CN112988188A - Software upgrading method applied to automobile steering wheel corner sensor - Google Patents

Software upgrading method applied to automobile steering wheel corner sensor Download PDF

Info

Publication number
CN112988188A
CN112988188A CN202110202027.9A CN202110202027A CN112988188A CN 112988188 A CN112988188 A CN 112988188A CN 202110202027 A CN202110202027 A CN 202110202027A CN 112988188 A CN112988188 A CN 112988188A
Authority
CN
China
Prior art keywords
data
software
steering wheel
software upgrading
angle sensor
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110202027.9A
Other languages
Chinese (zh)
Inventor
孙兴华
周良杰
赵浩东
黄艳钦
孟珂
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Longgan Auto Electronics Co ltd
Original Assignee
Shanghai Longgan Auto Electronics Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Longgan Auto Electronics Co ltd filed Critical Shanghai Longgan Auto Electronics Co ltd
Priority to CN202110202027.9A priority Critical patent/CN112988188A/en
Publication of CN112988188A publication Critical patent/CN112988188A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01MTESTING STATIC OR DYNAMIC BALANCE OF MACHINES OR STRUCTURES; TESTING OF STRUCTURES OR APPARATUS, NOT OTHERWISE PROVIDED FOR
    • G01M17/00Testing of vehicles
    • G01M17/007Wheeled or endless-tracked vehicles
    • G01M17/06Steering behaviour; Rolling behaviour

Abstract

The invention provides a software upgrading method applied to an automobile steering wheel angle sensor, which is characterized in that an upper computer is connected with the steering wheel angle sensor, and the software upgrading method comprises the following steps: step S1, the upper computer acquires the software upgrading data and carries out a first integrity verification operation and a first correctness verification operation on the software upgrading data in sequence; step S2, the upper computer sends the software upgrading data to a steering wheel angle sensor; step S3, the steering wheel angle sensor carries out a second integrity verification operation and a second correctness verification operation on the software in sequence; and step S4, the steering wheel angle sensor executes software upgrading operation according to the software upgrading data. The technical scheme of the invention has the advantages that the method for error-proof redundancy check is used to ensure the correctness and integrity of the upgrade file, the FLASH memory adopts a redundancy backup mode for the upgrade program, and an error-proof mechanism is used to ensure the safety and stability of the upgrade process.

Description

