Electronic control unit updating method and device, equipment and storage medium

By using the file reading function matching the operating system provided by the Flutter application to obtain and send update data, the problem that the program update device can only run on one operating system in the prior art is solved, cross-platform electronic control unit updates are realized, and the convenience and flexibility of updates are improved.

CN119759384AActive Publication Date: 2025-04-04BYD CO LTD

Patent Information

Application Number
CN202411393374.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-04-04
Estimated Expiration
2044-09-30

AI Technical Summary

Technical Problem

In the prior art, the program update device can only run on one operating system. When program updates are required based on other operating systems, the software needs to be redeveloped, resulting in inconvenience to update the electronic control unit.

Method used

The file reading function provided by the Flutter application is adopted to obtain the updated data according to the operating system type matching, and send the updated data to the electronic control unit to update it based on the updated data.

Benefits of technology

Cross-platform electronic control unit updates are realized, avoiding the trouble of redeveloping software due to changes in the operating system, and improving the convenience and flexibility of updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759384A_ABST
    Figure CN119759384A_ABST
Patent Text Reader

Abstract

The invention discloses an electronic control unit updating method, device and equipment and a storage medium, and relates to the technical field of automobile electronic control. The method comprises the following steps: in response to an operation of acquiring update data, acquiring the update data from a data source based on a file reading function which is provided by a Flutter application and is matched with an operating system of program update equipment, and sending the update data to an electronic control unit, so that the electronic control unit performs update based on the update data. The file reading function provided by the Flutter application is matched with the operating system of the program updating equipment. No matter which type of operating system of the program updating device is, the updated data can be read from the data source based on the file reading function provided by the Flutter application. Namely, according to the electronic control unit updating method provided by the invention, the operation system used by the program updating equipment is not limited, and the electronic control unit can be updated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automobile electronic control technology, and in particular to an electronic control unit updating method, device, equipment and storage medium. Background Art

[0002] The electronic control unit is an important part of the vehicle controller. With the upgrade of the vehicle control algorithm, in order to make the vehicle performance meet the requirements of the vehicle control algorithm, the electronic control unit needs to be updated.

[0003] In the related technology, the mobile electronic control unit (ECU) can be updated through a wireless diagnostic instrument or a wireless fieldbus protocol (Controller Area Network, CAN) device. Alternatively, the ECU can be updated by downloading or loading a local ECU update file from a server through native Android software.

[0004] However, the program updating device in the related art can only run in one operating system. When it is necessary to update the program based on other operating systems, the software of the program updating device needs to be developed again. Summary of the invention

[0005] The purpose of the present invention is to provide an electronic control unit updating method, device, equipment and storage medium, aiming to solve the technical problem in the related technology that the program updating device cannot be able to run on multiple platforms at the same time, and when the operating system changes, the software of the program updating device needs to be developed again, which makes it inconvenient to update the electronic control unit.

[0006] In order to achieve the above object, the present invention adopts the following technical scheme:

[0007] In a first aspect, the present application provides an electronic control unit updating method, which is applied to a program updating device, comprising: in response to an operation of obtaining update data, obtaining update data from a data source based on a file reading function provided by a Flutter application in the program updating device, wherein the file reading function provided by the Flutter application matches the operating system type; sending the update data to the electronic control unit, so that the electronic control unit is updated based on the update data.

[0008] The electronic control unit update method provided in the embodiment of the present application obtains the update data from the data source based on the file reading function provided by the Flutter application and matching the operating system of the program update device in response to the operation of obtaining the update data, and sends the update data to the electronic control unit, so that the electronic control unit is updated based on the update data. It can be understood that different types of operating systems have different operations when reading data, that is, the file reading functions of different types of operating systems are different, and the file reading function provided by the Flutter application installed in the program update device in the present application matches the operating system of the program update device. In this way, no matter what type of operating system the program update device is, the update data can be read from the data source based on the file reading function provided by the Flutter application. In other words, the electronic control unit update method provided in the present application does not limit the operating system used by the program update device, and can complete the update of the electronic control unit, and has the characteristic of being able to realize the update of the electronic control unit across platforms.

[0009] In some embodiments, the above method also includes: obtaining a target Flutter application toolkit that matches the operating system used by the program update device; and building a Flutter application based on the target Flutter application toolkit.

[0010] In some embodiments, sending the update data to the electronic control unit includes: sending the update data to a CAN device via a CAN protocol, so that the CAN device sends the update data to the electronic control unit via CAN communication.

[0011] In some embodiments, the protocol stack of the CAN protocol includes an application layer, which encapsulates a communication service interface and a parameter configuration service interface related to the diagnostic message, so that the program update device can interact with the CAN device and / or data source through the communication service interface and / or parameter configuration service interface.

[0012] In some embodiments, the protocol stack of the CAN protocol also includes a presentation layer and a session layer. The presentation layer is used to encode and convert instructions received by the application layer and send them to the session layer; the encoding conversion includes at least one of the following: binary to hexadecimal conversion, binary to decimal conversion.

[0013] In some embodiments, the session layer implements data communication with the CAN device through the Socket library of the Dart language.

[0014] In some embodiments, when the operating system used by the program update device is the Android system, the file reading function is written based on Java or Kotlin; when the operating system used by the program update device is the IOS system, the file reading function is written based on Objective-C or Swift; when the operating system used by the program update device is the Windows system, the file reading function is written based on C++ or C#.

