CN117076208A - Data processing method, device and equipment - Google Patents

Data processing method, device and equipment Download PDF

Info

Publication number
CN117076208A
CN117076208A CN202311118277.XA CN202311118277A CN117076208A CN 117076208 A CN117076208 A CN 117076208A CN 202311118277 A CN202311118277 A CN 202311118277A CN 117076208 A CN117076208 A CN 117076208A
Authority
CN
China
Prior art keywords
mcu
partition
upgrade
data
uds
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
CN202311118277.XA
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.)
Avatr Technology Chongqing Co Ltd
Original Assignee
Avatr Technology Chongqing 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 Avatr Technology Chongqing Co Ltd filed Critical Avatr Technology Chongqing Co Ltd
Priority to CN202311118277.XA priority Critical patent/CN117076208A/en
Publication of CN117076208A publication Critical patent/CN117076208A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1433Saving, restoring, recovering or retrying at system level during software upgrading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application discloses a data processing method, a device and equipment, which are applied to a Micro Control Unit (MCU), wherein a storage area of the MCU at least comprises a first partition and a second partition; upgrade data of the MCU are stored in the first partition and the second partition; comprising the following steps: under the condition that an upgrade instruction of the MCU is received, determining an operation partition of the MCU in the first partition and the second partition; determining an upgrade partition based on the run partition in the first partition and the second partition; the upgrade partition is different from the operation partition; operating the upgrade data of the MCU in the upgrade partition to upgrade the MCU to obtain an upgraded application program; and under the condition that the MCU is upgraded, writing the address identification of the upgrade partition into a first position in the MCU so that when the MCU is restarted, the upgraded application program is operated based on the indication of the address identification of the upgrade partition. The scheme does not influence the running of the MCU when upgrading the MCU, and has good compatibility.

Description

