Electronic control unit flashing method, device, system, equipment and storage medium
By employing Time-Sensitive Ethernet and IEEE protocols for clock synchronization and time slot allocation in the automotive network topology, the problems of underutilization of backbone bandwidth and data transmission failures are solved, enabling efficient and accurate electronic control unit (ECU) flashing.
Patent Information
- Application Number
- CN202110998168.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-27
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2041-08-27
AI Technical Summary
In automotive network topology architecture, when using over-the-air (OTA) download technology to flash multiple electronic control units in the vehicle, the backbone network bandwidth is not fully utilized, resulting in low flashing efficiency, data transmission is prone to collisions and frame drops, leading to flashing failures and increasing software complexity.
Time-Sensitive Ethernet is used as the backbone network, and clock synchronization and time slot allocation are performed through IEEE 802.1AS and IEEE 802.1QBV protocols to ensure that request and response messages are transmitted in an orderly manner within the corresponding receive and transmit time slots of the electronic control unit, avoiding data collisions and frame loss.
It improves the success rate of electronic control unit flashing, makes full use of backbone network bandwidth, reduces software complexity, shortens flashing time, and ensures transmission accuracy and efficiency.
Smart Images

Figure CN115733849B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of automobiles, and particularly relates to a method, device, system and equipment for writing electronic control unit and a storage medium. BACKGROUND
[0002] At present, vehicle-mounted Ethernet is widely applied in the field of automobiles, and the network topology architecture of automobiles gradually becomes Ethernet as the backbone network, and a plurality of function domain controllers form subnets, wherein the traditional Controller Area Network (CAN) or Local Interconnect Network (LIN) bus is still used in the function domain controllers, and the high-performance Ethernet is used to connect different function domain controllers, and data exchange is realized through the Ethernet gateway.
[0003] Based on the network topology architecture, when Over The Air (OTA) technology is used to write a plurality of Electronic Control Units (ECUs) in the vehicle, the bandwidth of the backbone network is not fully utilized, and the writing efficiency is low. In addition, when the data of each domain controller is transmitted on the backbone network, data collision and frame loss may occur, which easily leads to ECU writing failure, and also increases the software complexity of the writing client. SUMMARY
[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a method, device, system, equipment and storage medium for writing electronic control unit, which can fully utilize the bandwidth of the backbone network, improve the writing efficiency and improve the success rate of ECU writing.
[0005] In a first aspect, the present disclosure provides a method for writing electronic control unit, comprising:
[0006] obtaining a request message to be processed, the request message comprising an identifier of a target domain and an identifier of an electronic control unit to be written;
[0007] at a starting moment of a receiving time slot corresponding to the electronic control unit, sending the request message to the electronic control unit through the target domain according to the identifier of the target domain and the identifier of the electronic control unit;
[0008] at a starting moment of a sending time slot corresponding to the electronic control unit, receiving a response message generated by the electronic control unit according to the request message through the target domain.
[0009] In a second aspect, the present disclosure provides a device for writing electronic control unit, comprising:
[0010] An obtaining module is configured to obtain a request message to be processed, the request message comprising an identifier of a target domain and an identifier of an electronic control unit to be programmed;
[0011] A sending module is configured to send the request message to the electronic control unit through the target domain at a starting moment of a receiving time slot corresponding to the electronic control unit according to the identifier of the target domain and the identifier of the electronic control unit to be programmed.
[0012] A receiving module is configured to receive a response message generated by the electronic control unit according to the request message through the target domain at a starting moment of a sending time slot corresponding to the electronic control unit.
[0013] In a third aspect, an embodiment of the present disclosure provides a programming system of an electronic control unit, the system comprising an upgrade management module, one or more target domains and one or more electronic control units; the upgrade management module is connected with the one or more target domains; the target domain is connected with the one or more electronic control units.
[0014] The upgrade management module is configured to execute the programming method of the electronic control unit as described above.
[0015] In a fourth aspect, an embodiment of the present disclosure provides an electronic device, comprising:
[0016] a memory;
[0017] a processor; and
[0018] a computer program;
[0019] The computer program is stored in the memory and is configured to be executed by the processor to implement the programming method of the electronic control unit as described above.
[0020] In a fifth aspect, an embodiment of the present disclosure provides a computer readable storage medium, which stores a computer program, the computer program being executed by a processor to implement the steps of the programming method of the electronic control unit as described above.
[0021] The method, device, system, equipment and storage medium for flashing an electronic control unit provided by the embodiments of the present disclosure, the flashing method comprises: obtaining a request message to be processed, wherein the request message comprises an identifier of a target domain and an identifier of an electronic control unit; reading the identifier of the target domain and the identifier of the electronic control unit in the request message at the start time of a receiving time slot corresponding to the electronic control unit; sending the request message to the electronic control unit through the target domain; and returning a response message generated by the electronic control unit according to the request message to an upgrade management module through the target domain at the start time of a sending time slot corresponding to the electronic control unit. The present disclosure can orderly transmit the request message or the response message, effectively avoids the problems of data collision and frame loss in the transmission process of a large amount of data, increases the success rate of flashing, and further reduces the software complexity of the flashing client. In addition, the present disclosure makes full use of the bandwidth of the backbone network, ensures the accuracy of the transmitted data, and further improves the flashing efficiency and shortens the flashing time. BRIEF DESCRIPTION OF DRAWINGS
[0022] The accompanying drawings, which are incorporated herein and form part of the specification, illustrate embodiments consistent with the present disclosure and, together with the description, further serve to explain the principles of the present disclosure.
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the accompanying drawings required to be used in the embodiments or prior art description will be briefly introduced. Obviously, for those skilled in the art, other drawings can also be obtained based on these drawings without any creative work.
[0024] Figure 1 A network topology structure schematic diagram provided by the embodiments of the present disclosure;
[0025] Figure 2 A network topology structure schematic diagram provided by the embodiments of the present disclosure;
[0026] Figure 3 A flowchart of a flashing method of an electronic control unit provided by the embodiments of the present disclosure;
[0027] Figure 4 A data transmission structure schematic diagram provided by the embodiments of the present disclosure;
[0028] Figure 5 A flowchart of a flashing method of an electronic control unit provided by the embodiments of the present disclosure;
[0029] Figure 6 A structure schematic diagram of a flashing device of an electronic control unit provided by the embodiments of the present disclosure;
[0030] Figure 7A structural schematic diagram of an electronic control unit flashing system provided by an embodiment of the present disclosure is provided.
[0031] Figure 8 A structural schematic diagram of an electronic device provided by an embodiment of the present disclosure is provided. DETAILED DESCRIPTION
[0032] In order to enable a more clear understanding of the above-mentioned purposes, features and advantages of the present disclosure, the solutions of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflicts.
[0033] In the following description, a large number of specific details are set forth in order to facilitate a thorough understanding of the present disclosure, but the present disclosure can also be implemented in other manners different from those described herein; obviously, the embodiments described in the specification only constitute a part of the embodiments of the present disclosure, and not all the embodiments.
[0034] Specifically, the OTA is applied to flash the vehicle ECU, referring to Figure 1 , mainly includes the following modules, cloud server 110 (OTA cloud platform) and vehicle end 120, wherein the vehicle end 120 includes upgrade management program (OTA Manager) 121, domain controller 122 and electronic control unit 123; the cloud server 110 is used to realize the functions of upgrade model management, upgrade task and upgrade package management of the OTA cloud end; the upgrade management program 121 is a management program responsible for connecting the vehicle end 120 and the cloud server 110, and is used to realize the secure communication of the cloud end, including protocol communication link management, upgrade instruction receiving, upgrade state sending, upgrade package downloading, upgrade package decryption and differential package reconstruction functions.
[0035] On the vehicle applying the vehicle-mounted Ethernet, the upgrade management program 121 connects a large number of electronic control units 123 configured by the vehicle based on the network topology architecture of the vehicle-mounted Ethernet, and performs overall and coordinated control, so that the vehicle is more intelligent, wherein the electronic control unit 123 refers to a control device composed of integrated circuits for realizing functions of analyzing, processing and sending data, which can be installed on the intelligent hardware of the vehicle. At present, the network topology architecture of the vehicle, referring to Figure 2The upgrade management program 210 is connected to the Ethernet gateway 220, the Ethernet gateway 220 is connected to a plurality of domain controllers 230, that is, the Ethernet is used as the backbone network, and the domain controllers 230 are used as subnets, each domain controller 230 is connected to one or more electronic control units (ECU) 240 through a controller area network (CAN) bus or a local area network (LAN) bus, the Ethernet gateway 220 is used as a control bus to realize data exchange and complete the flashing of the electronic control unit 240.
[0036] In the related art, the ECU is flashed through the network topology architecture of the vehicle. In the related art, the single ECU is flashed through OTA one by one, which causes the bandwidth of the backbone network to be not fully utilized, and the flashing efficiency is low and the flashing time is long. If the ECU connected to the single domain controller through at most three CANs is flashed through OTA in parallel, the flashing speed is improved to a certain extent, but the bandwidth of the backbone network is still not fully utilized, and the flashing efficiency is not high. If the OTA parallel flashing is implemented in multiple functional domains at the same time, since the backbone network uses the traditional unreliable Ethernet, and lacks time synchronization, the data transmission of each domain controller will have a large number of collisions on the network and even may have a frame loss phenomenon, which is prone to flashing failure, and at the same time, the software complexity of the flashing client is also increased. In view of the problems existing in the ECU flashing process, the flashing method of the electronic control unit in the embodiment of the present disclosure is further described in detail through one or more embodiments.
[0037] Specifically, the time-sensitive Ethernet in the embodiment of the present disclosure can be a standard defined by the Institute of Electrical and Electronics Engineers (IEEE) Time-Sensitive Network (TSN), for example, can be an IEEE 802.1 protocol, wherein the domain controller connected to the backbone network at least supports the IEEE 802.1AS protocol and the IEEE 802.1QBV protocol in the time-sensitive protocol; the IEEE 802.1AS protocol defines the clock synchronization mechanism of the entire network, and each domain controller connected to the backbone network can perform clock synchronization based on the IEEE 802.1AS protocol; the IEEE 802.1QBV protocol is a time-aware shaper (TAS) that allocates specific time slots (time slots) for time-sensitive key data with higher priority, and at the specified time node, all nodes in the network must ensure the passing of important data frames in priority, and the electronic control unit can divide the time slots for the transmission of the request message based on the characteristics of the IEEE 802.1QBV protocol.
[0038] The Ethernet involved in the embodiments of the present disclosure can be a time-sensitive Ethernet, and based on the time-sensitive Ethernet, a time slot corresponding to each electronic control unit to be flashed is determined in advance. Then, the upgrade management module sends a request message corresponding to the electronic control unit to the target domain at the start time of the receiving time slot corresponding to the electronic control unit through the Ethernet, and the target domain forwards the request message to the electronic control unit. The electronic control unit generates a response message according to the request message and sends the response message to the target domain. The target domain returns the response message to the upgrade management module through the time-sensitive Ethernet at the start time of the sending time slot corresponding to the electronic control unit. The request message or the response message can be transmitted in order, effectively avoiding the problems of data collision and frame loss in the transmission process of a large amount of data, increasing the success rate of flashing, and further reducing the software complexity of the flashing client. In addition, the present disclosure makes full use of the bandwidth of the backbone network, ensures the accuracy of the transmitted data, and improves the flashing efficiency and shortens the flashing time.
[0039] Figure 3 The electronic control unit flashing method provided by the embodiments of the present disclosure can be based on Figure 1 the network topology, use the time-sensitive Ethernet as the backbone network to connect the domain controller, and use the CAN bus or the LAN bus to connect the domain controller and the ECU in the subnetwork. Specifically, the method includes the following steps S310-S330 as shown in Figure 3 .
[0040] It can be understood that before the ECU is flashed, all target domains (domain controllers) connected by the Ethernet need to be time-synchronized through the IEEE802.1AS protocol, and it is ensured that at the current time, only one electronic control unit in one of the target domains is in the start state at the corresponding receiving time slot or sending time slot, and the receiving time slot or sending time slot corresponding to other ECUs is in the closed state. For example, the receiving time slot and the sending time slot corresponding to each ECU are 200 microseconds (μs), and the number of ECUs to be flashed is 10. The request period can be 200 μs x 10 = 2000 μs. At the start time of the request period, that is, the start time of the receiving time slot corresponding to the first ECU, the range of the receiving time slot corresponding to the first ECU can be [0, 200 μs). After the receiving time slot corresponding to the first ECU ends, the start time of the receiving time slot corresponding to the second ECU is entered. At this time, the range of the receiving time slot corresponding to the second ECU can be [200 μs, 400 μs). In this way, in the request period, the receiving time slot corresponding to each ECU is opened in turn according to the order.
[0041] S310, obtaining a request message to be processed, the request message including an identifier of a target domain and an identifier of an electronic control unit to be flashed.
[0042] It can be understood that the request message to be processed is the request message sent to the electronic control unit to be flashed. The request message to be processed can be generated by the cloud server and sent to the upgrade management program.
[0043] It can be understood that the request message includes the identifier of the target domain and the identifier of the electronic control unit to be flashed. The target domain can refer to the domain controller in the above Figure 3 The identifier of the target domain can be the address of the target domain, which determines to which target domain the request message is to be sent. The identifier of the electronic control unit to be flashed can be the address of the electronic control unit, which determines which electronic control unit the target domain is to forward the request message to at the start time of the receiving time slot. The request message can also include data to be flashed for flashing the electronic control unit.
[0044] For example, refer to Figure 2The identifier of the target domain in the request message can be the identifier of the first domain controller from left to right in the domain controller 240, and the identifier of the electronic control unit can be the identifier of the first electronic control unit connected to the domain controller 240 from top to bottom. At the start time of the receiving time slot corresponding to the first electronic control unit, the request message is sent to the first domain controller, and then the first domain controller forwards the request message to the first electronic control unit.
[0045] S320, at the start time of the receiving time slot corresponding to the electronic control unit, the request message is sent to the electronic control unit through the target domain according to the identifier of the target domain and the identifier of the electronic control unit.
[0046] It can be understood that, based on the above S310, at the start time of the receiving time slot corresponding to the electronic control unit, the target domain and the electronic control unit to which the request message is to be sent are determined according to the identifier of the target domain and the identifier of the electronic control unit in the request message, and then the upgrade management program can send the request message to the electronic control unit through the target domain.
[0047] It can be understood that the target domain is used to receive and forward the request message, and the target domain can only receive the request message at the start time of the receiving time slot corresponding to the electronic control unit. The target domain cannot receive the request message when the receiving time slot corresponding to the electronic control unit has not started, but the target domain does not need to wait for the start of the receiving time slot to send the request message to the electronic control unit. The target domain can send the request message to the electronic control unit immediately after receiving the request message, or can send the request message to the electronic control unit after a predetermined time, which is not limited herein.
[0048] For example, referring to Figure 4 The upgrade management program 410 connects three domain controllers 420, 430 and 440 through a time-sensitive Ethernet. The domain controller 420 connects three electronic control units, the electronic control unit 421, the electronic control unit 422 and the electronic control unit 423. The domain controller 430 connects three electronic control units, and the domain controller 440 connects two electronic control units. Each electronic control unit corresponds to a time slot, which is used to control the data transmission between the upgrade management program 410 and the domain controller 420. For example, at the start time of the time slot corresponding to the electronic control unit 421, the upgrade management program 410 sends a request message to the domain controller 420, and then the domain controller 420 can send the received request message to the electronic control unit 421. After the end of the receiving time slot corresponding to the electronic control unit 421, the receiving time slot corresponding to the electronic control unit 422 starts, and so on, until the receiving time slot corresponding to the electronic control unit connected to the domain controller 440 ends.
[0049] S330, at the start moment of the sending time slot corresponding to the electronic control unit, the target domain receives the response message generated by the electronic control unit according to the request message.
[0050] It can be understood that the electronic control unit is used for receiving the request message, generating the response message according to the request message, and sending the response message to the target domain.
[0051] It can be understood that at the start moment of the sending time slot corresponding to the electronic control unit, the target domain returns the received response message to the upgrade management program through the backbone network, that is, the upgrade management program receives the response message sent by the target domain.
[0052] For example, referring to Figure 4 , after the domain controller 420 receives the response message sent by the electronic control unit 421, at the start moment of the sending time slot corresponding to the electronic control unit 421, the domain controller 420 sends the response message to the upgrade management program 410.
[0053] The writing method of the electronic control unit provided by the embodiment of the present disclosure comprises the following steps: obtaining a request message to be processed, wherein the request message comprises an identifier of a target domain and an identifier of an electronic control unit; reading the identifier of the target domain and the identifier of the electronic control unit in the request message at the start moment of a receiving time slot corresponding to the electronic control unit; sending the request message to the electronic control unit through the target domain; and returning a response message generated by the electronic control unit according to the request message to an upgrade management program through the target domain at the start moment of a sending time slot corresponding to the electronic control unit. The present disclosure uses time-sensitive Ethernet as a backbone network, can orderly transmit the request message or the response message, effectively avoids the problems of data collision and frame loss in the transmission process of a large amount of data, increases the success rate of writing, and further reduces the software complexity of the writing client. In addition, the present disclosure fully utilizes the bandwidth of the backbone network, guarantees the accuracy of the transmitted data, and further improves the writing efficiency and shortens the writing time.
[0054] On the basis of the above-mentioned embodiment, optionally, before obtaining the request message to be processed, the writing method further comprises the following steps S510-S540 as shown in Figure 5
[0055] S510, obtaining a first number of electronic control units to be written.
[0056] It can be understood that the first number of electronic control units to be written at the vehicle end is obtained, that is, how many electronic control units need to be written.
[0057] For example, referring to Figure 4 , the first quantity of electronic control units to be flashed under the 3 domain controllers is 8. Understandably, the domain controller 420 can be connected to more than 3 electronic control units, for example, it can be connected to 5 electronic control units, but only 3 of them need to be flashed, that is, electronic control unit 421, electronic control unit 422 and electronic control unit 423 need to be flashed, and the remaining 2 electronic control units do not need to be flashed, therefore, only the quantity of electronic control units to be flashed needs to be obtained, and the domain controller 430 and the domain controller 440 can be set in a similar manner to the domain controller 420, which is not limited here.
[0058] S520, according to the properties of the electronic control units to be flashed and the time-sensitive network protocol, determine the receiving time slot and the sending time slot corresponding to the electronic control units to be flashed.
[0059] Understandably, on the basis of the above S510, according to the properties of each electronic control unit to be flashed and the time-sensitive network protocol (IEEE802.1QBV protocol), determine the receiving time slot and the sending time slot corresponding to each electronic control unit. The receiving time slot and the sending time slot corresponding to each electronic control unit can be the same or different. The property of the electronic control unit can be the processing capability of the electronic control unit, that is, the efficiency of the electronic control unit in processing messages. If the efficiency of processing messages is fast, the receiving time slot and the sending time slot corresponding to the electronic control unit can be determined as a smaller time period. It can also be set according to user demand, or according to the properties of the CAN bus, to determine the receiving time slot and the sending time slot corresponding to each electronic control unit. For example, a CAN bus can transmit 4 messages in 1 millisecond (ms), and 1 message can occupy up to 250μs, so the receiving time slot and the sending time slot corresponding to all electronic control units connected to the CAN bus can be set to 250μs.
[0060] S530, determine the request period according to the sum of the receiving time slots corresponding to the first quantity of electronic control units to be flashed.
[0061] Understandably, on the basis of the above S520, determine the request period according to the sum of the receiving time slots of the first quantity of electronic control units to be flashed, that is, the sum of each receiving time slot is the length of the request period.
[0062] For example, if the first quantity of electronic control units to be flashed is 8, and the receiving time slot corresponding to each electronic control unit is 250μs, then the request period is the sum of the receiving time slots corresponding to 8 electronic control units, that is, 8x250μs=2000μs, wherein the receiving time slot corresponding to each electronic control unit can be different and can be determined according to actual demand.
[0063] Optionally, on the basis of S530, when sending the request message or the response message, it is further needed to judge whether it is in the request period or the response period. If it is in the request period, the request message is sent to the electronic control unit through the target domain at the start time of the receiving time slot corresponding to the electronic control unit; if it is in the response period, the response message generated by the electronic control unit according to the request message is received through the target domain at the start time of the sending time slot corresponding to the electronic control unit.
[0064] It can be understood that if the time-sensitive Ethernet transmits the request message in the period of the request period (within 2000 microseconds) and in the receiving time slot (within 250 microseconds) corresponding to each electronic control unit. If the time-sensitive Ethernet transmits the response message in the period of the response period and in the sending time slot corresponding to each electronic control unit. The request period and the response period are iterated in turn, that is, after the end of the request period, the response period is entered, and after the end of the response period, the request period is entered again until all the electronic control units to be flashed are flashed. The request message sent to all the electronic control units to be flashed in the request period is sent by the cloud server, which not only ensures the ordered transmission of data, but also fully utilizes the network bandwidth of the backbone network and further increases the processing efficiency of the cloud server.
[0065] Optionally, on the basis of S530, the determination of the start time of the receiving time slot corresponding to one or more electronic control units connected by each target domain can include: in the request period, the receiving time slots corresponding to the first number of electronic control units included in the request period enter the start time in turn; in the response period, the response time slots corresponding to the first number of electronic control units included in the response period enter the start time in turn.
[0066] It can be understood that in the request period, the receiving time slots corresponding to the first number of electronic control units to be flashed enter the start time in turn, for example, referring to Figure 4Corresponding to each electronic control unit, the receiving time slot is set to 250 μs, and the sum of the receiving time slots corresponding to the 8 electronic control units to be programmed is 2000 μs. Corresponding to the first electronic control unit 421, the receiving time slot is 250 μs. When entering the request period, that is, at the start time of the receiving time slot corresponding to the electronic control unit 421, the time range of the receiving time slot corresponding to the electronic control unit 421 is [0, 250 μs). After the receiving time slot corresponding to the electronic control unit 421 ends, the start time of the receiving time slot corresponding to the electronic control unit 422 is entered immediately, the time range of the receiving time slot corresponding to the electronic control unit is [250 μs, 500 μs), the time range of the receiving time slot corresponding to the electronic control unit 423 is [500 μs, 750 μs), and so on, until the request period ends.
[0067] S540, determining a response period according to the sum of the sending time slots corresponding to the first number of electronic control units to be programmed.
[0068] It can be understood that, on the basis of the above S520, the response period is determined according to the sum of the sending time slots of the first number of electronic control units to be programmed, that is, the sum of each sending time slot is the time length of the response period.
[0069] It can be understood that, in the response period, the sending time slots corresponding to the first number of electronic control units to be programmed enter the start time in turn, and the division and process of the sending time slot of each electronic control unit are similar to the receiving time slot, which will not be described here. It can be understood that, whether in the request period or in the response period, only the time slot corresponding to one electronic control unit is in the start state, that is, in the time period of one electronic control unit.
[0070] The programming method of the electronic control unit provided by the embodiment of the present disclosure can accurately divide the receiving time slot and the sending time slot of each electronic control unit by obtaining the first number of electronic control units to be programmed, then determining the receiving time slot and the sending time slot of the electronic control unit according to the attribute of the electronic control unit and the time-sensitive network protocol, determining the request period according to the sum of the first number of receiving time slots, and determining the response period according to the sum of the first number of sending time slots. In different periods, the request message or the response message is transmitted, which can ensure the orderliness of data transmission, only the data required by one electronic control unit is transmitted in a time period, the orderly data transmission is ensured, the problem of data confusion is reduced, and the transmission efficiency is improved.
[0071] On the basis of the above embodiment, optionally, after the scheduling period is determined, the programming method further includes: determining a second number of request messages to be processed according to the attribute of the electronic control unit and the request period.
[0072] It can be understood that, according to the processing capability and request period of the electronic control unit, the second number of the acquired request messages to be processed is determined, that is, the second number of request messages that the electronic control unit can receive and process in a request period. The processing is complete, which means that the response message is generated according to the received request message in the request period, so that after the iteration to the response period, the target domain will return the generated second number of response messages to the upgrade management program through the time-sensitive backbone network at the start time of the sending time slot corresponding to the electronic control unit.
[0073] Optionally, after determining the second number of request messages to be transmitted by the time-sensitive backbone network, the sending of the request messages further includes: sending the second number of request messages to the target domain at the start time of the receiving time slot corresponding to the electronic control unit in the request period.
[0074] It can be understood that, in the request period, the upgrade management program sends the second number of request messages to the target domain at the start time of the receiving time slot corresponding to the electronic control unit. As long as the upgrade management program can send the second number of request messages to the target domain in sequence within the period of the receiving time slot corresponding to the electronic control unit, it can also send all the second number of request messages to the target domain, or send a preset number at a time, which is not limited here.
[0075] Optionally, in the response period, the upgrade management program receives the second number of response messages sent by the target domain at the start time of the sending time slot corresponding to the electronic control unit.
[0076] It can be understood that, in the response period, the upgrade management program receives the second number of response messages sent by the target domain at the start time of the sending time slot corresponding to the electronic control unit. The form of the response message sent by the target domain is similar to the sending of the request message by the upgrade management program, which is not limited here.
[0077] Exemplarily, referring to Figure 4If the electronic control unit 421 can process 4 frames of CAN transmission messages in 1 ms, and the request period is 2000 μs, then the second number of request messages that the electronic control unit 421 can receive and process in the entire request period is 2000 μs / 1000 μs x 4 = 8, that is, after receiving 8 request messages, the electronic control unit 421 can generate 8 response messages and send them to the domain controller 420 before the end of the request period, and after entering the response period, the domain controller 420 sends the 8 response messages to the upgrade management program 410, that is, the second number of request messages sent by the upgrade management program 410 to the domain controller 420 is at most 8, and then the domain controller 420 sends the electronic control unit 421 at most 8 request messages, and at the same time, the electronic control unit 421 can correspondingly generate 8 response messages and send them to the domain controller 420 in the request period, and after entering the response period, at the start time of the corresponding sending time slot of the electronic control unit 421, the domain controller 420 returns the 8 response messages to the upgrade management program 410.
[0078] The method for flashing the electronic control unit provided by the embodiment of the present disclosure determines the second number of request messages to be processed through the attribute of the electronic control unit and the request period, can accurately determine the number of request messages sent to the electronic control unit, and can ensure that the processing efficiency of different electronic control units in the scheduling period is relatively high, can fully utilize the bandwidth of the backbone network to transmit the second number of request messages or response messages, and further improves the processing efficiency of the electronic control unit.
[0079] On the basis of the above-mentioned embodiment, optionally, each electronic control unit to be flashed has a corresponding receiving time slot and sending time slot.
[0080] It can be understood that each domain controller is connected to one or more electronic control units to be flashed, and each electronic control unit to be flashed has a corresponding receiving time slot and sending time slot, and the receiving time slot and sending time slot of each electronic control unit are divided in the upgrade management program and the domain controller according to the time-sensitive network protocol, and before the receiving time slot and sending time slot are divided, the upgrade management program and the domain controller are clock-synchronized, so that the time reference of the receiving time slot and sending time slot divided for each electronic control unit is the same, that is, it is ensured that in the request period or the response period, only the receiving time slot or sending time slot corresponding to one electronic control unit is in the start state.
[0081] Optionally, the target domain is configured to receive the response messages sent by the one or more electronic control units to be programmed, and to cache the response messages in a to-be-sent queue; and in the response period, at the start time of the sending time slot corresponding to the electronic control unit, the target domain sends the response message corresponding to the electronic control unit cached in the to-be-sent queue.
[0082] It can be understood that the data transmission process in which the target domain sends the request message to the electronic control unit and the electronic control unit returns the response message to the target domain is not controlled by the sending time slot, and the data transmission between the target domain and the electronic control unit can be performed at any time. After the electronic control unit receives the request message, the generated response message can be immediately transmitted to the target domain. However, if the response message is not received within the response period and is not in the sending time slot corresponding to the electronic control unit, the target domain can cache the received response message in the to-be-sent queue. Until the data transmission condition of the target domain is met, the response message is sent to the upgrade management program. The data transmission condition is that the response period is entered and the sending time slot corresponding to the electronic control unit is entered. It can be understood that part of the response message can not be sent to the upgrade management program by the target domain within one response period.
[0083] For example, referring to Figure 4 , the electronic control unit 421 can generate 8 response messages, and after each response message is generated, the response message is sent to the domain controller 420. The domain controller 420 caches the 8 received response messages in the to-be-sent queue in turn. Until the response period is entered and the start time of the sending time slot corresponding to the electronic control unit 421, the domain controller 420 sends the 8 response messages corresponding to the electronic control unit 421 in the to-be-sent queue to the upgrade management program 410.
[0084] For example, in the first request period, the electronic control unit 421 receives 8 request messages, but after the first request period ends and the first response period starts, the electronic control unit 421 generates only 6 response messages according to the request message, and sends and caches the 6 response messages to the to-be-sent queue of the domain controller 420. In the first response period, the domain controller 420 sends the 6 response messages to the upgrade management program 410, and the remaining 2 response messages can be sent to the upgrade management program 410 by the domain controller 420 in the second response period.
[0085] The programming method of the electronic control unit provided by the embodiment of the present disclosure can cache the response message generated by the electronic control unit in the to-be-sent queue of the target domain, and can feed back the response message to the upgrade management program in time, further improve the programming efficiency of the electronic control unit, ensure the accuracy of data transmission, and avoid the phenomenon of missing data transmission.
[0086] Figure 6 A structure diagram of the electronic control unit flashing device is provided for the embodiments of the present disclosure. The electronic control unit flashing device provided by the embodiments of the present disclosure can execute the processing flow provided by the electronic control unit flashing method embodiments, as shown in the following table. Figure 6 As shown in the table, the electronic control unit flashing device 600 comprises:
[0087] The acquisition module 610 is configured to acquire a request message to be processed, wherein the request message comprises an identifier of a target domain and an identifier of an electronic control unit to be flashed.
[0088] The sending module 620 is configured to send the request message to the electronic control unit through the target domain at a starting moment of a receiving time slot corresponding to the electronic control unit according to the identifier of the target domain and the identifier of the electronic control unit.
[0089] The receiving module 630 is configured to receive a response message generated by the electronic control unit according to the request message through the target domain at a starting moment of a sending time slot corresponding to the electronic control unit.
[0090] Optionally, the device 600 further comprises a determination module, which is specifically configured to acquire a first number of electronic control units to be flashed; determine the receiving time slot and the sending time slot corresponding to the electronic control units to be flashed according to the attributes of the electronic control units to be flashed and a time-sensitive network protocol; determine a request period according to the sum of the receiving time slots corresponding to the first number of electronic control units to be flashed; and determine a response period according to the sum of the sending time slots corresponding to the first number of electronic control units to be flashed.
[0091] Optionally, the sending module 620 is specifically configured to send the request message to the electronic control unit through the target domain at the starting moment of the receiving time slot corresponding to the electronic control unit within the request period; and the receiving module is further configured to receive the response message generated by the electronic control unit according to the request message through the target domain at the starting moment of the sending time slot corresponding to the electronic control unit within the response period.
[0092] Optionally, the device 600 further comprises a number module, which is specifically configured to determine a second number of request messages to be processed according to the attributes of the electronic control units and the request period after determining the scheduling period.
[0093] Optionally, the sending module 620 is specifically configured to send the request message to the electronic control unit through the target domain at the starting moment of the receiving time slot corresponding to the electronic control unit within the request period.
[0094] In the request period, at the start time of the receiving time slot corresponding to the electronic control unit, the second number of request messages are sent to the electronic control unit through the target domain.
[0095] Optionally, the target domain in the device 600 is configured to receive a response message sent by one or more electronic control units to be programmed, and to cache the response message in the to-be-sent queue.
[0096] Optionally, the sending module 620 is configured to receive, in the response period, a response message generated by the electronic control unit according to the request message at the start time of the sending time slot corresponding to the electronic control unit through the target domain, and specifically configured to:
[0097] In the response period, at the start time of the sending time slot corresponding to the electronic control unit, the response message corresponding to the electronic control unit cached in the to-be-sent queue sent by the target domain is received.
[0098] Optionally, in the request period, the receiving time slots corresponding to the first number of electronic control units included in the request period enter the start time in turn; and in the response period, the sending time slots corresponding to the first number of electronic control units included in the response period enter the start time in turn.
[0099] Figure 6 The programming device of the electronic control unit of the illustrated embodiment can be used to execute the technical solutions of the above-mentioned programming method embodiments of the electronic control unit, and has similar implementation principles and technical effects, which will not be described here.
[0100] Figure 7 A structural schematic diagram of a programming system of an electronic control unit is provided for the embodiments of the present disclosure, and the system 700 includes an upgrade management module 710, a target domain 720, and an electronic control unit 730, wherein the target domain 720 can refer to Figure 7 a domain controller 720.
[0101] The upgrade management module 710 is connected with one or more target domains 720; and the target domain 720 is connected with one or more electronic control units 730.
[0102] The upgrade management module 710 is configured to execute the above-mentioned programming method of the electronic control unit.
[0103] It can be understood that the process of programming the electronic control unit 730 by the system 700 can be referred to the above-mentioned programming method of the electronic control unit, and will not be described here.
[0104] The programming system of the electronic control unit provided by the embodiments of the present disclosure can be used to execute the technical solutions of the above-mentioned programming method embodiments of the electronic control unit, and has similar implementation principles and technical effects, which will not be described here.
[0105] Figure 8 A structural schematic diagram of an electronic device is provided for the embodiments of the present disclosure. The electronic device provided by the embodiments of the present disclosure can execute the processing flow provided by the above-mentioned embodiments, such as Figure 8 As shown in the figure, the electronic device 800 includes a processor 810, a communication interface 820, and a memory 830; wherein a computer program is stored in the memory 830 and is configured to be executed by the processor 810 to implement the flashing method of the electronic control unit as described above.
[0106] In addition, the embodiments of the present disclosure also provide a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the flashing method of the electronic control unit of the above-mentioned embodiments.
[0107] In addition, the embodiments of the present disclosure also provide a computer program product, which includes a computer program or instructions, and the computer program or instructions are executed by a processor to implement the flashing method of the electronic control unit as described above.
[0108] It should be noted that, in this document, relational terms such as "first" and "second", and the like, are used solely to distinguish one entity or action from another entity or action, without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations 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 can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without more limitations, an element preceded by "comprises... " does not, without more limitations, foreclose the existence of additional identical elements in the process, method, article, or apparatus that includes the element.
[0109] The above is only a specific implementation of the present disclosure, which enables those skilled in the art to understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to these embodiments herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for flashing an electronic control unit, characterized in that, include: Obtain the request message to be processed, the request message including the identifier of the target domain and the identifier of the electronic control unit to be flashed; At the start of the receiving time slot corresponding to the electronic control unit, the request message is sent to the electronic control unit through the target domain according to the identifier of the target domain and the identifier of the electronic control unit; wherein, the receiving time slot is determined according to the attributes of the electronic control unit to be flashed and the time-sensitive network protocol; At the start of the transmission time slot corresponding to the electronic control unit, a response message generated by the electronic control unit based on the request message is received through the target domain; Specifically, at the start of the receiving time slot corresponding to the electronic control unit, sending the request message to the electronic control unit through the target domain includes: During the request period, at the beginning of the receiving time slot corresponding to the electronic control unit, a second number of request messages are sent to the electronic control unit through the target domain; wherein, the request period is the sum of the receiving time slots corresponding to all electronic control units to be flashed, and the second number is the number of request messages to be processed determined according to the attribute and the request period.
2. The method according to claim 1, characterized in that, Before obtaining the request message to be processed, the method further includes: Obtain the first number of electronic control units to be flashed; Based on the attributes of the electronic control unit to be flashed and the time-sensitive network protocol, the transmission time slot and the reception time slot corresponding to the electronic control unit to be flashed are determined respectively. The request period is determined based on the sum of the receiving time slots corresponding to the first number of electronic control units to be written; The response period is determined based on the sum of the transmission time slots corresponding to the first number of electronic control units to be written.
3. The method according to claim 2, characterized in that, During the response period, at the beginning of the transmission time slot corresponding to the electronic control unit, a response message generated by the electronic control unit based on the request message is received through the target domain.
4. The method according to claim 3, characterized in that, After determining the request period, the method further includes: Based on the attributes of the electronic control unit and the request period, a second number of request messages to be processed is determined.
5. The method according to claim 2, characterized in that, Within the request period, the receiving time slots corresponding to the first number of electronic control units included in the request period sequentially enter the start time. Within the response period, the transmission time slots corresponding to the first number of electronic control units included in the response period sequentially enter the start time.
6. The method according to claim 3, characterized in that, The target domain is used to receive response messages sent by the one or more electronic control units to be flashed, and is also used to cache the response messages in the queue to be sent. Accordingly, within the response period, at the beginning of the transmission time slot corresponding to the electronic control unit, a response message generated by the electronic control unit based on the request message is received through the target domain, including: During the response period, at the beginning of the transmission time slot corresponding to the electronic control unit, the response message corresponding to the electronic control unit, which is buffered in the transmission queue sent by the target domain, is received.
7. A writing device for an electronic control unit, characterized in that, include: The acquisition module is used to acquire the request message to be processed, which includes the identifier of the target domain and the identifier of the electronic control unit to be flashed; The sending module is configured to send the request message to the electronic control unit through the target domain at the start of the receiving time slot corresponding to the electronic control unit, based on the identifier of the target domain and the identifier of the electronic control unit; wherein, the receiving time slot is determined according to the attributes of the electronic control unit to be flashed and the time-sensitive network protocol; The receiving module is configured to receive, at the start of the transmission time slot corresponding to the electronic control unit, a response message generated by the electronic control unit based on the request message through the target domain; The sending module is used for: During the request period, at the beginning of the receiving time slot corresponding to the electronic control unit, a second number of request messages are sent to the electronic control unit through the target domain; wherein, the request period is the sum of the receiving time slots corresponding to all electronic control units to be flashed, and the second number is the number of request messages to be processed determined according to the attribute and the request period.
8. A flashing system for an electronic control unit, characterized in that, The system includes an upgrade management module, one or more target domains, and one or more electronic control units; the upgrade management module is connected to the one or more target domains; the target domains are connected to the one or more electronic control units. The upgrade management module is used to execute the flashing method of the electronic control unit as described in any one of claims 1 to 6.
9. An electronic device, characterized in that, include: Memory; processor; as well as Computer programs; The computer program is stored in the memory and configured to be executed by the processor to implement the electronic control unit flashing method as described in any one of claims 1 to 6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the flashing method for the electronic control unit as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Communication system and communication apparatus
CN103155492A
Application program downloading method and device, gateway and storage medium
CN110677466A