Software upgrading method applied to automobile steering wheel corner sensor
Technical Field
The invention relates to the technical field of automobile electronic software systems, in particular to a software upgrading method applied to an automobile steering wheel corner sensor.
Background
The automobile steering wheel angle sensor detects the steering angle of the steering wheel of the vehicle and provides signals necessary for a vehicle control system to calculate the steering wheel angle, and for updating software in the steering wheel angle sensor, a shell of the steering wheel angle sensor needs to be detached, and then a burning tool is used for burning the latest control program into an MCU internal program memory of the steering wheel angle sensor. When the housing is removed, the housing is easily damaged, so that the cost for upgrading the software becomes high. The steering wheel angle sensor needs to be reassembled after software burning is finished, and a full-series integrated test needs to be carried out on the steering wheel angle sensor after the reassembly is finished, so that the cost is increased; after sale, the online upgrading function cannot be carried out, the efficiency of the upgrading mode is low, and the customer experience is poor; and the redundancy error-proofing function in the upgrading process can not be realized, and the safety and the reliability in the program upgrading process can not be ensured.
Disclosure of Invention
The invention aims to solve the technical problems and provides a software upgrading method for a steering wheel angle sensor, software can be updated without dismounting a shell of the sensor, and the correctness of software upgrading is ensured by using a mode of error-proof redundancy check.
The technical scheme specifically comprises the following steps:
a software upgrading method is applied to an automobile; the method comprises the following steps of setting an upper computer for carrying out software upgrading on a steering wheel corner sensor of the automobile, wherein the upper computer is connected with the steering wheel corner sensor, and the software upgrading method comprises the following steps:
step S1, the upper computer obtains software upgrading data of upgrading software to carry out first integrity verification operation on the software upgrading data, and carries out first correctness verification operation on the software upgrading data after the first integrity verification operation is passed;
step S2, the upper computer sends the software upgrading data to the steering wheel angle sensor;
step S3, the steering wheel angle sensor carries out a second correctness verification operation on the software upgrading data, and after the second correctness verification operation is passed, the second completeness verification operation is carried out on the software upgrading data;
and step S4, the steering wheel angle sensor executes software upgrading operation according to the software upgrading data.
Preferably, the software upgrade data includes a plurality of lines of software upgrade data, each line of the software upgrade data includes a first data portion and a second data portion, the first data portion is valid data for program upgrade, and the second data portion includes a first correct check code, the step S1 includes the following steps:
step S11, the upper computer initializes and enters a software upgrading state;
step S12, the upper computer loads the upgrade software;
step S13, the upper computer analyzes the upgrade software to obtain the software upgrade data, reads a plurality of bytes at the beginning of the first line and a plurality of bytes at the end of the last line of the software upgrade data, and generates a first complete check code;
and step S14, the upper computer calculates the corresponding first correct check code according to the first data part in each row of the software upgrading data and writes the first correct check code into the second data part.
Preferably, in step S1, the following steps are adopted to perform the first integrity verification operation on the software upgrade data:
step S11A, the upper computer reads a plurality of bytes at the beginning of the first line and a plurality of bytes at the end of the last line of the loaded software upgrade data that do not include the first correct check code, and generates a second complete check code;
step S12A, determining whether the second complete check code is consistent with the first complete check code;
if so, continuing to execute the first correctness verification operation on the software upgrading data;
if not, exiting.
Preferably, in step S1, the first correctness verifying operation is performed on a line of the software upgrade data by the following steps:
step S11B, the upper computer reads the loaded row of the software upgrading data and calculates a second correct check code according to a first data part of the row of the software upgrading data;
step S12B, determining whether the second correct check code is consistent with the first correct check code;
if so, indicating that the software upgrading data of the current line passes the first correctness verification operation;
if not, indicating that the software upgrading data in the current line does not pass the first correctness verification operation;
in the step S1, the steps S11B-S12B are executed in a loop, so as to perform the first correctness verifying operation on the software upgrade data of each row in turn, and after all the rows of the software upgrade data pass the first correctness verifying operation, it is determined that the whole software upgrade data passes the first correctness verifying operation.
Preferably, the steering wheel angle sensor is provided with a first preset time and a second preset time;
before the step S2 is executed, the method further includes a process of performing communication connection between the upper computer and the steering wheel angle sensor, and specifically includes the following steps:
step A1, the upper computer judges whether a communication connection request is established between the upper computer and the steering wheel angle sensor within the first preset time;
if yes, go to step S2;
if not, exiting;
the step S2 specifically includes:
step S21, after establishing communication connection with the steering wheel angle sensor, the upper computer judges whether the steering wheel angle sensor starts to receive the software upgrading data sent by the upper computer within the second preset time;
if yes, after the steering wheel angle sensor receives all the software upgrading data, the step S3 is performed;
if not, exiting.
Preferably, before the step S3 is executed, the steering wheel angle sensor receives and stores the software upgrade data transmitted by the upper computer by a row, and then the step S3 performs the second correctness verification operation on a row of the software upgrade data by using the following steps:
step S31A, the steering wheel angle sensor reads a line of stored software upgrading data, and a third correct check code is calculated according to a first data part of the line of software upgrading data;
step S32A, determining whether the third correct check code is consistent with the first correct check code;
if so, indicating that the software upgrading data of the current line passes the second correctness verification operation;
if not, the software upgrading data of the current line does not pass the second correctness verification operation;
in the step S3, the steps S31A-S32A are executed in a loop, so as to perform the second correctness verifying operation on the software upgrade data of each row in turn, and after all the rows of the software upgrade data pass the second correctness verifying operation, it is determined that the whole software upgrade data passes the second correctness verifying operation.
Preferably, in step S3, the second integrity verification operation is performed on the software upgrade data by using the following steps:
step S31B, the steering wheel angle sensor reads a number of first bytes of a first row and a number of bytes of a last row of the software upgrade data that do not include the first correct check code after passing the second correctness verification operation, and generates a third complete check code;
step S32B, determining whether the third complete check code is consistent with the first complete check code;
if yes, go to step S4;
if not, exiting.
Preferably, the steering wheel corner sensor is provided with a FLASH memory, and the FLASH memory is provided with a first storage area and two second storage areas;
when the steering wheel angle sensor works normally, an upgrading tool used for storing upgrading software is arranged in the first storage area, software programs which run normally are respectively stored in the two second storage areas, the software program stored in one of the second storage areas is marked as an original program, the software program stored in the other second storage area is marked as a backup program, and the original program is run when the steering wheel angle sensor works normally;
the step S4 includes the following steps:
step S41, the steering wheel angle sensor runs the upgrade tool in the first storage area to perform a software upgrade operation on the backup program according to the software upgrade data;
step S42, the steering wheel angle sensor determines whether the software upgrade operation is successful:
if yes, go to step S43;
if not, go to step S44;
step S43, the steering wheel angle sensor is reset, the backup program is then executed, and whether the backup program is normally executed is determined:
if so, erasing the original program, marking the backup program as the original program, copying the current original program into another empty second storage area, marking the copied original program as the backup program, then operating the original program and exiting;
if not, erasing the backup program, copying the original program to the empty second storage area, marking the copied original program as the backup program, and then operating the original program and exiting;
in step S44, the steering wheel angle sensor is reset, and then the original program is executed and exited.
Preferably, when the steering wheel angle sensor is not mounted on the automobile, the connection mode between the upper computer and the steering wheel angle sensor is a wired connection mode; and
when the steering wheel corner sensor is installed on the automobile, the connection mode of the upper computer and the steering wheel corner sensor is a wireless connection mode.
The technical scheme of the invention has the advantages that the method uses the error-proof redundancy check method to ensure the correctness and the integrity of the upgrade file, the FLASH memory is used for backing up the upgrade program, the error-proof mechanism is used to ensure the safety and the stability of the upgrade process, the efficiency of upgrading the steering wheel corner sensor software is improved, and the upgrade cost is reduced.
Drawings
Fig. 1 is a general flow chart illustrating a software upgrading method applied to a steering wheel angle sensor of an automobile according to the present invention;
FIG. 2 is a schematic view of the process of loading and acquiring software data by an upper computer in the software upgrading method of the present invention;
FIG. 3 is a schematic flow chart of the upper computer verifying the integrity of the software upgrading data in the software upgrading method of the present invention;
FIG. 4 is a schematic flow chart of the upper computer verifying the correctness of the software upgrading data in the software upgrading method of the present invention;
FIG. 5 is a schematic flow chart of the communication connection between the steering wheel angle sensor and the upper computer in the software upgrading method of the present invention within a preset time;
FIG. 6 is a schematic flow chart of data transmission between a steering wheel angle sensor and an upper computer in a preset time period in the software upgrading method of the present invention;
FIG. 7 is a schematic flow chart of the steering wheel angle sensor verifying the correctness of software upgrading data in the software upgrading method of the present invention;
FIG. 8 is a schematic flow chart of a steering wheel angle sensor verifying software upgrading data integrity in the software upgrading method of the present invention;
fig. 9 is a schematic flow chart of software upgrading performed by the steering wheel angle sensor through a program backup method in the software upgrading method according to the present invention;
fig. 10 is a block diagram of the software upgrading method implemented by two ways according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict.
The invention is further described with reference to the following drawings and specific examples, which are not intended to be limiting.
As shown in fig. 1, a software upgrading method is applied to an automobile; the method comprises the following steps that an upper computer 1 used for carrying out software upgrading on a steering wheel corner sensor 6 of an automobile is arranged, the upper computer 1 is connected with the steering wheel corner sensor 6, and the software upgrading method comprises the following steps:
step S1, the upper computer 1 obtains software upgrading data of an upgrading software to carry out a first integrity verification operation on the software upgrading data, and carries out a first correctness verification operation on the software upgrading data after the first integrity verification operation is passed;
step S2, the upper computer 1 sends the software upgrading data to the steering wheel angle sensor 6;
step S3, the steering wheel angle sensor 6 carries out a second correctness verification operation on the software upgrading data, and carries out a second integrity verification operation on the software upgrading data after the second correctness verification operation is passed;
in step S4, the steering wheel angle sensor 6 performs software upgrading operation based on the software upgrading data.
In this embodiment, after the initialization, the upper computer 1 performs integrity check on the loaded upgrade file to determine the integrity of the file to be upgraded, and prevents the incomplete upgrade file from being written to the steering wheel angle sensor 6. And if the data in the upgrade file is incomplete, the upper computer 1 stops the software upgrade operation. If the upgrade file data is complete, the upper computer 1 then starts to analyze the software upgrade file data according to the rows and simultaneously checks the correctness of the data, the last byte data of any row of data in the software upgrade data is a check code, the upper computer 1 firstly acquires a certain row of data, and the check code of the row is calculated by using a cyclic redundancy check algorithm to determine whether the check code of the row is correct or not so as to ensure the correctness of the data in the file to be upgraded. And if the upper computer 1 detects that the check code of a certain row of data in the file to be upgraded is wrong, the upper computer 1 immediately stops the program upgrading operation.
Similarly, after the steering wheel angle sensor 6 receives the software upgrade data, the accuracy of the software upgrade data is verified by using a cyclic redundancy check algorithm on the received data. If the software upgrading data is not verified correctly, the steering wheel angle sensor 6 returns to the mode of running the application program without upgrading. If the correctness of all the software upgrading data received by the steering wheel angle sensor 6 passes the verification, the steering wheel sensor continues to perform integrity verification on the software upgrading data. The safety of software upgrading data is ensured through double verification. And if the software upgrading data is incomplete, immediately returning the steering wheel corner sensor to run the application program in the application mode which is not upgraded.
In this embodiment, as shown in fig. 10, the present invention provides two ways to implement software upgrade of the steering wheel angle sensor 6. The first method is to realize software online upgrade by a wired connection mode of the upper computer 1, software upgrade data sent by the upper computer 1 is sent to the CAN network tool 2 through a data transmission channel, and then the CAN network tool 2 is used for transmitting the data to the steering wheel angle sensor 6. The second method is to realize software upgrading in a wireless connection mode through the upper computer 1, the upper computer 1 sends software upgrading data to the cloud end 3 for storage in a wireless transmission mode, the vehicle-mounted software updating controller 4 downloads the software upgrading data from the cloud end 3 when detecting that the automobile is in an idle state, and then the software upgrading data are sent to the steering wheel corner sensor 6 through the CAN gateway 5. In both modes, software upgrading data is finally sent to the steering wheel angle sensor 6 through the upper computer 1 to realize the online software upgrading mode.
In a preferred embodiment, as shown in fig. 2, the software upgrade data comprises a plurality of lines of software upgrade data, each line of software upgrade data comprises a first data portion and a second data portion, the first data portion is valid program upgrade data, and the second data portion comprises a first correct check code, step S1 comprises the following steps:
step S11, the upper computer 1 initializes and enters a software upgrading state;
step S12, the upper computer 1 loads the upgrade software;
step S13, the upper computer 1 analyzes according to the upgrade software to obtain software upgrade data, reads a plurality of first bytes of a first row and a plurality of last bytes of a last row of the software upgrade data, and generates a first complete check code Y1;
step S14, the upper computer 1 calculates a corresponding first correct check code A1 according to the first data part M area in each line of software upgrading dataXAnd written in the second data portion N area.
In this embodiment, srec is a file stored with a suffix name, the upgrade data of the upgrade software includes a plurality of rows of hexadecimal data, each row includes a plurality of bytes of data, the data of each row is divided into two parts, the first part is program upgrade valid data, the first part is named as an M region, the second part is named as an N region, the first part is set as an empty region, and a cyclic redundancy check algorithm is used to calculate the program upgrade valid data of the M part to obtain an original check code a1 with a byte sizeX(where X is the number of rows) the original check code is placed in the N region. And upgrade the whole softwareThe data contents of the first X bytes of the first row and the last X bytes of the last row of data (not containing the original check code) are set to the first integrity check character Y1 as an indication of the integrity of the data contents of the software upgrade. The upper computer 1 loads the software upgrading data in the above form to the upper computer 1 in rows.
In a preferred embodiment, as shown in FIG. 3, in step S1, the following steps are used to perform a first integrity verification operation on the software upgrade data:
step S11A, the upper computer 1 reads a plurality of first bytes of a first row and a plurality of bytes of a last row of the loaded software upgrade data, which do not include the first correct check code Y1, and generates a second complete check code Y2;
step S12A, determining whether the second integrity check code Y2 is consistent with the first integrity check code Y1;
if so, continuing to execute a first correctness verification operation on the software upgrading data;
if not, exiting.
In this embodiment, the upper computer 1 first reads the content of the first X bytes of data of the first row and the last X bytes of data of the last row of the software upgrade data to generate a second complete check code Y2, determines whether the second complete check code Y2 is consistent with the first complete check code Y1, and if not, indicates that the software upgrade data is in error in the loading process, and generates a corresponding error code to feed back to the upper computer 1, thereby implementing the integrity check on the software upgrade data.
In a preferred embodiment, as shown in FIG. 4, in step S1, a first correctness verification operation is performed on a line of software upgrade data using the following steps:
step S11B, the upper computer 1 reads a line of loaded software upgrade data, and calculates a second correct check code a2 according to a first data portion of the line of software upgrade dataX
Step S12B, determine the second correct check code A2XAnd the first correct check code A1XWhether the two are consistent;
if so, indicating that the software upgrading data of the current line passes the first correctness verification operation;
if not, the software upgrading data of the current line does not pass the first correctness verification operation;
in step S1, steps S11B-S12B are executed in a loop to perform the first correctness verifying operation on each line of software upgrade data in turn, and after all lines of software upgrade data pass the first correctness verifying operation, it is determined that the software upgrade data as a whole passes the first correctness verifying operation.
In this embodiment, after the integrity check of the software upgrade data is passed, the upper computer 1 performs correctness check, reads the program upgrade data of the M area in one row and calculates the check code a2 of the data of the M area by a cyclic redundancy check algorithm in the process of reading the software upgrade data by rowXThen with the original check code A1 of the N areaXAnd comparing, and if the check codes are consistent, the program upgrading data of the line is valid. The upper computer 1 checks all the data of the software upgrading data according to the method so as to ensure the correctness of the software upgrading data. Once a certain line is inconsistent, it shows that the software upgrading data is in error in the loading process, and generates a corresponding error code to be fed back to the upper computer 1, so as to implement correctness verification of the software upgrading data. After all the software upgrading data passes the verification, the upper computer 1 can contain the original verification code A1 in a row for the software upgrading dataXAll the sets of software upgrade data are sent to the steering wheel angle sensor 6 as one set in the form of M region + N region.
As shown in fig. 5 and 6, in a preferred embodiment, the steering wheel angle sensor 6 is provided with a first preset time and a second preset time;
before step S2 is executed, the method further includes a process of performing communication connection between the upper computer 1 and the steering wheel angle sensor 6, and specifically includes the following steps:
step A1, the upper computer 1 judges whether a communication connection request is established between the upper computer and the steering wheel angle sensor 6 within a first preset time;
if yes, go to step S2;
if not, exiting;
step S2 specifically includes:
step S21, after establishing communication connection with the steering wheel angle sensor 6, the upper computer 1 judges whether the steering wheel angle sensor 6 starts to receive software upgrading data sent by the upper computer within a second preset time;
if yes, step S3 is performed after the steering wheel angle sensor 6 has received all the software upgrade data;
if not, exiting.
In this embodiment, the first preset time and the second preset time are both set to 5s, and after the power-on initialization of the steering wheel angle sensor 6, the connection request of the upper computer 1 is waited for within 5 s. If the communication connection request of the upper computer 1 is not received within 5s, the steering wheel angle sensor 6 returns to the application program running under the non-upgrading application mode. And if a connection request of the upper computer 1 is received, the steering wheel angle sensor 6 responds to establish communication connection with the upper computer 1. After the steering wheel angle sensor 6 is successfully communicated with the upper computer 1, the steering wheel angle sensor 6 starts to receive software upgrading data sent by the upper computer 1 in a program upgrading mode, and when the software upgrading data are received, if the upper computer 1 does not send data within 5s, the steering wheel angle sensor 6 immediately returns to the application program running in the application program upgrading mode.
As shown in fig. 7, in a preferred embodiment, before executing step S3, the steering wheel angle sensor 6 receives and stores the software upgrade data transmitted from the upper computer 1 by rows, and then step S3 performs a second correctness verification operation on a row of the software upgrade data by using the following steps:
step S31A, the steering wheel angle sensor 6 reads a line of stored software upgrade data, and calculates a third correct check code A3 according to a first data portion of the line of software upgrade dataX
Step S32A, determining the third correct check code A3XAnd the first correct check code A1XWhether the two are consistent;
if so, indicating that the software upgrading data of the current line passes the second correctness verification operation;
if not, the current software upgrading data does not pass the second correctness verification operation;
in step S3, steps S31A-S32A are executed in a loop to perform the second correctness verifying operation for each line of software upgrade data in turn, and after all lines of software upgrade data pass the second correctness verifying operation, it is determined that the software upgrade data as a whole passes the second correctness verifying operation.
In this embodiment, the steering wheel angle sensor 6 includes the original check code a1 in the M region + N regionXFor one group, receiving software upgrading data of each row, reading program upgrading data of M areas in one group and calculating check codes A3 of the M area data by a cyclic redundancy check algorithmXThen with the original check code A1 of the N areaXAnd comparing, and if the comparison results are consistent, checking to ensure that the steering wheel angle sensor 6 continues to operate the next group of software upgrading data.
In a preferred embodiment, as shown in fig. 8, in step S3, the following steps are used to perform a second integrity verification operation on the software upgrade data:
step S31B, the steering wheel angle sensor 6 reads a number of first bytes of the first row and a number of bytes of the last row of the software upgrade data that pass the second correctness verification operation and do not include the first correct check code Y1, and generates a third complete check code Y3;
step S32B, determining whether the third integrity check code Y3 is consistent with the first integrity check code Y1;
if yes, go to step S4;
if not, exiting.
In this embodiment, the software upgrading data received by the steering wheel angle sensor 6 is stored in the first storage area of the FLASH memory, the steering wheel angle sensor 6 first reads the first X byte data of the first row and the last X byte data of the last row of the software upgrading data stored in the first storage area of the FLASH memory to generate a third complete check code Y3, determines whether the second complete check code Y3 is consistent with the first complete check code Y1, and if not, indicates that the software upgrading data is in error in the transmission process, and generates a corresponding error code to feed back the error code to the upper computer 1, thereby implementing the integrity check on the software upgrading data. And after the steering wheel corner sensor respectively verifies the correctness and the integrity of the software upgrading data according to the sequence, starting to execute the upgrading tool for upgrading the software.
As shown in fig. 9, in a preferred embodiment, the steering wheel angle sensor 6 is provided with a FLASH memory having a first storage area and two second storage areas;
when the steering wheel angle sensor 6 works normally, an upgrading tool used for storing upgrading software is arranged in the first storage area, software programs which run normally are respectively stored in the two second storage areas, the software program stored in one of the second storage areas is marked as an original program, the software program stored in the other second storage area is marked as a backup program, and the original program runs when the steering wheel angle sensor 6 works normally;
step S4 includes the following steps:
step S41, the steering wheel angle sensor 6 runs an upgrade tool in the first storage area to perform a software upgrade operation on the backup program according to the software upgrade data;
step S42, the steering wheel angle sensor 6 determines whether the software upgrade operation is successful:
if yes, go to step S43;
if not, go to step S44;
in step S43, the steering wheel angle sensor 6 is reset, and then the backup program is executed, and it is determined whether the backup program is normally executed:
if so, erasing the original program, marking the backup program as the original program, copying the current original program into an empty second storage area, marking the copied original program as the backup program, then operating the original program and exiting;
if not, erasing the backup program, copying the original program into an empty second storage area, marking the copied original program as the backup program, and then operating the original program and exiting;
in step S44, the steering wheel angle sensor 6 is reset, and then the original routine is executed and exited.
In this embodiment, the software program flag set by the steering wheel angle sensor 6 is set as the original application program and the backup program, and then the steering wheel angle sensor 6 is reset, after the reset steering wheel angle sensor 6 successfully runs the upgrade tool of the upgrade software in the first storage area of the FLASH, the steering wheel angle sensor erases the data of the software program flag set as the original program, that is, the original version application program, in the second storage area of another FLASH for storing the backup program for next upgrade, and sets the software program flag of the backup program as the backup program, and sets the re-flag of the other software program flag as the backup program as the original program. When the upgrading tool of the upgrading software is interrupted when being written into the second storage area of the FLASH, and the upgrading fails, the steering wheel corner sensor 6 is immediately reset, the old version application program with the original program set as the software program mark in the second storage area of the FLASH is operated after the resetting, and the application program is operated under the mode of returning to the non-upgrading application mode. The safety and the stability of the software upgrading of the steering wheel angle sensor 6 are ensured through the redundancy backup mode.
Further, if the backup program after successful upgrade cannot be successfully operated by the steering wheel angle sensor 6, the steering wheel angle sensor 6 erases data of the software program mark set as the backup program, copies the original program into an empty second storage area, sets the software program mark of the copied original program as the backup program, then operates the original program and quits, and returns to the application program operating mode without upgrade.
As shown in fig. 10, in a preferred embodiment, when the steering wheel angle sensor 6 is not mounted on the automobile, the connection between the upper computer 1 and the steering wheel angle sensor 6 is a wired connection; and
when the steering wheel angle sensor 6 is installed on the automobile, the connection mode of the upper computer 1 and the steering wheel angle sensor 6 is a wireless connection mode.
In the embodiment, the software upgrading is realized by adopting a wired connection mode, the mode is suitable for the condition that the steering wheel sensor 6 is not installed on an automobile or is detached from the automobile, software upgrading data is verified by using the upper computer 1 and then is sent to the steering wheel corner sensor 6 through a CAN network tool, the integrity and the correctness of the upgrading program data are judged by using a verification algorithm after the steering wheel corner sensor receives the upgrading program data, and the software upgrading data is written into FLASH after the verification is passed, so that the online software upgrading function of the steering wheel corner sensor is realized.
Adopt this kind of mode of wireless connection to realize software upgrading, this kind of mode is applicable to steering wheel sensor 6 and has installed on the car, the unable circumstances of dismantling from the car, this kind of circumstances must ensure that the car is in the networking state, the car CAN keep communication connection with high in the clouds 3 promptly, utilize host computer 1 to send the software upgrading data to high in the clouds 3 and save with wireless transmission, when detecting the car and being in idle state by on-vehicle software updating controller 4 again, download the software upgrading data from high in the clouds 3, then send the software upgrading data to steering wheel corner sensor 6 through CAN gateway 5. The wireless transmission channel is used for transmitting data to the cloud end 3 for storage and downloading, the vehicle-mounted software updating controller 4 detects the idle state of the automobile, and the wired transmission channel is used for transmitting software upgrading data to the steering wheel angle sensor 6 by the CAN gateway 5.
In summary, after the initialization, the upper computer 1 performs integrity check and correctness check on the loaded upgrade file to determine the integrity and correctness of the software upgrade data of the file to be upgraded, so as to prevent the incomplete or incorrect upgrade file from being written to the steering wheel angle sensor 6. If the software upgrading data in the upgrading file is incomplete or incorrect, the upper computer 1 stops software upgrading operation. And if the software upgrading data is complete and correct, the upper computer 1 sends the software upgrading data to the steering wheel angle sensor 6. The steering wheel angle sensor 6 first verifies the correctness of the software upgrade data using a cyclic redundancy check algorithm on the received data. If the software upgrading data is not verified, the steering wheel angle sensor 6 returns to the application program running in the non-upgrading application mode. And if the correctness of all the software upgrading data received by the steering wheel angle sensor 6 passes the verification, performing integrity verification on the software upgrading data. The safety of software upgrading data is ensured through double verification. And if the software upgrading data is incomplete, immediately returning the steering wheel corner sensor to run the application program in the application mode which is not upgraded. And then, two storage areas are set by using a FLASH memory in the steering wheel angle sensor 6, and the backup upgrade file is stored redundantly so as to roll back to the old version or the previous version of the application program used by the steering wheel angle sensor 6 under the condition that software upgrade fails.
The invention also provides two ways to realize the software upgrade of the steering wheel angle sensor 6. The first mode is wired connection, and software upgrading data sent by the upper computer 1 is transmitted to the steering wheel angle sensor 6 through the CAN network tool 2; the second mode is wireless connection, the upper computer 1 sends the software upgrading data to the cloud end 3 for storage in a wireless transmission mode, and then the software upgrading data are downloaded from the cloud end 3 to the steering wheel corner sensor 6 through the CAN gateway 5.
While the invention has been described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention.