Data processing method, device and equipment
Technical Field
The present application relates to the field of data display technologies, and in particular, to a data processing method, apparatus, and device.
Background
With the continuous development of control technology, the periphery of the controller can be connected with a micro-processing unit (Micro Control Unit, MCU).
For the upgrade of the MCU, the related technical scheme comprises the following steps: and dividing a storage area in the MCU into a boot area and a program area, and rewriting an upgrade package after erasing a program in the program area during upgrade.
Thus, on one hand, the MCU cannot normally run in the upgrading process; on the other hand, the upgrade failure may cause the MCU to fail to operate.
Disclosure of Invention
In view of this, the embodiment of the application provides a data processing method, a device and equipment, and the scheme does not influence the running of the MCU when upgrading the MCU, and has good compatibility.
The technical scheme of the application is realized as follows:
the embodiment of the application provides a data processing method which is applied to a Micro Control Unit (MCU), wherein a storage area of the MCU at least comprises a first partition and a second partition; upgrade data of the MCU are stored in the first partition and the second partition; the method comprises the following steps:
under the condition that an upgrade instruction of the MCU is received, determining an operation partition of the MCU in the first partition and the second partition;
determining, in the first partition and the second partition, an upgrade partition based on the run partition; the upgrade partition is different from the run partition;
Operating the upgrade data of the MCU in the upgrade partition to upgrade the MCU to obtain an upgraded application program;
and under the condition that the MCU is upgraded, writing the address identification of the upgrade partition into a first position in the MCU so as to enable the MCU to run the upgraded application program based on the indication of the address identification of the upgrade partition when restarting.
The embodiment of the application provides a data processing method, which is applied to a controller and comprises the following steps:
transmitting a first request to upgrade the MCU based on a first service in the UDS; the first request is used for requesting to transmit upgrade data of the MCU to the MCU; so that the MCU determines format information for transmitting upgrade data of the MCU based on the first request;
receiving the format information of a second service format in the UDS sent by the MCU;
and transmitting upgrade data of the MCU to the MCU by taking the format information as a reference based on a third service in the UDS in response to the format information.
The embodiment of the application provides a data processing device which is deployed in a Micro Control Unit (MCU), wherein a storage area of the MCU at least comprises a first partition and a second partition; upgrade data of the MCU are stored in the first partition and the second partition; the device comprises:
A first determining unit, configured to determine, when an upgrade instruction of an MCU is received, an operation partition that operates the MCU in the first partition and the second partition;
a second determining unit configured to determine, in the first partition and the second partition, an upgrade partition based on the operation partition; the upgrade partition is different from the run partition;
the upgrade unit is used for operating the upgrade data of the MCU in the upgrade partition to upgrade the MCU to obtain an upgraded application program;
and the writing unit is used for writing the address identification of the upgrading partition into a first position in the MCU under the condition that the MCU is upgraded, so that when the MCU is restarted, the upgraded application program is operated based on the indication of the address identification of the upgrading partition.
An embodiment of the present application provides a data processing apparatus, where the apparatus is deployed in a controller, the apparatus includes:
a transmitting unit, configured to transmit a first request for upgrading the MCU to the MCU based on a first service in the UDS; the first request is used for requesting to transmit upgrade data of the MCU to the MCU; so that the MCU determines format information for transmitting upgrade data of the MCU based on the first request;
A receiving unit, configured to receive the format information of a second service format in the UDS sent by the MCU;
and the transmission unit is used for responding to the format information, based on a third service in the UDS, taking the format information as a reference and transmitting the upgrade data of the MCU to the MCU.
An embodiment of the present application provides an electronic device, including:
a memory for storing executable data processing instructions;
and the processor is used for realizing the data processing method provided by the embodiment of the application when executing the executable data processing instructions stored in the memory.
The electronic device may be the MCU or the controller.
An embodiment of the present application provides a computer-readable storage medium having stored therein computer-executable instructions configured to perform the above-described data processing method.
The embodiment of the application provides a data processing method, a device, equipment and a computer readable storage medium, which are applied to a Micro Control Unit (MCU), wherein a storage area of the MCU at least comprises a first partition and a second partition; upgrade data of the MCU are stored in the first partition and the second partition; the method comprises the following steps: under the condition that an upgrade instruction of the MCU is received, determining an operation partition of the MCU in the first partition and the second partition; determining, in the first partition and the second partition, an upgrade partition based on the run partition; the upgrade partition is different from the run partition; operating the upgrade data of the MCU in the upgrade partition to upgrade the MCU to obtain an upgraded application program; and under the condition that the MCU is upgraded, writing the address identification of the upgrade partition into a first position in the MCU so as to enable the MCU to run the upgraded application program based on the indication of the address identification of the upgrade partition when restarting.
According to the technical scheme, firstly, upgrade data of the MCU are stored in the first partition and the second partition in advance, then upgrade instructions of the MCU are received, firstly, an operation partition is determined in the first partition and the second partition, then a non-operation partition is determined as an upgrade partition, upgrade data in the upgrade partition is operated, the MCU is upgraded, finally, under the condition that the MCU upgrade is completed, address identification of the upgrade partition is written into a first position in the MCU, so that when the MCU is restarted, an application program after upgrade is operated based on indication of the address identification of the upgrade partition. On one hand, the operation partition and the upgrading partition are treated differently, so that the mutual influence of operation and upgrading is realized; when the MCU is upgraded, the running of the MCU is not affected, and the compatibility is good. On the other hand, even if the MCU fails to upgrade, the original program still can run based on the original edition when restarting because the original program exists in the running partition, the running and the use of the MCU are not affected, and the reliability is higher.
Drawings
FIG. 1 is a schematic diagram of a data processing system according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of a data processing method according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating another data processing method according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating another data processing method according to an embodiment of the present application;
FIG. 5 is a flowchart illustrating another data processing method according to an embodiment of the present application;
FIG. 6 is a flowchart illustrating another data processing method according to an embodiment of the present application;
FIG. 7 is a flowchart of another data processing method according to an embodiment of the present application;
fig. 8 is a schematic flow chart of another vehicle data transmission process according to an embodiment of the present application;
FIG. 9 is a schematic diagram of a data processing apparatus according to an embodiment of the present application;
FIG. 10 is a schematic diagram of a data processing apparatus according to another embodiment of the present application;
fig. 11 is a schematic diagram of a composition structure of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application.
The present application will be further described with reference to the accompanying drawings, in order to make the objects, technical solutions and advantages of the present application more apparent, and the described embodiments should not be construed as limiting the present application, and all other embodiments obtained by those skilled in the art without making any inventive effort are within the scope of the present application.
In the following description, reference is made to "some embodiments\other embodiments" which describe a subset of all possible embodiments, but it is to be understood that "some embodiments\other embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with each other without conflict.
In the following description, the terms "first\second\third\fourth\fifth" are merely distinguishing between similar objects and not representing a particular ordering of the objects, it being understood that the "first\second\third\fourth\fifth" may, where permitted, be interchanged in a particular order or precedence, so that embodiments of the application described herein can be practiced in an order other than that illustrated or described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the application only and is not intended to be limiting of the application.
The following describes a data processing system provided in an embodiment of the present application.
Referring to what is shown in FIG. 1, data processing system 100 includes a controller 101 and an MCU102. Wherein communication may be between controller 101 and MCU102.
In one possible implementation, the controller 101 is configured to perform: transmitting a first request to upgrade the MCU based on a first service in the UDS; the first request is used for requesting to transmit upgrade data of the MCU to the MCU; so that the MCU determines format information for transmitting upgrade data of the MCU based on the first request; receiving the format information of a second service format in the UDS sent by the MCU; and transmitting upgrade data of the MCU to the MCU by taking the format information as a reference based on a third service in the UDS in response to the format information.
The controller 101 is an electronic device with associated data processing capabilities. By way of example, the controller 101 may be a System on a Chip (SOC).
In one possible implementation, MCU102 is configured to perform: under the condition that an upgrade instruction of the MCU is received, determining an operation partition of the MCU in the first partition and the second partition; determining, in the first partition and the second partition, an upgrade partition based on the run partition; the upgrade partition is different from the run partition; operating the upgrade data of the MCU in the upgrade partition to upgrade the MCU to obtain an upgraded application program; and under the condition that the MCU is upgraded, writing the address identification of the upgrade partition into a first position in the MCU so as to enable the MCU to run the upgraded application program based on the indication of the address identification of the upgrade partition when restarting.
MCU102 may be an electronic device or chip or the like with associated data processing capabilities.
In one possible implementation, the data processing method may be used to upgrade the MCU in TBOX, and the MCU102 is a microprocessor in TBOX.
The following describes a data processing method, device, equipment and storage medium provided in the embodiments of the present application.
In a first aspect, an embodiment of the present application provides a data processing method, where the method is applied to a MCU, and a storage area of the MCU includes at least a first partition and a second partition; upgrade data of the MCU are stored in the first partition and the second partition.
In some embodiments, the memory area of the MCU includes a boot area, a first partition, and a second partition.
The embodiment of the application does not limit the size and the address of each partition in the MCU.
As shown in fig. 2, the data processing method at the MCU side provided by the embodiment of the present application may include the following steps:
s201, under the condition that an upgrade instruction of the MCU is received, determining an operation partition of the MCU in the first partition and the second partition.
Wherein the first partition and the second partition are pre-partitioned.
In some embodiments, the MCU detects the currently running partition first upon receiving an upgrade instruction. For example, when the MCU is operating in the first partition, the operating partition is determined to be the first partition. In this way, the second partition may also be a backup partition.
S202, in the first partition and the second partition, determining an upgrade partition based on the operation partition.
The upgrade partition is different from the run partition.
In some embodiments, the upgrade partition is a partition of the first partition and the second partition that is different from the run partition. For example, in the case where the first partition is a run partition, the upgrade partition is determined to be the second partition.
Thus, the upgrade partition is determined by the MCU, but not based on the address information sent by the controller, and has the characteristics of simple, reliable and flexible realization.
And S203, running the upgrade data of the MCU in the upgrade partition to upgrade the MCU, so as to obtain an upgraded application program.
In some embodiments, upgrade data of the MCU is run to perform an upgrade process in the upgrade partition, resulting in an upgraded application.
S204, under the condition that the MCU upgrading is completed, writing the address identification of the upgrading partition into a first position in the MCU so that when the MCU is restarted, running the upgraded application program based on the indication of the address identification of the upgrading partition.
And the first position is used for writing the address of the running MCU. The embodiment of the application does not limit the first position specifically, and can be configured according to actual conditions. The first location may be configured as a suitable location in a charged erasable programmable read-only memory (Electrically Erasable Programmable read only memory, EEPROM), for example. Because the EEPROM is a memory chip which is not lost after power failure, the data cannot be lost when restarting, and the reliability of writing can be ensured.
In some embodiments, the MCU may detect the progress in the upgrade process, and if it is detected that the upgrade of the MCU is completed, write the address identifier of the upgrade partition to the first location in the MCU. Therefore, when the MCU is restarted, the application program under the address can be called based on the indication of the address identification of the upgrade partition, so that the application program after the upgrade is operated.
The embodiment of the application provides a data processing method of an MCU side, wherein a storage area of the MCU at least comprises a first partition and a second partition; upgrade data of the MCU are stored in the first partition and the second partition; the method comprises the following steps: under the condition that an upgrade instruction of the MCU is received, determining an operation partition of the MCU in the first partition and the second partition; determining, in the first partition and the second partition, an upgrade partition based on the run partition; the upgrade partition is different from the run partition; operating the upgrade data of the MCU in the upgrade partition to upgrade the MCU to obtain an upgraded application program; and under the condition that the MCU is upgraded, writing the address identification of the upgrade partition into a first position in the MCU so as to enable the MCU to run the upgraded application program based on the indication of the address identification of the upgrade partition when restarting.
According to the technical scheme, firstly, upgrade data of the MCU are stored in the first partition and the second partition in advance, then upgrade instructions of the MCU are received, firstly, an operation partition is determined in the first partition and the second partition, then a non-operation partition is determined as an upgrade partition, upgrade data in the upgrade partition is operated, the MCU is upgraded, finally, under the condition that the MCU upgrade is completed, address identification of the upgrade partition is written into a first position in the MCU, so that when the MCU is restarted, an application program after upgrade is operated based on indication of the address identification of the upgrade partition. On one hand, the operation partition and the upgrading partition are treated differently, so that the mutual influence of operation and upgrading is realized; when the MCU is upgraded, the running of the MCU is not affected, and the compatibility is good. On the other hand, even if the MCU fails to upgrade, the original program still can run based on the original edition when restarting because the original program exists in the running partition, the running and the use of the MCU are not affected, and the reliability is higher.
In some embodiments of the present application, the data of the MCU may be written to the first partition and the second partition in advance. Next, this process will be described.
Referring to what is shown in fig. 3, the process may include the steps of:
S205, under the condition that an upgrade instruction of the MCU is received, upgrade data of the MCU sent by the controller is obtained through a first interface.
The first interface includes a serial peripheral interface (Serial Peripheral Interface, SPI) or a controller area network (Controller Area Network, CAN) interface.
When the first interface is a CAN interface, data is received based on a CAN protocol, and the amount of data transmitted by the protocol is small, so that each data block needs to be packed, and the data cannot directly reach an application layer;
when the first interface is an SPI interface, data is received through an SPI protocol, the SPI protocol has the characteristic of large data transmission quantity, and the data can directly reach an application layer without grouping packets.
S206, storing the upgrade data of the MCU to the first partition and the second partition.
In some embodiments, the running partition of the MCU receives and stores the upgrade data of the MCU, and then backs up the upgrade data of the MCU to another partition. Thereby realizing the storage of the upgrade data of the MCU to the first partition and the second partition.
Next, a procedure for acquiring upgrade data of the MCU transmitted from the controller through the first interface in S205 will be described.
In some embodiments, upgrade data of the MCU sent by the controller is obtained through the first interface based on a unified diagnostic service UDS.
The UDS is provided with various service standards, and upgrade data is acquired based on the UDS, so that the method has the characteristics of high universality and good compatibility.
In other embodiments, upgrade data of the MCU sent by the controller is obtained through the first interface based on a custom SPI protocol.
Next, a process of acquiring upgrade data of the MCU transmitted by the controller through the first interface based on the unified diagnostic service UDS will be described.
Referring to what is shown in fig. 4, the process may include the steps of:
s401, receiving a first request in a first service format in the UDS.
The first request is for requesting transmission of upgrade data of the MCU.
In some embodiments, the first service is a 34 service in the UDS. The specific data format of the 34 service may be referred to the description in UDS.
S402, in response to the first request, format information of upgrade data of the MCU is sent to the controller based on a second service in the UDS, so that the controller can transmit the upgrade data of the MCU to the MCU based on the format information.
In some embodiments, the second service in the UDS is that ox74 is responding.
Format information for defining an upgrade data transmission format of the MCU. In particular on the controller side.
S403, based on the format information, receiving upgrade data of the MCU in a third service format in the UDS sent by the controller.
In some embodiments, the third service in the UDS is a 36 service. The specific data format of the 36 services may be referred to the description in UDS.
Therefore, the standardization of the upgrade data transmission of the MCU is realized through the first service, the second service and the third service in the UDS, and each service in the UDS has the characteristics of simplicity, convenience, safety and reliability. Also, here, services in UDS are introduced, but not the entire diagnostic procedure, i.e. the following procedure: entering a session mode, carrying out security authentication, closing recording DTC, closing sending and receiving application messages, carrying out condition checking and the like, namely simplifying the flow.
Further, referring to the contents shown in fig. 5, after receiving upgrade data of the MCU in a third service format in the UDS transmitted by the controller based on the format information, the data processing method may further include the following S404 to S406.
S404, receiving first indication information of a fourth service format in the UDS.
The first indication information is used for indicating that the upgrade data of the MCU is sent completely.
In some embodiments, the fourth service in the UDS is that ox77 is responding. The specific data format in which ox77 is responding may be referred to the description in UDS.
S405, responding to the first indication information, and checking the upgrade data of the MCU to obtain a checking result.
The verification method is not particularly limited, and may be configured according to actual requirements.
S406, feeding back the verification result to the controller based on the fourth service format.
Therefore, the verification result is fed back to the controller based on the standard service in the UDS, so that the reliability of data transmission is improved, and the method has the characteristics of high uniformity, simplicity and convenience.
In a second aspect, an embodiment of the present application provides a data processing method, where the method is applied to a controller.
As shown in fig. 6, the data processing method at the controller side provided by the embodiment of the present application may include the following steps:
s601, sending a first request for upgrading the MCU to the MCU based on a first service in the UDS; the first request is used for requesting to transmit upgrade data of the MCU to the MCU; so that the MCU determines format information for transmitting upgrade data of the MCU based on the first request.
In some embodiments, the first service is a 34 service in the UDS. The specific data format of the 34 service may be referred to the description in UDS.
S602, receiving the format information of a second service format in the UDS sent by the MCU.
In some embodiments, the fourth service in the UDS is that ox77 is responding. The specific data format in which ox77 is responding may be referred to the description in UDS. The second service format may be a 34 service format.
S603, responding to the format information, and transmitting upgrade data of the MCU to the MCU based on a third service in the UDS by taking the format information as a reference.
In some embodiments, the third service in the UDS is a 36 service. The specific data format of the 36 services may be referred to the description in UDS.
The embodiment of the application provides a data processing method of a controller side, which comprises the following steps: transmitting a first request to upgrade the MCU based on a first service in the UDS; the first request is used for requesting to transmit upgrade data of the MCU to the MCU; so that the MCU determines format information for transmitting upgrade data of the MCU based on the first request; receiving the format information of a second service format in the UDS sent by the MCU; and transmitting upgrade data of the MCU to the MCU by taking the format information as a reference based on a third service in the UDS in response to the format information.
By adopting the technical scheme, the standardization of the upgrade data transmission of the MCU is realized through the first service, the second service and the third service in the UDS, and each service in the UDS has the characteristics of simplicity, convenience, safety and reliability. Also, here, services in UDS are introduced, but not the entire diagnostic procedure, i.e. the following procedure: entering a session mode, carrying out security authentication, closing recording DTC, closing sending and receiving application messages, carrying out condition checking and the like, namely simplifying the flow.
Next, a process of transmitting upgrade data of the MCU to the MCU with reference to the format information in S603 will be described.
Referring to the content shown in fig. 7, in case that the format information includes a start address, a total size of transmission data, and a size of one data block in the transmission data, the process may include the steps of:
the transmission data may include a plurality of data blocks arranged in sequence, a start address is used to point to a start position of a first data block, a total size of the transmission data is used to represent a total size of all data blocks in one transmission, and a size of one data block refers to a data size of one data block.
S6031, determining the total size of the upgrade data of the MCU and the starting address in the upgrade data of the MCU.
The total size of the upgrade data of the MCU, and the start address in the upgrade data of the MCU are not limited herein according to the actual configuration.
S6032, splitting the upgrade data of the MCU according to the size of the data block in sequence based on the total size of the upgrade data of the MCU and the initial address in the upgrade data of the MCU to obtain N target data blocks.
And N is an integer greater than zero.
The value of N is related to the total size of the upgrade data of the MCU and the size of one data block.
And S6033, sequentially transmitting the N target data blocks to the MCU.
The transmission sequence of the N target data blocks is the left rear sequence of each data block obtained by dividing the MCU upgrade data.
And S6034, transmitting first indication information to the MCU based on a fourth service in the UDS under the condition that the upgrade data transmission of the MCU is completed.
The first indication information is used for indicating that the upgrade data of the MCU is sent completely.
It can be seen that the specific format information is configured, so that accurate data transmission can be realized, and the safety in the data transmission process is improved.
Next, an implementation process of the application embodiment in an actual application scenario is described.
This embodiment provides a UDS diagnostic upgrade method based on SPI.
The SPI is mainly used for communication between the microcontroller and peripheral equipment and between the microcontroller and the microcontroller, and has the characteristics of simple circuit implementation, fewer bus pins, higher transmission rate and the like, is widely applied in the communication field, and is a standardized standard of diagnosis service, namely ISO14229, which is Unified Diagnostic Services, and each service function, service format, positive response code, negative response code and the like of the UDS are defined in the ISO14229 protocol.
For the SOC upgrading MCU scheme in the related technology, the SPI custom protocol is generally adopted for upgrading, the defects still exist in the using process, the upgrading information safety is not high, the communication between data is not a standard interface, the mutual portability is poor, and the like.
This embodiment performs transmission of MCU upgrade data based on UDS.
The upgrading process comprises the following steps: the MCU mainly divides FLASH (corresponding to the storage area of the MCU) into a boot area and an AB partition (corresponding to the first partition and the second partition), after the system is operated, the system firstly enters the boot area, the partition (corresponding to the operation partition) needing to operate the APP is mainly judged, codes (corresponding to the upgrade data) in the AB area are identical, only corresponding addresses are different, when an SOC upgrade instruction is received, the data is written into a backup partition according to the partition currently operated, after the upgrade is completed, the corresponding upgrade area address mark is written into the EEPROM (corresponding to the first position) for storage, the equipment is restarted, and the operation is switched to a new APP area based on the upgrade area address mark (corresponding to the upgrade partition address mark).
Referring to fig. 8, a description will be given of a transmission process of upgrade data at the SOC end and the MCU end. Referring to what is shown in fig. 8, the process may include the steps of:
s801, the SOC end sends an MCU upgrading request to the MCU end based on 34 service, and the request is for downloading data.
The 34 service corresponds to the first service described above.
S802, the MCU end feeds back 34 service results to the SOC end through the forward response of the ox74, wherein the feedback comprises a starting address of data transmission, a data file size and a maximum block size of each transmission.
The ox74 is responding to the second service described above.
For example, data may also be designated for transmission with 36 services.
The start address of the transmission data, the data file size, and the maximum block size of each transmission correspond to the format information.
S803, the SOC transmits data to the MCU terminal based on the 36 service.
The 36-service corresponds to the third service described above.
S804, the MCU side feeds back 36 service results including response data block serial numbers to the SOC side through the forward response of the ox 76.
The ox76 is responding to the fourth service described above.
And S805, when the data transmission is completed, the SOC end sends 37 a service request to the MCU end for exiting.
S806, the MCU side feeds back 37 service results to the SOC side through the positive response of the ox77, and the method comprises the following steps: upgrading the verification state, wherein 0 is successful; 1 fails.
S807, the SOC end sends 11 services to the MCU end to restart the equipment.
S808, the MCU side feeds back 11 service results to the SOC side through the positive response of the ox 51.
This embodiment has the following technical effects:
firstly, for the uds protocol upgrading scheme of the CAN layer, firstly, disassembling the packet for processing, and when uds protocol is upgraded, because the data transmission quantity in the CAN protocol is small, the data CAN firstly be packetized at the CANTP layer to reach the application layer for data refreshing, and the data transmission time is long and the packet error probability is high; for the update scheme of the uds protocol of the Ethernet type, because the data transmission amount in the Ethernet protocol (SPI protocol) is large, the update data can be directly transmitted to an application layer through the SPI protocol to carry out data refreshing, so that the data transmission time and the packet error probability are reduced.
Secondly, for the process of requesting to download the upgrade data, the uds protocol upgrade scheme of the CAN layer needs to issue upgrade addresses to the MCU to sequentially determine which area of data is upgraded; for the uds protocol upgrading scheme of the Ethernet type, the MCU can upgrade based on another partition according to the partition where the MCU operates, and it can be seen that the uds protocol upgrading scheme of the Ethernet type does not need to issue an upgrading address to the MCU, so that the use is more flexible and convenient.
Third, for the uds protocol upgrade scheme of the CAN layer, the upgrade process at least includes: the process is simplified for the uds protocol upgrading scheme of the Ethernet type, namely, the process of entering the session mode, carrying out security authentication, closing the recording DTC, closing the sending and receiving application messages and the like.
The application also provides a data processing device which is deployed on the MCU, wherein a storage area of the MCU at least comprises a first partition and a second partition; upgrade data of the MCU are stored in the first partition and the second partition; fig. 9 is a schematic diagram of a composition structure of a data processing apparatus according to an embodiment of the present application, and as shown in fig. 9, a data processing apparatus 900 includes:
a first determining unit 901, configured to determine, when an upgrade instruction of an MCU is received, an operation partition that operates the MCU in the first partition and the second partition;
a second determining unit 902, configured to determine, in the first partition and the second partition, an upgrade partition based on the running partition; the upgrade partition is different from the run partition;
An upgrade unit 903, configured to run upgrade data of the MCU in the upgrade partition to upgrade the MCU, so as to obtain an upgraded application program;
and the writing unit 904 is configured to write, in the case where the upgrade of the MCU is completed, an address identifier of the upgrade partition to a first location in the MCU, so that when the MCU is restarted, the upgraded application program is operated based on an indication of the address identifier of the upgrade partition.
In some embodiments, the data processing apparatus 900 further comprises a data transmission unit for: under the condition that an upgrade instruction of the MCU is received, upgrade data of the MCU sent by a controller is obtained through a first interface; the first interface comprises a serial peripheral interface SPI or a controller area network CAN interface; and storing the upgrade data of the MCU to the first partition and the second partition.
In some embodiments, the data transmission unit is further configured to: based on unified diagnostic service UDS, upgrade data of the MCU sent by the controller are obtained through the first interface.
In some embodiments, the data transmission unit is further configured to: receiving a first request in a first service format in the UDS; the first request is used for requesting to transmit upgrade data of the MCU; transmitting format information of upgrade data of the MCU to the controller based on a second service in the UDS in response to the first request, so that the controller transmits the upgrade data of the MCU to the MCU based on the format information; and receiving upgrade data of the MCU in a third service format in the UDS sent by the controller based on the format information.
In some implementations, the data transmission unit is further configured to, after receiving upgrade data of the MCU in a third service format in the UDS sent by the controller based on the format information, perform:
receiving first indication information of a fourth service format in the UDS; the first indication information is used for indicating that the upgrade data of the MCU is sent completely; responding to the first indication information, and checking the upgrade data of the MCU to obtain a checking result; and feeding back the verification result to the controller based on the fourth service format.
The present application further provides a data processing device, where the device is disposed in a controller, fig. 10 is a schematic diagram of a composition structure of the data processing device provided in the embodiment of the present application, as shown in fig. 10, and a data processing device 1000 includes:
a sending unit 1001, configured to send, to an MCU, a first request to upgrade the MCU based on a first service in a UDS; the first request is used for requesting to transmit upgrade data of the MCU to the MCU; so that the MCU determines format information for transmitting upgrade data of the MCU based on the first request;
a receiving unit 1002, configured to receive the format information of a second service format in the UDS sent by the MCU;
And a transmission unit 1003, configured to transmit upgrade data of the MCU to the MCU with the format information as a reference based on a third service in the UDS in response to the format information.
In some embodiments, in case the format information includes a start address, a total size of transmission data, and a size of one data block in the transmission data, the transmission unit 1003 is further configured to:
determining the total size of the upgrade data of the MCU and the starting address in the upgrade data of the MCU; based on the total size of the upgrade data of the MCU and the initial address in the upgrade data of the MCU, sequentially splitting the upgrade data of the MCU according to the size of the data block to obtain N target data blocks; the N is an integer greater than zero; sequentially sending the N target data blocks to the MCU; transmitting first indication information to the MCU based on a fourth service in the UDS under the condition that the upgrade data transmission of the MCU is completed; the first indication information is used for indicating that the upgrade data of the MCU is sent completely.
It should be noted that, the description of the data processing apparatus in the embodiment of the present application is similar to the description of the embodiment of the method described above, and has similar beneficial effects as the embodiment of the method, so that a detailed description is omitted. For technical details not disclosed in the present apparatus embodiment, please refer to the description of the method embodiment of the present application for understanding.
It should be noted that, in the embodiment of the present application, if the above-mentioned data processing method is implemented in the form of a software functional module, and sold or used as a separate product, the data processing method may also be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be embodied essentially or in a part contributing to the related solutions in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a magnetic disk, an optical disk, or other various media capable of storing program codes. Thus, embodiments of the application are not limited to any specific combination of hardware and software.
Accordingly, an embodiment of the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the data processing method provided in the above embodiment.
The embodiment of the application also provides electronic equipment. Fig. 11 is a schematic diagram of a composition structure of an electronic device according to an embodiment of the present application, as shown in fig. 11, an electronic device 1100 includes: memory 1101, processor 1102, communication interface 1103 and communication bus 1104. Wherein the memory 1101 is configured to store executable data processing instructions; the processor 1102 is configured to implement the data processing method provided in the above embodiment when executing the executable data processing instructions stored in the memory.
The electronic device may be the controller or the MCU described above, for example.
The description of the electronic device and the storage medium embodiments above is similar to that of the method embodiments described above, with similar advantageous effects as the method embodiments. For the data processing of the present application. Technical details not disclosed in the apparatus and storage medium embodiments are understood with reference to the description of the method embodiments of the present application.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising at least one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above described device embodiments are only illustrative, e.g. the division of units is only one logical function division, and there may be other divisions in actual implementation, such as: multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. In addition, the various components shown or discussed may be coupled or directly coupled or communicatively coupled to each other via some interface, whether indirectly coupled or communicatively coupled to devices or units, whether electrically, mechanically, or otherwise.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units; can be located in one place or distributed to a plurality of network units; some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may be separately used as one unit, or two or more units may be integrated in one unit; the integrated units may be implemented in hardware or in hardware plus software functional units.
One of ordinary skill in the art will appreciate that: all or part of the steps for implementing the above method embodiments may be implemented by hardware related to program instructions, and the foregoing program may be stored in a computer readable storage medium, where the program, when executed, performs steps including the above method embodiments; and the aforementioned storage medium includes: various media capable of storing program codes, such as a removable storage device, a ROM, a magnetic disk, or an optical disk.
Alternatively, the above-described integrated units of the present application may be stored in a computer-readable storage medium if implemented in the form of software functional modules and sold or used as separate products. Based on such understanding, the technical solutions of the embodiments of the present application may be embodied essentially or in part contributing to the prior art in the form of a software product stored in a storage medium, comprising several instructions for causing a product to perform all or part of the methods of the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a removable storage device, a ROM, a magnetic disk, or an optical disk.
The foregoing is merely illustrative embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art will readily appreciate variations or substitutions within the scope of the present application. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (10)