[0015] In some embodiments, when the operating system used by the program update device is the Android system, the target Flutter application toolkit is built based on Gradle, and the program update device builds the Flutter application by running the Flutter bulid apk command; when the operating system used by the program update device is the IOS system, the target Flutter application toolkit is built based on Xcode, and the program update device builds the Flutter application by running the Flutter bulid ios command; when the operating system used by the program update device is the Windows system, the program update device builds the Flutter application by running the Flutter bulid windows command.

[0016] In a second aspect, the present application provides an electronic control unit update system, including: a data source, a program update device and an electronic control unit; the data source is used to store update data; the program update device is used to, in response to an operation of obtaining update data, obtain update data from the data source based on a file reading function provided by a Flutter application in the program update device, and the file reading function provided by the Flutter application matches the operating system type; the update data is sent to the electronic control unit, so that the electronic control unit is updated based on the update data.

[0017] In a third aspect, the present application provides an electronic control unit updating device, comprising a first acquisition unit and an update unit: the first acquisition unit is used to respond to an operation of obtaining update data, and obtain update data from a data source based on a file reading function provided by a Flutter application in a program update device, and the file reading function provided by the Flutter application matches the operating system type; the update unit is used to send the update data to the electronic control unit, so that the electronic control unit is updated based on the update data.

[0018] In some embodiments, the apparatus further includes: a second acquisition unit and a construction unit; the second acquisition unit is used to acquire a target Flutter application toolkit that matches the operating system used by the program update device; the construction unit is used to build a Flutter application based on the target Flutter application toolkit.

[0019] In some embodiments, the update unit is specifically used to send the update data to the CAN device via the CAN protocol, so that the CAN device sends the update data to the electronic control unit via CAN communication.

[0020] In some embodiments, the protocol stack of the CAN protocol includes an application layer, which encapsulates a communication service interface and a parameter configuration service interface related to the diagnostic message, so that the program update device can interact with the CAN device and / or data source through the communication service interface and / or parameter configuration service interface.

[0021] In some embodiments, the protocol stack of the CAN protocol also includes a presentation layer and a session layer. The presentation layer is used to encode and convert instructions received by the application layer and send them to the session layer; the encoding conversion includes at least one of the following: binary to hexadecimal conversion, binary to decimal conversion.

[0022] In some embodiments, the session layer implements data communication with the CAN device through the Socket library of the Dart language.

[0023] In some embodiments, when the operating system used by the program update device is the Android system, the file reading function is written based on Java or Kotlin; when the operating system used by the program update device is the IOS system, the file reading function is written based on Objective-C or Swift; when the operating system used by the program update device is the Windows system, the file reading function is written based on C++ or C#.

[0024] In some embodiments, when the operating system used by the program update device is the Android system, the target Flutter application toolkit is built based on Gradle, and the program update device builds the Flutter application by running the Flutter bulid apk command; when the operating system used by the program update device is the IOS system, the target Flutter application toolkit is built based on Xcode, and the program update device builds the Flutter application by running the Flutter bulid ios command; when the operating system used by the program update device is the Windows system, the program update device builds the Flutter application by running the Flutter bulid windows command.

[0025] In a fourth aspect, the present application provides a device comprising: a processor and a memory configured to store processor executable instructions; wherein the processor is configured to execute the instructions to implement any one of the optional electronic control unit update methods in the first aspect above.

[0026] In a fifth aspect, the present application provides a computer-readable storage medium having instructions stored thereon. When the instructions in the computer-readable storage medium are executed by a device, the device is enabled to execute any one of the optional electronic control unit update methods described in the first aspect above.

[0027] In a sixth aspect, the present application provides a computer program product, which includes computer instructions. When the computer instructions are executed on a processor of a device, the device is capable of executing any optional electronic control unit update method as described in the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0029] Figure 1 A schematic diagram of the structure of an electronic control unit update system provided in an embodiment of the present application;

[0030] Figure 2 A flowchart of an electronic control unit updating method provided in an embodiment of the present application;

[0031] Figure 3 A flowchart of another electronic control unit updating method provided in an embodiment of the present application;

[0032] Figure 4 It is a structural diagram of the ISO seven-layer network model;

[0033] Figure 5 A schematic diagram of building a Flutter application in different operating systems provided in an embodiment of the present application;

[0034] Figure 6 A schematic diagram of the structure of a cross-platform plug-in for CAN communication and file services provided in an embodiment of the present application;

[0035] Figure 7 A schematic diagram of the page where the Flutter application runs on the program update device;

[0036] Figure 8 A flowchart of updating an electronic control unit provided in an embodiment of the present application;

[0037] Fig. 9 A schematic diagram of the structure of an electronic control unit updating device provided in an embodiment of the present application;

[0038] Fig.10 A block diagram of a device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0039] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0040] In the description of the present invention, it should be understood that the terms "upper", "lower", "left", "right", "front", "back", "inside", "outside" and the like indicate directions or positional relationships based on the directions or relative positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as a limitation on the present invention. Unless otherwise specified, the above-mentioned directional description can be flexibly set in the process of actual application under the condition that the relative positional relationship shown in the accompanying drawings is satisfied.

[0041] The terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, "plurality" means two or more.

[0042] In the embodiments of the present invention, the terms "comprises", "comprising" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, article or device including the element.

[0043] In the embodiments of the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0044] In the description of this specification, specific features, structures, materials or characteristics may be combined in an appropriate manner in any one or more embodiments or examples.

