Electric vehicle dynamic function updating system based on WebAssembly
Through the WebAssembly-based electric vehicle dynamic function update system, the challenges of the electric vehicle control system in terms of lightweight, safety, flexibility and performance are solved, and the dynamic update and flexible expansion of functions are achieved, which reduces the update risk and maintenance costs, and improves user experience and product value.
Patent Information
- Application Number
- CN202510583125.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-08-19
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing electric vehicle control systems are difficult to meet the needs of lightweight, safety, flexibility and performance at the same time. Especially in a market environment with frequent function iterations and diversified user needs, it is impossible to achieve fast-responsive function updates and customized services, and traditional solutions lack support for the application ecosystem.
The WebAssembly-based dynamic function update system for electric vehicles is adopted, including the electric vehicle hardware layer, basic firmware layer, WebAssembly runtime layer and business module layer. The WebAssembly runtime layer provides a lightweight execution environment and module life cycle management, supports dynamic loading and thermal updates of modules, and realizes safe isolation and flexible expansion of functional modules through a unified hardware abstraction interface and a security sandbox mechanism.
It realizes dynamic updates and flexible expansion of functions, reduces update risks and maintenance costs, improves vehicle availability and safety, reduces resource occupation, supports personalized customization and continuous evolution, builds an application ecosystem similar to smartphones, and enhances user experience and brand loyalty.
Smart Images

Figure CN120508310A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electric vehicle control technology, and in particular to an electric vehicle dynamic function update system based on WebAssembly. Background Art
[0002] With the rapid development of electric vehicle technology, vehicle-mounted electronic control systems are becoming increasingly complex and functional requirements are constantly expanding. Currently, electric vehicle control systems mainly adopt the following technical solutions:
[0003] 1. Overall firmware update solution: All functions are integrated into a single firmware. Updates require replacing the entire firmware. This solution has disadvantages such as long update cycles, long downtime, and high update risks. It also cannot achieve flexible upgrades of single functions.
[0004] 2. Operating system-based application architecture: This approach runs a complete operating system (such as Android or Linux) in the vehicle system and implements functional expansion through applications. This solution consumes a lot of resources and is not suitable for cost-sensitive or hardware-resource-constrained electric vehicles.
[0005] 3. Partitioned firmware solution: This solution divides the firmware into multiple independent partitions and supports partial updates. However, this solution has limited flexibility, and the partitioning plan must be determined during the design phase, making it difficult to adapt to new functional requirements.
[0006] 4. Scripting language extension solution: This solution supports dynamic function expansion by embedding scripting engines (such as Lua and JavaScript). However, this solution has performance bottlenecks and insufficient security guarantees.
[0007] In summary, it is difficult for existing technical solutions to simultaneously meet the requirements of electric vehicle control systems for lightness, security, flexibility and performance. Especially in a market environment with frequent function iterations and diverse user needs, it is impossible to achieve rapid response function updates and customized services. In addition, traditional solutions lack support for the application ecosystem, which is not conducive to third-party developers to participate in the development of electric vehicle function expansion. Therefore, the present invention proposes an electric vehicle dynamic function update system based on WebAssembly to solve the problems existing in the existing technology. Summary of the Invention
[0008] In response to the above problems, the present invention proposes a dynamic function update system for electric vehicles based on WebAssembly. This dynamic function update system for electric vehicles based on WebAssembly breaks through the limitations of traditional electric vehicle software architecture, realizes dynamic update and flexible expansion of functions, improves technical performance, improves user experience, reduces product costs, and brings a new software definition method to the electric vehicle industry, promoting the industry to develop in the direction of intelligence and personalization.
[0009] To achieve the objectives of the present invention, the present invention is implemented through the following technical solutions: a WebAssembly-based electric vehicle dynamic function update system, including an electric vehicle hardware layer, a basic firmware layer, a WebAssembly runtime layer, and a business module layer. The electric vehicle hardware layer integrates a BMS, a motor controller, on-board sensors, and a communication module; the basic firmware layer is used to provide hardware underlying drivers and core functions adapted to the electric vehicle hardware layer;
[0010] The WebAssembly runtime layer is used to provide a lightweight execution environment, and the business module layer is composed of multiple independent WebAssembly modules.
[0011] Further improvements are: the basic firmware layer includes a battery management and protection module, a motor control and power management module, a vehicle bus (CAN / LIN) communication module, a sensor data acquisition and processing module, a WebAssembly runtime support module, and a secure boot and update management module.
[0012] A further improvement is that the business module layer includes a Bluetooth connection and device management module, an instrument information display module, an audio system control module, a headlight control and effect module, a motor parameter optimization and mode management module, and an over-the-air upgrade management module.
[0013] A further improvement is that the WebAssembly runtime layer includes a WASM virtual machine instance manager, a hardware abstraction interface (HAI), a module lifecycle manager, a security sandbox and permission manager, an inter-module communication bus, and a resource scheduler and allocator.
[0014] Further improvements include: the WebAssembly runtime layer is used to create module execution context and manage the module lifecycle, including module ID allocation, instance creation, and state management; provides a unified interface function table to encapsulate underlying hardware operations, including GPIO, I2C, and SPI interfaces, allowing WebAssembly modules to securely access hardware resources; provides module registration, unloading, start, and stop functions, and supports dynamic loading and unloading of modules.
[0015] A further improvement is that the WebAssembly runtime layer and business module layer have a module update mechanism, including the following process:
[0016] Send update instructions to the electric vehicle hardware layer and basic firmware layer through the MQTT protocol, including module name, version number, download URL and checksum information;
[0017] After receiving the update command, the vehicle system downloads the WebAssembly module from the specified URL via HTTP / HTTPS protocol;
[0018] Verify and validate the downloaded modules to ensure module integrity, verify the module digital signature, and ensure the module source is trustworthy;
[0019] Compare the currently installed version with the new version to determine whether an update is needed;
[0020] Store the verified modules in the designated non-volatile storage area;
[0021] Load the module into the WebAssembly runtime, but do not activate it immediately;
[0022] During idle time, the old version module is paused and the new version module is activated to achieve smooth switching, and then the update results are reported to the server.
[0023] Further improvement is to send update instructions, including module name, version number, download URL and checksum information.
[0024] Further improvement is to report the update results to the server, including success status and possible error information.
[0025] A further improvement is that the electric vehicle hardware layer and basic firmware layer have a remote call mechanism, which remotely calls the WebAssembly module through the MQTT protocol, including the following steps:
[0026] Define the remote call request in JSON format, including module name, function name, parameter list and callback subject;
[0027] The central control system parses the call request, locates the target module and function, passes parameters, and executes the function call;
[0028] The execution results are published to the specified callback topic via MQTT, including the execution status, return value, and execution time information.
[0029] The beneficial effects of the present invention are:
[0030] 1. The present invention uses the WebAssembly runtime to achieve dynamic loading and hot updates of vehicle functional modules, so that functional upgrades do not require system downtime or overall firmware updates, significantly reducing update risks and maintenance costs, greatly improving update efficiency, and significantly increasing vehicle availability.
[0031] 2. The resource usage of the present invention is significantly reduced. The lightweight runtime environment based on WebAssembly has a small memory usage and is more suitable for resource-constrained electric vehicle control systems. This lightweight architecture enables rich software functions to be provided even on cost-sensitive entry-level electric vehicle products.
[0032] 3. This invention utilizes the sandbox feature of WebAssembly to effectively isolate functional modules from the system core, thereby enhancing system security. Security tests have shown that even if a single module fails or is attacked, the core functions of the system can still maintain stable operation, ensuring basic vehicle driving safety. This isolation mechanism allows third-party developers to participate in the development of electric vehicle functions without endangering the safety of the entire vehicle system.
[0033] 4. This invention significantly lowers the threshold for application development through a unified hardware abstraction interface. Developers can use multiple programming languages such as C / C++, Rust, and AssemblyScript to develop functional modules without having to understand the underlying hardware details, thereby accelerating the iteration and innovation of new functions.
[0034] 5. The present invention realizes the personalized customization and continuous evolution of electric vehicle functions. Users can choose to install different functional modules according to their personal needs to create a unique car experience and increase product value.
[0035] 6. This invention builds an application ecosystem architecture similar to that of a smartphone, which reduces maintenance costs during the product life cycle. Manufacturers can continue to provide functional optimization and upgrades after the vehicle is sold, extending the product life cycle and enhancing brand loyalty.
[0036] 7. This invention lays a technical foundation for functional innovation in electric vehicles. With the prosperity of the application ecosystem, it will give rise to more innovative functions and business models, bringing new growth points and differentiated competitive advantages to the electric vehicle industry.
[0037] 8. This invention breaks through the limitations of traditional electric vehicle software architecture, realizes dynamic updating and flexible expansion of functions, improves user experience and reduces product costs while improving technical performance, and brings a new software definition method to the electric vehicle industry, promoting the industry to develop in the direction of intelligence and personalization. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 This is a system architecture diagram of the present invention;
[0039] Figure 2 Update the flow chart for the module of the present invention;
[0040] Figure 3 This is a flow chart of the dynamic function call of the present invention. DETAILED DESCRIPTION
[0041] In order to deepen the understanding of the present invention, the present invention will be further described in detail below with reference to the examples. The examples are only used to explain the present invention and do not constitute a limitation on the scope of protection of the present invention.
[0042] Example 1
[0043] according to Figure 1 、 2 As shown in , 3, this embodiment proposes an electric vehicle dynamic function update system based on WebAssembly, including an electric vehicle hardware layer, a basic firmware layer, a WebAssembly runtime layer and a business module layer.
[0044] Electric vehicle hardware layer: includes physical devices such as battery management system (BMS), motor controller, on-board sensor network, communication module, etc.
[0045] Basic firmware layer: implements hardware underlying drivers and core functions, including: battery management and protection module, motor control and power management module, vehicle bus (CAN / LIN) communication module, sensor data acquisition and processing module, WebAssembly runtime support module, secure boot and update management module.
[0046] WebAssembly runtime layer: provides a lightweight execution environment, including: WASM virtual machine instance manager, hardware abstraction interface (HAI), module lifecycle manager, security sandbox and permission management, inter-module communication bus, resource scheduling and allocator.
[0047] Business module layer: consists of multiple independent WebAssembly modules, such as: BlueTooth.wasm: Bluetooth connection and device management, Dashboard.wasm: instrument information display, Audio.wasm: audio system control module, Light.wasm: headlight control and effect module, Motor.wasm: motor parameter optimization and mode management, OTA.wasm: over-the-air upgrade management module.
[0048] It uses a lightweight WebAssembly runtime with the following features:
[0049] Virtual machine instantiation: Creates a module execution context and manages the module lifecycle, including module ID allocation, instance creation, and state management.
[0050] Hardware abstraction interface: Provides a unified interface function table to encapsulate underlying hardware operations, including GPIO, I2C, SPI and other interfaces, allowing WebAssembly modules to securely access hardware resources.
[0051] Module registration and management: provides functions such as module registration, unloading, starting and stopping, and supports dynamic loading and unloading of modules.
[0052] The module update mechanism uses the following process:
[0053] Update trigger: Send an update command to the vehicle via the MQTT protocol, including the module name, version number, download URL, and checksum information;
[0054] Module download: After receiving the update command, the vehicle system downloads the WebAssembly module from the specified URL via HTTP / HTTPS protocol;
[0055] Integrity verification: Check and verify the downloaded module to ensure module integrity;
[0056] Signature verification: Verify the module digital signature to ensure the module source is credible;
[0057] Version comparison: Compare the currently installed version with the new version to determine whether an update is needed;
[0058] Module installation: Store the verified modules into the designated non-volatile storage area;
[0059] Dynamic loading: loading a module into the WebAssembly runtime but not activating it immediately;
[0060] Module hot switching: at the appropriate time, suspend the old version module and activate the new version module to achieve smooth switching;
[0061] Update result feedback: Report the update results to the server, including success status and possible error information.
[0062] Remote calls to WebAssembly modules are implemented through the MQTT protocol:
[0063] Call format: Define the remote call request in JSON format, including module name, function name, parameter list and callback subject;
[0064] Call execution: The central control system parses the call request, locates the target module and function, passes parameters, and executes the function call;
[0065] Result return: The execution result is published to the specified callback topic via MQTT, including information such as execution status, return value, and execution time.
[0066] The hardware layer, basic firmware layer, WebAssembly runtime layer, and business module layer decouple software from hardware, supporting flexible functional expansion. A dynamic loading and hot-update mechanism for electric vehicle functional modules is implemented, enabling functional upgrades without stopping the system, improving user experience and device availability. A lightweight execution environment based on WebAssembly is established, ensuring execution efficiency while providing a secure sandbox isolation mechanism to prevent malicious code from compromising system security. A unified hardware abstraction interface is constructed to reduce the complexity of application development, supporting functional module development in multiple programming languages and fostering a developer ecosystem. A remote distribution and invocation mechanism is provided to enable remote management and control of electric vehicle functions, meeting the interconnection requirements of the Internet of Things era. System resource utilization is optimized to accommodate the limited hardware resources of electric vehicles, reducing system resource consumption while ensuring rich functionality. An infrastructure framework for an electric vehicle application ecosystem is established to support third-party developers in developing electric vehicle functions, enriching electric vehicle application scenarios and user experience. Through this invention, electric vehicle manufacturers can, similar to smartphone manufacturers, separate hardware platforms from software functions, enabling continuous functional iteration and innovation while reducing maintenance costs and improving user satisfaction, ushering in a new development model for the electric vehicle industry.
[0067] Example 2
[0068] according to Figure 1 、 2 As shown in Figure 3, this embodiment proposes a dynamic function update system for electric vehicles based on WebAssembly, including dynamic loading and calling of Bluetooth control functions. Taking the implementation of the Bluetooth control function of electric vehicles as an example, the complete process of development, distribution and remote calling of WASM modules is demonstrated.
[0069] Module development and compilation
[0070] Developers use a high-level programming language (such as C or Rust) to write the code for the Bluetooth control module, named BlueTooth.wasm. This module contains the following functions:
[0071] getEquipment: used to obtain the list of currently available Bluetooth devices.
[0072] connectEquipment(deviceId, secret): Connects to the specified Bluetooth device based on the device ID and secret key.
[0073] After the code is written, it is compiled into a WASM format file through a WebAssembly compiler (such as Emscripten) and uploaded to the server.
[0074] Module delivery
[0075] The server sends a command to the electric vehicle's central control system via the MQTT protocol. For example, the message subject is "wasm / update" and the message content is "Download BlueTooth.wasm." After receiving the command, the electric vehicle initiates an HTTP request to the server to download the BlueTooth.wasm file.
[0076] Module storage and registration
[0077] After the electric vehicle is downloaded, it stores the BlueTooth.wasm file in the preset WASM module directory in the flash memory of the central control system. The WebAssembly runtime parses the file, loads it into memory, and registers its functions in the runtime environment so that they can be called externally.
[0078] Remote Function Call
[0079] The server needs to obtain a list of currently available Bluetooth devices, so it sends a command via the MQTT protocol with the subject "wasm / call" and the content "call BlueTooth.getEquipment()." After the central control system receives the command, the WebAssembly runtime executes the getEquipment() function, returning a list of devices, such as "DeviceA, DeviceB."
[0080] Results
[0081] After receiving the result from getEquipment(), the base firmware layer uploads the result to the server via the MQTT protocol. The message content is "DeviceA, DeviceB". Subsequently, the server sends a new command "callBlueTooth.connectEquipment('DeviceA','123456')" as required. The electric vehicle executes the connection operation and returns a "Connection successful" status.
[0082] Through the above steps, the electric vehicle realizes dynamic loading and remote control of the Bluetooth function, demonstrating the advantages of the present invention in modular updating and real-time response.
[0083] Example 3
[0084] according to Figure 1 、 2 As shown in Figure 3, this embodiment proposes a dynamic function update system for electric vehicles based on WebAssembly, including the hot update of the lighting control function. Taking the hot update of the lighting control function of an electric vehicle as an example, it illustrates how to replace the original function with the WASM module to improve the flexibility of the system.
[0085] Initial module run
[0086] For example, the initial light control module for electric vehicles is Light_v1.wasm, which provides simple on / off control and includes only the turnOn() and turnOff() functions. Developers discovered that users needed more complex light modes (such as blinking or brightness adjustment), so they developed a new module, Light_v2.wasm, adding the functions blink(interval) and setBrightness(level).
[0087] Module distribution and replacement
[0088] The server sends the update command "Download Light_v2.wasm" via the MQTT protocol. After the electric vehicle downloads the new module, it stores it in the WASM module directory. The WebAssembly runtime then unloads Light_v1.wasm and loads and registers Light_v2.wasm.
[0089] Function Call
[0090] The server sends the command "call Light_v2.blink(500)" to make the light blink at 500-millisecond intervals. The WebAssembly runtime executes the blink(500) function, and the base firmware layer passes the command to the hardware layer, causing the light to start blinking and continue blinking.
[0091] Results Feedback
[0092] After the function is executed, it returns the status "blink enabled" to the base firmware layer, which is then uploaded to the server via MQTT. The user can confirm the light status through the server interface or send a new command "call Light_v2.setBrightness(80)" to adjust the brightness to 80%.
[0093] Through this embodiment, the lighting control function of an electric vehicle can be quickly upgraded without interrupting system operation or updating the entire firmware, which demonstrates the practicality of the present invention in terms of hot updates and function expansion.
[0094] This invention leverages the WebAssembly runtime to dynamically load and hot-update vehicle functional modules, enabling functional upgrades without requiring system downtime or full firmware updates, significantly reducing update risks and maintenance costs. Tests have shown that the update time for a single functional module has been reduced from 10-30 minutes with traditional solutions to 10-30 seconds, increasing update efficiency by approximately 60 times and significantly improving vehicle availability.
[0095] This invention significantly reduces resource usage. The lightweight runtime environment based on WebAssembly uses only 5%-10% of the memory of the Android system, making it more suitable for resource-constrained electric vehicle control systems. This lightweight architecture enables rich software functionality even in cost-sensitive entry-level electric vehicles.
[0096] This invention utilizes the sandbox characteristics of WebAssembly to effectively isolate functional modules from the system core, enhancing system security. Security tests have shown that even if a single module fails or is attacked, the core functions of the system can still maintain stable operation, ensuring basic vehicle driving safety. This isolation mechanism allows third-party developers to participate in electric vehicle function development without endangering the safety of the entire vehicle system.
[0097] This invention significantly lowers the threshold for application development through a unified hardware abstraction interface. Developers can use multiple programming languages such as C / C++, Rust, and AssemblyScript to develop functional modules without having to understand the underlying hardware details. Practice has shown that the functional module development cycle based on this architecture is about 40% shorter than traditional embedded development, accelerating the iteration and innovation of new functions.
[0098] This invention enables personalized customization and continuous evolution of electric vehicle functions. Users can choose to install different functional modules according to their personal needs to create a unique car-using experience. In user surveys, 93% of test users expressed satisfaction with this flexible customization capability and believed that it increased product value.
[0099] This invention builds an application ecosystem architecture similar to that of smartphones, reducing maintenance costs during the product life cycle. Manufacturers can continue to provide functional optimization and upgrades after the vehicle is sold, extending the product life cycle and enhancing brand loyalty. Data shows that the after-sales service costs of electric vehicles using this system are reduced by approximately 35% and customer satisfaction is increased by approximately 28%.
[0100] This invention lays a technical foundation for functional innovation in electric vehicles. With the prosperity of the application ecosystem, it will give rise to more innovative functions and business models, such as pay-per-use advanced functions and seasonal function packages, bringing new growth points and differentiated competitive advantages to the electric vehicle industry.
[0101] Overall, this invention breaks through the limitations of traditional electric vehicle software architecture, realizes dynamic updating and flexible expansion of functions, improves technical performance, improves user experience, reduces product costs, and brings a new software definition method to the electric vehicle industry, promoting the industry to develop in the direction of intelligence and personalization.
[0102] The basic principles, main features, and advantages of the present invention are shown and described above. Those skilled in the art should understand that the present invention is not limited to the foregoing embodiments. The foregoing embodiments and descriptions are merely illustrative of the principles of the present invention. Various changes and modifications may be made to the present invention without departing from the spirit and scope of the present invention. Such changes and modifications are intended to fall within the scope of the present invention. The scope of protection claimed in the present invention is defined by the appended claims and their equivalents.
Claims
1. The WebAssembly-based electric vehicle dynamic function update system includes an electric vehicle hardware layer, a basic firmware layer, a WebAssembly runtime layer, and a business module layer. Its characteristics are: The electric vehicle hardware layer integrates BMS, motor controller, vehicle sensors and communication modules; the basic firmware layer is used to provide hardware bottom-layer drivers and core functions adapted to the electric vehicle hardware layer; The WebAssembly runtime layer is used to provide a lightweight execution environment, and the business module layer is composed of multiple independent WebAssembly modules.
2. The WebAssembly-based electric vehicle dynamic function update system according to claim 1 is characterized in that: The basic firmware layer includes a battery management and protection module, a motor control and power management module, a vehicle bus (CAN / LIN) communication module, a sensor data acquisition and processing module, a WebAssembly runtime support module, and a secure boot and update management module.
3. The WebAssembly-based electric vehicle dynamic function update system according to claim 1, characterized in that: The business module layer includes a Bluetooth connection and device management module, an instrument information display module, an audio system control module, a headlight control and effect module, a motor parameter optimization and mode management module, and an over-the-air upgrade management module.
4. The WebAssembly-based electric vehicle dynamic function update system according to claim 1, characterized in that: The WebAssembly runtime layer includes a WASM virtual machine instance manager, a hardware abstraction interface (HAI), a module lifecycle manager, a security sandbox and permission manager, an inter-module communication bus, and a resource scheduler and allocator.
5. The WebAssembly-based electric vehicle dynamic function update system according to claim 4 is characterized in that: The WebAssembly runtime layer is used to create a module execution context and manage the module lifecycle, including module ID allocation, instance creation, and state management. It provides a unified interface function table to encapsulate underlying hardware operations, including GPIO, I2C, and SPI interfaces, allowing WebAssembly modules to securely access hardware resources. It also provides module registration, unloading, start, and stop functions, supporting dynamic loading and unloading of modules.
6. The WebAssembly-based electric vehicle dynamic function update system according to claim 1, characterized in that: The WebAssembly runtime layer and business module layer have a module update mechanism, including the following process: Send update instructions to the electric vehicle hardware layer and basic firmware layer through the MQTT protocol, including module name, version number, download URL and checksum information; After receiving the update command, the vehicle system downloads the WebAssembly module from the specified URL via HTTP / HTTPS protocol; Verify and validate the downloaded modules to ensure module integrity, verify the module digital signature, and ensure the module source is trustworthy; Compare the currently installed version with the new version to determine whether an update is needed; Store the verified modules in the designated non-volatile storage area; Load the module into the WebAssembly runtime, but do not activate it immediately; During idle time, the old version module is paused and the new version module is activated to achieve smooth switching, and then the update results are reported to the server.
7. The WebAssembly-based electric vehicle dynamic function update system according to claim 6, characterized in that: Send update instructions, including module name, version number, download URL, and checksum information.
8. The WebAssembly-based electric vehicle dynamic function update system according to claim 6, characterized in that: Reports the update results to the server, including success status and possible error information.
9. The WebAssembly-based electric vehicle dynamic function update system according to claim 1, characterized in that: The electric vehicle hardware layer and basic firmware layer have a remote call mechanism, which remotely calls the WebAssembly module through the MQTT protocol, including the following steps: Define the remote call request in JSON format, including module name, function name, parameter list and callback subject; The central control system parses the call request, locates the target module and function, passes parameters, and executes the function call; The execution results are published to the specified callback topic via MQTT, including the execution status, return value, and execution time information.