1. The data processing method is characterized in that the method is applied to a micro control unit MCU, and a storage area of the MCU at least comprises a first partition and a second partition; upgrade data of the MCU are stored in the first partition and the second partition; the method comprises the following steps:
under the condition that an upgrade instruction of the MCU is received, determining an operation partition of the MCU in the first partition and the second partition;
determining, in the first partition and the second partition, an upgrade partition based on the run partition; the upgrade partition is different from the run partition;
operating the upgrade data of the MCU in the upgrade partition to upgrade the MCU to obtain an upgraded application program;
and under the condition that the MCU is upgraded, writing the address identification of the upgrade partition into a first position in the MCU so as to enable the MCU to run the upgraded application program based on the indication of the address identification of the upgrade partition when restarting.
2. The method according to claim 1, wherein the method further comprises:
under the condition that an upgrade instruction of the MCU is received, upgrade data of the MCU sent by a controller is obtained through a first interface; the first interface comprises a serial peripheral interface SPI or a controller area network CAN interface;
and storing the upgrade data of the MCU to the first partition and the second partition.
3. The method according to claim 2, wherein the receiving, through the first interface, upgrade data of the MCU transmitted by the controller, includes:
based on unified diagnostic service UDS, upgrade data of the MCU sent by the controller are obtained through the first interface.
4. A method according to claim 3, wherein the obtaining, based on a unified diagnostic service UDS, upgrade data of the MCU sent by the controller through the first interface comprises:
receiving a first request in a first service format in the UDS; the first request is used for requesting to transmit upgrade data of the MCU;
transmitting format information of upgrade data of the MCU to the controller based on a second service in the UDS in response to the first request, so that the controller transmits the upgrade data of the MCU to the MCU based on the format information;
And receiving upgrade data of the MCU in a third service format in the UDS sent by the controller based on the format information.
5. The method of claim 4, wherein after receiving upgrade data of the MCU in a third service format in the UDS transmitted by the controller based on the format information, the method further comprises:
receiving first indication information of a fourth service format in the UDS; the first indication information is used for indicating that the upgrade data of the MCU is sent completely;
responding to the first indication information, and checking the upgrade data of the MCU to obtain a checking result;
and feeding back the verification result to the controller based on the fourth service format.
6. A method of data processing, the method being applied to a controller, the method comprising:
transmitting a first request to upgrade the MCU based on a first service in the UDS; the first request is used for requesting to transmit upgrade data of the MCU to the MCU; so that the MCU determines format information for transmitting upgrade data of the MCU based on the first request;
receiving the format information of a second service format in the UDS sent by the MCU;
And transmitting upgrade data of the MCU to the MCU by taking the format information as a reference based on a third service in the UDS in response to the format information.
7. The method according to claim 6, wherein, in the case that the format information includes a start address, a total size of transmission data, and a size of one data block in the transmission data, the transmitting the upgrade data of the MCU to the MCU with the format information as a reference includes:
determining the total size of the upgrade data of the MCU and the starting address in the upgrade data of the MCU;
based on the total size of the upgrade data of the MCU and the initial address in the upgrade data of the MCU, sequentially splitting the upgrade data of the MCU according to the size of the data block to obtain N target data blocks; the N is an integer greater than zero;
sequentially sending the N target data blocks to the MCU;
transmitting first indication information to the MCU based on a fourth service in the UDS under the condition that the upgrade data transmission of the MCU is completed; the first indication information is used for indicating that the upgrade data of the MCU is sent completely.
8. The data processing device is characterized in that the device is deployed on a Micro Control Unit (MCU), and a storage area of the MCU at least comprises a first partition and a second partition; upgrade data of the MCU are stored in the first partition and the second partition; the device comprises:
A first determining unit, configured to determine, when an upgrade instruction of an MCU is received, an operation partition that operates the MCU in the first partition and the second partition;
a second determining unit configured to determine, in the first partition and the second partition, an upgrade partition based on the operation partition; the upgrade partition is different from the run partition;
the upgrade unit is used for operating the upgrade data of the MCU in the upgrade partition to upgrade the MCU to obtain an upgraded application program;
and the writing unit is used for writing the address identification of the upgrading partition into a first position in the MCU under the condition that the MCU is upgraded, so that when the MCU is restarted, the upgraded application program is operated based on the indication of the address identification of the upgrading partition.
9. A data processing apparatus, the apparatus being deployed at a controller, the apparatus comprising:
a transmitting unit, configured to transmit a first request for upgrading the MCU to the MCU based on a first service in the UDS; the first request is used for requesting to transmit upgrade data of the MCU to the MCU; so that the MCU determines format information for transmitting upgrade data of the MCU based on the first request;
A receiving unit, configured to receive the format information of a second service format in the UDS sent by the MCU;
and the transmission unit is used for responding to the format information, based on a third service in the UDS, taking the format information as a reference and transmitting the upgrade data of the MCU to the MCU.
10. An electronic device comprising a memory and a processor, the memory having stored thereon a computer program which, when executed by the processor, implements the data processing method of any of claims 1 to 7.
CN202311118277.XA 2023-08-31 2023-08-31 Data processing method, device and equipment Pending CN117076208A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311118277.XA CN117076208A (en) 2023-08-31 2023-08-31 Data processing method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311118277.XA CN117076208A (en) 2023-08-31 2023-08-31 Data processing method, device and equipment

