CN116800787A - Vehicle-mounted communication method and system based on Ethernet communication protocol - Google Patents

Vehicle-mounted communication method and system based on Ethernet communication protocol Download PDF

Info

Publication number
CN116800787A
CN116800787A CN202310719214.3A CN202310719214A CN116800787A CN 116800787 A CN116800787 A CN 116800787A CN 202310719214 A CN202310719214 A CN 202310719214A CN 116800787 A CN116800787 A CN 116800787A
Authority
CN
China
Prior art keywords
data
message
vehicle
unit
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310719214.3A
Other languages
Chinese (zh)
Inventor
徐晴雯
廖飞亮
李化武
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SHENZHEN ZHONGHONG TECHNOLOGY CO LTD
Original Assignee
SHENZHEN ZHONGHONG TECHNOLOGY CO LTD
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SHENZHEN ZHONGHONG TECHNOLOGY CO LTD filed Critical SHENZHEN ZHONGHONG TECHNOLOGY CO LTD
Priority to CN202310719214.3A priority Critical patent/CN116800787A/en
Publication of CN116800787A publication Critical patent/CN116800787A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Computer Security & Cryptography (AREA)
  • Communication Control (AREA)

Abstract

The application relates to the technical field of vehicle-mounted Ethernet, and particularly discloses a vehicle-mounted communication method and system based on an Ethernet communication protocol, wherein the system comprises the following steps: the communication service module is used for confirming the data transmission object and providing a data communication interface for transmitting protocol frame data; the data transmission module is used for constructing a response queue according to the data transmission object and the size of the protocol frame data, and transmitting and receiving the protocol frame data according to the response queue; the data analysis module is used for encoding data to be transmitted to generate byte order data and analyzing the received protocol frame data to extract message content; the data processing module is used for processing the message content and feeding back the processing result to the data transmission module. According to the application, the response queue is constructed according to the transmission object of the data and the time interval of the data subsection transmission, so that each path of communication process is flexibly processed in a multithreading mode, and the vehicle-mounted communication efficiency is improved.

Description

