CN100474248C - Method and data processing device for updating computer programs by data transmission - Google Patents

Method and data processing device for updating computer programs by data transmission Download PDF

Info

Publication number
CN100474248C
CN100474248C CNB2005800067034A CN200580006703A CN100474248C CN 100474248 C CN100474248 C CN 100474248C CN B2005800067034 A CNB2005800067034 A CN B2005800067034A CN 200580006703 A CN200580006703 A CN 200580006703A CN 100474248 C CN100474248 C CN 100474248C
Authority
CN
China
Prior art keywords
program
version
data
program part
address
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.)
Expired - Fee Related
Application number
CNB2005800067034A
Other languages
Chinese (zh)
Other versions
CN1926513A (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.)
Siemens AG
Original Assignee
Siemens AG
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 Siemens AG filed Critical Siemens AG
Publication of CN1926513A publication Critical patent/CN1926513A/en
Application granted granted Critical
Publication of CN100474248C publication Critical patent/CN100474248C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Information Transfer Between Computers (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention relates to a delta compression method, which can be used in particular for updating computer programs, in particular by means of narrow-band transmission paths. The inventive method for creating the differential data does not only identify absolutely identical program areas but also those areas, in which the referenced memory addresses have changed as a result of moved program parts that are otherwise identical to those in the old program version. The identification of said relatively similar program parts is based on the interpretation of the referenced memory addresses in jump or access commands. Only the newly added program areas and address data for the individual program parts are transmitted as differential data. The memory size required by the differential data can thus be significantly reduced. During the update of the old program version, the new memory addresses are explicitly computed in addition to the moved program parts and are inserted into the new program version to be created.

Description

Be used for method and data processing equipment by the data transmission updating computer program
Technical field
The present invention relates to a kind of method that is used for establishment differential data between the new procedures version of the old program version of the computer program that need upgrade and computer program, and a kind ofly be used to utilize differential data to come the method for the old program version of updating computer program.The invention further relates to a kind of data processing equipment that is used to create and send differential data, and the data processing equipment that is used to receive and handle differential data.
Background technology
In data processing equipment, the legacy version of computer program no matter be whole operation system or only a part of application software, was replaced by new edition fully originally usually, that is to say that new program file covers old program file with identical filename.If the mobile data treatment facility, when installed device must be upgraded as mobile phone or in motor vehicle, at present the new procedures version was transferred to separately equipment according to user's demand.It can realize in this wise that promptly these equipment are connected with data server by cable, and the new procedures version is connected in the mobile device by these data then, perhaps in the switch type data carrier, is provided use as the new procedures version on CD or the DVD.On the other hand, data server itself can connect by remote data, for example obtains program version as Internet connection or wireless connections.What will consider in every type data transmission is, perhaps can only in the suitable time, transmit relatively limited data volume, perhaps high data transmission rate perhaps can be brought the data transmission expense of great number, and therefore, the data that people attempt sending keep as much as possible little.Yet this target contradicts with the complicacy that increases day by day of current operating system or application program.
In specific industrial circle, for example as in software development or the maintenance at database, this is again necessary, be long-time common preservation of old program version and new procedures version, so that for example can recover to change, perhaps when going wrong, old program version can be reused once more.Because this can cause the bottleneck of the storage space that is provided for using, so developed new algorithm, this algorithm is calculated the deviation of old program version and new procedures version, and has created the file that has differential data thus.In addition, differential data is used for generating the new procedures version automatically when showing old program version.Old program version is saved with the differential data file that is significantly less than the new procedures version.The algorithm that is used to create differential data is also referred to as the difference compression algorithm.
In this algorithm, two grades of the key distinction: by the algorithm grade of copy and paste generation new procedures version, and the algorithm grade of using stickup and deletion action.
When copy and paste, the consistent zone of search maximum possible in old and new procedures version.Remaining areas is used as the new zone that will paste.The new zone that will paste and store as differential data about the data of the location in unanimity and new zone or mutual arrangement.Then, duplicate and paste algorithm generation new procedures version from legacy version when needed, this algorithm copies consistent zone from old program version, and utilizes new region that corresponding locating information and mutual the arrangement are set.Thus, rebulid new version fully.
When pasting and delete, search for the zone of maximum possible unanimity equally.Yet differential data information does not comprise the zone that will paste fully, but its difference is at length checked in differentiated each other zone, and creates a montage original text, utilizes this montage original text, and the legacy version in differentiated zone and redaction are mated each other.Thus, paste deletion algorithm and generate the new procedures version, this algorithm changes in old program version accordingly based on the montage original text.New part of adding is stuck, and the abridged part is deleted.Redaction correspondingly generates by the processing to legacy version.
A kind ofly disclosedly duplicate that to paste algorithm be the Xdelta algorithm, this algorithm is attached to gnu general public license.This algorithm has utilized differential data to be applied in the renewal of computer program of mobile terminal device in today, needs obviously littler storage space and transmission bandwidth because the differential data file is compared with the program file itself that utilizes the usual method compression.The computer program that is used to upgrade exists with binary form that it is target processor compiles.Algorithm compares mutually with the binary program code new procedures version old, the zone of the unanimity of search maximum possible, and its position of mark, just its program address.Remaining areas is added in the differential data as the zone that will paste.
Summary of the invention
The objective of the invention is, propose a kind of method and a kind of data processing equipment that is used to create and send differential data that is used to create differential data, wherein, the needed storage space of differential data should be further reduced.Another object of the present invention is to find a kind of method and a kind of data processing equipment that is used to receive and handle this differential data that utilizes the old program version of this differential data updating computer program.
This purpose realizes by method or equipment that the present invention proposes.One aspect of the present invention proposes a kind of method that is used for producing differential data between the new procedures version of the old program version of the computer program that will upgrade and computer program, wherein, the new procedures version can be generated by differential data and old program version, the binary program code of old program version and new procedures version compares mutually, this program code is made of instruction word, and, identical program part is determined, this identical program part does not exist only in the old program version but also is present in the new procedures version, and identical program part comprises at least one instruction word, and the duplicate address data are as first's storage of differential data, these duplicate address data are determined in old program version inside and location at the identical program part of new procedures version inside, it may further comprise the steps: determine old program version and the binary program code of new procedures version and the identical program part that is combined by the instruction word that includes address reference by the sequence that remains unchanged of definitely identical instruction word, this address reference is with reference to another absolute identical instruction word; To sorting out as the program part in the program code that is included in the new procedures version inequality and that remaining is constant of new program part; Store new program part, and by pasting address date and revising the data correction address reference, the stickup address date is determined the location at the new program part of the program code inside of new procedures version, wherein, the second portion of new program part, stickup address date and correction data formation differential data.Another aspect of the present invention proposes a kind ofly to be used to utilize the differential data between the binary program code of the binary program code of the old program version of computer program and new procedures version that the old program version of computer program is carried out method for updating, wherein the binary program code is made of instruction word, differential data comprises the duplicate address data at least, new program part and stickup address date, the duplicate address data are determined the location at the identical program part of the inside of old program version and new procedures version, identical program part is made of the binary program code of the old program version of the sequence that remains unchanged of identical instruction word and new procedures version and the instruction word that includes address reference, address reference is with reference to another identical instruction word, new program part is the program part in all inequality and all the other constant program codes that are included in the new procedures version, determine location by pasting address date in the inside of the binary program code of new procedures version, this method may further comprise the steps: copy identical program part from old program version, and utilize the duplicate address data in the new procedures version, to locate identical program part, utilize the stickup address date in the new procedures version, to paste new program part, utilization belongs to the correction data of differential data, in identical program part, determine new address reference, and the modified address reference.Another aspect of the present invention proposes a kind of data processing equipment that is used to create and transmit differential data, and it has: computing unit, the new and old program version of this computing unit; The Installed System Memory that is connected with computing unit is used for the buffer-stored of data; The non-temporary data memory that is connected with computing unit is used to store old program version, new procedures version and differential data; The communication interface that is connected with computing unit is used to be formed into the data connection of the data processing equipment of another preparation reception at least, and is used for the data transmission of the differential data of another data processing equipment at least.Last aspect of the present invention proposes a kind of data processing equipment that is used to receive and handle differential data, and it has: computing unit, the new and old program version of this computing unit; The communication interface that is connected with computing unit is used to be formed into another data of preparing the data processing equipment that sends and connects, and is used for receiving differential data from another data processing equipment; The non-temporary data memory that is connected with described computing unit is used to store old program version, new procedures version and differential data; The Installed System Memory that is connected with computing unit is used for the buffer-stored of data.
Basis of the present invention is identification, because for example paste new program part, so in the new procedures version inside partly of computer program, as each function or functional block, often only change the position with respect to legacy version.In the binary program code of conversion, cause the variation of a plurality of memory addresss by programmed instruction visit therefrom, therefore, the memory location of the transfer scope of program branches or variable or constant data changes.At first, accessed memory address is with the operand of the operand, particularly transfer instruction of the formal description computer instruction of binary program code.Simultaneously, transfer instruction is used for the branch of function, and comprises the affiliated relative or absolute program address as this function of memory address.In addition, accessed memory address can be used as absolute memory address and is stored in the program, the access instruction access that this memory address utilization is indirect.Absolute memory address is referring again to data, for example variable or constant value.Utilize indirect access instruction, data read from storer or are written in the storer by dual benchmark.
Next, describe as address reference momently by the memory address of programmed instruction visit.
The program part that disclosed Xdelta algorithm identified shifts is inconsistent part, and in this program part, address reference changes, and therefore, this algorithm need not logically and need not come detection of code from content, but directly does man-to-man comparison.Whereby, only find consistent program part, this part has identical instruction sequences.
Yet the basis that the present invention considers is, promptly basic feasible solution is, address reference with and change identification automatically, wherein program code is explained and need not be carried out the detection of character to character.When source code was converted to binary code, the calculating of address reference was carried out by the standardisation process of link and location always.If the source code that is made of the multiple source file is converted, so, at first source file is compiled and is created thus so-called file destination individually.Next, connector is combined into a file destination with independent file destination, and the address parameter is imported on the position, and variable or function are called in this position, therefore, the final position of this variable and function in program with respect to the link time point be unknown.If connector is placed on all address parameters on definite position, steady arm replaces the address parameter by corresponding absolute or relative program address so.Steady arm recomputates the address reference of program part always in the inside of a program and identical program inside.
The present invention is as starting point, and promptly when new and old program version, the address reference of change can be calculated automatically by the new procedures version, therefore, in old program version and the position of all program parts in the new procedures version learned.New absolute or relative address is with reference to can be at large being detected by the method that is used to generate differential data, and corresponding to differential data, thereby when the program part of new and old edition more, modified address reference accordingly.The program part that only must change address reference is used as new program part and is included into, and not as the differential data storage, this has obviously reduced the demand of the storage space of differential data.
In a preferred embodiment of the present invention, differential data is further reduced, and wherein, new address reference does not correspond to differential data.Know old and new procedures version equally because be used to upgrade the algorithm of differential data,, and in the new procedures version, revise so this algorithm is same as be used to create and capablely the algorithm of differential data at large calculate new address reference.
For the reformed address reference of calculated address, must understand, promptly which program part in old program version is corresponding to which program part in the new procedures version.These keep identical program part (except reformed address reference) to be identified as is suitable mutually, and for this reason, the method for the present invention that is used to create differential data detects new and binary code old program version in terms of content.
Binary code is made up of the sequence of instruction word, and its length is determined by the processor of using, and can directly be understood by processor.Instruction word also can be a computer instruction, by operational label, actual operation part and can constitute by the operand that one or more elements constitute, or directly with the value and the specific address of the variable of binary code form storage.
Can discern in this wise in the address reference that the inside of computer program changes, the sequence that is the operational label of computer instruction remains unchanged, and only the operand of transfer instruction or access instruction changes, perhaps the memory address that is changed by the computer instruction visit that remains unchanged for example is written into.
Whereby, not only find identical program part, and find identical program part except the address reference that changes according to algorithm of the present invention.These all program parts are grouped as so-called identical program part, just the program part of unanimity between old program version and new procedures version.
Thereby what be made of a plurality of independently program parts is that unaltered program limit is big with respect to the tangible change of common difference compression algorithm by algorithm identified.The program part of the new arrangement that remaining is retained correspondingly takies very little memory location, therefore, the present invention can be applied in the situation that is used for updating computer program especially, in these programs, the data transmission only arrowband or with high costs is possible, during for example as the use gsm mobile telephone.
By the differential data of algorithm stores comprise be used for new, all new program part and positional informations so far as the form of the program address data that also are used for identical program part, yet, wherein the difference with respect to the algorithm of routine is that program part seldom is corresponding to program part new and that be used to transmit.
In a preferred embodiment of the present invention, algorithm scrutiny program version repeatedly on identical, new procedures version.In the first step, this algorithm is picked out the zone that is associated of identical instruction word.In addition, algorithm begins computing by the associated area of maximum possible, and the value of computing to a minimum then.Be subjected to the minimum value of system constraint to represent the length of instruction word.In a special design proposal, the minimum value in the zone that is associated can be also preestablishes as the multiple of instruction word, thereby, optimized the process that differential data is created.
In second step, the identical relatively computer instruction of search in program part all the other reservations and the new identification of conduct temporarily, and in identical program part, search for indirect access instruction.Identical relatively computer instruction is the instruction that has as the address reference of operand, and its operational label and relative position and adjacent identical program part unanimity.Yet the value of operand deviates from the value in old program version in the new procedures version.Identical relatively computer instruction often directly is arranged in the afterbody of identical program part as next instruction, perhaps is inserted between two identical program parts.Yet these instructions also can only be surrounded by new program part.If the operand of identical relatively computer instruction and address reference come reference as the program limit that identical program part is included into, so, utilize identical relatively computer instruction that order line is categorized as identical program part.If the program part that this order line is identical with another is adjacent, this order line is corresponding to this identical program part so.
The indirect access instruction that belongs to identical program part is with reference to instruction word, and instruction word comprises the absolute program address as address reference.If instruction word belongs to as the program part that newly is included into, and be included in absolute program address in the instruction word again with reference to identical program part, the identical program address of instruction word is classified as identical program part equally so.
Next, second step repeated in a time, up to finding all instructions that have with reference to the address reference of identical program part.
In another preferred embodiment, after finishing, the generation of differential data carries out the checking of differential data.This realizes thus, promptly creates the new procedures version according to differential data and old program version, when occurring in new and old program version (as: on mobile terminal device) identically.Identical program part duplicates out from old program version, and pastes the program address of the correspondence of new procedures version.Address date also can be used as the duplicate address data and represents.Itself or starting point is described and the length of corresponding program part, starting point and end point are perhaps described.
Except the position of identical program part, new program part also obtains differential data, and is inserted in the new procedures version between identical program part.This realizes that on the program address this program address illustrates by so-called stickup address date.Subsequently, perhaps when the copy and paste of program part, search address reference in program part, and it is detected, i.e. address reference in old program version is with reference to those identical program parts.Then, the known reposition corresponding to identical program part comes the modified address reference.At last, the new procedures version comparison of the new program version of creating and original existence, and if determine there is not deviation, differential data can be used as correct and is included into so.
In the process of checking, can find that the mistake determined, this mistake depend on, in program code, comprise the long statement of data, text string for example, it is consistent with one or more instruction words in being included in old program version with its binary form.If the statement of these data is used as identical program division and assigns to explain undeservedly, can cause so, i.e. program version of during verifying, creating and original new procedures incompatible version.These are explained in another design proposal of the present invention improperly as special event recognition.As possible assisting, the instruction word that has unaccounted data is deleted from the group of identical program part, and is included into as new program part.Can select another kind of possibility in such a case, in this case, the unaccounted statement of data does not exist only in the old program version and also is present in the new procedures version.Then, the location storage of these data is in old program version and new procedures version, and the data division that conduct will be duplicated under distinguishing mark adds in the differential data.In the method, create the less differential data that will transmit with respect to the data that are included into as new program part.
Recipient one side of differential data, the appraisal procedure that is used for matching with the generation method must be employed, thereby can create correct new procedures version from differential data and in the old program version.The method of the present invention that is used for new and old program version like this, utilization is included in the duplicate address data in the differential data and copies identical program part from old program version, and is correspondingly locating in the new procedures version.New program part utilization is pasted address date and is pasted between the identical program part.Afterwards or identical program part duplicate or during the stickup of new procedures version, all identical relatively computer instructions and the instruction of all indirect accesses find out one by one from program part, explain or revise, that is to say that it is evaluated, the address reference of instruction position with reference to that identical program part and this program part in old program version has changed how many character lengths or byte in the new procedures version.The new address reference of Chuan Jianing is registered in the new procedures version accordingly thus.According to the type of address reference, modified value or calculate, and therefore be added to the quantity of the correspondence of byte on the old relative memory address or deduct from it as displacement, this modified value or as the absolute position and memory address determine.
Comprise computing unit according to the data processing equipment of generation that is used for differential data of the present invention and transmission as core, microprocessor for example, it is used to carry out the method that is used to generate differential data, and at least one is used for the Installed System Memory of data buffering storage.In addition, in order to store old program version or new procedures version and differential data constantly, have non-interim data-carrier store, as hard disk or flash memory.In addition, data processing equipment has communication interface, utilizes this communication interface can constitute wireless or set up data by data processing equipment that cable and another preparation at least receive and is connected, thereby transmit differential data by this data-interface.Such data-interface can for example be that GSM interface or network connect.
In addition, in a preferred design proposal, data processing equipment comprises input block, as keyboard or mouse, thereby, can import minimum value whereby in advance as the identical program part that is included into.This input can be used in optimization and creates the method for differential data and the storing value that is used to influence differential data.The minimum value that method is determined shows as computer instruction, and therefore, in identical program part, operand must be consistent with operational label.When producing deviation, the user can illustrate that the minimum value of identical program part is several times of this optimum cell.Computing unit is correspondingly considered predetermined value then, and wherein, this predetermined value is corresponding to the less same program part of new program part.
The data processing equipment that is used to receive and handle differential data according to the present invention comprises the computing unit as core, and its execution is used for the method for new and old program version.In addition, the Installed System Memory that is used for metadata cache that exists, the non-interim data-carrier store that is used to store old program version and new procedures version and differential data and communication interface can utilize wireless or wired being connected to set up the connection of the data processing equipment that preparation sends, so that this data processing equipment is accepted differential data once more.
In a preferred design proposal, after accepting differential data, computing unit is according to verification and check whether carry out faultless transmission.In addition, in another design proposal, according to the authenticity of the file address inspection differential data that together sends, thereby whether verification msg is sent by titular transmitter.
If according to verification and or the file address determine that promptly differential data is invalid, upgrade being interrupted so, and mistake can be preserved in error memory.
The generative process of new procedures version can or directly start after successfully receiving, and perhaps the result by determining upgrades as the effective flow process by legacy version.
The new program version of creating can be once more according to verification with check its correctness, and under the situation of mistake, by old program version replacement, it must be stored individually for this reason.In this kind situation, the corresponding error report also is stored.
Description of drawings
Next, reference example and accompanying drawing are further explained the present invention.Shown in the figure:
The renewal of the computer program that Fig. 1 is made up of two original functions;
Fig. 2 is used to create and send the data processing equipment of differential data;
Data processing equipment shown in Fig. 3 Fig. 2 and data center and two receive and handle the communicating by letter of data processing equipment of differential data.
Embodiment
As an example, during charge equipment in being installed in motor vehicle, consider the renewal of old program version.At this, the data processing equipment that is used to create differential data is connected with so-called data center, central communication computer, and this computing machine can be handled the renewal of a plurality of charge equipments.
Figure 2 illustrates such being used to and create the data processing equipment 11 of differential data.Can see computing unit 12, this computing unit is carried out the method for the establishment that is used for differential data, and this computing unit is connected with ethernet interface 15, and Installed System Memory 13 and non-temporary data memory 14, and it is designed to hard disk.In addition, computing unit 12 is connected with the keyboard that uses as input block 16, utilizes this keyboard to carry out the input in advance of the minimum value that is relevant to identical program part, perhaps can be manipulated to the transmission course of the differential data of charge equipment by hand.In addition, in order to detect input, pattern displaying unit 22 is connected with computing unit 12.
Figure 3 illustrates the data processing equipment 11 that is connected with data center 22.Data center 22 is connected with two data processing equipments 17 as the charge equipment design by gsm radio again.Data center 22 also has Ethernet interface 24, GSM interface 25 and Installed System Memory and non-interim data-carrier store 27 except having computing unit 23.Be provided with a computing unit 18 in each data processing unit 17, this computing unit is carried out the method that is used for new and old program version.This computing unit and gsm communication interface 19, Installed System Memory 21 and the flash memory (Flash-ROM) that uses as non-interim data-carrier store 20 are connected.Input block and output unit are not necessarily necessary in this equipment, and therefore, it can not rely on the work of operator ground.
In ensuing giving an example, the old program version of the computer program that moves on charge equipment is made of two functions, and wherein, second function called in from first function.
Function has following C-source code:
Void FunctionA(void)
{
FunctionB();
}
void FunctionB(void)
{
int y=1;
}
The mnemonic form of computer instruction that is used for the ARM7 processor is as follows:
FunctionA:
stmdb r 13!,{r14}
b1 FunctionB
ldmia r13!,{pc}
FunctionB:
mov r0,#1
mov pc,r14
In the new procedures version, paste the 3rd function, promptly between function A and B.
void FunctionA(void)
{
FunctionB();
}
void FunctionC(void)
{
int x=0;
}
void FunctioB(void)
{
int y=1;
}
The conversion that is used for FunctionC has form:
Function C:
mov 0,#0
mov pc,r14。
Because for the present invention, have the instruction of address reference, play the part of conclusive role as the branch instruction b1 here, thus only consider its binary mode at this in for example, and when simplification is used to describe remaining instruction, keep mnemonic form.
The operational label of instruction " b1 FunctionB " is part " b1 " (branch and link), and it writes as " 0 x eb " scale-of-two.The relative position that is used for the FunctionB of displacement commands is registered as operand.Because between the program address and FunctionB of branch instruction, therefore relative displacement address is corresponding to 8Byte, because ARM 7 processors are 32 bit processors in old program version for two instruction lengths.Yet in branch instruction " b1 ", relative displacement address has been interpreted as comprising the side-play amount of 8 Byte, so the operand of branch instruction is 0 x 000000.
In ensuing table 1, the conversion that is used for ARM7 is shown contrastively in legacy version and redaction.As in the program line 2 of redaction, according to the displacement of FunktionB, the relative displacement address of branch instruction improves 8 Byte (0 x 000002) with two instruction lengths downwards.
Relatively as the program line 2 of new program part and 4-5 the time, conventional difference compression algorithm is identified.
Table 1: in for example 1, the mnemonic symbol of legacy version and redaction
Program line Old program version The new procedures version
1 stmb r13,{r14} stmb r13!,{r14}
2 0xeb000000 0xeb000002
3 ldmia r13!,{pc} ldmia r13!,{pc}
4 mov r0,#1 mov r0,#0
5 mov pc,r14 mov pc,r14
6 mov r0,#1
7 mov pc,r14
In contrast, the algorithm identified row 1 according to the present invention that is used to create differential data as first identical program part and row 3 as second identical program part and row 6 and row 7 as the 3rd identical program part.Algorithm begins computing and attempt seeking once more the program line that exists there new version from old program version.If move the position of row, the location finding that moving equally of the row after this row in legacy version so.The row of arranging each other 4 and 5 of legacy version is expert at and 6 and 7 is found once more, therefore can not obscure between identical program line 5 and 7, but new row 5 is clearly corresponding to new program part.
Next, when the identical relatively computer instruction of search, the algorithm displacement commands in 2 of finding to be expert at, its not only adjacent first identical part but also adjacent to second identical part.In two program versions, this displacement commands is with reference to same identical program part, and therefore first identical program part is added in instruction.Then, second identical program part is directly linked on first identical program part, thereby makes these two identical program parts can be associated to an independent identical program part.The row 4 and 5 that algorithm is only discerned redaction is new program part.
Be included in the program line 4 of the new procedures version in the differential data and 5 content and locating information, for example the program address as detailed description is linked together, and this program address is here by row number explanation.In addition, differential data comprises data, and promptly same identical program part is between the new row 1 to 3, as between old row 1 to 3, and the row 6 of new version and 7 row 4 and 5 corresponding to old version.
The storage size of differential data not only realizes in this wise, 2 needn't store at once as the identical program part that comprises the stickup address date, but in this wise, 1 to 3 be used as the identical program part identification that is associated at once, must only comprise the statement of one rather than two duplicate address data therein.Simplify for example in the minimizing of the differential data realized clearly make the program length of increase and program complexity increase manyfold.
When indirect access instruction, second illustrates searching of address reference.
Program version is made up of two part of total program of storing with different source code file (Modul1.c and Modul2.c) respectively.
Old version:
Modul1.c:
const int x=1;
Modul2.c:
void Function1{void}
{
int local;
local=x;
}
New version:
Modul1.c:
const int y=2;
const int x=1;
Modul2.c:
void Function1{void}
{
int local;
local=x;
}
This is identical to Modul2.c at two program versions, and the explanation of constant y is new the interpolation in Modul1.c.
The summary that is used for the affiliated conversion of ARM7 can find at table 2, and wherein, binary code and corresponding mnemonic symbol separately illustrate.
On 0 x 41000104 of program address, two versions, this instruction has absolute program address 0 x 41000110 as address reference to storage instruction " ldr r0,0 x 41000110 " (0 x 41000110 loads registration r0 from the address) indirectly.Giving the reference of finding second program address and second address reference on first address, 0 x 41000200 or 0 x 41000204.Constant x is on second address.Utilize instruction " ldr r0,0 x 41000110 ", a value is loaded by second address reference, and wherein, second address reference utilization is included in first address reference discovery in the instruction.
According to the algorithm that is used to create differential data of the present invention, when the binary code of comparison program version identification from the row of 0 x, 41000104 to 0 x 4100010c as first identical program part.Row 0 x 41000200 of this algorithm identified in old program version is same as identical program part with row 0 x 41000204 in the new procedures version.
Table 2: at for example redaction in 2 and the mnemonic symbol of legacy version
Figure C200580006703D00261
Figure C200580006703D00271
Among program part-row 0 x 41000110 and 0 x 41000200 that conduct in the new procedures version newly is included into, utilize and search computer instruction as the address reference of operand.Yet row does not comprise computer instruction, because two row belong to so-called " literal pool " or character area.In for example, fixed value 1 and 2 is literal.Character area is in the zone in address space shown in this contact, and literal and affiliated address are kept in this address space.
Search the computer instruction as the address reference of operand except utilizing in new program part, identical program part utilizes address reference to search indirect access instruction.Be expert at simultaneously and find instruction ldr among 0 x 41000104, its address reference is with reference to second address reference, second identical program part of second address reference indication.Whereby, because comprise the instruction word (0 x 41000200 or 0 x 41000204) that has the address reference on identical program part as program part 0 x 41000110 that newly is included into so far, so this instruction word is equally as identical program part arrangement.Because it directly is connected on first identical program part, it is corresponding to this program part.
The storing value of differential data can further reduce after utilizing the compression of standard compression method, and this differential data sends in the charge equipment of installing motor vehicle from toll center.When the charge equipment that will upgrade when registering at the center next time, such process for example is activated, thus data are used in the exchange street.With after the center contacts for the first time, directly send a update request to charge equipment, and then charge equipment enters the receiving mode that is used for differential data.
After data processing equipment 11 was determined differential data, this equipment connected the transmission differential data to data center 22 by Ethernet.Data center waits for does not also have the charge equipment of renewal to register at the center again so far.Therefore, for example two of fleet trucies just have been that a freight transportation starts, and the data processing equipment of installing in truck 17 is used for next obtaining the street cost of use to data center's registration.Then, data center 22 requires equipment 17 to receive differential data.After differential data was transferred on the charge equipment by GSM, charge equipment was according to the verification of together sending and detect, and whether realized faultless transmission.In addition, utilize the password of in charge equipment, preserving in advance to verify whether be correct, that is to say whether differential data comes from trustworthy source if utilizing differential data to be sent to the file address.The renewal process of the old computer program of preserving in charge equipment subsequently, begins.
In addition, in Fig. 3, this also is possible, and promptly data processing equipment 11 itself is worked as the center, and correspondingly directly is formed into the data connection of charge equipment, and differential data can be transferred to charge equipment.
Fig. 1 shows the synoptic diagram of the renewal that above-described first program gives an example.Old program version 1 is used for as the update method of duplicating original paper.Duplicate address data 10 explain from old program version 1 to copy which part, and this part of duplicating out must copy to which position of new procedures version 2.These duplicate address data belong to the location of the first 6 of the differential data 3 of describing identical program part.Illustrate for example in, illustrate with its binary form as the displacement commands of independent computer instruction.It can be cut apart in functional symbol 4 (" 0 x eb ") and functional symbol 5 (" 0 x 000000 ").
Utilization belongs to the stickup address date 9 of the second portion 7 of differential data 3, and new program part 8 can stick between the identical program part.
Next, update method is searched the instruction word that has address reference in identical program part, and finds instruction 0 x eb000000, and it is originally with reference to program line 4., this program line finds that algorithm is rejected the duplicate address data in 6 if being expert at now.This algorithm can correspondingly calculate the relative displacement address as 4 instruction lengths, and because algorithm is to instructing 0 x eb decoding, so this also is as can be known, promptly relative displacement address utilizes the deviation of 2 instructions to illustrate.Algorithm correspondingly calculates 0 x 000002 as new operand 5, and registration is expert in 2.The new procedures version 2 can and be checked its correctness according to another verification.
If successfully realized renewal, each charge equipment automatically starts execution new procedures version so.
In second program given an example, update method found to come the ldr instruction of 0 x 41000104 voluntarily in identical program part, and the reference of second address reference on 0 x 41000110 of program address in character area.Second address reference is carried out in old program version 0 x 41000200.Affiliated program line (0 x 00000001) moves to specific address 0 x 41000204 in new version.Update algorithm is registered in this new address reference in the new procedures version.

Claims (23)

1. method that is used between the new procedures version of the old program version of the computer program that will upgrade and computer program, producing differential data, wherein
-described new procedures version (2) can be generated by differential data (3) and described old program version (1),
The binary program code of-described old program version (1) and described new procedures version (2) compares mutually, and this program code is made of instruction word, and
-identical program part is determined, this identical program part does not exist only in described old program version, (1) in but also be present in described new procedures version, (2) in, and described identical program part comprises at least one described instruction word, and duplicate address data, (10) as described differential data, (3) first, (6) storage, these duplicate address data are determined at described old program version, (1) inner and at described new procedures version, (2) location of Nei Bu identical program part
It is characterized in that, may further comprise the steps:
-determine described old program version (1) and the binary program code of described new procedures version (2) and the described identical program part that combines by the described instruction word that includes address reference by the sequence that remains unchanged of absolute identical instruction word, this address reference is with reference to another absolute identical instruction word
-to sorting out as the program part in the program code that is included in described new procedures version (2) inequality and that remaining is constant of described new program part (8),
-storage described new program part (8), and by pasting address date (9) and revising the described address reference of data correction, described stickup address date is determined the location at the described new program part (8) of the program code inside of described new procedures version (2), wherein, described new program part (8), described stickup address date (9) and described correction data constitute the second portion (7) of described differential data (3).
2. method according to claim 1 is characterized in that, repeatedly realizes determining of described identical program part, wherein
-at first, only absolute identical instruction word is used as identical program part identification,
-next, search the described instruction word that has described address reference with new program part identical,
If-described address reference is with reference to identical program part, so Suo Shu instruction word assigns to put in order as described identical program division,
-and then, beginning to search for described address reference again, this address reference is with reference to identical program part.
3. method according to claim 2 is characterized in that, at first, described identical program part is searched for as the sequence that links up of described absolute identical instruction word, and wherein, described sequence has the described absolute identical instruction word of minimal amount.
4. method according to claim 2, it is characterized in that, search identical relatively computer instruction at described new program part, in this instruction, operational label (4) is present in two program versions, and operand (5) illustrates described address reference, and this address reference is with reference to described identical program part.
5. method according to claim 2, it is characterized in that, search the indirect access instruction at described identical program part, its operand is with reference to the described address reference of described new program part inside, and described address reference is again with reference to described identical program part, and then, the instruction word that belongs to described address reference is classified as described identical program part equally.
6. according to each described method in the aforementioned claim, it is characterized in that, after the generation of described differential data (3) finishes, carry out the affirmation of described differential data (3), wherein
The copy of the described new procedures version of-generation, wherein said identical program part is from duplicating out the locational described old program version (1) of duplicate address data (10), and described new program part (8) is adhered on the position of pasting address date (9)
The address reference of the described same program part of-described all references is searched, and is calculated by the new location of the described identical program part of reference,
-be performed corresponding to the correction of the described address reference of described new location,
The copy of-described program version and described new procedures version (2) are relatively.
7. method according to claim 6, it is characterized in that, when confirming, the data of not explained of described identical program part are identified, its binary form always with binary form of described instruction word or consistent with binary form of the sequence of the instruction word that comes from described old program version (1).
8. method according to claim 7 is characterized in that, the instruction word that belongs to described unaccounted data is deleted from described identical program part, and stores as described new program part (8).
9. method according to claim 7, it is characterized in that, address date is as the 3rd of described differential data (3) part storage, and described address date is determined the location of described unaccounted data of the binary program code inside of described old program version (1) and described new procedures version (2).
10. one kind is used to utilize the differential data (3) between the binary program code of the binary program code of the old program version (1) of computer program and new procedures version (2) that the old program version (1) of computer program is carried out method for updating, wherein
-described binary program code is made of instruction word,
-described differential data (3) comprises duplicate address data (10), new program part (8) at least and pastes address date (9),
-described duplicate address data (10) determine in the location of described old program version (1) with the identical program part of the inside of new procedures version (2),
-described identical program part is made of the binary program code of the described old program version (1) of the sequence that remains unchanged of identical instruction word and described new procedures version (2) and the described instruction word that includes address reference, described address reference is with reference to another identical instruction word
-described new program part (8) is the program part in all inequality and all the other constant program codes that are included in described new procedures version (2), determine location by described stickup address date (9) in the inside of the binary program code of described new procedures version (2)
It is characterized in that, may further comprise the steps:
-from described old program version (1), copy described identical program part, and utilize described duplicate address data (10) in described new procedures version (2), to locate described identical program part,
-utilize described stickup address date (9) in described new procedures version (2), to paste described new program part (8),
-utilize the correction data that belong to described differential data, in described identical program part, determine new address reference, and revise described address reference.
11. method according to claim 10 is characterized in that, described address reference is determined, and this address reference is with reference to described identical program part, and described address reference is revised corresponding to the new location of described identical program part.
12. method according to claim 11 is characterized in that, described new location by the identical program part of reference is used as location in described old program version (1) and the displacement between the location in described new procedures version (2) is calculated.
13. method according to claim 11 is characterized in that, the absolute fix that described new location by the identical program part of reference is used as in described new procedures version (2) is calculated.
14. a data processing equipment (11) that is used for creating and transmitting differential data (3), it has:
-computing unit (12), the new and old program version of described computing unit, described computing unit are carried out according to the described method of claim 1 to 9,
-the Installed System Memory (13) that is connected with described computing unit (12) is used for the buffer-stored of data,
-non-the temporary data memory (14) that is connected with described computing unit (12) is used to store old program version (1), new procedures version (2) and differential data (3),
-the communication interface (15) that is connected with described computing unit (12), be used to be formed into the data connection of the data processing equipment (22) of another preparation reception at least, and be used for the data transmission of the described differential data (3) of another data processing equipment (22) at least.
15. data processing equipment according to claim 14 (11), it is characterized in that, described computing unit (12) is connected with input block (16), this input block is used for the input of the minimum value of identical program part, this minimum value is as the quantity of the computer instruction that belongs to identical program part at least, and described computing unit (12) is considered the minimum value of described identical program part as follows, be its corresponding to identical program part, the value of this program part is less than the minimum value of adjacent new program part (8).
16. a data processing equipment (17) that is used for receiving and handling differential data (3), it has:
-computing unit (18), the new and old program version of described computing unit, described computing unit are carried out according to the described method of claim 10-13,
-the communication interface (19) that is connected with described computing unit (18), the data that are used to be formed into the data processing equipment (22) that another preparation sends connect, and are used for receiving described differential data (3) from another data processing equipment (22),
-non-the temporary data memory (20) that is connected with described computing unit (18) is used to store old program version (1), new procedures version (2) and described differential data (3),
-the Installed System Memory (21) that is connected with described computing unit (18) is used for the buffer-stored of data.
17. data processing equipment according to claim 16 (17) is characterized in that, is upgrading described old program version (1) afterwards, described computing unit (18) is according to verification and check the validity of described new procedures version (2).
18. data processing equipment according to claim 16 (17) is characterized in that, is upgrading described old program version (1) afterwards, described computing unit (18) is checked the validity of described new procedures version (2) according to the file address.
19. data processing equipment according to claim 17 (17), it is characterized in that, when described new procedures version (2) was invalid, described computing unit (18) substituted described new procedures version (2) by described old program version (1), and produces an error reporting.
20. data processing equipment according to claim 17 (17) is characterized in that, when described new procedures version (2) was effective, described computing unit (18) automatically performed described new procedures version (2).
21. data processing equipment according to claim 16 (17) is characterized in that, is receiving described differential data (3) afterwards, described computing unit (18) directly begins the renewal of described old program version (1).
22. data processing equipment according to claim 16 (17) is characterized in that, described communication interface (19) is the GSM interface.
23. according to each described data processing equipment (11,17) in the aforementioned claim 14 to 22, it is characterized in that, before sending or after accepting, described computing unit (12,18) utilizes the compression method compression of standard or the described differential data (3) that decompresses.
CNB2005800067034A 2004-03-02 2005-02-01 Method and data processing device for updating computer programs by data transmission Expired - Fee Related CN100474248C (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
DE102004010179A DE102004010179A1 (en) 2004-03-02 2004-03-02 Method and data processing device for updating computer programs by data transmission
DE102004010179.5 2004-03-02

Publications (2)

Publication Number Publication Date
CN1926513A CN1926513A (en) 2007-03-07
CN100474248C true CN100474248C (en) 2009-04-01

Family

ID=34917059

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2005800067034A Expired - Fee Related CN100474248C (en) 2004-03-02 2005-02-01 Method and data processing device for updating computer programs by data transmission

Country Status (5)

Country Link
EP (1) EP1721248B1 (en)
CN (1) CN100474248C (en)
AT (1) ATE365348T1 (en)
DE (2) DE102004010179A1 (en)
WO (1) WO2005085993A2 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7890464B2 (en) * 2003-06-20 2011-02-15 Innopath Software, Inc. Processing software images and generating difference files
JP5775599B2 (en) * 2010-12-15 2015-09-09 マイクロソフト テクノロジー ライセンシング,エルエルシー Intelligent code difference processing using code clone detection
KR101602993B1 (en) * 2012-08-23 2016-03-11 엘에스산전 주식회사 Error detection device for programming language
CN106203460A (en) 2015-05-05 2016-12-07 杜比实验室特许公司 Training signal processes model for the part replacement in signal processing system
CN106656200B (en) * 2016-12-13 2019-11-08 合肥工业大学 A kind of program counter compression method and its hardware circuit
WO2018173911A1 (en) * 2017-03-24 2018-09-27 日立オートモティブシステムズ株式会社 Car onboard control device and program updating software
CN109471656A (en) * 2017-09-06 2019-03-15 上海汽车集团股份有限公司 A kind of program updating method and device
CN111737638A (en) * 2020-06-11 2020-10-02 Oppo广东移动通信有限公司 Data processing method based on Fourier transform and related device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
IL125846A0 (en) * 1998-08-19 1999-04-11 Emony Incremental program update
JP5019578B2 (en) * 2003-06-23 2012-09-05 レッド・ベンド・リミテツド Method and system for updating a version of content stored in a storage device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Compressing differences of executable code. BAKER B S ET AL.WORKSHOP ON COMPLIER SUPPORT FOR SYSTEM SOFTWARE AND ACM SIGPLAN. 1999
Compressing differences of executable code. BAKER B S ET AL.WORKSHOP ON COMPLIER SUPPORT FOR SYSTEM SOFTWARE AND ACM SIGPLAN. 1999 *

Also Published As

Publication number Publication date
WO2005085993A3 (en) 2006-06-29
EP1721248A2 (en) 2006-11-15
CN1926513A (en) 2007-03-07
DE102004010179A1 (en) 2005-10-06
DE502005000902D1 (en) 2007-08-02
ATE365348T1 (en) 2007-07-15
EP1721248B1 (en) 2007-06-20
WO2005085993A2 (en) 2005-09-15

Similar Documents

Publication Publication Date Title
CN100474248C (en) Method and data processing device for updating computer programs by data transmission
CN100447740C (en) System and method for intra-package delta compression of data
CN105446723A (en) Method and device for identifying semantic difference between source code versions
KR102088167B1 (en) Apparatus for updating software as an agent and patch method thereof
CN106815051A (en) A kind of firmware upgrade method of embedded device, device and currency examination device
CN108205446A (en) Firmware restorative procedure and device
CN107992325A (en) A kind of method that fileinfo is compared by feature code check
CN106055375A (en) Application program installation method and device
CN102346925B (en) Electronic ticket storage equipment, electronic ticket checking system and method
CN112286565A (en) Embedded system differential upgrading method based on storage container
KR100826553B1 (en) Car navigation system, map data update system and method thereof and data saving device thereof
CN101681415B (en) Method and apparatus for changing and adding activation keys for functions of digital content
CN107943504B (en) Dynamic upgrading method for software module in embedded system
CN102799528B (en) A kind of script debugging method for circuit board level test, device and system thereof
US9396239B2 (en) Compiling method, storage medium and compiling apparatus
CN113791809B (en) Application exception handling method and device and computer readable storage medium
US20080270430A1 (en) File management system, file management method, support device thereof, and program thereof
CN101197959A (en) Terminal control method, system and equipment
CN104572145A (en) File version management method and system
CN113568834A (en) SDK code compatibility detection method, device, computer equipment and medium
CN106201606A (en) software distribution method and system
CN113157329A (en) Method, system, server and storage medium for starting application
KR101737575B1 (en) Method and device for verifying data based on sql sentences generated automatically
KR101737576B1 (en) Method and device for transmitting data based on sql sentences generated automatically
CN111881128B (en) Big data regression verification method and big data regression verification device

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20090401

Termination date: 20180201

CF01 Termination of patent right due to non-payment of annual fee