Information acquisition method and device of application program, electronic equipment and storage medium
By obtaining and parsing the system description file in the application installation package, users can obtain application information before downloading, solve the problems of resource waste and download errors, improve download efficiency and ensure device security.
Patent Information
- Application Number
- CN202310947021.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-28
- Publication Date
- 2025-02-14
AI Technical Summary
In the prior art, users are unable to obtain application information before downloading application installation packages, resulting in the risk of resource waste and download errors.
By sending the installation package download request of the target application to the server, obtaining the system description file in the installation package, parsing the system description file to obtain the application's key description information, and determining whether to continue downloading the installation package.
Users can obtain application information before downloading the installation package, avoid resource waste and download errors, improve download efficiency and ensure device safety.
Smart Images

Figure CN119440551A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, device, electronic device and storage medium for obtaining information from an application. Background Art
[0002] In the prior art, users cannot obtain information about the application, such as the application name, before downloading the application installation package. The application information can only be obtained when the application installation package is completely downloaded and parsed, which takes up storage space of the electronic device and causes a waste of resources. Summary of the invention
[0003] The present application provides an application information acquisition method, device, electronic device, computer-readable storage medium and computer program product to solve the problem that the information of the installation package cannot be analyzed while consuming less traffic. The technical solution of the present application is as follows:
[0004] According to a first aspect of an embodiment of the present application, a method for obtaining application information is provided, comprising: sending a download request for an installation package of a target application to a server; obtaining a system description file in the installation package, wherein the system description file is used to describe the target application; and obtaining key description information of the target application based on the system description file, wherein the key description information is used to determine whether to continue downloading the installation package.
[0005] In one embodiment of the present application, the pre-acquisition of the system description file in the installation package includes: acquiring the tail data of the installation package, the tail data including the tail data in the central directory file area; determining the address information of the system description file according to the central directory file area; based on the address information of the system description file, requesting the system description file from the server, and receiving the system description file sent by the server.
[0006] In one embodiment of the present application, obtaining the tail data of the installation package includes: sending a first HTTP request for the installation package to the server, and receiving the size and / or address information of the installation package returned by the server; based on the size and / or address information of the installation package, sending a second HTTP to the server, requesting that the second HTTP request be used to request the tail data.
[0007] In one embodiment of the present application, the first HTTP request for sending the installation package to the server includes: generating a Hypertext Transfer Protocol HTTP header request, and sending the HTTP header request to the server, wherein the HTTP header request is used to determine whether the server supports segmented downloading; receiving a response message sent by the server, and judging whether the server supports segmented downloading based on the response message; if the server supports the segmented downloading, sending the first HTTP request to the server.
[0008] In one embodiment of the present application, determining the address information of the system description file based on the central directory file area includes: traversing multiple file headers included in the central directory file area; if the file identifier carried in the currently traversed file header is the file identifier of the system description file, stopping the traversal of the next file header; parsing the target bytes in the currently traversed file header to obtain the address information of the system description file.
[0009] In one embodiment of the present application, determining the address information of the system description file based on the central directory file area also includes: determining the size of the tail data as the actual first area size of the downloaded central directory file area; obtaining the end identifier of the central directory file area based on the last byte of the tail data, and determining the marked second area size of the central directory file area based on the end identifier; performing legitimacy verification on the central directory file area based on the first area size and the second area size; after the central directory file area passes the legitimacy verification, determining the address information of the system description file based on the data of the central directory file area.
[0010] In one embodiment of the present application, the legitimacy of the central directory file area is verified based on the first area size and the second area size, including: if the first area size is greater than or equal to the second area size, determining that the central directory file area has passed the legitimacy verification; if the first area size is less than the second area size, determining that the central directory file area has not passed the legitimacy verification, and stopping subsequent operations.
[0011] In one embodiment of the present application, the method also includes: if the size of the first area is larger than the size of the second area, determining the starting position and the ending position of the central directory file area according to the end mark of the central directory file area; and intercepting the central directory file area from the tail data according to the starting position and the ending position of the central directory file area.
[0012] In one embodiment of the present application, based on the size and / or address information of the installation package, a second HTTP request is sent to the server, and the second HTTP request is used to request the tail data, including: based on the size and / or address information of the installation package, adding a request header carrying the address range of the tail data in the HTTP get request to obtain a second HTTP request; sending the second HTTP request to the server, and receiving the tail data sent by the server.
[0013] In one embodiment of the present application, obtaining key description information of the target application according to the system description file includes: extracting a string block and an extensible markup language XML content block from the system description file; parsing the string block and the XML content block to obtain the key description information.
[0014] In one embodiment of the present application, extracting the string block and the extensible markup language XML content block from the system description file includes: decompressing the system description file according to the compression method of the installation package to obtain a first system description file; performing XML decompression on the first system description file to obtain a second system description file; and obtaining the string block and the XML content block from the second system description file.
[0015] According to a second aspect of an embodiment of the present application, another method for obtaining information of an application is provided, comprising: receiving a second HTTP request sent by an electronic device before downloading an installation package of a target application; sending tail data of the installation package to the electronic device; wherein the second HTTP request is used to obtain the tail data, and the tail data includes part or all of the data in the central directory file area of the installation package, and the central directory file area is used for a system description file of the target application, and the system description file includes key description information of the target application, and the key description information is used to determine whether to continue downloading the installation package.
[0016] In one embodiment of the present application, after sending the tail data of the installation package to the electronic device, the method further includes: receiving a third HTTP request for the system description file sent by the electronic device; and sending the system description file to the electronic device.
[0017] In one embodiment of the present application, the receiving device sends a second HTTP request before downloading the installation package of the target application, including: receiving a first HTTP request for the installation package sent by the electronic device, and sending the size and / or address information of the installation package to the electronic device; receiving the second HTTP request sent by the electronic device based on the size and / or address information of the installation package.
[0018] In one embodiment of the present application, before receiving the first HTTP request for the installation package sent by the electronic device, it also includes: receiving an HTTP header request sent by the electronic device to the server, the HTTP header request being used to determine whether the server supports segmented downloading; and sending a response message to the electronic device, the response message being used to indicate whether the server supports segmented downloading.
[0019] According to the third aspect of an embodiment of the present application, a device for obtaining information of an application is provided, comprising: a sending module for sending a download request for an installation package of a target application to a server; a first obtaining module for obtaining a system description file in the installation package, wherein the system description file is used to describe the target application; and a second obtaining module for obtaining key description information of the target application based on the system description file, wherein the key description information is used to determine whether to continue downloading the installation package.
[0020] According to the fourth aspect of an embodiment of the present application, another application information acquisition device is provided, including: a receiving module, used to receive a second HTTP request sent by an electronic device before downloading an installation package of a target application; a sending module, used to send tail data of the installation package to the electronic device; wherein the second HTTP request is used to obtain the tail data, and the tail data includes part or all of the data in the central directory file area of the installation package, and the central directory file area is used for the system description file of the target application, and the system description file includes key description information of the target application, and the key description information is used to determine whether to continue downloading the installation package.
[0021] According to the fifth aspect of the embodiments of the present application, there is provided an electronic device, comprising a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to implement the steps of the method of the first aspect of the embodiments of the present application.
[0022] According to the sixth aspect of the embodiments of the present application, a computer-readable storage medium is provided, on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the method of the first aspect of the embodiments of the present application are implemented.
[0023] According to the seventh aspect of the embodiments of the present application, a computer program product is provided, including a computer program, characterized in that when the computer program is executed by a processor of an electronic device, the steps of the method of the first aspect of the embodiments of the present application are implemented.
[0024] The technical solution provided by the embodiment of the present application brings at least the following beneficial effects: the electronic device can determine the key description information of the target application by obtaining the system description file in the installation package of the target application. When the user downloads the installation package, he can judge whether to continue downloading the installation package based on the key description information, avoid downloading the wrong application, and effectively help the user improve the efficiency of downloading applications. At the same time, it also avoids downloading risky applications and ensures the safety of the user's device.
[0025] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the application.
[0027] Figure 1 The present invention is a flowchart of a method for obtaining information of an application program according to an exemplary embodiment.
[0028] Figure 2 The figure is a schematic diagram showing a format of an application installation package according to an exemplary embodiment.
[0029] Figure 3 The figure is a schematic diagram showing the format of a central directory file area according to an exemplary embodiment.
[0030] Figure 4 The present invention is a flowchart of a method for obtaining information of an application program according to another exemplary embodiment.
[0031] Figure 5 The present invention is a flowchart of a method for obtaining information of an application program according to another exemplary embodiment.
[0032] Figure 6 The present invention is a flowchart of a method for obtaining information of an application program according to another exemplary embodiment.
[0033] Figure 7 The present invention is a flowchart of a method for obtaining information of an application program according to another exemplary embodiment.
[0034] Figure 8 The figure is a schematic diagram showing the format of a central directory file area end record according to an exemplary embodiment.
[0035] Fig. 9 The present invention is a flowchart of a method for obtaining information of an application program according to another exemplary embodiment.
[0036] Fig.10The present invention is a flowchart of a method for obtaining information of an application program according to another exemplary embodiment.
[0037] Fig.11 The figure is a flowchart of obtaining information of an application program according to an exemplary embodiment.
[0038] Fig.12 The diagram is an interactive diagram of a method for obtaining information of an application program according to an exemplary embodiment.
[0039] Fig.13 The invention is a structural block diagram of a device for acquiring information of an application program according to an exemplary embodiment.
[0040] Fig.14 The invention is a structural block diagram of a device for acquiring information of an application program according to an exemplary embodiment.
[0041] Fig.15 It is a block diagram of an electronic device according to an exemplary embodiment.
[0042] Fig.16 It is a structural block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0043] In order to enable ordinary persons in the art to better understand the technical solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0044] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0045] The acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0046] Figure 1 is a flowchart of a method for obtaining information of an application program according to an exemplary embodiment. Figure 1 As shown, the method for obtaining information of an application program in an embodiment of the present application includes but is not limited to the following steps:
[0047] S101, sending a download request for an installation package of a target application to a server.
[0048] It should be noted that the execution subject of the information acquisition method of the application provided in the embodiment of the present application is an electronic device and a server, and the electronic device can be a terminal device. Optionally, the terminal device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and the non-mobile electronic device can be a network attached storage (Network Attached Storage, NAS), a personal computer (personalcomputer, PC), a television (television, TV), a teller machine or a self-service machine, etc. Optionally, the server can be a cloud server, a server of a distributed system, or a server combined with a blockchain, etc. The embodiment of the present application is not specifically limited.
[0049] In some implementations, the electronic device may generate a Hypertext Transfer Protocol (HTTP) request for downloading an installation package of a target application based on the HTTP protocol, and send the download request to a server.
[0050] S102, obtaining a system description file in the installation package, wherein the system description file is used to describe the target application.
[0051] It is understandable that the installation package of the target application is a compressed file used to install the target application on the electronic device, and the installation package contains file information such as the program file and configuration file of the target application. In the installation package, each file is arranged in a set order starting from the file header, wherein the central directory file area is located at the tail area of the installation package, and the central directory file area can indicate the address information of the system description file.
[0052] In some implementations, after the electronic device sends a download request to the server, it can pre-acquire the system description file in the target application installation package, that is, before downloading the installation package, it can pre-acquire the system description file in the installation package.
[0053] In some implementations, the tail data of the installation package, that is, the data in the central directory file area, can be obtained from the installation package of the target application. Based on the data in the central directory file area, the address information of the system description file can be determined, and then the system description file can be obtained according to the address information. The system description file is used to describe the target application.
[0054] For example, Figure 2 As shown in the standard installation package file format, all files are arranged one by one starting from the file header. At the end of the installation package, there is a Central directory file area, which contains descriptions of all files. Figure 3 The format of the central directory file area is shown. The central directory file area can be parsed to obtain the location of the installation package where the system description file is located, and then the system description file can be obtained.
[0055] S103, obtaining key description information of the target application according to the system description file, where the key description information is used to determine whether to continue downloading the installation package.
[0056] In some implementations, the system description file may be decompressed and a string block and an extensible markup language XML content block may be extracted from the decompressed system description file, wherein the string block stores the key description information and the XML content block describes the location where the key description information is stored in the string block.
[0057] In some implementations, by parsing the XML content block, the location where the key description information of the target application is stored in the string block can be obtained. Then, the string block is parsed to obtain the key description information. The key description information includes, but is not limited to: the package name of the installation package of the target application, the name of the target application, the version of the target application, and other information.
[0058] Furthermore, the user can determine whether the target application is needed based on the key description information of the target application, and then determine whether to continue downloading the installation package. The user does not need to download the installation package in its entirety to determine the information of the installation package, saving the time of downloading the installation package. Optionally, the user can determine whether the target application is needed based on the package name of the installation package and the name of the target application, and can determine whether the target application version is needed based on the version of the target application.
[0059] Optionally, if the user determines to continue downloading the installation package, the electronic device can feedback a continue download instruction to the server, and the installation package can continue to be downloaded. If the user determines not to download the installation package anymore, the electronic device can feedback a stop download instruction to the server, or the server does not receive the instruction information feedback from the electronic device after waiting for a set period of time, and does not send the installation package to the electronic device, thereby achieving the purpose of stopping the download.
[0060] In the application information acquisition method provided in the embodiment of the present application, the electronic device can determine the key description information of the target application by acquiring the system description file in the installation package of the target application. When the user downloads the installation package, he can judge whether to continue downloading the installation package based on the key description information, avoid downloading the wrong application, and effectively help the user improve the efficiency of downloading applications. At the same time, it also avoids downloading risky applications and ensures the safety of the user's device.
[0061] Figure 4 is a flowchart of a method for obtaining information of an application program according to an exemplary embodiment. Figure 4 As shown, the method for obtaining information of an application program in an embodiment of the present application includes but is not limited to the following steps:
[0062] S401, obtaining tail data of the installation package, where the tail data includes data in the central directory file area.
[0063] In some implementations, the tail data of the installation package includes data in the central directory file area. Optionally, the data in the central directory file area of the installation package can be obtained by sending an HTTP request to the server. Optionally, the HTTP request can obtain part of the data in the central directory file area from the tail data of the installation package, or can obtain all the data in the central directory file area from the tail data of the installation package.
[0064] Optionally, the size and / or address information of the installation package may be obtained by sending a first HTTP request to the server, and then based on the size and / or address information of the installation package, a second HTTP request may be sent to the server to obtain the tail data of the installation package.
[0065] S402: Determine the address information of the system description file according to the central directory file area.
[0066] In some implementations, before determining the address information of the system description file from the central directory file area, the legitimacy of the central directory file area needs to be verified. After determining that the central directory file area is legitimate, the central directory file area can be traversed to determine the address information of the system description file from multiple file headers.
[0067] It is understandable that the central directory file area is composed of multiple file headers, which contain description information of all files, including but not limited to address information of the system description file. Optionally, the file header where the address information of the system description file is located can be determined based on the file identifier of the system description file, and the address information of the system description file can be obtained by parsing the file header.
[0068] S403: Request the system description file from the server based on the address information of the system description file, and receive the system description file sent by the server.
[0069] In some implementations, a third HTTP request may be sent to the server to request the server to send the system description file. Optionally, based on the address information of the system description file, a request header carrying the address range of the system description file may be included in the HTTP acquisition request to obtain the third HTTP request. Further, the third HTTP request may be sent to the server, and the system description file sent by the server may be received.
[0070] S404, obtaining key description information of the target application according to the system description file, where the key description information is used to determine whether to continue downloading the installation package.
[0071] In the embodiment of the present application, the implementation method of step S404 can be implemented by any method in the embodiments of the present application, which is not limited here and will not be repeated.
[0072] In the application information acquisition method provided in the embodiment of the present application, the electronic device can determine the address information of the system description file and then determine the system description file by obtaining the central directory file area in the installation package of the target application. Based on the system description file, the key description information of the target application can be determined. When the user downloads the installation package, the user can determine whether to continue downloading the installation package based on the key description information, avoid downloading the wrong application, and effectively help the user improve the efficiency of downloading applications. At the same time, it also avoids downloading risky applications and ensures the safety of the user's device.
[0073] Figure 5 is a flowchart of a method for obtaining information of an application program according to an exemplary embodiment. Figure 5 As shown, the method for obtaining information of an application program in an embodiment of the present application includes but is not limited to the following steps:
[0074] S501, sending a first HTTP request for an installation package to a server, and receiving size and / or address information of the installation package returned by the server.
[0075] It is understandable that most of the installation packages of applications are downloaded through a server. By determining that the server supports segmented downloading, the tail data of the installation package can be obtained instead of the installation package of the entire application.
[0076] In some implementations, an HTTP header request may be used to verify whether the server supports segmented downloading. Optionally, a Hypertext Transfer Protocol (HTTP) header request is generated and sent to the server, wherein the HTTP header request is used to determine whether the server supports segmented downloading.
[0077] Further, a response message sent by the server is received, and based on the response message, it is determined whether the server supports segmented downloading. For example, if the value of the accept range "Accept-Ranges" in the response message is "bytes" and the HTTP status code is 206, it is determined that the server supports segmented downloading.
[0078] In some implementations, if it is determined that the server supports segmented downloading, a first HTTP request is sent to the server to obtain the size and / or address information of the installation package.
[0079] S502: Based on the size and / or address information of the installation package, a second HTTP request is sent to the server, where the second HTTP request is used to request tail data.
[0080] In some implementations, the address range of the tail data can be determined based on the size and / or address information of the installation package. By adding a request header carrying the address range of the tail data to the HTTP get request, a second HTTP request is obtained, and the second HTTP request is sent to the server to request the tail data of the installation package.
[0081] Furthermore, the tail data of the installation package sent by the server may be received, wherein the tail data includes part or all of the data in the central directory file area.
[0082] S503: Determine the address information of the system description file according to the central directory file area.
[0083] In the embodiment of the present application, the implementation method of step S503 can be implemented by any method in the embodiments of the present application, which is not limited here and will not be repeated.
[0084] S504: Request the system description file from the server based on the address information of the system description file, and receive the system description file sent by the server.
[0085] In the embodiment of the present application, the implementation method of step S504 can be implemented by any method in the embodiments of the present application, which is not limited here and will not be repeated.
[0086] S505, obtaining key description information of the target application according to the system description file, where the key description information is used to determine whether to continue downloading the installation package.
[0087] In the embodiment of the present application, the implementation method of step S505 can be implemented by any method in the embodiments of the present application, which is not limited here and will not be repeated.
[0088] In the application information acquisition method provided in the embodiment of the present application, the electronic device can determine the address information of the system description file and then determine the system description file by obtaining the central directory file area in the installation package of the target application. Based on the system description file, the key description information of the target application can be determined. When the user downloads the installation package, the user can determine whether to continue downloading the installation package based on the key description information, avoid downloading the wrong application, and effectively help the user improve the efficiency of downloading applications. At the same time, it also avoids downloading risky applications and ensures the safety of the user's device.
[0089] Figure 6 is a flowchart of a method for obtaining information of an application program according to an exemplary embodiment. Figure 6 As shown, the method for obtaining information of an application program in an embodiment of the present application includes but is not limited to the following steps:
[0090] S601 obtains the tail data of the installation package, where the tail data includes data in the central directory file area.
[0091] In the embodiment of the present application, the implementation method of step S601 can be implemented by any method in the embodiments of the present application, which is not limited here and will not be repeated.
[0092] S602, traverse multiple file headers included in the central directory file area.
[0093] In some implementations, the central directory file area contains a file header describing all the files in the installation package, such as Figure 3 As shown, the central directory file area includes file headers such as file header 1, file header 2, ..., file header n, and a central directory file area end record, etc. Each file header corresponds to a file in the installation package one by one.
[0094] Optionally, multiple file headers may be traversed from the starting position of the central directory file area, and each file header may be read to obtain a file identifier of the file header, wherein the file identifier may be a file name or a file path.
[0095] S603: If the file identifier carried in the currently traversed file header is the file identifier of the system description file, stop traversing the next file header.
[0096] In some implementations, during the traversal process, it can be determined based on the read file identifier whether the file identifier carried in the header of the currently traversed file is the file identifier of the system description file.
[0097] Optionally, the file identifier carried in the file header can be matched with the file identifier of the system description file. If the match is successful, the file identifier carried in the currently traversed file header is determined to be the file identifier of the system description file, and the traversal of the next file header is stopped.
[0098] Optionally, if the match is unsuccessful, it is determined that the file identifier carried in the currently traversed file header is not the file identifier of the system description file, and then the traversal of the next file header is continued until it is determined that the file identifier carried in the file header is the file identifier of the system description file, and the traversal of the next file header is stopped.
[0099] S604, parsing the target bytes in the currently traversed file header to obtain address information of the system description file.
[0100] In some implementations, the file header includes information such as the file name, file size, and target bytes. By parsing the target bytes in the currently traversed file header, the address information of the system description file can be obtained. Optionally, the target bytes can be parsed according to the format of the file header to obtain the offset of the system description file, and the difference between the starting position of the system description file and the central directory file area can be determined based on the offset, thereby obtaining the address information of the system description file.
[0101] It is understood that the offset of the system description file can be an integer value, indicating how many units (such as bytes) need to be moved from the starting position to reach the position of the system description file. A positive offset indicates that the system description file is on the right side of the starting position, and a negative offset indicates that the system description file is on the left side of the starting position.
[0102] S605: Request the system description file from the server based on the address information of the system description file, and receive the system description file sent by the server.
[0103] In the embodiment of the present application, the implementation method of step S605 can be implemented by any method in the embodiments of the present application, which is not limited here and will not be repeated.
[0104] S606, obtaining key description information of the target application according to the system description file, where the key description information is used to determine whether to continue downloading the installation package.
[0105] In the embodiment of the present application, the implementation method of step S606 can be implemented by any method in the various embodiments of the present application, which is not limited here and will not be repeated.
[0106] In the application information acquisition method provided in the embodiment of the present application, the electronic device obtains the central directory file area in the installation package of the target application, and by traversing the central directory file area, it can determine the address information of the system description file, and then determine the system description file. Based on the system description file, the key description information of the target application can be determined. When the user downloads the installation package, the user can determine whether to continue downloading the installation package based on the key description information, avoid downloading the wrong application, and effectively help the user improve the efficiency of downloading applications. At the same time, it also avoids downloading risky applications and ensures the safety of the user's device.
[0107] Figure 7 is a flowchart of a method for obtaining information of an application program according to an exemplary embodiment. Figure 7 As shown, the method for obtaining information of an application program in an embodiment of the present application includes but is not limited to the following steps:
[0108] S701, obtaining tail data of the installation package, where the tail data includes data in the central directory file area.
[0109] In the embodiment of the present application, the implementation method of step S701 can be implemented by any method in the embodiments of the present application, which is not limited here and will not be repeated.
[0110] S702, determining the size of the tail data as the actual first area size of the downloaded central directory file area.
[0111] It is understandable that when the electronic device requests the server to obtain the tail data of the installation package, the tail data sent by the server may be incomplete, that is, part of the data in the central directory file area is obtained. It is possible to determine whether the tail data is complete, that is, whether the central directory file area has passed the legality verification, based on the size of the tail data downloaded by the electronic device and the size of the tail data identifier.
[0112] In some implementations, the tail data size downloaded by the electronic device, that is, the data size of the downloaded central directory file area, can be used as the actual first area size of the central directory file area.
[0113] S703, based on the last byte of the tail data, obtain an end mark of the central directory file area, and determine the size of the second area marked in the central directory file area based on the end mark.
[0114] It can be understood that there is an end record of the central directory file area in the central directory file area, which is located at the end of the central directory file area, such as Figure 3 The "End of Central Directory Record" shown here is used to describe the size of the central directory file area.
[0115] In some implementations, the end marker of the central directory file area can be obtained by reading the last byte of the tail data of the installation package, that is, the last byte of the central directory file area. The starting position and the end position of the central directory file area can be determined based on the end marker, and then the size of the central directory file area can be determined as the second area size.
[0116] For example, Figure 8 In the schematic diagram of the end record of the central directory file area shown, the size of the central directory file area described can be determined to be located at the byte "\0xc\0xd\0xe\0xf" according to the end mark, and then the starting position and the end position of the central directory file area can be determined to obtain the second area size.
[0117] S704: Verify the validity of the central directory file area according to the first area size and the second area size.
[0118] Optionally, if the first area size is greater than or equal to the second area size, it is determined that the central directory file area has passed the legality verification. If the first area size is less than the second area size, it is determined that the central directory file area has not passed the legality verification, and subsequent operations are stopped.
[0119] For example, assume that the size of the installation package is 100 bytes, identified as 0-99. If the size of the second area of the central directory file area is 10 bytes, identified as 89-99, and the size of the downloaded first area is 20 bytes, identified as 79-99, the size of the first area is larger than the size of the second area, indicating that the central directory file area has been completely downloaded and has passed the legitimacy verification.
[0120] If the size of the second area of the central directory file area is 30 bytes, marked as 69-99, and the size of the downloaded first area is 20 bytes, marked as 79-99, and the size of the first area is smaller than the size of the second area, it means that only part of the data of the central directory file area has been downloaded, and the central directory file area cannot pass the legitimacy verification, then subsequent operations are stopped.
[0121] In some implementations, if the size of the first region is larger than the size of the second region, the start position and the end position of the central directory file region can be determined according to the end mark of the central directory file region, and then the central directory file region is intercepted from the tail data according to the start position and the end position of the central directory file region.
[0122] S705, after the central directory file area passes the legality verification, determine the address information of the system description file according to the data in the central directory file area.
[0123] In some implementations, if the central directory file area passes the validity verification, it means that the central directory file area is completely downloaded, and then the address information of the system description file can be obtained from the central directory file area.
[0124] Optionally, multiple file headers included in the central directory file area may be traversed, and according to the file identifier of the system description file, it is determined whether the file identifier carried in the currently traversed file header is the file identifier of the system description file.
[0125] Furthermore, if it is determined that the file identifier carried in the currently traversed file header is the file identifier of the system description file, the traversal of the next file header is stopped, and the target byte in the currently traversed file header is parsed to obtain the address information of the system description file.
[0126] S706: Request the system description file from the server based on the address information of the system description file, and receive the system description file sent by the server.
[0127] In the embodiment of the present application, the implementation method of step S706 can be implemented by any method in the embodiments of the present application, which is not limited here and will not be repeated.
[0128] S707, obtaining key description information of the target application according to the system description file, where the key description information is used to determine whether to continue downloading the installation package.
[0129] In the embodiment of the present application, the implementation method of step S707 can be implemented by any method in the embodiments of the present application, which is not limited here and will not be repeated.
[0130] In the application information acquisition method provided in the embodiment of the present application, the electronic device can determine the address information of the system description file and then determine the system description file by obtaining the central directory file area in the installation package of the target application and verifying the legitimacy of the central directory file area. Based on the system description file, the key description information of the target application can be determined. When the user downloads the installation package, the user can determine whether to continue downloading the installation package based on the key description information to avoid downloading the wrong application, which effectively helps the user improve the efficiency of downloading applications. At the same time, it also avoids downloading risky applications and ensures the safety of the user's device.
[0131] Fig. 9 is a flowchart of a method for obtaining information of an application program according to an exemplary embodiment. Fig. 9 As shown, the method for obtaining information of an application program in an embodiment of the present application includes but is not limited to the following steps:
[0132] S901, sending a download request for the installation package of the target application to the server.
[0133] In the embodiment of the present application, the implementation method of step S901 can be implemented by any method in the embodiments of the present application, which is not limited here and will not be repeated.
[0134] S902: Obtain a system description file in the installation package, wherein the system description file is used to describe the target application.
[0135] In the embodiment of the present application, the implementation method of step S902 can be implemented by any method in the embodiments of the present application, which is not limited here and will not be repeated.
[0136] S903, extracting a character string block and an extensible markup language XML content block from the system description file.
[0137] It is understandable that there is a large compression space for the system description file. Therefore, by compressing the system description file for the first time, the file format of the system description file in Extensible Markup Language (XML) can be obtained, and then a second compression can be performed according to the compression method of the installation package to obtain the installation package of the target application.
[0138] Optionally, the system description file may be decompressed in a compression mode of the installation package to obtain a first system description file, and then the first system description file is decompressed in XML to obtain a second system description file, and the string block and the XML content block are obtained from the second system description file.
[0139] Optionally, the start and end positions of the string block and the start and end positions of the XML content block may be determined from the second system description file according to their identifiers, and then the string block and the XML content block may be extracted.
[0140] S904, parse the string block and the XML content block to obtain key description information.
[0141] It is understandable that the key description information is stored in the string block, and the XML content block describes the location of the node or attribute value of the system description file, that is, the location where the key description information is stored in the string block. Among them, the key description information is used to determine whether to continue downloading the installation package.
[0142] In some implementations, the string block and the XML content block can be parsed, the position of the key description information in the string block can be obtained from the XML content block, and then the key description information of the target application can be obtained from the string block according to the position. The key description information includes, but is not limited to: the package name of the installation package of the target application, the name of the target application, the version of the target application, and other information.
[0143] Optionally, a string segmentation function may be used to parse the string block; and XML parsing may be used to parse the XML content block.
[0144] In the application information acquisition method provided in the embodiment of the present application, the electronic device obtains the system description file in the installation package of the target application and decompresses the system description file to obtain the string block and the XML content block, thereby obtaining the key description information of the target application. When the user downloads the installation package, he can judge whether to continue downloading the installation package based on the key description information, avoid downloading the wrong application, and effectively help the user improve the efficiency of downloading applications. At the same time, it also avoids downloading risky applications and ensures the safety of the user's device.
[0145] Fig.10 is a flowchart of a method for obtaining information of an application program according to an exemplary embodiment. Fig.10 As shown, the method for obtaining information of an application program in an embodiment of the present application includes but is not limited to the following steps:
[0146] S1001, receiving a second HTTP request sent by the electronic device before downloading the installation package of the target application.
[0147] In some implementations, the server can generate a response message by receiving an HTTP header request sent by the electronic device to the server, where the HTTP header request is used to determine whether the server supports segmented downloading, and then the server sends a response message to the electronic device, where the response message is used to indicate whether the server supports segmented downloading, and the response message includes the server's acceptance range and HTTP status code.
[0148] In some implementations, the server receives a first HTTP request for an installation package sent by an electronic device, and sends the size and / or address information of the installation package to the electronic device. Then, a second HTTP request sent by the electronic device based on the size and / or address information of the installation package may be received. The first HTTP request is used to obtain the size and / or address information of the installation package.
[0149] S1002, sending the tail data of the installation package to the electronic device.
[0150] In some implementations, by receiving the second HTTP request sent by the electronic device, the tail data of the installation package can be determined, and the tail data of the installation package can be sent to the electronic device.
[0151] It can be understood that the second HTTP request is used to obtain tail data, which includes data in the central directory file area of the installation package. The central directory file area is used for the system description file of the target application. The system description file includes key description information of the target application. The key description information is used to determine whether to continue downloading the installation package.
[0152] Optionally, the server may send partial data of the central directory file area to the electronic device, or may send all data of the central directory file area to the electronic device, wherein all data indicates that the central directory file area can pass the legality verification, and partial data indicates that the central directory file area cannot pass the legality verification.
[0153] In some implementations, the server may also send the system description file to the electronic device by receiving a third HTTP request for the system description file sent by the electronic device, wherein the third HTTP request is used to obtain the system description file.
[0154] In the application information acquisition method provided in the embodiment of the present application, the server sends the tail data of the installation package to the electronic device by receiving the second HTTP request sent by the electronic device. The system description file is sent to the electronic device by receiving the third HTTP request sent by the electronic device. The electronic device receives the system description file in the installation package of the target application and decompresses the system description file to obtain a string block and an XML content block, thereby obtaining key description information of the target application. When downloading the installation package, the user can determine whether to continue downloading the installation package based on the key description information to avoid downloading the wrong application, which effectively helps the user improve the efficiency of downloading applications. At the same time, it also avoids downloading risky applications and ensures the safety of the user's device.
[0155] like Fig.11 In the flowchart of obtaining application information shown, the size and / or address information of the installation package is first obtained through the first HTTP request. Based on the size and / or address information of the installation package, the tail data of the installation package is obtained through the second HTTP request, that is, part or all of the data in the central directory file area is obtained. Then, the address information of the system description file is obtained from the central directory file area, and the system description file is obtained through the third HTTP request. The string block and the XML content block can be extracted from the system description file to obtain the key description information of the installation package. The user can determine whether the installation package is the target application based on the key description information. If it is determined that the installation package is not the target application, the process is terminated. If it is determined that the installation package is the target application, subsequent operations are performed, such as downloading and installing the installation package.
[0156] Fig.12 is an interactive schematic diagram of a method for obtaining information of an application program according to an exemplary embodiment. Fig.12 As shown, the method for obtaining information of an application program in an embodiment of the present application includes but is not limited to the following steps:
[0157] S1201, the electronic device sends an HTTP header request to the server.
[0158] S1202, the server receives an HTTP header request sent by the electronic device to the server, and generates a response message.
[0159] S1203, the server sends a response message to the electronic device.
[0160] S1204, the electronic device receives a response message sent by the server and determines that the server supports segmented downloading.
[0161] S1205, the electronic device sends a first HTTP request to the server.
[0162] S1206: The server sends the size and / or address information of the installation package to the electronic device.
[0163] S1207, the electronic device sends a second HTTP request to the server.
[0164] S1208, the server sends the tail data of the installation package to the electronic device.
[0165] S1209, the electronic device sends a third HTTP request for a system description file to the server.
[0166] S1210: The server sends a system description file to the electronic device.
[0167] S1211, the electronic device obtains key description information of the target application according to the system description file.
[0168] In the application information acquisition method provided in the embodiment of the present application, the server determines that the server supports segmented downloading by receiving an HTTP header request. By receiving a second HTTP request sent by the electronic device, the tail data of the installation package is sent to the electronic device. By receiving a third HTTP request sent by the electronic device, the system description file is sent to the electronic device. The electronic device receives the system description file in the installation package of the target application and decompresses the system description file to obtain a string block and an XML content block, thereby obtaining key description information of the target application. When downloading the installation package, the user can determine whether to continue downloading the installation package based on the key description information to avoid downloading the wrong application, effectively helping the user improve the efficiency of downloading applications. At the same time, it also avoids downloading risky applications and ensures the safety of the user's device.
[0169] Fig.13 is a structural block diagram of an information acquisition device for an application according to an exemplary embodiment. Fig.13 The application information acquisition device 1300 according to the embodiment of the present application includes: a sending module 1301 , a first acquisition module 1302 , and a second acquisition module 1303 .
[0170] The sending module 1301 is used to send a download request for the installation package of the target application to the server.
[0171] The first acquisition module 1302 is used to acquire a system description file in the installation package, wherein the system description file is used to describe the target application.
[0172] The second acquisition module 1303 is used to acquire key description information of the target application according to the system description file, and the key description information is used to determine whether to continue downloading the installation package.
[0173] In one embodiment of the present application, the first acquisition module 1302 is also used to: obtain the tail data of the installation package, the tail data including the data in the central directory file area; determine the address information of the system description file according to the central directory file area; based on the address information of the system description file, request the system description file from the server, and receive the system description file sent by the server.
[0174] In one embodiment of the present application, the first acquisition module 1302 is also used to: send a first HTTP request for the installation package to the server, and receive the size and / or address information of the installation package returned by the server; based on the size and / or address information of the installation package, send a second HTTP request to the server, and the second HTTP request is used to request the tail data.
[0175] In one embodiment of the present application, the first acquisition module 1302 is also used to: generate a Hypertext Transfer Protocol HTTP header request and send the HTTP header request to the server, wherein the HTTP header request is used to determine whether the server supports segmented downloading; receive a response message sent by the server, and determine whether the server supports segmented downloading based on the response message; if the server supports the segmented downloading, send the first HTTP request to the server.
[0176] In one embodiment of the present application, the first acquisition module 1302 is also used to: traverse the multiple file headers included in the central directory file area; if the file identifier carried in the currently traversed file header is the file identifier of the system description file, stop traversing the next file header; parse the target bytes in the currently traversed file header to obtain the address information of the system description file.
[0177] In one embodiment of the present application, the first acquisition module 1302 is also used to: determine the size of the tail data as the actual first area size of the downloaded central directory file area; obtain the end mark of the central directory file area based on the last byte of the tail data, and determine the marked second area size of the central directory file area based on the end mark; verify the legitimacy of the central directory file area based on the first area size and the second area size; after the central directory file area passes the legitimacy verification, determine the address information of the system description file based on the data of the central directory file area.
[0178] In one embodiment of the present application, the first acquisition module 1302 is also used to: if the first area size is greater than or equal to the second area size, determine that the central directory file area has passed the legitimacy verification; if the first area size is smaller than the second area size, determine that the central directory file area has not passed the legitimacy verification and stop subsequent operations.
[0179] In one embodiment of the present application, the first acquisition module 1302 is also used to: if the size of the first area is larger than the size of the second area, determine the starting position and the ending position of the central directory file area according to the end mark of the central directory file area; and intercept the central directory file area from the tail data according to the starting position and the ending position of the central directory file area.
[0180] In one embodiment of the present application, the first acquisition module 1302 is also used to: based on the size and / or address information of the installation package, add a request header carrying the address range of tail data in the HTTP acquisition request to obtain a second HTTP request; send the second HTTP request to the server, and receive the tail data sent by the server.
[0181] In one embodiment of the present application, the second acquisition module 1303 is further used to: extract a string block and an extensible markup language XML content block from the system description file; and parse the string block and the XML content block to obtain the key description information.
[0182] In one embodiment of the present application, the second acquisition module 1303 is further used to: decompress the system description file according to the compression method of the installation package to obtain a first system description file; perform XML decompression on the first system description file to obtain a second system description file; and obtain the string block and the XML content block from the second system description file.
[0183] In the application information acquisition method provided in the embodiment of the present application, the electronic device obtains the system description file in the installation package of the target application and decompresses the system description file to obtain the string block and the XML content block, thereby obtaining the key description information of the target application. When the user downloads the installation package, he can judge whether to continue downloading the installation package based on the key description information, avoid downloading the wrong application, and effectively help the user improve the efficiency of downloading applications. At the same time, it also avoids downloading risky applications and ensures the safety of the user's device.
[0184] Fig.14 is a structural block diagram of an information acquisition device for an application according to an exemplary embodiment. Fig.14The application information acquisition device 1400 of the embodiment of the present application includes: a receiving module 1401 and a sending module 1402 .
[0185] The receiving module 1401 is used to receive a second HTTP request sent by the electronic device before downloading the installation package of the target application.
[0186] The sending module 1402 is used to send the tail data of the installation package to the electronic device.
[0187] Among them, the second HTTP request is used to obtain the tail data, and the tail data includes part or all of the data in the central directory file area of the installation package. The central directory file area is used for the system description file of the target application. The system description file includes key description information of the target application. The key description information is used to determine whether to continue downloading the installation package.
[0188] In one embodiment of the present application, the sending module 1402 is further used to: receive a third HTTP request for the system description file sent by the electronic device; and send the system description file to the electronic device.
[0189] In one embodiment of the present application, the sending module 1402 is also used to: receive a first HTTP request for the installation package sent by the electronic device, and send the size and / or address information of the installation package to the electronic device; receive the second HTTP request sent by the electronic device based on the size and / or address information of the installation package.
[0190] In one embodiment of the present application, the sending module 1402 is also used to: receive an HTTP header request sent by the electronic device to the server, wherein the HTTP header request is used to determine whether the server supports segmented downloading; and send a response message to the electronic device, wherein the response message is used to indicate whether the server supports segmented downloading.
[0191] In the application information acquisition method provided in the embodiment of the present application, the server sends the tail data of the installation package to the electronic device by receiving the second HTTP request sent by the electronic device. The system description file is sent to the electronic device by receiving the third HTTP request sent by the electronic device. The electronic device receives the system description file in the installation package of the target application and decompresses the system description file to obtain a string block and an XML content block, thereby obtaining key description information of the target application. When downloading the installation package, the user can determine whether to continue downloading the installation package based on the key description information to avoid downloading the wrong application, which effectively helps the user improve the efficiency of downloading applications. At the same time, it also avoids downloading risky applications and ensures the safety of the user's device.
[0192] Fig.15 It is a block diagram of an electronic device according to an exemplary embodiment. Fig.15 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0193] like Fig.15 As shown, the electronic device 1500 includes a processor 1501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1502 or the program loaded from the memory 1506 to the random access memory (RAM) 1503. In the RAM 1503, various programs and data required for the operation of the electronic device 1500 are also stored. The processor 1501, the ROM 1502 and the RAM 1503 are connected to each other through a bus 1504. An input / output (I / O) interface 1505 is also connected to the bus 1504.
[0194] The following components are connected to the I / O interface 1505: a memory 1506 including a hard disk, etc.; and a communication part 1507 including a network interface card such as a local area network (LAN) card, a modem, etc., and the communication part 1507 performs communication processing via a network such as the Internet; a drive 1508 is also connected to the I / O interface 1505 as needed.
[0195] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1507. When the computer program is executed by the processor 1501, the above-mentioned functions defined in the method of the present application are executed.
[0196] In an exemplary embodiment, a storage medium including instructions is also provided, such as a memory including instructions, and the instructions can be executed by the processor 1501 of the electronic device 1500 to complete the above method. Optionally, the storage medium can be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0197] In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0198] Fig.16 It is a structural block diagram of an electronic device according to an exemplary embodiment. Fig.16 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present application. Fig.16 As shown, the electronic device 1600 includes a processor 1601 and a memory 1602. The memory 1602 is used to store program codes, and the processor 1601 is connected to the memory 1602 to read program codes from the memory 1602 to implement the information acquisition method of the application program in the above embodiment.
[0199] Optionally, the number of processors 1601 may be one or more.
[0200] Optionally, the electronic device may further include an interface 1603, and the number of the interface 1603 may be multiple. The interface 1603 may be connected to an application program and may receive data from an external device such as a sensor.
[0201] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0202] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for obtaining information of an application, characterized in that: Executed by an electronic device, the method includes: Send a download request for the installation package of the target application to the server; Obtaining a system description file in the installation package, wherein the system description file is used to describe the target application; According to the system description file, key description information of the target application is obtained, and the key description information is used to determine whether to continue downloading the installation package.
2. The method according to claim 1, characterized in that: The step of pre-obtaining the system description file in the installation package includes: Acquire tail data of the installation package, wherein the tail data includes data in a central directory file area; Determining address information of the system description file according to the central directory file area; Based on the address information of the system description file, the system description file is requested from a server, and the system description file sent by the server is received.
3. The method according to claim 2, characterized in that The step of obtaining the tail data of the installation package includes: Sending a first HTTP request for the installation package to the server, and receiving size and / or address information of the installation package returned by the server; Based on the size and / or address information of the installation package, a second HTTP request is sent to the server, where the second HTTP request is used to request the tail data.
4. The method according to claim 3, characterized in that: The step of sending a first HTTP request for the installation package to the server includes: Generate a Hypertext Transfer Protocol (HTTP) header request, and send the HTTP header request to a server, wherein the HTTP header request is used to determine whether the server supports segmented downloading; receiving a response message sent by the server, and determining whether the server supports segmented downloading based on the response message; If the server supports the segmented download, the first HTTP request is sent to the server.
5. The method according to claim 2, characterized in that: Determining the address information of the system description file according to the central directory file area includes: Traversing a plurality of file headers included in the central directory file area; If the file identifier carried in the currently traversed file header is the file identifier of the system description file, stop traversing the next file header; The target bytes in the currently traversed file header are parsed to obtain address information of the system description file.
6. The method according to claim 2, characterized in that The step of determining the address information of the system description file according to the central directory file area further comprises: Determine the size of the tail data as the actual first area size of the downloaded central directory file area; Based on the last byte of the tail data, acquiring an end mark of the central directory file area, and determining a size of a second area marked in the central directory file area based on the end mark; Performing legitimacy verification on the central directory file area according to the first area size and the second area size; After the central directory file area passes the legality verification, the address information of the system description file is determined according to the data in the central directory file area.
7. The method according to claim 6, characterized in that The step of verifying the legitimacy of the central directory file area according to the first area size and the second area size includes: If the size of the first area is greater than or equal to the size of the second area, determining that the central directory file area passes the legality verification; If the size of the first area is smaller than the size of the second area, it is determined that the central directory file area has not passed the legality verification, and subsequent operations are stopped.
8. The method according to claim 7, characterized in that The method further comprises: If the size of the first area is larger than the size of the second area, determining the starting position and the ending position of the central directory file area according to the end mark of the central directory file area; The central directory file area is intercepted from the tail data according to the starting position and the ending position of the central directory file area.
9. The method according to claim 2, characterized in that: The sending a second HTTP request to the server based on the size and / or address information of the installation package, wherein the second HTTP request is used to request the tail data, including: Based on the size and / or address information of the installation package, a request header carrying the address range of the tail data is added to the HTTP acquisition request to obtain a second HTTP request; Send the second HTTP request to the server, and receive the tail data sent by the server.
10. The method according to any one of claims 1 to 9, characterized in that The step of obtaining key description information of the target application according to the system description file includes: Extracting a string block and an extensible markup language XML content block from the system description file; The character string block and the XML content block are parsed to obtain the key description information.
11. The method according to claim 10, characterized in that The step of extracting a character string block and an extensible markup language XML content block from the system description file comprises: Decompressing the system description file according to the compression method of the installation package to obtain a first system description file; Performing XML decompression on the first system description file to obtain a second system description file; The character string block and the XML content block are obtained from the second system description file.
12. A method for obtaining information of an application, characterized in that: Executed by a server, the method includes: receiving a second HTTP request sent by the electronic device before downloading the installation package of the target application; Sending tail data of the installation package to the electronic device; Among them, the second HTTP request is used to obtain the tail data, and the tail data includes part or all of the data in the central directory file area of the installation package. The central directory file area is used for the system description file of the target application. The system description file includes key description information of the target application. The key description information is used to determine whether to continue downloading the installation package.
13. The method according to claim 12, characterized in that After sending the tail data of the installation package to the electronic device, the method further includes: Receiving a third HTTP request for the system description file sent by the electronic device; The system description file is sent to the electronic device.
14. The method according to claim 12, characterized in that The receiving a second HTTP request sent by the electronic device before downloading the installation package of the target application comprises: receiving a first HTTP request for the installation package sent by the electronic device, and sending size and / or address information of the installation package to the electronic device; Receive the second HTTP request sent by the electronic device based on the size and / or address information of the installation package.
15. The method according to claim 14, characterized in that Before receiving the first HTTP request for the installation package sent by the electronic device, the method further includes: receiving an HTTP header request sent by the electronic device to the server, wherein the HTTP header request is used to determine whether the server supports segmented downloading; A response message is sent to the electronic device, where the response message is used to indicate whether the server supports segmented downloading.
16. An application information acquisition device, characterized in that: The method is performed by an electronic device, and the device includes: A sending module, used for sending a download request of the installation package of the target application to the server; A first acquisition module is used to acquire a system description file in the installation package, wherein the system description file is used to describe the target application; The second acquisition module is used to acquire key description information of the target application according to the system description file, and the key description information is used to determine whether to continue downloading the installation package.
17. The device according to claim 16, characterized in that The first acquisition module is further used for: Acquire tail data of the installation package, wherein the tail data includes data in a central directory file area; Determining address information of the system description file according to the central directory file area; Based on the address information of the system description file, the system description file is requested from a server, and the system description file sent by the server is received.
18. The device according to claim 17, characterized in that The first acquisition module is further used for: Sending a first HTTP request for the installation package to the server, and receiving size and / or address information of the installation package returned by the server; Based on the size and / or address information of the installation package, a second HTTP request is sent to the server, where the second HTTP request is used to request the tail data.
19. The device according to claim 18, characterized in that The first acquisition module is further used for: Generate a Hypertext Transfer Protocol (HTTP) header request, and send the HTTP header request to a server, wherein the HTTP header request is used to determine whether the server supports segmented downloading; receiving a response message sent by the server, and determining whether the server supports segmented downloading based on the response message; If the server supports the segmented download, the first HTTP request is sent to the server.
20. The device according to claim 17, characterized in that The first acquisition module is further used for: Traversing a plurality of file headers included in the central directory file area; If the file identifier carried in the currently traversed file header is the file identifier of the system description file, stop traversing the next file header; The target bytes in the currently traversed file header are parsed to obtain address information of the system description file.
21. The device according to claim 17, characterized in that The first acquisition module is further used for: Determine the size of the tail data as the actual first area size of the downloaded central directory file area; Based on the last byte of the tail data, acquiring an end mark of the central directory file area, and determining a size of a second area marked in the central directory file area based on the end mark; Performing legitimacy verification on the central directory file area according to the first area size and the second area size; After the central directory file area passes the legality verification, the address information of the system description file is determined according to the data in the central directory file area.
22. The device according to claim 21, characterized in that The first acquisition module is further used for: If the size of the first area is greater than or equal to the size of the second area, determining that the central directory file area passes the legality verification; If the size of the first area is smaller than the size of the second area, it is determined that the central directory file area has not passed the legality verification, and subsequent operations are stopped.
23. The device according to claim 22, characterized in that The first acquisition module is further used for: If the size of the first area is larger than the size of the second area, determining the starting position and the ending position of the central directory file area according to the end mark of the central directory file area; The central directory file area is intercepted from the tail data according to the starting position and the ending position of the central directory file area.
24. The device according to claim 17, characterized in that The first acquisition module is further used for: Based on the size and / or address information of the installation package, a request header carrying the address range of the tail data is added to the HTTP acquisition request to obtain a second HTTP request; Send the second HTTP request to the server, and receive the tail data sent by the server.
25. The device according to any one of claims 16 to 24, characterized in that The second acquisition module is further used for: Extracting a string block and an extensible markup language XML content block from the system description file; The character string block and the XML content block are parsed to obtain the key description information.
26. The device according to claim 25, characterized in that The second acquisition module is further used for: Decompressing the system description file according to the compression method of the installation package to obtain a first system description file; Performing XML decompression on the first system description file to obtain a second system description file; The character string block and the XML content block are obtained from the second system description file.
27. An application information acquisition device, characterized in that: Executed by a server, the device includes: A receiving module, configured to receive a second HTTP request sent by the electronic device before downloading an installation package of the target application; A sending module, used for sending the tail data of the installation package to the electronic device; Among them, the second HTTP request is used to obtain the tail data, and the tail data includes part or all of the data in the central directory file area of the installation package. The central directory file area is used for the system description file of the target application. The system description file includes key description information of the target application. The key description information is used to determine whether to continue downloading the installation package.
28. The device according to claim 27, characterized in that The sending module is further used for: Receiving a third HTTP request for the system description file sent by the electronic device; The system description file is sent to the electronic device.
29. The device according to claim 27, characterized in that The sending module is further used for: receiving a first HTTP request for the installation package sent by the electronic device, and sending size and / or address information of the installation package to the electronic device; Receive the second HTTP request sent by the electronic device based on the size and / or address information of the installation package.
30. The device according to claim 29, characterized in that The sending module is further used for: receiving an HTTP header request sent by the electronic device to the server, wherein the HTTP header request is used to determine whether the server supports segmented downloading; A response message is sent to the electronic device, where the response message is used to indicate whether the server supports segmented downloading.
31. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to implement the steps of the method according to any one of claims 1 to 15.
32. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the steps of the method described in any one of claims 1 to 15 are implemented.