Vehicle-mounted communication method, device, equipment and storage medium

By determining the instance file information and data information of the target service in the vehicle communication system, performing serialization operations, and selecting an appropriate transmission method for data transmission, the complexity of in-vehicle communication in different language environments is solved, thereby reducing system load and improving communication efficiency.

CN114501376BActive Publication Date: 2024-11-29CHINA AUTOMOTIVE INNOVATION CORP
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202111596660.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-24
Publication Date
2024-11-29
Estimated Expiration
2041-12-24

AI Technical Summary

Technical Problem

Existing Ethernet-based in-vehicle communication methods require complex compilation and calls when dealing with data communication between controllers with different language environments or between processor cores with different language environments under the same controller, resulting in increased system load and low communication efficiency.

Method used

By determining the instance file information and data information corresponding to the target service, serialization is performed, and data transmission is carried out by selecting shared memory, transmission control protocol or user data packet protocol according to the transmission method, simplifying function calls between languages.

Benefits of technology

It reduces system load, improves data communication efficiency, and simplifies function calls in different language environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114501376B_ABST
    Figure CN114501376B_ABST
Patent Text Reader

Abstract

The present application discloses a vehicle-mounted communication method, device, equipment and storage medium. The method includes: determining the interface and instance file information corresponding to the target service, determining the data information corresponding to the target service according to the interface and instance file information corresponding to the target service, serializing the data information corresponding to the target service to obtain the serialized data information, determining the transmission mode corresponding to the target service, and if the transmission mode corresponding to the target service is shared memory, writing the serialized data information into the shared memory. In this way, cross-language function calls can be simplified, system load can be reduced, and data communication efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of vehicle-mounted Ethernet, and in particular to a vehicle-mounted communication method, device, equipment and storage medium. Background Art

[0002] With the development of intelligent vehicles, vehicle functions are becoming more and more abundant. The number of electronic control units (ECUs) in the vehicle body has rapidly increased from dozens to hundreds. The original distributed architecture design and vehicle communication mode based on bus (CAN) signals are increasingly unable to meet the development and communication of existing intelligent vehicles. Centralized electronic and electrical architecture and Ethernet-based in-vehicle communication have become a technical trend. In the existing Ethernet-based in-vehicle communication, data communication between different controllers and data communication between the same controllers use the same communication protocol, with a large amount of data transmission, which increases the system load. In addition, the existing Ethernet-based in-vehicle communication often requires complex compilation and calling when facing data communication between controllers in different language environments, or between processor cores in different language environments under the same controller. Summary of the invention

[0003] The embodiments of the present application provide a vehicle-mounted communication method, apparatus, device and storage medium, which can support different communication modes, simplify function calls across languages, reduce system load and improve data communication efficiency.

[0004] On the one hand, an embodiment of the present application provides a vehicle-mounted communication method, the method comprising:

[0005] Determine the instance file information corresponding to the target service;

[0006] Determine the data information corresponding to the target service; the data information includes data header information and valid information;

[0007] Perform serialization operation on the data information corresponding to the target service to obtain serialized data information;

[0008] Determine the transmission mode corresponding to the target service according to the instance file information corresponding to the target service;

[0009] If the transmission mode corresponding to the target service is shared memory, the serialized data information is written into the shared memory.

[0010] Further, after determining the transmission mode of the interface corresponding to the target service according to the instance file information corresponding to the target service, the method further includes:

[0011] If the transmission mode corresponding to the target service is the transmission control protocol, the serialized data information is sent through the transmission control protocol.

[0012] Further, after determining the transmission mode corresponding to the target service according to the instance file information corresponding to the target service, the method further includes:

[0013] If the transmission mode corresponding to the target service is User Datagram Protocol, the serialized data information is sent through User Datagram Protocol.

[0014] Furthermore, before determining the instance file information corresponding to the target service, the process also includes:

[0015] Define the service interface through the interface definition language;

[0016] Initialize the instance file information of the service; the instance file information includes service information, instance information and transmission method.

[0017] On the other hand, an embodiment of the present application provides a vehicle-mounted communication method, the method comprising:

[0018] Receive serialized data information;

[0019] Deserialize the serialized data information to obtain the data information;

[0020] Determine the interface corresponding to the target service according to the data header information in the data information;

[0021] Transmit data information to the interface corresponding to the target service;

[0022] Obtain valid information from data information;

[0023] Execute the target service based on the valid information.

