Container-based ECU (Electronic Control Unit) flashing method, device and equipment and storage medium

By using containerized preset flashing programs and virtual LAN interfaces in ECU flashing, batch flashing of ECU is realized, solving the problems of communication conflicts and low flashing efficiency in the prior art, and improving the flashing efficiency and Reduced costs.

CN119271223APending Publication Date: 2025-01-07CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411334572.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

The existing ECU flashing technology based on DoIP protocol is prone to communication conflicts when batch flashing, resulting in failure of flashing, and low flushing efficiency one by one, affecting production progress and cost.

Method used

Using container-based ECU flashing method, a one-to-one communication link between the host computer and multiple ECUs of the same model is established through the virtual LAN interface, and a containerized preset flashing program is used to realize batch flashing to avoid communication conflicts and Improve brushing efficiency.

Benefits of technology

The batch writing of ECU is realized, which avoids communication conflicts, simplifies the writing process, improves the writing efficiency, and reduces the cost and system complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119271223A_ABST
    Figure CN119271223A_ABST
Patent Text Reader

Abstract

The invention provides a container-based ECU flashing method, device and equipment and a storage medium, applied to an upper computer, the upper computer communicates with multiple ECUs of the same model through a virtual local area network interface, at least one ECU is configured in each vehicle, and the method comprises the following steps: receiving a control instruction for flashing multiple ECUs, the control instruction at least comprises a target number of to-be-flashed ECUs and a path of an upgrade file; packaging the preset flashing program into a container mirror image, and creating a target number of containers according to the container mirror image and the control instruction; the preset flashing program in each container is run, the upgrading file is transmitted to each ECU through each communication link so as to complete flashing of each ECU, and the communication links are constructed between the containers and the ECUs based on the virtual local area network interfaces in a one-to-one correspondence mode. Therefore, the ECU batch flashing process is simplified, the flashing efficiency is high, additional physical network equipment does not need to be added, and the cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of electronic control units, and in particular to a container-based ECU flashing method, device, equipment and storage medium. Background Art

[0002] As one of the indispensable core components of automobiles, the automotive electronic control unit (ECU) is responsible for integrating, processing and executing data and information from various sensors and actuators of the vehicle, and realizing precise control of multiple key systems such as the engine, transmission system, braking system, safety system and body control. With the acceleration of the trend of automobile intelligence and networking, ECU needs to continuously update software to adapt to increasingly complex functional requirements. Software updates usually include the addition of new functions, optimization of existing functions, bug fixes and the application of security patches. In related technologies, ECU flashing technology based on DoIP (Diagnostic Co mmunication over Internet Protocol) is usually adopted. The new software version is written into the ECU through special equipment to achieve software update. The DoIP protocol is a flashing technology based on the TCP / IP protocol (Transmission Control Protocol / Internet Protocol). It can connect to the vehicle through the Internet or local area network to perform remote or local flashing operations on the ECU.

[0003] However, ECU flashing based on the DoIP protocol requires that the flashing device and the ECU to be flashed are in the same network environment, and is only applicable to the flashing of a single ECU. When batch flashing of ECUs is required, since ECUs of the same model may be configured with the same IP address, on the one hand, concurrent communication of multiple ECUs will cause communication conflicts and lead to flashing failures; on the other hand, if the ECUs are flashed one by one, the flashing efficiency will be low, affecting production schedule and cost. Summary of the invention

[0004] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.

[0005] In view of the shortcomings of the prior art described above, the present application discloses a container-based ECU flashing method, device, equipment and storage medium to solve the above-mentioned technical problem of how to achieve batch flashing of ECUs to improve flashing efficiency.

[0006] In the first aspect, the present application provides a container-based ECU flashing method, which is applied to a host computer, wherein the host computer communicates with multiple ECUs of the same model through a virtual local area network interface, and at least one ECU is configured in each vehicle. The method includes: receiving a control instruction for flashing multiple ECUs, wherein the control instruction includes at least a target number of ECUs to be flashed and a path of an upgrade file; encapsulating a preset flashing program into a container image, and creating the target number of containers according to the container image and the control instruction; running the preset flashing program in each of the containers, so that the upgrade file is transmitted to each ECU through each communication link to complete the flashing of each ECU, wherein the communication link is constructed one-to-one between the container and the ECU based on the virtual local area network interface.