[0045] Terminology explanation:

[0046] 1. Electronic Control Unit (ECU) is a miniature computer management center. It takes signal (data) collection, calculation, analysis and judgment, and decision-making as input, and then issues control instructions and directs the actuator to work as output. It also provides stable power supply or reference voltage to the sensor. In this application, the electronic control unit can be a vehicle ECU.

[0047] 2. Cross-platform application development framework (Flutter), Flutter is an open source application development framework from Google. With just one set of code, it can run on six operating systems: Android, iOS, World Wide Web (Web), Windows, macOS, and Linux. In this application, Flutter allows developers to write code and then compile it into applications that can run on three operating systems: iOS, Android, and Windows.

[0048] 3. Fieldbus protocol (Controller Area Network, CAN) is a serial communication protocol bus used for real-time applications, mostly used for vehicle communication.

[0049] 4. Unified Diagnostic Services (UDS) implements accurate fault diagnosis and maintenance operations through a clear set of instructions (such as reading fault codes and data streams). Located in the application layer.

[0050] 5. Computer programming language (Dart), which is an object-oriented, class-defined, single-inheritance language. Dart is the main development language for Flutter applications. In this application, Flutter allows developers to write code in Dart and then compile it into applications that can run on three operating systems: iOS, Android, and Windows.

[0051] With the rapid development of automobile technology, especially the continuous upgrading of vehicle control algorithms, ECU, as the core component of automobile control system, its performance and functions must be updated accordingly to meet higher demands.

[0052] In the related technology, the update of ECU is based on the design process requirements of a certain car model. A set of PC-side programs is developed based on the diagnostic protocol to flash the host computer. The application is in the form of S19 file, and the data is transmitted through the CAN network according to the communication protocol process to realize the ECU program update and upgrade. This process generally requires the preparation of the application S19 file that needs to be updated on the PC in advance, and then the CAN box is connected to the PC via a USB cable, and connected to the car ECU via DB9. The PC installation program flashes the host computer and updates the ECU program by selecting the S19 file. However, this method of program flashing tools can only run on the PC side, and there is a problem of a single operating platform.

[0053] Alternatively, in the related technology, the ECU program can also be updated through a diagnostic instrument. This method can be used to update a certain ECU installed on the vehicle, or to upgrade the ECU before disassembly or installation. The mobile ECU software upgrade solution can be implemented through a wireless diagnostic instrument or a wireless CAN device. However, for the mobile ECU software upgrade solution, since the suppliers of WiFi wireless CAN devices or diagnostic instruments generally provide Android SDK for the purchaser's native Android secondary development, the current ECU mobile terminal burning solution of some domestic automotive controller suppliers is a native Android App, which downloads or loads the local ECU update file from the server through the native Android App for software upgrade.

[0054] It can be seen that the program update device in the related art can only run on one operating system. When it is necessary to update the program based on other operating systems, the software of the program update device needs to be developed again, which makes it inconvenient to update the electronic control unit.

[0055] Based on this, an embodiment of the present application provides an electronic control unit update method, which is applied to a program update device. The method obtains update data from a data source based on a file reading function provided by a Flutter application and matching the operating system of the program update device in response to an operation of obtaining update data, and sends the update data to the electronic control unit, so that the electronic control unit is updated based on the update data. It can be understood that different types of operating systems have different operations when reading data, that is, different types of operating systems have different file reading functions, and the file reading function provided by the Flutter application installed in the program update device in the present application matches the operating system of the program update device. In this way, regardless of the type of operating system of the program update device, the update data can be read from the data source based on the file reading function provided by the Flutter application. In other words, the electronic control unit update method provided in the present application does not limit the operating system used by the program update device, and can complete the update of the electronic control unit, and has the characteristic of being able to implement the update of the electronic control unit across platforms.

[0056] It should be understood that the electronic control unit update method provided in the present application can be applied to an electronic control unit update system, such as Figure 1 As shown, the electronic control unit updating system includes: a data source 100 , a program updating device 200 and an electronic control unit 300 .

[0057] The data source 100 is used to store update data.

[0058] The program update device 200 is used to, in response to the operation of obtaining update data, obtain update data from the data source 100 based on the file reading function provided by the Flutter application in the program update device 200. The file reading function provided by the Flutter application matches the operating system type.

[0059] The program updating device 200 is further configured to send the update data to the electronic control unit 300 so that the electronic control unit 300 is updated based on the update data.

[0060] It should be understood that the embodiment of the present application does not limit the operating system used by the program update device 200. The operating system used by the program update device 200 can be an Android system, an IOS system, or a Windows system.

[0061] In some embodiments, Figure 1As shown, the control unit update system also includes a CAN device 400. The program update device 200 communicates with the CAN device 400 via WIFI, and the electronic control unit 300 is connected to the CAN device 400 via a D-type data interface connector (DB9). After the program update device 200 obtains the update data from the data source 100, it sends the update data to the electronic control unit 300 via the CAN device 400, so that the electronic control unit 300 is updated according to the update data.

[0062] It should be understood that in the related art, the program update device 200 and the CAN device 400 need to be connected via a Universal Serial Bus (USB), which has the problem of limited length of the connection line. The present application realizes the program update device 200 and the CAN device via WIFI, avoiding the update of the electronic control unit due to the limitation of the communication bus length.

[0063] The data source 100 may be a device capable of storing data, for example, a server.

[0064] It should be noted that the data source 100 and the program updating device 200 may be an integrated device or two separate devices with a communication connection, and the embodiment of the present application does not limit this.

[0065] In the embodiment of the present application, the program update device 200 may be a terminal device, such as a personal computer (PC), a notebook computer, a mobile device, a tablet computer, a laptop computer, etc. The embodiment of the present application does not limit the specific form of the electronic device. Alternatively, the program update device 200 may also be a single server, or a server cluster composed of multiple servers. In some implementations, the server cluster may be a distributed cluster server. The embodiment of the present application does not impose any restrictions on the specific form of the program update device 200.

[0066] It should be pointed out that Figure 1 The structure shown does not constitute a limitation on the electronic control unit update system. In other embodiments, the system may include fewer or more components than shown in the figure, or a combination of certain components, or a different arrangement of components. The embodiments of the present application do not impose any limitations on this.

[0067] It should be understood that the electronic control unit update method provided in the embodiment of the present application can be applied to Figure 1 In the program update device of the electronic control unit update system shown in the figure. Figure 2 As shown, the electronic control unit updating method provided in the embodiment of the present application includes S201 - S202 .

[0068] S201. In response to an operation of obtaining update data, update data is obtained from a data source based on a file reading function provided by a Flutter application in a program update device.

[0069] Among them, the file reading function provided by the Flutter application matches the operating system type. The Flutter application is a program developed based on the Flutter platform. Since the Flutter platform is a cross-platform application development framework, developing a Flutter application based on the Flutter platform can enable the Flutter application to run in multiple types of operating systems.

[0070] It should be noted that the file reading function methods corresponding to different operating systems are different. The operating systems in this application include: Android system, IOS system and Windows system.

[0071] In some embodiments, when the operating system used by the program update device is an Android system, the file reading function is written based on the Java programming language (Java) or a static programming language (kotlin).

[0072] It is understandable that the Android system is an open source mobile operating system based on the Linux kernel, but its application layer is mainly written in Java and runs through the Dalvik or ART (Android Runtime) virtual machine. Java, as an object-oriented programming language, has become the basis for building the Android system and its application framework because of its simplicity, efficiency and cross-platform characteristics. Kotlin, as another static programming language, has also been widely used in Android development in recent years because it is highly interoperable with Java and provides simpler syntax and richer functions. Therefore, in the case where the operating system used by the program update device is the Android system, the file reading function written in the Java programming language (Java programming language, Java) or the static programming language (kotlin) can be used.

[0073] The process of obtaining updated data based on Java or Kotlin generally includes: determining the path to read data, creating a FileInputStream object, reading data and closing the stream. The path to read data can be reading from the application's internal storage, external storage or a specific directory. In this application, the path to read data is to read updated data from a data source, and the data source can be local or server. Local can be understood as internal storage, and server can be understood as external storage.

[0074] In other embodiments, when the operating system used by the program update device is an IOS system, the file reading function is written based on Objective-C or Swift.

[0075] It is understandable that the iOS system is a mobile operating system developed by developers. Based on the efficient execution of the C language and the object-oriented capabilities of the Smalltalk language, the developers specifically proposed the Objective-C language. Due to its close integration with the Apple system, Objective-C has become one of the standard languages ​​for Apple system application development. As a substitute for Objective-C, Swift has been widely used for its simpler syntax and more powerful functions compared to Objective-C. Therefore, when the operating system used by the program update device is the iOS system, the file reading function written based on Objective-C or Swift can be used.

[0076] The process of obtaining updated data based on Objective-C or Swift generally includes: determining the path to read data and reading data. Among them, Objective-C uses stringWithContentsOfFile:encoding:error: of NSString to read data.

[0077] In some other embodiments, when the operating system used by the program updating device is Windows, the file reading function is written based on C++ or C#.

[0078] It is understandable that the Windows system is an operating system based on multiple programming languages. These mainly include: C++, C#, C language, assembly language, etc. C++ is a compiled language, and its program will be compiled into machine code before execution, so C++ has high execution efficiency. At the same time, C++ has good compatibility, making C++ the basis for building application frameworks in Windows systems. As a high-level language, C# can quickly develop safe and reliable applications with the support of the .NET framework. In the case where the operating system used by the program update device is the Windows system, the file reading function written in C++ or C# can be used.

[0079] The process of obtaining updated data based on C++ or C# generally includes two steps: determining the path to read data and reading data. When using C++, you need to include the header file, and you can use ifstream to read the updated data. Using C#, you can write a file reading function in the .NET environment.

[0080] As a possible implementation method, when the electronic control unit is updated based on the update data, the user clicks the "Update" button in the program update device, that is, the program update device obtains the control instruction to update the electronic control unit, and the program update device obtains the update data from the data source according to the file reading function provided by the Flutter application, where the data source can be local or server.

[0081] S202: Send the update data to the electronic control unit, so that the electronic control unit is updated based on the update data.

[0082] It should be understood that in some embodiments, the continuity and stability of the ECU's operation are crucial when it is controlling the operation of the vehicle. If updates are allowed to be performed while the ECU is in operation, unexpected interruptions during the update process (such as sudden power outages, unstable network connections, etc.) may cause ECU failures, thereby affecting the normal operation and safety of the vehicle. Therefore, updates cannot be completed when the electronic control unit is in operation.

