[go: up one dir, main page]

CN103019785B - For the treatment of the method and apparatus of program upgrade - Google Patents

For the treatment of the method and apparatus of program upgrade Download PDF

Info

Publication number
CN103019785B
CN103019785B CN201210534020.8A CN201210534020A CN103019785B CN 103019785 B CN103019785 B CN 103019785B CN 201210534020 A CN201210534020 A CN 201210534020A CN 103019785 B CN103019785 B CN 103019785B
Authority
CN
China
Prior art keywords
data
file
upgrade
client
feature information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201210534020.8A
Other languages
Chinese (zh)
Other versions
CN103019785A (en
Inventor
王东玉
苏云琳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qax Technology Group Inc
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201210534020.8A priority Critical patent/CN103019785B/en
Publication of CN103019785A publication Critical patent/CN103019785A/en
Application granted granted Critical
Publication of CN103019785B publication Critical patent/CN103019785B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a kind of method and apparatus for the treatment of program upgrade, relate to field of computer technology.Described device comprises: executable file generation module; Upgrade request receiver module; Judge module; Upgrade data provides module; Wherein, in listing file each upgrade data file feature information in also comprise the check information of upgrade data section; Also comprise in client: correction verification module, after being suitable for the complete described upgrade data of client downloads, calculate the check information of described upgrade data, and the check information of this upgrade data in described check information and listing file data is compared; If verification is passed through, then store described upgrade data section; If verify unsuccessfully, then notify upgrade data mistake described in client.The all installation procedure versions of the present invention only have portion, so fully ensure that FileVersion consistance, reduce the quantity of file, the efficiency of Deterministic service device locating file, improve the download efficiency of server, can also save disk storage space.

Description

用于处理程序升级的方法和装置Method and device for processing program upgrades

技术领域technical field

本发明涉及计算机技术领域,具体涉及一种用于处理程序升级的方法和装置。The invention relates to the technical field of computers, in particular to a method and device for processing program upgrades.

背景技术Background technique

对于程序升级来说,比如游戏程序等应用程序,一般存在两种方式:For program upgrades, such as game programs and other applications, there are generally two ways:

一是整包升级,就是将一个程序版本的所有文件组合安装包,由终端升级程序下载之后执行对原有版本进行安装或升级。One is the whole package upgrade, which is to combine all the files of a program version into an installation package, and then install or upgrade the original version after the terminal upgrade program downloads it.

二是差异升级,方式是将数据文件按照某种方式存储,并形成一个数据文件列表,将这些数据文件的部分信息写入,终端的升级程序先下载数据文件列表并与本地文件比对,形成差异列表,之后下载相应的数据文件进行升级。The second is differential upgrade. The method is to store the data files in a certain way, and form a list of data files, and write some information of these data files. The upgrade program of the terminal first downloads the list of data files and compares them with the local files to form List of differences, and then download the corresponding data files to upgrade.

但是在实际中,现有技术可对产品隔一段时间做一次新版本,以使新用户无需从原始版本开始安装,然后逐个升级至最新版本。But in practice, the existing technology can make a new version of the product at intervals, so that new users do not need to install from the original version, and then upgrade to the latest version one by one.

比如,对于一个初始版本安装包A,其后续数据文件包括数据文件A1,数据文件A2,为了保证客户端能够进行差异升级需要一个单独的列表文件L1将对A,A1,A2的相关信息进行顺序存储。而为了使后续新的用户可以直接安装当前最新的产品,则可将A+A1+A2做成第二版的安装包B,而在此之后出现的数据文件针对第二版的数据文件B1,B2,那么为了保证安装初始版本的客户端和第二版本的客户端均可正常升级,那么需要对初始版本的数据文件重新更改列表文件,并针对第二版本的数据文件更改列表文件;那么以此类推,如果为了使客户端不用从初始版本开始安装产品,并逐个升级至最新状态,随着升级的数据的增加,其版本可能越来越多,存在于服务器中的文件相应增加量更多。For example, for an initial version installation package A, its subsequent data files include data file A1 and data file A2. In order to ensure that the client can perform differential upgrades, a separate list file L1 is required to sequence the relevant information of A, A1, and A2 storage. In order to allow subsequent new users to directly install the latest products, A+A1+A2 can be made into the second version of the installation package B, and the data files that appear after that are for the second version of the data file B1. B2, in order to ensure that both the client with the initial version and the client with the second version can be upgraded normally, it is necessary to re-change the list file for the data file of the initial version, and change the list file for the data file of the second version; then By analogy, if the client does not need to install the product from the initial version and upgrades to the latest state one by one, with the increase of the upgraded data, there may be more and more versions, and the files stored in the server will increase correspondingly. .

对于整包升级,文件的一致性比较好,不用考虑版本问题,下载逻辑比较简单,但对于用户来说,下载量比较大,每次升级都会有较多的冗余数据。For whole-package upgrades, the consistency of the files is better, and the download logic is relatively simple without considering the version issue. However, for users, the download volume is relatively large, and each upgrade will have more redundant data.

对于差异升级,只下载差异数据,缺点是文件量很大,但是对于前述情况,如果针对同一产品,其版本很多的时,首先,由于各版本的文件之间需要保持一致,那么随着版本的大量增加,各种版本相应的文件数量增加,导致维持各种版本文件的一致性的逻辑也越来越复杂。其次,由于服务器中存在各种版本的文件,导致目录中文件过多,而对于某个客户端的升级请求,服务器查询其存储的相应于所述升级请求的文件时,需要遍历的文件也非常庞大,影响服务器性能。再次,由于相应文件个数相对很多,对于存储和管理不方便,并且占用存储空间也大。For differential upgrade, only the differential data is downloaded. The disadvantage is that the file size is large. However, for the aforementioned situation, if there are many versions for the same product, first of all, because the files of each version need to be consistent, then as the version With a large increase, the number of corresponding files in various versions increases, resulting in more and more complicated logic for maintaining the consistency of files in various versions. Secondly, due to the existence of various versions of files in the server, there are too many files in the directory, and for an upgrade request from a certain client, when the server queries the files stored in it corresponding to the upgrade request, the files that need to be traversed are also very large , affecting server performance. Again, due to the relatively large number of corresponding files, it is inconvenient for storage and management, and takes up a large storage space.

发明内容Contents of the invention

鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的一种用于处理程序升级的装置、系统和相应的一种用于处理程序升级的方法。In view of the above problems, the present invention is proposed to provide an apparatus and system for processing program upgrades and a corresponding method for processing program upgrades that overcome the above problems or at least partially solve the above problems.

依据本发明的一个方面,提供了一种用于处理程序升级的方法,包括:According to one aspect of the present invention, a method for processing program upgrades is provided, including:

生成一个可执行文件,所述可执行文件用于:将用于原始安装的升级数据、以及后续新获得的用于升级的升级数据存入所述可执行文件数据区,并在所述升级数据区的指定字节位置或数据段存储列表文件数据;所述列表文件数据记录的包括:安装数据和各升级数据的文件特征信息,和安装数据和各升级数据在数据区中存储的字节位置或数据段;An executable file is generated, and the executable file is used to: store the upgrade data used for the original installation and the upgrade data newly obtained for the upgrade into the executable file data area, and store the upgrade data in the upgrade data area The specified byte position or data segment in the area stores the list file data; the list file data records include: the file feature information of the installation data and each upgrade data, and the byte positions of the installation data and each upgrade data stored in the data area or data segment;

基于所述可执行文件的程序升级下载过程包括:The program upgrade download process based on the executable file includes:

接收客户端的程序升级下载请求;Receive a program upgrade download request from the client;

根据所述程序升级下载请求,获取所述可执行文件数据区中指定字节位置或数据段存储的第一列表文件数据和获取对应客户端可执行文件的第二列表文件数据,并比较所述第一列表文件数据和第二列表文件数据的文件特征信息,判断是否存在客户端未下载的升级数据;According to the program upgrade download request, obtain the first list file data stored in the specified byte position or data segment in the executable file data area and obtain the second list file data of the corresponding client executable file, and compare the The file characteristic information of the first list file data and the second list file data, judge whether there is the upgrade data that the client has not downloaded;

如果存在,则根据列表文件数据记录的所述升级数据在在数据区中存储的字节位置或数据段,从所述可执行文件数据区中提取升级数据并将所升级数据提供给客户端下载;If it exists, extract the upgrade data from the executable file data area and provide the upgraded data to the client for downloading according to the byte position or data segment stored in the data area of the upgrade data recorded in the list file data ;

其中,所述列表文件数据中各升级数据的文件特征信息中还包括升级数据段的校验信息;Wherein, the file feature information of each upgrade data in the list file data also includes check information of the upgrade data segment;

进一步的,当所述客户端下载完所述升级数据后,计算所述升级数据的校验信息,并将所述校验信息与列表文件数据中该升级数据的校验信息进行比较;Further, after the client downloads the upgrade data, calculate the verification information of the upgrade data, and compare the verification information with the verification information of the upgrade data in the list file data;

如果校验通过,则存储所述升级数据段;If the verification is passed, the upgrade data segment is stored;

如果校验失败,则通知客户端所述升级数据错误。If the verification fails, the client is notified that the upgrade data is wrong.

可选的,所述根据所述程序升级下载请求,获取所述可执行文件数据区中指定字节位置或数据段存储的第一列表文件数据和获取对应客户端可执行文件的第二列表文件数据,并比较所述第一列表文件数据和第二列表文件数据的文件特征信息,判断是否存在客户端未下载的数据包括:Optionally, according to the program upgrade download request, obtain the first list file data stored in the specified byte position or data segment in the executable file data area and obtain the second list file corresponding to the client executable file data, and compare the file characteristic information of the first list file data and the second list file data, and judge whether there is data not downloaded by the client, including:

从所述可执行文件数据区的指定字节位置或者数据段中,提取第一列表文件数据;Extracting the first list file data from the specified byte position or data segment of the executable file data area;

通知客户端将其可执行文件中的第二列表文件数据上传;Notify the client to upload the second list file data in its executable file;

将第二列表文件数据与第一列表文件数据的文件特征信息比较,获得的客户端未下载的升级数据在所述可执行文件数据区中存储的字节位置或数据段。Comparing the file feature information of the second list file data with the first list file data, obtain the byte position or data segment of the upgrade data not downloaded by the client in the executable file data area.

可选的,所述根据所述程序升级下载请求,获取所述可执行文件数据区中指定字节位置或数据段存储的第一列表文件数据和获取对应客户端可执行文件的第二列表文件数据,并比较所述第一列表文件数据和第二列表文件数据的文件特征信息,判断是否存在客户端未下载的升级数据包括:Optionally, according to the program upgrade download request, obtain the first list file data stored in the specified byte position or data segment in the executable file data area and obtain the second list file corresponding to the client executable file data, and compare the file feature information of the first list file data and the second list file data, and judge whether there is an upgrade data not downloaded by the client, including:

从所述可执行文件数据区的指定字节位置或者数据段中,提取第一列表文件数据提供给客户端下载;From the specified byte position or data segment of the executable file data area, extract the first list file data and provide it to the client for downloading;

接收客户端发送的升级数据下载请求;所述升级数据下载请求包括:通过客户端提取本地的第二列表文件数据,并将第二列表文件数据与第一列表文件数据的文件特征信息比较后,获得的客户端未下载的升级数据在所述可执行文件数据区中存储的字节位置或数据段。Receiving an upgrade data download request sent by the client; the upgrade data download request includes: extracting the local second list file data through the client, and comparing the second list file data with the file feature information of the first list file data, The obtained byte position or data segment of the upgrade data not downloaded by the client is stored in the executable file data area.

可选的,所述将第二列表文件数据与第一列表文件数据的文件特征信息比较,获得的客户端未下载的数据在所述可执行文件数据区中存储的字节位置或数据段包括:Optionally, the second list file data is compared with the file feature information of the first list file data, and the obtained byte position or data segment of the data not downloaded by the client in the executable file data area includes :

将第一列表文件数据中的各升级数据的文件特征信息,并与第二列表文件数据中的各升级数据的文件特征信息进行比较,判断是否出现新的文件特征信息;Comparing the file characteristic information of each upgraded data in the first list file data with the file characteristic information of each upgraded data in the second list file data, and judging whether there is new file characteristic information;

如果未出现新的文件特征信息,则可判断客户端下载已经结束;If no new file feature information appears, it can be judged that the client download has ended;

如果出现新的文件特征信息,则从列表文件数据中提取所述新的文件特征信息对应的字节位置或者数据段。If new file feature information appears, the byte position or data segment corresponding to the new file feature information is extracted from the list file data.

可选的,所述列表文件中的各升级数据的文件特征信息,按升级先后使用顺序记录;所述升级数据在所述可执行文件中按升级先后使用顺序存储。Optionally, the file feature information of each upgrade data in the list file is recorded in the order of upgrade and use; the upgrade data is stored in the executable file in the order of upgrade and use.

可选的,所述将第二列表文件数据与第一列表文件数据的文件特征信息比较,获得的客户端未下载的数据在所述可执行文件数据区中存储的字节位置或数据段包括:Optionally, the second list file data is compared with the file feature information of the first list file data, and the obtained byte position or data segment of the data not downloaded by the client in the executable file data area includes :

按顺序逐个将第一列表文件数据中升级数据的文件特征信息与本第二列表文件数据中升级数据的文件特征信息进行比较,判断是否出现新的文件特征信息;Compare the file feature information of the upgrade data in the first list file data one by one with the file feature information of the upgrade data in the second list file data in order to judge whether there is new file feature information;

如果出现新的文件特征信息,则停止比较,并从列表文件数据中提取所述新的文件特征信息对应的字节位置或者数据段。If new file feature information appears, the comparison is stopped, and the byte position or data segment corresponding to the new file feature information is extracted from the list file data.

可选的,所述根据所述客户端未下载的升级数据在所述可执行文件数据区中存储的字节位置或数据段,从可执行文件的数据区中提取数据并将所述升级数据提供给客户端下载包括:Optionally, according to the byte position or data segment stored in the executable file data area of the upgrade data not downloaded by the client, extracting data from the executable file data area and storing the upgrade data Downloads provided to clients include:

从可执行文件的所述字节位置或者数据段开始提取升级数据的字节流发送给客户端。The byte stream of the upgrade data is extracted from the byte position or data segment of the executable file and sent to the client.

依据本发明的另一个方面,提供了一种用于处理程序升级的装置,包括:According to another aspect of the present invention, a device for processing program upgrades is provided, including:

可执行文件生成模块,适于生成一个可执行文件,所述可执行文件用于:将用于原始安装的升级数据、以及后续新获得的用于升级的升级数据存入所述可执行文件数据区,并在所述升级数据区的指定字节位置或数据段存储列表文件数据;所述列表文件数据记录的包括:安装数据和各升级数据的文件特征信息,和安装数据和各升级数据在数据区中存储的字节位置或数据段;Executable file generation module, adapted to generate an executable file, the executable file is used to: store the upgrade data for the original installation and the upgrade data for the upgrade newly obtained subsequently into the executable file data area, and store the list file data in the specified byte position or data segment of the upgrade data area; the list file data record includes: the file feature information of the installation data and each upgrade data, and the installation data and each upgrade data in The byte position or data segment stored in the data area;

升级请求接收模块,适于接收客户端的程序升级下载请求;An upgrade request receiving module, adapted to receive a program upgrade download request from the client;

判断模块,适于根据所述程序升级下载请求,获取所述可执行文件数据区中指定字节位置或数据段存储的第一列表文件数据和获取对应客户端可执行文件的第二列表文件数据,并比较所述第一列表文件数据和第二列表文件数据的文件特征信息,判断是否存在客户端未下载的升级数据;The judging module is adapted to obtain the first list file data stored in the specified byte position or data segment in the executable file data area and obtain the second list file data corresponding to the client executable file according to the program upgrade download request , and compare the file characteristic information of the first list file data and the second list file data, and judge whether there is upgrade data not downloaded by the client;

升级数据提供模块,适于如果存在,则根据列表文件数据记录的所述升级数据在在数据区中存储的字节位置或数据段,从所述可执行文件数据区中提取升级数据并将所升级数据提供给客户端下载;The upgrade data providing module is adapted to extract the upgrade data from the executable file data area according to the byte position or data segment stored in the data area of the upgrade data recorded in the list file data, if it exists The upgrade data is provided to the client for download;

其中,所述列表文件中各升级数据的文件特征信息中还包括升级数据段的校验信息;Wherein, the file feature information of each upgrade data in the list file also includes check information of the upgrade data segment;

进一步的,在所述客户端还包括:Further, the client also includes:

校验模块,适于所述客户端下载完所述升级数据后,计算所述升级数据的校验信息,并将所述校验信息与列表文件数据中该升级数据的校验信息进行比较;The verification module is adapted to calculate the verification information of the upgraded data after the client downloads the upgraded data, and compare the verified information with the verified information of the upgraded data in the list file data;

如果校验通过,则存储所述升级数据段;If the verification is passed, the upgrade data segment is stored;

如果校验失败,则通知客户端所述升级数据错误。If the verification fails, the client is notified that the upgrade data is wrong.

可选的,所述判断模块包括:Optionally, the judging module includes:

第一列表文件提取模块一,适于从所述可执行文件数据区的指定字节位置或者数据段中,提取第一列表文件数据;The first list file extraction module one is adapted to extract the first list file data from the specified byte position or data segment of the executable file data area;

第二列表文件获取模块一,适于通知客户端将其可执行文件中的第二列表文件数据上传;The second list file acquisition module 1 is adapted to notify the client to upload the second list file data in its executable file;

第一判断模块,适于将第二列表文件数据与第一列表文件数据的文件特征信息比较,获得的客户端未下载的升级数据在所述可执行文件数据区中存储的字节位置或数据段。The first judging module is adapted to compare the file feature information of the second list file data with the first list file data, and obtain the byte position or data stored in the executable file data area of the upgrade data not downloaded by the client part.

可选的,所述判断模块包括:Optionally, the judging module includes:

第一列表文件提取模块二,适于从所述可执行文件数据区的指定字节位置或者数据段中,提取第一列表文件数据提供给客户端下载;The first list file extraction module 2 is adapted to extract the first list file data from the specified byte position or data segment of the executable file data area and provide it to the client for downloading;

升级数据下载请求接收模块,适于接收客户端发送的升级数据下载请求;所述升级数据下载请求包括:通过客户端提取本地的第二列表文件数据,并将第二列表文件数据与第一列表文件数据的文件特征信息比较后,获得的客户端未下载的升级数据在所述可执行文件数据区中存储的字节位置或数据段。The upgrade data download request receiving module is adapted to receive the upgrade data download request sent by the client; the upgrade data download request includes: extracting the local second list file data through the client, and combining the second list file data with the first list After the file feature information of the file data is compared, the obtained byte position or data segment of the upgrade data not downloaded by the client is stored in the executable file data area.

可选的,所述判断模块包括:Optionally, the judging module includes:

第二判断模块,适于将第一列表文件数据中的各升级数据的文件特征信息,并与第二列表文件数据中的各升级数据的文件特征信息进行比较,判断是否出现新的文件特征信息;如果未出现新的文件特征信息,则可判断客户端下载已经结束;如果出现新的文件特征信息,则从列表文件数据中提取所述新的文件特征信息对应的字节位置或者数据段。The second judging module is adapted to compare the file feature information of each upgrade data in the first list file data with the file feature information of each upgrade data in the second list file data, and judge whether new file feature information appears ; If there is no new file feature information, it can be judged that the client download has ended; if there is new file feature information, then extract the byte position or data segment corresponding to the new file feature information from the list file data.

可选的,所述列表文件中的各升级数据的文件特征信息,按升级先后使用顺序记录;所述升级数据在所述可执行文件中按升级先后使用顺序存储。Optionally, the file feature information of each upgrade data in the list file is recorded in the order of upgrade and use; the upgrade data is stored in the executable file in the order of upgrade and use.

可选的,所述判断模块包括:Optionally, the judging module includes:

第二判断模块,适于按顺序逐个将第一列表文件数据中升级数据的文件特征信息与本第二列表文件数据中升级数据的文件特征信息进行比较,判断是否出现新的文件特征信息;The second judging module is adapted to compare the file characteristic information of the upgraded data in the first list file data one by one with the file characteristic information of the upgraded data in the second list file data one by one, and judge whether new file characteristic information appears;

如果出现新的文件特征信息,则停止比较,并从列表文件数据中提取所述新的文件特征信息对应的字节位置或者数据段。If new file feature information appears, the comparison is stopped, and the byte position or data segment corresponding to the new file feature information is extracted from the list file data.

可选的,所述升级数据提供模块包括:Optionally, the upgrade data providing module includes:

第一提取模块,适于从可执行文件的所述字节位置或者数据段开始提取升级数据的字节流发送给客户端。The first extraction module is adapted to extract the byte stream of the upgrade data from the byte position or the data segment of the executable file and send it to the client.

根据本发明的一种用于处理程序升级的方法可以在服务器将所有各种适于升级的数据,与初始安装程序设置于同一可执行文件中,然后在该可执行文件中指定一个固定位置存放列表文件数据,所述列表文件数据各种版本的适于升级的数据段的文件特征信息,该文件特征信息包括各适于升级的数据段存储于该可执行文件中的位置;那么基于此可执行文件,客户端对原产品进行升级时,则首先从服务器获取该可执行文件指定位置的列表文件数据,对其进行解析并与本地列表文件数据进行比较,判断是否存在需要下载的数据段,如果存在则从服务器中所述可执行文件的该数据段所在位置下载该数据,即可进行升级。According to a method for processing program upgrades of the present invention, all various data suitable for upgrading can be set in the same executable file as the initial installation program on the server, and then a fixed location is specified in the executable file to store List file data, the file feature information of the data segments suitable for upgrading of various versions of the list file data, the file feature information includes the location where each data segment suitable for upgrading is stored in the executable file; then based on this, it can be Executing the file, when the client upgrades the original product, it first obtains the list file data at the specified location of the executable file from the server, parses it and compares it with the local list file data to determine whether there is a data segment that needs to be downloaded. If it exists, download the data from the location of the data segment of the executable file in the server, and then upgrade.

本发明由此解决了现有技术中:The present invention thus solves in the prior art:

首先由于各版本的文件之间需要保持一致,那么随着版本的大量增加,各种版本相应的文件数量增加,导致维持各种版本文件的一致性的逻辑也越来越复杂;First of all, because the files of each version need to be consistent, with the large increase of versions, the number of corresponding files of each version increases, resulting in the logic of maintaining the consistency of files of various versions becoming more and more complicated;

其次,由于服务器中存在各种版本的文件,导致目录中文件过多,而对于某个客户端的升级请求,服务器查询其存储的相应于所述升级请求的文件时,需要遍历的文件也非常庞大,影响服务器性能。Secondly, due to the existence of various versions of files in the server, there are too many files in the directory, and for an upgrade request from a certain client, when the server queries the files stored in it corresponding to the upgrade request, the files that need to be traversed are also very large , affecting server performance.

再次,由于相应文件个数相对很多,对于存储和管理不方便,并且占用存储空间也大的问题;Thirdly, due to the relatively large number of corresponding files, it is inconvenient for storage and management, and it also takes up a lot of storage space;

本发明取得了如下的有益效果:The present invention has obtained following beneficial effect:

首先,升级数据和安装程序文件只有一份可执行文件,不用为最新用户做新版本安装程序,所有安装程序版本只有一份,那么充分保证了文件版本一致性;First of all, there is only one executable file for the upgrade data and the installer file, and there is no need to make a new version installer for the latest users. There is only one copy for all installer versions, so the consistency of the file version is fully guaranteed;

其次,并且大大减少文件了的数量,保证服务器查找文件的效率;Secondly, and greatly reduce the number of files to ensure the efficiency of the server to find files;

再次,文件量很小,可以有针对性的对文件进行缓存,提高服务器的下载效率;最后还能大大节省磁盘存储空间的有益效果。Again, the file size is small, and the files can be cached in a targeted manner to improve the download efficiency of the server; finally, it can also greatly save the beneficial effect of disk storage space.

上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, it can be implemented according to the contents of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable , the specific embodiments of the present invention are enumerated below.

附图说明Description of drawings

通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅适于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiment. The drawings are only for the purpose of illustrating a preferred embodiment and are not to be considered as limiting the invention. Also throughout the drawings, the same reference numerals are used to designate the same components. In the attached picture:

图1示出了根据本发明一个实施例的一种程序升级下载的方法实施例一的流程示意图;FIG. 1 shows a schematic flowchart of Embodiment 1 of a method for program upgrade and download according to an embodiment of the present invention;

图2示出了根据本发明一个实施例的一种程序升级下载方法实施例二的流程示意图;FIG. 2 shows a schematic flowchart of Embodiment 2 of a program upgrade downloading method according to an embodiment of the present invention;

图3示出了根据本发明一个实施例的可执行文件的磁盘文件结构示意图;FIG. 3 shows a schematic diagram of a disk file structure of an executable file according to an embodiment of the present invention;

图4示出了根据本发明一个实施例的一种程序升级下载装置的结构示意图;以及Fig. 4 shows a schematic structural diagram of a program upgrade downloading device according to an embodiment of the present invention; and

图5示出了根据本发明一个实施例的一种程序升级下载系统的结构示意图。Fig. 5 shows a schematic structural diagram of a program upgrade downloading system according to an embodiment of the present invention.

具体实施方式Detailed ways

下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

参照图1其示出了本发明一种用于处理程序升级的方法实施例一的流程示意图,具体可以包括:Referring to FIG. 1, it shows a schematic flowchart of Embodiment 1 of a method for processing program upgrades according to the present invention, which may specifically include:

步骤S100,生成一个可执行文件,所述可执行文件用于:将用于原始安装的升级数据、以及后续新获得的用于升级的升级数据存入所述可执行文件数据区,并在所述升级数据区的指定字节位置或数据段存储列表文件数据;所述列表文件数据记录的包括:安装数据和各升级数据的文件特征信息,和安装数据和各升级数据在数据区中存储的字节位置或数据段;Step S100, generate an executable file, and the executable file is used to: store the upgrade data used for the original installation and the upgrade data newly obtained for the upgrade in the executable file data area, and store the upgrade data in the executable file data area. The specified byte position or data segment of the upgrade data area stores the list file data; the list file data records include: the file feature information of the installation data and each upgrade data, and the storage of the installation data and each upgrade data in the data area byte position or data segment;

在本发明实施例中,针对安装程序会设置一个可执行文件,其中可执行文件如windows系统中的.exe,.dll等结构的文件。其中,如图3,其示出了可执行文件(即PE文件,PE文件被称为可移植的执行体是PortableExecute的全称,常见的EXE、DLL、OCX、SYS、COM都是PE文件)的磁盘文件结构,可执行文件包括DOS文件头、PE头部、Sections表、代码段、重定位数据段和数据区(即各个数据段)。在一个PE文件的开始处,我们会看到一个DOS文件头,它使任何PE文件都是一个有效的MS-DOS可执行文件。之后是文件头(按COFF格式),用来说明该二进制文件将运行在何种机器之上、分几个区段、链接的时间、是可执行文件还是DLL、等等,后面包括Section表,即“数据目录”数组;这些目录包含许多指向各“段”数据的指针。之后就是数据段,各节中的内容才是你执行一个程序真正需要的东西,代码段和重定位数据段存储产品的安装逻辑,数据区中指定位置存储了列表文件数据,并且存储了升级数据。所述列表文件数据记录的内容包括:存储在所述可执行文件的数据区中各适于升级的升级数据的文件特征信息,所述文件特征信息包括各升级数据的文件特征信息、和相对可执行文件的在数据区的字节位置或者数据段。In the embodiment of the present invention, an executable file is set for the installation program, wherein the executable file is a file with a structure such as .exe, .dll, etc. in the windows system. Wherein, as Fig. 3, it has shown executable file (being PE file, and PE file is referred to as portable execution body and is the full name of PortableExecute, and common EXE, DLL, OCX, SYS, COM are all PE files) Disk file structure, executable file includes DOS file header, PE header, Sections table, code segment, relocation data segment and data area (that is, each data segment). At the beginning of a PE file, we see a DOS header, which makes any PE file a valid MS-DOS executable. After that is the file header (in COFF format), which is used to explain what kind of machine the binary file will run on, how many sections, link time, whether it is an executable file or a DLL, etc., followed by the Section table, That is, an array of "data directories"; these directories contain many pointers to the data of each "segment". After that is the data section. The content in each section is what you really need to execute a program. The code section and the relocation data section store the installation logic of the product. The specified location in the data area stores the list file data and upgrade data. . The content of the list file data record includes: the file characteristic information of each upgrade data suitable for upgrading stored in the data area of the executable file, the file characteristic information includes the file characteristic information of each upgrade data, and the relative The byte position or data segment of the executable file in the data area.

本发明的原始升级数据(可以理解为初始安装程序),和后续的升级数据(可以理解为后续的升级包)通过上述步骤设置在一个可执行文件中。The original upgrade data of the present invention (which can be understood as an initial installation program) and subsequent upgrade data (which can be understood as a subsequent upgrade package) are set in an executable file through the above steps.

在本发明实施例中,从服务器侧说明本发明的实施过程。In the embodiment of the present invention, the implementation process of the present invention is described from the server side.

基于所述可执行文件的程序升级下载过程包括:The program upgrade download process based on the executable file includes:

步骤S110,接收客户端的程序升级下载请求;Step S110, receiving a program upgrade download request from the client;

客户端可发送程序升级下载请求至服务器,以通知服务器针对该客户端进行程序升级下载流程。具体的程序升级下载请求可包括客户端的身份信息,比如IP地址信息等。The client can send a program upgrade download request to the server to notify the server to perform a program upgrade download process for the client. The specific program upgrade download request may include the identity information of the client, such as IP address information.

步骤S120,根据所述程序升级下载请求,获取所述可执行文件数据区中指定字节位置或数据段存储的第一列表文件数据和获取对应客户端可执行文件的第二列表文件数据,并比较所述第一列表文件数据和第二列表文件数据的文件特征信息,判断是否存在客户端未下载的升级数据;Step S120, according to the program upgrade download request, obtain the first list file data stored in the specified byte position or data segment in the executable file data area and obtain the second list file data corresponding to the client executable file, and Comparing the file characteristic information of the first list file data and the second list file data, and judging whether there is upgrade data not downloaded by the client;

在服务器侧提供的可执行文件中的指定字节位置或者数据段存在一个第一列表文件数据,在客户端存对应可执行文件的第二列表文件数据,那么即可将第一列表文件数据的文件特征信息和第二列表文件数据的文件特征信息进行比较,判断服务器侧的可执行文件中是否存在客户端未下载的升级数据的文件特征信息,从而可获知服务器侧的可执行文件中是否存在客户端未下载的升级数据。There is a first list file data at the specified byte position or data segment in the executable file provided by the server side, and the second list file data corresponding to the executable file is stored on the client side, then the first list file data can be The file feature information is compared with the file feature information of the second list file data, and it is judged whether there is file feature information of the upgrade data not downloaded by the client in the executable file on the server side, so as to know whether there is any in the executable file on the server side. Update data not downloaded by the client.

可选的,所述根据所述程序升级下载请求,获取所述可执行文件数据区中指定字节位置或数据段存储的第一列表文件数据和获取对应客户端可执行文件的第二列表文件数据,并比较所述第一列表文件数据和第二列表文件数据的文件特征信息,判断是否存在客户端未下载的数据包括:Optionally, according to the program upgrade download request, obtain the first list file data stored in the specified byte position or data segment in the executable file data area and obtain the second list file corresponding to the client executable file data, and compare the file characteristic information of the first list file data and the second list file data, and judge whether there is data not downloaded by the client, including:

步骤S11,服务器从所述可执行文件数据区的指定字节位置或者数据段中,提取第一列表文件数据;Step S11, the server extracts the first list file data from the specified byte position or data segment of the executable file data area;

服务器从服务器侧的可执行文件数据区的指定字节位置或者数据段中,提取第一列表文件数据。The server extracts the first list file data from the specified byte position or data segment of the executable file data area on the server side.

步骤S12,服务器通知客户端将其可执行文件中的第二列表文件数据上传;Step S12, the server notifies the client to upload the second list file data in its executable file;

服务器通知客户端将客户端中的可执行文件中的第二列表文件数据上传The server notifies the client to upload the second list file data in the executable file in the client

步骤S13,服务器将第二列表文件数据与第一列表文件数据的文件特征信息比较,获得的客户端未下载的升级数据在所述可执行文件数据区中存储的字节位置或数据段。Step S13, the server compares the file feature information of the second list file data with the first list file data, and obtains the byte position or data segment of the upgrade data not downloaded by the client in the executable file data area.

服务器将第二列表文件数据与第一列表文件数据的文件特征信息比较,获得的客户端未下载的升级数据在所述可执行文件数据区中存储的字节位置或数据段。The server compares the file feature information of the second list file data with the first list file data, and obtains the byte position or data segment of the upgrade data not downloaded by the client in the executable file data area.

可选的,所述根据所述程序升级下载请求,获取所述可执行文件数据区中指定字节位置或数据段存储的第一列表文件数据和获取对应客户端可执行文件的第二列表文件数据,并比较所述第一列表文件数据和第二列表文件数据的文件特征信息,判断是否存在客户端未下载的升级数据包括:Optionally, according to the program upgrade download request, obtain the first list file data stored in the specified byte position or data segment in the executable file data area and obtain the second list file corresponding to the client executable file data, and compare the file feature information of the first list file data and the second list file data, and judge whether there is an upgrade data not downloaded by the client, including:

步骤S21,服务器从所述可执行文件数据区的指定字节位置或者数据段中,提取第一列表文件数据提供给客户端下载;Step S21, the server extracts the first list file data from the specified byte position or data segment of the executable file data area and provides it to the client for downloading;

步骤S22,客户端提取本地的第二列表文件数据,并将第二列表文件数据与第一列表文件数据的文件特征信息比较后,获得的客户端未下载的升级数据在所述可执行文件数据区中存储的字节位置或数据段;Step S22, the client extracts the local second list file data, and compares the second list file data with the file feature information of the first list file data, and obtains the upgrade data not downloaded by the client in the executable file data The byte location or data segment stored in the zone;

步骤S23,客户端根据所述客户端未下载的升级数据在所述可执行文件数据区中存储的字节位置或数据段生成升级数据下载请求,并发送的升级数据下载请求至服务器;Step S23, the client generates an upgrade data download request according to the byte position or data segment stored in the executable file data area of the upgrade data not downloaded by the client, and sends the upgrade data download request to the server;

步骤S24,服务器接收客户端发送的升级数据下载请求。Step S24, the server receives the upgrade data download request sent by the client.

即服务器接收客户端发送的升级数据下载请求,而所述升级数据下载请求包括客户端未下载的升级数据在所述可执行文件数据区中存储的字节位置或数据段。That is, the server receives the upgrade data download request sent by the client, and the upgrade data download request includes the byte position or data segment of the upgrade data not downloaded by the client stored in the executable file data area.

可选的,所述将第二列表文件数据与第一列表文件数据的文件特征信息比较,获得的客户端未下载的数据在所述可执行文件数据区中存储的字节位置或数据段包括:Optionally, the second list file data is compared with the file feature information of the first list file data, and the obtained byte position or data segment of the data not downloaded by the client in the executable file data area includes :

步骤S31,将第一列表文件数据中的各升级数据的文件特征信息,并与第二列表文件数据中的各升级数据的文件特征信息进行比较,判断是否出现新的文件特征信息;Step S31, comparing the file characteristic information of each upgraded data in the first list file data with the file characteristic information of each upgraded data in the second list file data, and judging whether new file characteristic information appears;

步骤S32,如果未出现新的文件特征信息,则可判断客户端下载已经结束;Step S32, if there is no new file feature information, it can be judged that the client download has ended;

步骤S33,如果出现新的文件特征信息,则从列表文件数据中提取所述新的文件特征信息对应的字节位置或者数据段。Step S33, if new file feature information appears, extract the byte position or data segment corresponding to the new file feature information from the list file data.

可选的,所述列表文件中的各升级数据的文件特征信息,按升级先后使用顺序记录;所述升级数据在所述可执行文件中按升级先后使用顺序存储。Optionally, the file feature information of each upgrade data in the list file is recorded in the order of upgrade and use; the upgrade data is stored in the executable file in the order of upgrade and use.

即将升级数据按升级先后顺序存入服务器的可执行文件的数据区中。The data to be upgraded is stored in the data area of the executable file of the server in the order of the upgrade sequence.

进一步的,所述将第二列表文件数据与第一列表文件数据的文件特征信息比较,获得的客户端未下载的数据在所述可执行文件数据区中存储的字节位置或数据段包括:Further, comparing the second list file data with the file feature information of the first list file data, the obtained byte position or data segment of the data not downloaded by the client stored in the executable file data area includes:

步骤S41,按顺序逐个将第一列表文件数据中升级数据的文件特征信息与本第二列表文件数据中升级数据的文件特征信息进行比较,判断是否出现新的文件特征信息;Step S41, comparing the file characteristic information of the upgraded data in the first list of file data one by one with the file characteristic information of the upgraded data in the second list of file data in order, and judging whether there is new file characteristic information;

步骤S42,如果出现新的文件特征信息,则停止比较,并从列表文件数据中提取所述新的文件特征信息对应的字节位置或者数据段。Step S42, if new file feature information appears, stop the comparison, and extract the byte position or data segment corresponding to the new file feature information from the list file data.

因为可执行文件中按顺序进行存储,那么指定字节位置或者数据段中的列表文件数据也可按顺序进行记录,那么则可按顺序逐个将第一列表文件数据中升级数据的文件特征信息与本第二列表文件数据中升级数据的文件特征信息进行比较,判断是否出现新的文件特征信息,如果出现新的文件特征信息,则停止比较,那么可节省的比较时间。Because the executable file is stored in order, the list file data in the specified byte position or data segment can also be recorded in order, so the file characteristic information and the file feature information of the upgrade data in the first list file data can be sequentially recorded one by one. The file feature information of the upgraded data in the second list of file data is compared to determine whether new file feature information appears, and if new file feature information appears, the comparison is stopped, so that the comparison time can be saved.

步骤S130,如果存在,则根据列表文件数据记录的所述升级数据在在数据区中存储的字节位置或数据段,从所述可执行文件数据区中提取升级数据并将所升级数据提供给客户端下载。Step S130, if it exists, extract the upgrade data from the executable file data area and provide the upgrade data to Client Downloads.

因升级数据下载请求提示了从可执行文件的哪个位置提取数据提供给客户端下载以进行升级,那么服务器即可根据该提示的各位置,从可执行文件中提取数据提供给客户端下载。Since the upgrade data download request indicates which location of the executable file to extract data from and provide to the client for downloading for upgrading, the server can extract data from the executable file and provide the client to download according to each location prompted.

可选的,在前步骤S52,的情况下,所述根据所述客户端未下载的升级数据在所述可执行文件数据区中存储的字节位置或数据段,从可执行文件的数据区中提取数据并将所述升级数据提供给客户端下载包括:Optionally, in the case of the previous step S52', the byte position or data segment stored in the data area of the executable file according to the upgrade data not downloaded by the client is obtained from the data area of the executable file Extracting data from and providing the upgrade data to the client for downloading includes:

步骤S42,从可执行文件的所述字节位置或者数据段开始提取升级数据的字节流发送给客户端。Step S42, extracting the byte stream of the upgrade data from the byte position or data segment of the executable file and sending it to the client.

由于可执行文件时按升级使用顺序存储的升级数据,只提示了相对可执行文件开始位置开始下载的偏移字节,那么本步骤即可从该提示的偏移字节开始,将其之后存在的数据全提取出来提供给客户端下载,因而不会出错,也因服务器只需判断开始偏移位置和最终的结束位置,而不用做其他额外的位置判断,从而提高了服务器的判断和下载效率。Since the upgrade data stored in the order of upgrade usage in the executable file only shows the offset bytes relative to the starting position of the executable file to start downloading, then this step can start from the offset byte of the prompt, and save the data stored thereafter. All the data is extracted and provided to the client for download, so there will be no errors, and because the server only needs to judge the start offset position and the final end position, without making other additional position judgments, thus improving the server's judgment and download efficiency .

其中,所述列表文件数据中各升级数据的文件特征信息中还可包括升级数据段的校验信息;Wherein, the file characteristic information of each upgrade data in the list file data may also include check information of the upgrade data segment;

比如对升级数据段的数据内容做MD5(MD5,信息摘要算法第5版)计算得到MD5值,对应进行存储。For example, MD5 (MD5, Information Digest Algorithm Version 5) calculation is performed on the data content of the upgraded data segment to obtain the MD5 value, which is stored accordingly.

进一步的包括:Further include:

步骤D11,所述客户端下载完所述升级数据后,计算所述升级数据的校验信息,并将所述校验信息与列表文件数据中该升级数据的校验信息进行比较;Step D11, after the client downloads the upgrade data, calculate the verification information of the upgrade data, and compare the verification information with the verification information of the upgrade data in the list file data;

比如对下载得到的每个升级数据段的内容进行MD5计算,将计算得到的MD5值,与前面步骤下载得到的列表文件数据中对应该数据段存储的MD5值进行比较。For example, the MD5 calculation is performed on the content of each upgraded data segment obtained by downloading, and the calculated MD5 value is compared with the MD5 value stored in the list file data downloaded in the previous step corresponding to the data segment.

步骤D12,如果校验通过,则存储所述升级数据段;Step D12, if the verification is passed, storing the upgrade data segment;

如果MD5值相同,则校验通过,则存储所述升级数据段。If the MD5 values are the same, the verification is passed, and the upgrade data segment is stored.

步骤D13,如果校验失败,则通知客户端所述升级数据错误。Step D13, if the verification fails, the client is notified that the upgrade data is wrong.

如果MD5值相同,则校验失败,则通知客户端所述升级数据错误,需要重新下载等。If the MD5 values are the same, the verification fails, and the client is notified that the upgrade data is wrong and needs to be downloaded again.

参照图2,其示出了本发明一种用于处理程序升级的方法实施例二的流程示意图,具体可以包括:Referring to FIG. 2 , it shows a schematic flowchart of Embodiment 2 of a method for processing program upgrades according to the present invention, which may specifically include:

步骤100,生成一个可执行文件,所述可执行文件用于:将用于原始安装的升级数据、以及后续新获得的用于升级的升级数据存入所述可执行文件数据区,并在所述升级数据区的指定字节位置或数据段存储列表文件数据;所述列表文件数据记录的包括:安装数据和各升级数据的文件特征信息,和安装数据和各升级数据在数据区中存储的字节位置或数据段;Step 100, generate an executable file, and the executable file is used to: store the upgrade data used for the original installation and the upgrade data newly obtained for the upgrade in the executable file data area, and store the upgrade data in the executable file data area. The specified byte position or data segment of the upgrade data area stores the list file data; the list file data records include: the file feature information of the installation data and each upgrade data, and the storage of the installation data and each upgrade data in the data area byte position or data segment;

步骤110,接收客户端的程序升级下载请求;Step 110, receiving a program upgrade download request from the client;

客户端可发送程序升级下载请求至服务器,以通知服务器针对该客户端进行程序升级下载流程。具体的程序升级下载请求可包括客户端的身份信息,比如IP地址信息等。The client can send a program upgrade download request to the server to notify the server to perform a program upgrade download process for the client. The specific program upgrade download request may include the identity information of the client, such as IP address information.

另外,在本步骤之前,还可包括:服务器可根据当前可执行文件的更新情况,通知客户端进行程序升级下载。In addition, before this step, it may also include: the server may notify the client to download the program upgrade according to the update status of the current executable file.

比如服务器将可执行文件的升级数据更新了,则可通知各个客户端对程序进行升级。For example, if the server updates the upgrade data of the executable file, it may notify each client to upgrade the program.

步骤120,从所述可执行文件数据区的指定字节位置或者数据段中,提取第一列表文件数据提供给客户端下载;Step 120, extracting the first list file data from the specified byte position or data segment of the executable file data area and providing it to the client for downloading;

在本发明实施例中,针对安装程序会设置一个可执行文件,其中可执行文件如windows系统中的.exe,.dll等结构的文件。其中,如图3,其示出了可执行文件(即PE文件,PE文件被称为可移植的执行体是PortableExecute的全称,常见的EXE、DLL、OCX、SYS、COM都是PE文件)的磁盘文件结构,可执行文件包括DOS文件头、PE头部、Sections表、代码段、重定位数据段和数据区(即各个数据段)。在一个PE文件的开始处,我们会看到一个DOS文件头,它使任何PE文件都是一个有效的MS-DOS可执行文件。之后是文件头(按COFF格式),用来说明该二进制文件将运行在何种机器之上、分几个区段、链接的时间、是可执行文件还是DLL、等等,后面包括Section表,即“数据目录”数组;这些目录包含许多指向各“段”数据的指针。之后就是数据段,各节中的内容才是你执行一个程序真正需要的东西,代码段和重定位数据段存储产品的安装逻辑,数据区中指定位置存储了列表文件数据,并且存储了升级数据。所述列表文件数据记录内容的包括:存储在所述可执行文件的数据区中各适于升级的升级数据的文件特征信息,所述文件特征信息包括各升级数据的文件特征信息、和相对可执行文件的字节位置或者数据段。In the embodiment of the present invention, an executable file is set for the installation program, wherein the executable file is a file with a structure such as .exe, .dll, etc. in the windows system. Wherein, as Fig. 3, it has shown executable file (being PE file, and PE file is referred to as portable execution body and is the full name of PortableExecute, and common EXE, DLL, OCX, SYS, COM are all PE files) Disk file structure, executable file includes DOS file header, PE header, Sections table, code segment, relocation data segment and data area (that is, each data segment). At the beginning of a PE file, we see a DOS header, which makes any PE file a valid MS-DOS executable. After that is the file header (in COFF format), which is used to explain what kind of machine the binary file will run on, how many sections, link time, whether it is an executable file or a DLL, etc., followed by the Section table, That is, an array of "data directories"; these directories contain many pointers to the data of each "segment". After that is the data section. The content in each section is what you really need to execute a program. The code section and the relocation data section store the installation logic of the product. The specified location in the data area stores the list file data and upgrade data. . The record content of the list file data includes: the file characteristic information of the upgrade data suitable for upgrading stored in the data area of the executable file, the file characteristic information includes the file characteristic information of each upgrade data, and the relative The byte position or data segment of the executable file.

在可执行文件中,每个数据段相对可执行文件最开始位置均存在偏移字节,那么可预先约定哪个偏移字节开始存储列表文件数据,即将适于升级的升级数据的包括文件特征信息、偏移字节等信息存储于该指定偏移字节。那么服务器和客户端可在进行升级流程时指定读取该指定偏移字节的列表文件数据进行处理。In an executable file, each data segment has an offset byte relative to the initial position of the executable file, so it can be pre-agreed which offset byte starts to store the list file data, that is, the included file characteristics of the upgrade data suitable for upgrade Information, offset bytes and other information are stored in the specified offset bytes. Then the server and the client can specify to read the list file data of the specified offset byte for processing when performing the upgrade process.

优选的,所述列表文件中的各升级数据的文件特征信息,按升级先后使用顺序记录;所述升级数据在所述可执行文件中按升级先后使用顺序存储。Preferably, the file feature information of each upgrade data in the list file is recorded in the order of upgrade and use; the upgrade data is stored in the executable file in the order of upgrade and use.

即按照安装时先后使用升级数据的顺序,将升级数据在数据区中按该顺序存储,比如安装时按顺序使用升级数据a1、a2、a3,那么可在数据区存储a1的数据段偏移字节靠前,存储a2的数据段紧接在a1后,存储a3的数据段紧接在a2后。That is, store the upgrade data in the data area according to the order in which the upgrade data is used successively during installation. For example, if the upgrade data a1, a2, and a3 are used in order during installation, then the offset word of the data segment of a1 can be stored in the data area. First, the data segment storing a2 is immediately after a1, and the data segment storing a3 is immediately after a2.

那么在本步骤中,服务器接收到客户端的程序升级下载请求后,根据该程序升级下载请求针对的可执行文件,首先从可执行文件数据区中指定的字节位置或者数据段提取列表文件数据,提供给客户端下载。比如指定数据区中,相对可执行文件开始位置的偏移字节为m1至偏移位置为m2位置之间的数据段,提取该位置数据段的字节流,将其提供给客户端下载。其中,如图3,可执行文件开始位置的偏移位置为0。Then in this step, after receiving the program upgrade download request from the client, the server first extracts the list file data from the specified byte position or data segment in the executable file data area according to the executable file targeted by the program upgrade download request, Provided to the client for download. For example, in the specified data area, the data segment between the offset byte m1 and the offset position m2 relative to the start position of the executable file is extracted, and the byte stream of the data segment at this position is extracted, and provided to the client for download. Wherein, as shown in FIG. 3 , the offset position of the start position of the executable file is 0.

步骤130,接收客户端发送的升级数据下载请求;所述升级数据下载请求包括:通过客户端提取本地的第二列表文件数据,并将第二列表文件数据与第一列表文件数据的文件特征信息比较后,获得的客户端未下载的升级数据在所述可执行文件数据区中存储的字节位置或数据段;Step 130, receiving an upgrade data download request sent by the client; the upgrade data download request includes: extracting the local second list file data through the client, and combining the second list file data with the file feature information of the first list file data After the comparison, the obtained byte position or data segment of the upgrade data not downloaded by the client is stored in the data area of the executable file;

在客户端接收到所述列表文件数据后,客户端会将列表文件数据中的文件特征信息与本地该程序的文件特征信息进行比较,判断当前下载的列表文件数据中的文件特征信息是否存在本地没有的各升级数据段的文件特征信息,以判断是否客户端的程序是否需要升级。如果存在,那么提取所述升级数据段的相对可执行文件的字节位置或者数据段,比如相对可执行文件开始位置的偏移字节,然后根据该字节位置或者数据段生成升级数据下载请求。After the client receives the list file data, the client will compare the file feature information in the list file data with the file feature information of the local program to determine whether the file feature information in the currently downloaded list file data exists locally. There is no file feature information of each upgrade data segment to determine whether the client program needs to be upgraded. If it exists, then extract the byte position or data segment of the upgrade data segment relative to the executable file, such as the offset byte relative to the start position of the executable file, and then generate an upgrade data download request according to the byte position or data segment .

具体的,所述可执行文件中的一字节位置或者数据段由客户端将所述列表文件数据与本地列表文件数据进行比较包括:Specifically, the one-byte position or data segment in the executable file is compared by the client with the list file data and the local list file data includes:

步骤A11,客户端解析所下载的列表文件数据中的各升级数据的文件特征信息,并与客户端本地列表文件数据中的各升级数据的文件特征信息进行比较,判断是否出现新的文件特征信息;Step A11, the client parses the file characteristic information of each upgraded data in the downloaded list file data, and compares it with the file characteristic information of each upgraded data in the client's local list file data, and judges whether there is new file characteristic information ;

客户端将从服务器下载得到的列表文件数据的字节流保存至对应的本地列表数据文件中,然后解析该列表文件中记录的各升级数据的文件特征信息,比如文件特征信息,字节位置或者数据段等信息。The client saves the byte stream of the list file data downloaded from the server to the corresponding local list data file, and then parses the file feature information of each upgraded data recorded in the list file, such as file feature information, byte position or data segment and other information.

在本发明中,客户端将当前下载的列表文件数据中的文件特征信息,与本地列表文件数据中的文件特征信息进行比较,判断当前下载的列表文件数据中是否有新的文件特征信息出现。In the present invention, the client compares the file feature information in the currently downloaded list file data with the file feature information in the local list file data, and judges whether there is new file feature information in the currently downloaded list file data.

步骤A12,如果未出现新的文件特征信息,则可判断下载已经结束;Step A12, if no new file feature information appears, it can be judged that the download has ended;

如果未出线新的文件特征信息,那么客户端即可判断程序当前版本已是最新版本,则下载过程结束,不再生成和发送升级数据下载请求。If there is no new file characteristic information, the client can determine that the current version of the program is the latest version, and the download process ends, and no upgrade data download request is generated and sent.

步骤A13,如果出现新的文件特征信息,则提取所述新的文件特征信息对应的字节位置或者数据段,并基于所述字节位置或者数据段生成所述升级数据下载请求。Step A13, if new file feature information appears, extract the byte position or data segment corresponding to the new file feature information, and generate the upgrade data download request based on the byte position or data segment.

如果出线新的文件特征信息,则提取文件特征信息对应的升级数据段的在可执行文件数据区中的字节位置或者数据段,比如相对可执行文件开始位置的偏移字节,然后基于该字节位置或者数据段生成升级数据下载请求。If there is new file feature information out of the line, then extract the byte position or data segment of the upgrade data segment corresponding to the file feature information in the executable file data area, such as the offset byte relative to the start position of the executable file, and then based on the The byte position or data segment generates the upgrade data download request.

进一步的,在所述列表文件中的各升级数据的文件特征信息,按升级先后使用顺序记录;所述升级数据在所述可执行文件中按升级先后使用顺序存储的基础上,所述可执行文件中的一字节位置或者数据段由客户端将所述列表文件数据与本地列表文件数据进行比较包括:Further, the file feature information of each upgrade data in the list file is recorded according to the sequence of upgrade and use; on the basis that the upgrade data is stored in the executable file according to the sequence of upgrade and use, the executable A byte position or data segment in the file is compared by the client with the list file data and the local list file data including:

步骤B11,客户端按顺序逐个将下载的列表文件数据中升级数据的文件特征信息与本地的列表文件数据中升级数据的文件特征信息进行比较,判断是否出现新的文件特征信息;Step B11, the client compares the file characteristic information of the upgraded data in the downloaded list file data one by one with the file characteristic information of the upgraded data in the local list file data one by one, and judges whether there is new file characteristic information;

即从列表文件数据存储各升级数据的文件特征信息的先后顺序,逐个将当前下载的列表文件中升级数据段的文件特征信息,与本地的升级数据段的文件特征信息进行比较。That is, the order of file feature information of each upgrade data is stored from the list file data, and the file feature information of the upgrade data segment in the currently downloaded list file is compared one by one with the file feature information of the local upgrade data segment.

步骤B12,如果未出现新的文件特征信息,则可判断下载已经结束。Step B12, if there is no new file feature information, it can be judged that the download has ended.

步骤B13,如果出现新的文件特征信息,则停止比较,并提取所述新升级数据的所述字节位置或者数据段,并基于所述字节位置或者数据段生成所述升级数据下载请求。Step B13, if new file feature information appears, stop the comparison, extract the byte position or data segment of the new upgrade data, and generate the upgrade data download request based on the byte position or data segment.

当出现新升级数据段时,即新文件特征信息时,则对当前下载的列表数据中的剩余文件特征信息不再进行比较,节省资源耗用。然后基于当前新的文件特征信息对应的字节位置或者数据段生成升级请求。When there is a newly upgraded data segment, that is, new file feature information, the remaining file feature information in the currently downloaded list data is no longer compared, saving resource consumption. Then an upgrade request is generated based on the byte position or data segment corresponding to the current new file feature information.

步骤140,根据列表文件数据记录的所述升级数据在在数据区中存储的字节位置或数据段,从所述可执行文件数据区中提取升级数据并将所升级数据提供给客户端下载。Step 140, according to the byte position or data segment of the upgrade data stored in the data area of the list file data record, extract the upgrade data from the executable file data area and provide the upgraded data to the client for download.

因升级数据下载请求提示了从可执行文件的哪个位置提取数据提供给客户端下载以进行升级,那么服务器即可根据该提示的各位置,从可执行文件中提取数据提供给客户端下载。Since the upgrade data download request indicates which location of the executable file to extract data from and provide to the client for downloading for upgrading, the server can extract data from the executable file and provide the client to download according to each location prompted.

可选的,在前述列表文件中的各升级数据的文件特征信息,按升级先后使用顺序记录;所述升级数据在所述可执行文件中按升级先后使用顺序存储和步骤B11至步骤B13的基础上,所述根据所述升级数据下载请求,从可执行文件的所述字节位置或者数据段提取升级数据,提供给客户端下载包括:Optionally, the file feature information of each upgrade data in the aforementioned list file is recorded in the order of use in order of upgrade; the upgrade data is stored in the order of use in order of upgrade in the executable file and the basis of steps B11 to B13 In the above, according to the upgrade data download request, extracting the upgrade data from the byte position or data segment of the executable file, and providing it to the client for downloading includes:

步骤C11,根据所述升级数据下载请求,从可执行文件的所述字节位置或者数据段开始提取升级数据的字节流发送给客户端;Step C11, according to the upgrade data download request, extract the byte stream of the upgrade data from the byte position or data segment of the executable file and send it to the client;

由于可执行文件时按升级使用顺序存储的升级数据,并且步骤B13生成的升级数据请求中,只提示了相对可执行文件开始位置开始下载的偏移字节,那么本步骤即可从该提示的偏移字节开始,将其之后存在的数据全提取出来提供给客户端下载,因而不会出错,也因服务器只需判断开始偏移位置和最终的结束位置,而不用做其他额外的位置判断,从而提高了服务器的判断和下载效率。Since the executable file is the upgrade data stored in the order of upgrade use, and the upgrade data request generated in step B13 only indicates the offset byte to be downloaded relative to the start position of the executable file, then this step can start from the prompt The offset byte starts, and all the data that exists after it is extracted and provided to the client for download, so there is no error, and because the server only needs to judge the start offset position and the final end position, without making other additional position judgments , thereby improving the judgment and download efficiency of the server.

另外,在所述列表数据文件中还可包括升级数据段的文件大小(比如大小为500字节),进一步的,所述客户端接收时包括:In addition, the file size of the upgrade data segment (such as a size of 500 bytes) may also be included in the list data file. Further, when the client receives:

所述客户端根据各升级数据段的文件大小,将接收到的字节流逐个存储为相应升级数据段的本地升级数据文件。According to the file size of each upgrade data segment, the client stores the received byte stream one by one as a local upgrade data file of the corresponding upgrade data segment.

比如服务器从可执行文件偏移字节1000字节位置开始提取数据给客户端下载,而从该位置开始第一个文件a1大小为500字节,第二个文件a2为800字节,第三个文件a3为300字节。For example, the server extracts data from the executable file offset of 1000 bytes for the client to download, and from this position, the first file a1 is 500 bytes in size, the second file a2 is 800 bytes in size, and the third file a2 is 800 bytes in size. A file a3 is 300 bytes.

那么服务器从第可执行文件偏移1000字节处提取数据给客户端,客户端判断接收到的字节总数到500时,则将这段字节流保存为a1,接收到的字节流总数为1300时,则将800-1300之间的字节流保存为a2,接收到的字节流总数为1600时,则将1300-1600之间的字节流保存为a3。Then the server extracts data from the 1000 byte offset of the executable file to the client, and when the client judges that the total number of bytes received reaches 500, it saves this byte stream as a1, and the total number of received byte streams When it is 1300, save the byte stream between 800-1300 as a2, and when the total number of received byte streams is 1600, save the byte stream between 1300-1600 as a3.

其中,所述列表文件数据中各升级数据的文件特征信息中还可包括升级数据段的校验信息;Wherein, the file characteristic information of each upgrade data in the list file data may also include check information of the upgrade data segment;

比如对升级数据段的数据内容做MD5(MD5,信息摘要算法第5版)计算得到MD5值,对应进行存储。For example, MD5 (MD5, Information Digest Algorithm Version 5) calculation is performed on the data content of the upgraded data segment to obtain the MD5 value, which is stored accordingly.

进一步的包括:Further include:

步骤D11,所述客户端下载完所述升级数据后,计算所述升级数据的校验信息,并将所述校验信息与列表文件数据中该升级数据的校验信息进行比较;Step D11, after the client downloads the upgrade data, calculate the verification information of the upgrade data, and compare the verification information with the verification information of the upgrade data in the list file data;

比如对下载得到的每个升级数据段的内容进行MD5计算,将计算得到的MD5值,与前面步骤下载得到的列表文件数据中对应该数据段存储的MD5值进行比较。For example, the MD5 calculation is performed on the content of each upgraded data segment obtained by downloading, and the calculated MD5 value is compared with the MD5 value stored in the list file data downloaded in the previous step corresponding to the data segment.

步骤D12,如果校验通过,则存储所述升级数据段;Step D12, if the verification is passed, storing the upgrade data segment;

如果MD5值相同,则校验通过,则存储所述升级数据段。If the MD5 values are the same, the verification is passed, and the upgrade data segment is stored.

步骤D13,如果校验失败,则通知客户端所述升级数据错误。Step D13, if the verification fails, the client is notified that the upgrade data is wrong.

如果MD5值相同,则校验失败,则通知客户端所述升级数据错误,需要重新下载等。If the MD5 values are the same, the verification fails, and the client is notified that the upgrade data is wrong and needs to be downloaded again.

如此客户端则可根据安装逻辑基于下载得到的新的升级数据文件进行升级。In this way, the client can be upgraded based on the downloaded new upgrade data file according to the installation logic.

参照图4,其示出了本申请一种用于处理程序升级的装置的实施例的结构示意图,包括:Referring to FIG. 4 , it shows a schematic structural diagram of an embodiment of a device for processing program upgrades in the present application, including:

可执行文件生成模块310,适于生成一个可执行文件,所述可执行文件用于:将用于原始安装的升级数据、以及后续新获得的用于升级的升级数据存入所述可执行文件数据区,并在所述升级数据区的指定字节位置或数据段存储列表文件数据;所述列表文件数据记录的包括:安装数据和各升级数据的文件特征信息,和安装数据和各升级数据在数据区中存储的字节位置或数据段;The executable file generation module 310 is adapted to generate an executable file, and the executable file is used for: storing the upgrade data used for the original installation and the upgrade data used for the upgrade newly obtained subsequently into the executable file data area, and store the list file data in the specified byte position or data segment of the upgrade data area; the list file data records include: installation data and file feature information of each upgrade data, and installation data and each upgrade data The byte position or data segment stored in the data area;

升级请求接收模块320,适于接收客户端的程序升级下载请求;The upgrade request receiving module 320 is adapted to receive a program upgrade download request from the client;

判断模块330,适于根据所述程序升级下载请求,获取所述可执行文件数据区中指定字节位置或数据段存储的第一列表文件数据和获取对应客户端可执行文件的第二列表文件数据,并比较所述第一列表文件数据和第二列表文件数据的文件特征信息,判断是否存在客户端未下载的升级数据;The judging module 330 is adapted to obtain the first list file data stored in the specified byte position or data segment in the executable file data area and obtain the second list file corresponding to the client executable file according to the program upgrade download request data, and compare the file characteristic information of the first list file data and the second list file data, and judge whether there is upgrade data not downloaded by the client;

升级数据提供模块340,适于如果存在,则根据列表文件数据记录的所述升级数据在在数据区中存储的字节位置或数据段,从所述可执行文件数据区中提取升级数据并将所升级数据提供给客户端下载;The upgrade data providing module 340 is adapted to extract the upgrade data from the executable file data area according to the byte position or data segment stored in the data area of the upgrade data recorded in the list file data and The upgraded data is provided to the client for download;

其中,所述列表文件中各升级数据的文件特征信息中还包括升级数据段的校验信息;Wherein, the file feature information of each upgrade data in the list file also includes check information of the upgrade data segment;

进一步的,在所述客户端还包括:Further, the client also includes:

校验模块,适于所述客户端下载完所述升级数据后,计算所述升级数据的校验信息,并将所述校验信息与列表文件数据中该升级数据的校验信息进行比较;The verification module is adapted to calculate the verification information of the upgraded data after the client downloads the upgraded data, and compare the verified information with the verified information of the upgraded data in the list file data;

如果校验通过,则存储所述升级数据段;If the verification is passed, the upgrade data segment is stored;

如果校验失败,则通知客户端所述升级数据错误。If the verification fails, the client is notified that the upgrade data is wrong.

可选的,所述判断模块包括:Optionally, the judging module includes:

第一列表文件提取模块一,适于从所述可执行文件数据区的指定字节位置或者数据段中,提取第一列表文件数据;The first list file extraction module one is adapted to extract the first list file data from the specified byte position or data segment of the executable file data area;

第二列表文件获取模块一,适于通知客户端将其可执行文件中的第二列表文件数据上传;The second list file acquisition module 1 is adapted to notify the client to upload the second list file data in its executable file;

第一判断模块,适于将第二列表文件数据与第一列表文件数据的文件特征信息比较,获得的客户端未下载的升级数据在所述可执行文件数据区中存储的字节位置或数据段。The first judging module is adapted to compare the file feature information of the second list file data with the first list file data, and obtain the byte position or data stored in the executable file data area of the upgrade data not downloaded by the client part.

可选的,所述判断模块包括:Optionally, the judging module includes:

第一列表文件提取模块二,适于从所述可执行文件数据区的指定字节位置或者数据段中,提取第一列表文件数据提供给客户端下载;The first list file extraction module 2 is adapted to extract the first list file data from the specified byte position or data segment of the executable file data area and provide it to the client for downloading;

升级数据下载请求接收模块,适于接收客户端发送的升级数据下载请求;所述升级数据下载请求包括:通过客户端提取本地的第二列表文件数据,并将第二列表文件数据与第一列表文件数据的文件特征信息比较后,获得的客户端未下载的升级数据在所述可执行文件数据区中存储的字节位置或数据段。The upgrade data download request receiving module is adapted to receive the upgrade data download request sent by the client; the upgrade data download request includes: extracting the local second list file data through the client, and combining the second list file data with the first list After the file feature information of the file data is compared, the obtained byte position or data segment of the upgrade data not downloaded by the client is stored in the executable file data area.

可选的,所述判断模块包括:Optionally, the judging module includes:

第二判断模块,适于将第一列表文件数据中的各升级数据的文件特征信息,并与第二列表文件数据中的各升级数据的文件特征信息进行比较,判断是否出现新的文件特征信息;如果未出现新的文件特征信息,则可判断客户端下载已经结束;如果出现新的文件特征信息,则从列表文件数据中提取所述新的文件特征信息对应的字节位置或者数据段。The second judging module is adapted to compare the file feature information of each upgrade data in the first list file data with the file feature information of each upgrade data in the second list file data, and judge whether new file feature information appears ; If there is no new file feature information, it can be judged that the client download has ended; if there is new file feature information, then extract the byte position or data segment corresponding to the new file feature information from the list file data.

可选的,所述列表文件中的各升级数据的文件特征信息,按升级先后使用顺序记录;所述升级数据在所述可执行文件中按升级先后使用顺序存储。Optionally, the file feature information of each upgrade data in the list file is recorded in the order of upgrade and use; the upgrade data is stored in the executable file in the order of upgrade and use.

可选的,所述判断模块包括:Optionally, the judging module includes:

第二判断模块,适于按顺序逐个将第一列表文件数据中升级数据的文件特征信息与本第二列表文件数据中升级数据的文件特征信息进行比较,判断是否出现新的文件特征信息;The second judging module is adapted to compare the file characteristic information of the upgraded data in the first list file data one by one with the file characteristic information of the upgraded data in the second list file data one by one, and judge whether new file characteristic information appears;

如果出现新的文件特征信息,则停止比较,并从列表文件数据中提取所述新的文件特征信息对应的字节位置或者数据段。If new file feature information appears, the comparison is stopped, and the byte position or data segment corresponding to the new file feature information is extracted from the list file data.

可选的,所述升级数据提供模块包括:Optionally, the upgrade data providing module includes:

从可执行文件的所述字节位置或者数据段开始提取升级数据的字节流发送给客户端。The byte stream of the upgrade data is extracted from the byte position or data segment of the executable file and sent to the client.

可选的,所述升级数据提取模块包括:Optionally, the upgrade data extraction module includes:

第一提取模块,适于根据所述升级数据下载请求,从可执行文件的所述字节位置或者数据段开始提取升级数据的字节流发送给客户端。The first extraction module is adapted to extract the byte stream of the upgrade data from the byte position or data segment of the executable file and send it to the client according to the upgrade data download request.

参照图5,其示出了一种程序升级下载的系统实施例的结构示意图,包括:Referring to FIG. 5 , it shows a schematic structural diagram of a system embodiment for program upgrade download, including:

服务器410和客户端420;server 410 and client 420;

所述服务器410包括:The server 410 includes:

升级请求接收模块411,适于接收客户端的程序升级下载请求;The upgrade request receiving module 411 is adapted to receive a program upgrade download request from the client;

列表文件提取模块412,适于从所述可执行文件数据区的指定字节位置或者数据段中,提取第一列表文件数据提供给客户端下载;The list file extraction module 412 is adapted to extract the first list file data from the specified byte position or data segment of the executable file data area and provide it to the client for downloading;

升级数据下载请求接收模块413,适于接收客户端发送的升级数据下载请求;所述升级数据下载请求包括:通过客户端提取本地的第二列表文件数据,并将第二列表文件数据与第一列表文件数据的文件特征信息比较后,获得的客户端未下载的升级数据在所述可执行文件数据区中存储的字节位置或数据段;The upgrade data download request receiving module 413 is adapted to receive the upgrade data download request sent by the client; the upgrade data download request includes: extracting the local second list file data through the client, and combining the second list file data with the first After comparing the file characteristic information of the list file data, the byte position or data segment stored in the executable file data area of the obtained upgrade data not downloaded by the client;

升级数据提取模块414,适于根据列表文件数据记录的所述升级数据在在数据区中存储的字节位置或数据段,从所述可执行文件数据区中提取升级数据并将所升级数据提供给客户端下载。The upgrade data extraction module 414 is adapted to extract the upgrade data from the executable file data area and provide the upgrade data according to the byte position or data segment stored in the data area of the upgrade data recorded in the list file data Download it to the client.

所述客户端420包括:The client 420 includes:

升级请求发送模块421,适于发送所述程序升级下载请求;An upgrade request sending module 421, adapted to send the program upgrade download request;

比较模块422,适于通过客户端提取本地的第二列表文件数据,并将第二列表文件数据与第一列表文件数据的文件特征信息比较后,获得的客户端未下载的升级数据在所述可执行文件数据区中存储的字节位置或数据段;The comparison module 422 is adapted to extract the local second list file data through the client, and after comparing the second list file data with the file feature information of the first list file data, the obtained upgrade data not downloaded by the client is in the The byte location or data segment stored in the executable's data area;

升级数据下载请求生成模块423,适于基于所述字节位置或者数据段生成所述升级数据下载请求;An upgrade data download request generation module 423, adapted to generate the upgrade data download request based on the byte position or data segment;

升级数据下载请求发送模块424,适于发送所述升级数据下载请求;The upgrade data download request sending module 424 is adapted to send the upgrade data download request;

其中,所述列表文件中各升级数据的文件特征信息中还包括升级数据段的校验信息;Wherein, the file feature information of each upgrade data in the list file also includes check information of the upgrade data segment;

相应的,在所述客户端还包括:Correspondingly, the client also includes:

校验模块,适于所述客户端下载完所述升级数据后,计算所述升级数据的校验信息,并将所述校验信息与列表文件数据中该升级数据的校验信息进行比较;The verification module is adapted to calculate the verification information of the upgraded data after the client downloads the upgraded data, and compare the verified information with the verified information of the upgraded data in the list file data;

如果校验通过,则存储所述升级数据段;If the verification is passed, the upgrade data segment is stored;

如果校验失败,则通知客户端所述升级数据错误。If the verification fails, the client is notified that the upgrade data is wrong.

可选的,所述列表文件中的各升级数据的文件特征信息,按升级先后使用顺序记录;所述升级数据在所述可执行文件中按升级先后使用顺序存储。Optionally, the file feature information of each upgrade data in the list file is recorded in the order of upgrade and use; the upgrade data is stored in the executable file in the order of upgrade and use.

可选的,在所述客户端中,所述比较模块包括:Optionally, in the client, the comparison module includes:

解析比较模块,适于客户端解析所下载的列表文件数据中的各升级数据的文件特征信息,并与客户端本地列表文件数据中的各升级数据的文件特征信息进行比较,判断是否出现新的文件特征信息;The analysis and comparison module is suitable for the client to analyze the file characteristic information of each upgraded data in the downloaded list file data, and compare it with the file characteristic information of each upgraded data in the client's local list file data, and judge whether there is a new file feature information;

如果未出现新的文件特征信息,则可判断下载已经结束;If no new file feature information appears, it can be judged that the download has ended;

如果出现新的文件特征信息,则提取所述新的文件特征信息对应的字节位置或者数据段,转入升级数据下载请求生成模块。If there is new file feature information, then extract the byte position or data segment corresponding to the new file feature information, and transfer to the upgrade data download request generation module.

可选的,所述比较模块包括:Optionally, the comparison module includes:

顺序比较模块,适于客户端按顺序逐个将下载的列表文件数据中升级数据的文件特征信息与本地的列表文件数据中升级数据的文件特征信息进行比较,判断是否出现新的文件特征信息;The sequence comparison module is suitable for the client to compare the file characteristic information of the upgraded data in the downloaded list file data with the file characteristic information of the upgraded data in the local list file data one by one in order to determine whether new file characteristic information appears;

如果出现新的文件特征信息,则停止比较,并提取所述新升级数据的所述字节位置或者数据段,并转入升级数据下载请求生成模块。If there is new file feature information, stop comparing, and extract the byte position or data segment of the new upgrade data, and transfer to the upgrade data download request generation module.

可选的,所述升级数据提取模块包括:Optionally, the upgrade data extraction module includes:

第一提取模块,适于根据所述升级数据下载请求,从可执行文件的所述字节位置或者数据段开始提取升级数据的字节流发送给客户端;The first extraction module is adapted to extract the byte stream of the upgrade data from the byte position or data segment of the executable file and send it to the client according to the upgrade data download request;

在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other device. Various generic systems can also be used with the teachings based on this. The structure required to construct such a system is apparent from the above description. Furthermore, the present invention is not specific to any particular programming language. It should be understood that various programming languages can be used to implement the contents of the present invention described herein, and the above description of specific languages is for disclosing the best mode of the present invention.

在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.

类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, in order to streamline this disclosure and to facilitate an understanding of one or more of the various inventive aspects, various features of the invention are sometimes grouped together in a single embodiment, figure, or its description. This method of disclosure, however, is not to be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.

本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art can understand that the modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment. Modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore may be divided into a plurality of sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings) and any method or method so disclosed may be used in any combination, except that at least some of such features and/or processes or units are mutually exclusive. All processes or units of equipment are combined. Each feature disclosed in this specification (including accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.

此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。Furthermore, those skilled in the art will understand that although some embodiments described herein include some features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention. and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.

本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的一种用于处理程序升级的装置中的一些或者全部部件的一些或者全部功能。本发明还可以实现为适于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all of some or all of the components in an apparatus for upgrading a processing program according to an embodiment of the present invention. Full functionality. The present invention can also be implemented as an apparatus or an apparatus program (for example, a computer program and a computer program product) adapted to perform a part or all of the methods described herein. Such a program for realizing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet site, or provided on a carrier signal, or provided in any other form.

应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means can be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. does not indicate any order. These words can be interpreted as names.

Claims (14)

1., for the treatment of a method for program upgrade, comprising:
Generate an executable file, described executable file is used for: by the upgrade data being used for upgrading of the installation data and follow-up new acquisition that are used for original installation stored in described executable file data field, and at the specified bytes position of described executable file data field or data segment store list file data; Comprising of described listing file data record: the file feature information of installation data and each upgrade data, and the byte location that stores within a data area of installation data and each upgrade data or data segment;
Program upgrade downloading process based on described executable file comprises:
Receive the program upgrade download request of client;
According to described program upgrade download request, obtain in described executable file data field and specify the first row list file data that byte location or data segment store and the secondary series list file data obtaining corresponding client executable file, and the file feature information of more described first row list file data and secondary series list file data, judge whether to exist the upgrade data that client is not downloaded;
If existed, then the byte location stored within a data area according to the described upgrade data of listing file data record or data segment, extract upgrade data and described upgrade data be supplied to client downloads from described executable file data field;
Wherein, in described listing file data each upgrade data file feature information in also comprise the check information of upgrade data section;
Further, when after the complete described upgrade data of described client downloads, calculate the check information of described upgrade data, and the check information of this upgrade data in described check information and listing file data is compared;
If verification is passed through, then store described upgrade data section;
If verify unsuccessfully, then notify upgrade data mistake described in client.
2. the method for claim 1, described according to described program upgrade download request, obtain in described executable file data field and specify the first row list file data that byte location or data segment store and the secondary series list file data obtaining corresponding client executable file, and the file feature information of more described first row list file data and secondary series list file data, judge whether to exist the data that client do not download and comprise:
From the specified bytes position or data segment of described executable file data field, extract first row list file data;
Notice client is by the secondary series list file data upload in its executable file;
The file feature information of secondary series list file data with first row list file data is compared, the byte location that the upgrade data that the client of acquisition is not downloaded stores in described executable file data field or data segment.
3. the method for claim 1, described according to described program upgrade download request, obtain in described executable file data field and specify the first row list file data that byte location or data segment store and the secondary series list file data obtaining corresponding client executable file, and the file feature information of more described first row list file data and secondary series list file data, judge whether to exist the upgrade data that client do not download and comprise:
From the specified bytes position or data segment of described executable file data field, extract first row list file data and be supplied to client downloads;
Receive the upgrade data download request that client sends; Described upgrade data download request comprises: extract local secondary series list file data by client, and after secondary series list file data are compared with the file feature information of first row list file data, the byte location that the upgrade data that the client of acquisition is not downloaded stores in described executable file data field or data segment.
4. the method for claim 1, describedly compares the file feature information of secondary series list file data with first row list file data, and the byte location that the data that the client of acquisition is not downloaded store in described executable file data field or data segment comprise:
By the file feature information of each upgrade data in first row list file data, and compare with the file feature information of each upgrade data in secondary series list file data, judge whether to occur new file feature information;
If there is not new file feature information, then can judge that client downloads terminates;
If there is new file feature information, then from byte location corresponding to file feature information new described in listing file extracting data or data segment.
5. the method for claim 1, the file feature information of each upgrade data in described listing file, successively uses journal by upgrading; Described upgrade data successively uses sequential storage by upgrading in described executable file.
6. method as claimed in claim 5, describedly compares the file feature information of secondary series list file data with first row list file data, and the byte location that the data that the client of acquisition is not downloaded store in described executable file data field or data segment comprise:
One by one the file feature information of upgrade data in the file feature information of upgrade data in first row list file data and secondary series list file data is compared in order, judge whether to occur new file feature information;
If there is new file feature information, then stop comparing, and from byte location corresponding to file feature information new described in listing file extracting data or data segment.
7. method as claimed in claim 6, the byte location that the described upgrade data do not downloaded according to described client stores in described executable file data field or data segment, extract data and described upgrade data be supplied to client downloads and comprise from the data field of executable file:
The byte stream extracting upgrade data from the described byte location or data segment of executable file sends to client.
8., for the treatment of a device for program upgrade, comprising:
Executable file generation module, be suitable for generation executable file, described executable file is used for: by the upgrade data being used for upgrading of the installation data and follow-up new acquisition that are used for original installation stored in described executable file data field, and at the specified bytes position of described executable file data field or data segment store list file data; Comprising of described listing file data record: the file feature information of installation data and each upgrade data, and the byte location that stores within a data area of installation data and each upgrade data or data segment;
Upgrade request receiver module, is suitable for the program upgrade download request receiving client;
Judge module, be suitable for according to described program upgrade download request, obtain in described executable file data field and specify the first row list file data that byte location or data segment store and the secondary series list file data obtaining corresponding client executable file, and the file feature information of more described first row list file data and secondary series list file data, judge whether to exist the upgrade data that client is not downloaded;
Upgrade data provides module, if be suitable for existence, the byte location then stored within a data area according to the described upgrade data of listing file data record or data segment, extract upgrade data and described upgrade data be supplied to client downloads from described executable file data field;
Wherein, in described listing file each upgrade data file feature information in also comprise the check information of upgrade data section;
Further, also comprise in described client:
Correction verification module, after being suitable for the complete described upgrade data of described client downloads, calculates the check information of described upgrade data, and is compared by the check information of this upgrade data in described check information and listing file data;
If verification is passed through, then store described upgrade data section;
If verify unsuccessfully, then notify upgrade data mistake described in client.
9. device as claimed in claim 8, described judge module comprises:
First row list file extraction module one, is suitable for from the specified bytes position or data segment of described executable file data field, extracts first row list file data;
Secondary series list file acquisition module one, is suitable for notice client by the secondary series list file data upload in its executable file;
First judge module, is suitable for the file feature information of secondary series list file data with first row list file data to compare, the byte location that the upgrade data that the client of acquisition is not downloaded stores in described executable file data field or data segment.
10. device as claimed in claim 8, described judge module comprises:
First row list file extraction module two, is suitable for from the specified bytes position or data segment of described executable file data field, extracts first row list file data and is supplied to client downloads;
Upgrade data download request receiver module, is suitable for the upgrade data download request receiving client transmission; Described upgrade data download request comprises: extract local secondary series list file data by client, and after secondary series list file data are compared with the file feature information of first row list file data, the byte location that the upgrade data that the client of acquisition is not downloaded stores in described executable file data field or data segment.
11. devices as claimed in claim 8, described judge module comprises:
Second judge module, is suitable for the file feature information of each upgrade data in first row list file data, and compares with the file feature information of each upgrade data in secondary series list file data, judges whether to occur new file feature information; If there is not new file feature information, then can judge that client downloads terminates; If there is new file feature information, then from byte location corresponding to file feature information new described in listing file extracting data or data segment.
12. devices as claimed in claim 8, the file feature information of each upgrade data in described listing file, successively uses journal by upgrading; Described upgrade data successively uses sequential storage by upgrading in described executable file.
13. devices as claimed in claim 12, described judge module comprises:
Second judge module, is suitable for the file feature information of upgrade data in the file feature information of upgrade data in first row list file data and secondary series list file data being compared one by one in order, judges whether to occur new file feature information;
If there is new file feature information, then stop comparing, and from byte location corresponding to file feature information new described in listing file extracting data or data segment.
14. devices as claimed in claim 13, described upgrade data provides module to comprise:
First extraction module, the byte stream being suitable for extracting upgrade data from the described byte location or data segment of executable file sends to client.
CN201210534020.8A 2012-12-11 2012-12-11 For the treatment of the method and apparatus of program upgrade Active CN103019785B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210534020.8A CN103019785B (en) 2012-12-11 2012-12-11 For the treatment of the method and apparatus of program upgrade

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210534020.8A CN103019785B (en) 2012-12-11 2012-12-11 For the treatment of the method and apparatus of program upgrade

Publications (2)

Publication Number Publication Date
CN103019785A CN103019785A (en) 2013-04-03
CN103019785B true CN103019785B (en) 2015-11-25

Family

ID=47968419

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210534020.8A Active CN103019785B (en) 2012-12-11 2012-12-11 For the treatment of the method and apparatus of program upgrade

Country Status (1)

Country Link
CN (1) CN103019785B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103051689B (en) * 2012-12-11 2016-06-22 北京奇虎科技有限公司 A kind of program upgrading method for down loading and device
CN105100191B (en) 2015-05-22 2018-09-21 华为技术有限公司 The method, apparatus and system of Java application installations are realized in a kind of cloud compiling
CN105740032A (en) * 2016-03-10 2016-07-06 汉柏科技有限公司 Network device system upgrading method and device
CN105867934B (en) * 2016-04-13 2021-01-22 厦门雅迅网络股份有限公司 File remote upgrading method based on dichotomy and MD5 verification
CN106445737B (en) * 2016-09-12 2023-03-10 恒为科技(上海)股份有限公司 Multi-backup starting method
CN110209401B (en) * 2019-05-28 2024-04-09 北京小米移动软件有限公司 Application program loading method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1310388A (en) * 2000-02-21 2001-08-29 英业达股份有限公司 A method for updating data files in an incremental manner
WO2003054695A1 (en) * 2001-12-12 2003-07-03 Valve Corporation Method and system for upgrading and rolling back versions
CN101359293A (en) * 2008-09-04 2009-02-04 腾讯科技(深圳)有限公司 Method and apparatus for making part update pack
CN101753524A (en) * 2008-12-15 2010-06-23 青岛海信传媒网络技术有限公司 Method and system for upgrading software
CN103051689A (en) * 2012-12-11 2013-04-17 北京奇虎科技有限公司 Program updating downloading method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1310388A (en) * 2000-02-21 2001-08-29 英业达股份有限公司 A method for updating data files in an incremental manner
WO2003054695A1 (en) * 2001-12-12 2003-07-03 Valve Corporation Method and system for upgrading and rolling back versions
CN101359293A (en) * 2008-09-04 2009-02-04 腾讯科技(深圳)有限公司 Method and apparatus for making part update pack
CN101753524A (en) * 2008-12-15 2010-06-23 青岛海信传媒网络技术有限公司 Method and system for upgrading software
CN103051689A (en) * 2012-12-11 2013-04-17 北京奇虎科技有限公司 Program updating downloading method and device

Also Published As

Publication number Publication date
CN103019785A (en) 2013-04-03

Similar Documents

Publication Publication Date Title
CN103051689B (en) A kind of program upgrading method for down loading and device
CN103019785B (en) For the treatment of the method and apparatus of program upgrade
CN103034512B (en) The method and apparatus of more new procedures
CN103647816A (en) Method and device for upgrading application software
CN101436138B (en) Control device and control method for software upgrade and dynamic rolling back
CN103973475B (en) Different patch packet generation method and method for down loading, server, client
CN103646082B (en) A kind of method and device of file verification
CN104079673B (en) A kind of methods, devices and systems for preventing DNS from kidnapping in application downloading
CN104699511A (en) Plug-in upgrading method and plug-in upgrading device
CN106325929B (en) Firmware upgrading method, firmware upgrading device, refrigerator and server
CN105389191A (en) Software upgrading method, apparatus and system based on local area network
CN101473590B (en) System and method for caching web files
CN103745158A (en) Method and device for repairing system bugs
CN105045631A (en) Method and device for upgrading client-side applications
CN103034673A (en) Object data allocation method, object data allocation system and server apparatus, client device and program thereof
WO2011088714A1 (en) Method, device and system for running application
CN104836843A (en) Client application program updating method and device
WO2016183951A1 (en) System upgrade method and terminal
WO2017016282A1 (en) Software upgrading method and apparatus, and computer storage medium
CN105159691A (en) Method and device for updating metadata
CN106155739A (en) A kind of plug-in unit control metering method, server, client and control amount platform
CN106843880A (en) Android installation package APK customization method, device and server
CN114911500A (en) Terminal upgrade method, terminal and system
WO2016082450A1 (en) Method for upgrading user terminal, and user terminal
CN114185804B (en) Interface testing method and device and terminal equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20161228

Address after: 100015 Chaoyang District Road, Jiuxianqiao, No. 10, building No. 3, floor 15, floor 17, 1701-26,

Patentee after: BEIJING QIANXIN TECHNOLOGY Co.,Ltd.

Address before: 100088 Beijing city Xicheng District xinjiekouwai Street 28, block D room 112 (Desheng Park)

Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Patentee before: Qizhi software (Beijing) Co.,Ltd.

CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 100015 15, 17 floor 1701-26, 3 building, 10 Jiuxianqiao Road, Chaoyang District, Beijing.

Patentee after: QAX Technology Group Inc.

Address before: 100015 15, 17 floor 1701-26, 3 building, 10 Jiuxianqiao Road, Chaoyang District, Beijing.

Patentee before: BEIJING QIANXIN TECHNOLOGY Co.,Ltd.