[0007] In one embodiment of the present application, the method of constructing the communication link includes: binding each of the containers to different virtual LAN interfaces respectively; establishing a one-to-one communication link between the container and the ECU based on each bound virtual LAN interface, and each virtual LAN interface is associated with only one ECU.

[0008] In one embodiment of the present application, the one-to-one communication link between the container and the ECU is established based on each bound virtual LAN interface, including: assigning a unique first network address to each container, and the first network address of the container corresponding to the same virtual LAN interface and the second network address of the ECU are in the same network segment, wherein the second network address of each ECU is the same; and establishing the communication link according to the first network address of the container corresponding to the same virtual LAN interface and the second network address of the ECU.

[0009] In one embodiment of the present application, the running of the preset flashing program in each container includes: using the ECU with the same virtual LAN interface as the container running the preset flashing program as the target control unit; using the preset flashing program to detect whether the host computer and the target control unit are successfully connected within a preset time; if the connection is successful, sending a session instruction to the target control unit to establish a coding session between the preset flashing program and the target control unit based on the session instruction; if the connection fails, re-establishing the connection until the connection is successful or the number of connections reaches a preset number; reading the upgrade file according to the path of the upgrade file and sending it to the target control unit to flash the target control unit.

[0010] In one embodiment of the present application, the flashing of each of the ECUs includes: using the preset flashing program in each of the containers to transfer the flash operation file to the ECU with the same virtual LAN interface, the upgrade file includes the flash operation file and the application file, and the flash operation file is used to erase and write the preset storage partition in the ECU; erasing the preset storage partition by loading the flash operation file, and writing the application file to the preset storage partition after the erasing is completed, so as to complete the flashing of each of the ECUs.

[0011] In one embodiment of the present application, after the flashing of each of the ECUs is completed, it also includes: reading the current version information of the application file in the ECU through the preset flashing program; comparing the current version information with the version information carried by the application file in the upgrade file; if they are inconsistent, feeding back flag information carrying a flashing failure to the host computer; if they are consistent, feeding back flag information carrying a flashing success to the host computer; calling a preset instruction based on the flag information to delete the container of the same virtual LAN interface as the ECU, and the preset instruction is used to delete the container.

[0012] In one embodiment of the present application, before receiving the control instructions for flashing multiple ECUs, it also includes: connecting each of the ECUs to different access ports, the access ports being ports configured for the virtual LAN created based on the switch, and the access ports and the virtual LANs correspond one to one; creating the same number of virtual LAN interfaces as the access ports on the host computer; and associating each of the virtual LAN interfaces with different access ports, so that the host computer establishes communication with each of the ECUs through different virtual LAN interfaces.

[0013] In the second aspect, the present application provides a container-based ECU flashing device, which is applied to a host computer, and the host computer communicates with multiple ECUs of the same model through a virtual LAN interface, and at least one ECU is configured in each vehicle, and the device includes: an instruction receiving module, which is used to receive control instructions for flashing multiple ECUs, and the control instructions include at least a target number of ECUs to be flashed and a path of an upgrade file; a container creation module, which is used to encapsulate a preset flashing program into a container image, and create the target number of containers according to the container image and the control instructions; a flashing module, which is used to run the preset flashing program in each of the containers, so that the upgrade file is transmitted to each ECU through each communication link to complete the flashing of each ECU, wherein the communication link is constructed one-to-one between the container and the ECU based on the virtual LAN interface.

[0014] In a third aspect, the present application also provides an electronic device, comprising: a processor, a memory and a communication bus; the communication bus is used to connect the processor and the memory; the processor is used to execute a computer program stored in the memory to implement the container-based ECU flashing method as described in the above embodiment.

[0015] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor of a computer, the computer executes the container-based ECU flashing method as described in the above embodiments.

[0016] Beneficial effects of the present application: The present application proposes a container-based ECU flashing method, device, equipment and storage medium. A host computer and multiple ECUs of the same model are established to communicate through a virtual local area network interface, at least one ECU is configured in each vehicle, and the host computer is used to receive control instructions for flashing multiple ECUs, and the control instructions at least include the target number of ECUs to be flashed and the path of the upgrade file; the preset flashing program is encapsulated as a container image, and the target number of containers is created according to the container image and the control instructions; the preset flashing program in each container is run, so that the upgrade file is transmitted to each ECU through each communication link to complete the flashing of each ECU, wherein the communication link is constructed one-to-one between the container and the ECU based on the virtual local area network interface. In this way, on the one hand, one-to-one communication between the container and the ECU is realized through different VLANs (virtual local area networks), so that the communication between ECUs of the same model is isolated, and while realizing the batch flashing of the ECU, the communication conflict between different ECUs is avoided; on the other hand, the preset flashing program is containerized, so that the flexibility and response speed of the preset flashing program are high, the flashing process is significantly simplified, and the flashing efficiency is further improved. In addition, there is no need to add additional hardware equipment, such as switches and professional flashing equipment, which reduces the cost and complexity of the system.