[0083] Based on this, as a feasible implementation method, before the program update device sends the update data to the electronic control unit, the program update device can send a program update request to the electronic control unit to obtain the status of the electronic control unit, and then update the electronic control unit when it is in a non-working state, so as to avoid affecting the driving of the vehicle due to the update of the electronic control unit.

[0084] Specifically, before the program update device sends the update data to the electronic control unit, the program update device may send a program update request to the electronic control unit. After receiving the program update request, the electronic control unit confirms whether the electronic control unit can be updated, and replies to the program update device with a message indicating that the update can be performed or not. When the reply message received by the program update device indicates that the update can be performed, the update data is sent to the electronic control unit.

[0085] It should be noted that there may be multiple electronic control units, so the program update request sent by the program update device to the electronic control unit carries the identification of the electronic control unit. The program update device can send the update data to the electronic control unit corresponding to the identification according to the identification of the electronic control unit, so that the electronic control unit corresponding to the identification is updated based on the update data.

[0086] The electronic control unit update method of the embodiment of the present application, by responding to the operation of obtaining update data, obtains update data from the data source based on the file reading function provided by the Flutter application and matching the operating system of the program update device, and sends the update data to the electronic control unit, so that the electronic control unit is updated based on the update data. It can be understood that different types of operating systems have different operations when reading data, that is, the file reading functions of different types of operating systems are different, and the file reading function provided by the Flutter application installed in the program update device in the present application matches the operating system of the program update device. In this way, no matter what type of operating system the program update device is, the update data can be read from the data source based on the file reading function provided by the Flutter application. In other words, the electronic control unit update method provided in the present application does not limit the operating system used by the program update device, and can complete the update of the electronic control unit, and has the characteristic of being able to implement the update of the electronic control unit across platforms.

[0087] It should be noted that the technical solution of the present application is only described for operating systems such as Android, IOS and Windows, and does not constitute a limitation on the present solution. The technical solution of the present application is also applicable to other operating systems applicable to Flutter.

[0088] Combination Figure 1 ,like Figure 3 As shown, in an implementation method provided in an embodiment of the present application, before obtaining the update data, it is necessary to build a Flutter application in the operating system, so the above-mentioned electronic control unit update method may also include S301-S302.

[0089] S301. Obtain a target Flutter application toolkit that matches the operating system used by the program update device.

[0090] It is understandable that due to the differences in performance, compatibility and other characteristics of different operating systems, the construction process of the Flutter application toolkit corresponding to different operating systems is also different.

[0091] In some embodiments, when the operating system used by the program update device is an Android system, the target Flutter application toolkit is built based on the project automated build open source tool (Gradle).

[0092] It is understandable that Gradle supports cross-platform functions, and at the same time, Gradle supports incremental building, high efficiency in building projects, and Android Studio has built-in support for Gradle, which allows developers to manage the project building process, making Gradle widely used in building Flutter application toolkits on the Android system. Therefore, when the operating system used by the program update device is the Android system, the target Flutter application toolkit can be built based on the project automation build open source tool (Gradle).

[0093] In some embodiments, when the operating system used by the program update device is an iOS system, the target Flutter application toolkit is built based on an integrated development tool (Xcode) running on the Mac OS X operating system.

[0094] It is understandable that Xcode is the official integrated development environment provided by the iOS system. Xcode provides comprehensive development tools and framework support, which improves development efficiency and reduces development difficulty. At the same time, Xcode can reduce the cost and time of cross-platform development, making Xcode one of the preferred tools for iOS application development. Therefore, when the operating system used by the program update device is the iOS system, the target Flutter application toolkit can be built based on the integrated development tool (Xcode) running on the Mac OS X operating system.

[0095] In some embodiments, because Flutter has prepared the necessary build logic, configuration, and dependencies for the Windows system, developers can build Flutter applications in the Windows system without installing or configuring additional toolkits. If the operating system used by the program update device is the Windows system, you can install VisualStudio, use the Flutter create command to create a new Flutter project, and choose to add Windows support when creating it, so that you can build Flutter applications in the Windows system.

[0096] It should be noted that when developing a Flutter application, the process of building a Flutter application corresponding to each operating system has been written into the program. When building a Flutter application, you only need to call the Flutter application toolkit that matches the operating system to build the Flutter application in the operating system.

[0097] S302: Build a Flutter application based on the target Flutter application toolkit.

[0098] In some embodiments, when the operating system used by the program update device is an Android system, the program update device builds a Flutter application by running the Flutter build apk command. The specific process includes: running the Flutter build apk command to build an APK file. This command compiles the Dart code into machine code and packages all necessary resources into an APK file, which can be installed and run on an Android device.

[0099] In some embodiments, when the operating system used by the program update device is an iOS system, the program update device builds a Flutter application by running the Flutter build ios command. The specific process includes: running the Flutter build ios command to build an iOS application, which generates an Xcode project. In Xcode, the Archive function can be used to package the application and publish it to an app store or for Ad Hoc distribution.

[0100] In some embodiments, when the operating system used by the program update device is a Windows system, the program update device builds a Flutter application by running the Flutter build windows command. The specific process includes: running the Flutter build windows command generates an executable file (.exe), which can be run in the Windows system.

[0101] In the embodiment of the present application, when developing the Flutter application, the process of building the Flutter application corresponding to each operating system has been written in the program. When building the Flutter application, it is only necessary to call the Flutter application toolkit matching the operating system to build the Flutter application in the operating system. That is, regardless of the type of operating system of the program update device, the Flutter application can be built in the program update device.