Vehicle-mounted communication method and system based on Ethernet communication protocol
Technical Field
The application relates to the technical field of vehicle-mounted Ethernet, in particular to a vehicle-mounted communication method and system based on an Ethernet communication protocol.
Background
SOME/IP is used as a service-oriented scalability protocol introduced by vehicle-mounted Ethernet communication and is widely applied to various functional fields of SOA architecture vehicle types, and TCP or UDP can be selected to be used as a transmission layer protocol according to different scenes and requirements, so that data can still be ensured not to be lost under the conditions that the number of the service ends and the client ends is increased and the data volume is increased.
With the development of automation and intellectualization of automobiles, the data volume of vehicle-mounted communication is increased more and more, so that the data volume of single-frame SOME/IP protocol exceeds the prescribed length of protocol, and in order to ensure that data is not lost, packet transmission is used, namely, the data is segmented for transmission, but the packet transmission generally increases time intervals, so that when more objects are transmitted, the data transmission efficiency is reduced, and the normal vehicle-mounted communication is influenced.
Disclosure of Invention
The application aims to provide a method and a system based on an Ethernet communication protocol, which are applied to vehicle-mounted instrument communication software, and can dynamically adjust a data processing process by constructing a response queue according to a data transmission object and a data segmentation sending time interval, thereby reducing the influence of the increase of communication data quantity on vehicle-mounted communication efficiency.
In a first aspect, the present application provides a vehicle-mounted communication system based on an ethernet communication protocol, including: a communication service module, a data transmission module, a data analysis module and a data processing module,
the communication service module is used for confirming a data transmission object and providing a data communication interface for transmitting protocol frame data;
the data transmission module is used for constructing a response queue according to the data transmission object and the protocol frame data size, and transmitting and receiving the protocol frame data according to the response queue;
the data analysis module is used for encoding data to be transmitted to generate byte sequence data and analyzing the received protocol frame data to extract message content;
the data processing module is used for processing the message content and feeding back the processing result to the data transmission module.
According to the technical scheme, when the data volume is large and the data is required to be sent and received in a segmented mode, the response queue is constructed according to the transmission object of the data and the time interval of the data segment sending, and the waiting time can be used for processing other communication processes, so that the vehicle-mounted communication still has high communication efficiency under the condition of large data volume.
Optionally, the communication service module comprises a service discovery unit, a service providing unit and a service monitoring unit,
the service discovery unit is used for acquiring services provided by other devices in the vehicle-mounted network;
the service providing unit is used for issuing service examples for other vehicle-mounted equipment in the vehicle-mounted network to find and use and is provided with a service interface;
the service monitoring unit is used for monitoring whether network connection is established between the vehicle-mounted devices, locating the service instance and detecting whether the service instance is running.
Optionally, the data transmission module comprises a data receiving unit, a data sending unit and a response control center,
the data receiving unit is used for receiving protocol frame data sent by other equipment of the vehicle-mounted network, extracting information through the data analysis module and storing the information into a preset information queue;
the data transmitting unit is used for generating data to be transmitted according to the feedback result of the data processing module;
the response control center is used for constructing a response queue according to the data transmission object and the data protocol frame size, and transmitting and receiving data according to the response queue.
Optionally, the response control center comprises a data segmentation unit, a data reorganization unit, a time monitoring unit and a response queue generating unit,
the data segmentation unit is used for segmenting data according to a preset segmentation rule when the data is transmitted;
the data reorganizing unit is used for receiving and reorganizing data sent by the segments during data receiving;
the time monitoring unit is used for setting a time interval and carrying out segmented transmission and segmented reception of data according to the time interval;
the response queue generating unit is used for generating corresponding response queues at the data sending end and the data receiving end respectively according to all transmission data and set time intervals, and realizing data sending and data receiving processing according to the response queues.
Optionally, the data analysis module comprises a serialization processing unit and a deserialization processing unit,
the serialization processing unit is used for serializing the transmitted data to form byte order data;
the anti-sequence processing unit is used for performing anti-sequence processing on the received data to form data in a protocol matrix definition format.
Optionally, the data processing module comprises an active processing unit and a passive processing unit,
the active processing unit is used for actively carrying out data feedback according to the subscription event and transmitting the corresponding result to the data transmission module;
the passive processing unit is used for carrying out response processing according to the received protocol frame data and transmitting a response result to the data transmission module.
In a second aspect, the present application provides a vehicle-mounted communication method based on an ethernet communication protocol, including the following steps:
receiving protocol frame data transmitted by other vehicle-mounted equipment in real time, and processing the received protocol frame data through a data analysis module to acquire message content and a data transmission queue;
responding the message content through a data processing module to generate a response result;
based on the response result, generating data to be transmitted through a data transmission module;
and feeding the data to be transmitted back to the data transmission object.
Optionally, the feeding back the data to be sent to the data transmission object includes:
judging whether the size of the data to be transmitted reaches a preset threshold value,
if not, directly transmitting the data to be transmitted to a data transmission object;
if yes, segmenting the data to be transmitted, and setting a corresponding time interval;
generating a response queue according to the data transmission object and the time interval;
and transmitting the data to be transmitted to the data transmission object based on the response queue.
Optionally, the processing the received protocol frame data through the data parsing module, after obtaining the message content, includes:
judging whether the message is a synchronous message or an asynchronous message based on the message content;
if the message is the synchronous message, a preset callback method is directly triggered;
if the message is an asynchronous message, the message is stored in a preset message queue.
In a third aspect, the present application provides a computer readable storage medium storing a computer program capable of being loaded by a processor and executing a vehicle-mounted communication method based on an ethernet communication protocol as described above.
In summary, the data are encapsulated correspondingly on the basis of vsomeip, and the data interaction processing between the vehicle-mounted devices can be effectively realized by modularization of the vsomeip, and various synchronous and asynchronous RPC calls or event notifications can be stably and efficiently processed; in addition, in the case of large data transmission quantity, the data processing sequence can be dynamically adjusted while the data is transmitted in a segmented mode, so that the overall efficiency of vehicle-mounted communication is improved; in addition, the producer consumption model is adopted, so that the isolation of data receiving and data processing is ensured, and the frame loss phenomenon that the data receiving is influenced due to the fact that the data processing time is too long is prevented.
Drawings
Fig. 1 is a schematic diagram of a vehicle-mounted communication system based on an ethernet communication protocol according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a communication service module according to an embodiment of the present application;
fig. 3 is a schematic diagram of a data transmission module according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a response control center provided by an embodiment of the present application;
FIG. 5 is a flowchart of a vehicle communication method based on an Ethernet communication protocol according to an embodiment of the application;
fig. 6 is a flowchart of feeding back data to be sent to a data transmission object according to an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to fig. 1 to 6.
The application provides a vehicle-mounted communication system based on an Ethernet communication protocol, referring to FIG. 1, comprising: the system comprises a communication service module 10, a data transmission module 20, a data analysis module 30 and a data processing module 40.
The communication service module 10 is configured to confirm a data transmission object and provide a data communication interface to transmit protocol frame data.
The data transmission module 20 is configured to construct a response queue according to the data transmission object and the protocol frame data size, and transmit and receive the protocol frame data according to the response queue.
The data parsing module 30 is configured to encode data to be transmitted to generate byte order data, and parse received protocol frame data to extract message content.
The data processing module 40 is configured to process the message content, and feed back the processing result to the data transmission module.
The protocol frame data represents a data packet of the SOME/IP protocol, and can be transmitted through two communication data protocols, namely TCP and UDP in the transmission process. The SOME/IP protocol packet mainly includes two major parts, namely Header and Data. The Data body represented by Data, that is, the message content, and the Header contains information such as a message ID, a service ID, a message type, and an ID corresponding to the vehicle-mounted device that sent the message.
The SOME/IP is used as a service-oriented scalability protocol introduced by vehicle-mounted Ethernet communication, and is widely applied to various functional fields of SOA architecture vehicle types. The SOME/IP protocol manages whole vehicle information in units of services, which may include various callable methods (methods) and event notification groups (EventGroups), and distributes services on demand by delivering and sharing the information through a server interface.
SOA represents a service oriented architecture in which so functions are defined as independent services and are linked by well defined interfaces and protocols between services. SOME/IP in the in-vehicle Ethernet protocol architecture is a communication middleware defined based on the SOA concept.
The application adopts vsomeip to construct SOME/IP protocol stack system and is applied in vehicle network system to construct middleware communication system of SOA architecture, so as to realize data interaction with other devices in vehicle network. The data interaction mode is in a service mode, and realizes the data interaction by publishing own service and searching for the service provided by subscribing other devices, namely, the communication connection relation is established firstly, then the data interaction can be carried out, and the communication can be carried out only when both parties know the contact way of each other compared with the mobile phone.
Thus, in the embodiment of the present application, the communication service module 10 first confirms the data transmission object and provides a data communication interface to transmit the protocol frame data.
Specifically, referring to fig. 2, the communication service module 10 includes a service discovery unit 11, a service providing unit 12, and a service monitoring unit 13.
The service discovery unit 11 is configured to obtain a service provided by another device in the vehicle-mounted network.
The service providing unit 12 is used for publishing service instances for discovery and use by other vehicle-mounted devices in the vehicle-mounted network, and is provided with a service interface.
The service monitoring unit 13 is used for monitoring whether a network connection is established between the in-vehicle devices, locating a service instance and detecting whether the service instance is running.
In the embodiment of the application, when two vehicle-mounted devices perform data interaction, the two devices are both a server and a client, namely, participate in the publishing service and the subscribing service at the same time. When the service is released, the service information provided by the service terminal is broadcasted and can be used for subscribing other vehicle-mounted equipment.
When subscribing to the service, the client is used to subscribe to the corresponding service from the service terminal providing the service. Firstly, a client searches for available service examples in a vehicle-mounted network by sending a message of a discovery service, a service end receives the discovery service message of the client and then sends a service response through UDP, and the client can subscribe related events by sending an event subscription message after receiving the response of the service end.
After receiving the subscription request of the client, the server checks whether the subscription condition is satisfied, if so, returns an ACK, and if not, returns a NACK. When the client successfully subscribes to the related event, the server can release the client subscribing to the event according to the attribute of the event, wherein ACK and NACK represent feedback information in network communication, the ACK represents positive feedback, and the NACK represents negative feedback.
In addition to acquiring available service instances by the service discovery unit 11, as a service provider, a corresponding service interface is provided by the service providing unit 12 while providing services. The service interfaces are mainly divided into three types: method, event, filed.
The Method is used for realizing communication of remote procedure call by adopting a Request-Response mechanism, a client sends a remote procedure call Request for requesting related data or requesting to execute related operations, a server receives the Request, performs corresponding operations according to content, and then feeds back the Request of the client through a Response.
The Event is used for realizing interaction of the control Event group in the subscription-release mechanism, and unlike the Method, the Event is not used for requesting one response time, but the server actively transmits data to the client to break, and the Event transmits data when the server achieves a certain condition.
Filed differs from the first two by the fact that Field's core is to manipulate a particular piece of data, which is generally a variable of particular significance, while Method and Event's core is to perform certain actions.
Each service is composed of similar or related functions and has a corresponding implementation interface. For example, the services provided by the vehicle-mounted air conditioner are: the air conditioner can be turned on or off, the air quantity of the air conditioner can be adjusted, the current environment temperature can be informed, and the current target temperature can be set. The Method can turn on or off the air conditioner, can adjust the air quantity of the air conditioner to be equal to two callable methods, can inform that the current ambient temperature is equal to an Event, and can set the current target temperature to be equal to a Field to adjust the data.
It should be noted that service subscription actually refers to a subscription event, and after the subscription is successful, the server may implement the publishing of the client subscribing to the event according to the attribute of the event itself, for example, the service may inform the current environmental temperature in the air conditioning service. After subscribing to this event, the on-board air conditioner as a server will constantly know what the current ambient temperature of the subscribing client is.
In addition, before the subscription of the service is implemented, it is first ensured that the current vehicle-mounted network is in a normal connection state, so that the service monitoring unit 13 monitors whether a network connection is established between the vehicle-mounted devices, locates the service instance and detects whether the service instance is running, and only when the service instance is detected to be in a running state, the service instance can be used by other vehicle-mounted devices.
In the embodiment of the present application, after the service communication module 10 is used to implement the service publishing and subscribing, that is, after the communication relationship is established, the data transmission object is confirmed, the data transmission module 20 can be used to receive the message sent by the other vehicle-mounted devices in real time, and send the request data to the service providing terminal according to the own needs.
Specifically, referring to fig. 3, the data transmission module 20 includes a data reception unit 21, a data transmission unit 22, and a response control center 23.
The data receiving unit 21 is configured to receive protocol frame data sent by other devices of the vehicle-mounted network, extract a message through the data parsing module, and store the message into a preset message queue.
The data transmitting unit 22 is configured to generate data to be transmitted according to a result fed back by the data processing module.
The response control center 23 is configured to construct a response queue according to the data transmission object and the data protocol frame size, and to implement transmission and reception of data according to the response queue.
The data parsing module 30 parses the protocol frame data to obtain the message content, and then performs corresponding processing according to the message content. Since multiple protocol frame data may be received in the same time period, that is, multiple in-vehicle devices all transmit messages. It is difficult to process a plurality of messages at the same time at this time, so that the acquired message content is stored in a preset message queue, and the data processing module 40 processes the messages in the message queue.
In addition to receiving messages from other devices on board the vehicle via the data receiving unit 201, messages are sent via the data sending unit 202, i.e. using services provided by other devices on board the vehicle, or feedback of messages is actively performed according to subscribed events.
In addition, it is mentioned that the vehicle-mounted devices transmit messages through SOME/IP protocol frame data, and when UDP is used for data transmission, the message is limited by the message content length, that is, a payload is included, when the data amount is large and exceeds the payload, the protocol frame data needs to be segmented, that is, segmented at the transmitting end, and received at the receiving end, and in order to remove disorder and jitter when transmitting data packets, a corresponding time interval is set, that is, after each segmented data packet is transmitted, the next segmented data packet is transmitted after a certain time interval.
Since the waiting interval time length can reduce the communication efficiency when the number of the data volume is too large and the data needs to be sent in a segmented manner is large, for example, when the vehicle-mounted device serving as a server side has a plurality of messages in an associated message queue, that is, when one task is processed, the next task is popped out of the message queue, in general, when one task is processed, a waiting process exists, and if the previous task is a task of sending the data in a segmented manner, that means that the task is completed after the data sending of all the segments is completed, and the time interval exists for sending the segments, so that when the number of the tasks sent in the segmented manner is large or the number of the segments of the data segmented is large, the whole communication efficiency can be influenced.
Therefore, in the embodiment of the present application, by adding the response control center 23, combining the message queues and the time intervals of the segmented transmission, the process of processing each message is adjusted, that is, a response queue is constructed according to the data transmission object and the data protocol frame size, and the transmission and the reception of the data are realized according to the response queue.
Specifically, referring to fig. 4, the response control center 23 includes a data segmentation unit 231, a data reassembly unit 232, a time monitoring unit 233, and a response queue generation unit 234.
The data segmentation unit 231 is configured to segment data according to a preset segmentation rule during data transmission.
The data reorganizing unit 232 is configured to receive and reorganize data sent in segments during data reception.
The time monitoring unit 233 is used to set time intervals, and performs segment transmission and segment reception of data at the time intervals.
The response queue generating unit 234 is configured to generate, at the data transmitting end and the data receiving end, a corresponding response queue according to all transmission data and the set time interval, and implement data transmission and data reception processing according to the response queue.
The response queue represents a task sequence which indicates that the current vehicle-mounted communication equipment is processed in time sequence at the data transmitting end and the data receiving end.
In the embodiment of the present application, when the amount of data to be transmitted is large, the protocol frame data, that is, the SOME/IP packet, is segmented by the data segmentation unit 231 according to the payload, and a corresponding segmentation identifier is added, so that since the data to be transmitted is sent in segments, the data to be transmitted is received in segments by the data reassembly unit 232 at the receiving end.
Since the time interval is set by the time monitoring unit 233 in order to try to avoid disorder and jitter when transmitting the data packet, and the segment transmission and segment reception of the data are performed at the time interval.
It should be noted that, since the segmentation of the data is performed according to the payload of the UDP protocol, the data byte length of each segment is the same except for the last segment, and after the last segment is transmitted, the entire data to be transmitted is transmitted, and there is no subsequent time interval, so the time interval set here is only one value, that is, the same time interval is set, and of course, there may be different time intervals according to different data transmission objects.
Considering that the time interval of transmitting data in segments may affect the communication efficiency of the whole data if the number of times of occurrence is large.
Therefore, in the embodiment of the present application, the response queue generating unit 234 generates corresponding response queues according to all the transmission data and the set time interval at the data transmitting end and the data receiving end, and implements the data transmission and the data receiving process according to the response queues.
For example, at the data transmitting end, a plurality of objects to be transmitted are confirmed according to the message queue, at this time, the sequence of the task process is determined according to the message queue, the current task process sequence is assumed to be [ A, B, C, D ], wherein A and B are tasks to be transmitted in a segmented manner, the number of segments is respectively denoted as [ A1, A2, A3] and [ B1, B2, B3 and B4], the time required for transmitting each segment is assumed to be t1, the interval time of transmitting the segment data is t2, if t1 is the same as t2, the interval time of transmitting the segment can be utilized, and the processing of the task B is performed while the task A is processed by another thread, namely, the response sequences of [ A1, B1, A2, B2, A3, B3 and B4] can be set for the two tasks of A, B.
If there is still a time interval, the process is similarly advanced downwards to determine the completion time of the next task, then whether the next task can be completed in the time interval is considered, in principle, each thread task is not interrupted by the task, that is, the task cannot be stopped under the condition that one task is completed in half, then another task is completed, thus occupying resources, affecting data transmission, releasing the resources after one task is completed, then entering another linear task, and so on, so that a response sequence can be constructed.
Of course, the above-mentioned t1 and t2 are the same for illustration only, the task sequences should be comprehensively arranged according to the duty ratio between t1 and t2 and the time of data transmission under different transmission objects, and the completion sequence of the tasks is reasonably planned by multithreading by utilizing the time intervals of segmented transmission, so as to improve the data transmission efficiency of the whole vehicle-mounted communication.
Since the data transmission is performed in the form of a SOME/IP protocol frame, but the actual data interaction is performed with the actual message content, the SOME/IP protocol frame data is also parsed by the data parsing module 30 to extract the message content.
Specifically, the data parsing module 30 includes a serialization processing unit 301 and a deserialization processing unit 302.
The serialization processing unit 301 is configured to perform serialization processing on the transmitted data to form byte order data.
The anti-sequence processing unit 302 is configured to perform anti-sequence processing on the received data to form data in a protocol matrix definition format.
Wherein Serialization refers to the process of converting a data structure or object into a binary string according to predefined rules; deserialization (Deserialization) refers to the process of reconstructing a binary string into a data structure or object according to the same rules.
In the embodiment of the application, the serialization and anti-serialization processing of the data adopts the Protobuf of the Google open source, the transmitted data is processed into a byte order by using the Protobuf to be transmitted, and the received data is processed into a format defined by a protocol matrix by the anti-serialization processing. For a specific SOME/IP protocol matrix, only a corresponding proto interface file is required to be defined, so that data encoding and decoding transmission can be conveniently carried out.
In the embodiment of the present application, the types of the messages are various, and the above is mentioned that each service instance is provided with a plurality of message transmission interfaces corresponding to different message types. There are different processing manners for different message types, so that the classification processing of the message is performed by the data processing module 40.
Specifically, the data processing module 40 includes an active processing unit 401 and a passive processing unit 402.
The active processing unit 401 is configured to actively perform data feedback according to the subscription event, and transmit the corresponding result to the data transmission module.
The passive processing unit 402 is configured to perform response processing according to the received protocol frame data, and transmit the response result to the data transmission module.
In the embodiment of the application, a producer consumer model is adopted for processing the message, and the acquired message content is stored in a preset message queue, and then the message items in the message queue are popped up and processed circularly. Therefore, the message can be cached without frame loss under the condition of large bus data quantity to a certain extent, so that the real-time performance and the reliability of the data are improved.
Because the SOME/IP protocol frame data includes a corresponding Message Type, that is, message Type is used to identify the Type of the Message, there are several types, such as request for expected reply, request for no reply, subscribed event Message, and response Message.
And processing the message popped up in the message queue, firstly determining the type of the message, if the message belongs to the request type, processing according to a preset callback method, and determining whether to generate a corresponding reply message according to whether reply is required. If the subscribed event message corresponds to a notification message, no reply is needed, and if the subscribed air conditioning service in the above example, the current ambient temperature is continuously known, so that the reply processing of the type message is not needed. If the response type message is the response type message, that is, the response message obtained in the case that the request is actively sent and the response is expected to be obtained, or the feedback message given after the subscription event is successful, etc. Such messages do not naturally require a reply either.
The processing of the message needs to be replied to or fed back, corresponding feedback information is generated by the passive processing unit 402, and then the feedback information is sent through the message transmission module 20. For the subscribed event, the attribute of the event itself is updated to automatically transmit the message, that is, the active processing unit 401 generates the corresponding message content according to the subscribed event, and then the message transmission module 20 transmits the message.
The embodiment of the application also provides a vehicle-mounted communication method based on the Ethernet communication protocol, which is shown in fig. 5 and comprises the following steps:
s100, receiving protocol frame data transmitted by other vehicle-mounted equipment in real time, and processing the received protocol frame data through a data analysis module to acquire message content and a data transmission object.
And S200, performing response processing on the message content through a data processing module, and generating a response result.
And S300, generating data to be transmitted through a data transmission module based on the response result.
S400, feeding the data to be transmitted back to the data transmission object.
In the embodiment of the application, in the whole vehicle-mounted network, all vehicle-mounted devices communicate data through SOME/IP protocol, after releasing own service for other vehicle-mounted devices to use, corresponding data requests are required to be acquired in real time, and the data requests are processed according to the data requests.
Since the data is transmitted in the form of SOME/IP protocol frame data, after receiving the protocol frame data transmitted by other devices on the vehicle, the data analysis module 30 analyzes the protocol frame data to extract the message content, and then processes the message according to the message content.
When the message content is processed, a corresponding feedback result is generated when feedback is needed, then the response result is converted into data to be sent through the data transmission module 20, and finally the data to be sent is sent to a data transmission object, so that a round of communication is completed.
In addition, since the amount of data to be transmitted is considered to be large, that is, the length of the formed byte data exceeds the payload, it is necessary to perform the segmented transmission at this time.
Therefore, in the embodiment of the present application, when the data to be transmitted is fed back to the data transmission object, the data to be transmitted is further judged according to the size of the data to be transmitted, whether the data needs to be transmitted in a segmented manner is determined, and when the data needs to be transmitted in a segmented manner, the efficiency of the whole data communication is also considered, and the time interval of fractional transmission is also considered.
Specifically, referring to fig. 6, the data to be sent is fed back to the data transmission object, and specifically includes the following steps:
s410, judging whether the size of the data to be sent reaches a preset threshold value.
And S420, if not, directly transmitting the data to be transmitted to a data transmission object.
S430, if yes, segmenting the data to be transmitted, and setting a corresponding time interval.
S440, generating a response queue according to the data transmission object and the time interval.
S450, based on the response queue, the data to be sent are sent to the data transmission object.
The preset threshold value indicates the maximum transmissible data length, namely the payload, when the data is transmitted through UDP.
Firstly, judging whether the data to be transmitted reaches a preset threshold value, and if the data to be transmitted does not reach the preset threshold value, directly transmitting the protocol frame data to be transmitted to a data transmission object.
If the data to be transmitted reaches the preset threshold, the data is segmented according to the length of the data to be transmitted and the effective load, and then the time interval is set according to the transmission object, namely, after the segmented data is transmitted once, the next segmented data is transmitted at a certain interval, so that the data transmission object is convenient to avoid disorder when receiving the data, and a certain buffer time can be provided for data recombination.
After segmenting the data and setting time intervals, confirming all data or tasks to be transmitted according to the current transmission object, constructing a response sequence by combining the time intervals of segmenting the data to be transmitted, and finally transmitting the data to be transmitted to the data transmission object according to the response sequence.
In addition, since some messages need to be fed back, the sender of the message, that is, the source of the message, is first determined, and in the above description, the protocol frame data includes information such as a corresponding Service ID, client ID, and the like, in addition to the message data, so that it can be determined by the protocol frame data where the message is transmitted, that is, the data transmission object is confirmed, and accordingly, if the message feedback is needed, the feedback message is sent to the data transmission object.
In the embodiment of the application, after receiving the protocol frame data and processing the protocol frame data through the data analysis module, the message content can be obtained, the message content is correspondingly processed through the data processing module, and for the message needing to be fed back, a corresponding response feedback result can be generated,
based on the response result, the data transmission module generates transmission data, wherein the transmission data is naturally protocol frame data, the data to be transmitted is processed in a serialization manner through a serialization processing unit in the data analysis module to form byte order data, then information such as message attribute and corresponding ID is combined to package to obtain the protocol frame data, and finally the protocol frame data is transmitted through the data transmission module, namely, feedback information is transmitted to a message source.
Because the dataset interaction is a remote message call RPC in addition to the event group interaction mechanism, the remote message call may include two forms of synchronous call and asynchronous call, and the synchronous call may be simply understood as a call party needs to wait for the call result of the executing party. For example, in the process of subscribing an event group, whether the subscription is successful or not after the event subscription message is sent, the feedback of the provider needs to be obtained to know, that is, the feedback of the service provider needs to be waited, and the real-time response needs to be called synchronously.
And the asynchronous call is performed without waiting for the execution result of the executing party by the calling party, and the corresponding message can be stored in a preset message queue under the condition.
Thus, in the embodiment of the present application, different processing is performed for these two different message formats, so that the whole communication system can stably and efficiently process various synchronous and asynchronous RPC calls or event notifications.
Specifically, the received protocol frame data is processed by the data analysis module, and after the message content is obtained, the method further comprises the following steps:
s510, judging whether synchronous message or asynchronous message based on message content.
S520, if the message is the synchronous message, a preset callback method is directly triggered.
S530, if the message is an asynchronous message, the message is sent to or received from a preset message queue.
In the embodiment of the application, after the received protocol frame data is analyzed and the message content is acquired, the message is judged, whether the message is a synchronous message or an asynchronous message is judged, whether data feedback is needed or not is judged according to the corresponding message type, and judgment is also carried out according to the corresponding Session ID, when the Session ID is in an activated state, the current call back is indicated to be in a state of being in a dialing state, and one party waits for response. This situation is also equivalent to a synchronization message.
After determining whether the synchronous message or the asynchronous message, corresponding processing is performed, and for the synchronous message, a preset callback method is directly triggered to perform processing. So as to better satisfy the real-time performance of the synchronous message. For asynchronous messages, messages are put into and taken out of a preset message queue, and then the data processing module circularly processes the messages in the message queue.
The embodiment of the application also provides a computer readable storage medium which stores a computer program capable of being loaded by a processor and executing the vehicle-mounted communication method based on the Ethernet communication protocol.
The embodiments of the present application are all preferred embodiments of the present application, and are not intended to limit the scope of the present application in this way, therefore: all equivalent changes according to the principles of the present application should be covered by the scope of the present application.

Claims (10)

1. An ethernet communication protocol-based vehicle-mounted communication system, comprising: a communication service module, a data transmission module, a data analysis module and a data processing module,
the communication service module is used for confirming a data transmission object and providing a data communication interface for transmitting protocol frame data;
the data transmission module is used for constructing a response queue according to the data transmission object and the protocol frame data size, and transmitting and receiving the protocol frame data according to the response queue;
the data analysis module is used for encoding data to be transmitted to generate byte sequence data and analyzing the received protocol frame data to extract message content;
the data processing module is used for processing the message content and feeding back the processing result to the data transmission module.
2. The Ethernet communication protocol-based vehicle communication system as claimed in claim 1, wherein the communication service module comprises a service discovery unit, a service providing unit, and a service monitoring unit,
the service discovery unit is used for acquiring services provided by other devices in the vehicle-mounted network;
the service providing unit is used for issuing service examples for other vehicle-mounted equipment in the vehicle-mounted network to find and use and is provided with a service interface;
the service monitoring unit is used for monitoring whether network connection is established between the vehicle-mounted devices, locating the service instance and detecting whether the service instance is running.
3. The Ethernet communication protocol-based vehicle communication system of claim 1, wherein the data transmission module comprises a data receiving unit, a data transmitting unit and a response control center,
the data receiving unit is used for receiving protocol frame data sent by other equipment of the vehicle-mounted network, extracting information through the data analysis module and storing the information into a preset information queue;
the data transmitting unit is used for generating data to be transmitted according to the feedback result of the data processing module;
the response control center is used for constructing a response queue according to the data transmission object and the data protocol frame size, and transmitting and receiving data according to the response queue.
4. The Ethernet communication protocol-based vehicle communication system according to claim 3, wherein the response control center comprises a data segmentation unit, a data reorganization unit, a time monitoring unit, and a response queue generating unit,
the data segmentation unit is used for segmenting data according to a preset segmentation rule when the data is transmitted;
the data reorganizing unit is used for receiving and reorganizing data sent by the segments during data receiving;
the time monitoring unit is used for setting a time interval and carrying out segmented transmission and segmented reception of data according to the time interval;
the response queue generating unit is used for generating corresponding response queues at the data sending end and the data receiving end respectively according to all transmission data and set time intervals, and realizing data sending and data receiving processing according to the response queues.
5. The Ethernet communication protocol-based vehicle communication system of claim 1, wherein the data parsing module comprises a serialization processing unit and a deserialization processing unit,
the serialization processing unit is used for serializing the transmitted data to form byte order data;
the anti-sequence processing unit is used for performing anti-sequence processing on the received data to form data in a protocol matrix definition format.
6. The Ethernet communication protocol based vehicle communication system of claim 1, wherein the data processing module comprises an active processing unit and a passive processing unit,
the active processing unit is used for actively carrying out data feedback according to the subscription event and transmitting the corresponding result to the data transmission module;
the passive processing unit is used for carrying out response processing according to the received protocol frame data and transmitting a response result to the data transmission module.
7. An ethernet communication protocol-based vehicle-mounted communication method is characterized by comprising the following steps:
receiving protocol frame data transmitted by other vehicle-mounted equipment in real time, and processing the received protocol frame data through a data analysis module to acquire message content and a data transmission object;
responding the message content through a data processing module to generate a response result;
based on the response result, generating data to be transmitted through a data transmission module;
and feeding the data to be transmitted back to the data transmission object.
8. The method for vehicle-mounted communication based on ethernet communication protocol according to claim 7, wherein said feeding back the data to be transmitted to the data transmission object comprises:
judging whether the size of the data to be transmitted reaches a preset threshold value,
if not, directly transmitting the data to be transmitted to a data transmission object;
if yes, segmenting the data to be transmitted, and setting a corresponding time interval;
generating a response queue according to the data transmission object and the time interval;
and transmitting the data to be transmitted to the data transmission object based on the response queue.
9. The method for vehicle-mounted communication based on ethernet communication protocol according to claim 7, wherein said processing the received protocol frame data by the data parsing module, after obtaining the message content, comprises:
judging whether the message is a synchronous message or an asynchronous message based on the message content;
if the message is the synchronous message, a preset callback method is directly triggered;
if the message is an asynchronous message, the message is stored in a preset message queue.
10. A computer readable storage medium storing a computer program capable of being loaded by a processor and executing a vehicle communication method based on an ethernet communication protocol according to any of claims 7 to 9.
CN202310719214.3A 2023-06-16 2023-06-16 Vehicle-mounted communication method and system based on Ethernet communication protocol Pending CN116800787A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310719214.3A CN116800787A (en) 2023-06-16 2023-06-16 Vehicle-mounted communication method and system based on Ethernet communication protocol

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310719214.3A CN116800787A (en) 2023-06-16 2023-06-16 Vehicle-mounted communication method and system based on Ethernet communication protocol

Publications (1)

Publication Number Publication Date
CN116800787A true CN116800787A (en) 2023-09-22

Family

ID=88034167

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310719214.3A Pending CN116800787A (en) 2023-06-16 2023-06-16 Vehicle-mounted communication method and system based on Ethernet communication protocol

Country Status (1)

Country Link
CN (1) CN116800787A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117459190A (en) * 2023-12-20 2024-01-26 中汽研(天津)汽车工程研究院有限公司 OTA communication method of heterogeneous central computing architecture

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117459190A (en) * 2023-12-20 2024-01-26 中汽研(天津)汽车工程研究院有限公司 OTA communication method of heterogeneous central computing architecture
CN117459190B (en) * 2023-12-20 2024-04-02 中汽研(天津)汽车工程研究院有限公司 OTA communication method of heterogeneous central computing architecture

Similar Documents

Publication Publication Date Title
US8375094B2 (en) Creating a message readable by a plurality of heterogeneous recipients
US8769025B2 (en) Cluster server of an instant messaging system and messaging method between clusters
CN109756559B (en) Construction and use method for distributed data distribution service of embedded airborne system
US20080177872A1 (en) Managing aggregation and sending of communications
CN109327513B (en) Interaction method, interaction device and computer-readable storage medium
US20070067389A1 (en) Publish/subscribe messaging system
CN109819021B (en) Business background and method for asynchronously processing business request
CN113157449A (en) Real-time stream data analysis processing method based on MQTT
CN110753129A (en) Message transmission method, system, device, equipment and computer readable storage medium
CN116800787A (en) Vehicle-mounted communication method and system based on Ethernet communication protocol
CN110557321B (en) Information transmission method, network equipment and terminal
CN114866528A (en) Data communication method based on MQTT and Websocket
CN113965628A (en) Message scheduling method, server and storage medium
CN112256246A (en) Micro-service integration framework for supporting cross-language calling in power system
CN111464824A (en) Message sending method and system, server and storage medium
CN109547333A (en) Instant communicating method and device
CN115225706B (en) Data transmission method, device, vehicle and storage medium
CN116405547A (en) Message pushing method and device, processor, electronic equipment and storage medium
CN113973105B (en) System and method for simplifying SOAP message on service bus
CN112596933B (en) Micro-service system based on message event communication
CN115454667A (en) Concurrent remote calling system and method based on message queue
CN112769741B (en) Message communication method and electronic equipment
CN108881991B (en) Bullet screen message distribution method, device, equipment and storage medium
KR100868323B1 (en) Event Filtering System and Method Thereof
CN117201591A (en) Message tracking method and device based on MQTT protocol and related products

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination