CN110764486A - Method and device for operating vehicle-mounted controller, vehicle-mounted controller and storage medium - Google Patents

Method and device for operating vehicle-mounted controller, vehicle-mounted controller and storage medium Download PDF

Info

Publication number
CN110764486A
CN110764486A CN201910937896.9A CN201910937896A CN110764486A CN 110764486 A CN110764486 A CN 110764486A CN 201910937896 A CN201910937896 A CN 201910937896A CN 110764486 A CN110764486 A CN 110764486A
Authority
CN
China
Prior art keywords
partition
memory
vehicle
mounted controller
controller
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.)
Granted
Application number
CN201910937896.9A
Other languages
Chinese (zh)
Other versions
CN110764486B (en
Inventor
周洪波
张永生
李�瑞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Express Jiangsu Technology Co Ltd
Human Horizons Jiangsu Technology Co Ltd
Original Assignee
China Express Jiangsu Technology 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 China Express Jiangsu Technology Co Ltd filed Critical China Express Jiangsu Technology Co Ltd
Priority to CN201910937896.9A priority Critical patent/CN110764486B/en
Publication of CN110764486A publication Critical patent/CN110764486A/en
Application granted granted Critical
Publication of CN110764486B publication Critical patent/CN110764486B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B23/00Testing or monitoring of control systems or parts thereof
    • G05B23/02Electric testing or monitoring
    • G05B23/0205Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults
    • G05B23/0218Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults characterised by the fault detection method dealing with either existing or incipient faults
    • G05B23/0221Preprocessing measurements, e.g. data collection rate adjustment; Standardization of measurements; Time series or signal analysis, e.g. frequency analysis or wavelets; Trustworthiness of measurements; Indexes therefor; Measurements using easily measured parameters to estimate parameters difficult to measure; Virtual sensor creation; De-noising; Sensor fusion; Unconventional preprocessing inherently present in specific fault detection methods like PCA-based methods
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/24Pc safety
    • G05B2219/24065Real time diagnostics

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses an operation method and device of a vehicle-mounted controller, the vehicle-mounted controller and a storage medium, wherein the method comprises the following steps: reading partition layout information of a memory of the on-board controller from a partition management partition of the memory; obtaining a partition mode of the memory according to the partition layout information of the memory; and according to the partition mode, when detecting that the system partition currently running in the memory is damaged, executing corresponding operation to enable the working system of the vehicle-mounted controller to keep normal running or recover normal running. By adopting the embodiment of the invention, the system recovery can be realized in time when the working system of the vehicle-mounted controller cannot normally operate, and the operation reliability of the vehicle-mounted controller is improved, thereby improving the driving safety.

Description

Method and device for operating vehicle-mounted controller, vehicle-mounted controller and storage medium
Technical Field
The present invention relates to the field of automotive technologies, and in particular, to an operating method of an onboard controller, and a storage medium.
Background
An on-vehicle controller is an on-vehicle device for controlling a vehicle, and plays an important role in ensuring driving safety. In the running process of the vehicle-mounted controller, the partition in the memory of the vehicle-mounted controller is damaged due to various reasons, and the damage of the system partition in the memory of the vehicle-mounted controller can cause the working system of the vehicle-mounted controller to be incapable of running normally, which can cause great influence on the driving safety. However, in the process of implementing the present invention, the inventor finds that the conventional vehicle-mounted controller cannot timely recover the normal operation after the working system cannot normally operate, and therefore, the conventional vehicle-mounted controller has low operation reliability.
Disclosure of Invention
The embodiment of the invention provides an operation method and device of a vehicle-mounted controller, the vehicle-mounted controller and a storage medium, which can realize system recovery in time when a working system of the vehicle-mounted controller cannot normally operate, and improve the operation reliability of the vehicle-mounted controller, thereby improving the driving safety.
In order to achieve the above object, an embodiment of the present invention provides an operation method of a vehicle-mounted controller, including:
reading partition layout information of a memory of the on-board controller from a partition management partition of the memory; wherein the partition layout information comprises a data structure and a physical address of a partition layout;
obtaining a partition mode of the memory according to the partition layout information of the memory;
when the partition mode is a first partition mode, detecting whether a system partition currently running in the memory is damaged, if so, reading an emergency program from an emergency partition of the memory and executing the emergency program so as to enable a working system of the vehicle-mounted controller to recover normal work; wherein the system partition of the memory is used for storing working system files of the vehicle-mounted controller;
when the partition mode is a second partition mode, detecting whether a currently running system partition in the memory is damaged, if so, switching the currently running system partition to a next system partition in the memory, and loading and running a working system file of the vehicle-mounted controller from the currently running system partition so as to enable a working system of the vehicle-mounted controller to keep normal running; and repeating the steps until all the system partitions in the memory are damaged, reading the emergency program from the emergency partition of the memory and executing the emergency program so as to enable the working system of the vehicle-mounted controller to recover normal work.
As an improvement of the above scheme, the working system files include operating system files, application programs and library files on which the application programs depend;
the system partition includes an operating system partition for storing the operating system files, and a file system partition for storing the application programs and library files on which the application programs depend.
As an improvement of the above solution, the memory further includes a boot partition for storing a boot loader;
before the reading of the partition layout information of the memory from the partition management partition of the memory of the on-board controller, the method further comprises the steps of:
after the vehicle-mounted controller is powered on, the boot loader is read from a boot partition of a memory of the vehicle-mounted controller and executed, so that a working system file of the vehicle-mounted controller is loaded from one system partition of the memory and runs.
As an improvement of the above scheme, whether the currently running system partition in the memory is damaged is detected by the following method:
detecting whether the effective bit of the currently running system partition is effective or not, if so, judging that the currently running system partition is not damaged, and if not, judging that the currently running system partition is damaged; alternatively, the first and second electrodes may be,
detecting whether the integrity zone bit of the currently running system partition is effective, if so, judging that the currently running system partition is not damaged, and if not, judging that the currently running system partition is damaged; alternatively, the first and second electrodes may be,
and performing CRC (cyclic redundancy check) on the content stored in the currently running system partition, if the content passes the CRC, judging that the currently running system partition is not damaged, and if not, judging that the currently running system partition is damaged.
As an improvement of the above solution, the emergency program when executed by the onboard controller implements the following steps:
acquiring a mirror image file;
analyzing the image file to obtain the content of each partition in the image file;
when the fact that the partition management partition of the image file contains the test mark is judged, copying the image file to a memory of the vehicle-mounted controller, and operating the image file in the memory;
and when the condition that the partition management partition of the image file does not contain the test mark is judged, acquiring the partition layout information of the image file and the memory, writing the content of the partition corresponding to the memory in the image file into the memory according to the image file and the partition layout information of the memory, and re-operating the vehicle-mounted controller.
As an improvement of the above scheme, the acquiring the image file specifically includes:
acquiring current software version information of the vehicle-mounted controller;
sending request upgrading information and the current software version information to a server; the upgrading request information is used for requesting the server to return an image file according to the current software version information;
and receiving the image file sent by the server.
Correspondingly, the embodiment of the invention also provides an operation device of the vehicle-mounted controller, which comprises the following components:
the information reading module is used for reading partition layout information of a memory from a partition management partition of the memory of the vehicle-mounted controller; wherein the partition layout information comprises a data structure and a physical address of a partition layout;
the mode confirmation module is used for obtaining the partition mode of the memory according to the partition layout information of the memory;
the first operation module is used for detecting whether a system partition currently operated in the memory is damaged or not when the partition mode is the first partition mode, and if so, reading an emergency program from an emergency partition of the memory and executing the emergency program so as to enable a working system of the vehicle-mounted controller to recover normal work; wherein the system partition of the memory is used for storing working system files of the vehicle-mounted controller;
the second operation module is used for detecting whether the currently-operated system partition in the memory is damaged or not when the partition mode is the second partition mode, if so, switching the currently-operated system partition into the next system partition in the memory, and loading and operating the working system file of the vehicle-mounted controller from the currently-operated system partition so as to enable the working system of the vehicle-mounted controller to keep normal operation; and repeating the steps until all the system partitions in the memory are damaged, reading the emergency program from the emergency partition of the memory and executing the emergency program so as to enable the working system of the vehicle-mounted controller to recover normal work.
The embodiment of the invention also provides an on-board controller, which comprises a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the operation method of any one of the on-board controllers when executing the computer program;
wherein the memory comprises a partition management partition for storing partition layout information of the memory, an emergency partition for storing emergency programs, and at least one system partition for storing operating system files of the onboard controllers.
As an improvement of the above solution, the memory further comprises a data partition and a journal partition;
the data partition is used for storing equipment parameters of the vehicle-mounted controller; wherein the equipment parameters comprise calibration parameters, calibration data and type parameters;
the log partition is used for storing operation records of the vehicle-mounted controller and data generated in the running process.
The embodiment of the invention also provides a computer-readable storage medium, which includes a stored computer program, and when the computer program runs, the device where the computer-readable storage medium is located is controlled to execute the running method of any one of the above-mentioned onboard controllers.
Compared with the prior art, the embodiment of the invention provides an operation method and device of an on-board controller, the on-board controller and a storage medium, wherein the partition layout information of a memory of the on-board controller is read from a partition management partition of the memory; obtaining a partition mode of the memory according to the partition layout information of the memory; and according to the partition mode, when detecting that the system partition currently running in the memory is damaged, executing corresponding operation to enable the working system of the vehicle-mounted controller to keep normal running or recover normal running. When the system partition in the memory of the vehicle-mounted controller is damaged, the system recovery of the vehicle-mounted controller is realized in time, so that the running reliability of the vehicle-mounted controller is improved, and the driving safety is improved.
Drawings
Fig. 1 is a schematic flow chart of an embodiment of an operating method of an on-board controller provided by the present invention.
Fig. 2 is a schematic flow chart of an embodiment of steps implemented when an emergency program is executed by an onboard controller in the method for operating an onboard controller according to the present invention.
Fig. 3 is a schematic structural diagram of an embodiment of an operating device of the vehicle-mounted controller provided by the invention.
Fig. 4 is a schematic structural diagram of an embodiment of the vehicle-mounted controller provided by the 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 any inventive step, are within the scope of the present invention.
Referring to fig. 1, a schematic flow chart of an embodiment of an operating method of the vehicle-mounted controller provided by the invention is shown.
The embodiment of the invention provides an operation method of an on-board controller, which is applied to the on-board controller, wherein a memory of the on-board controller comprises a partition management partition used for storing partition layout information of the memory, an emergency partition used for storing emergency programs and at least one system partition used for storing working system files of the on-board controller. The method comprises steps S10 to S40, which are as follows:
s10, reading partition layout information of a memory from a partition management partition of the memory of the vehicle-mounted controller; wherein the partition layout information includes a data structure and a physical address of the partition layout.
And S20, obtaining the partition mode of the memory according to the partition layout information of the memory.
According to the data structure and the physical address of the partition layout in the partition layout information of the memory, the partition layout logic of the memory, the relation among the partitions, the front-back dependency of the partitions, the address called by the partitions, the action of the partitions and other information can be obtained, and therefore the partition mode of the memory is obtained. The partition modes include a first partition mode and a second partition mode: when only one system partition is contained in the memory, the partition mode of the memory is a first partition mode; when two or more system partitions are included in the memory, the partition mode of the memory is the second partition mode. It should be noted that all system partitions included in the vehicle-mounted controller may be backup for each other, that is, all system partitions include the same file. It can be understood that the operation method of the vehicle-mounted controller provided by the embodiment of the invention can be compatible with the vehicle-mounted controllers with different partition modes, so that the vehicle-mounted controllers adopting different partition layouts only need to maintain one set of software codes, the reusability and compatibility of the operation method of the vehicle-mounted controller can be effectively enhanced, and the function expandability of the vehicle-mounted controller is enhanced.
S30, when the partition mode is a first partition mode, detecting whether a system partition currently running in the memory is damaged, if so, reading an emergency program from an emergency partition of the memory and executing the emergency program so as to enable a working system of the vehicle-mounted controller to recover normal work; wherein the system partition of the memory is used for storing the working system file of the vehicle-mounted controller.
When the partition mode is judged to be the first partition mode, whether the currently running system partition in the memory is damaged or not is detected in real time in order to ensure the running reliability of the vehicle-mounted controller. When the damage of the system partition currently running in the memory is detected, the working system of the vehicle-mounted controller cannot normally run, and because only one system partition is arranged in the memory, in order to enable the vehicle-mounted controller to be restored to a normal working state as soon as possible, the emergency program is read from the emergency partition of the memory and executed, so that the working system of the vehicle-mounted controller can be restored to normal working.
When the emergency program is executed by the vehicle-mounted controller, system recovery of the vehicle-mounted controller can be achieved. In specific implementation, the emergency program may be various, and may be set according to an actual situation, which is not limited herein.
The method for detecting whether the currently running system partition in the memory is damaged may be various, and the method may be set according to actual conditions, and is not limited herein.
Specifically, the working system files include operating system files, application programs and library files on which the application programs depend;
the system partition includes an operating system partition for storing the operating system files, and a file system partition for storing the application programs and library files on which the application programs depend.
The vehicle-mounted controller can realize management of the hardware platform and provide an API (application programming interface) for the application program by running the operating system files in the operating system partition. The on-board controller may implement the associated functions of the on-board controller by running the application and the library files on which the application depends in the file system partition.
S40, when the partition mode is a second partition mode, detecting whether the currently running system partition in the memory is damaged, if so, switching the currently running system partition to a next system partition in the memory, and loading and running the working system file of the vehicle-mounted controller from the currently running system partition so as to enable the working system of the vehicle-mounted controller to keep normal running; and repeating the steps until all the system partitions in the memory are damaged, reading the emergency program from the emergency partition of the memory and executing the emergency program so as to enable the working system of the vehicle-mounted controller to recover normal work.
In order to ensure the operation reliability of the vehicle-mounted controller, when the partition mode is judged to be the second partition mode, whether the currently-operated system partition in the memory is damaged or not is detected in real time, when the currently-operated system partition in the memory is detected to be damaged, the working system of the vehicle-mounted controller cannot normally operate, because at least two system partitions exist in the memory, in order to enable the vehicle-mounted controller to keep a normal working state, the currently-operated system partition is switched to be the next system partition in the memory, and after the currently-operated system partition is switched, the working system file of the vehicle-mounted controller is added into the currently-operated system partition and operates to operate the working system of the vehicle-mounted controller, so that the working system of the vehicle-mounted controller keeps normally operating. And then, repeatedly executing the steps until all the system partitions in the memory are damaged, and reading the emergency program from the emergency partition of the memory and executing the emergency program so as to enable the working system of the vehicle-mounted controller to recover to the normal working state as soon as possible.
According to the operation method of the vehicle-mounted controller provided by the embodiment of the invention, the partition layout information of the memory is read from the partition management partition of the memory of the vehicle-mounted controller; obtaining a partition mode of the memory according to the partition layout information of the memory; and according to the partition mode, when detecting that the system partition currently running in the memory is damaged, executing corresponding operation to enable the working system of the vehicle-mounted controller to keep normal running or recover normal running. When the system partition in the memory of the vehicle-mounted controller is damaged, the system recovery of the vehicle-mounted controller is realized in time, so that the running reliability of the vehicle-mounted controller is improved, and the driving safety is improved.
On the basis of the above examples, the present invention further provides various preferred embodiments.
As one of the preferred embodiments, the memory further comprises a boot partition for storing a boot loader;
the method for operating the vehicle-mounted controller further includes, before step S10, step S100:
and S100, after the vehicle-mounted controller is powered on, reading the boot loader from a boot partition of a memory of the vehicle-mounted controller and executing the boot loader so as to load and run a working system file of the vehicle-mounted controller from one system partition of the memory.
When the boot loader is executed by the vehicle-mounted controller, the following steps can be realized: and adding the working system file of the vehicle-mounted controller from one system partition of the memory of the vehicle-mounted controller and running so as to run the working system of the vehicle-mounted controller.
In the preferred embodiment, the operation steps of the vehicle-mounted controller after being powered on are perfected, so that the operation method of the vehicle-mounted controller can be used for starting the vehicle-mounted controller.
As one of the preferred embodiments, whether the system partition currently running in the memory is damaged is detected by the following method:
detecting whether the effective bit of the currently running system partition is effective or not, if so, judging that the currently running system partition is not damaged, and if not, judging that the currently running system partition is damaged; alternatively, the first and second electrodes may be,
detecting whether the integrity zone bit of the currently running system partition is effective, if so, judging that the currently running system partition is not damaged, and if not, judging that the currently running system partition is damaged; alternatively, the first and second electrodes may be,
and performing CRC (cyclic redundancy check) on the content stored in the currently running system partition, if the content passes the CRC, judging that the currently running system partition is not damaged, and if not, judging that the currently running system partition is damaged.
As one of the preferred embodiments, referring to fig. 2, the emergency program when executed by the onboard controller implements the following steps:
and S31, acquiring the mirror image file.
The image file is used for system recovery of the vehicle-mounted controller. The image file can be preset in an emergency partition of the memory or other positions of the memory, or can be set in the network, and can be acquired from the network in real time when the image file needs to be used.
Further, the step S31 includes steps S311 to S313, which are as follows:
and S311, acquiring the current software version information of the vehicle-mounted controller.
S312, sending upgrading request information and the current software version information to a server; and the upgrading request information is used for requesting the server to return an image file according to the current software version information.
S313, receiving the mirror image file sent by the server.
Due to the technical progress, the updating frequency of the image file is high, so that the image file is more convenient to update when being arranged in a network compared with the image file arranged in a vehicle-mounted controller, and the timeliness of the version of the image file is guaranteed.
And S32, analyzing the image file to obtain the content of each partition in the image file.
And analyzing the mirror image file to obtain the content of each partition in the mirror image file.
And S33, when the partition management partition of the image file is judged to contain the test mark, copying the image file to the memory of the vehicle-mounted controller, and operating the image file in the memory.
When the vehicle-mounted controller is instructed to upgrade by using the image file by setting the test flag in the partition management partition of the image file, the corresponding upgrade method can be selected according to whether the image file contains the test flag. When the test mark is judged to be contained in the partition management partition of the image file, the vehicle-mounted controller is indicated to operate according to the partition layout and the partition content of the image file completely, at the moment, the image file is copied into the memory, and the image file is operated in the memory, so that the working system of the vehicle-mounted controller can recover to normal work.
S34, when the fact that the partition management partition of the image file does not contain the test mark is judged, obtaining partition layout information of the image file and the memory, writing the content of the partition corresponding to the memory in the image file into the memory according to the image file and the partition layout information of the memory, and running the vehicle-mounted controller again.
When the condition that the partition management partition of the image file does not contain the test mark is judged, the partition layout after the vehicle-mounted controller is upgraded still follows the original partition layout of the memory, at the moment, the partition layout information of the image file and the memory is obtained, the contents of the partitions corresponding to the memory in the image file are written into the memory in a one-to-one correspondence mode according to the partition layout information of the image file and the memory, and the vehicle-mounted controller is operated again, so that the working system of the vehicle-mounted controller can work normally.
In the preferred embodiment, since the previous partition format and policy may not meet new requirements after the partition format is changed due to the application of requirements when the product is upgraded, the on-board controller upgrades the image file to recover the operating system, and selects a corresponding upgrading method according to whether the image file includes the test flag, so that the partition layout of the memory of the on-board controller can be updated or the original partition layout can be reserved according to the image file, and the controllability and compatibility of upgrading are improved.
The embodiment of the invention also provides an operation device of the vehicle-mounted controller, which can implement all the processes of the operation method of the vehicle-mounted controller.
Fig. 3 is a schematic structural diagram of an embodiment of the operating device of the vehicle-mounted controller according to the present invention.
The embodiment of the invention provides an operation device of a vehicle-mounted controller, which comprises:
an information reading module 21, configured to read partition layout information of a memory of the onboard controller from a partition management partition of the memory; wherein the partition layout information comprises a data structure and a physical address of a partition layout;
the mode confirming module 22 is configured to obtain a partition mode of the memory according to the partition layout information of the memory;
the first operation module 23 is configured to detect whether a currently operating system partition in the memory is damaged when the partition mode is the first partition mode, and if so, read an emergency program from an emergency partition in the memory and execute the emergency program, so that the working system of the vehicle-mounted controller returns to normal operation; wherein the system partition of the memory is used for storing working system files of the vehicle-mounted controller;
a second operation module 24, configured to detect whether a currently operating system partition in the memory is damaged when the partition mode is the second partition mode, if so, switch the currently operating system partition to a next system partition in the memory, and load and operate a working system file of the vehicle-mounted controller from the currently operating system partition, so that the working system of the vehicle-mounted controller keeps operating normally; and repeating the steps until all the system partitions in the memory are damaged, reading the emergency program from the emergency partition of the memory and executing the emergency program so as to enable the working system of the vehicle-mounted controller to recover normal work.
The embodiment of the invention also provides a vehicle-mounted controller, which comprises a memory and the running device of the vehicle-mounted controller in the embodiment;
wherein the memory comprises a boot partition for storing a boot loader, a partition management partition for storing partition layout information of the memory, an emergency partition for storing emergency programs, and at least one system partition for storing operating system files of the on-board controller.
The operation device of the vehicle-mounted controller is applied to the vehicle-mounted controller, and the principle of realizing the function is the same as that of the embodiment, and is not described again here.
Wherein, when the boot loader is executed by the vehicle-mounted controller, the following steps can be realized: and loading and running the working system file of the vehicle-mounted controller from one system partition of the memory of the vehicle-mounted controller so as to run the working system of the vehicle-mounted controller.
Specifically, the working system files include operating system files, application programs and library files on which the application programs depend;
the system partition includes an operating system partition for storing the operating system files, and a file system partition for storing the application programs and library files on which the application programs depend.
The vehicle-mounted controller can realize management of the hardware platform and provide an API (application programming interface) for the application program by running the operating system files in the operating system partition. The on-board controller may implement the associated functions of the on-board controller by running the application and the library files on which the application depends in the file system partition.
When the emergency program is executed by the vehicle-mounted controller, system recovery of the vehicle-mounted controller can be achieved. In specific implementation, the emergency program may be various, and may be set according to an actual situation, which is not limited herein.
Optionally, referring to fig. 2, when executed by the onboard controller, the emergency program implements the following steps:
and S31, acquiring the mirror image file.
The image file is used for system recovery of the vehicle-mounted controller. The image file can be preset in an emergency partition of the memory or other positions of the memory, or can be set in the network, and can be acquired from the network in real time when the image file needs to be used.
Further, the step S31 includes steps S311 to S313, which are as follows:
and S311, acquiring the current software version information of the vehicle-mounted controller.
S312, sending upgrading request information and the current software version information to a server; and the upgrading request information is used for requesting the server to return an image file according to the current software version information.
S313, receiving the mirror image file sent by the server.
Due to the technical progress, the updating frequency of the image file is high, so that the image file is more convenient to update when being arranged in a network compared with the image file arranged in a vehicle-mounted controller, and the timeliness of the version of the image file is guaranteed.
And S32, analyzing the image file to obtain the content of each partition in the image file.
And analyzing the mirror image file to obtain the content of each partition in the mirror image file.
And S33, when the partition management partition of the image file is judged to contain the test mark, copying the image file to the memory of the vehicle-mounted controller, and operating the image file in the memory.
When the vehicle-mounted controller is instructed to upgrade by using the image file by setting the test flag in the partition management partition of the image file, the corresponding upgrade method can be selected according to whether the image file contains the test flag. When the test mark is judged to be contained in the partition management partition of the image file, the vehicle-mounted controller is indicated to operate according to the partition layout and the partition content of the image file completely, at the moment, the image file is copied into the memory, and the image file is operated in the memory, so that the working system of the vehicle-mounted controller can recover to normal work.
S34, when the fact that the partition management partition of the image file does not contain the test mark is judged, obtaining partition layout information of the image file and the memory, writing the content of the partition corresponding to the memory in the image file into the memory according to the image file and the partition layout information of the memory, and running the vehicle-mounted controller again.
When the condition that the partition management partition of the image file does not contain the test mark is judged, the partition layout after the vehicle-mounted controller is upgraded still follows the original partition layout of the memory, at the moment, the partition layout information of the image file and the memory is obtained, the contents of the partitions corresponding to the memory in the image file are written into the memory in a one-to-one correspondence mode according to the partition layout information of the image file and the memory, and the vehicle-mounted controller is operated again, so that the working system of the vehicle-mounted controller can work normally.
In the preferred embodiment, since the previous partition format and policy may not meet new requirements after the partition format is changed due to the application of requirements when the product is upgraded, the on-board controller upgrades the image file to recover the operating system, and selects a corresponding upgrading method according to whether the image file includes the test flag, so that the partition layout of the memory of the on-board controller can be updated or the original partition layout can be reserved according to the image file, and the controllability and compatibility of upgrading are improved.
Further, the memory further comprises a data partition;
the data partition is used for storing equipment parameters of the vehicle-mounted controller; wherein the equipment parameters include calibration parameters, calibration data, and type parameters.
Further, the memory further comprises a journaling partition;
the log partition is used for storing operation records of the vehicle-mounted controller and data generated in the running process.
According to the running device of the vehicle-mounted controller and the vehicle-mounted controller provided by the embodiment of the invention, the partition layout information of the memory is read from the partition management partition of the memory of the vehicle-mounted controller; obtaining a partition mode of the memory according to the partition layout information of the memory; and according to the partition mode, when detecting that the system partition currently running in the memory is damaged, executing corresponding operation to enable the working system of the vehicle-mounted controller to keep normal running or recover normal running. When the system partition in the memory of the vehicle-mounted controller is damaged, the system recovery of the vehicle-mounted controller is realized in time, so that the running reliability of the vehicle-mounted controller is improved, and the driving safety is improved.
Fig. 4 is a schematic structural diagram of an embodiment of the vehicle-mounted controller provided by the invention.
An embodiment of the present invention provides an on-board controller, which includes a processor 31, a memory 32, and a computer program stored in the memory 32 and configured to be executed by the processor 31, and when the processor 31 executes the computer program, the method for operating the on-board controller according to any of the above embodiments is implemented.
Wherein the memory 32 comprises a partition management partition for storing partition layout information of the memory 32, an emergency partition for storing emergency programs, and at least one system partition for storing operating system files of the onboard controllers.
Further, the memory 32 also includes a data partition and a log partition;
the data partition is used for storing equipment parameters of the vehicle-mounted controller; wherein the equipment parameters comprise calibration parameters, calibration data and type parameters;
the log partition is used for storing operation records of the vehicle-mounted controller and data generated in the running process.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium includes a stored computer program, where the computer program, when running, controls a device on which the computer-readable storage medium is located to perform the operation method of the vehicle-mounted controller according to any one of the above embodiments.
The processor 31, when executing the computer program, implements the steps in the above-described embodiments of the method for operating the vehicle-mounted controller, such as all the steps of the method for operating the vehicle-mounted controller shown in fig. 1. Alternatively, the processor 31 may implement the functions of the modules/units in the running device embodiments of the vehicle-mounted controllers, for example, the functions of the modules in the running device of the vehicle-mounted controller shown in fig. 3, when executing the computer program.
Illustratively, the computer program may be divided into one or more modules, which are stored in the memory 32 and executed by the processor 31 to accomplish the present invention. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program in the onboard controller. For example, the computer program may be divided into an information reading module, a mode confirmation module, a first operation module and a second operation module, and the specific functions of each module are as follows: the information reading module is used for reading partition layout information of a memory from a partition management partition of the memory of the vehicle-mounted controller; wherein the partition layout information comprises a data structure and a physical address of a partition layout; the mode confirmation module is used for obtaining the partition mode of the memory according to the partition layout information of the memory; the first operation module is used for detecting whether a system partition currently operated in the memory is damaged or not when the partition mode is the first partition mode, and if so, reading an emergency program from an emergency partition of the memory and executing the emergency program so as to enable a working system of the vehicle-mounted controller to recover normal work; wherein the system partition of the memory is used for storing working system files of the vehicle-mounted controller; the second operation module is used for detecting whether the currently-operated system partition in the memory is damaged or not when the partition mode is the second partition mode, if so, switching the currently-operated system partition into the next system partition in the memory, and loading and operating the working system file of the vehicle-mounted controller from the currently-operated system partition so as to enable the working system of the vehicle-mounted controller to keep normal operation; and repeating the steps until all the system partitions in the memory are damaged, reading the emergency program from the emergency partition of the memory and executing the emergency program so as to enable the working system of the vehicle-mounted controller to recover normal work.
The vehicle-mounted controller can be a desktop computer, a notebook computer, a palm computer, a cloud server and other computing equipment. The onboard controller may include, but is not limited to, a processor 31, a memory 32. It will be understood by those skilled in the art that the schematic diagram is merely an example of an onboard controller, and does not constitute a limitation of an onboard controller, and may include more or fewer components than shown, or some components in combination, or different components, e.g., the onboard controller may also include input-output devices, network access devices, buses, etc.
The Processor 31 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. The general purpose processor may be a microprocessor or the processor may be any conventional processor, etc., and the processor 31 is a control center of the vehicle controller and connects various parts of the entire vehicle controller by various interfaces and lines.
The memory 32 may be used for storing the computer programs and/or modules, and the processor 31 may implement various functions of the vehicle-mounted controller by running or executing the computer programs and/or modules stored in the memory 32 and calling data stored in the memory 32. Further, the memory 32 may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
Wherein the module/unit integrated with the vehicle-mounted controller can be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like.
It should be noted that the above-described device embodiments are merely illustrative, where the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. In addition, in the drawings of the embodiment of the apparatus provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, and may be specifically implemented as one or more communication buses or signal lines. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, several modifications and variations can be made without departing from the technical principle of the present invention, and these modifications and variations should also be regarded as the protection scope of the present invention.

Claims (10)

1. A method of operating an on-board controller, comprising the steps of:
reading partition layout information of a memory of the on-board controller from a partition management partition of the memory; wherein the partition layout information comprises a data structure and a physical address of a partition layout;
obtaining a partition mode of the memory according to the partition layout information of the memory;
when the partition mode is a first partition mode, detecting whether a system partition currently running in the memory is damaged, if so, reading an emergency program from an emergency partition of the memory and executing the emergency program so as to enable a working system of the vehicle-mounted controller to recover normal work; wherein the system partition of the memory is used for storing working system files of the vehicle-mounted controller;
when the partition mode is a second partition mode, detecting whether a currently running system partition in the memory is damaged, if so, switching the currently running system partition to a next system partition in the memory, and loading and running a working system file of the vehicle-mounted controller from the currently running system partition so as to enable a working system of the vehicle-mounted controller to keep normal running; and repeating the steps until all the system partitions in the memory are damaged, reading the emergency program from the emergency partition of the memory and executing the emergency program so as to enable the working system of the vehicle-mounted controller to recover normal work.
2. The method of claim 1, wherein the operating system files include operating system files, application programs, and library files upon which the application programs depend;
the system partition includes an operating system partition for storing the operating system files, and a file system partition for storing the application programs and library files on which the application programs depend.
3. The method of claim 1, further comprising a boot partition in the memory for storing a boot loader;
before the reading of the partition layout information of the memory from the partition management partition of the memory of the on-board controller, the method further comprises the steps of:
after the vehicle-mounted controller is powered on, the boot loader is read from a boot partition of a memory of the vehicle-mounted controller and executed, so that a working system file of the vehicle-mounted controller is loaded from one system partition of the memory and runs.
4. The method of claim 1, wherein detecting whether a currently running system partition in the memory is corrupted is performed by:
detecting whether the effective bit of the currently running system partition is effective or not, if so, judging that the currently running system partition is not damaged, and if not, judging that the currently running system partition is damaged; alternatively, the first and second electrodes may be,
detecting whether the integrity zone bit of the currently running system partition is effective, if so, judging that the currently running system partition is not damaged, and if not, judging that the currently running system partition is damaged; alternatively, the first and second electrodes may be,
and performing CRC (cyclic redundancy check) on the content stored in the currently running system partition, if the content passes the CRC, judging that the currently running system partition is not damaged, and if not, judging that the currently running system partition is damaged.
5. The method of operating an on-board controller of claim 1, wherein the emergency program, when executed by the on-board controller, performs the steps of:
acquiring a mirror image file;
analyzing the image file to obtain the content of each partition in the image file;
when the fact that the partition management partition of the image file contains the test mark is judged, copying the image file to a memory of the vehicle-mounted controller, and operating the image file in the memory;
and when the condition that the partition management partition of the image file does not contain the test mark is judged, acquiring the partition layout information of the image file and the memory, writing the content of the partition corresponding to the memory in the image file into the memory according to the image file and the partition layout information of the memory, and re-operating the vehicle-mounted controller.
6. The method for operating the vehicle-mounted controller according to claim 5, wherein the obtaining of the image file specifically includes:
acquiring current software version information of the vehicle-mounted controller;
sending request upgrading information and the current software version information to a server; the upgrading request information is used for requesting the server to return an image file according to the current software version information;
and receiving the image file sent by the server.
7. An operating device of an on-vehicle controller, characterized by comprising:
the information reading module is used for reading partition layout information of a memory from a partition management partition of the memory of the vehicle-mounted controller; wherein the partition layout information comprises a data structure and a physical address of a partition layout;
the mode confirmation module is used for obtaining the partition mode of the memory according to the partition layout information of the memory;
the first operation module is used for detecting whether a system partition currently operated in the memory is damaged or not when the partition mode is the first partition mode, and if so, reading an emergency program from an emergency partition of the memory and executing the emergency program so as to enable a working system of the vehicle-mounted controller to recover normal work; wherein the system partition of the memory is used for storing working system files of the vehicle-mounted controller;
the second operation module is used for detecting whether the currently-operated system partition in the memory is damaged or not when the partition mode is the second partition mode, if so, switching the currently-operated system partition into the next system partition in the memory, and loading and operating the working system file of the vehicle-mounted controller from the currently-operated system partition so as to enable the working system of the vehicle-mounted controller to keep normal operation; and repeating the steps until all the system partitions in the memory are damaged, reading the emergency program from the emergency partition of the memory and executing the emergency program so as to enable the working system of the vehicle-mounted controller to recover normal work.
8. An on-board controller comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, the processor implementing a method of operating the on-board controller of any one of claims 1-6 when executing the computer program;
wherein the memory comprises a partition management partition for storing partition layout information of the memory, an emergency partition for storing emergency programs, and at least one system partition for storing operating system files of the onboard controllers.
9. The vehicle controller of claim 8, wherein the memory further comprises a data partition and a log partition;
the data partition is used for storing equipment parameters of the vehicle-mounted controller; wherein the equipment parameters comprise calibration parameters, calibration data and type parameters;
the log partition is used for storing operation records of the vehicle-mounted controller and data generated in the running process.
10. A computer-readable storage medium, comprising a stored computer program, wherein the computer program, when executed, controls an apparatus in which the computer-readable storage medium is located to perform the method of operating the in-vehicle controller according to any one of claims 1 to 6.
CN201910937896.9A 2019-09-30 2019-09-30 Method and device for operating vehicle-mounted controller, vehicle-mounted controller and storage medium Active CN110764486B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910937896.9A CN110764486B (en) 2019-09-30 2019-09-30 Method and device for operating vehicle-mounted controller, vehicle-mounted controller and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910937896.9A CN110764486B (en) 2019-09-30 2019-09-30 Method and device for operating vehicle-mounted controller, vehicle-mounted controller and storage medium

Publications (2)

Publication Number Publication Date
CN110764486A true CN110764486A (en) 2020-02-07
CN110764486B CN110764486B (en) 2020-09-29

Family

ID=69329087

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910937896.9A Active CN110764486B (en) 2019-09-30 2019-09-30 Method and device for operating vehicle-mounted controller, vehicle-mounted controller and storage medium

Country Status (1)

Country Link
CN (1) CN110764486B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112562104A (en) * 2020-11-26 2021-03-26 东南大学 Programmable self-adaptive single-chip vehicle-mounted unit
CN113568072A (en) * 2021-08-07 2021-10-29 北京国信华源科技有限公司 Rainfall meter and rainfall detection method
CN115729647A (en) * 2023-01-09 2023-03-03 苏州浪潮智能科技有限公司 Server startup management system and method

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102297259A (en) * 2011-05-12 2011-12-28 浙江吉利汽车研究院有限公司 Improved method for controlling automatic shift of transmission and TCU (transmission control unit)
CN103793256A (en) * 2014-03-03 2014-05-14 联想(北京)有限公司 Method for management of memory cards, and electronic device
CN106843192A (en) * 2016-12-30 2017-06-13 北京中油瑞飞信息技术有限责任公司 The system start method and device of controller
CN107220194A (en) * 2017-05-24 2017-09-29 郑州云海信息技术有限公司 A kind of partitioned allocation method of multipath server, device and multipath server
CN107239771A (en) * 2017-06-21 2017-10-10 北京小米移动软件有限公司 Fingerprint calibration method and device
CN107239411A (en) * 2017-06-06 2017-10-10 上汽通用汽车有限公司 A kind of Vehicle Controller EMS memory management process and system
EP3349083A1 (en) * 2016-05-24 2018-07-18 Huawei Technologies Co., Ltd. System and apparatus for storing information
CN108958819A (en) * 2018-06-29 2018-12-07 大陆汽车车身电子系统(芜湖)有限公司 The starting method and multi-partitioned systems of multi-partitioned systems
US20190079842A1 (en) * 2017-09-13 2019-03-14 Hyundai Motor Company Failure diagnosis apparatus and method for in-vehicle control unit

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102297259A (en) * 2011-05-12 2011-12-28 浙江吉利汽车研究院有限公司 Improved method for controlling automatic shift of transmission and TCU (transmission control unit)
CN103793256A (en) * 2014-03-03 2014-05-14 联想(北京)有限公司 Method for management of memory cards, and electronic device
EP3349083A1 (en) * 2016-05-24 2018-07-18 Huawei Technologies Co., Ltd. System and apparatus for storing information
CN106843192A (en) * 2016-12-30 2017-06-13 北京中油瑞飞信息技术有限责任公司 The system start method and device of controller
CN107220194A (en) * 2017-05-24 2017-09-29 郑州云海信息技术有限公司 A kind of partitioned allocation method of multipath server, device and multipath server
CN107239411A (en) * 2017-06-06 2017-10-10 上汽通用汽车有限公司 A kind of Vehicle Controller EMS memory management process and system
CN107239771A (en) * 2017-06-21 2017-10-10 北京小米移动软件有限公司 Fingerprint calibration method and device
US20190079842A1 (en) * 2017-09-13 2019-03-14 Hyundai Motor Company Failure diagnosis apparatus and method for in-vehicle control unit
CN108958819A (en) * 2018-06-29 2018-12-07 大陆汽车车身电子系统(芜湖)有限公司 The starting method and multi-partitioned systems of multi-partitioned systems

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112562104A (en) * 2020-11-26 2021-03-26 东南大学 Programmable self-adaptive single-chip vehicle-mounted unit
CN113568072A (en) * 2021-08-07 2021-10-29 北京国信华源科技有限公司 Rainfall meter and rainfall detection method
CN113568072B (en) * 2021-08-07 2023-02-28 北京国信华源科技有限公司 Rainfall meter and rainfall detection method
CN115729647A (en) * 2023-01-09 2023-03-03 苏州浪潮智能科技有限公司 Server startup management system and method
CN115729647B (en) * 2023-01-09 2023-04-25 苏州浪潮智能科技有限公司 Server starting management system and method

Also Published As

Publication number Publication date
CN110764486B (en) 2020-09-29

Similar Documents

Publication Publication Date Title
CN110764486B (en) Method and device for operating vehicle-mounted controller, vehicle-mounted controller and storage medium
CN109933348B (en) Method and device for updating Bootloader in electronic control unit
KR101427755B1 (en) Device and method for firmware upgrade using usb
US8539471B2 (en) Updating firmware of an electronic device
US20030221092A1 (en) Method and system of switching between two or more images of firmware on a host device
CN102334100A (en) Program update device, program update method, and information processing device
CN111796848A (en) Bootloader software updating method and device, embedded controller and storage medium
CN111240720A (en) Boot program upgrading method and device and storage medium
CN111045712A (en) Single system upgrading method and system with backup function
US7904896B2 (en) Program rewriting system, boot loader, storage medium, and electronic control unit
US20210173634A1 (en) Vehicle control device and program update system
CN104598281A (en) Method for upgrading system of electronic device
CN110333882B (en) System upgrading method, device, equipment and computer readable medium
CN106933604B (en) System upgrading method and device
US20220391192A1 (en) Ota master, center, system, method, non-transitory storage medium, and vehicle
JP3805195B2 (en) Program rewriting apparatus and program rewriting method
JP2614361B2 (en) How to change file contents
US8918582B2 (en) Simulating EEPROM in virtual distributed switches
CN109428936B (en) APP upgrading method, device, system, electronic equipment and storage medium
CN111625256A (en) Application program upgrading method, system, equipment and computer storage medium
CN112579113A (en) Application program upgrading method and device, storage medium and terminal
WO2021153224A1 (en) Information processing device and information processing method
US20220391193A1 (en) Ota master, system, method, non-transitory storage medium, and vehicle
CN113448644A (en) OC hard disk configuration method, device, terminal and storage medium in ring3 mode of operating system
JP2023070929A (en) Electronic control system, data structure of software package, and computer program

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
GR01 Patent grant
GR01 Patent grant
PP01 Preservation of patent right

Effective date of registration: 20240222

Granted publication date: 20200929

PP01 Preservation of patent right