Background technology
Along with the develop rapidly of China's automobile industry, domestic a lot of Automobile Enterprises and colleges and universities are devoted to the research and development of automobile control software design.For automobile control software design, gordian technique not only comprises the algorithm realization of control law, also adopts the mode that theory and experimental result combine, and final input/output relation is converted to the MAP table of mapping.Ripe product software remodeling only needs retouch MAP to show just can complete.MAP table is the significant data information of automobile software.
The design of software can cover dissimilar automobile product, and concrete entrucking product can realize the agreement of particular type by the change of nominal data, the important content of therefore nominal data Ye Shi producer protection.
As gordian technique control method, the secret important method being automobile software enterprise and protecting advanced technology of software kernels technology.Software should be allowed can to upgrade on auto production line, ensure that gordian technique does not leak again, demarcating file is very important method, and it comprises code information and the data message of software, they are realizations of the gordian techniquies such as control law, comprise most important technical information.But the size of code of automobile control software design is often all very large, and compiled code amount is MB data magnitudes.Therefore the content represented with data mode after how managing these compilings is the key of demarcating document design, and it is the prerequisite that calibration tool and target machine carry out file interaction, and good file organization form is conducive to simplified communication protocol, realizes effective transmission of file.
The design of demarcating file mainly completes the stipulations of software code and data layout.This technology is monopolized by Foreign Automobile Enterprises at present, is the important means of restriction Automobile Industry in China development.This patent is devoted to solve this problem, for the realization of calibration tool provides technical support.
Summary of the invention
The object of the invention is: the storage means providing a kind of nominal data, effectively can manage chunk data, and effective storage of data under the discontinuous situation in address can be ensured.
Technical solution of the present invention is:
A design for nominal data storage means, is characterized in that: comprise the following steps:
1] obtain nominal data information, nominal data information is divided into two classes: data first address and nominal data;
2] nominal data information is stored in data field:
When nominal data information is data first address, data field stores first address Product-factor;
When nominal data information is nominal data, data field stores offset address and nominal data;
3] before data field, add control field, after data field, add check field;
Control field comprises for the field of identification data field character and the field for identifying nominal data message length;
Check field is for ensureing the correctness of nominal data.
With 2 bytes store first address Product-factors; With 2 bytes store offset addresss, 1 bytes store nominal data.
Step 3] in control field, for a field bytes store of identification data field character; For identifying the field of nominal data message length.
Step 3] comprise 3 kinds for the field of identification data field character: mark first address information, mark nominal data and identification document terminate.
Check field adopts the method for School Affairs to arrange.
Advantage of the present invention is: the method efficiently simply solves demarcates rationalization's problem of file, and achieving with address is the nominal data arrangement hereof of communication infrastructure.Consider communication to start, terminate, large data transmission, and the identified problems of communication intermediate data, and ensure that data correctness and the high efficiency communicated with simple algorithm, at the design aspect of calibration tool, there is very large practical value.
Embodiment
1. the design of data structure: object is to mark off three partial datas clearly, enables calibration tool obtain with as far as possible little computing cost and store data.
As shown in Figure 1, control field is used for character and the nominal data message length of marker data field to the unitized construction of three data segments, is the information that calibration tool primarily obtains, and is placed on row first, is convenient to search.Data field is the entity of nominal data, is placed in thereafter, and check field ensures the overall correctness of the row data, is placed on end of line.In order to the readability of file, the nominal data that often row stores is no more than 0x20.
The data length of different processor single treatment differs, and consider the compatibility of demarcating file, nominal data adopts single digital independent amount-4 byte of higher level 32 machines general at present.
1.1 control field designs:
Packet in enormous quantities is containing two kinds of information, data address and data itself.In the transmission of data in enormous quantities, can not all data of disposable transmission, so data need segmentation, every segment data should state start address separately.Field for identification data field character is divided three classes according to application needs:
1. identify nominal data;
2. identification document terminates;
3. identify first address information.
Field for identification data field character adopts a bytes store, due to the data that the length of nominal data and first address is variable within 0x20, in the design of control field, consider this problem, the field for identifying nominal data message length adopts a bytes store.Format is as Fig. 2.
The character of data field is defined as follows:
0x00: represent nominal data;
0x01: represent the end of file;
0x04: represent data first address.
Be as the criterion often to go the physical length of actual nominal data and data first address for the field that identifies nominal data message length, be less than or equal to 0x20.
1.2 data field designs:
Nominal data information comprises two classes: data first address and nominal data itself; Nominal data information is stored in data field;
When storing data first address, data first address=base address * Product-factor; Base address adopts 0x10000, Product-factor two byte representations, and denotable address realm is [0,0xFFFF0000], adds address offset, and denotable address space is 4GB, is far longer than the space that current automobile nominal data needs.As shown in Figure 3, first address Product-factor is exactly data field.
When storing nominal data, data field represents as shown in Figure 4:
Offset address is made up of two bytes, and scope is [0x0,0xFFFC]; Nominal data length is [0x4,0x20].
The design of 1.3 check field
The object that check field is arranged is to ensure the correctness in each row of data transmitting procedure.Because nominal data is at the MB order of magnitude, the data of often row transmission all need verification, and the time overhead of verification computing affects the key factor of transmission performance.In order to reduce computing overhead, adopt the method for School Affairs.The method communication two ends operand all very little, be conducive to communicate high efficiency.
Below by embodiment, the present invention is described in further detail.
Certain data volume is 0x11FF86 byte, the design in continuous data district, two different addresses, and first address and the length of two segment datas are respectively:
First address: 0x1000 data length: 0x10FF80;
First address: 0x15000 data length: 0x1006.
The design of this example considers all problems that high order of magnitude data assignment may run into, and data volume can arbitrarily be expanded, and the method for designing of file is constant.
Data assignment: first address is 0x1000, the data acquisition of data in 0x10000 offset address mode, acquiescence base address is 0x0; The data of more than 0x10000, by 02 control word statement first address, are 0x10000=0x10000*1; Therefore base address multiplication factor is 0x1; First paragraph data length is the integral multiple of 0x20, all adopts 0x20 memory length.
The start address of second segment data is 0x15000, and start address does not need again to state, offset address is from 0x5000, and the number before 0x16000 address adopts the storage mode of often row 0x20 data, last 6 independent a line of character.
As Fig. 5,04 is control field, and what represent data field storage is first address Product-factor; 02 is data length, and 0001 is first address Product-factor, and 07 is check field;
As Fig. 6,00 is control field, and 06 is data length, often row 0x06 nominal data, and 6000 is offset address.
As Fig. 7,01 is control field, and 00 represents that data field does not have data, and 01 is verification.