A vehicle-side ECU communication method and system
By defining and registering serialization/deserialization interfaces in the vehicle-side ECU communication system, and performing data conversion based on the ECU service instance identifier, the problem of high-cost communication development is solved, achieving cost reduction and efficiency improvement.
Patent Information
- Application Number
- CN202311337863.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-14
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2043-10-14
AI Technical Summary
The development cost of existing vehicle-side ECU service-oriented communication is high, requiring the development of different communication middleware and service programs for each serialization method.
Based on the serialization request method of the client ECU, define serialization and deserialization interfaces, register them with the communication middleware, construct ECU service instances and identify the serialization method, and call the corresponding interfaces to perform data conversion through the service instance identifier.
It reduces the cost of ECU communication services, improves development efficiency, enhances reusability and maintainability, and is compatible with different ECU communication services.
Smart Images

Figure CN117651260B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of automotive technology, and in particular relates to a vehicle-side ECU communication method and system. Background Technology
[0002] With the rapid development of automotive intelligence, Service-Oriented Architecture (SOA) communication is widely used. During communication, different serialization methods offer varying advantages and adaptability depending on the application scenario. Therefore, a vehicle's ECU (Electronic Control Unit) may use different serialization methods such as JSON, XML, Protocol Buffers, MessagePack, and BSON. To provide services to the ECU, different communication middleware and service programs need to be developed for each serialization method, resulting in high costs for vehicle ECU communication services. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide a vehicle-side ECU communication method and system to solve the problem of high development costs of existing vehicle-side ECU service-oriented communication.
[0004] In a first aspect of the present invention, a vehicle-side ECU communication method is provided, comprising:
[0005] Define serialization and deserialization interfaces according to the serialization request method of the client ECU;
[0006] Register the serialization and deserialization interfaces to the communication middleware;
[0007] Construct different ECU service instances and identify the serialization method of the service instances;
[0008] Based on the identifier of the ECU service instance, the corresponding serialization or deserialization interface is called to perform data conversion processing.
[0009] In a second aspect of the present invention, a vehicle-side ECU communication system is provided, comprising:
[0010] The registration module is used to define serialization and deserialization interfaces according to the serialization request method of the client ECU, and register the serialization and deserialization interfaces to the communication middleware.
[0011] The construction module is used to construct different ECU service instances and identify the serialization method of the service instances;
[0012] The communication middleware is used to call the corresponding serialization or deserialization interface for data conversion processing based on the identifier of the ECU service instance.
[0013] In a third aspect of the present invention, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor executes the computer program to implement the steps of the method as described in the first aspect of the present invention.
[0014] In a fourth aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method provided in the first aspect of the present invention.
[0015] In this embodiment of the invention, the corresponding serialization and deserialization interfaces are selected according to the identifiers in different ECU service instances to perform corresponding data conversion processing. This not only reduces the cost of ECU communication services and improves development efficiency, but also has high reusability, good maintainability, and compatibility with different ECU communication services. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a flowchart illustrating a vehicle-side ECU communication method according to an embodiment of the present invention.
[0018] Figure 2 This is a timing diagram illustrating a vehicle-side ECU communication method according to an embodiment of the present invention.
[0019] Figure 3 This is a schematic diagram of the structure of a vehicle-side ECU communication system according to an embodiment of the present invention;
[0020] Figure 4 This is a schematic diagram of the structure of an electronic device provided in one embodiment of the present invention. Detailed Implementation
[0021] To make the objectives, features, and advantages of this invention more apparent and understandable, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0022] It should be understood that the terms "comprising" and other similar expressions in the specification, claims, and accompanying drawings of this invention are intended to cover a non-exclusive inclusion, such as a process, method, system, or apparatus that includes a series of steps or units and is not limited to the listed steps or units. Furthermore, "first" and "second" are used to distinguish different objects and are not intended to describe a specific order.
[0023] Please see Figure 1 A flowchart illustrating a vehicle-side ECU communication method provided in this embodiment of the invention includes:
[0024] S101. Define the serialization interface and deserialization interface according to the serialization request method of the client ECU.
[0025] The client ECU, i.e. the vehicle ECU, may use different serialization request methods. Therefore, it is necessary to define the corresponding serialization interface and deserialization interface according to the serialization request method of the ECU.
[0026] Serialization refers to the process of converting an object into a transmittable sequence of bytes. Common serialization methods include JDK, JSON, XML, Hessian, Kryo, Thrift, Protostuff, and FST. Its purpose is to enable objects to be stored across platforms and transmitted over networks. Deserialization, on the other hand, is the process of restoring the byte sequence back into an object. The serialization interface is the interface that implements the serialization process, and the deserialization interface is the interface that implements the deserialization process.
[0027] S102. Register the serialization interface and deserialization interface to the communication middleware;
[0028] The communication middleware is a software layer that provides communication services. It can serialize / deserialize data from clients or services and transmit the converted data. After registering the serialization and deserialization interfaces with the communication middleware, the serialization / deserialization interfaces in the communication middleware can be directly called for data conversion processing.
[0029] S103. Construct different ECU service instances and identify the serialization method of the service instances;
[0030] The service instance refers to the specific service type requested by the client. For example, an ECU requesting to obtain a certain type of data can be regarded as a service instance. Different ECU service instances are constructed on the server side, and the service instance is identified. The client can make a corresponding service instance request based on the identifier and obtain the corresponding serialization / deserialization interface.
[0031] S104. Based on the identifier of the ECU service instance, call the corresponding serialization or deserialization interface to perform data conversion processing.
[0032] When the client or server needs to process the transmitted data, it can call the corresponding serialization / deserialization interface according to the service instance identifier to convert the data. For example, when the client needs to transmit data, it can call the serialization interface to convert the parameters into a byte stream and transmit it to the server. The byte stream data received by the client can also be converted into the corresponding parameters by calling the deserialization interface.
[0033] Optionally, the client parameters can be converted into a byte stream by calling the serialization interface and then sent to the server. The server can convert the byte stream back into parameters by calling the deserialization interface and then send them to the service interface.
[0034] The server-side parameters are converted into a byte stream by calling the serialization interface and then sent to the client-side service interface. The client-side service interface then converts the byte stream back into parameters by calling the deserialization interface and sends them to the client.
[0035] The converted data is transmitted based on the communication protocol corresponding to the ECU, such as through network transmission protocols like TCP / IP.
[0036] For example, such as Figure 2 As shown, Figure 2 The diagram illustrates the communication process between the client consumer and the service provider:
[0037] The client consumer (i.e., ECU) constructs a Proxy, using the identifier of service instance 1 as a parameter. The Proxy (i.e., the client service interface) finds the corresponding serialization / deserialization interface based on the service instance identifier. The client consumer initiates a request by calling the `method` function, and then calls the serialization interface corresponding to service instance 1 to perform data conversion. Finally, it sends the data to the server using the appropriate communication protocol.
[0038] After receiving a request from service instance 1, the Skeleton (i.e., the server-side service interface) calls the corresponding deserialization interface to convert the data and then calls the service interface to pass the parameters to the service provider.
[0039] After the service provider responds, it converts the response into a byte stream through a serialization interface and sends it to the client through the corresponding communication protocol.
[0040] The client-side service interface converts the response byte stream data by calling the deserialization interface, and then sends the converted parameters to the client consumer.
[0041] In this embodiment, by registering the defined serialization / deserialization interfaces to the communication middleware, and finding the corresponding interface based on the service instance identifier for data conversion processing, communication services can be provided for ECUs with different serialization methods. This not only reduces the cost of ECU communication services and improves development efficiency, but also offers high reusability and maintainability.
[0042] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0043] Figure 3 This is a schematic diagram of a vehicle-side ECU communication system provided in an embodiment of the present invention. The system includes:
[0044] The registration module 310 is used to define serialization and deserialization interfaces according to the serialization request method of the client ECU, and register the serialization and deserialization interfaces to the communication middleware.
[0045] The construction module 320 is used to construct different ECU service instances and identify the serialization method of the service instances;
[0046] The communication middleware 330 is used to call the corresponding serialization or deserialization interface for data conversion processing based on the identifier of the ECU service instance.
[0047] Based on the communication middleware 330, the communication data between the client ECU and the server can be converted by calling the serialization and deserialization interfaces therein.
[0048] Optionally, the step of calling the corresponding serialization or deserialization interface for data conversion processing includes:
[0049] The client parameters are converted into a byte stream by calling the serialization interface and then sent to the server. The server converts the byte stream back into parameters by calling the deserialization interface and then sends them to the service interface.
[0050] The server-side parameters are converted into a byte stream by calling the serialization interface and then sent to the client interface. The client interface, in turn, converts the byte stream back into parameters by calling the deserialization interface and then sends them to the client.
[0051] The converted data is transmitted based on the communication protocol corresponding to the ECU.
[0052] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the systems and modules described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0053] Figure 4 This is a schematic diagram of an electronic device according to an embodiment of the present invention. The electronic device is used for communication services with a vehicle-side ECU. Figure 4 As shown, the electronic device 4 in this embodiment includes a memory 410, a processor 420, and a system bus 430. The memory 410 includes an executable program 4101 stored thereon. As those skilled in the art will understand, Figure 4 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0054] The following is combined Figure 4 A detailed introduction to each component of the electronic device:
[0055] The memory 410 can be used to store software programs and modules. The processor 420 executes various functional applications and data processing of the electronic device by running the software programs and modules stored in the memory 410. The memory 410 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device (such as cached data), etc. In addition, the memory 410 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0056] The memory 410 contains an executable program 4101 for network request methods. This executable program 4101 can be divided into one or more modules / units, which are stored in the memory 410 and executed by the processor 420 for purposes such as vehicle ECU communication. Each module / unit can be a series of computer program instruction segments capable of performing a specific function, describing the execution process of the computer program 4101 in the electronic device 4. For example, the computer program 4101 can be divided into functional modules such as a registration module, a construction module, and communication middleware.
[0057] The processor 420 is the control center of the electronic device. It connects various parts of the electronic device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 410, and by calling data stored in the memory 410, it performs various functions and processes data, thereby monitoring the overall status of the electronic device. Optionally, the processor 420 may include one or more processing units; preferably, the processor 420 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, application programs, etc., and the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into the processor 420.
[0058] The system bus 430 is used to connect various functional components inside the computer, transmitting data, address, and control information. Its type can be, for example, a PCI bus, an ISA bus, or a CAN bus. Instructions from the processor 420 are transmitted to the memory 410 via the bus, and the memory 410 sends data back to the processor 420. The system bus 430 is responsible for data and instruction exchange between the processor 420 and the memory 410. Of course, the system bus 430 can also connect to other devices, such as network interfaces and display devices.
[0059] In this embodiment of the invention, the executable program executed by the processing 420 of the electronic device includes:
[0060] Define serialization and deserialization interfaces according to the serialization request method of the client ECU;
[0061] Register the serialization and deserialization interfaces to the communication middleware;
[0062] Construct different ECU service instances and identify the serialization method of the service instances;
[0063] Based on the identifier of the ECU service instance, the corresponding serialization or deserialization interface is called to perform data conversion processing.
[0064] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0065] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0066] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A vehicle-side ECU communication method, characterized in that, include: Define serialization and deserialization interfaces according to the serialization request method of the client ECU; Register the serialization and deserialization interfaces to the communication middleware; Construct different ECU service instances and identify the serialization method of the service instances; Based on the identifier of the ECU service instance, the corresponding serialization or deserialization interface is called to perform data conversion processing; The data conversion processing by calling the corresponding serialization or deserialization interface includes: The client parameters are converted into a byte stream by calling the serialization interface and then sent to the server. The server converts the byte stream back into parameters by calling the deserialization interface and then sends them to the service interface. The server-side parameters are converted into a byte stream by calling the serialization interface and then sent to the client-side service interface. The client-side service interface converts the byte stream back into parameters by calling the deserialization interface and then sends them to the client. The client consumer constructs a proxy and uses the identifier of the target service instance as a parameter. The proxy finds the corresponding serialization / deserialization interface based on the service instance identifier. After receiving the service instance request, Skeleton calls the corresponding deserialization interface to perform data conversion and calls the service interface to pass the parameters to the service provider.
2. The method according to claim 1, characterized in that, The step of calling the corresponding serialization or deserialization interface for data conversion also includes: The converted data is transmitted based on the communication protocol corresponding to the ECU.
3. A vehicle-side ECU communication system employing the method described in any one of claims 1-2, characterized in that, include: The registration module is used to define serialization and deserialization interfaces according to the serialization request method of the client ECU, and register the serialization and deserialization interfaces to the communication middleware. The construction module is used to construct different ECU service instances and identify the serialization method of the service instances; The communication middleware is used to call the corresponding serialization or deserialization interface for data conversion processing based on the identifier of the ECU service instance.
4. The system according to claim 3, characterized in that, The step of calling the corresponding serialization or deserialization interface for data conversion also includes: The converted data is transmitted based on the communication protocol corresponding to the ECU.
5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of a vehicle-side ECU communication method as described in any one of claims 1 to 2.
6. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed, it implements the steps of a vehicle-side ECU communication method as described in any one of claims 1 to 2.
Citation Information
Patent Citations
Service calling method and related equipment
CN113495796A
Communication middleware, data transmission method and vehicle
CN116366737A