[0024] Further, after executing the target service according to the valid information, it also includes:

[0025] If the message type in the data message is a request for which a response is expected, a response message is sent.

[0026] Furthermore, the method further comprises:

[0027] If the target service is executed successfully, it is determined that the data information is processed successfully, and a return message indicating successful processing is sent.

[0028] Furthermore, the method further comprises:

[0029] If the target service fails to execute, it is determined that the data information processing fails, and the failure type corresponding to the data information is determined;

[0030] Determine the return information corresponding to the failure type according to the failure type;

[0031] Send return information.

[0032] On the other hand, an embodiment of the present application provides a vehicle-mounted communication device, the device comprising:

[0033] A service determination module is used to determine the instance file information corresponding to the target service;

[0034] A data information determination module, used to determine the data information corresponding to the target service; the data information includes data header information and valid information;

[0035] The serialization module is used to perform serialization operations on the data information corresponding to the target service to obtain the serialized data information;

[0036] A transmission mode determination module, used to determine the transmission mode corresponding to the target service according to the instance file information corresponding to the target service;

[0037] The information transmission module is used to write the serialized data information into the shared memory if the transmission mode corresponding to the target service is the shared memory.

[0038] Furthermore, the device also includes:

[0039] The information transmission module is also used to send serialized data information through the transmission control protocol if the transmission mode corresponding to the target service is the transmission control protocol.

[0040] Furthermore, the device also includes:

[0041] The information transmission module is also used to send the serialized data information through the user data packet protocol if the transmission mode corresponding to the target service is the user data packet protocol.

[0042] Furthermore, the device also includes:

[0043] An interface definition module, used to define the interface of a service using an interface definition language;

[0044] The initialization module is used to initialize the instance file information of the service; the instance file information includes service information, instance information and transmission method.

[0045] On the other hand, an embodiment of the present application provides a vehicle-mounted communication device, the device comprising:

[0046] An information receiving module, used for receiving serialized data information;

[0047] A deserialization module, used to perform a deserialization operation on the serialized data information to obtain data information;

[0048] An interface determination module, used to determine an interface corresponding to a target service according to data header information in the data information;

[0049] An interface transmission module, used to transmit the data information to the interface corresponding to the target service;

[0050] An effective information acquisition module, used to acquire effective information from the data information;

[0051] The service execution module is used to execute the target service according to the valid information.

[0052] Furthermore, the device also includes:

[0053] The response information sending module is used to send the response information if the message type in the data information is a request for which a response is expected.

[0054] Furthermore, the device also includes:

[0055] The return information sending module is used to determine that the data information processing is successful if the target service is executed successfully and send the return information of successful processing.

[0056] Furthermore, the device also includes:

[0057] The return information sending module is also used to determine the data information processing failure if the target service fails to execute, and determine the failure type corresponding to the data information;

[0058] Determine the return information corresponding to the failure type according to the failure type;

[0059] Send return information.

[0060] On the other hand, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded by the processor and executes the vehicle communication method as described above.

[0061] On the other hand, an embodiment of the present application provides a computer storage medium, in which at least one instruction or at least one program is stored, and the at least one instruction or at least one program is loaded and executed by a processor to implement the vehicle communication method as described above.

[0062] The vehicle-mounted communication method, device, equipment, and storage medium provided by the embodiments of the present application have the following technical effects:

[0063] On the one hand, an embodiment of the present application provides a vehicle-mounted communication method, the method comprising:

[0064] Determine the interface and instance file information corresponding to the target service, determine the data information corresponding to the target service based on the interface and instance file information corresponding to the target service, perform serialization operations on the data information corresponding to the target service to obtain the serialized data information, and determine the transmission mode corresponding to the target service. If the transmission mode corresponding to the target service is shared memory, write the serialized data information into the shared memory. In this way, cross-language function calls can be simplified, system load can be reduced, and data communication efficiency can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are 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 creative work.

[0066] Figure 1 is a schematic diagram of an application environment provided by an embodiment of the present application;

[0067] Figure 2 It is a flowchart of a vehicle communication method provided by an embodiment of the present application;

[0068] Figure 3 It is a flowchart of a vehicle communication method provided by an embodiment of the present application;

[0069] Figure 4 is a structural schematic diagram of a vehicle-mounted communication device provided in an embodiment of the present application;

[0070] Figure 5 is a structural schematic diagram of a vehicle-mounted communication device provided in an embodiment of the present application;

[0071] Figure 6 This is a hardware structure block diagram of a server of an in-vehicle communication method provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0073] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0074] See also Figure 1 , Figure 1 1 is a schematic diagram of an application environment provided by an embodiment of the present application, including a client 101 and a server 102. The client 101 determines the target service to be called and the server 102 corresponding to the target service, and sends a request to call the target service to the server 102; the server 102 receives the request to call the target service, and executes the call to the target service according to the request to call the target service.

[0075] Specifically, the client 101 determines the interface and instance file information corresponding to the target service, determines the data information corresponding to the target service based on the interface and instance file information corresponding to the target service, serializes the data information corresponding to the target service to obtain the serialized data information, determines the transmission mode corresponding to the target service, and if the transmission mode corresponding to the target service is shared memory, writes the serialized data information into the shared memory.

[0076] Specifically, the server 102 receives serialized data information, performs a deserialization operation on the serialized data information to obtain the data information, determines the interface corresponding to the target service according to the data header information in the data information; transmits the data information to the interface corresponding to the target service; obtains valid information in the data information; and executes the target service according to the valid information.

[0077] In the embodiment of the present application, the client 101 and the server 102 are both controllers in the car, connected via the vehicle Ethernet. Optionally, the client 101 and the server 102 can be different processor cores in the same controller. Optionally, the client 101 and the server 102 can also be different controllers. Optionally, the client 101 and the server 102 can be controllers in the same language environment. Optionally, the client 101 and the server 102 can also be controllers in different language environments. In this way, data communication in four situations can be taken into account at the same time: two processor cores in the same language environment in the same controller, two processor cores in different language environments in the same controller, two controllers in the same language environment, and two controllers in different language environments.

[0078] In the embodiment of the present application, the client 101 and the server 102 are not fixed. A client 101 of a service can be a server 102 of another service, and a server 102 of a service can also be a client 101 of another service.

[0079] The following describes a specific embodiment of a vehicle-mounted communication method of the present application. Figure 2 It is a flowchart of a vehicle communication method provided by an embodiment of the present application. This specification provides method operation steps such as the embodiment or flowchart, but may include more or fewer operation steps based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the steps among many orders, and does not represent the only order of execution. When the actual system or server product is executed, it can be executed in the order shown in the embodiment or the drawings or in parallel (for example, in a parallel processor or multi-threaded processing environment). Specifically, Figure 2 As shown, the method may include:

[0080] S201: Determine instance file information corresponding to the target service.

[0081] In the embodiment of the present application, each service and each instance in each service has its corresponding instance file information, and the instance file information corresponding to each service and each instance in each service can be pre-configured and a corresponding configuration code can be generated and stored in each client. When the client needs to call the target service, the client can determine the instance file information corresponding to the target service according to the configuration code.

[0082] In the embodiment of the present application, the instance file information includes the service information (Service ID), instance information (Instance ID) and transmission method of the instance.

[0083] In the embodiment of the present application, the service information (Service ID) of the instance is the identifier corresponding to the service in which the instance is located. Each service uniquely corresponds to a service information (Service ID). Different services can be determined and distinguished by the service information (Service ID). Optionally, the service information (Service ID) can be an unsigned integer type with a length of 16 bits.

[0084] In an embodiment of the present application, the instance information (Instance ID) of an instance is the identifier corresponding to the instance in the service in which it is located. A service may include multiple instances, and each instance in a service uniquely corresponds to an instance information (Instance ID). Different instances in a service can be determined and distinguished through the instance information (Instance ID). Optionally, the instance information (Instance ID) can be an unsigned integer type with a length of 16 bits (bit). Thus, an instance can be uniquely determined through the service information (Service ID) and the instance information (Instance ID).

[0085] In the embodiment of the present application, the transmission mode may include the Transmission Control Protocol (TCP), the User Datagram Protocol (UDP) and the shared memory, wherein the shared memory is used for data transmission between two processor cores in the same controller.

[0086] As an optional implementation, two processor cores in the same controller may perform data transmission via a shared memory, or may perform data transmission via a Transmission Control Protocol (TCP) protocol or a User Datagram Protocol (UDP) protocol.

[0087] In the embodiment of the present application, each instance corresponds to a unique transmission mode to prevent repeated calls from occurring during the call. Different instances within the same service may correspond to different transmission modes.

[0088] S203: Determine data information corresponding to the target service.

[0089] In the embodiment of the present application, the data information includes data header information and valid information. The data header information is auxiliary information in the data information, and the data header information is used to control the carrying and transmission of the data information, so that the valid information is transmitted to the server, so as to call and execute the target service according to the valid message.

[0090] In the embodiment of the present application, the data header information complies with the Internet Protocol (IP) protocol, thereby facilitating data transmission through the existing Ethernet.

[0091] In the embodiment of the present application, the data header information includes message information (Message ID), request information (RequestID), protocol version information (Protocol Version), interface version information (Interface Version), message type (Message Type) and return information (return Code).

[0092] In an embodiment of the present application, since an instance may include multiple methods (Method), events (Event) or notifications (Notification), the target service to be called is determined by message information (Message ID) to determine which method (Method), event (Event) or notification (Notification) in the corresponding instance.

[0093] In the embodiment of the present application, a method (Method), event (Event) or notification (Notification) uniquely corresponds to a message information (Message ID) in the system. Optionally, the system can be a general system composed of all controllers in the car, or a subsystem composed of some controllers in the car, such as an electric power steering system (EPS). Optionally, the message information (Message ID) can be matched with the bus identifier (CAN ID), so that data transmission and communication between the vehicle Ethernet and the bus (CAN) signal can be realized.

[0094] In the embodiment of the present application, the message information (Message ID) may be a 32-bit identifier.

[0095] As an optional implementation, for a method (Method), the message information (Message ID) corresponding to the method (Method) can be composed of the service information (Service ID) of the instance where the method (Method) is located and the method information (Method ID) with the first bit (bit) being 0. The method information (Method ID) is a unique identifier of the method in the corresponding service, and its size is 16 bits (bit).

[0096] As an optional implementation, for an event (Event) or notification (Notification), the message information (Message ID) corresponding to the event (Event) or notification (Notification) may be composed of the service information (Service ID) of the instance where the event (Event) or notification (Notification) is located and the event information (Event ID) with the first bit (bit) being 1. The event information (Event ID) is a unique identifier of the event (Event) or notification (Notification) in the corresponding service, and its size is 16 bits (bits).

[0097] As an optional implementation manner, the first bit of the method information (Method ID) may also be 1, and correspondingly, the first bit of the event information (Event ID) is 0.

[0098] In the embodiment of the present application, the request information (Request ID) is unique to the combination of the client and the server, and can be used to distinguish multiple calls to the same method (Method) by the client. For a request (Request) for which a response (Response) is expected, the server can copy the request information (Request ID) of the request to the response (Response) information, so that when there are multiple requests (Request) that are not completed, the client can still map the received response (Response) information to the request (Request) issuer and determine the specific request (Request) issuer corresponding to the response (Response) information. When the response (Response) arrives at the corresponding request (Request) issuer or the response (Response) does not arrive within a preset time, the request information (Request ID) can be reused.

[0099] In an embodiment of the present application, the request information (Request ID) can be a 32-bit identifier, consisting of client information (Client ID) and session information (Session ID), and the size of the client information (Client ID) and the session information (Session ID) are both 16 bits.

[0100] In the embodiment of the present application, a client uniquely corresponds to a client ID in the system. The session ID is a unique identifier assigned to the client each time it calls a service. If the session function is not used, the corresponding session ID can be set to 0x0000.

[0101] As an optional implementation, the call of the method using the request / response mode can be processed using the session function. Correspondingly, the session information (Session ID) can start from 0x0001.

[0102] As an optional implementation, the call of events, notifications, and methods that adopt the fire and forget mode can be processed using the session function or not. Specifically, whether to use the session function can be determined according to the requirements of the application layer. If the session function is used to process the call of events, notifications, and methods that adopt the fire and forget mode, the corresponding session information (Session ID) starts from 0x0001 and increases each time the information is sent.

[0103] In the embodiment of the present application, when the value of the session information (Session ID) reaches 0xFFFF, it can start again from 0x0001.

[0104] In the embodiment of the present application, the protocol version information (Protocol Version) may be an 8-bit field for defining the version number of the protocol. In the embodiment of the present application, the protocol version information (Protocol Version) is set to 0x01.

[0105] In the embodiment of the present application, the interface version information (Interface Version) may be an 8-bit field used for the version number of the service interface.

[0106] In the embodiment of the present application, the message type (Message Type) can be an 8-bit field, which is used to distinguish the communication mode between the client and the server. Specifically, Table 1 is a corresponding table of message types (Message Type) of a vehicle communication method in an embodiment of the present application, and the first row of Table 1 represents the value of the message type (Message Type), the message type, and the corresponding meaning of the message type.

[0107] Table 1

[0108]

[0109]

[0110] In the embodiment of the present application, for the conventional request / response mode, that is, there is a request (Request) with an expected response, the corresponding message type (Message Type) is 0x00. Correspondingly, the server returns a response (Response) information after calling the target service, and the message type (Message Type) corresponding to the response (Response) information is 0x80.

[0111] In the embodiment of the present application, if the transmission mode corresponding to the target service is the User Datagram Protocol (UDP) or other transport layer protocols without receiving responses, a request (Request) for returning an acknowledgment (ACK) may be used, and the corresponding message type (Message Type) may be 0x40. Correspondingly, the server returns an acknowledgment (ACK) message after calling the target service, and the message type (Message Type) corresponding to the acknowledgment (ACK) message is 0x80.

[0112] In the embodiment of the present application, the return information (return Code) can be an 8-bit field, which is used to indicate whether the request (Request) to call the target service is successfully processed. For the message types (Message Type) of 0x00, 0x01 and 0x02, that is, there is a request (Request) with an expected response (Response), a request (Request) without an expected response (Response) and a callback of a request notification (Notification) or event (Event), and there is no expected data information in response (Response). Since it is a request (Request) to call the target service sent by the client to the server, there is no data communication before this, and the corresponding return information (return Code) is 0x00, that is, no error occurs.

[0113] S205: Perform a serialization operation on the data information corresponding to the target service to obtain serialized data information.

[0114] In the embodiment, the data information is serialized by protobuf (Google Protocol Buffers). Protobuf (Google Protocol Buffers) is a highly efficient protocol data exchange format tool library. Compared with the conventional structured data serialization method, it has higher conversion efficiency and supports multiple languages ​​such as Java, C++, Python, and supports multiple platforms, thereby simplifying cross-language function calls.

[0115] S207: Determine the transmission mode corresponding to the target service according to the instance file information corresponding to the target service.

[0116] In the embodiment of the present application, the instance file information corresponding to the target service includes the transmission method adopted by the instance, and the transmission method corresponding to the target service can be determined based on the instance file information corresponding to the target service.

[0117] S209: If the transmission mode corresponding to the target service is shared memory, the serialized data information is written into the shared memory.

[0118] In the embodiment of the present application, two processor cores in the same controller can transmit data through shared memory, thereby avoiding the use of communication protocols to call services in the same controller, improving the call rate, and reducing the system load. In addition, if the two processor cores are in different language environments, the serialization of data information based on protobuf (Google Protocol Buffers) combined with data transmission through shared memory simplifies cross-language function calls and enables fast calls in different language environments.

[0119] As an optional implementation, if the transmission mode corresponding to the target service is the Transmission Control Protocol (TCP) protocol, the serialized data information is sent through the Transmission Control Protocol (TCP).

[0120] As an optional implementation, if the transmission mode corresponding to the target service is the User Datagram Protocol (UDP), the serialized data information is sent via the User Datagram Protocol (UDP).

[0121] Through the above method, the vehicle communication method provided in the present application can support different communication modes, and can simultaneously take into account data communications in four situations: two processor cores in the same language environment in the same controller, two processor cores in different language environments in the same controller, two controllers in the same language environment, and two controllers in different language environments. It reduces the system load, simplifies function calls across languages, and realizes fast calls in different language environments.

[0122] As an optional implementation, before the client calls the target service and determines the instance file information corresponding to the target service, the interface corresponding to each service is defined, and the operation of initializing the instance file information corresponding to each service is initialized.

[0123] In an embodiment of the present application, each interface is defined by an interface definition language, and the functional limitations of each interface are defined, thereby establishing a correspondence between services of different types and functions and instances within services and each interface. By determining the interface corresponding to the target service, the target service can be found and called, which facilitates the subsequent server to execute the call to the target service.

[0124] In an embodiment of the present application, the instance file information corresponding to each service is initialized, the transmission mode of each instance within each service is determined, and a correspondence is established between the instance file information and the unique service information (Service ID) and instance information (Instance ID) of the corresponding instance, so that the transmission mode of the target service can be determined by searching or calling the instance file information of the target service.

[0125] Figure 3 A schematic diagram of a vehicle communication method provided in an embodiment of the present application is shown. Figure 3 As shown, the method includes:

[0126] S301: receiving serialized data information.

[0127] In the embodiment of the present application, the server receives the serialized data information sent by the client. Optionally, if the client writes the serialized data information into the shared memory, the server reads the serialized data information from the shared memory.

[0128] S303: Deserialize the serialized data information to obtain the data information.

[0129] In the embodiment of the present application, the serialized data information is deserialized based on protobuf (Google Protocol Buffers) to obtain the data information.

[0130] S305: Determine the interface corresponding to the target service according to the data header information in the data information.

[0131] In the embodiment of the present application, the message information (Message ID) in the data header information can uniquely determine the corresponding method (Method), event (Event) or notification (Notification), and can also uniquely determine the corresponding service information (Service ID). According to the service information (Service ID), the interface corresponding to the service can be determined, and thus the interface corresponding to the target service can be determined according to the data header information.

[0132] S307: Transmit the data information to the interface corresponding to the target service.

[0133] In the embodiment of the present application, there is a definite corresponding relationship between each service and each interface. By transmitting data information to the interface corresponding to the target service, the data information can be transmitted to the target service according to the interface.

[0134] S309: Obtain valid information in the data information.

[0135] In the embodiment of the present application, the header information is auxiliary information in the data information, which is used to control the carrying and transmission of the data information so that the valid information is transmitted to the server. When the data information is transmitted to the target service, the header information is separated and discarded, while the valid information is retained for executing and calling the target service.

[0136] S311: Execute the target service according to the valid information.

[0137] As an optional implementation, if the message type (Message Type) in the data information is 0x00, that is, there is a request (Request) expected by the response (Response), the server returns a message to the client and sends a response (Response) information. Correspondingly, the message type (Message Type) of the response (Response) information is 0x80.

[0138] As an optional implementation, if the target service is executed successfully and the data information is determined to be processed successfully, the server sends a return code indicating successful processing to the client, and the corresponding return code value is 0x00, indicating that no error occurred.

[0139] If the target service fails to execute, it is determined that the data information processing failed, and check whether the following errors are generated:

[0140] The first error: The protocol version information (Protocol Version) is not supported;

[0141] The second error: Service information (Service ID) is not supported;

[0142] The third error: The interface version information (Interface Version) corresponding to the service does not match;

[0143] The fourth error: method information (Method ID) is not supported;

[0144] The fifth error: The message type is not supported.

[0145] The sixth error: The message type is not defined;

[0146] The seventh error: The payload cannot be parsed, deserialization error.

[0147] According to the above seven types of errors, determine which specific error type the failure type corresponding to the data information is, determine the corresponding return information (return Code) according to the failure type, and send the return information (returnCode) to the client.

[0148] Specifically, Table 2 is a corresponding table of return information (return Code) of a vehicle-mounted communication method of an embodiment of the present application. The first row of Table 2 represents the value of the return information (return Code), the return information, and the corresponding meaning of the return information.

[0149] Table 2

[0150]

[0151]

[0152] The embodiment of the present application also provides a vehicle-mounted communication device, Figure 4 is a schematic diagram of the structure of a vehicle-mounted communication device provided in an embodiment of the present application, such as Figure 4 As shown, the device comprises:

[0153] The service determination module 401 is used to determine the instance file information corresponding to the target service.

[0154] The data information determination module 402 is used to determine the data information corresponding to the target service; the data information includes data header information and valid information.

[0155] The serialization module 403 is used to perform a serialization operation on the data information corresponding to the target service to obtain the serialized data information.

[0156] The transmission mode determination module 404 is used to determine the transmission mode corresponding to the target service according to the instance file information corresponding to the target service.

[0157] The information transmission module 405 is used to write the serialized data information into the shared memory if the transmission mode corresponding to the target service is the shared memory.

[0158] As an optional implementation, the device further includes:

[0159] The information transmission module 405 is further used to send the serialized data information through the transmission control protocol if the transmission mode corresponding to the target service is the transmission control protocol.

[0160] As an optional implementation, the device further includes:

[0161] The information transmission module 405 is further configured to send the serialized data information via the user data packet protocol if the transmission mode corresponding to the target service is the user data packet protocol.

[0162] As an optional implementation, the device further includes:

[0163] The interface definition module 406 is used to define the interface of the service by using an interface definition language.

[0164] The initialization module 407 is used to initialize the instance file information of the service; the instance file information includes service information, instance information and transmission mode.

[0165] As an optional implementation, the present application also provides a vehicle-mounted communication device, Figure 5 is a schematic diagram of the structure of a vehicle-mounted communication device provided in an embodiment of the present application, such as Figure 5 As shown, the device comprises:

[0166] The information receiving module 501 is used to receive serialized data information.

[0167] The deserialization module 502 is used to perform a deserialization operation on the serialized data information to obtain data information.

[0168] The interface determination module 503 is used to determine the interface corresponding to the target service according to the data header information in the data information.

[0169] The interface transmission module 504 is used to transmit the data information to the interface corresponding to the target service.

[0170] The valid information acquisition module 505 is used to acquire the valid information in the data information.

[0171] The service execution module 506 is used to execute the target service according to the valid information.

[0172] As an optional implementation, the device further includes:

[0173] The response information sending module 507 is used to send response information if the message type in the data information is a request for which a response is expected.

[0174] As an optional implementation, the device further includes:

[0175] The return information sending module 508 is used to determine that the data information processing is successful if the target service is executed successfully and send a return information indicating the processing is successful.

[0176] As an optional implementation, the device further includes:

[0177] The return information sending module 508 is also used to determine that the data information processing fails if the target service fails to execute, determine the failure type corresponding to the data information; determine the return information corresponding to the failure type according to the failure type; and send the return information.

[0178] The device and method embodiments in the device embodiment are based on the same application concept.

[0179] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal, a server or a similar computing device. Taking running on a server as an example, Figure 6 1 is a hardware structure block diagram of a server of a vehicle-mounted communication method provided in an embodiment of the present application. Figure 6As shown, the server 600 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 610 (the processor 610 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 630 for storing data, and one or more storage media 620 (such as one or more mass storage devices) for storing application programs 623 or data 622. Among them, the memory 630 and the storage medium 620 can be short-term storage or permanent storage. The program stored in the storage medium 620 may include one or more modules, each of which may include a series of instruction operations on the server. Furthermore, the central processing unit 610 can be configured to communicate with the storage medium 620 and execute a series of instruction operations in the storage medium 620 on the server 600. The server 600 may also include one or more power supplies 660, one or more wired or wireless network interfaces 650, one or more input and output interfaces 640, and / or one or more operating systems 621, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0180] The input / output interface 640 may be used to receive or send data via a network. The specific example of the network may include a wireless network provided by a communication provider of the server 600. In one example, the input / output interface 640 includes a network adapter (Network Interface Controller, NIC), which may be connected to other network devices via a base station so as to communicate with the Internet. In one example, the input / output interface 640 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0181] It can be understood by those skilled in the art that Figure 6 The structure shown is for illustration only and does not limit the structure of the above electronic device. Figure 6 More or fewer components as shown, or with Figure 6 Different configurations are shown.

[0182] An embodiment of the present application also provides an in-vehicle communication device, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, at least one program, a code set or an instruction set is loaded and executed by the processor to implement the in-vehicle communication method.

[0183] An embodiment of the present application also provides a storage medium, which can be set in a server to store at least one instruction, at least one program, a code set or an instruction set related to a value determination method in a method embodiment. The at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the vehicle-mounted communication method provided by the above-mentioned method embodiment.

[0184] Optionally, in this embodiment, the storage medium may be located in at least one of the multiple network servers of the computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0185] It can be seen from the embodiments of the in-vehicle communication method, device, equipment and storage medium provided by the present application that in the present application, the interface and instance file information corresponding to the target service are determined, the data information corresponding to the target service is determined based on the interface and instance file information corresponding to the target service, the data information corresponding to the target service is serialized to obtain the serialized data information, and the transmission mode corresponding to the target service is determined. If the transmission mode corresponding to the target service is shared memory, the serialized data information is written into the shared memory. In this way, different communication modes can be supported, and cross-language function calls can be simplified, the system load can be reduced, and the data communication efficiency can be improved.

[0186] It should be noted that the above-mentioned sequence of the embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. The above-mentioned specific embodiments of this specification are described. Other embodiments are within the scope of the attached claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0187] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0188] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0189] The above are only preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A vehicle communication method, characterized in that: The method is applied to in-vehicle communication based on Ethernet between different controllers in a vehicle or between different processor cores under the same controller, including: Determine the instance file information corresponding to the target service; Determine the data information corresponding to the target service; the data information includes data header information and valid information; the data header information includes message information, request information, protocol version information, interface version information, message type and return information; Performing a serialization operation on the data information corresponding to the target service to obtain serialized data information; Determine the transmission mode corresponding to the target service according to the instance file information corresponding to the target service; If the transmission mode corresponding to the target service is shared memory, the serialized data information is written into the shared memory; the shared memory is used for data transmission between two processor cores in the same controller; If the transmission mode corresponding to the target service is the transmission control protocol, sending the serialized data information through the transmission control protocol; If the transmission mode corresponding to the target service is the User Datagram Protocol, the serialized data information is sent via the User Datagram Protocol.

2. The vehicle-mounted communication method according to claim 1, characterized in that: Before determining the instance file information corresponding to the target service, the method further includes: Define the service interface through the interface definition language; Initialize the instance file information of the service; the instance file information includes service information, instance information and transmission mode.

3. A vehicle-mounted communication method, characterized in that: The method is applied to in-vehicle communication based on Ethernet between different controllers in a vehicle or between different processor cores under the same controller, including: Receive serialized data information; Deserialize the serialized data information to obtain data information; the data information includes data header information and valid information; the data header information includes message information, request information, protocol version information, interface version information, message type and return information; Determine the interface corresponding to the target service according to the data header information in the data information; Transmitting the data information to the interface corresponding to the target service; Acquire valid information from the data information; The target service is executed according to the valid information.

4. The vehicle-mounted communication method according to claim 3, characterized in that: After executing the target service according to the valid information, the method further includes: If the message type in the data information is a request for which a response is expected, a response message is sent.

5. The vehicle-mounted communication method according to claim 3, characterized in that: The method further comprises: If the target service is executed successfully, it is determined that the data information is processed successfully, and a return message indicating successful processing is sent.

6. The vehicle-mounted communication method according to claim 5, characterized in that: The method further comprises: If the target service fails to execute, determining that the data information processing fails, and determining the failure type corresponding to the data information; Determine, according to the failure type, the return information corresponding to the failure type; The return information is sent.

7. A vehicle-mounted communication device, characterized in that: The device is applied to in-vehicle communication based on Ethernet between different controllers in a vehicle or between different processor cores under the same controller, including: A service determination module is used to determine the instance file information corresponding to the target service; A data information determination module, used to determine the data information corresponding to the target service; the data information includes data header information and valid information; the data header information includes message information, request information, protocol version information, interface version information, message type and return information; A serialization module, used to perform a serialization operation on the data information corresponding to the target service to obtain serialized data information; A transmission mode determination module, used to determine the transmission mode corresponding to the target service according to the instance file information corresponding to the target service; An information transmission module is used to write the serialized data information into the shared memory if the transmission mode corresponding to the target service is shared memory; the shared memory is used for data transmission between two processor cores in the same controller; if the transmission mode corresponding to the target service is transmission control protocol, the serialized data information is sent through the transmission control protocol; if the transmission mode corresponding to the target service is user data packet protocol, the serialized data information is sent through the user data packet protocol.

8. A vehicle-mounted communication device, characterized in that: The device is applied to in-vehicle communication based on Ethernet between different controllers in a vehicle or between different processor cores under the same controller, including: An information receiving module, used for receiving serialized data information; A deserialization module, used to perform a deserialization operation on the serialized data information to obtain data information; the data information includes data header information and valid information; the data header information includes message information, request information, protocol version information, interface version information, message type and return information; An interface determination module, used to determine an interface corresponding to a target service according to data header information in the data information; An interface transmission module, used to transmit the data information to the interface corresponding to the target service; An effective information acquisition module, used to acquire effective information from the data information; A service execution module is used to execute the target service according to the valid information.

9. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded by the processor and executed according to the in-vehicle communication method as described in any one of claims 1-2 or 3-6.

10. A computer storage medium, characterized in that: The computer storage medium stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement the vehicle-mounted communication method as described in any one of claims 1-2 or 3-6.

Citation Information

Patent Citations

  • Interprocess function invocation method and device based on shared memory

    CN107491355A

  • Method for communication network data transmission, apparatus for communication network data transmission, storage medium and terminal device for realizing communication network data transmission

    CN108600011A

  • Recording data multi-process distribution method and system based on Android equipment

    CN110781014A

  • Data communication method and system for remotely calling automatic driving platform

    CN112804249A

  • Systems and methods for secure data sharing

    US20120072723A1