[0102] In one implementation of the embodiment of the present application, in combination Figure 1 The above-mentioned sending of the update data to the electronic control unit may specifically include S401.

[0103] S401 . Sending update data to a CAN device via a CAN protocol, so that the CAN device sends the update data to an electronic control unit via CAN communication.

[0104] In some embodiments, Figure 4As shown, the ISO seven-layer network model includes from bottom to top: physical layer, data link layer, network layer, transport layer, session layer, presentation layer and application layer. Based on the ISO seven-layer network model, different systems and networks can communicate. In this application, the CAN device and the program update device communicate based on the ISO seven-layer network model.

[0105] As a feasible implementation method, the protocol stack of the CAN protocol includes an application layer, which encapsulates the communication service interface and parameter configuration service interface related to the diagnostic message, so that the program update device can interact with the CAN device and / or data source through the communication service interface and / or parameter configuration service interface.

[0106] Exemplarily, the communication service interface may include: a data sending request interface (N_USData_request), a request confirmation service interface (N_USData_comfirm), a first frame indication service interface (N_USData_FF_indication) and a data indication service interface (N_USData_indication), and the parameter configuration service interface may include a parameter configuration request service interface (N_ChangeParameter_request) and a parameter configuration confirmation service interface (N_ChangeParameter_comfirm).

[0107] The data sending request service interface is used to indicate sending a data sending request to the electronic control unit. The request confirmation service is used to indicate whether the electronic control unit responds to the data sending request to confirm whether the updated data is sent successfully. The first frame indication service is used to indicate the first frame of the updated data. The data indication service is used to indicate the start or completion of receiving the updated data. The parameter configuration request service is used to indicate the adjustment of the parameters for sending the updated data. The parameter configuration confirmation service is used to indicate whether the parameters are adjusted successfully after responding to the parameter configuration request.

[0108] In some embodiments, since the CAN device and the vehicle controller (i.e., the electronic control unit) need to comply with the ISO15765-2 specification at the network layer and the transport layer, the protocol stack of the CAN protocol also includes a presentation layer and a session layer. The presentation layer is used to encode and convert the instructions received by the application layer and send them to the session layer. The session layer implements data communication with the CAN device through the Socket library of the Dart language.

[0109] The code conversion includes at least one of the following: binary to hexadecimal conversion, binary to decimal conversion. The code conversion enables the code that complies with the UDS specification to be converted into the code that complies with the ISO15765-2 specification.

[0110] It should be noted that the session layer in the ISO seven-layer network model is equivalent to providing a method for establishing a connection between physical devices and realizing communication between devices. In this application, the session layer provides a method for the program update device to establish a connection with the CAN device, and uses the Socket library of the Dart language to realize data communication with CAN, specifically including: establishing a TCP / IP connection, sending message data, monitoring data, closing the connection, etc.

[0111] In the present application embodiment, Figure 5 As shown, Figure 5 This is a schematic diagram of building Flutter applications in different operating systems, including: CAN communication and file service cross-platform plug-ins, specific burning services, Flutter applications, and building Flutter applications in Android systems, IOS systems, and Windows systems respectively through bulid apk, bulid ios, and bulid windows instructions.

[0112] Among them, the Flutter application realizes the CAN communication function and the file service function through the CAN communication and file service cross-platform plug-in. The CAN communication function is used to establish communication between the program update device and the CAN device quality inspection. The file service function is used to obtain the update data and send the update data to the CAN device through the CAN protocol, so that the CAN device sends the update data to the electronic control unit through CAN communication.

[0113] The specific burning service means obtaining update data and updating the electronic control unit according to the update data.

[0114] like Figure 6 As shown, the Flutter application can provide a platform channel, based on which CAN communication and file service plug-in can communicate with Android system, IOS system and Windows system.

[0115] like Figure 7 As shown, Figure 7 A schematic diagram of the page where the Flutter application runs on the program update device.

[0116] The page of the above Flutter application includes a project type search box and a barcode scan button, so you can get the update data by entering in the search box or scanning the barcode. Connect CAN means to establish communication with the CAN device. Start burning means to update the electronic control unit.

[0117] The following is an example to illustrate the method for updating an electronic control unit provided in an embodiment of the present application.

[0118] For example, Figure 8As shown, the process of updating the electronic control unit according to the update data may include:

[0119] S801, diagnostic session mode.

[0120] It should be noted that the prerequisite for UDS flashing the program is to enter the session mode first. The session mode is used to distinguish the execution status of diagnostic services under different permissions. There are three types: default session, programming session and extended session. Program flashing can be achieved in the programming session mode.

[0121] S802. Secure access.

[0122] It should be noted that when UDS flashes the program, you can request a seed and key to unlock the ECU in order to obtain read and write permissions.

[0123] S803, erase the original data of ECU.

[0124] S804: Request to download update data.

[0125] S805: Transmit updated data.

[0126] S806, transmission exits.

[0127] S807: Is data transmission completed?

[0128] S808. Check data integrity.

[0129] S809, reset.

[0130] The above embodiment takes the process of UDS flashing program as an example to illustrate the process of updating the electronic control unit according to the update data. Since the ECU update process of different automotive ECU suppliers or OEMs may be different, but they all follow the ISO14229-1 specification. Therefore, this application does not limit the specific process of updating the electronic control unit according to the update data.

[0131] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to achieve the above functions, the electronic control unit update device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0132] The embodiment of the present application can divide the functional modules of the electronic control unit update device according to the above method. For example, the electronic control unit update device can include various functional modules corresponding to the various functional divisions, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation.

[0133] The present application also provides an electronic control unit update system, including: a data source, a program update device and an electronic control unit; the data source is used to store update data; the program update device is used to, in response to an operation of obtaining update data, obtain update data from the data source based on a file reading function provided by a Flutter application in the program update device, and the file reading function provided by the Flutter application matches the operating system type; the update data is sent to the electronic control unit, so that the electronic control unit is updated based on the update data.

[0134] In some embodiments, the program update device is further used to obtain a target Flutter application toolkit that matches the operating system used by the program update device; and build a Flutter application based on the target Flutter application toolkit.

[0135] In some embodiments, the program updating device is used to send the updating data to the CAN device via the CAN protocol, so that the CAN device sends the updating data to the electronic control unit via CAN communication.

[0136] In some embodiments, the protocol stack of the CAN protocol includes an application layer, which encapsulates a communication service interface and a parameter configuration service interface related to the diagnostic message, so that the program update device can interact with the CAN device and / or data source through the communication service interface and / or parameter configuration service interface.

[0137] In some embodiments, the protocol stack of the CAN protocol also includes a presentation layer and a session layer. The presentation layer is used to encode and convert instructions received by the application layer and send them to the session layer; the encoding conversion includes at least one of the following: binary to hexadecimal conversion, binary to decimal conversion.

[0138] In some embodiments, the session layer implements data communication with the CAN device through the Socket library of the Dart language.

[0139] In some embodiments, when the operating system used by the program update device is the Android system, the file reading function is written based on Java or Kotlin; when the operating system used by the program update device is the IOS system, the file reading function is written based on Objective-C or Swift; when the operating system used by the program update device is the Windows system, the file reading function is written based on C++ or C#.

[0140] In some embodiments, when the operating system used by the program update device is the Android system, the target Flutter application toolkit is built based on Gradle, and the program update device builds the Flutter application by running the Flutter bulid apk command; when the operating system used by the program update device is the IOS system, the target Flutter application toolkit is built based on Xcode, and the program update device builds the Flutter application by running the Flutter bulid ios command; when the operating system used by the program update device is the Windows system, the program update device builds the Flutter application by running the Flutter bulid windows command.

[0141] Fig. 9 A possible structural diagram of the electronic control unit updating device involved in the above embodiment is shown. Fig. 9 The electronic control unit updating device 900 includes: a first acquiring unit 901 and an updating unit 902 .

[0142] The first acquisition unit 901 is used to obtain the update data from the data source in response to the operation of obtaining the update data based on the file reading function provided by the Flutter application in the program update device, where the file reading function provided by the Flutter application matches the operating system type.

[0143] The updating unit 902 is used to send the updating data to the electronic control unit so that the electronic control unit is updated based on the updating data.

[0144] In some embodiments, the apparatus further includes: a second acquisition unit and a construction unit; the second acquisition unit is used to acquire a target Flutter application toolkit that matches the operating system used by the program update device; the construction unit is used to build a Flutter application based on the target Flutter application toolkit.

[0145] In some embodiments, the updating unit 902 is specifically configured to send the updating data to the CAN device via the CAN protocol, so that the CAN device sends the updating data to the electronic control unit via the CAN communication.

[0146] In some embodiments, the protocol stack of the CAN protocol includes an application layer, which encapsulates a communication service interface and a parameter configuration service interface related to the diagnostic message, so that the program update device can interact with the CAN device and / or data source through the communication service interface and / or parameter configuration service interface.

[0147] In some embodiments, the protocol stack of the CAN protocol also includes a presentation layer and a session layer. The presentation layer is used to encode and convert instructions received by the application layer and send them to the session layer; the encoding conversion includes at least one of the following: binary to hexadecimal conversion, binary to decimal conversion.

[0148] In some embodiments, the session layer implements data communication with the CAN device through the Socket library of the Dart language.

[0149] In some embodiments, when the operating system used by the program update device is the Android system, the file reading function is written based on Java or Kotlin; when the operating system used by the program update device is the IOS system, the file reading function is written based on Objective-C or Swift; when the operating system used by the program update device is the Windows system, the file reading function is written based on C++ or C#.

[0150] In some embodiments, when the operating system used by the program update device is the Android system, the target Flutter application toolkit is built based on Gradle, and the program update device builds the Flutter application by running the Flutter bulid apk command; when the operating system used by the program update device is the IOS system, the target Flutter application toolkit is built based on Xcode, and the program update device builds the Flutter application by running the Flutter bulid ios command; when the operating system used by the program update device is the Windows system, the program update device builds the Flutter application by running the Flutter bulid windows command.

[0151] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0152] Fig.10 FIG. 1 shows a block diagram of the devices involved in the above embodiments. Fig.10 As shown, the device 1000 includes but is not limited to: a processor 1001 and a memory 1002.

[0153] The memory 1002 is used to store executable instructions of the processor 1001. It can be understood that the processor 1001 is configured to execute instructions to implement the group fault detection method in the above embodiment.

[0154] It should be noted that those skilled in the art can understand that Fig.10 The device structure shown in the figure does not constitute a limitation on the device, and the device may include Fig.10 More or fewer components may be shown, or certain components may be combined, or the components may be arranged differently.