Claims (9)

1. A software upgrading method is applied to an automobile; the software upgrading method is characterized in that an upper computer used for carrying out software upgrading on the steering wheel corner sensor of the automobile is arranged, the upper computer is connected with the steering wheel corner sensor, and the software upgrading method comprises the following steps:
step S1, the upper computer obtains software upgrading data of upgrading software to carry out first integrity verification operation on the software upgrading data, and carries out first correctness verification operation on the software upgrading data after the first integrity verification operation is passed;
step S2, the upper computer sends the software upgrading data to the steering wheel angle sensor;
step S3, the steering wheel angle sensor carries out a second correctness verification operation on the software upgrading data, and after the second correctness verification operation is passed, the second completeness verification operation is carried out on the software upgrading data;
and step S4, the steering wheel angle sensor executes software upgrading operation according to the software upgrading data.
2. The software upgrading method according to claim 1, wherein the software upgrading data includes a plurality of lines of software upgrading data, each line of the software upgrading data includes a first data portion and a second data portion, the first data portion is valid program upgrading data, the second data portion includes a first correct check code, the step S1 includes the following steps:
step S11, the upper computer initializes and enters a software upgrading state;
step S12, the upper computer loads the upgrade software;
step S13, the upper computer analyzes the upgrade software to obtain the software upgrade data, reads a plurality of bytes at the beginning of the first line and a plurality of bytes at the end of the last line of the software upgrade data, and generates a first complete check code;
and step S14, the upper computer calculates the corresponding first correct check code according to the first data part in each row of the software upgrading data and writes the first correct check code into the second data part.
3. The software upgrading method according to claim 2, wherein in step S1, the following steps are adopted to perform the first integrity verification operation on the software upgrading data:
step S11A, the upper computer reads a plurality of bytes at the beginning of the first line and a plurality of bytes at the end of the last line of the loaded software upgrade data that do not include the first correct check code, and generates a second complete check code;
step S12A, determining whether the second complete check code is consistent with the first complete check code;
if so, continuing to execute the first correctness verification operation on the software upgrading data;
if not, exiting.
4. The software upgrading method according to claim 2, wherein in step S1, the first correctness verifying operation is performed on a row of the software upgrading data by adopting the following steps:
step S11B, the upper computer reads the loaded row of the software upgrading data and calculates a second correct check code according to a first data part of the row of the software upgrading data;
step S12B, determining whether the second correct check code is consistent with the first correct check code;
if so, indicating that the software upgrading data of the current line passes the first correctness verification operation;
if not, indicating that the software upgrading data in the current line does not pass the first correctness verification operation;
in the step S1, the steps S11B-S12B are executed in a loop, so as to perform the first correctness verifying operation on the software upgrade data of each row in turn, and after all the rows of the software upgrade data pass the first correctness verifying operation, it is determined that the whole software upgrade data passes the first correctness verifying operation.
5. The software upgrading method according to claim 1, wherein the steering wheel angle sensor is provided with a first preset time and a second preset time;
before the step S2 is executed, the method further includes a process of performing communication connection between the upper computer and the steering wheel angle sensor, and specifically includes the following steps:
step A1, the upper computer judges whether a communication connection request is established between the upper computer and the steering wheel angle sensor within the first preset time;
if yes, go to step S2;
if not, exiting;
the step S2 specifically includes:
step S21, after establishing communication connection with the steering wheel angle sensor, the upper computer judges whether the steering wheel angle sensor starts to receive the software upgrading data sent by the upper computer within the second preset time;
if yes, after the steering wheel angle sensor receives all the software upgrading data, the step S3 is performed;
if not, exiting.
6. The software upgrading method according to claim 2, wherein the steering wheel angle sensor receives and stores the software upgrading data transmitted from the upper computer by a row before the step S3 is executed, and then the step S3 performs the second correctness verification operation on a row of the software upgrading data by:
step S31A, the steering wheel angle sensor reads a line of stored software upgrading data, and a third correct check code is calculated according to a first data part of the line of software upgrading data;
step S32A, determining whether the third correct check code is consistent with the first correct check code;
if so, indicating that the software upgrading data of the current line passes the second correctness verification operation;
if not, the software upgrading data of the current line does not pass the second correctness verification operation;
in the step S3, the steps S31A-S32A are executed in a loop, so as to perform the second correctness verifying operation on the software upgrade data of each row in turn, and after all the rows of the software upgrade data pass the second correctness verifying operation, it is determined that the whole software upgrade data passes the second correctness verifying operation.
7. The software upgrading method according to claim 2, wherein in the step S3, the second integrity verification operation is performed on the software upgrading data by adopting the following steps:
step S31B, the steering wheel angle sensor reads a number of first bytes of a first row and a number of bytes of a last row of the software upgrade data that do not include the first correct check code after passing the second correctness verification operation, and generates a third complete check code;
step S32B, determining whether the third complete check code is consistent with the first complete check code;
if yes, go to step S4;
if not, exiting.
8. The software upgrading method according to claim 1, characterized in that the steering wheel angle sensor is provided with a FLASH memory, and the FLASH memory is provided with a first storage area and two second storage areas;
when the steering wheel angle sensor works normally, an upgrading tool used for storing upgrading software is arranged in the first storage area, software programs which run normally are respectively stored in the two second storage areas, the software program stored in one of the second storage areas is marked as an original program, the software program stored in the other second storage area is marked as a backup program, and the original program is run when the steering wheel angle sensor works normally;
the step S4 includes the following steps:
step S41, the steering wheel angle sensor runs the upgrade tool in the first storage area to perform a software upgrade operation on the backup program according to the software upgrade data;
step S42, the steering wheel angle sensor determines whether the software upgrade operation is successful:
if yes, go to step S43;
if not, go to step S44;
step S43, the steering wheel angle sensor is reset, the backup program is then executed, and whether the backup program is normally executed is determined:
if so, erasing the original program, marking the backup program as the original program, copying the current original program into the empty second storage area, marking the copied original program as the backup program, then operating the original program and exiting;
if not, erasing the backup program, copying the original program to the empty second storage area, marking the copied original program as the backup program, and then operating the original program and exiting;
in step S44, the steering wheel angle sensor is reset, and then the original program is executed and exited.
9. The software upgrading method according to claim 1, wherein when the steering wheel angle sensor is not mounted on the automobile, the connection mode between the upper computer and the steering wheel angle sensor is a wired connection mode; and
when the steering wheel corner sensor is installed on the automobile, the connection mode of the upper computer and the steering wheel corner sensor is a wireless connection mode.
CN202110202027.9A 2021-02-23 2021-02-23 Software upgrading method applied to automobile steering wheel corner sensor Pending CN112988188A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110202027.9A CN112988188A (en) 2021-02-23 2021-02-23 Software upgrading method applied to automobile steering wheel corner sensor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110202027.9A CN112988188A (en) 2021-02-23 2021-02-23 Software upgrading method applied to automobile steering wheel corner sensor

Publications (1)

Publication Number Publication Date
CN112988188A true CN112988188A (en) 2021-06-18

Family

ID=76349751

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110202027.9A Pending CN112988188A (en) 2021-02-23 2021-02-23 Software upgrading method applied to automobile steering wheel corner sensor

Country Status (1)

Country Link
CN (1) CN112988188A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102023876A (en) * 2009-09-14 2011-04-20 漳州科能电器有限公司 Embedded system capable of upgrading software on line and online upgrading method
CN104899065A (en) * 2015-06-11 2015-09-09 武汉虹信通信技术有限责任公司 Method and system for batch online recovery and software online upgrading
CN107402847A (en) * 2017-07-28 2017-11-28 安徽江淮汽车集团股份有限公司 A kind of remote upgrade method and system of entire car controller software
CN110007941A (en) * 2019-03-05 2019-07-12 小黄狗环保科技有限公司 A kind of the MCU firmware and upgrade method of Intelligent refuse classification recovery system
CN110058952A (en) * 2018-01-18 2019-07-26 株洲中车时代电气股份有限公司 A kind of method of calibration and system of files in embedded equipment
CN110187909A (en) * 2019-06-03 2019-08-30 山东海格尔信息技术股份有限公司 A kind of single-chip microcontroller firmware upgrade method based on android system
CN110399152A (en) * 2019-07-22 2019-11-01 浙江鸿泉车联网有限公司 A kind of device systems double copies upgrade method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102023876A (en) * 2009-09-14 2011-04-20 漳州科能电器有限公司 Embedded system capable of upgrading software on line and online upgrading method
CN104899065A (en) * 2015-06-11 2015-09-09 武汉虹信通信技术有限责任公司 Method and system for batch online recovery and software online upgrading
CN107402847A (en) * 2017-07-28 2017-11-28 安徽江淮汽车集团股份有限公司 A kind of remote upgrade method and system of entire car controller software
CN110058952A (en) * 2018-01-18 2019-07-26 株洲中车时代电气股份有限公司 A kind of method of calibration and system of files in embedded equipment
CN110007941A (en) * 2019-03-05 2019-07-12 小黄狗环保科技有限公司 A kind of the MCU firmware and upgrade method of Intelligent refuse classification recovery system
CN110187909A (en) * 2019-06-03 2019-08-30 山东海格尔信息技术股份有限公司 A kind of single-chip microcontroller firmware upgrade method based on android system
CN110399152A (en) * 2019-07-22 2019-11-01 浙江鸿泉车联网有限公司 A kind of device systems double copies upgrade method and device

Similar Documents

Publication Publication Date Title
KR101082940B1 (en) Network equipment and a method for monitoring the start up of a such an equipment
CN110178114B (en) Vehicle control device and program update system
CN109189445B (en) Method for upgrading program of equipment of Internet of things
US20100169709A1 (en) System Of Updating Firmware And Method Thereof, And Method Of Creating Firmware
CN104899065A (en) Method and system for batch online recovery and software online upgrading
KR20140060912A (en) Method and apparatus for updating boot loader
CN111813428A (en) Method and device for upgrading terminal firmware, electronic equipment and storage medium
US20060218340A1 (en) Data validity determining method for flash EEPROM and electronic control system
US9172398B2 (en) Vehicle data abnormality determination device
CN105045671A (en) Method and device for upgrading systems of intelligent terminals
CN112181459A (en) CPLD upgrade optimization method and system
CN112988188A (en) Software upgrading method applied to automobile steering wheel corner sensor
JP3093541B2 (en) Terminal device and online system for managing version numbers of programs and data
EP4075309A1 (en) Secure boot device
US20220244946A1 (en) Ota master, update control method, non-transitory storage medium, and vehicle
CN115982710A (en) OTA (over the air) security upgrading method based on Ethernet
CN115061704A (en) Firmware upgrading method and electronic equipment
CN110727450A (en) Method and device for updating boot loader
CN114003242A (en) Software update device, update control method, non-temporary storage medium, and server
CN112181455B (en) Online upgrading method of microcontroller, microcontroller and storage medium
CN116382724B (en) Remote upgrading method and system based on cloud printer
CN117348910A (en) BootLoader upgrading method and system of intelligent cabin MCU
US20220317994A1 (en) Ota master, update control method, and non-transitory storage medium
KR20080065166A (en) Application program download apparatus and method for touch panel in mobile terminal
KR101637608B1 (en) Update method for multimedia system in a vehicle and system thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination