Calibration data writing method based on XML modeTechnical Field
The invention belongs to the technical field of automotive electronics, and particularly relates to a calibration data writing method based on an XML mode.
Background
In the research, development, production and after-sale stages of a whole vehicle, calibration data of some controllers needs to be flushed into the controllers, and currently, the following two mainstream modes are generally used for flushing the calibration data of the automobile controller: 1. based on CCP/XCP protocol, the calibration tool used in this way is expensive (e.g., CANAPE by VECTOR, INCA by ETAS), and is not suitable for production line and after sale; 2. the method based on the UDS is used for brushing the data into the controller, the realization method is practical for calibrating the controller with large data volume, but for the controller with small data volume, the method is not suitable for the requirement of a production line on production beat due to the fact that the flow is complex and the brushing time is long.
Therefore, a new method for effectively solving the problem is urgently needed.
Disclosure of Invention
The invention aims to provide a simple and effective calibration data writing method based on an XML mode, which meets the requirement of a production line on production beat.
The invention discloses a calibration data writing method based on an XML mode, which is used for writing calibration data in an upper computer into a target controller of a vehicle to realize data updating in the target controller and specifically comprises the following steps: A. the upper computer is in communication connection with the target controller, and an XML document containing data to be calibrated is stored in or transmitted to the upper computer; B. and the upper computer analyzes the data to be calibrated from the XML document and writes the data to be calibrated into the target controller.
Further, in order to ensure that the calibration data is written normally and accurately, the method further comprises a step C after the step B: verifying the calibration data by adopting a UDS diagnostic standard, wherein the step C is as follows: resetting the target controller, reading the written calibration data from the target controller by the upper computer, comparing the read calibration data with the data to be calibrated analyzed from the XML document to verify whether the writing of the calibration data is accurate, recording the verification result, and simultaneously carrying out corresponding prompt when the calibration is wrong.
Further, in the step B, when writing of the calibration data fails, the target controller sets a predetermined fault code at a predetermined position; and C, reading the content of the preset position of the target controller by the upper computer, and judging that the calibration is wrong if the content of the preset position is a preset fault code.
XML (Extensible Markup Language) is designed to transmit and store data, and is widely used in various network devices at present, and is simple and easy to understand and convenient to operate. The invention uses the general XML format to put the calibration data, has simple flow and lower requirement on the calibration equipment, and is very suitable for the calibration operation of the controller with smaller calibration data amount.
Drawings
Fig. 1 is an example of an XML file in embodiment 1.
FIG. 2 is a flow chart of the calibration data writing process of the present invention.
Detailed Description
The following describes embodiments of the present invention, such as shapes and structures of respective members, mutual positions and connection relationships between respective portions, and actions and operation principles of the respective portions, in further detail, with reference to the accompanying drawings.
Example 1:
the embodiment provides a simple and effective calibration data writing method based on an XML mode, which meets the requirement of a production line on a production beat, and is used for writing the calibration data in an upper computer into a target controller of a vehicle to realize data updating in the target controller.
As shown in fig. 2, the method for writing calibration data based on the XML scheme of this embodiment includes the following steps:
A. storing an XML document containing data to be calibrated in an upper computer, and connecting the upper computer with a target controller in a communication way; as shown in fig. 1, the XML document sequentially contains the calibration version information (i.e. MRRevo14_ T18_1.5TCI _ FWD _ Fuel in fig. 1), the format of the calibration content data (i.e. DFN _ RYTE in fig. 1), the start address of the calibration content data (i.e. 3400 in fig. 1), the length of the calibration content data, and the specific calibration content data (i.e. XX … … XX in fig. 1);
B. the upper computer analyzes the data to be calibrated from the XML document and writes the data to be calibrated into a target controller; when the target controller fails to write the calibration data, setting a preset fault code at a preset fault code position;
c: and (3) verifying calibration data by adopting a UDS diagnostic standard: resetting the target controller, reading the written calibration data from the target controller by the upper computer, comparing the read calibration data with the data to be calibrated analyzed from the XML document to verify whether the writing of the calibration data is accurate, recording the verification result, and simultaneously carrying out corresponding prompt (for example, displaying 'calibration data writing failure') when the calibration is wrong; the calibration data for verification includes calibration version information and calibration content data.
In step C, the upper computer reads the contents of the position of the fault code of the target controller, determines that calibration has failed when the contents of the position of the fault code are a predetermined fault code, and prompts the user accordingly (for example, displays "calibration data write failure").
The invention has been described in connection with the accompanying drawings, it is to be understood that the invention is not limited in its application to the details of construction and the arrangement of the components set forth in the following description, as long as the invention is capable of being practiced without modification in any way whatsoever, and is capable of other applications without departing from the spirit and scope of the invention as defined by the appended claims.