[0155] The processor 1001 is the control center of the device. It uses various interfaces and lines to connect various parts of the entire device. By running or executing software programs and / or modules stored in the memory 1002 and calling data stored in the memory 1002, it executes various functions of the device and processes data, thereby monitoring the device as a whole. The processor 1001 may include one or more processing units. Optionally, the processor 1001 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1001.

[0156] The memory 1002 may be used to store software programs and various data. The memory 1002 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one functional module (such as a determination unit, a processing unit, etc.), etc. In addition, the memory 1002 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0157] In an exemplary embodiment, the present application also provides a vehicle, comprising the above-mentioned device.

[0158] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 1002 including instructions, and the above instructions can be executed by the processor 1001 of the device 1000 to implement the method in the above embodiment.

[0159] In actual implementation, Fig. 9 The first acquisition unit 901 and the update unit 902 in the embodiment can both be composed of Fig.10The processor 1001 in the embodiment calls the computer program stored in the memory 1002 to implement. The specific execution process can refer to the description of the method part in the above embodiment, which will not be repeated here.

[0160] Optionally, the computer-readable storage medium may be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0161] In an exemplary embodiment, the present application also provides a computer program product including one or more instructions, and the one or more instructions can be executed by the processor 1001 of the device to complete the method in the above embodiment.

[0162] It should be noted that when the instructions in the above-mentioned computer-readable storage medium or one or more instructions in the computer program product are executed by the processor of the device, the various processes of the above-mentioned method embodiment are implemented, and the same technical effect as the above-mentioned method can be achieved. To avoid repetition, they will not be repeated here.

[0163] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0164] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0165] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0166] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0167] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or the full classification part or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including a number of instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute the full classification part or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, ROM, RAM, disk or CD and other media that can store program code.

[0168] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. An electronic control unit updating method, characterized in that: Applicable to program update devices, including: In response to an operation of obtaining update data, obtaining the update data from a data source based on a file reading function provided by a Flutter application in the program update device, where the file reading function provided by the Flutter application matches the operating system type; The update data is sent to an electronic control unit so that the electronic control unit is updated based on the update data.

2. The method according to claim 1, characterized in that The method further comprises: Obtain a target Flutter application toolkit that matches the operating system used by the program update device; The Flutter application is built based on the target Flutter application toolkit.

3. The method according to claim 1, characterized in that The sending of the update data to the electronic control unit comprises: The update data is sent to a CAN device through a CAN protocol, so that the CAN device sends the update data to the electronic control unit through CAN communication.

4. The method according to claim 3, characterized in that The protocol stack of the CAN protocol includes an application layer, which encapsulates a communication service interface and a parameter configuration service interface related to the diagnostic message, so that the program update device can interact with the CAN device and / or the data source through the communication service interface and / or the parameter configuration service interface.

5. The method according to claim 4, characterized in that The protocol stack of the CAN protocol also includes a presentation layer and a session layer. The presentation layer is used to perform code conversion on the instructions received by the application layer and send them to the session layer; the code conversion includes at least one of the following: binary to hexadecimal conversion, binary to decimal conversion.

6. The method according to claim 5, characterized in that The session layer implements data communication with the CAN device through the Socket library of the Dart language.

7. The method according to any one of claims 1 to 6, characterized in that: When the operating system used by the program update device is an Android system, the file reading function is written based on Java or Kotlin; When the operating system used by the program update device is an IOS system, the file reading function is written based on Objective-C or Swift; When the operating system used by the program updating device is Windows system, the file reading function is written based on C++ or C#.

8. The method according to any one of claims 1 to 6, characterized in that: In the case where the operating system used by the program update device is an Android system, the target Flutter application toolkit is built based on Gradle, and the program update device builds the Flutter application by running the Flutter bulid apk command; In the case where the operating system used by the program update device is an IOS system, the target Flutter application toolkit is built based on Xcode, and the program update device builds the Flutter application by running the Flutter bulid ios command; When the operating system used by the program update device is a Windows system, the program update device builds the Flutter application by running a Flutter build windows command.

9. An electronic control unit update system, characterized in that: include: Data sources, program update devices and electronic control units; The data source is used to store update data; The program update device is used to, in response to an operation of obtaining update data, obtain the update data from a data source based on a file reading function provided by a Flutter application in the program update device, where the file reading function provided by the Flutter application matches the operating system type; and send the update data to an electronic control unit so that the electronic control unit is updated based on the update data.

10. An electronic control unit updating device, characterized in that: It includes a first acquisition unit and an update unit: The first acquisition unit is used to, in response to an operation of acquiring update data, acquire the update data from a data source based on a file reading function provided by a Flutter application, where the file reading function provided by the Flutter application matches the operating system type; The updating unit is used to send the updating data to the electronic control unit, so that the electronic control unit is updated based on the updating data.

11. A device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method according to any one of claims 1 to 8.

12. A computer-readable storage medium, characterized in that: When the computer-executable instructions stored in the computer-readable storage medium are executed by a processor of a device, the device is capable of performing the method according to any one of claims 1 to 8.

13. A computer program product, comprising computer instructions, characterized in that: When the computer instructions are executed on a processor of a device, the device is enabled to perform the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Form dynamic implementation method and device, equipment and storage medium

    CN115544992A

  • Method and apparatus for implementing user interface

    WO2022042162A1

Cited By

  • Electronic control unit updating method and apparatus, device, and storage medium

    WO2026066627A1