Publications (1)

Publication Number Publication Date
CN117076208A true CN117076208A (en) 2023-11-17

Family

ID=88702223

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311118277.XA Pending CN117076208A (en) 2023-08-31 2023-08-31 Data processing method, device and equipment

Country Status (1)

Country Link
CN (1) CN117076208A (en)

Similar Documents

Publication Publication Date Title
US10437680B2 (en) Relay apparatus, relay method, and computer program product
CN110178114B (en) Vehicle control device and program update system
US20190057214A1 (en) Update control device, terminal, and method of controlling
US20170192770A1 (en) Gateway device, in-vehicle network system, and firmware update method
US8539471B2 (en) Updating firmware of an electronic device
US9372682B2 (en) Parallel programming and updating of lighting bus subscribers
US11914987B2 (en) Master update agent and distributed update agent architecture for vehicles
CN108509215B (en) System software replacing method and device, terminal equipment and storage medium
CN111813428A (en) Method and device for upgrading terminal firmware, electronic equipment and storage medium
CN112947977B (en) Online software upgrading method and system
JP2023090981A (en) Gateway device, on-vehicle network system and firmware update method
WO2011088701A1 (en) Method and device for online upgrading cross-platform version
CN113094072A (en) Vehicle upgrading method and device, electronic device and storage medium
EP2685374B1 (en) Wireless network access terminal and running method thereof
CN113238774A (en) Vehicle-mounted greeting animation updating method and device, vehicle-mounted terminal and storage medium
CN112416411B (en) Upgrading method and device, equipment end, server and computer readable medium
CN105045671A (en) Method and device for upgrading systems of intelligent terminals
CN114567552A (en) Vehicle-mounted V2X equipment upgrading method and device, computer equipment and storage medium
CN110147246A (en) Version checking method and device, storage medium and the terminal of space download technology
CN113939802A (en) Vehicle control device, update program, program update system, and write device
CN117076208A (en) Data processing method, device and equipment
CN110704076A (en) Data processing method and device, vehicle-mounted controller and computer-readable storage medium
US20230107783A1 (en) In-vehicle information processing apparatus, information processing method, and server program
CN114546455A (en) MCU software upgrading method and device for double partitions
CN113885907A (en) Firmware upgrading system and method

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