In-vehicle Android VHAL system and implementation method based on service architecture SOA
Through the vehicle-mounted Android VHAL system based on service architecture SOA, using the SOME/IP communication protocol and Binder mechanism, the bandwidth limitation and data load problems in the communication between the vehicle-mounted Android system VHAL and the body domain are solved, achieving high bandwidth, flexibility and low development Difficulty communication solutions.
Patent Information
- Application Number
- CN202211375769.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-04
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2042-11-04
AI Technical Summary
When the existing vehicle-mounted Android system VHAL communicates with the body domain, the CAN bus bandwidth is limited, signal-oriented communication leads to increased data load, limited data frame capacity, and complex multi-domain data interaction, which increases the difficulty of maintenance.
The vehicle-mounted Android VHAL system is adopted based on service architecture SOA, realizes cross-process communication through the Binder mechanism, uses the SOME/IP communication protocol to provide service discovery functions, and performs high-bandwidth communication through Ethernet, supporting TCP and UDP to reduce useless data load.
It achieves compatibility or replacement of Android's native VHAL, improves communication flexibility and bandwidth utilization, reduces development difficulty, avoids data serialization and deserialization problems, supports multi-domain communication, and makes full use of the high-bandwidth characteristics of Ethernet .
Smart Images

Figure CN115883637B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular to a vehicle-mounted Android VHAL system based on a service architecture SOA and an implementation method thereof. Background Art
[0002] The vehicle-mounted Android system VHAL (Vehicle HAL) belongs to the cockpit domain and is mainly used to communicate with the body domain to realize the functional control and status display of body domain modules such as seats, windows, wipers, air conditioners, and lights. At present, the main ways for the vehicle-mounted Android system VHAL to communicate with the body domain are: one is based on Ethernet sockets; the other is to communicate between the two domains through the CAN (Controller Area Network) bus first, and then use Ethernet sockets to implement it in the cockpit domain. These methods have the following disadvantages:
[0003] First, there is a communication bandwidth limitation when using CAN bus communication. The maximum rate of CAN bus is 1Mbps, and even when CANFD is used, the maximum rate is only 8Mbps; second, the communication process of CAN bus is signal-oriented. When the sender finds that the value of the signal has changed or the sending cycle has arrived, it will send a message without considering whether the receiver has a demand. This will cause too much unnecessary data on the bus and increase the bus load; third, when using CAN bus to send data, the data frame can only carry a maximum of 64 bytes of data; fourth, using socket communication can make full use of the high bandwidth of Ethernet, but the implementation requires a custom data communication protocol, and manual data packaging and unpacking of composite data structures; fifth, the cockpit domain may interact with multiple other domains, such as the power domain and the intelligent driving domain, so developers may need to maintain multiple socket connections, which increases the difficulty of maintaining and expanding data communication links between multiple domains. Summary of the invention
[0004] The purpose of the present invention is to provide an in-vehicle Android VHAL system and an implementation method based on a service architecture SOA to replace the existing solutions in the above-mentioned background technology or be compatible with the existing solutions.
[0005] The embodiment of the present application is implemented as follows:
[0006] In a first aspect, an embodiment of the present application provides an in-vehicle Android VHAL system based on a service architecture SOA, including an Android application layer, an Android middleware layer, and an Android hardware abstraction layer;
[0007] The Android application layer and the Android middleware layer, as well as the Android middleware layer and the Android hardware abstraction layer communicate across processes through a Binder mechanism;
[0008] Among them, the Android hardware abstraction layer includes a first service module, a second service module and a third service module, and the first service module, the second service module and the third service module communicate with each other across processes through the Binder mechanism; the Android middleware layer includes a CarService service module, and the CarService service module communicates with the second service module and the third service module; wherein the interfaces provided by the second service module and the third service module are consistent with those provided by the first service module; and wherein the service-based architecture is formed based on the SOME / IP communication protocol.
[0009] In some embodiments, the Android hardware abstraction layer further includes a fourth service module;
[0010] The fourth service module provides the service discovery function related to the SOME / IP communication protocol to the Android application layer upward, and the fourth service module is connected to the COM module of the SOME / IP communication protocol downward; wherein the fourth service module and the first service module operate independently of each other, and the fourth service module and the first service module belong to two independent data paths based on the SOME / IP communication protocol.
[0011] In some embodiments, the Android middleware layer further includes a CarSoaService service module;
[0012] The CarSoaService service module is a collection of SOA servers or SOA clients of the Android application layer. The SOA server and the SOA client are centrally implemented in the CarSoaService service module or independently form separate modules.
[0013] In some implementations, according to the version of the Android system, the CarService service module determines whether to call the first service module or the second service module by modifying a system property value or a getService interface call parameter value in a getVehicle interface in a code corresponding to the CarService service module.
[0014] In some implementations, a fifth service module is further included, the first service module and the second service module are compatible and run in parallel, and the interface of the first service module or the second service module is used by the configuration of the fifth service module.
[0015] In some implementations, the third service module and the CarSoaService service module communicate with the vehicle body domain via Ethernet, where Ethernet is used to transmit function-related interface data.
[0016] In some implementations, control data packets associated with the SOME / IP communication protocol communicate with the vehicle body domain via a COM module of the SOME / IP communication protocol, and the control data packets associated with the SOME / IP communication protocol include service discovery, service provision, and event subscription packets.
[0017] In some implementations, the third service module is adapted to the first service module and the SOA architecture module and is used for conversion and interface adaptation between the data structure of the first service module data and the data structure of the service architecture SOA interface data.
[0018] In a second aspect, an embodiment of the present application further provides a method for implementing an in-vehicle Android VHAL based on a service architecture SOA, which is applied to the in-vehicle Android VHAL system based on a service architecture SOA described in any one of the above embodiments, and is characterized by comprising:
[0019] Setting a first Binder mechanism, through which the Android application layer and the Android middleware layer, and the Android middleware layer and the Android hardware abstraction layer, perform cross-process communication;
[0020] Setting a second Binder mechanism, and enabling cross-process communication among the first service module, the second service module and the third service module through the second Binder mechanism;
[0021] The second service module and the third service module are configured to have consistent interfaces with the first service module; and the CarService service module is configured in the Android middleware layer.
[0022] In some embodiments, it further comprises:
[0023] A fourth service module is set up which is independent of the first service module, wherein the fourth service module is included in the Android hardware abstraction layer, provides the Android application layer with a service discovery function related to the SOME / IP communication protocol, and interfaces with the COM module of the SOME / IP communication protocol downward.
[0024] Compared with the prior art, the beneficial effects of the embodiments of the present application are:
[0025] The present invention provides an in-vehicle Android VHAL system based on a service architecture SOA and an implementation method thereof, which can achieve the following beneficial effects:
[0026] First, it can replace or be compatible with Android's native VHAL (partial replacement or compatibility), without affecting Android's layered structure. Android application layer programs do not need any modification, and Android middleware layer only needs minimal modification.
[0027] Second, the solution uses the SOA architecture and the SOME / IP communication protocol, which is extremely flexible, supports communication between multiple domains, and has flexible configuration;
[0028] Third, this solution uses Ethernet to carry communications, which has high bandwidth, supports TCP and UDP, can be configured according to needs, and has no data payload size restrictions;
[0029] Fourth, the interface of this solution communicates according to demand and does not generate a large amount of useless load data;
[0030] Fifth, the implementation of the SOME / IP communication protocol solves the problem of data serialization and deserialization. The implementation of the SOME / IP communication protocol and the function development based on the protocol can be independent. Function developers do not need to pay attention to the serialization and deserialization of data, but can directly call the interface. Function developers do not need to directly maintain the network link, but only need to monitor the status of related services.
[0031] Sixth, the native Android VHAL is only a subset of the functions that can be realized by the SOA architecture. The SOA architecture of this solution also provides another channel for realizing other functions of the SOA architecture, such as the CarSoaService service module in the architecture diagram. This channel is completely independent of the native Android VHAL and can make full use of the high bandwidth of Ethernet communication. In addition, the upper-level functions of this channel are realized using the JAVA language, which can reduce the difficulty for developers to use.
[0032] In order to more clearly understand the technical means of the present invention, which can be implemented according to the contents of the specification, and to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the following preferred embodiments are specifically cited and described in detail with the accompanying drawings. Other features and advantages of the present invention will be explained in the subsequent description, and part of them will become obvious from the description, or be reflected by implementing the present invention. The purposes and other advantages of the present invention can be achieved and obtained by the structures specifically pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0034] Figure 1 An architectural diagram of an in-vehicle Android VHAL system based on a service architecture SOA provided by an embodiment of the present invention;
[0035] Figure 2 The present invention is a flowchart of a method for implementing an in-vehicle Android VHAL based on a service architecture SOA according to an embodiment of the present invention. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0037] In one or more embodiments of the present invention, please refer to Figure 1 This embodiment provides an in-vehicle Android VHAL system based on a service architecture SOA, which includes an Android application layer, an Android middleware layer and an Android hardware abstraction layer. The Android application layer and the Android middleware layer, as well as the Android middleware layer and the Android hardware abstraction layer communicate across processes through the Binder mechanism; wherein the Android hardware abstraction layer includes a first service module, a second service module and a third service module, and the first service module, the second service module and the third service module also communicate across processes through the Binder mechanism; wherein the Android middleware layer includes a CarService service module, and the CarService service module communicates with the second service module and the third service module; wherein the second service module and the third service module are consistent with the interface provided by the first service module; wherein the service architecture is formed based on the SOME / IP communication protocol.
[0038] The present invention can replace or be compatible (partially replace or be compatible) with the native VHAL (first service module) of Android by adopting the above scheme, without affecting the layered structure of Android. The service architecture SOA is based on the communication protocol of SOME / IP (extensible service middleware based on IP), which is located in the application layer of the OSI7 layer model, is the core content of the vehicle Ethernet technology, and can be used to control the transmission of messages and application data. The SOME / IP communication protocol does not depend on the operating system, can be independent of the hardware platform, operating system and programming language, has a high degree of platform scalability, can realize data interaction of different platforms, and has the characteristics of data serialization and deserialization, service discovery, etc. During communication, data is sent only when the receiving party has a demand, which can avoid excessive unnecessary data on the bus and reduce the bus load. On the SOME / IP communication protocol, developers only need to pay attention to the functional interface status of the service, and do not need to pay attention to the implementation and maintenance of the specific communication protocol.
[0039] It should be noted that the first service module is the android.hardware.automotive.vehicle@2.0-service.g6 service module, the second service module is the com.hozonauto.adaptervhal@1.0-service service module, and the third service module is the com.hozonauto.soavhal@1.0-service service module, that is, the android.hardware.automotive.vehicle@2.0-service.g6 service module, the com.hozonauto.adaptervhal@1.0-service service module and the com.hozonauto.soavhal@1.0-service service module also communicate across processes through the Binder mechanism of the Android system.
[0040] As an example, the android.hardware.automotive.vehicle@2.0-service.g6 service module is an implementation of the Android native VHAL. The vehicle-mounted Android VHAL system and implementation method based on the service architecture SOA provided by the present invention is to make the interface compatible with or completely replace the module;
[0041] The com.hozonauto.adaptervhal@1.0-service service module and the com.hozonauto.soavhal@1.0-service service module are specific implementations of the vehicle-mounted Android VHAL system and implementation method based on the service architecture SOA provided by the present invention. Therefore, by providing a consistent interface between the com.hozonauto.adaptervhal@1.0-service service module and the com.hozonauto.soavhal@1.0-service service module and the android.hardware.automotive.vehicle@2.0-service.g6 service module and communicating with the Android middleware layer including the CarService service module, the android.hardware.automotive.vehicle@2.0-service.g6 service module can be completely replaced according to demand.
[0042] In one embodiment of the present invention, the Android hardware abstraction layer also includes a fourth service module. As an example, the fourth service module is the android.vendor.ara.com@1.0-service service module. The fourth service module provides the Android application layer with a service discovery function related to the SOME / IP communication protocol, and the fourth service module is connected to isomeipd_ics downward, that is, it is connected to the COM module of the SOME / IP communication protocol; the fourth service module and the first service module operate independently of each other, and the fourth service module and the first service module belong to two independent data paths based on the SOME / IP communication protocol. It should be noted that Figure 1 The SD in the architecture diagram represents the service discovery and other related operation data of the SOME / IP communication protocol, which is implemented through cross-communication through local sockets.
[0043] In one embodiment of the present invention, the Android middleware layer also includes a CarSoaService service module. It should be noted that the CarSoaService service module is a collection of SOA servers or SOA clients of the Android application layer, wherein the SOA server and the SOA client are centrally implemented in the CarSoaService service module or independently form separate modules. Corresponding changes can be made during implementation according to specific needs.
[0044] It should be noted that, depending on the version of the Android system, the CarService service module determines whether to call the first service module or the second service module by modifying the value of the system property ro.vehicle.hal (Android R and later versions) or modifying the getService interface call parameter value in the getVehicle interface of CarService.java of the CarService service module code of the Android source code (versions before Android R).
[0045] In one embodiment of the present invention, a fifth service module is further included. The first service module and the second service module are compatible and run in parallel. The interface of the first service module or the second service module is determined by the configuration of the fifth service module. It should be noted that the fifth service module is a libsoaserviceconfig service module. If a complete replacement is required, the module android.hardware.automotive.vehicle@2.0-service.g6 service can be directly removed, and the corresponding libsoaserviceconfig service module is also removed synchronously.
[0046] It should be noted that the third service module and the CarSoaService service module communicate with the vehicle body domain via Ethernet, wherein Ethernet is used to transmit function-related interface data.
[0047] In one embodiment of the present invention, control data packets related to the SOME / IP communication protocol communicate with the vehicle body domain through the COM module of the SOME / IP communication protocol, and the control data packets related to the SOME / IP communication protocol include service discovery, service provision and event subscription packets.
[0048] It should be noted that the third service module is adapted to the first service module and the SOA architecture module and is used for the conversion between the data structure of the first service module data and the data structure of the service architecture SOA interface data and the interface adaptation. Among them, the third service module is the core of the vehicle-mounted Android VHAL system and implementation method based on the service architecture SOA of the present invention.
[0049] In another embodiment of the present invention, please refer to Figure 2 , also provides a method for implementing an in-vehicle Android VHAL based on a service architecture SOA, which is applied to the in-vehicle Android VHAL system based on the service architecture SOA discussed in any one of the above embodiments, including: S101: setting a first Binder mechanism, and using the first Binder mechanism to enable cross-process communication between the Android application layer and the Android middleware layer, and between the Android middleware layer and the Android hardware abstraction layer; S102: setting a second Binder mechanism, and using the second Binder mechanism to enable cross-process communication between the first service module, the second service module, and the third service module; S103: setting the interfaces of the second service module and the third service module to be consistent with the first service module; and setting a CarService service module in the Android middleware layer.
[0050] It should be noted that the implementation method of the in-vehicle Android VHAL based on the service architecture SOA also includes: setting a fourth service module independent of the first service module, wherein the fourth service module is included in the Android hardware abstraction layer, providing the Android application layer with service discovery functions related to the SOME / IP communication protocol upward, and connecting with the COM module of the SOME / IP communication protocol downward.
[0051] The beneficial effects of the vehicle-mounted Android VHAL system and implementation method based on the service architecture SOA provided by the present invention are as follows: first, the native Android VHAL can be replaced or compatible (partially replaced or compatible) without affecting the layered structure of Android, the Android application layer program does not need any modification, and the Android middleware layer only needs minimal modification; second, the solution uses the SOA architecture and the SOME / IP communication protocol, has extremely strong flexibility, supports communication between multiple domains, and has flexible configuration; third, the solution uses Ethernet to bear communication, has high bandwidth, supports TCP and UDP, can be configured according to requirements, and has no data load size limit; fourth, the interface of the solution communicates according to requirements, and does not generate a large amount of useless load data; fifth, the implementation of the SOME / IP communication protocol solves the problem of data The serialization and deserialization problems of data can be solved by implementing the SOME / IP communication protocol and developing functions based on the protocol independently. Function developers do not need to worry about the serialization and deserialization problems of data and can directly call the interface. Function developers do not need to directly maintain the network link and only need to monitor the status of related services. The Android native VHAL part is a subset of the functions that can be realized by the SOA architecture. The SOA architecture of this solution also provides another channel for realizing other functions of the SOA architecture, such as the CarSoaService service module in the architecture diagram. This channel is completely independent of the Android native VHAL and can make full use of the high bandwidth and other characteristics of Ethernet communication. In addition, the upper-level functions of this channel are realized using the JAVA language, which can reduce the difficulty for developers to use.
[0052] Finally, it should be noted that the above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention are included in the scope of the claims of the present invention to be approved.
Claims
1. A vehicle-mounted Android VHAL system based on service architecture SOA, characterized in that: Includes Android application layer, Android middleware layer and Android hardware abstraction layer; The Android application layer and the Android middleware layer, as well as the Android middleware layer and the Android hardware abstraction layer communicate across processes through a Binder mechanism; Wherein, the Android hardware abstraction layer includes a first service module, a second service module and a third service module, and the first service module, the second service module and the third service module communicate with each other through a Binder mechanism across processes; the Android middleware layer includes a CarService service module, and the CarService service module communicates with the second service module and the third service module; wherein the interfaces provided by the second service module and the third service module are consistent with those provided by the first service module; wherein the service-based architecture is formed based on the SOME / IP communication protocol; The Android hardware abstraction layer also includes a fourth service module; The fourth service module provides the Android application layer with a service discovery function related to the SOME / IP communication protocol, and the fourth service module is connected to the COM module of the SOME / IP communication protocol; wherein the fourth service module and the first service module operate independently of each other, and the fourth service module and the first service module belong to two independent data paths based on the SOME / IP communication protocol; The Android middleware layer also includes a CarSoaService service module; The CarSoaService service module is a collection of SOA servers or SOA clients of the Android application layer. The SOA servers and SOA clients are centrally implemented in the CarSoaService service module or independently form separate modules. According to the version of the Android system, the CarService service module determines to call the first service module or the second service module by modifying the system property value or modifying the getService interface call parameter value in the getVehicle interface in the corresponding code of the CarService service module; It also includes a fifth service module, the first service module and the second service module are compatible and run in parallel, and the interface of the first service module or the second service module is used according to the configuration of the fifth service module.
2. The vehicle-mounted Android VHAL system based on service architecture SOA according to claim 1 is characterized in that: The third service module and the CarSoaService service module communicate with the vehicle body domain via Ethernet, wherein Ethernet is used to transmit function-related interface data.
3. The vehicle-mounted Android VHAL system based on service architecture SOA according to claim 1 is characterized in that: The control data packets related to the SOME / IP communication protocol communicate with the vehicle body domain through the COM module of the SOME / IP communication protocol, and the control data packets related to the SOME / IP communication protocol include service discovery, service provision and event subscription packets.
4. The vehicle-mounted Android VHAL system based on service architecture SOA according to claim 1 is characterized in that: The third service module is adapted to the first service module and the SOA architecture module and is used for conversion between the data structure of the first service module data and the data structure of the service architecture SOA interface data and interface adaptation.
5. A method for implementing an in-vehicle Android VHAL based on a service architecture SOA, applied to an in-vehicle Android VHAL system based on a service architecture SOA as claimed in any one of claims 1 to 4, characterized in that: include: Setting a first Binder mechanism, through which the Android application layer and the Android middleware layer, and the Android middleware layer and the Android hardware abstraction layer, perform cross-process communication; Setting a second Binder mechanism, and enabling cross-process communication among the first service module, the second service module and the third service module through the second Binder mechanism; The second service module and the third service module are configured to have consistent interfaces with the first service module; and the CarService service module is configured in the Android middleware layer.
6. The method for implementing the vehicle-mounted Android VHAL based on the service architecture SOA according to claim 5 is characterized in that: Also includes: A fourth service module is set up which is independent of the first service module, wherein the fourth service module is included in the Android hardware abstraction layer, provides the Android application layer with a service discovery function related to the SOME / IP communication protocol, and interfaces with the COM module of the SOME / IP communication protocol downward.
