CN109814893A - Method for down loading, device, computer equipment and the storage medium of OTA upgrade package - Google Patents
Method for down loading, device, computer equipment and the storage medium of OTA upgrade package Download PDFInfo
- Publication number
- CN109814893A CN109814893A CN201711177197.6A CN201711177197A CN109814893A CN 109814893 A CN109814893 A CN 109814893A CN 201711177197 A CN201711177197 A CN 201711177197A CN 109814893 A CN109814893 A CN 109814893A
- Authority
- CN
- China
- Prior art keywords
- upgrade package
- ota upgrade
- download
- keyword
- ota
- 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.)
- Pending
Links
Landscapes
- Information Transfer Between Computers (AREA)
Abstract
本发明实施例提供OTA升级包的下载方法、装置、计算机设备及存储介质,属于通信技术领域。该OTA升级包的下载方法包括:接收到OTA升级包的下载指令时,获取该OTA升级包的下载地址;从该下载地址中下载该OTA升级包的部分文件,该部分文件包含有该OTA升级包的注释字段;解析该部分文件中的注释字段携带的关键字;当解析的该关键字与预设的关键字相符时,从该下载地址中下载完整的该OTA升级包。本发明可以提高OTA升级包的下载准确性,避免下载错误的升级包造成对带宽的浪费。
Embodiments of the present invention provide a method, device, computer device and storage medium for downloading an OTA upgrade package, which belong to the technical field of communications. The method for downloading the OTA upgrade package includes: when receiving a download instruction of the OTA upgrade package, obtaining a download address of the OTA upgrade package; downloading a part of the OTA upgrade package file from the download address, where the partial file contains the OTA upgrade package The comment field of the package; parse the keyword carried in the comment field in this part of the file; when the parsed keyword matches the preset keyword, download the complete OTA upgrade package from the download address. The invention can improve the download accuracy of the OTA upgrade package and avoid the waste of bandwidth caused by downloading the wrong upgrade package.
Description
技术领域technical field
本发明涉及通信技术领域,特别是涉及OTA升级包的下载方法、装置、计算机设备及存储介质。The present invention relates to the field of communication technologies, and in particular, to a method, device, computer equipment and storage medium for downloading an OTA upgrade package.
背景技术Background technique
随着各种android客户端的设备种类和数量日益增长,且这些设备分布在不同的地方,往往要求系统不断的升级来修复缺陷或者提供更好的功能。OTA(Over the Air:空中下载)升级是Android系统提供的标准系统软件包的升级方式,它功能强大,主要通过网络(例如WIFI、3G/4G等网络)自动下载OTA升级包进行升级,由于目前Android系统功能日益增强,OTA升级包也越来越大,不同于目前功能单一的APK应用包大小,也意味着OTA升级包对带宽的占用也会增加。With the growing variety and number of devices of various android clients, and these devices are distributed in different places, it is often required to continuously upgrade the system to fix defects or provide better functions. OTA (Over the Air: Over the Air) upgrade is an upgrade method of the standard system software package provided by the Android system. It has powerful functions. It mainly downloads the OTA upgrade package automatically through the network (such as WIFI, 3G/4G and other networks) for upgrade. The functions of the Android system are increasing day by day, and the OTA upgrade package is also getting larger and larger. Different from the current single-function APK application package size, it also means that the OTA upgrade package will occupy more bandwidth.
目前这种OTA升级方式要求必须先完整下载OTA升级包,重启系统进入到Recover模式(恢复模式)进一步校验版本的正确性来决定版本是否能用于升级,如果版本不是所需要升级的对应版本包,这种方式在有限的资源下就不可避免的会浪费下载带宽。At present, this OTA upgrade method requires that the OTA upgrade package must be downloaded completely, and the system must be restarted to enter the Recover mode (recovery mode) to further verify the correctness of the version to determine whether the version can be used for upgrade. If the version is not the corresponding version that needs to be upgraded package, this method will inevitably waste download bandwidth under limited resources.
再加上现在越来越多的运营商只让厂家提供一个镜像升级包来完成在线终端用户的升级,升级服务器、网管服务器在各运营商都是统一管理和部署,不会根据各厂家的实现方法来定制服务器。另外,如果升级服务器上放置的OTA升级包本身有问题,例如是一个错误版本包,目前的方法也只有下载了完整的升级包才会发现,又是另一种情况对下载带宽的浪费。In addition, more and more operators now only allow manufacturers to provide an image upgrade package to complete the upgrade of online end users. The upgrade server and network management server are managed and deployed in a unified manner by each operator, and will not be implemented according to the implementation method of each manufacturer. to customize the server. In addition, if there is a problem with the OTA upgrade package placed on the upgrade server, such as a wrong version package, the current method will only find out after downloading the complete upgrade package, which is another waste of download bandwidth.
发明内容SUMMARY OF THE INVENTION
有鉴于此,本发明的目的在于提供一种OTA升级包的下载方法、装置、计算机设备及存储介质,可以提高OTA升级包的下载准确性,避免下载错误的升级包造成对带宽的浪费。In view of this, the purpose of the present invention is to provide a download method, device, computer equipment and storage medium of an OTA upgrade package, which can improve the download accuracy of the OTA upgrade package and avoid the waste of bandwidth caused by downloading the wrong upgrade package.
本发明解决上述技术问题所采用的技术方案如下:The technical scheme adopted by the present invention to solve the above-mentioned technical problems is as follows:
根据本发明的一个方面,提供的一种OTA升级包的下载方法,该方法包括:According to an aspect of the present invention, there is provided a method for downloading an OTA upgrade package, the method comprising:
接收到OTA升级包的下载指令时,获取该OTA升级包的下载地址;When receiving the download instruction of the OTA upgrade package, obtain the download address of the OTA upgrade package;
从该下载地址中下载该OTA升级包的部分文件,该部分文件包含有该OTA升级包的注释字段;Download part of the file of the OTA upgrade package from the download address, and the part of the file contains the comment field of the OTA upgrade package;
解析该部分文件中的注释字段携带的关键字;Parse the keywords carried in the comment field in this part of the file;
当解析的该关键字与预设的关键字相符时,从该下载地址中下载完整的该OTA升级包。When the parsed keyword matches the preset keyword, download the complete OTA upgrade package from the download address.
根据本发明的另一个方面,提供的一种OTA升级包的下载装置,该装置包括:According to another aspect of the present invention, a device for downloading an OTA upgrade package is provided, the device comprising:
指令接收模块,用于接收到OTA升级包的下载指令时,获取该OTA升级包的下载地址;The instruction receiving module is used to obtain the download address of the OTA upgrade package when receiving the download instruction of the OTA upgrade package;
第一下载模块,用于从该下载地址中下载该OTA升级包的部分文件,该部分文件包含有该OTA升级包的注释字段;The first download module is used to download the partial file of the OTA upgrade package from the download address, and the partial file contains the comment field of the OTA upgrade package;
解析模块,用于解析该部分文件中的注释字段携带的关键字;Parsing module, used to parse the keywords carried by the comment field in this part of the file;
第二下载模块,用于当解析的该关键字与预设的关键字相符时,从该下载地址中下载完整的该OTA升级包。The second download module is configured to download the complete OTA upgrade package from the download address when the parsed keyword matches the preset keyword.
根据本发明的又一个发明,提供的一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,该处理器执行该程序时实现上述的OTA升级包的下载方法。According to another invention of the present invention, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, the processor implements the above-mentioned OTA upgrade package when executing the program. Download method.
根据本发明的再一个发明,提供的一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述OTA升级包的下载方法中的步骤。According to yet another invention of the present invention, a computer-readable storage medium is provided, and a computer program is stored thereon, and when the program is executed by a processor, the steps in the above-mentioned method for downloading an OTA upgrade package are implemented.
本发明实施例提供的一种OTA升级包的下载方法、装置、计算机设备及存储介质,通过在接收到OTA升级包的下载指令时,先从OTA升级包的下载地址中下载包含有该OTA升级包的注释字段的部分文件,当该注释字段中携带的关键字,例如版本号、版本时间、校验码和/或该OTA升级包适用的市场代码与预期设置的关键字相同时,表示该下载地址中的OTA升级包为正确的升级包,此时在将该完整的OTA升级包下载下来可以保证下载的升级包就是所需的升级文件,提高了OTA升级包的下载准确性,避免下载错误的升级包造成对带宽的浪费。An embodiment of the present invention provides a method, device, computer device and storage medium for downloading an OTA upgrade package. When receiving a download instruction for an OTA upgrade package, first download the OTA upgrade package from the download address of the OTA upgrade package, including the OTA upgrade package. Part of the file of the comment field of the package, when the keywords carried in the comment field, such as version number, version time, check code and/or the applicable market code of the OTA upgrade package are the same as the expected keywords, it indicates that the The OTA upgrade package in the download address is the correct upgrade package. At this time, downloading the complete OTA upgrade package can ensure that the downloaded upgrade package is the required upgrade file, which improves the download accuracy of the OTA upgrade package and avoids downloading. The wrong upgrade package results in wasted bandwidth.
附图说明Description of drawings
图1为根据本发明的一个实施例的OTA升级包的下载方法的流程图;1 is a flowchart of a method for downloading an OTA upgrade package according to an embodiment of the present invention;
图2为根据本发明的另一实施例的OTA升级包的下载方法的流程图;2 is a flowchart of a method for downloading an OTA upgrade package according to another embodiment of the present invention;
图3为根据本发明的一个实施例的OTA升级包中EOCD字段的示意图;3 is a schematic diagram of an EOCD field in an OTA upgrade package according to an embodiment of the present invention;
图4为根据本发明的又一实施例的OTA升级包的下载方法的流程图;4 is a flowchart of a method for downloading an OTA upgrade package according to yet another embodiment of the present invention;
图5为根据本发明的再一实施例的OTA升级包的下载方法的流程图;5 is a flowchart of a method for downloading an OTA upgrade package according to yet another embodiment of the present invention;
图6为根据本发明的一个实施例的OTA升级包的下载装置的示范性结构框图;6 is an exemplary structural block diagram of an apparatus for downloading an OTA upgrade package according to an embodiment of the present invention;
图7为根据本发明的一个实施例的计算机设备的内部结构示意图。FIG. 7 is a schematic diagram of the internal structure of a computer device according to an embodiment of the present invention.
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics and advantages of the present invention will be further described with reference to the accompanying drawings in conjunction with the embodiments.
具体实施方式Detailed ways
为了使本发明所要解决的技术问题、技术方案及有益效果更加清楚、明白,以下结合附图和实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention clearer and more comprehensible, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention.
图1为根据本发明的一个实施例的OTA升级包的下载方法的流程图,下面结合图1来详细描述根据本发明的一个实施例的OTA升级包的下载方法,如图1所示,该方法包括以下步骤S101至步骤S104。FIG. 1 is a flowchart of a method for downloading an OTA upgrade package according to an embodiment of the present invention. The following describes the method for downloading an OTA upgrade package according to an embodiment of the present invention in detail with reference to FIG. 1. As shown in FIG. 1, the The method includes the following steps S101 to S104.
S101、接收到OTA升级包的下载指令时,获取该OTA升级包的下载地址。S101. When receiving the download instruction of the OTA upgrade package, obtain the download address of the OTA upgrade package.
在该实施例中,上述的下载指令可以是用户输入的下载更新的命令,可以是计算机设备的系统启动时,系统自动发出的下载指令,还可以是当计算机设备满足一定的触发条件(例如连接WiFi且电量超过设定值)时,接收到系统自动发送的OTA升级包的下载指令,此处不做限制。In this embodiment, the above-mentioned download instruction may be a download update command input by the user, may be a download instruction automatically issued by the system when the system of the computer device is started, or may be a download instruction that is automatically issued by the system when the computer device satisfies a certain trigger condition (for example, a connection When WiFi and the power exceeds the set value), the download command of the OTA upgrade package automatically sent by the system is received, and there is no limit here.
其中,该步骤中的下载地址可以是升级服务器地址,该下载地址可以是网页链接。该下载地址可以是本地存储的下载地址,也可以是服务器下发的下载地址,本实施例对该下载地址的来源不做限制。Wherein, the download address in this step may be an upgrade server address, and the download address may be a web page link. The download address may be a locally stored download address or a download address delivered by a server, and the source of the download address is not limited in this embodiment.
S102、从该下载地址中下载该OTA升级包的部分文件,该部分文件包含有该OTA升级包的注释字段。S102. Download a partial file of the OTA upgrade package from the download address, where the partial file includes a comment field of the OTA upgrade package.
在其中的一个实施例中,该部分文件只要能够覆盖该OTA升级包的注释字段即可。由于OTA升级包属于标准的ZIP文件,标准的ZIP文件的格式中规定其注释字段位于ZIP文件的EOCD(end of central directory record:目录结束标识)字段内,且该目录结束标识存在于整个压缩包的尾部,所以在下载包含该OTA升级包的注释字段的部分文件时,可以通过已有的http range技术下载位于该OTA升级包尾部最后的4K大小左右的包即可。In one of the embodiments, the partial file only needs to be able to cover the comment field of the OTA upgrade package. Since the OTA upgrade package belongs to a standard ZIP file, the standard ZIP file format specifies that its comment field is located in the EOCD (end of central directory record: directory end identifier) field of the ZIP file, and the directory end identifier exists in the entire compressed package. Therefore, when downloading part of the file containing the comment field of the OTA upgrade package, you can download the package of about 4K size at the end of the OTA upgrade package through the existing http range technology.
S103、解析该部分文件中的注释字段携带的关键字。S103, parse the keyword carried in the comment field in the part of the file.
在其中的一个实施例中,上述的关键字包括以下关键字中的至少一种:该OTA升级包的版本号、该OTA升级包的版本时间、该OTA升级包的校验码及该OTA升级包适用的市场代码。In one embodiment, the above keywords include at least one of the following keywords: the version number of the OTA upgrade package, the version time of the OTA upgrade package, the check code of the OTA upgrade package, and the OTA upgrade package The market code for which the package applies.
在该实施例中,可以通过查找该OTA升级包的EOCD字段,再在该EOCD字段中定位该升级包的注释字段,然后提取写入该注释字段内的字符,最后将提取的字符解析出来即可,解析出来的关键字即为该注释字段携带的关键字。In this embodiment, the EOCD field of the OTA upgrade package can be searched, the comment field of the upgrade package can be located in the EOCD field, the characters written in the comment field can be extracted, and finally the extracted characters can be parsed out. Yes, the parsed keyword is the keyword carried in the comment field.
S104、当解析的该关键字与预设的关键字相符时,从该下载地址中下载完整的该OTA升级包。S104, when the parsed keyword matches a preset keyword, download the complete OTA upgrade package from the download address.
在其中的一个实施例中,该预设的关键字包括但不限于:版本号、版本时间、校验码及市场代码。In one embodiment, the preset keywords include but are not limited to: version number, version time, check code and market code.
在其中的一个实施例中,判断解析的关键字与预设的关键字是否相符可以通过如下方式:判断预设的关键字中是否包含有全部所述解析的关键字,若是,则判断解析的该关键字与预设的关键字相符。In one of the embodiments, determining whether the parsed keyword matches the preset keyword can be determined by the following methods: judging whether the preset keyword contains all the parsed keywords; The keyword matches the preset keyword.
根据本实施例的一个使用场景例如:预设的关键字包括:版本号、版本时间、校验码及市场代码,解析出的关键字包括版本号、校验码及市场代码,如果解析出来的版本号、校验码及市场代码与预设的版本号、校验码及市场代码均相同,则可以判断解析的该关键字与预设的关键字相符。According to a usage scenario of this embodiment, for example, the preset keywords include: version number, version time, check code, and market code, and the parsed keywords include version number, check code, and market code. If the version number, check code, and market code are the same as the preset version number, check code, and market code, it can be determined that the parsed keyword matches the preset keyword.
在其中的一个实施例中,该部分文件位于该OTA升级包的尾部,该从该下载地址中下载该OTA升级包的部分文件的步骤包括:In one embodiment, the partial file is located at the end of the OTA upgrade package, and the step of downloading the partial file of the OTA upgrade package from the download address includes:
从该下载地址中下载位于该OTA升级包尾部的该部分文件。Download the part of the file at the end of the OTA upgrade package from the download address.
在该实施例中,由于上述的部分文件属于OTA升级包的一部分,与该OTA升级包的下载地址相同,故应从同一下载地址中下载该OTA升级包的部分文件及该完整的OTA升级包。In this embodiment, since the above-mentioned partial files belong to a part of the OTA upgrade package and are the same as the download address of the OTA upgrade package, the partial files of the OTA upgrade package and the complete OTA upgrade package should be downloaded from the same download address.
在其中的一个实施例中,该OTA升级包的下载方法还包括以下步骤(1)至(3)。In one embodiment, the method for downloading an OTA upgrade package further includes the following steps (1) to (3).
(1)、查询该OTA升级包中的特征字符串,所述特征字符串用于定位所述注释字段的开始位置。(1), query the feature string in the OTA upgrade package, where the feature string is used to locate the start position of the comment field.
根据本实施例的一个示例,可以根据OTA升级包中的EOCD签名定位位于该OTA升级包尾部的EOCD字段,然后在该EOCD字段中查找表示该OTA升级包的注释长度的字段,可以将与该查找到的字段相邻的后面一个字段作为该注释字段的起始位置。According to an example of this embodiment, the EOCD field located at the end of the OTA upgrade package can be located according to the EOCD signature in the OTA upgrade package, and then the EOCD field is searched for a field representing the comment length of the OTA upgrade package, and the EOCD field can be compared with the EOCD field. The next field adjacent to the found field is used as the starting position of the comment field.
(2)、将该关键字编译为对应的字符。(2) Compile the keyword into the corresponding character.
其中,该关键字表示该OTA升级包的关键信息,例如版本号、版本时间、校验码、市场代码等等。The keyword represents key information of the OTA upgrade package, such as version number, version time, check code, market code, and the like.
(3)将编译的该字符存储至该注释字段中。(3) Store the compiled character in the comment field.
在其中的一个实施例中,可以根据从上述步骤(1)中确定的注释字段的起始位置,从该起始位置开始存储该编译的字符。In one of the embodiments, the compiled character can be stored from the starting position according to the starting position of the comment field determined in the above step (1).
在其中的一个实施例中,该OTA升级包的下载方法还包括:In one embodiment, the method for downloading the OTA upgrade package further includes:
当解析的该关键字与预设的关键字不相符时,输出该关键字不相符的消息。When the parsed keyword does not match the preset keyword, a message that the keyword does not match is output.
根据本实施例的一个示例,该输出的方式显示输出,也可以是语音输出,此处不做限制。当本端计算机设备为更新对象时,该步骤中输出的对象可以是将该关键字不相符的消息输出给本端,当更新对象为对远程的计算机设备进行更新时,该步骤中输出的对象还可以是输出其它待更新的计算机设备。According to an example of this embodiment, the output method is display output, and may also be voice output, which is not limited here. When the computer device of the local end is the update object, the object output in this step may be the message that the keyword does not match to output to the local end; when the update object is to update the remote computer device, the object output in this step It can also output other computer equipment to be updated.
在其中一个实施例中,该OTA升级包的下载方法还包括:当解析的该关键字与预设的关键字不相符时,取消下载该完整的OTA升级包,退出升级流程。In one embodiment, the method for downloading the OTA upgrade package further includes: when the parsed keyword does not match a preset keyword, canceling the download of the complete OTA upgrade package and exiting the upgrade process.
本实施例通过在接收到OTA升级包的下载指令时,先从OTA升级包的下载地址中下载包含有该OTA升级包的注释字段的部分文件,当该注释字段中携带的关键字,例如版本号、版本时间、校验码和/或该OTA升级包适用的市场代码与预期设置的关键字相同时,表示该下载地址中的OTA升级包为正确的升级包,此时在将该完整的OTA升级包下载下来可以保证下载的升级包就是所需的升级文件,提高了OTA升级包的下载准确性,避免下载错误的升级包造成对带宽的浪费。In this embodiment, when receiving the download instruction of the OTA upgrade package, firstly download a part of the file containing the comment field of the OTA upgrade package from the download address of the OTA upgrade package, when the keyword carried in the comment field, such as version No., version time, check code and/or the applicable market code of the OTA upgrade package is the same as the expected keyword, it means that the OTA upgrade package in the download address is the correct upgrade package. Downloading the OTA upgrade package can ensure that the downloaded upgrade package is the required upgrade file, which improves the download accuracy of the OTA upgrade package and avoids the waste of bandwidth caused by downloading the wrong upgrade package.
图2为根据本发明的另一实施例的OTA升级包的下载方法的流程图,下面结合图2来详细描述根据本发明的另一实施例的OTA升级包的下载方法,如图2所示,该方法包括上述步骤S101、S102及S104的基础上,上述步骤S103还包括以下步骤S201至S204。FIG. 2 is a flowchart of a method for downloading an OTA upgrade package according to another embodiment of the present invention. The following describes a method for downloading an OTA upgrade package according to another embodiment of the present invention in detail with reference to FIG. 2 , as shown in FIG. 2 . , the method includes the above steps S101, S102 and S104, the above step S103 further includes the following steps S201 to S204.
S201、查询该部分文件中的特征字符串。S201. Query the characteristic string in the part of the file.
根据本实施例的一个示例,该特征字符用于标记EOCD字段的开始位置,在标准ZIP文件的格式中规定用“50 4B 05 06”标记EOCD字段的开始位置。According to an example of this embodiment, the characteristic character is used to mark the start position of the EOCD field, and it is specified in the standard ZIP file format that "50 4B 05 06" is used to mark the start position of the EOCD field.
S202、根据该特征字符串定位该OTA升级包的注释字段的开始位置。S202. Locate the start position of the comment field of the OTA upgrade package according to the characteristic string.
根据本实施例的一个示例,用“CA06”标记ZIP文件注释长度,由于关键信息的注释字段位于该注释长度标记字段的后面,所以可以将与该注释长度标记字段相邻的后面一个字段作为该注释字段的起始位置。According to an example of this embodiment, "CA06" is used to mark the comment length of the ZIP file. Since the comment field of the key information is located after the comment length mark field, the next field adjacent to the comment length mark field can be used as the comment length mark field. The starting position of the comment field.
S203、从该开始位置开始,提取该注释字段中的字符。S203, starting from the starting position, extract the characters in the comment field.
S204、将该字符解析为对应的关键字。S204. Parse the character into a corresponding keyword.
其中,Android的OTA升级包是一个标准的ZIP文件,ZIP文件由若干条记录(record)构成,每个记录头部都有一个四字节的标记(signature)用来区分不同类型的记录,所有签名的前两个字节都是“PK”(16进制为50 4B),仅后两个字节有区别。Among them, the OTA upgrade package of Android is a standard ZIP file. The ZIP file consists of several records. Each record has a four-byte signature in the header to distinguish different types of records. The first two bytes of the signature are both "PK" (50 4B in hexadecimal), and only the last two bytes are different.
在各种记录中,最为基础的是EOCD字段,图3为根据本发明的一个实施例的OTA升级包中EOCD字段的示意图,如图3所示,该EOCD字段的标记是16进制的“50 4B 05 06”,每个zip文件中有且仅有一条这个记录,主要用途是给出压缩包中包含的文件列表的位置,目录结束标识存在于整个压缩包的结尾,故EOCD必须从文件尾部向前搜索。Among various records, the most basic is the EOCD field. Figure 3 is a schematic diagram of the EOCD field in the OTA upgrade package according to an embodiment of the present invention. As shown in Figure 3, the EOCD field is marked in hexadecimal "" 50 4B 05 06", there is only one record in each zip file, the main purpose is to give the location of the file list contained in the compressed package, the directory end mark exists at the end of the entire compressed package, so EOCD must start from the file. The tail searches forward.
其中,EOCD的字段定义如下表(1):Among them, the fields of EOCD are defined in the following table (1):
表(1)Table 1)
其中,最后两个字段“注释长度”及“注释内容”可以为ZIP文件添加任意内容的注释,所以我们可以将版本关键信息作为ZIP文件的注释添加进去。这样的扩展同时也兼容了OTA文件的标准通用性。Among them, the last two fields "comment length" and "comment content" can add comments of any content to the ZIP file, so we can add the version key information as the comment of the ZIP file. Such extensions are also compatible with the standard universality of OTA files.
在关键信息中我们可以自定义一些版本的关键内容,例如:版本号、版本时间、校验码以及适用的市场代码。将这些信息在版本制作时打包到OTA包最后的注释字段中。In the key information, we can customize some key content of the version, such as: version number, version time, check code and applicable market code. Pack this information into the comment field at the end of the OTA package when the version is made.
本实施例提供了一种将注释字段中的字符解析为对应的关键字的方法,通过定位到该注释字段的起始位置,提取该注释字段中的字符,再将提取的字符解析为对应的关键字,即可完成对部分文件中的注释字段携带的关键字的解析。This embodiment provides a method for parsing characters in a comment field into corresponding keywords, by locating the starting position of the comment field, extracting the characters in the comment field, and then parsing the extracted characters into corresponding keywords keyword, you can complete the analysis of the keywords carried in the comment fields in some files.
图4为根据本发明的又一实施例的OTA升级包的下载方法的流程图,下面结合图4来详细描述根据本发明的又一实施例的OTA升级包的下载方法,如图4所示,该方法在包括上述步骤S101至S104的基础上,还包括以下步骤S401至S403。FIG. 4 is a flowchart of a method for downloading an OTA upgrade package according to another embodiment of the present invention. The following describes a method for downloading an OTA upgrade package according to another embodiment of the present invention in detail with reference to FIG. 4 , as shown in FIG. 4 . , the method further includes the following steps S401 to S403 on the basis of the above steps S101 to S104.
S401、查询该OTA升级包中的特征字符串,所述特征字符串用于定位所述注释字段的开始位置。S401. Query a feature string in the OTA upgrade package, where the feature string is used to locate the start position of the comment field.
在其中的一个实施例中,可以从OTA升级包的尾部开始,搜索特征字符串“50 4B05 06”,从而定位到EOCD字段,这个EOCD字段的固定字段长度为22,注释字段长度则由两个字节表示,可以最多为65535字节。In one embodiment, the characteristic string "50 4B05 06" can be searched from the end of the OTA upgrade package to locate the EOCD field. The fixed field length of this EOCD field is 22, and the length of the comment field is composed of two Byte representation, can be up to 65535 bytes.
然后根据该特征字符串定位到EOCD的“.ZIP file comment”字段,其长度由“.ZIPfile comment length”字段给出,OTA升级包的签名包会放在注释字段的最后,其长度由“签名长度”字段给出,如图3中的标识。Then locate the ".ZIP file comment" field of EOCD according to the characteristic string, and its length is given by the ".ZIPfile comment length" field. The signature package of the OTA upgrade package will be placed at the end of the comment field, and its length is given by "Signature Length" field is given, as identified in Figure 3.
S402、将该关键字编译为对应的字符,得到关键信息。S402. Compile the keyword into corresponding characters to obtain key information.
在其中的一个实施例中,该关键字包括但不限于OTA升级包的版本号、该OTA升级包的版本时间、该OTA升级包的校验码及该OTA升级包适用的市场代码等等。In one embodiment, the keyword includes but is not limited to the version number of the OTA upgrade package, the version time of the OTA upgrade package, the check code of the OTA upgrade package, and the applicable market code of the OTA upgrade package, and the like.
S403、将编译的该字符存储至该注释字段中。S403. Store the compiled character in the comment field.
将该关键信息写入“.ZIP file comment”字段,并相应修改“.ZIP file commentlength”和“注释总长度”字段的值。Write the key information into the ".ZIP file comment" field, and modify the values of the ".ZIP file commentlength" and "Total comment length" fields accordingly.
当用户准备升级下载OTA升级包前,可以先从文件尾部下载最后4K大小的包(确保能覆盖到注释字段即可)后,按照上面打包的方法找到对应字段,提取出存放在OTA升级包注释字段中的关键信息。先核对关键信息,信息符合表示是用户需要的升级包,这个时候再下载全部升级包,如果核对关键信息不符合,就不会浪费带宽下载了。When the user is ready to upgrade and download the OTA upgrade package, he can download the last 4K package from the end of the file (make sure that the comment field can be covered), find the corresponding field according to the packaging method above, and extract the comment stored in the OTA upgrade package. key information in the field. Check the key information first, and if the information matches, it means that it is the upgrade package that the user needs. At this time, download all the upgrade packages. If the key information does not match, you will not waste bandwidth downloading.
图5为根据本发明的再一实施例的OTA升级包的下载方法的流程图,如图5所示,在该实施例中,该OTA升级包的下载方法包括以下步骤S501至S507:5 is a flowchart of a method for downloading an OTA upgrade package according to yet another embodiment of the present invention. As shown in FIG. 5 , in this embodiment, the method for downloading an OTA upgrade package includes the following steps S501 to S507:
S501、通过http range下载尾部指定字节;S501. Download the specified bytes at the end through http range;
S502、判断是否找到EOCD字段,若是,则跳转至步骤S503,否则,跳转至步骤S507;S502, determine whether the EOCD field is found, if so, jump to step S503, otherwise, jump to step S507;
S503、判断EOCD中的注释字段是否符合OTA包的格式,若是,则跳转至步骤S504,否则,跳转至步骤S507;S503, determine whether the comment field in the EOCD conforms to the format of the OTA package, if so, jump to step S504, otherwise, jump to step S507;
S504、提取EOCD字段中的关键信息的注释字段;S504, extract the comment field of the key information in the EOCD field;
S505、判断注释字段中的关键信息与预设的关键字是否匹配,若是,则跳转至步骤S506,否则,跳转至步骤S507;S505, determine whether the key information in the comment field matches the preset keyword, if so, jump to step S506, otherwise, jump to step S507;
S506、开始下载,准备升级;S506, start downloading, and prepare to upgrade;
S507、部署版本不符合要求,拒绝升级。S507. The deployment version does not meet the requirements, and the upgrade is refused.
本实施例首先根据版本需要提取的关键信息自定义OTA包所需要额外携带的信息内容,再在版本集成时在OTA包注释字段中加入关键信息,其中,主要通过以下步骤1)至步骤3)在版本集成时在OTA包注释字段中加入关键信息:In this embodiment, the additional information content of the OTA package needs to be customized according to the key information that needs to be extracted for the version, and then the key information is added to the comment field of the OTA package when the version is integrated, and the following steps 1) to 3) are mainly used. Include key information in the OTA package comment field during version integration:
1)定位OTA包的EOCD起始标识符;1) Locate the EOCD start identifier of the OTA package;
从OTA包尾部开始,搜索特征字符串50 4B 05 06,从而定位到EOCD,这个记录固定字段长度为22,注释字段长度则由两个字节表示--最多可以增加65535字节的注释信息;Starting from the end of the OTA packet, search for the characteristic string 50 4B 05 06 to locate the EOCD. The fixed field length of this record is 22, and the length of the comment field is represented by two bytes - up to 65535 bytes of comment information can be added;
2)根据标准ZIP文件EOCD字段的定义,定位注释字段开始位置;2) According to the definition of the standard ZIP file EOCD field, locate the start position of the comment field;
3)添加自定义的关键信息字段。3) Add custom key information fields.
将关键信息写入OTA包“注释”字段,并相应修改“ZIP文件注释长度”和“注释总长度”字段的值。Write key information into the "Comment" field of the OTA package, and modify the values of the "ZIP File Comment Length" and "Total Comment Length" fields accordingly.
当终端准备升级前根据下发的升级服务器地址,先下载OTA升级包文件最后若干字节,能够覆盖到注释字段即可,提取关键字段信息,然后根据提取的关键信息预校验通过,若通过就开始下载OTA升级包进入升级,未通过,则无需下载OTA升级包。When the terminal is ready to upgrade, it first downloads the last bytes of the OTA upgrade package file according to the delivered upgrade server address, and can cover the comment field, extracts the key field information, and then passes the pre-check based on the extracted key information. If you pass it, you will start to download the OTA upgrade package to enter the upgrade. If it fails, you do not need to download the OTA upgrade package.
本实施例通过在一个完整的OTA升级包中存放自带的关键信息,以便在版本下载前,可以通过先下载OTA升级包中固定位置的一些字段,来预判断版本的关键信息,如果符合本次版本的升级信息,才会去下载完整的软件包,避免不正确的升级包造成用户升级带宽的浪费。In this embodiment, the self-contained key information is stored in a complete OTA upgrade package, so that the key information of the version can be pre-judged by downloading some fields in the fixed position in the OTA upgrade package before the version is downloaded. Only the upgrade information of the next version will be downloaded, and the complete software package will be downloaded, so as to avoid the waste of upgrade bandwidth caused by incorrect upgrade packages.
为了达到上述目的,本发明提供了一种在一个OTA升级文件中增加关键信息的方法,OTA升级文件是标准的ZIP文件格式压缩包,依据ZIP文件的标准文件格式定义,利用ZIP文件的注释字段存放关键信息,这样升级包即符合通用性,又可以利用一个标准升级文件来完成版本正确性的预判断,与其他文件、服务器没有依赖关系。In order to achieve the above object, the present invention provides a method for adding key information in an OTA upgrade file. The OTA upgrade file is a standard ZIP file format compressed package. According to the standard file format definition of the ZIP file, the comment field of the ZIP file is used. Store key information, so that the upgrade package is universal, and can use a standard upgrade file to complete the pre-judgment of version correctness, and has no dependencies with other files and servers.
根据本实施例的一个示例,上述步骤S101~S507的标号并不用于限定本实施例中各个步骤的先后顺序,各个步骤的编号只是为了使得描述各个步骤时可以通用引用该步骤的标号进行便捷的指代,只要各个步骤执行的顺序不影响本实施例的逻辑关系即表示在本申请请求保护的范围之内。According to an example of this embodiment, the labels of the above steps S101 to S507 are not used to limit the sequence of each step in this embodiment, and the numbers of each step are only for the convenience of referring to the labels of the steps when describing each step. It means that as long as the order in which each step is performed does not affect the logical relationship of this embodiment, it is within the scope of protection claimed in this application.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件来实现,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明各个实施例所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is better implementation. Based on this understanding, the technical solutions of the present invention can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products are stored in a storage medium (such as ROM/RAM, magnetic disk, CD-ROM), including several instructions to make a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in the various embodiments of the present invention.
图6为根据本发明的一个实施例的OTA升级包的下载装置的示范性结构框图,下面结合图6来详细描述根据本发明的一个实施例的OTA升级包的下载装置,如图6所示,该OTA升级包的下载装置100包括指令接收模块11、第一下载模块12、解析模块13及第二下载模块14。其中:FIG. 6 is an exemplary structural block diagram of an apparatus for downloading an OTA upgrade package according to an embodiment of the present invention. The following describes the apparatus for downloading an OTA upgrade package according to an embodiment of the present invention in detail with reference to FIG. 6 , as shown in FIG. 6 . , the downloading apparatus 100 of the OTA upgrade package includes an instruction receiving module 11 , a first downloading module 12 , a parsing module 13 and a second downloading module 14 . in:
指令接收模块11,用于接收到OTA升级包的下载指令时,获取该OTA升级包的下载地址。The instruction receiving module 11 is configured to acquire the download address of the OTA upgrade package when receiving the download instruction of the OTA upgrade package.
在该实施例中,上述的下载指令可以是用户输入的下载更新的命令,可以是计算机设备的系统启动时,系统自动发出的下载指令,还可以是当计算机设备满足一定的触发条件(例如连接WiFi且电量超过设定值)时,接收到系统自动发送的OTA升级包的下载指令,此处不做限制。In this embodiment, the above-mentioned download instruction may be a download update command input by the user, may be a download instruction automatically issued by the system when the system of the computer device is started, or may be a download instruction that is automatically issued by the system when the computer device satisfies a certain trigger condition (for example, a connection When WiFi and the power exceeds the set value), the download command of the OTA upgrade package automatically sent by the system is received, and there is no limit here.
其中,该步骤中的下载地址可以是升级服务器地址,该下载地址可以是网页链接。该下载地址可以是本地存储的下载地址,也可以是服务器下发的下载地址,本实施例对该下载地址的来源不做限制。Wherein, the download address in this step may be an upgrade server address, and the download address may be a web page link. The download address may be a locally stored download address or a download address delivered by a server, and the source of the download address is not limited in this embodiment.
第一下载模块12,用于从该下载地址中下载该OTA升级包的部分文件,该部分文件包含有该OTA升级包的注释字段。The first download module 12 is configured to download a partial file of the OTA upgrade package from the download address, where the partial file includes a comment field of the OTA upgrade package.
在其中的一个实施例中,该部分文件只要能够覆盖该OTA升级包的注释字段即可。由于OTA升级包属于标准的ZIP文件,标准的ZIP文件的格式中规定其注释字段位于ZIP文件的EOCD(end of central directory record:目录结束标识)字段内,且该目录结束标识存在于整个压缩包的尾部,所以该第一下载模块12在下载包含该OTA升级包的注释字段的部分文件时,可以通过已有的http range技术下载位于该OTA升级包尾部最后的4K大小左右的包即可。In one of the embodiments, the partial file only needs to be able to cover the comment field of the OTA upgrade package. Since the OTA upgrade package belongs to a standard ZIP file, the standard ZIP file format specifies that its comment field is located in the EOCD (end of central directory record: directory end identifier) field of the ZIP file, and the directory end identifier exists in the entire compressed package. Therefore, when the first download module 12 downloads a part of the file containing the comment field of the OTA upgrade package, it can download the last 4K-sized package located at the tail of the OTA upgrade package through the existing http range technology.
解析模块13,用于解析该部分文件中的注释字段携带的关键字。The parsing module 13 is configured to parse the keywords carried in the comment field in the part of the file.
在其中的一个实施例中,上述的关键字包括以下关键字中的至少一种:该OTA升级包的版本号、该OTA升级包的版本时间、该OTA升级包的校验码及该OTA升级包适用的市场代码。In one embodiment, the above keywords include at least one of the following keywords: the version number of the OTA upgrade package, the version time of the OTA upgrade package, the check code of the OTA upgrade package, and the OTA upgrade package The market code for which the package applies.
在该实施例中,该解析模块13可以通过查找该OTA升级包的EOCD字段,再在该EOCD字段中定位该升级包的注释字段,然后提取写入该注释字段内的字符,最后将提取的字符解析出来即可,解析出来的关键字即为该注释字段携带的关键字。In this embodiment, the parsing module 13 can search the EOCD field of the OTA upgrade package, locate the comment field of the upgrade package in the EOCD field, then extract the characters written in the comment field, and finally extract the extracted The characters can be parsed, and the parsed keywords are the keywords carried in the comment field.
第二下载模块14,用于当解析的该关键字与预设的关键字相符时,从该下载地址中下载完整的该OTA升级包。The second download module 14 is configured to download the complete OTA upgrade package from the download address when the parsed keyword matches the preset keyword.
在其中的一个实施例中,该预设的关键字包括但不限于:版本号、版本时间、校验码及市场代码。In one embodiment, the preset keywords include but are not limited to: version number, version time, check code and market code.
在其中的一个实施例中,判断解析的关键字与预设的关键字是否相符可以通过如下方式:判断预设的关键字中是否包含有全部所述解析的关键字,若是,则判断解析的该关键字与预设的关键字相符。In one of the embodiments, determining whether the parsed keyword matches the preset keyword can be determined by the following methods: judging whether the preset keyword contains all the parsed keywords; The keyword matches the preset keyword.
根据本实施例的一个使用场景例如:预设的关键字包括:版本号、版本时间、校验码及市场代码,解析出的关键字包括版本号、校验码及市场代码,如果解析出来的版本号、校验码及市场代码与预设的版本号、校验码及市场代码均相同,则可以判断解析的该关键字与预设的关键字相符。According to a usage scenario of this embodiment, for example, the preset keywords include: version number, version time, check code, and market code, and the parsed keywords include version number, check code, and market code. If the version number, check code, and market code are the same as the preset version number, check code, and market code, it can be determined that the parsed keyword matches the preset keyword.
在其中的一个实施例中,该解析模块13包括:In one embodiment, the parsing module 13 includes:
查询单元,用于查询该部分文件中的特征字符串。该特征字符用于标记EOCD字段的开始位置,在标准ZIP文件的格式中规定用“50 4B 05 06”标记EOCD字段的开始位置;The query unit is used to query the characteristic strings in this part of the file. This characteristic character is used to mark the starting position of the EOCD field. In the standard ZIP file format, "50 4B 05 06" is specified to mark the starting position of the EOCD field;
定位单元,用于根据该特征字符串定位该OTA升级包的注释字段的开始位置。其中,可以用“CA06”标记ZIP文件注释长度,由于关键信息的注释字段位于该注释长度标记字段的后面,所以可以将与该注释长度标记字段相邻的后面一个字段作为该注释字段的起始位置;A locating unit, configured to locate the start position of the comment field of the OTA upgrade package according to the characteristic string. Among them, "CA06" can be used to mark the comment length of the ZIP file. Since the comment field of the key information is located behind the comment length mark field, the next field adjacent to the comment length mark field can be used as the start of the comment field. Location;
字符提取单元,用于从该开始位置开始,提取该注释字段中的字符;A character extraction unit for extracting characters in the comment field starting from the starting position;
解析单元,用于将该字符解析为对应的关键字。Parsing unit for parsing the character into the corresponding keyword.
在其中一个实施例中,该第一下载模块12具体用于从该下载地址中下载位于该OTA升级包尾部的部分文件。In one embodiment, the first download module 12 is specifically configured to download a part of the file located at the end of the OTA upgrade package from the download address.
在其中一个实施例中,该OTA升级包的下载装置100还包括:In one embodiment, the apparatus 100 for downloading the OTA upgrade package further includes:
字符串查询模块,用于查询该OTA升级包中的特征字符串,所述特征字符串用于定位所述注释字段的开始位置;String query module, for querying the characteristic string in the OTA upgrade package, and the characteristic string is used to locate the starting position of the comment field;
编译模块,用于将该关键字编译为对应的字符;The compilation module is used to compile the keyword into the corresponding character;
存储模块,用于将编译的该字符存储至该注释字段中。A storage module for storing the compiled character into the comment field.
在其中一个实施例中,该OTA升级包的下载装置100还包括:In one embodiment, the apparatus 100 for downloading the OTA upgrade package further includes:
输出模块,用于当解析的该关键字与预设的关键字不相符时,输出该关键字不相符的消息。The output module is configured to output a message that the keyword does not match when the parsed keyword does not match the preset keyword.
根据本实施例的一个示例,该输出的方式显示输出,也可以是语音输出,此处不做限制。当本端计算机设备为更新对象时,该步骤中输出的对象可以是将该关键字不相符的消息输出给本端,当更新对象为对远程的计算机设备进行更新时,该步骤中输出的对象还可以是输出其它待更新的计算机设备。According to an example of this embodiment, the output method is display output, and may also be voice output, which is not limited here. When the computer device of the local end is the update object, the object output in this step may be the message that the keyword does not match to output to the local end; when the update object is to update the remote computer device, the object output in this step It can also output other computer equipment to be updated.
在其中的一个实施例中,上述的关键字包括以下关键字中的至少一种:In one embodiment, the above keywords include at least one of the following keywords:
该OTA升级包的版本号、该OTA升级包的版本时间、该OTA升级包的校验码及该OTA升级包适用的市场代码。The version number of the OTA upgrade package, the version time of the OTA upgrade package, the verification code of the OTA upgrade package, and the applicable market code of the OTA upgrade package.
在其中的一个实施例中,该OTA升级包的下载装置100还包括:In one embodiment, the apparatus 100 for downloading the OTA upgrade package further includes:
退出模块,用于当解析的该关键字与预设的关键字不相符时,取消下载该完整的OTA升级包,退出升级流程。The exit module is used to cancel the download of the complete OTA upgrade package and exit the upgrade process when the parsed keyword does not match the preset keyword.
其中上述第一下载模块及第二下载模块中的“第一”和“第二”的意义仅在于将两个下载模块加以区分,并不用于限定哪个下载模块的优先级更高或者其它的限定意义。The meanings of "first" and "second" in the above-mentioned first download module and second download module are only to distinguish the two download modules, and are not used to limit which download module has a higher priority or other limitations. significance.
其中,该OTA升级包的下载装置中包括的各个模块可全部或部分通过软件、硬件或其组合来实现。进一步地,该OTA升级包的下载装置中的各个模块可以是用于实现对应功能的程序段。Wherein, each module included in the device for downloading the OTA upgrade package may be implemented in whole or in part by software, hardware or a combination thereof. Further, each module in the apparatus for downloading the OTA upgrade package may be a program segment for implementing corresponding functions.
上述OTA升级包的下载装置可以实现为一种计算机程序的形式,计算机程序可以在如图7所示的计算机设备上运行。The above apparatus for downloading the OTA upgrade package may be implemented in the form of a computer program, and the computer program may run on the computer device as shown in FIG. 7 .
需要说明的是,上述装置实施例与方法实施例属于同一构思,其具体实现过程详见方法实施例,且方法实施例中的技术特征在装置实施例中均对应适用,这里不再赘述。It should be noted that the above apparatus embodiments and method embodiments belong to the same concept, and the specific implementation process is detailed in the method embodiments, and the technical features in the method embodiments are correspondingly applicable in the apparatus embodiments, which will not be repeated here.
根据本发明的一个实施例提供的一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,该处理器执行该程序时实现上述的OTA升级包的下载方法。A computer device provided according to an embodiment of the present invention includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the program, the above-mentioned OTA upgrade package can be downloaded method.
图7为根据本发明的一个实施例的计算机设备的内部结构示意图,该计算机设备可以为服务器。参照图7,该计算机设备包括通过系统总线连接的处理器、存储器、输入装置、显示屏和网络接口。其中,该存储器包括非易失性存储介质和内存储器,该计算机设备的非易失性存储介质可存储操作系统和计算机可读指令,该计算机可读指令被执行时,可使得处理器执行本申请各实施例的一种OTA升级包的下载方法,该方法的具体实现过程可参考图1至5各实施例的具体内容,在此不再赘述。该计算机设备的处理器用于提供计算和控制能力,支撑整个计算机设备的运行。该内存储器中可储存有计算机可读指令,该计算机可读指令被处理器执行时,可使得处理器执行一种OTA升级包的下载方法。计算机设备的输入装置用于各个参数的输入,计算机设备的显示屏用于进行显示,计算机设备的网络接口用于进行网络通信,例如文件下载。本领域技术人员可以理解,图7中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。FIG. 7 is a schematic diagram of the internal structure of a computer device according to an embodiment of the present invention, and the computer device may be a server. Referring to Figure 7, the computer device includes a processor, memory, input device, display screen and network interface connected through a system bus. Wherein, the memory includes a non-volatile storage medium and an internal memory, and the non-volatile storage medium of the computer device can store an operating system and computer-readable instructions, and when the computer-readable instructions are executed, can cause the processor to execute the present invention. A method for downloading an OTA upgrade package according to each embodiment of the application is applied. For the specific implementation process of the method, reference may be made to the specific content of each embodiment in FIGS. 1 to 5 , which will not be repeated here. The processor of the computer device is used to provide computing and control capabilities and support the operation of the entire computer device. Computer-readable instructions may be stored in the internal memory, and when executed by the processor, the computer-readable instructions may cause the processor to execute a method for downloading an OTA upgrade package. The input device of the computer equipment is used for inputting various parameters, the display screen of the computer equipment is used for display, and the network interface of the computer equipment is used for network communication, such as file download. Those skilled in the art can understand that the structure shown in FIG. 7 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied. Include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
本实施例中的存储器可用于存储软件程序以及各种数据。存储器可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等;存储数据区可存储根据手机的使用所创建的数据等。此外,存储器可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory in this embodiment can be used to store software programs and various data. The memory may mainly include a stored program area and a stored data area, wherein the stored program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the mobile phone. Additionally, the memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
本实施例另提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述OTA升级包的下载方法中的各个步骤。This embodiment further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, implements each step in the above method for downloading an OTA upgrade package.
根据本实施例的一个示例,上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述程序可存储于一计算机可读取存储介质中,如本发明实施例中,该程序可存储于计算机系统的存储介质中,并被该计算机系统中的至少一个处理器执行,以实现包括如上述各方法的实施例的流程。该存储介质包括但不限于磁碟、优盘、光盘、只读存储记忆体(Read-Only Memory,ROM)等。According to an example of this embodiment, all or part of the processes in the method of the above embodiment can be completed by instructing relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, as implemented in the present invention In an example, the program may be stored in a storage medium of a computer system, and executed by at least one processor in the computer system, so as to implement the processes including the embodiments of the above-mentioned methods. The storage medium includes, but is not limited to, a magnetic disk, a USB flash drive, an optical disk, a read-only memory (Read-Only Memory, ROM), and the like.
本实施例提供的一种OTA升级包的下载方法、装置、计算机设备及存储介质,通过在接收到OTA升级包的下载指令时,先从OTA升级包的下载地址中下载包含有该OTA升级包的注释字段的部分文件,当该注释字段中携带的关键字,例如版本号、版本时间、校验码和/或该OTA升级包适用的市场代码与预期设置的关键字相同时,表示该下载地址中的OTA升级包为正确的升级包,此时在将该完整的OTA升级包下载下来可以保证下载的升级包就是所需的升级文件,提高了OTA升级包的下载准确性,避免下载错误的升级包造成对带宽的浪费。The present embodiment provides a method, device, computer device and storage medium for downloading an OTA upgrade package. When receiving a download instruction for an OTA upgrade package, first download the OTA upgrade package from the download address of the OTA upgrade package. Part of the file in the comment field of the comment field, when the keywords carried in the comment field, such as version number, version time, check code and/or the applicable market code of the OTA upgrade package are the same as the expected keywords, it indicates that the download The OTA upgrade package in the address is the correct upgrade package. At this time, downloading the complete OTA upgrade package can ensure that the downloaded upgrade package is the required upgrade file, which improves the download accuracy of the OTA upgrade package and avoids download errors. The upgrade package caused a waste of bandwidth.
以上参照附图说明了本发明的优选实施例,并非因此局限本发明的权利范围。本领域技术人员不脱离本发明的范围和实质,可以有多种变型方案实现本发明,比如作为一个实施例的特征可用于另一实施例而得到又一实施例。凡在运用本发明的技术构思之内所作的任何修改、等同替换和改进,均应在本发明的权利范围之内。The preferred embodiments of the present invention have been described above with reference to the accompanying drawings, but are not intended to limit the scope of the rights of the present invention. Those skilled in the art can implement the present invention in various modifications without departing from the scope and spirit of the present invention. For example, features of one embodiment can be used in another embodiment to obtain yet another embodiment. Any modifications, equivalent replacements and improvements made within the technical concept of applying the present invention shall fall within the right scope of the present invention.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201711177197.6A CN109814893A (en) | 2017-11-22 | 2017-11-22 | Method for down loading, device, computer equipment and the storage medium of OTA upgrade package |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201711177197.6A CN109814893A (en) | 2017-11-22 | 2017-11-22 | Method for down loading, device, computer equipment and the storage medium of OTA upgrade package |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN109814893A true CN109814893A (en) | 2019-05-28 |
Family
ID=66599867
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201711177197.6A Pending CN109814893A (en) | 2017-11-22 | 2017-11-22 | Method for down loading, device, computer equipment and the storage medium of OTA upgrade package |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN109814893A (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111970689A (en) * | 2020-06-29 | 2020-11-20 | 百度在线网络技术(北京)有限公司 | OTA data packet generation method and device and electronic equipment |
| CN112529759A (en) * | 2020-12-22 | 2021-03-19 | 北京百度网讯科技有限公司 | Document processing method, device, equipment, storage medium and computer program product |
| WO2025020520A1 (en) * | 2023-07-26 | 2025-01-30 | 华为技术有限公司 | Program update method, electronic device, and server |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102118640A (en) * | 2009-12-31 | 2011-07-06 | 乐金电子(中国)研究开发中心有限公司 | Digital television as well as software upgrading method and system thereof |
| CN105933150A (en) * | 2016-04-20 | 2016-09-07 | 努比亚技术有限公司 | OTA upgrade method, device and system |
| CN106909404A (en) * | 2015-12-22 | 2017-06-30 | 博雅网络游戏开发(深圳)有限公司 | Oftware updating method and system |
| WO2017161947A1 (en) * | 2016-03-23 | 2017-09-28 | 广州视睿电子科技有限公司 | Multi-system ota upgrade method and multi-system device |
-
2017
- 2017-11-22 CN CN201711177197.6A patent/CN109814893A/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102118640A (en) * | 2009-12-31 | 2011-07-06 | 乐金电子(中国)研究开发中心有限公司 | Digital television as well as software upgrading method and system thereof |
| CN106909404A (en) * | 2015-12-22 | 2017-06-30 | 博雅网络游戏开发(深圳)有限公司 | Oftware updating method and system |
| WO2017161947A1 (en) * | 2016-03-23 | 2017-09-28 | 广州视睿电子科技有限公司 | Multi-system ota upgrade method and multi-system device |
| CN105933150A (en) * | 2016-04-20 | 2016-09-07 | 努比亚技术有限公司 | OTA upgrade method, device and system |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111970689A (en) * | 2020-06-29 | 2020-11-20 | 百度在线网络技术(北京)有限公司 | OTA data packet generation method and device and electronic equipment |
| CN112529759A (en) * | 2020-12-22 | 2021-03-19 | 北京百度网讯科技有限公司 | Document processing method, device, equipment, storage medium and computer program product |
| CN112529759B (en) * | 2020-12-22 | 2024-05-14 | 北京百度网讯科技有限公司 | Document processing method, apparatus, device, storage medium, and computer program product |
| WO2025020520A1 (en) * | 2023-07-26 | 2025-01-30 | 华为技术有限公司 | Program update method, electronic device, and server |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| KR102204115B1 (en) | Patch upgrade-based file processing method and device, terminal, and storage medium | |
| US10212563B2 (en) | Updating web resources | |
| CN112631622B (en) | Application installation method, device, server and computer readable medium | |
| CN103559065B (en) | Method and system for OTA (Over-the-Air Technology) upgrade | |
| CN115129348B (en) | Resource updating method, device and equipment of application program and readable storage medium | |
| CN108512898B (en) | File pushing method and device, computer equipment and storage medium | |
| CN106325892A (en) | Method and device for difference backspacing upgrade | |
| CN104699511A (en) | Plug-in upgrading method and plug-in upgrading device | |
| US9104520B2 (en) | Method and apparatus for upgrading application | |
| CN105704177A (en) | UA identification method and device | |
| CN109814893A (en) | Method for down loading, device, computer equipment and the storage medium of OTA upgrade package | |
| CN109947450A (en) | System file upgrade method, device, mobile terminal and readable storage medium | |
| CN109840103B (en) | Method and device for updating application program container and storage medium | |
| CN110851151B (en) | Method, device, terminal, server and storage medium for preinstalling applications | |
| CN102375744A (en) | Network television upgrade method | |
| CN104636153A (en) | Android terminal and method for upgrading Android terminal | |
| CN107179918B (en) | Software processing method, device and system | |
| CN106569865B (en) | Method and device for manufacturing system upgrade file of terminal | |
| CN106130751B (en) | A kind of upgrade status data administrator, system and method | |
| CN118276887A (en) | A set-top box cross-system upgrade method, device, set-top box and storage medium | |
| CN115408040A (en) | Remote upgrading method, upgrading package manufacturing equipment, instrument equipment and storage medium | |
| CN108833128A (en) | A kind of method that equipment updates | |
| CN114064096A (en) | Application upgrading method and device, terminal and computer readable storage medium | |
| CN114253441A (en) | Target function starting method and device, storage medium and electronic device | |
| CN114968292B (en) | Program processing method, device, equipment and computer-readable storage medium |
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 | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190528 |
|
| RJ01 | Rejection of invention patent application after publication |