[0017] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0019] Figure 1It is a schematic diagram of an implementation environment of an ECU flashing method based on a container shown in an exemplary embodiment of the present application;

[0020] Figure 2 It is a flow chart of a container-based ECU flashing method shown in an exemplary embodiment of the present application;

[0021] Figure 3 is a schematic diagram of establishing communication between a host computer and an ECU, shown in an exemplary embodiment of the present application;

[0022] Figure 4 is a schematic diagram of a flashing process of running a preset flashing program shown in an exemplary embodiment of the present application;

[0023] Figure 5 It is a schematic diagram of the overall process of flashing an ECU based on a container, shown in an exemplary embodiment of the present application;

[0024] Figure 6 is a block diagram of an ECU flashing device based on a container shown in an exemplary embodiment of the present application;

[0025] Figure 7 It is a structural diagram of a computer system suitable for implementing the electronic device of the present application, shown as an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0026] The following will describe the implementation methods of the present application with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be understood that the preferred embodiments are only for illustrating the present application, not for limiting the scope of protection of the present application.

[0027] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.

[0028] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present application. However, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present application difficult to understand.

[0029] VLAN (Virtual Local Area Network) is a technology that divides the network based on logical grouping rather than physical location. In a traditional local area network (LAN), the communication between devices is limited by physical location, that is, they must be connected to the same physical network segment to communicate with each other. However, with the expansion of network scale and the increase of complexity, this division method based on physical location has become less and less flexible and efficient. Therefore, VLAN technology breaks the limitation of physical location by introducing the concept of logical grouping in the network, and divides the devices in the network into different virtual LANs. Even if these devices are not physically connected, devices in the same VLAN can communicate with each other as if they were in the same physical LAN, while the communication between devices belonging to different VLANs will be isolated unless forwarded through a specific routing mechanism. High security and flexibility.

[0030] Docker is an open source container engine and an implementation of container technology that enables rapid deployment and expansion of applications. Container technology is a lightweight, portable, self-sufficient way to package and run applications. It can maintain consistency in different computing environments. By packaging the application and its dependencies in a separate container, it can run in any environment that supports containers without being affected by the underlying system. Each container runs in an independent namespace and control group, achieving isolation of applications between containers.

[0031] Based on the above technology, this application proposes a container-based ECU flashing method to solve the problem that when batch flashing ECUs of the same model, communication conflicts occur during the flashing process due to the same IP address of the ECUs, making it difficult to achieve batch flashing.

[0032] See also Figure 1 , is a schematic diagram of an implementation environment of a container-based ECU flashing method shown as an exemplary embodiment of the present application. Figure 1 As shown, the implementation environment includes a host computer 100 and a vehicle-side cluster 101, and the vehicle-side cluster includes one or more vehicles. The number of vehicles will not be limited here, for example, it can specifically include vehicle 101a, vehicle 101b, ..., vehicle 101n, and the ECUs configured in vehicles 101a, vehicle 101b, ..., vehicle 101n can be connected to the above-mentioned host computer 100 through a virtual LAN respectively, so that the ECU in each vehicle interacts with the host computer through different virtual LANs, thereby using the host computer to perform container-based flashing on each ECU of the same model.

[0033] See also Figure 2, is a flowchart of a container-based ECU flashing method shown in an exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown in FIG. 1 is shown in FIG. 1 . It should be understood that the method may also be applicable to other exemplary implementation environments, and this embodiment does not limit the implementation environment to which the method is applicable. Figure 2 As shown, in an exemplary embodiment, the container-based ECU flashing method is applied to a host computer, the host computer communicates with multiple ECUs of the same model through a virtual local area network interface, and at least one ECU is configured in each vehicle. The method includes at least steps S210 to S230, which are described in detail as follows:

[0034] Step S210, receiving a control instruction for flashing multiple ECUs, the control instruction at least including a target number of ECUs to be flashed and a path of an upgrade file.

[0035] In one embodiment of the present application, the host computer communicates with the ECU through a virtual LAN interface. First, a virtual LAN needs to be created using a switch that supports the virtual LAN (VLAN) function, and then a one-to-one communication between the ECU and the virtual LAN is established, and then the network isolation is performed between the ECUs of the same model to avoid communication conflicts caused by the same IP addresses of the ECUs of the same model, thereby reducing the failure rate of flashing and the reliability of ECU flashing. Among them, the switch and the ECU are connected through an access port (access port), and the switch and the host computer are connected through a Trunk port (port aggregation), and the Trunk port allows data from different VLANs to pass without interfering with each other.

[0036] Specifically, each ECU is connected to a different access port, which is a port configured for a virtual LAN created based on a switch, and the access port and the virtual LAN correspond one to one; the same number of virtual LAN interfaces as the access port are created on the host computer; each virtual LAN interface is associated with a different access port, so that the host computer can establish communication with each ECU through different virtual LAN interfaces.

[0037] See also Figure 3 , is a schematic diagram of establishing communication between a host computer and an ECU according to an exemplary embodiment of the present application. Figure 3 As shown in the figure, taking the VLAN switch to create N virtual LANs as an example, N access ports are configured on the switch, each access port is assigned to a virtual LAN, and then each ECU is connected to a different virtual LAN through the access port, that is, ECU1 is connected to VLAN1, ECU2 is connected to VLAN2, and so on, until ECUN is connected to VLANN. The host computer carries the data transmission of N VLANs on the switch through the Trunk port.

[0038] In one embodiment of the present application, the host computer creates a virtual LAN interface including: installing a python operating environment and a docker (container) operating environment on the host computer's operating system, creating the same number of virtual LAN interfaces as the virtual LAN based on a physical network interface of the host computer, and binding each virtual LAN interface to a virtual LAN. Among them, the physical network interface needs to turn on the promiscuous mode, and the virtual LAN interface is essentially obtained by logically dividing the physical network interface, and is used to achieve logical network isolation on the same physical network without the need for additional physical interfaces or devices, thus reducing the cost of ECU flashing.

[0039] In this application, the parameters carried by the control instruction at least include the network address of the ECU, that is, the diagnostic IP address (Internet Protocol Address) of the ECU, as well as the logical address of the ECU, the IP address of the host computer, the logical address of the host computer, and the security key. Among them, the logical address of the ECU is used for the addressing of the ECU, the IP address of the host computer is the IP address in the running Docker environment, and the logical address of the host computer is used for the addressing of the host computer. In this way, the normal communication between the containers created subsequently and the host computer and the ECU is ensured; the security key is associated with a specific permission, thereby controlling the access level and operation permission between the container and the ECU. Only those who hold a valid security key can access the ECU and issue files. This permission management mechanism helps to achieve fine-grained access control and reduce security risks during the flashing process.

[0040] Step S220, encapsulate the preset flashing program into a container image, and create a target number of containers according to the container image and the control instruction. The container is dynamically created according to the target number and the container image in the control instruction, and the parameter list carried in the control instruction, that is, the parameters other than the target number, is passed to the preset flashing program in each container to ensure that the subsequent preset flashing program executes the flashing of the ECU based on the parameter list.

[0041] In one embodiment of the present application, the preset flash program is pre-written to implement the ECU flash function based on the DoIP protocol. All flash operations corresponding to the container can be completed by calling the preset flash program in the container. The container is an example of the operation of the container image. When the container is started, it will be initialized based on the content in the container image and create an independent operating environment. Since multiple containers need to run the preset flash program, in order to save the storage space of the host computer, each container shares the same container image encapsulated with the preset flash program. In this way, when the preset flash program needs to be updated, only the container image needs to be updated. It also reduces the time for repeated loading and initialization of multiple containers during flashing, improves the startup speed and operation efficiency of the container, and indirectly simplifies the flashing process and flashing efficiency.

[0042] In one embodiment of the present application, the preset flash program is encapsulated as a container image, including: encapsulating the preset writing program and all dependencies required for its operation, such as libraries, environment variables, configuration files, etc., in the container image. In this way, the deployment process of the preset flash program is simplified, and the preset writing program can be applied to different environments.

[0043] In one embodiment of the present application, a target number of containers is dynamically created, and the target number is less than or equal to the number of VLANs. Different containers all run the same preset flash program, are configured in different VLANs, are assigned different network addresses, i.e., IP addresses, and all mount the path of the upgrade file, i.e., the designated path of the upgrade file from the host computer to the inside of the container, and the preset flash program in the container is set to access the upgrade file only in read-only mode.

[0044] Step S230, running the preset flashing program in each container, so that the upgrade file is transmitted to each ECU through each communication link to complete the flashing of each ECU, wherein the communication link is constructed between the container and the ECU based on the virtual LAN interface in a one-to-one correspondence.

[0045] Specifically, before running the preset flash program, a communication link needs to be established, including: binding each container to a different virtual LAN interface; establishing a one-to-one communication link between the container and the ECU based on each bound virtual LAN interface, and each virtual LAN interface is associated with only one ECU. Among them, a unique first network address is assigned to each container, and the first network address of the container corresponding to the same virtual LAN interface and the second network address of the ECU are in the same network segment, and the second network addresses of each ECU are the same; a communication link is established based on the first network address of the container corresponding to the same virtual LAN interface and the second network address of the ECU.

[0046] In one embodiment of the present application, a macvlan (MAC Virtual Local Area Network) network is created for each container, and each macvlan network is associated with a different virtual local area network interface to bind each container to a VLAN. Figure 3 As shown in the figure, container1 is bound to VLAN1 through macvlan1, container2 is bound to VLAN2 through macvlan2, and so on, until containerN is bound to VLANN through macvlanN.

[0047] See also Figure 4 , is a schematic diagram of a flashing process of running a preset flashing program according to an exemplary embodiment of the present application. Figure 4 As shown, before the preset flashing program flashes the ECU, it is necessary to perform a connectivity check, that is, to check whether a socket connection is established between the host computer and the ECU in the container environment. If the connection fails, the retry mechanism automatically re-establishes the connection after the TCP connection and routing are activated.

[0048] Specifically, the ECU with the same virtual LAN interface as the container running the preset flashing program is used as the target control unit; the preset flashing program is used to detect whether the host computer and the target control unit are successfully connected within a preset time; if the connection is successful, a session instruction is sent to the target control unit to establish a coding session between the preset flashing program and the target control unit based on the session instruction; if the connection fails, the connection is re-established until the connection is successful or the number of connections reaches a preset number; the upgrade file is read according to the path of the upgrade file and sent to the target control unit to flash the target control unit.

[0049] In one embodiment of the present application, after the coding session is established between the preset flashing program and the target control unit, the security level can be unlocked according to the security key carried in the control instruction, so that the flashing can be performed after passing the security authentication, thereby ensuring the security of the data during the flashing process. After the fingerprint authentication is required, the flashing of the ECU can also be determined by writing the fingerprint information. For example, the above service is implemented by calling the key service in the UDS (Unified Diagnostic Services) protocol.

[0050] Specifically, completing the flashing of each ECU includes: using the preset flashing program in each container to transfer the flash operation file to the ECU with the same virtual LAN interface, the upgrade file includes the flash operation file (i.e., flashdriver file) and the application file, the flash operation file is used to erase and write the preset storage partition in the ECU; erasing the preset storage partition by loading the flash operation file, and writing the application file to the preset storage partition after the erasing is completed, so as to complete the flashing of each ECU.

[0051] In one embodiment of the present application, the paths of the flash operation file and the application file are defined separately, wherein the flashdriver file generally refers to the content in the Flash memory used to store programs and data in the ECU, including the basic software and configuration parameters required for the operation of the ECU. When updating the software of the ECU, it is first necessary to ensure that the old data in the Flash memory is correctly replaced to avoid conflicts or inconsistencies between the new and old data, thereby ensuring that the ECU can run correctly according to the new program. Therefore, it is necessary to write the flashdriver file first, and then write the application file. Among them, the 34 / 36 service and the 37 service in the UDS protocol can be called in sequence to implement the writing of the files.

[0052] In one embodiment of the present application, after the application is written to the ECU, the service regarding communication sessions in the UDS protocol can also be used to establish or maintain a communication session between the preset flashing program and the ECU, and a request for clearing DTC (Diagnostic Trouble Code) records can be sent to the ECU through the preset flashing program to control the ECU to clear all DTC records.

[0053] like Figure 4 As shown, after completing the flashing of each ECU, it is necessary to detect whether the flashing is successful, including: reading the current version information of the application file in the ECU through a preset flashing program; comparing the current version information with the version information carried by the application file in the upgrade file; if they are inconsistent, then feedback carrying the flag information of the flashing failure is sent to the host computer; if they are consistent, then feedback carrying the flag information of the flashing success is sent to the host computer.

[0054] See also Figure 5 , is a schematic diagram of the overall process of flashing ECU based on a container according to an exemplary embodiment of the present application. Figure 5 As shown in the figure, after the flashing of ECU is completed based on the container, the container needs to be destroyed. Specifically, when the flashing is successful or the flashing is recognized, the preset instruction is called based on the flag information to delete the container with the same virtual LAN interface as the ECU. The preset instruction is used to delete the container. In this way, the system resources occupied by the container during operation are released, saving the system resources of the host computer.

[0055] The container-based ECU flashing method proposed in this application has the following advantages: First, one-to-one communication between the container and the ECU is achieved through different VLANs, so that the communication between ECUs of the same model is isolated, and while realizing batch flashing of ECUs, communication conflicts between different ECUs are avoided; second, the preset flashing program is containerized, so that the preset flashing program has high flexibility and response speed, significantly simplifies the flashing process, and further improves the flashing efficiency. Third, there is no need to add additional hardware equipment, such as switches and professional flashing equipment, which reduces costs and system complexity.

[0056] See also Figure 6 , is a block diagram of a container-based ECU flashing device shown as an exemplary embodiment of the present application. The device can be applied to Figure 1 The implementation environment shown in FIG. 1 is shown in FIG. 1 . It should be understood that the present application does not limit the implementation environment of the device. The container-based ECU flashing device is applied to a host computer, which communicates with multiple ECUs of the same model through a virtual local area network interface. At least one ECU is configured in each vehicle, such as Figure 6 As shown, in an exemplary embodiment, the device at least includes an instruction receiving module 610, a container creating module 620 and a flashing module 630, which are described in detail as follows:

[0057] The instruction receiving module 610 is used to receive a control instruction for flashing multiple ECUs, where the control instruction at least includes a target number of ECUs to be flashed and a path of an upgrade file;

[0058] The container creation module 620 is used to encapsulate the preset flashing program into a container image, and create a target number of containers according to the container image and the control instructions;

[0059] The flashing module 630 is used to run the preset flashing program in each container, so that the upgrade file is transmitted to each ECU through each communication link to complete the flashing of each ECU, wherein the communication link is constructed one-to-one between the container and the ECU based on the virtual local area network interface.

[0060] It should be noted that the container-based ECU flashing device provided in the above embodiment and the container-based ECU flashing method provided in the above embodiment belong to the same concept, and the contents of the operations performed by each module have been described in detail in the method embodiment and will not be repeated here.

[0061] The present application also provides an electronic device, comprising: a processor, a memory and a communication bus; the communication bus is used to connect the processor and the memory; the processor is used to execute a computer program stored in the memory to implement the container-based ECU flashing method as in the above embodiment.

[0062] See also Figure 7 , shows a schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application. It should be noted that, Figure 7 The computer system 700 of the electronic device shown is only an example and should not bring any limitation to the functions and application scope of the embodiments of the present application.

[0063] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 702 or the program loaded from the storage part 708 to the random access memory (RAM) 703, such as executing the method in the above embodiment. In the RAM 703, various programs and data required for system operation are also stored. The CPU 701, the ROM 702 and the RAM 703 are connected to each other through the bus 704. The input / output (I / O) interface 705 is also connected to the bus 704.

[0064] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 704 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 709 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed so that a computer program read therefrom is installed into the storage section 708 as needed.

[0065] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, various functions defined in the system of the present application are executed. It should be noted that the container-based ECU flashing method and the container-based ECU flashing device have been described in detail in the above-mentioned method embodiment, and will not be repeated here.

[0066] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer executes the container-based ECU flashing method as described above. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.

[0067] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, system or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, system or device. A computer program contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0068] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0069] The above embodiments are merely illustrative of the principles and effects of the present application, and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.

Claims

1. A container-based ECU flashing method, characterized in that: Applied to a host computer, the host computer communicates with multiple ECUs of the same model through a virtual local area network interface, and at least one ECU is configured in each vehicle. The method includes: receiving a control instruction for flashing a plurality of the ECUs, the control instruction including at least a target number of the ECUs to be flashed and a path of an upgrade file; Encapsulating the preset flashing program into a container image, and creating the target number of containers according to the container image and the control instruction; The preset flashing program in each of the containers is run, so that the upgrade file is transmitted to each of the ECUs through each communication link to complete the flashing of each of the ECUs, wherein the communication link is constructed between the container and the ECU in a one-to-one correspondence based on the virtual LAN interface.

2. The container-based ECU flashing method according to claim 1, characterized in that: The communication link is constructed in a manner including: Binding each of the containers to different virtual local area network interfaces respectively; A one-to-one communication link is established between the container and the ECU based on each bound virtual LAN interface, and each virtual LAN interface is associated with only one ECU.

3. The container-based ECU flashing method according to claim 2, characterized in that: The establishing of a one-to-one communication link between the container and the ECU based on each of the bound virtual local area network interfaces includes: Allocating a unique first network address to each of the containers, and the first network address of the container corresponding to the same virtual local area network interface and the second network address of the ECU are in the same network segment, wherein the second network address of each of the ECUs is the same; A communication link is established according to the first network address of the container corresponding to the same virtual local area network interface and the second network address of the ECU.

4. The container-based ECU flashing method according to claim 1, characterized in that: The running of the preset flashing program in each container includes: The ECU having the same virtual local area network interface as the container running the preset flashing program is used as a target control unit; Using the preset flashing program to detect whether the host computer and the target control unit are successfully connected within a preset time; If the connection is successful, a session instruction is sent to the target control unit to establish a coding session between the preset flashing program and the target control unit based on the session instruction; If the connection fails, re-establish the connection until the connection succeeds or the number of connections reaches the preset number; The upgrade file is read according to the path of the upgrade file and sent to the target control unit to flash the target control unit.

5. The container-based ECU flashing method according to claim 4 is characterized in that: The step of completing the flashing of each ECU includes: Using the preset flash program in each container to transfer a flash operation file to the ECU of the same virtual local area network interface, the upgrade file includes the flash operation file and an application file, and the flash operation file is used to erase and write a preset storage partition in the ECU; The preset storage partition is erased by loading the flash operation file, and after the erasing is completed, the application file is written into the preset storage partition to complete the flashing of each ECU.

6. The container-based ECU flashing method according to claim 5, characterized in that: After the flashing of each ECU is completed, the method further includes: Read the current version information of the application file in the ECU through the preset flashing program; Compare the current version information with the version information carried by the application file in the upgrade file; If they are inconsistent, feedback containing a flag indicating that the flashing failed is sent to the host computer; If they are consistent, then the flag information carrying the flashing success is fed back to the host computer; A preset instruction is called based on the flag information to delete the container having the same virtual local area network interface as the ECU, wherein the preset instruction is used to delete the container.

7. The container-based ECU flashing method according to any one of claims 1 to 6, characterized in that: Before receiving the control instruction for flashing the plurality of ECUs, the method further includes: Connecting each of the ECUs to different access ports, respectively, where the access ports are ports configured by a virtual local area network created based on a switch, and the access ports correspond to the virtual local area networks one by one; Creating, on the host computer, the same number of the virtual LAN interfaces as the access ports; Each of the virtual local area network interfaces is associated with a different access port, so that the host computer establishes communication with each of the ECUs through the different virtual local area network interfaces.

8. A container-based ECU flashing device, characterized in that: Applied to a host computer, the host computer communicates with multiple ECUs of the same model through a virtual local area network interface, and at least one ECU is configured in each vehicle. The device includes: An instruction receiving module, used for receiving a control instruction for flashing a plurality of the ECUs, the control instruction at least including a target number of the ECUs to be flashed and a path of an upgrade file; A container creation module, used to encapsulate a preset flashing program into a container image, and create the target number of containers according to the container image and the control instruction; A flashing module is used to run the preset flashing program in each of the containers, so that the upgrade file is transmitted to each of the ECUs through each communication link to complete the flashing of each of the ECUs, wherein the communication link is constructed between the container and the ECU in a one-to-one correspondence based on the virtual local area network interface.

9. An electronic device, characterized in that: include: processor, memory, and communication bus; The communication bus is used to connect the processor and the memory; The processor is configured to execute the computer program stored in the memory to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is used to make a computer execute the method according to any one of claims 1 to 7.