VDC firmware upgrade method, device, equipment and medium based on continuous integration
By automatically parsing DCM and A2L files and flashing S19 files on the cloud integration server, the problem of inefficiency and error-prone VDC firmware upgrades is solved, and efficient and accurate firmware upgrades are achieved.
Patent Information
- Application Number
- CN202311188914.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-14
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2043-09-14
AI Technical Summary
In the existing technology, VDC firmware upgrade is inefficient and error-prone. It cannot be integrated in the cloud and requires manual operation, resulting in low efficiency and high errors.
By automatically parsing DCM and A2L files on the cloud integration server, determining the calibration amount, storage address and data value, and automatically flashing the data value to the S19 file, the VDC firmware can be upgraded based on the flashed S19 file.
It improves the speed and accuracy of firmware upgrade, reduces manual operations, improves upgrade efficiency, and realizes sustainable integrated VDC firmware upgrade.
Smart Images

Figure CN117311757B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent vehicle technology, and in particular to a VDC firmware upgrade method, device, equipment and medium based on continuous integration. Background Art
[0002] At present, the firmware upgrade of the vehicle running Dynamic Control system (VDC) is usually carried out in software cloud integration. Specifically, after the software is compiled and the S19 file is generated, it is split into the code segment S19 (code_s19) file and the calibration S19 (Cal_s19) through software tools. Furthermore, the integrator will provide the Cal_s19 file to the developer or calibrator, who will then use the industry tool CANape (CAN Application Programming Environment, a comprehensive tool software that can be used for ECU measurement, calibration, diagnosis, and ADAS sensor data recording verification) locally, rather than on the server cloud, to import the DCM file and A2L file required for calibration in the graphical interface, and calibrate the S19 file. The tool can present the memory address, signal name, signal value and other data in the VDC. The calibrator can modify the data according to the corresponding signal name, and use the software to write the required signal data value in the DCM file into the Cal_S19 file through the A2L file. Finally, use the Cal_s19 file and code_s19 file to flash it into the car VDC.
[0003] The entire process of the above execution method relies on a graphical interface tool. Since the CANape tool cannot be directly called through the command line in the software cloud integration system, this step cannot be integrated in the cloud and can only be performed manually, that is, manual calibration is required and then re-flashed in the cloud integration software, which is not only inefficient but also prone to errors. Summary of the invention
[0004] In view of this, the embodiments of the present application provide a VDC firmware upgrade method, apparatus, device and medium based on continuous integration to solve the problem of low efficiency and easy errors when implementing VDC firmware upgrade based on cloud integration in the prior art.
[0005] In a first aspect of an embodiment of the present application, a vehicle driving dynamics control system VDC firmware upgrade method based on continuous integration is provided, comprising:
[0006] Obtain a data communication module DCM file of the vehicle, parse the DCM file to obtain a first variable, the first variable including all calibration quantities of the VDC and stored data values of each calibration quantity;
[0007] Obtaining a standardized format description A2L file of the vehicle, parsing the A2L file to obtain a second variable, the second variable including all calibration quantities of the VDC, and storage addresses and data attributes of each calibration quantity;
[0008] Using the specific calibration value of the VDC as an index, obtaining the data attribute of the specific calibration value in the second variable, converting the stored data value of the specific calibration value in the first variable into a hexadecimal string based on the data attribute, and obtaining the value to be written of the specific calibration value;
[0009] Obtain the vehicle's program S19 file, and determine the flashing location based on the storage address of the specific calibration amount and the address information in the S19 file;
[0010] Taking the flashing position as the starting point, write the value to be flashed of the specific calibration amount into the S19 file;
[0011] Traverse all calibration quantities in the first variable and the second variable, determine the value to be written of each calibration quantity, and write the value to be written of each calibration quantity into the S19 file to obtain an updated S19 file;
[0012] Implement vehicle VDC firmware upgrade based on the updated S19 file.
[0013] A second aspect of the embodiment of the present application provides a vehicle driving dynamics control system VDC firmware upgrade device based on continuous integration, comprising:
[0014] A first acquisition module is configured to acquire a data communication module DCM file of the vehicle, parse the DCM file to obtain a first variable, the first variable includes all calibration quantities of the VDC, and a stored data value of each calibration quantity;
[0015] A second acquisition module is configured to acquire a standardized format description A2L file of the vehicle, parse the A2L file to obtain a second variable, the second variable including all calibration quantities of the VDC, and a storage address and data attributes of each calibration quantity;
[0016] A conversion module is configured to use a specific calibration value of the VDC as an index, obtain a data attribute of the specific calibration value in the second variable, convert a stored data value of the specific calibration value in the first variable into a hexadecimal string based on the data attribute, and obtain a value to be written of the specific calibration value;
[0017] A determination module is configured to obtain a program S19 file of the vehicle and determine a flashing location based on a storage address of a specific calibration amount and address information in the S19 file;
[0018] The flashing module is configured to write a specific calibrated value to be flashed into the S19 file starting from the flashing position;
[0019] The flashing module is further configured to traverse all calibration quantities in the first variable and the second variable, determine the value to be flashed of each calibration quantity, and write the value to be flashed of each calibration quantity into the S19 file to obtain an updated S19 file;
[0020] The upgrade module is configured to implement a firmware upgrade of the vehicle VDC based on the updated S19 file.
[0021] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0022] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0023] The beneficial effect of the embodiments of the present application compared with the prior art is as follows: the embodiments of the present application automatically parse the DCM file and A2L file of the vehicle on a server implementing cloud integration, determine the calibration amount, the storage address of the calibration amount and the storage data value of the calibration amount for calibrating the vehicle VDC, and automatically write the storage data value of the calibration amount into the S19 file of the vehicle, so that the VDC firmware of the vehicle can be upgraded based on the flashed S19 file, without the need to use an additional independent calibration tool for calibration, thereby realizing sustainable integrated VDC firmware upgrades, improving the speed and accuracy of firmware upgrades, and improving upgrade efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0025] Figure 1 It is a scenario diagram of an application scenario of an embodiment of the present application.
[0026] Figure 2 It is a flowchart of a VDC firmware upgrade method based on continuous integration provided in an embodiment of the present application.
[0027] Figure 3 It is a flowchart of a method for converting a stored data value of a specific calibration quantity in a first variable into a hexadecimal string based on data attributes provided in an embodiment of the present application.
[0028] Figure 4 It is a flowchart of a method for converting a value list into a hexadecimal string based on dimension, value data type, value data length, and value storage decimal places provided by an embodiment of the present application.
[0029] Figure 5 It is a flowchart of a method for determining a flash writing position based on a storage address of a specific calibration amount and address information in an S19 file provided in an embodiment of the present application.
[0030] Figure 6 It is a flowchart of a method for writing a specific calibration value into an S19 file provided in an embodiment of the present application.
[0031] Figure 7 It is a schematic diagram of a VDC firmware upgrade device based on continuous integration provided in an embodiment of the present application.
[0032] Figure 8 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0034] Glossary:
[0035] Data Communication Module DCM (Diagnostic Communication Manager File): A file used to describe the configuration and behavior of the vehicle diagnostic communication manager. It defines the protocols and rules for the diagnostic communication manager to communicate with the vehicle electronic control unit (ECU). The DCM file contains parameters, messages, and protocol information related to diagnostic communication, as well as functions and configurations that support specific diagnostic protocols.
[0036] Standardized format description A2L (ASAM MCD 2MC Description File) file: A2L file is a standardized file format used to describe the functions and characteristics of automotive electronic control units (ECUs). It is developed based on the ASAM (Associationfor Standardization of Automation and Measuring Systems) standard and is used to define the measurement and calibration parameters of ECUs. The A2L file contains a description of the measurement and calibration parameters of the ECU, such as sensor data, signal quantities, and parameters of specific functions. It defines information such as the name, data type, physical unit, minimum and maximum values of the parameters. The A2L file also contains the communication protocol and format between the measurement and calibration tools and the ECU. The A2L file plays an important role in the development, testing, and calibration of automotive electronic systems, enabling different tools and equipment to accurately access and interpret the parameters of the ECU.
[0037] Vehicle program S19 file: S19 file is a file format for storing binary data, commonly used to store and transmit firmware and program code. In automotive electronic systems, S19 files are commonly used to store and transmit ECU firmware programs. S19 files store binary data in text format, with each line representing a data record. It contains machine instructions, data, and checksum information of the firmware program. S19 files are commonly used to load firmware programs into ECUs to update and upgrade the functions and features of the ECU. S19 files are of great significance in the development and maintenance of automotive electronic systems. They provide a standardized way to store and transmit ECU firmware programs to ensure the correctness and integrity of the program.
[0038] A VDC firmware upgrade method and device based on continuous integration according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.
[0039] Figure 1 1 is a schematic diagram of an application scenario of an embodiment of the present application. The application scenario may include terminal devices 1, 2 and 3, a server 4 and a network 5.
[0040] Terminal devices 1, 2 and 3 can be hardware or software. When terminal devices 1, 2 and 3 are hardware, they can be various electronic devices with display screens and supporting communication with server 4, including but not limited to smart phones, tablet computers, laptop portable computers and desktop computers, etc.; when terminal devices 1, 2 and 3 are software, they can be installed in the electronic devices as described above. Terminal devices 1, 2 and 3 can be implemented as multiple software or software modules, or as a single software or software module, and the embodiments of the present application are not limited to this. Furthermore, various applications can be installed on terminal devices 1, 2 and 3, such as data processing applications, instant messaging tools, social platform software, search applications, shopping applications, etc.
[0041] The server 4 may be a server that provides various services, for example, a background server that receives a request sent by a terminal device that establishes a communication connection with the server, and the background server may receive and analyze the request sent by the terminal device, and generate a processing result. The server 4 may be a single server, a server cluster composed of several servers, or a cloud computing service center, which is not limited in the present application.
[0042] It should be noted that the server 4 can be hardware or software. When the server 4 is hardware, it can be various electronic devices that provide various services for the terminal devices 1, 2, and 3. When the server 4 is software, it can be multiple software or software modules that provide various services for the terminal devices 1, 2, and 3, or it can be a single software or software module that provides various services for the terminal devices 1, 2, and 3, and the embodiments of the present application are not limited to this.
[0043] The network 5 can be a wired network connected by coaxial cable, twisted pair and optical fiber, or it can be a wireless network that can interconnect various communication devices without wiring, such as Bluetooth, Near Field Communication (NFC), infrared, etc., which is not limited in the embodiments of the present application.
[0044] The server can save the vehicle's DCM file, A2L file and S19 file, and can also receive the vehicle's DCM file, A2L file and S19 file sent by the terminal device. The server can parse the DCM file and A2L file, and can also flash the S19 file.
[0045] It should be noted that the specific types, quantities and combinations of the terminal devices 1, 2 and 3, the server 4 and the network 5 can be adjusted according to the actual needs of the application scenario, and the embodiments of the present application do not limit this.
[0046] As mentioned above, the existing VDC firmware upgrade process relies on a graphical interface tool. Since the CANape tool cannot be directly called through the command line in the software cloud integration system, this step cannot be integrated in the cloud and can only be performed manually, that is, manual calibration is required and then re-flashing in the cloud integration software, which is not only inefficient but also prone to errors.
[0047] In view of this, an embodiment of the present application provides a VDC firmware upgrade method based on continuous integration, by automatically parsing the vehicle's DCM file and A2L file on a server implementing cloud integration, determining the calibration amount, the storage address of the calibration amount and the storage data value of the calibration amount for calibrating the vehicle's VDC, and automatically flashing the storage data value of the calibration amount into the vehicle's S19 file, so that the vehicle's VDC firmware can be upgraded based on the flashed S19 file, without the need to use an additional independent calibration tool for calibration, thereby realizing a continuously integrated VDC firmware upgrade, improving the speed and accuracy of the firmware upgrade, and improving the upgrade efficiency.
[0048] Figure 2 It is a flowchart of a VDC firmware upgrade method based on continuous integration provided in an embodiment of the present application. Figure 2 The VDC firmware upgrade method based on continuous integration can be Figure 1 The server executes. Figure 2 As shown, the VDC firmware upgrade method based on continuous integration includes the following steps:
[0049] In step S201, a data communication module DCM file of the vehicle is obtained, and the DCM file is parsed to obtain a first variable.
[0050] The first variable includes all calibration quantities of VDC and stored data values of each calibration quantity.
[0051] In step S202, a standardized format description A2L file of the vehicle is obtained, and the A2L file is parsed to obtain a second variable.
[0052] The second variable includes all calibration quantities of the VDC, as well as the storage address and data attributes of each calibration quantity.
[0053] In step S203, the specific calibration quantity of VDC is used as an index to obtain the data attribute of the specific calibration quantity in the second variable, and the stored data value of the specific calibration quantity in the first variable is converted into a hexadecimal string based on the data attribute to obtain the value to be written of the specific calibration quantity.
[0054] In step S204, the vehicle program S19 file is obtained, and the flashing location is determined based on the storage address of the specific calibration amount and the address information in the S19 file.
[0055] In step S205, the value to be flashed of a specific calibration amount is written into the S19 file with the flashing position as the starting point.
[0056] In step S206, all calibration quantities in the first variable and the second variable are traversed to determine the value to be written of each calibration quantity, and the value to be written of each calibration quantity is written into the S19 file to obtain an updated S19 file.
[0057] In step S207 , the firmware upgrade of the vehicle VDC is implemented based on the updated S19 file.
[0058] In the embodiment of the present application, the VDC firmware upgrade method based on continuous integration can be executed by a cloud integration server. The cloud integration server can obtain the VDC file and A2L file of the vehicle, and parse them respectively to obtain the storage address and storage data value of each VDC calibration quantity, and then write the storage data value to the corresponding address in the vehicle S19 file based on the storage address.
[0059] In an embodiment of the present application, after the cloud server obtains the DCM file of the vehicle, it can parse the DCM file to obtain a first variable, wherein the first variable includes all calibration quantities of the VDC and the stored data values of each calibration quantity. Further, the cloud server obtains the A2L file of the vehicle and can parse the A2L file to obtain a second variable, wherein the second variable includes all calibration quantities of the VDC and the storage address and data attributes of each calibration quantity. Parsing the DCM file and the A2L file can be to store the data in the DCM file and the A2L file in a dictionary through regular expressions, or other parsing methods, which are not limited here.
[0060] In the embodiment of the present application, the specific calibration quantity of the VDC can be used as an index in the cloud server to obtain the data attribute of the specific calibration quantity in the second variable, and the stored data value of the specific calibration quantity in the first variable can be converted into a hexadecimal string based on the data attribute to obtain the value to be written of the specific calibration quantity. In other words, the data attribute of the specific calibration quantity stored in the A2L file can be used to convert the stored data value of the specific calibration quantity stored in the DCM file into a hexadecimal string, and the hexadecimal string is the value to be written of the specific calibration quantity.
[0061] In an embodiment of the present application, the cloud server can obtain the vehicle's program S19 file, and determine the flash position based on the storage address of the specific calibration quantity and the address information in the S19 file. Furthermore, the value to be flashed of the specific calibration quantity is written into the S19 file starting from the flash position. Furthermore, all calibration quantities in the first variable and the second variable are traversed to determine the value to be flashed of each calibration quantity, and the value to be flashed of each calibration quantity is written into the S19 file to obtain an updated S19 file. In other words, the flash position where the value to be flashed of the specific calibration quantity is written into the S19 file can also be determined based on the storage address in the second variable, and the flash position is the starting flash position.
[0062] In the embodiment of the present application, the firmware upgrade of the vehicle VDC can be realized based on the updated S19 file. That is, by executing the program in the S19 file after the flashing, the firmware upgrade of the VDC corresponding to the S19 file can be realized.
[0063] According to the technical solution provided in the embodiment of the present application, the DCM file and A2L file of the vehicle are automatically parsed on a server implementing cloud integration, the calibration amount, the storage address of the calibration amount and the storage data value of the calibration amount for calibrating the vehicle VDC are determined, and the storage data value of the calibration amount is automatically written into the S19 file of the vehicle, so that the VDC firmware of the vehicle can be upgraded based on the flashed S19 file, without the need to use an additional independent calibration tool for calibration, thereby realizing sustainable integrated VDC firmware upgrade, improving the speed and accuracy of firmware upgrade, and improving upgrade efficiency.
[0064] In the embodiment of the present application, the stored data value in the first variable includes at least one of the following data types: array data, numerical data, and table data.
[0065] That is to say, when parsing a DCM file, the library for parsing DCM can be called through the DCM file address parameter to parse the DCM file. There are multiple data items in a DCM file, including array data, two-dimensional chart data, curve chart data, fixed value data, and fixed value block / array data, where array data can be POINTS:STUETZSTELLENVERTEILUNG data, two-dimensional chart data can be MAP:GRUPPENKENNFELD data, curve chart data can be CURVE:GRUPPENKENNLINIE data, fixed value data can be VALUE:FESTWERT data, and fixed value block / array data can be ARRAY:FESTWERTEBLOCK data.
[0066] Different types of data items may be stored separately. Table 1 shows an example of storing different data items separately.
[0067] Table 1
[0068]
[0069]
[0070] Among them, POINTS, VALUE, CURVE, ARRAY and MAP are data item types, and WholeDCMData is the first variable.
[0071] In an embodiment of the present application, when the server parses the A2L file, it can call the library for parsing A2L through the A2L file address parameter to parse the A2L file. A2L contains many data groups, of which the main ones that need to be acquired and stored include the following four categories: data feature data group, layout record data group, axis point feature data value and calculation method data group. The data in the above four types of data groups in A2L can be extracted and stored in the second variable. Among them, the second variable can include multiple variables, each variable corresponding to a type of data group. Table 2 shows an example of storing different data groups in A2L separately.
[0072] Table 2
[0073]
[0074] Among them, CalA2LData is a storage variable of the data feature data group CHARACTERISTIC, LayA2LData is a storage variable of the layout record data group RECORD_LAYOUT, AXIA2LData is a storage variable of the axial point feature data group AXIS_PTS, and CmA2LData is a storage variable of the calculation method data group COMPU_METHOD. The variables CalA2Ldata, LayA2LData, AXIA2LData, and CmA2LData can be collectively referred to as second variables, wherein the variables CalA2Ldata and AXIA2LData store the storage address of each calibration quantity, and the variables LayA2LData and CmA2LData store the data attributes of each calibration quantity.
[0075] In the embodiment of the present application, parsing the A2L file to obtain the second variable can be to parse the data feature array and the axis feature array in the A2L file to obtain the storage address in the second variable; parse the layout record array and the calculation method array in the A2L file to obtain the data attributes in the second variable. In other words, the data feature array and the axis feature array can be parsed from the A2L file and stored in the variables CalA2Ldata and AXIA2LData in the second variable, and the variables CalA2Ldata and AXIA2LData store the storage address of each calibration quantity; the layout record array and the calculation method array can also be parsed from the A2L file and stored in the variables LayA2LData and CmA2LData in the second variable, and the variables LayA2LData and CmA2LData store the data attributes of each calibration quantity. Further, the data attributes of each calibration quantity can be the length of the data value of each calibration quantity, the storage method of the data value, the number of decimal places of the data value, etc.
[0076] Figure 3 1 is a flow chart of a method for converting a data value stored in a first variable of a specific calibration quantity into a hexadecimal string based on data attributes provided by an embodiment of the present application. Figure 3 As shown, the method comprises the following steps:
[0077] In step S301 , a third variable is determined based on the first variable.
[0078] The third variable includes a specific calibration amount of VDC and a stored data value of the specific calibration amount.
[0079] In step S302 , a fourth variable is determined based on the third variable and the second variable.
[0080] Among them, the fourth variable includes a specific calibration quantity, dimension, value list, value data type, value data length and value storage decimal places. The dimension and value list are determined by the stored data value in the third variable, the value data type and value storage decimal places are determined by the content parsed from the calculation method array in the second variable, and the value data length is determined by the content parsed from the layout record array in the second variable.
[0081] In step S303 , the value list is converted into a hexadecimal string based on the dimension, the value data type, the value data length, and the number of decimal places stored in the value.
[0082] In the embodiment of the present application, after the DCM file of the vehicle is parsed to obtain the first variable, the third variable can be determined based on the first variable. Among them, the third variable includes a specific calibration quantity of VDC and a stored data value of the specific calibration quantity. In other words, all data stored in the variable WholeDCMData can be traversed, and the field name of each data is the calibration quantity CalName. The value data of the signal can be found in the variable WholeDCMData through the field name and stored in the variable DataValue, which is the third variable.
[0083] In the embodiment of the present application, the fourth variable is determined based on the third variable and the second variable. The fourth variable includes a specific calibration quantity, dimension, value list, value data type, value data length, and value storage decimal places. The dimension and value list are determined by the stored data value in the third variable, the value data type and the value storage decimal places are determined by the content parsed from the calculation method array in the second variable, and the value data length is determined by the content parsed from the layout record array in the second variable.
[0084] That is, you can use the field name CalName to find attribute data (data type, physical address, minimum value, maximum value, etc.) in the variable CalA2LData or AXIA2LData, and store the specific attributes of the field as shown in Table 3:
[0085] Table 3
[0086]
[0087] Next, the corresponding ConversionMethod attribute data is found in the variable CmA2LData through the field CpmethodKey, and the "Format" attribute is found through the fixed field Format. The value after the decimal point is truncated through the string, that is, the number of decimal places of the value data corresponding to the CalName, and the value is stored in the variable FixedLen.
[0088] In the variable LayoutKey, the corresponding byte size is searched through the field LayoutKey, that is, the number of bytes of the value data corresponding to the CalName, and the value is stored in the variable DataByteSizeType.
[0089] Intercept the data type contained in the field CpmethodKey and store the value in the variable DataType.
[0090] The corresponding dimension Dimension and the stored data value Values are obtained in the variable WholeDCMDataDataValue through the field CalName, and stored in the variables Dim and ValuesList respectively, to obtain the fourth variable as shown in Table 4:
[0091] Table 4
[0092]
[0093] In one example, the predefined data type table based on the CAN bus A2L file is stored in the variable A2LDefineTable, and the corresponding value data length DataByteSize can be obtained through the field DataByteSizeType.
[0094] In the embodiment of the present application, the value list may be converted into a hexadecimal string based on the dimension, value data type, value data length, and value storage decimal places determined above.
[0095] Figure 4 1 is a flow chart of a method for converting a value list into a hexadecimal string based on dimension, value data type, value data length, and value storage decimal places provided by an embodiment of the present application. Figure 4 As shown, the method comprises the following steps:
[0096] In step S401 , in response to determining that the value list is table data based on the dimension, the value list is transposed.
[0097] In step S402, all value data in the value list are traversed, absolute values of all value data are taken, and the sign bit is saved.
[0098] In step S403 , in response to the value data type being an integer type or a Boolean type, the absolute value of the value data is converted into first binary data.
[0099] In step S404, the difference between the value data length and the total length of the first binary data is subtracted by 1 to obtain the number of bits that need to be padded with 0.
[0100] In step S405, the sign bit, the first binary data and the 0-filled bit are concatenated to obtain a binary original code string of the value data, and the binary original code string is converted into a hexadecimal string.
[0101] In step S406 , in response to the value data type being a fixed-point type, the absolute value of the value data is converted into second binary data.
[0102] In step S407, when it is determined that the value data is an integer, the value data is converted into a hexadecimal string using the same method as the above-mentioned integer or Boolean value data.
[0103] In step S408, when it is determined that the value data is a decimal, the integer part data length and the decimal part data length are acquired from the second binary data.
[0104] In step S409, the value data length is subtracted from the number of decimal places stored in the value, then from the integer part data length, and finally subtracted by 1 to obtain the number of digits that need to be padded with 0 in the integer part.
[0105] In step S410, the number of decimal places stored in the value is subtracted from the data length of the decimal part to obtain the number of digits that need to be padded with 0 in the decimal part.
[0106] In step S411, the sign bit, the integer part data and the integer part padded with 0 bits are concatenated to obtain a concatenated integer part binary string, the decimal part data and the decimal part padded with 0 bits are concatenated to obtain a concatenated decimal part binary string, the integer part binary string and the decimal part binary string are concatenated to obtain a binary original code string of the value data, and the binary original code string is converted into a hexadecimal string.
[0107] In the embodiment of the present application, when converting the value list into a hexadecimal string, the data type of the value list can be first determined. Specifically, it can be determined whether the value list is table data based on the dimension. When the value list is table data, since in the first variable WholeDCMData, the table data is stored by row, and in the S19 file, the data is stored by column, the value list needs to be transposed.
[0108] In the embodiment of the present application, all value data in the value list can be traversed, the absolute value of all value data can be taken, and the sign bit can be saved. In other words, all value data stored in the variable ValuesList can be traversed, the field name of each value data is Value, the positive and negative sign of Value is extracted, and the absolute value Value is used for subsequent processing.
[0109] In an embodiment of the present application, the storage type of the value data can be determined, and different methods are used to convert data stored in different storage types. When it is determined that the value data type is an integer or a Boolean type, the absolute value of the value data can be first converted into the first binary data. Then, the difference between the length of the value data and the total length of the first binary data is subtracted by 1 to obtain the number of bits that need to be padded with 0. Finally, the sign bit, the first binary data, and the padded 0 bit are concatenated to obtain a binary original code string of the value data, and the binary original code string is converted into a hexadecimal string to obtain a hexadecimal string of the integer or Boolean storage data.
[0110] That is to say, when DataType is "int" or "boolean", it indicates that the value data is stored in the VDC memory as an integer. At this time, the decimal can be converted to binary BinValue, the total length of the binary value BinInterLen is obtained, and (DataByteSize-BinInterLen-1) is calculated to obtain the bit length that needs to be padded with 0. The "-1" operation is performed because there is a 1-bit length used to store the sign bit. After padded with 0, all strings are concatenated to obtain the original code string TrueForm. In this TrueForm, if Singedness is 1, the Value is originally a negative number. At this time, TrueForm needs to be converted to the complement code TwoCom, and then converted to the hexadecimal string ValueHexStr.
[0111] When the value data type is determined to be a fixed-point type, the absolute value of the value data may be first converted into second binary data to further determine whether the value data is an integer or a decimal. When the value data is determined to be an integer, the value data may be converted into a hexadecimal string using the same method as the above-mentioned integer or Boolean value data.
[0112] When it is determined that the value data is a decimal, the integer part data length and the decimal part data length can be first obtained from the second binary data. Then the value data length is subtracted from the value storage decimal place, and then the integer part data length is subtracted, and finally 1 is subtracted to obtain the number of digits that need to be padded with 0 in the integer part. Then the decimal place of the value storage is subtracted from the decimal part data length to obtain the number of digits that need to be padded with 0 in the decimal part. Finally, the sign bit, the integer part data and the integer part padded with 0 bits are spliced to obtain a spliced integer part binary string, the decimal part data and the decimal part padded with 0 bits are spliced to obtain a spliced decimal part binary string, the integer part binary string and the decimal part binary string are spliced to obtain a binary original code string of the value data, and the binary original code string is converted into a hexadecimal string.
[0113] That is to say, if DataType is "fix", it indicates that the storage method of the value data in the VDC memory is fixed-point storage. At this time, the decimal is first converted to binary BinValue. Since fixed-point numbers may store decimals, it is necessary to use the "." symbol in the BinValue string to determine whether it is a decimal or an integer. If it is a pure integer, the method of obtaining the original code string TrueForm is the same as the conversion method of the above integer or Boolean value data. If it is a decimal, you can get the binary integer part data length BinInterLen and the decimal part data length BinFixLen. Calculate (DataByteSize-FixedLen-1-BinInterLen) to obtain the length of the integer part that needs to be padded with 0, and concatenate all the strings after padded with 0 to obtain the original code string TrueFormInter of the integer part. Similarly, calculate (FixedLen-BinFixLen) to obtain the length of the integer part that needs to be padded with 0, and concatenate all the strings after padded with 0 to obtain the original code string TrueFormFix of the integer part. Concatenate the integer part and the decimal part together to obtain the binary original code string TrueForm of the fixed-point number. If Singedness is 1, the Value is originally a negative number, and the TrueForm needs to be converted to the two's complement TwoCom. Finally, it is converted to a hexadecimal string ValueHexStr.
[0114] In the embodiment of the present application, if DataType is "float" or "double", it indicates that the value data is stored in the VDC memory in floating-point storage mode. At this time, the existing floating-point conversion library to computer hexadecimal data can be directly called for conversion, which will not be repeated here.
[0115] It should be noted that for a specific calibration quantity, its ValueList may include one or more Values. When the ValueList includes multiple Values, the Values in the entire ValueList can be converted into ValueS19Str by looping, concatenated, and stored in the variable ValueListS19Str, thereby obtaining the hexadecimal string of the specific calibration quantity.
[0116] In the embodiment of the present application, the value to be written of the specific calibration amount is obtained by converting the hexadecimal string into a little endian storage. That is, since the memory of the VDC controller adopts a little endian storage method, after converting the stored data value in the first variable into a hexadecimal string, the hexadecimal string also needs to be converted into a little endian storage to obtain the value to be written of the specific calibration amount. For example, if the hexadecimal string is ABCDEF, it needs to be replaced with EFCDAB.
[0117] In the embodiment of the present application, the storage addresses and values to be written of all calibration quantities in the DCM file and the A2L file can be determined in the above manner, and then the storage addresses and values to be written of all calibration quantities are written into the S19 file. When writing, the calibration quantities can be written one by one, first determining the writing position of the calibration quantity to be written, and then writing the value to be written from the writing position.
[0118] Figure 5 1 is a flow chart of a method for determining a flash write location based on a storage address of a specific calibration amount and address information in an S19 file provided in an embodiment of the present application. Figure 5 As shown, the method comprises the following steps:
[0119] In step S501 , a fifth variable is determined.
[0120] The fifth variable includes a specific calibration amount, a storage address of the specific calibration amount, and a value to be written of the specific calibration amount.
[0121] In step S502, each line of the S19 file is segmented to obtain a sixth variable.
[0122] The sixth variable includes the record type, the data length, the starting address of the row of data, the data stored in the row and the check bit.
[0123] In step S503, in response to the storage address in the fifth variable being equal to the starting address of the row of data in the current row in the sixth variable, it is determined that the current row of the S19 file is the flashing position of the specific calibration amount.
[0124] In step S504, in response to the storage address in the fifth variable being unequal to the starting address of the row data of the current row in the sixth variable, the storage address in the fifth variable is divided into a first row positioning address and a first column positioning address, and the starting address of the row data of the current row in the sixth variable is divided into a second row positioning address and a second column positioning address.
[0125] The first row locating address includes the first 3 bytes of the storage address, the second row locating address includes the first 3 bytes of the row data starting address, the first column locating address includes the last byte of the storage address, and the second column locating address includes the last byte of the row data starting address.
[0126] In step S505, when it is determined that the first row positioning address is equal to the second row positioning address and the decimal number of the absolute value of the difference between the first column positioning address and the second column positioning address is greater than 0 and less than 32, the current line of the S19 file is determined to be the flashing position of the specific calibration amount.
[0127] In step S506, when it is determined that the first row anchor address is equal to the second row anchor address and the decimal value of the difference between the first column anchor address and the second column anchor address is greater than or equal to 32, the second column anchor address is updated.
[0128] The updated second column positioning address is the last byte in the starting address of the next row of data in the sixth variable.
[0129] In step S507, when it is determined that the decimal value of the absolute value of the difference between the first column positioning address and the updated second column positioning address is greater than 0 and less than 32, the next line of the S19 file is determined to be the write position of the specific calibration amount, otherwise the step of updating the second column positioning address is re-executed to determine whether the absolute value of the difference between the first column positioning address and the updated second column positioning address is greater than 0 and less than 32, until the absolute value of the difference between the first column positioning address and the updated second column positioning address is greater than 0 and less than 32, and the line where the updated second column positioning address is located in the S19 file is determined to be the write position of the specific calibration amount.
[0130] In the embodiment of the present application, when determining the flashing position of the specific calibration amount, a fifth variable may be determined, wherein the fifth variable includes the specific calibration amount, the storage address of the specific calibration amount, and the value to be flashed of the specific calibration amount.
[0131] Next, each line of the S19 file may be segmented to obtain a sixth variable, wherein the sixth variable includes a record type, a data length, a starting address of the line of data, data stored in the line, and a check bit.
[0132] Then determine whether the storage address in the fifth variable is equal to the starting address of the row data in the current row in the sixth variable. If they are equal, directly determine the current row of the S19 file as the write position of the specific calibration quantity. Otherwise, divide the storage address in the fifth variable into the first row positioning address and the first column positioning address, and divide the starting address of the row data in the current row in the sixth variable into the second row positioning address and the second column positioning address. Among them, the first row positioning address includes the first 3 bytes of the storage address, the second row positioning address includes the first 3 bytes of the row data starting address, the first column positioning address includes the last byte of the storage address, and the second column positioning address includes the last byte of the row data starting address.
[0133] Next, determine whether the first row positioning address is equal to the second row positioning address. If they are equal, further determine whether the decimal value of the absolute value of the difference between the first column positioning address and the second column positioning address is greater than 0 and less than 32. If so, determine the current line of the S19 file to be the writing position of the specific calibration quantity. If not, update the second column positioning address, wherein the updated second column positioning address is the last byte in the starting address of the row data of the next row in the sixth variable. Then determine whether the decimal value of the absolute value of the difference between the first column positioning address and the updated second column positioning address is greater than 0 and less than 32. If so, determine the next line of the S19 file to be the writing position of the specific calibration quantity. Otherwise, re-execute the step of updating the second column positioning address and determining whether the absolute value of the difference between the first column positioning address and the updated second column positioning address is greater than 0 and less than 32, until the absolute value of the difference between the first column positioning address and the updated second column positioning address is greater than 0 and less than 32, and determine that the updated second column positioning address is the writing position of the specific calibration quantity in the line where the second column positioning address is located in the S19 file.
[0134] That is to say, according to the storage address of the characteristic calibration value and the value to be written determined above, the fifth variable can be determined as shown in Table 5:
[0135] Table 5
[0136] Variable Name CalName Addr ValueListS19Str describe Calibration quantity name Data storage address The value string to be flushed Example Cm_EMPC_RmotEff2_x 80c33fd0 A1EFF32566EAF445
[0137] The fifth variable includes a specific calibration amount, a storage address of the specific calibration amount, and a value to be written of the specific calibration amount.
[0138] At the same time, each line of the S19 file can be segmented to obtain the sixth variable as shown in Table 6:
[0139] Table 6
[0140]
[0141] Among them, Srecord is the record type, DataLen is the data length, addr is the starting address of the data in this row, Data is the data stored in this row, and Checksum is the check bit.
[0142] In the embodiment of the present application, the writing position of the specific calibration amount can be determined according to the storage address in the fifth variable and the starting address of the row of data in the current row in the sixth variable. Specifically, when it is determined that the storage address in the fifth variable is equal to the starting address of the row of data in the current row in the sixth variable, it can be determined that the current line of the S19 file is the writing position of the specific calibration amount.
[0143] When it is determined that the storage address in the fifth variable is not equal to the row data starting address of the current row in the sixth variable, the storage address in the fifth variable can be divided into a first row positioning address and a first column positioning address, and the row data starting address of the current row in the sixth variable can be divided into a second row positioning address and a second column positioning address. The first row positioning address includes the first 3 bytes of the storage address, the second row positioning address includes the first 3 bytes of the row data starting address, the first column positioning address includes the last byte of the storage address, and the second column positioning address includes the last byte of the row data starting address.
[0144] Then determine whether the first row location address is equal to the second row location address. If so, determine whether the decimal value of the absolute value of the difference between the first column location address and the second column location address is greater than 0 and less than 32. If so, determine that the current line of the S19 file is the write position of the specific calibration amount, otherwise update the second column location address. The updated second column location address is the last byte in the starting address of the next row of data in the sixth variable.
[0145] Next, it can be determined whether the decimal value of the absolute value of the difference between the first column positioning address and the updated second column positioning address is greater than 0 and less than 32. If so, determine that the next line of the S19 file is the write position of the specific calibration amount. Otherwise, re-execute the step of updating the second column positioning address and judging whether the absolute value of the difference between the first column positioning address and the updated second column positioning address is greater than 0 and less than 32, until the absolute value of the difference between the first column positioning address and the updated second column positioning address is greater than 0 and less than 32, and determine that the line where the updated second column positioning address is located in the S19 file is the write position of the specific calibration amount.
[0146] That is to say, in the fifth variable, Addr occupies four bytes, eight hexadecimal numbers. In the VDC memory, the first six hexadecimal numbers locate the row, which can be stored in the variable FroHex and recorded as the first row location address. The last two hexadecimal numbers locate the column, which can be stored in the variable BehHex and recorded as the first column location address. At the same time, the first six hexadecimal numbers in the storage address in the sixth variable are stored in the variable Froaddr and recorded as the second row location address, and the last two hexadecimal numbers are stored in the variable Behaddr and recorded as the second column location address.
[0147] You can first perform direct precise positioning, that is, use Addr to directly compare with the matched row addr. If they are equal, the current row is the precise location and you can start preparing for flashing. This comparison method is suitable for a small number of data. For most data, it may not be possible to directly locate it accurately, and indirect precise positioning is required.
[0148] When performing indirect precise positioning, first perform fuzzy positioning, use FroHex to compare with the first 6 hexadecimal numbers Froaddr of the addr variable in this row. If they are equal, the current row and the next few rows are the approximate locations where the CalName value data is stored. Next, perform precise positioning, use BehHex and the last 2 hexadecimal numbers Behaddr of the addr variable in this row to calculate. If the decimal value of (BehHex-Behaddr) is between 0 and 32, the current row is at the precise location and preparations for flashing are started. If they are not equal, use BehHex and the last 2 hexadecimal numbers Behaddr of the addr variable in the next row of this row to calculate. If the decimal value of (BehHex-Behaddr) is between 0 and 32, the current row is at the precise location and preparations for flashing are started.
[0149] In the embodiment of the present application, each calibration quantity in all calibration quantities of VDC can be a specific calibration quantity, and the value of each specific calibration quantity can be written into the S19 file according to a preset order, so as to write the value to be written of each calibration quantity into the S19 file.
[0150] Figure 6 1 is a flow chart of a method for writing a specific calibration value into an S19 file provided in an embodiment of the present application. Figure 6 As shown, the method comprises the following steps:
[0151] In step S601, the length of the rewritable data in the current line of the S19 file is determined.
[0152] The length of the writable data of the current row is the difference between the total length of the data of the current row and the starting address of the data of the current row.
[0153] In step S602, the data length of the to-be-written value of the specific calibration amount is obtained.
[0154] In step S603, in response to the data length of the value to be flushed being less than or equal to the flushable data length of the current row, the value to be flushed is written into the current row of the S19 file at one time.
[0155] In step S604, in response to the data length of the value to be flushed being greater than the flushable data length of the current row, the value to be flushed is divided into a direct write value and an updated value to be flushed.
[0156] The length of the directly written value is equal to the length of the writable data of the current row.
[0157] In step S605, the direct write value is written to the current line of the S19 file.
[0158] In step S606, the length of the writable data in the next line of the S19 file is determined.
[0159] The length of the writable data in the next row is the difference between the total length of the data in the next row and the starting address of the data in the next row.
[0160] In step S607, in response to the data length of the updated value to be flushed being less than or equal to the flushable data length of the next line, the updated value to be flushed is written to the next line of the S19 file at one time; otherwise, the steps of splitting the updated value to be flushed, obtaining the flushable data length of the next line of the S19 file, and judging whether the updated value to be flushed is less than or equal to the flushable data length of the next line are repeated until the updated value to be flushed is less than or equal to the flushable data length of the next line, and the writing of all values to be flushed is completed.
[0161] In the embodiment of the present application, the length of the rewritable data of the current row of the S19 file can be determined first, which is the difference between the total length of the current row of data and the starting address of the current row of data. Then, the data length of the value to be rewritable of a specific calibration quantity can be obtained.
[0162] Next, the data length of the value to be written is compared with the length of the data that can be written in the current row. When the data length of the value to be written is less than or equal to the length of the data that can be written in the current row, the value to be written is written to the current row of the S19 file at one time. When the data length of the value to be written is greater than the length of the data that can be written in the current row, the value to be written is divided into a direct write value and an updated value to be written. Among them, the length of the direct write value is equal to the length of the data that can be written in the current row.
[0163] The split direct write value can be written into the current line of the S19 file. Then continue to determine the length of the flashable data of the next line of the S19 file, which is the difference between the total length of the next line of data and the starting address of the next line of data. Continue to compare the data length of the updated value to be flashed with the length of the flashable data of the next line. When the data length of the updated value to be flashed is less than or equal to the length of the flashable data of the next line, write the updated value to be flashed to the next line of the S19 file at one time. Otherwise, repeat the steps of splitting the updated value to be flashed, obtaining the length of the flashable data of the next line of the S19 file, and judging whether the updated value to be flashed is less than or equal to the length of the flashable data of the next line, until the updated value to be flashed is less than or equal to the length of the flashable data of the next line, and the writing of all the values to be flashed is completed.
[0164] That is to say, the length of the data that can be written in the current row can be stored in the variable BrushLen, where BrushLen = the total length of the data in the current row - the starting address of the data in the current row. Taking the record type S3 as an example, the total length of the data in the current row is 64 hexadecimal digits. Assuming that the starting address of the data in the current row is 6, the length of the data that can be written in the current row is 64-6=58 hexadecimal digits.
[0165] If the length of the variable data of the value string ValueListS19Str to be written is less than or equal to BrushLen, it means that it can be brushed in at one time, so it is directly brushed in, and the string is replaced to the sixth variable S19File_ after completion. If the length of the variable data of the value string ValueListS19Str to be written is greater than BrushLen, it means that it cannot be brushed in at one time, and it is necessary to cut ValueListS19Str into two segments, the length of the first segment is BrushLen, and this part is brushed in at one time. The length of the second segment is ValueListS19Str-BrushLen, which is stored in the variable ValueListS19StrRest, and jump to the next line to continue the loop writing process. Until the entire ValueListS19Str is brushed. After completion, replace the string to S19File_.
[0166] In the embodiment of the present application, after writing the values to be written of each calibration quantity into the S19 file, the check bit value of each row in the S19 file can also be calculated, and the check bit value is written into the check bit of the sixth variable. The check bit value is implemented in the following manner: the data length of the current row in the sixth variable, the starting address of the row data, and the data stored in the row are converted into decimal by byte and then added to obtain a sum variable; the sum variable is converted into a hexadecimal number to obtain a hexadecimal sum variable; the last two digits of the hexadecimal sum variable are taken as the check bit value of the current row.
[0167] That is to say, after completing the flashing of all calibration quantities, the check digit needs to be calculated and updated. When calculating, the data content of the three parts of DataLen, addr, and Data is converted to decimal for each byte, that is, two hexadecimal numbers, and then added. The obtained value is stored in the variable Sum, and then Sum is converted to a hexadecimal number. The last two hexadecimal numbers are stored in the variable SumHexTail. At this time, the variable is the check value Checksum of the row. Replace its Checksum with the value of the SumHexTail variable and replace it in S19File_ to complete the check digit calculation of this row.
[0168] In the embodiment of the present application, after the value data DataValue of all CalName signals in the DCM file are flushed into the S19File_variable, the S19File_variable is finally written into the S19 file. At this time, the DCM file has successfully flushed the data content into the new S19 file through the A2L file.
[0169] By adopting the technical solution of the embodiment of the present application, in the process of cloud integration of VDC software, using script tools, the flashing work can be automatically performed on the cloud without having to be performed locally, reducing the communication time cost between integrators and developers or calibration personnel, and greatly improving production efficiency. The logic and algorithm of the entire process are highly efficient and have low time complexity, and the difficulties encountered in actual production are solved through program design.
[0170] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.
[0171] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0172] Figure 7 Schematic diagram of a VDC firmware upgrade device based on continuous integration provided by an embodiment of the present application. Figure 7 As shown, the VDC firmware upgrade device based on continuous integration includes:
[0173] The first acquisition module 701 is configured to acquire a data communication module DCM file of the vehicle, parse the DCM file to obtain a first variable, and the first variable includes all calibration quantities of the VDC and stored data values of each calibration quantity.
[0174] The second acquisition module 702 is configured to acquire a standardized format description A2L file of the vehicle, parse the A2L file to obtain a second variable, and the second variable includes all calibration quantities of the VDC, and a storage address and data attributes of each calibration quantity.
[0175] The conversion module 703 is configured to use the specific calibration quantity of the VDC as an index, obtain the data attribute of the specific calibration quantity in the second variable, convert the stored data value of the specific calibration quantity in the first variable into a hexadecimal string based on the data attribute, and obtain the value to be flushed of the specific calibration quantity.
[0176] The determination module 704 is configured to obtain the vehicle program S19 file and determine the flashing location based on the storage address of the specific calibration quantity and the address information in the S19 file.
[0177] The flashing module 705 is configured to write a specific calibrated amount of the to-be-flashed value into the S19 file starting from the flashing position.
[0178] The flashing module 705 is further configured to traverse all calibration quantities in the first variable and the second variable, determine the value to be flashed of each calibration quantity, and write the value to be flashed of each calibration quantity into the S19 file to obtain an updated S19 file.
[0179] The upgrade module 706 is configured to implement the firmware upgrade of the vehicle VDC based on the updated S19 file.
[0180] According to the technical solution provided in the embodiment of the present application, the DCM file and A2L file of the vehicle are automatically parsed on a server implementing cloud integration, the calibration amount, the storage address of the calibration amount and the storage data value of the calibration amount for calibrating the vehicle VDC are determined, and the storage data value of the calibration amount is automatically written to the S19 file of the vehicle, so that the VDC firmware of the vehicle can be upgraded based on the flashed S19 file, without the need to use an additional independent calibration tool for calibration, thereby realizing sustainable integrated VDC firmware upgrades, improving the speed and accuracy of firmware upgrades, and improving upgrade efficiency.
[0181] In an embodiment of the present application, the stored data value in the first variable includes at least one of the following data types: array data, numerical data, and table data; parsing the A2L file to obtain the second variable includes: parsing the data feature array and the axis point feature array in the A2L file to obtain the storage address in the second variable; parsing the layout record array and the calculation method array in the A2L file to obtain the data attributes in the second variable.
[0182] In an embodiment of the present application, the stored data value of a specific calibration quantity in a first variable is converted into a hexadecimal string based on data attributes, including: determining a third variable based on the first variable, the third variable including a specific calibration quantity of the VDC and a stored data value of the specific calibration quantity; determining a fourth variable based on the third variable and the second variable, the fourth variable including a specific calibration quantity, a dimension, a value list, a value data type, a value data length, and a value storage decimal number, wherein the dimension and the value list are determined by the stored data value in the third variable, the value data type and the value storage decimal number are determined by the content parsed from the calculation method array in the second variable, and the value data length is determined by the content parsed from the layout record array in the second variable; converting the value list into a hexadecimal string based on the dimension, the value data type, the value data length, and the value storage decimal number.
[0183] In an embodiment of the present application, a value list is converted into a hexadecimal string based on a dimension, a value data type, a value data length, and the number of decimal places stored in the value, including: in response to judging that the value list is table data based on the dimension, transposing the value list; traversing all value data in the value list, taking absolute values of all value data, and saving the sign bit; in response to the value data type being an integer or a Boolean type, converting the absolute value of the value data into first binary data; subtracting 1 from the difference between the value data length and the total length of the first binary data to obtain the number of bits that need to be padded with 0; concatenating the sign bit, the first binary data, and the padded 0 bit to obtain a binary original code string of the value data, and converting the binary original code string into a hexadecimal string; in response to the value data type being a fixed-point type, converting the absolute value of the value data into second binary data; when determining that the value data is an integer, using the same integer as above Or the value data is converted into a hexadecimal string in the same method as the Boolean value data; when it is determined that the value data is a decimal, the integer part data length and the decimal part data length are obtained from the second binary data; the value data length is subtracted from the number of decimal places stored in the value, then subtracted from the integer part data length, and finally subtracted by 1 to obtain the number of bits that need to be padded with 0 in the integer part; the decimal places stored in the value are subtracted from the decimal part data length to obtain the number of bits that need to be padded with 0 in the decimal part; the sign bit, the integer part data and the integer part padded with 0 bits are concatenated to obtain a concatenated integer part binary string, the decimal part data and the decimal part padded with 0 bits are concatenated to obtain a concatenated decimal part binary string, the integer part binary string and the decimal part binary string are concatenated to obtain a binary original code string of the value data, and the binary original code string is converted into a hexadecimal string.
[0184] In the embodiment of the present application, the value to be written of the specific calibration quantity is obtained by converting the hexadecimal string into little endian storage; the writing position is determined based on the storage address of the specific calibration quantity and the address information in the S19 file, including: determining a fifth variable, the fifth variable including the specific calibration quantity, the storage address of the specific calibration quantity and the value to be written of the specific calibration quantity; segmenting each line of the S19 file to obtain a sixth variable, the sixth variable including the record type, the data length, the starting address of the line data, the data stored in the line and the check bit; in response to the storage address in the fifth variable and the line number of the current line in the sixth variable In response to the storage address in the fifth variable being not equal to the row data starting address of the current row in the sixth variable, the storage address in the fifth variable is divided into a first row positioning address and a first column positioning address, and the row data starting address of the current row in the sixth variable is divided into a second row positioning address and a second column positioning address, wherein the first row positioning address includes the first 3 bytes of the storage address, the second row positioning address includes the first 3 bytes of the row data starting address, the first column positioning address includes the last 1 byte of the storage address, and the second column positioning address includes the last 1 byte of the row data starting address. The address includes the last byte of the row data starting address; when it is determined that the first row positioning address is equal to the second row positioning address, and when it is determined that the decimal number of the absolute value of the difference between the first column positioning address and the second column positioning address is greater than 0 and less than 32, it is determined that the current line of the S19 file is the write position of the specific calibration quantity; when it is determined that the first row positioning address is equal to the second row positioning address, and when it is determined that the decimal number of the absolute value of the difference between the first column positioning address and the second column positioning address is greater than or equal to 32, the second column positioning address is updated, and the updated second column positioning address is the starting address of the row data of the next row in the sixth variable. The last byte; when it is determined that the decimal value of the absolute value of the difference between the first column positioning address and the updated second column positioning address is greater than 0 and less than 32, determine that the next line of the S19 file is the write position of the specific calibration amount, otherwise re-execute the step of updating the second column positioning address, and judge whether the absolute value of the difference between the first column positioning address and the updated second column positioning address is greater than 0 and less than 32, until the absolute value of the difference between the first column positioning address and the updated second column positioning address is greater than 0 and less than 32, and determine that the line where the updated second column positioning address is located in the S19 file is the write position of the specific calibration amount.
[0185] In an embodiment of the present application, the step of writing the to-be-written values of each calibration quantity into the S19 file includes: taking each calibration quantity in all the calibration quantities of the VDC as a specific calibration quantity, and writing the value of each specific calibration quantity into the S19 file in a preset order; wherein, writing the value of the specific calibration quantity into the S19 file includes: determining the length of the flashable data of the current row of the S19 file, the flashable data length of the current row being the difference between the total length of the data of the current row and the starting address of the data of the current row; obtaining the data length of the to-be-written value of the specific calibration quantity; in response to the data length of the to-be-written value being less than or equal to the flashable data length of the current row, writing the to-be-written value into the current row of the S19 file at one time; in response to the data length of the to-be-written value being greater than the flashable data length of the current row, dividing the to-be-written value into a directly written value and an updated to-be-written value. value, the length of the directly written value is equal to the length of the flashable data of the current row; write the directly written value into the current row of the S19 file; determine the length of the flashable data of the next row of the S19 file, the length of the flashable data of the next row is the difference between the total length of the next row of data and the starting address of the next row of data; in response to the data length of the updated value to be flashed being less than or equal to the length of the flashable data of the next row, write the updated value to be flashed into the next row of the S19 file at one time, otherwise, repeat the steps of splitting the updated value to be flashed, obtaining the length of the flashable data of the next row of the S19 file, and judging whether the updated value to be flashed is less than or equal to the length of the flashable data of the next row, until the updated value to be flashed is less than or equal to the length of the flashable data of the next row, and the writing of all the values to be flashed is completed.
[0186] In an embodiment of the present application, after writing the values to be flushed of each calibration quantity into the S19 file, it also includes: calculating the check bit value of each row in the S19 file; writing the check bit value into the check bit of the sixth variable; wherein the check bit value is implemented in the following manner: converting the data length of the current row in the sixth variable, the starting address of the row data, and the data stored in the row into decimal by byte and adding them to obtain a summation variable; converting the summation variable into a hexadecimal number to obtain a hexadecimal summation variable; taking the last two digits of the hexadecimal summation variable as the check bit value of the current row.
[0187] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0188] Figure 8 Schematic diagram of an electronic device provided in an embodiment of the present application. Figure 8As shown, the electronic device 8 of this embodiment includes: a processor 801, a memory 802, and a computer program 803 stored in the memory 802 and executable on the processor 801. When the processor 801 executes the computer program 803, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 801 executes the computer program 803, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0189] The electronic device 8 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 8 may include, but is not limited to, a processor 801 and a memory 802. Those skilled in the art will appreciate that Figure 8 The electronic device 8 is merely an example and does not limit the electronic device 8 . The electronic device 8 may include more or fewer components than those shown in the figure, or different components.
[0190] The processor 801 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0191] The memory 802 may be an internal storage unit of the electronic device 8, for example, a hard disk or memory of the electronic device 8. The memory 802 may also be an external storage device of the electronic device 8, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 8. The memory 802 may also include both an internal storage unit of the electronic device 8 and an external storage device. The memory 802 is used to store computer programs and other programs and data required by the electronic device.
[0192] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0193] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, which may be in source code form, object code form, executable file or some intermediate form. Computer-readable media may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0194] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A vehicle dynamics control system VDC firmware upgrade method based on continuous integration, characterized in that: The method is executed by a cloud integration server and includes: Obtaining a data communication module DCM file of the vehicle, parsing the DCM file to obtain a first variable, wherein the first variable includes all calibration quantities of the VDC and stored data values of each calibration quantity; Obtaining a standardized format description A2L file of the vehicle, parsing the A2L file to obtain a second variable, wherein the second variable includes all calibration quantities of the VDC, and a storage address and data attributes of each calibration quantity; Using the specific calibration value of the VDC as an index, obtaining a data attribute of the specific calibration value in the second variable, converting a stored data value of the specific calibration value in the first variable into a hexadecimal string based on the data attribute, and obtaining a value to be written of the specific calibration value; Obtaining the program S19 file of the vehicle, and determining the flashing location based on the storage address of the specific calibration amount and the address information in the S19 file; Taking the flashing position as the starting point, writing the to-be-flashed value of the specific calibration amount into the S19 file; Traversing all calibration quantities in the first variable and the second variable, determining the value to be written of each calibration quantity, and writing the value to be written of each calibration quantity into the S19 file to obtain an updated S19 file; The firmware upgrade of the vehicle VDC is implemented based on the updated S19 file.
2. The method according to claim 1, characterized in that The stored data value in the first variable includes at least one of the following data types: array data, numerical data, table data; The parsing of the A2L file to obtain the second variable comprises: Parse the data feature array and the axis point feature array in the A2L file to obtain the storage address in the second variable; The layout record array and the calculation method array in the A2L file are parsed to obtain the data attributes in the second variable.
3. The method according to claim 2, characterized in that The step of converting the data value stored in the first variable of the specific calibration amount into a hexadecimal string based on the data attribute comprises: determining a third variable based on the first variable, the third variable comprising a specific calibration amount of the VDC and a stored data value of the specific calibration amount; Determine a fourth variable based on the third variable and the second variable, the fourth variable including the specific calibration quantity, dimension, value list, value data type, value data length, and value storage decimal places, wherein the dimension and value list are determined by the stored data value in the third variable, the value data type and value storage decimal places are determined by the content parsed from the calculation method array in the second variable, and the value data length is determined by the content parsed from the layout record array in the second variable; The list of values is converted to a hexadecimal string based on the dimension, value data type, value data length, and value storage decimal places.
4. The method according to claim 3, characterized in that The converting the value list into a hexadecimal string based on the dimension, the value data type, the value data length, and the value storage decimal place comprises: In response to determining that the value list is table data based on the dimension, transposing the value list; Traverse all value data in the value list, take absolute values of all value data, and save the sign bit; In response to the value data type being an integer type or a Boolean type, converting the absolute value of the value data into first binary data; Subtract 1 from the difference between the value data length and the total length of the first binary data to obtain the number of bits that need to be padded with 0; The sign bit, the first binary data and the 0-filled bit are concatenated to obtain a binary original code string of the value data, and the binary original code string is converted into a hexadecimal string; In response to the value data type being a fixed-point type, converting the absolute value of the value data into second binary data; When it is determined that the value data is an integer, converting the value data into a hexadecimal string using the same method as the integer or Boolean value data described above; When it is determined that the value data is a decimal, obtaining the data length of the integer part and the data length of the decimal part from the second binary data; Subtract the number of decimal places stored in the value from the value data length, then subtract the integer part data length, and finally subtract 1 to obtain the number of digits that need to be padded with 0 in the integer part; Subtract the decimal part data length from the decimal part storage number to obtain the number of digits that need to be padded with 0 in the decimal part; The sign bit, the integer part data and the integer part padded with 0 are concatenated to obtain a concatenated integer part binary string, the decimal part data and the decimal part padded with 0 are concatenated to obtain a concatenated decimal part binary string, the integer part binary string and the decimal part binary string are concatenated to obtain a binary original code string of the value data, and the binary original code string is converted into a hexadecimal string.
5. The method according to claim 1, characterized in that The value to be written of the specific calibration amount is obtained by converting the hexadecimal string into a little-endian format for storage; The determining of the flash writing position based on the storage address of the specific calibration amount and the address information in the S19 file includes: Determine a fifth variable, wherein the fifth variable includes the specific calibration amount, a storage address of the specific calibration amount, and a to-be-written value of the specific calibration amount; Each line of the S19 file is segmented to obtain a sixth variable, wherein the sixth variable includes a record type, a data length, a starting address of the line of data, data stored in the line, and a check bit; In response to the storage address in the fifth variable being equal to the starting address of the row of data in the current row in the sixth variable, determining that the current row of the S19 file is the flash writing position of the specific calibration amount; In response to the storage address in the fifth variable being unequal to the row data starting address of the current row in the sixth variable, the storage address in the fifth variable is divided into a first row positioning address and a first column positioning address, and the row data starting address of the current row in the sixth variable is divided into a second row positioning address and a second column positioning address, wherein the first row positioning address includes the first 3 bytes of the storage address, the second row positioning address includes the first 3 bytes of the row data starting address, the first column positioning address includes the last byte of the storage address, and the second column positioning address includes the last byte of the row data starting address; When it is determined that the first row location address is equal to the second row location address, and when it is determined that the decimal value of the absolute value of the difference between the first column location address and the second column location address is greater than 0 and less than 32, determining that the current behavior of the S19 file is the flash writing position of the specific calibration amount; When it is determined that the first row location address is equal to the second row location address, and when it is determined that the decimal value of the absolute value of the difference between the first column location address and the second column location address is greater than or equal to 32, the second column location address is updated, and the updated second column location address is the last byte in the starting address of the row of data of the next row in the sixth variable; When it is determined that the decimal value of the absolute value of the difference between the first column positioning address and the updated second column positioning address is greater than 0 and less than 32, the next line of the S19 file is determined to be the write position of the specific calibration amount, otherwise the step of updating the second column positioning address and judging whether the absolute value of the difference between the first column positioning address and the updated second column positioning address is greater than 0 and less than 32 is re-executed, until the absolute value of the difference between the first column positioning address and the updated second column positioning address is greater than 0 and less than 32, and it is determined that the line where the updated second column positioning address is located in the S19 file is the write position of the specific calibration amount.
6. The method according to claim 5, characterized in that The step of writing the to-be-written values of each calibration quantity into the S19 file includes: taking each calibration quantity of all calibration quantities of the VDC as a specific calibration quantity, and writing the value of each specific calibration quantity into the S19 file in a preset order; Among them, writing the value of a specific calibration amount into the S19 file includes: Determine the length of the rewritable data of the current row of the S19 file, where the length of the rewritable data of the current row is the difference between the total length of the data of the current row and the starting address of the data of the current row; Obtaining the data length of the value to be written of the specific calibration amount; In response to the data length of the value to be written being less than or equal to the writable data length of the current row, writing the value to be written into the current row of the S19 file at one time; In response to the data length of the to-be-written value being greater than the writable data length of the current row, dividing the to-be-written value into a direct write value and an updated to-be-written value, wherein the length of the direct write value is equal to the writable data length of the current row; Write the direct write value into the current line of the S19 file; Determine the length of the next line of data that can be written to the S19 file, where the length of the next line of data that can be written to the S19 file is the difference between the total length of the next line of data and the starting address of the next line of data; In response to the data length of the updated value to be flushed being less than or equal to the flushable data length of the next row, the updated value to be flushed is written to the next row of the S19 file at one time; otherwise, the steps of splitting the updated value to be flushed, obtaining the flushable data length of the next row of the S19 file, and judging whether the updated value to be flushed is less than or equal to the flushable data length of the next row are repeated until the updated value to be flushed is less than or equal to the flushable data length of the next row, and the writing of all values to be flushed is completed.
7. The method according to any one of claims 5 to 6, characterized in that After writing the values to be written of each calibration quantity into the S19 file, it also includes: Calculate the check digit value of each line in the S19 file; Writing the check bit value into the check bit of the sixth variable; The check bit value is implemented in the following way: The data length of the current row in the sixth variable, the starting address of the row data and the data stored in the row are converted into decimal by bytes and then added to obtain a sum variable; Convert the sum variable into a hexadecimal number to obtain a hexadecimal sum variable; The last two digits of the hexadecimal sum variable are taken as the check digit value of the current row.
8. A vehicle dynamics control system VDC firmware upgrade device based on continuous integration, characterized in that: The device is located in a cloud integrated server and includes: A first acquisition module is configured to acquire a data communication module DCM file of the vehicle, parse the DCM file to obtain a first variable, wherein the first variable includes all calibration quantities of the VDC and stored data values of each calibration quantity; A second acquisition module is configured to acquire a standardized format description A2L file of a vehicle, parse the A2L file to obtain a second variable, wherein the second variable includes all calibration quantities of the VDC, and a storage address and data attribute of each calibration quantity; a conversion module, configured to use the specific calibration value of the VDC as an index, obtain a data attribute of the specific calibration value in the second variable, and convert a stored data value of the specific calibration value in the first variable into a hexadecimal string based on the data attribute to obtain a value to be written of the specific calibration value; A determination module is configured to obtain a program S19 file of the vehicle and determine a flashing location based on a storage address of the specific calibration amount and address information in the S19 file; A flashing module is configured to write the to-be-flashed value of the specific calibration amount into the S19 file starting from the flashing position; The flashing module is further configured to traverse all calibration quantities in the first variable and the second variable, determine the value to be flashed of each calibration quantity, and write the value to be flashed of each calibration quantity into the S19 file to obtain an updated S19 file; The upgrade module is configured to implement a firmware upgrade of the vehicle VDC based on the updated S19 file.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
