CN117675884A - Data communication method, electronic device and storage medium - Google Patents

Data communication method, electronic device and storage medium Download PDF

Info

Publication number
CN117675884A
CN117675884A CN202311340237.XA CN202311340237A CN117675884A CN 117675884 A CN117675884 A CN 117675884A CN 202311340237 A CN202311340237 A CN 202311340237A CN 117675884 A CN117675884 A CN 117675884A
Authority
CN
China
Prior art keywords
data
link layer
vehicle
connector
data link
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
CN202311340237.XA
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 Launch Technology Co Ltd
Original Assignee
Shenzhen Launch 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 Launch Technology Co Ltd filed Critical Shenzhen Launch Technology Co Ltd
Priority to CN202311340237.XA priority Critical patent/CN117675884A/en
Publication of CN117675884A publication Critical patent/CN117675884A/en
Pending legal-status Critical Current

Links

Landscapes

  • Small-Scale Networks (AREA)

Abstract

The application provides a data communication method, electronic equipment and a storage medium, which are applied to a data communication system and comprise the following steps: the diagnostic device sends first data link layer data to the device connector; the device connector receives the first data link layer data, encapsulates the first data link layer data to obtain a first network data packet, and sends the first network data packet to the vehicle connector; the vehicle connector receives the first network data packet, analyzes the first network data packet to obtain first data link layer data, and sends the first data link layer data to the vehicle to be diagnosed. According to the device connector and the vehicle connector, only data of the data link layer is required to be processed, and only the physical layer exists below the data link layer, so that the device connector and the vehicle connector only need to solve the problem of data compatibility of the physical layer, namely the success rate of the device connector and the vehicle connector for transmitting the data of the data link layer is improved, and the success rate of remote data communication is further improved.

Description

Data communication method, electronic device and storage medium
Technical Field
The application belongs to the technical field of vehicle communication, and particularly relates to a data communication method, electronic equipment and a storage medium.
Background
With the continuous development of modern society, people's travel and traffic patterns are also deeply changed. Vehicles are no longer merely mechanical devices, and they have become intelligent, internet-connected mobile platforms. To accommodate this revolution, it has become critical to establish remote data communication with the vehicle.
Currently, the method of establishing remote data communication with vehicles is mainly based on application layer implementation in the open systems interconnection reference model (Open Systems Interconnection Reference Model, OSI). In the implementation of application-layer-based remote data communication, data needs to be cooperatively transmitted through an application layer, a presentation layer, a session layer, a transport layer, a network layer, a data link layer, and a physical layer. However, data incompatibilities in terms of data occur when the data is transmitted at any level, such as: the incompatibility of the MAC addresses may prevent the data from being correctly recognized and processed by the receiving hierarchy, resulting in interruption of the remote data communication and thus failure of the remote data communication. Since the application layer is the uppermost layer in the OSI model, the problem of data compatibility of other 6 layers is eliminated in the implementation of the remote data communication, so that the failure rate of the remote data communication is greatly increased.
Disclosure of Invention
The embodiment of the application provides a data communication method, electronic equipment and a storage medium, wherein a device connector obtains a first network data packet by packaging a first data link layer data sent by diagnostic equipment, so that a vehicle connector analyzes the first network data packet to obtain first data link layer data, and then sends the first data link layer data to a vehicle to be diagnosed, namely, the remote communication process between the diagnostic equipment and the vehicle to be diagnosed is realized based on the data link layer.
In a first aspect, an embodiment of the present application provides a data communication method, applied to a data communication system, where the data communication system includes a diagnostic device, a device connector, a vehicle connector, and a vehicle to be diagnosed, where the device connector establishes a physical layer connection of an open system interconnection reference model OSI model with the diagnostic device, the device connector establishes a remote communication connection with the vehicle connector, and the vehicle connector establishes a physical layer connection of the OSI model with the vehicle to be diagnosed, the method includes:
The diagnostic device sending first data link layer data to the device connector;
the device connector receives the first data link layer data, encapsulates the first data link layer data to obtain a first network data packet, and sends the first network data packet to the vehicle connector;
the vehicle connector receives the first network data packet, analyzes the first network data packet to obtain the first data link layer data, and sends the first data link layer data to the vehicle to be diagnosed.
By adopting the technical scheme, the device connector obtains the first network data packet by packaging the first data link layer data sent by the diagnostic device, so that the vehicle connector analyzes the first network data packet to obtain the first data link layer data and sends the first data link layer data to the vehicle to be diagnosed, namely, the device connector or the vehicle connector only needs to process the data link layer data in the remote communication process between the diagnostic device and the vehicle to be diagnosed based on the data link layer, and only needs to eliminate the data compatibility problem of the physical layer under the data link layer, so that the problem of high remote data communication failure rate can be solved.
In a possible implementation manner of the first aspect, after the step of sending the first data link layer data to the vehicle to be diagnosed, the method further includes:
the vehicle to be diagnosed receives the first data link layer data and sends second data link layer data to the vehicle connector;
the vehicle connector receives the second data link layer data, encapsulates the second data link layer data to obtain a second network data packet, and sends the second network data packet to the equipment connector;
and the device connector receives the second network data packet, analyzes the second network data packet to obtain the second data link layer data, and sends the second data link layer data to the diagnostic device.
In a second aspect, an embodiment of the present application provides a data communication method applied to a device connector, where the device connector establishes a physical layer connection of an OSI model with a diagnostic device, and the device connector establishes a remote communication connection with a vehicle connector, the method including:
receiving first data link layer data sent by the diagnostic equipment;
Encapsulating the first data link layer data to obtain a first network data packet;
and sending the first network data packet to the vehicle connector, wherein the vehicle connector is used for receiving the first network data packet, analyzing the first network data packet to obtain the first data link layer data, and sending the first data link layer data to a vehicle to be diagnosed.
According to the technical scheme, the equipment connector obtains the first network data packet by packaging the first data link layer data sent by the diagnosis equipment, the first network data packet is sent to the vehicle connector, so that the vehicle connector analyzes the first network data packet to obtain the first data link layer data and sends the first data link layer data to the vehicle to be diagnosed, the vehicle to be diagnosed responds to the first data link layer data to obtain the second data link layer data, namely, in the remote communication process between the diagnosis equipment and the vehicle to be diagnosed based on the data link layer, the equipment connector only needs to process the data link layer data, and only a physical layer is arranged below the data link layer, so that the equipment connector in the technical scheme only needs to eliminate the data compatibility problem of the physical layer.
In a possible implementation manner of the second aspect, the method further includes:
receiving a second network data packet sent by the vehicle connector, wherein the second network data packet is obtained by encapsulating a second data link layer data by the vehicle connector, and the second data link layer data is obtained by the vehicle to be diagnosed according to diagnosis request data;
analyzing the second network data packet to obtain the second data link layer data;
and sending the second data link layer data to the diagnosis equipment.
According to the technical scheme, the equipment connector receives the second network data packet sent by the vehicle connector in a remote communication mode, analyzes the second network data packet to obtain second data link layer data, and sends the second data link layer data to the diagnosis equipment.
In a possible implementation manner of the second aspect, the first data link layer data includes the diagnosis request data, and the second data link layer data includes diagnosis data, where the diagnosis request data is used to obtain the diagnosis data, and the diagnosis data is performance data of the vehicle to be diagnosed.
According to the technical scheme, the diagnosis equipment remotely sends diagnosis request data to the vehicle to be diagnosed through the equipment connector and the vehicle connector, after the vehicle to be diagnosed receives the diagnosis request data, the diagnosis data in the vehicle to be diagnosed can be obtained based on the diagnosis request data, namely, the diagnosis equipment remotely initiates a diagnosis request to the vehicle to be diagnosed, and then the vehicle to be diagnosed responds to the diagnosis request to obtain the diagnosis data, so that a remote fault diagnosis channel between the diagnosis equipment and the vehicle to be diagnosed is established, and the vehicle to be diagnosed can remotely feed back the diagnosis data of the vehicle to be diagnosed to the diagnosis equipment.
In a third aspect, an embodiment of the present application provides a data communication method applied to a vehicle connector, where the vehicle connector establishes a physical layer connection of an OSI model with a vehicle to be diagnosed, and the vehicle connector establishes a remote communication connection with a device connector, the method including:
Receiving second data link layer data sent by a vehicle to be diagnosed;
encapsulating the second data link layer data to obtain a second network data packet;
and sending the second network data packet to a device connector, wherein the device connector is configured to receive the second network data packet, parse the second network data packet to obtain the second data link layer data, and send the second data link layer data to a diagnostic device.
According to the technical scheme, the vehicle connector obtains the second network data packet by packaging the second data link layer data sent by the vehicle to be diagnosed, so that the equipment connector analyzes the second network data packet to obtain the second data link layer data, the second data link layer data is sent to the diagnosis equipment, the diagnosis equipment performs fault diagnosis analysis based on the second data link layer data, namely, in the remote communication process between the diagnosis equipment and the vehicle to be diagnosed based on the data link layer, the vehicle connector only needs to process the data link layer data, and only a physical layer is arranged below the data link layer, so that the vehicle connector in the technical scheme only needs to eliminate the data compatibility problem of the physical layer, and compared with the remote data communication scheme based on the application layer, the success rate of the vehicle connector for transmitting the data link layer data is improved, and the success rate of remote data communication is further improved.
In a possible implementation manner of the third aspect, the method further includes:
receiving a first network data packet, wherein the first network data packet is obtained by encapsulating first data link layer data by the device connector, and the first data link layer data is obtained by the diagnostic device;
analyzing the first network data packet to obtain first data link layer data;
and sending the first data link layer data to the vehicle to be diagnosed.
According to the technical scheme, the vehicle connector analyzes the first network data packet to obtain the first data link layer data, and sends the first data link layer data to the vehicle to be diagnosed, and the vehicle to be diagnosed can respond to the first data link layer data to obtain the diagnosis data in the vehicle to be diagnosed, so that the vehicle to be diagnosed can respond to the diagnosis equipment remotely.
In a possible implementation manner of the third aspect, the first data link layer data includes diagnostic request data, and the second data link layer data includes diagnostic data, wherein the diagnostic request data is used to obtain the diagnostic data, and the diagnostic data is performance data of the vehicle to be diagnosed itself.
By adopting the technical scheme, the vehicle to be diagnosed sends the diagnosis data to the diagnosis device through the vehicle connector and the device connector (the diagnosis data is the diagnosis data in the vehicle to be diagnosed, which is acquired based on the diagnosis request data after the vehicle to be diagnosed receives the diagnosis request data), and after the diagnosis device receives the diagnosis data, the diagnosis data is subjected to fault analysis processing to obtain a fault analysis result of the vehicle to be diagnosed, namely the diagnosis data is fed back to the diagnosis device remotely by the vehicle to be diagnosed, so that the remote fault diagnosis of the vehicle to be diagnosed by the diagnosis device is realized.
In a fourth aspect, embodiments of the present application provide an electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing steps of a data communication method as in any of the alternative implementations of the first aspect or steps of a data communication method as in any of the alternative implementations of the second aspect when the computer program is executed.
In a fifth aspect, embodiments of the present application provide a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the data communication method according to any one of the first aspects, or implements the steps of the data communication method according to any one of the second aspects.
In a sixth aspect, embodiments of the present application provide a computer program product, which when run on a terminal device, causes the terminal device to perform the data communication method according to any one of the first aspects or to perform the data communication method according to any one of the second aspects.
It will be appreciated that the advantages of the second to sixth aspects may be found in the relevant description of the first aspect, and are not described here again.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following description will briefly introduce the drawings that are needed in the embodiments or the description of the prior art, it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of a system architecture for implementing a data communication method according to an embodiment of the present application;
FIG. 2 is one of the interactive flowcharts of a data communication method provided in an embodiment of the present application;
FIG. 3 is a second interactive flow chart of a data communication method according to an embodiment of the present application;
Fig. 4 is a schematic flow chart of a data communication method according to an embodiment of the present application;
FIG. 5 is a second flow chart of a data communication method according to the embodiment of the present application;
FIG. 6 is a schematic flow chart of another data communication method according to an embodiment of the present application;
FIG. 7 is a second flow chart of another data communication method according to the embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
It is noted that the terminology used in the embodiments of the present application is used for the purpose of explaining specific embodiments of the present application only and is not intended to limit the present application. In the description of the embodiments of the present application, unless otherwise indicated, "a plurality" means two or more, and "at least one", "one or more" means one, two or more. The terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a definition of "a first", "a second" feature may explicitly or implicitly include one or more of such features.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
For better understanding of the embodiments of the present application, the open system interconnection reference model and the physical network card appearing in the embodiments of the present application are specifically explained herein in sequence.
1. Open systems interconnection reference model (Open Systems Interconnection Reference Model, OSI)
The OSI model divides the operation of network communications into 7 layers, from low to high: a physical layer, a data link layer, a network layer, a transport layer, a session layer, a presentation layer, and an application layer. In general, the OSI model divides the different functions of a computer network protocol into seven different levels, from a physical layer (first layer) to an application layer (seventh layer), each having different responsibilities and functions.
2. Physical network card
The physical network card (also referred to as a network adapter or network card) operates in the second layer of the OSI model, the data link layer. The data link layer is responsible for transferring data frames from one physical medium to another while handling error detection and correction of the data frames. The physical network card works by encapsulating data into frames and transmitting and receiving these frames on the physical layer.
Referring to fig. 1, fig. 1 is a schematic diagram of a system architecture for implementing a data communication method according to an embodiment of the present application.
The system architecture comprises a vehicle to be diagnosed, a vehicle connector, a device connector and a diagnosis device; the vehicle to be diagnosed is internally provided with a third physical network card, the vehicle connector is internally provided with a second physical network card, the equipment connector is internally provided with a first physical network card, and the diagnostic equipment is internally provided with a fourth physical network card; the vehicle to be diagnosed is connected with the vehicle connector through an interface of a vehicle-mounted automatic diagnosis system (OnBoardDiagnostics, OBD), and data interaction is carried out through a physical layer of an OSI model; the vehicle connector and the device connector interact data in a remote communication manner, for example: remote communication can be realized by using a preset server as a data transfer station; alternatively, the remote communication may be implemented by a peer-to-peer (P2P) technology; alternatively, the remote communication may be implemented through a cellular mobile network such as 2G, 3G, 4G, or 5G, and the specific manner in which the remote communication is implemented is not limited herein; the device connector and the diagnostic device are connected through an OBD interface, and data interaction is performed through a physical layer of the OSI model.
The vehicle to be diagnosed may include a vehicle for which there is a current need for diagnosis, and in the embodiment of the present application, the first data link layer data including the diagnosis request data sent by the vehicle connector is used to receive the vehicle, obtain the diagnosis data of the vehicle to be diagnosed based on the first data link layer data, and send the second data link layer data including the diagnosis data to the vehicle connector.
The vehicle connector may be a diagnostic communication device vehicle communication interface (Vehicle Communication Interface, VCI) or an on-board OBD connector capable of establishing a connection with an OBD interface of a vehicle and having both an ethernet communication function and an internet communication function, and in the embodiment of the present application, is configured to parse a first network data packet after receiving the first network data packet sent by the device connector to obtain first data link layer data containing diagnostic request data, send the first data link layer data containing diagnostic request data to the vehicle to be diagnosed, and further be configured to receive second data link layer data containing diagnostic data sent by the vehicle to be diagnosed, encapsulate the second data link layer data into a second network data packet, and send the second network data packet to the device connector by means of remote communication.
The device connector may be a diagnostic communication device VCI or a diagnostic device connector capable of being connected to a diagnostic device and having both an ethernet communication function and an internet communication function, and in the embodiment of the present application, is configured to receive first data link layer data including diagnostic request data sent by the diagnostic device, encapsulate the first data link layer data into a first network data packet, send the first network data packet to the vehicle connector through a remote communication manner, and further, after receiving a second network data packet sent by the vehicle connector, parse the second network data packet to obtain second data link layer data including diagnostic data, and send the second data link layer data including diagnostic data to the diagnostic device.
The diagnostic device may be a terminal device with vehicle diagnostic software installed and having a vehicle diagnostic function, where the terminal device includes, but is not limited to, a mobile terminal, a personal computer, a personal digital assistant (PersonalDigitalAssistant, PDA), and the like, and is used in the embodiment of the present application to send first data link layer data containing diagnostic request data to a device connector, and analyze and process diagnostic data of a vehicle to be diagnosed returned by the device connector to obtain a diagnostic result of the vehicle to be diagnosed.
Existing remote data communication schemes are implemented based on the application layer in the OSI model, and thus the process of data transmission involves multiple levels including an application layer, a presentation layer, a session layer, a transport layer, a network layer, a data link layer, and a physical layer. However, data is incompatible if transmitted at any level, such as: the incompatibility of the MAC addresses may prevent the data from being correctly recognized and processed by the receiving hierarchy, resulting in interruption of the remote data communication and thus failure of the remote data communication. Since the application layer is at layer 7 in the OSI model, the data compatibility problem of other layers 6 is eliminated in the implementation of the vehicle remote fault diagnosis scheme, resulting in a higher failure rate of the vehicle remote fault diagnosis.
Based on the above-mentioned problems, an embodiment of the present application provides a data communication method, which is applied to a data communication system, where the data communication system includes a diagnostic device, a device connector, a vehicle connector and a vehicle to be diagnosed, where the device connector and the diagnostic device establish a physical layer connection of an open system interconnection reference model OSI model, the device connector and the vehicle connector establish a remote communication connection, and the vehicle connector and the vehicle to be diagnosed establish a physical layer connection of the OSI model, and the specific implementation process is as follows: the diagnostic device sends first data link layer data to the device connector; the device connector receives the first data link layer data, encapsulates the first data link layer data to obtain a first network data packet, and sends the first network data packet to the vehicle connector; the vehicle connector receives the first network data packet, analyzes the first network data packet to obtain first data link layer data, and sends the first data link layer data to the vehicle to be diagnosed, so that the vehicle to be diagnosed obtains second data link layer data according to the first data link layer data, namely, in the remote communication process between the diagnosis device and the vehicle to be diagnosed based on the data link layer, the device connector or the vehicle connector only needs to process the data link layer data, and only needs to process the physical layer below the data link layer, so that the device connector or the vehicle connector in the technical scheme only needs to eliminate the data compatibility problem of the physical layer, compared with the remote data communication scheme based on the application layer, the success rate of the device connector for transmitting the data link layer data is improved, and the success rate of remote data communication is further improved.
Referring to fig. 2 with reference to the system architecture shown in fig. 1, fig. 2 is an interaction flow chart of a data communication method provided in an embodiment of the present application, applied to a data communication system, where the data communication system includes a diagnostic device, a device connector, a vehicle connector and a vehicle to be diagnosed, the device connector and the diagnostic device establish a physical layer connection of an OSI model of an open system interconnection reference model, the device connector and the vehicle connector establish a remote communication connection, and the vehicle connector and the vehicle to be diagnosed establish a physical layer connection of the OSI model, the data communication method includes the following steps:
in step 201, the diagnostic device transmits first data link layer data to the device connector.
In step 202, the device connector receives the first data link layer data, encapsulates the first data link layer data, and obtains a first network data packet.
In step 203, the device connector transmits the first network data packet to the vehicle connector.
In step 204, the vehicle connector receives the first network data packet, and parses the first network data packet to obtain first data link layer data.
The vehicle connector transmits the first data link layer data to the vehicle to be diagnosed, step 205.
It should be noted that, in the embodiment of the present application, the first data link layer data may include the following data: functionally, diagnostic request data, IP assignment data, and other Ethernet communication data may be included; from the perspective of the protocol, a complete packet such as UDP, TCP, doIP, ARP, DHCP may be included.
The physical layer connection based on the OSI model between the diagnostic device and the device connector, the remote communication connection between the device connector and the vehicle diagnostic device, and the physical layer connection based on the OSI model between the vehicle to be diagnosed and the vehicle connector are established in advance. The diagnostic device may send the first data link layer data to the device connector through the physical layer, the device connector encapsulates the first data link layer data after receiving the first data link layer data to obtain a first network data packet, and sends the first network data packet to the vehicle connector through a remote communication manner, and the vehicle connector parses the first network data packet after receiving the first network data packet to obtain the first data link layer data, and sends the first data link layer data to the vehicle to be diagnosed through the physical layer.
According to the method, the device connector obtains the first network data packet by packaging the first data link layer data sent by the diagnostic device, the vehicle connector analyzes the first network data packet to obtain the first data link layer data, and then the first data link layer data is sent to the vehicle to be diagnosed, namely, in the remote communication process between the diagnostic device and the vehicle to be diagnosed based on the data link layer, as the device connector or the vehicle connector only needs to process the data link layer data and only needs to process the physical layer under the data link layer, the device connector or the vehicle connector in the technical scheme only needs to eliminate the data compatibility problem of the physical layer, and the problem of high remote data communication failure rate can be solved.
Further, in the embodiment of the present application, based on the system architecture shown in fig. 1, as shown in fig. 3, the data communication method further includes the following steps:
in step 301, a vehicle to be diagnosed receives first data link layer data and transmits second data link layer data to a vehicle connector.
In step 302, the vehicle connector receives the second data link layer data, encapsulates the second data link layer data, and obtains a second network data packet.
In step 303, the vehicle connector transmits the second network data packet to the device connector.
In step 304, the device connector receives the second network data packet, and parses the second network data packet to obtain second data link layer data.
The device connector sends the second data link layer data to the diagnostic device, step 305.
It should be noted that, in the embodiment of the present application, the second data link layer data may include the following data: functionally, diagnostic data, IP assignment data, and other ethernet communication data may be included; from the perspective of the protocol, a complete packet such as UDP, TCP, doIP, ARP, DHCP may be included.
The vehicle to be diagnosed can acquire second data link layer data under the indication of the first data link layer data after receiving the first data link layer data, and send the second data link layer data to the vehicle connector through the physical layer, the vehicle connector encapsulates the second data link layer data after receiving the second data link layer data to obtain a second network data packet, and sends the second network data packet to the device connector in a remote communication mode, and the device connector analyzes the second network data packet after receiving the second network data packet to obtain the second data link layer data and sends the second data link layer data to the diagnosis device through the physical layer.
Referring to fig. 4, fig. 4 is a flow chart of a data communication method according to an embodiment of the present application, applied to a device connector, wherein the device connector establishes a physical layer connection of an OSI model with a diagnostic device, and the device connector establishes a remote communication connection with a vehicle connector, and the data communication method includes the following steps:
step 401, receiving first data link layer data sent by a diagnostic device.
It should be noted that, in the embodiment of the present application, the first data link layer data may include the following data: functionally, diagnostic request data, IP assignment data, and other Ethernet communication data may be included; from the perspective of the protocol, a complete packet such as UDP, TCP, doIP, ARP, DHCP may be included.
The first physical network card is positioned inside the device connector, and the fourth physical network card is positioned inside the diagnostic device. The connection between the device connector and the diagnostic device is required to be established in advance through a vehicle diagnostic system interface; connecting the device connector to a network, for example: connecting the device connector to the internet for establishing a remote communication between the device connector and the vehicle connector, thereby enabling remote data transmission between the device connector and the vehicle connector; because the physical layer connection of the OSI model between the device connector and the diagnostic device is established in advance, the physical layer connection is also established between the first physical network card and the fourth physical network card, so that the first physical network card in the device connector and the fourth physical network card in the diagnostic device can perform data transmission and communication on the physical layer.
In a case where the device connector has established a physical layer connection of the OSI model with the diagnostic device, the device connector has been connected to the network, and the first physical network card and the fourth physical network card have established a physical layer connection, remote data communication of the vehicle to be diagnosed is initiated by the diagnostic device, specifically, the fourth physical network card in the diagnostic device may transmit data of the data link layer, i.e. the first data link layer data, to the first physical network card in the device connector through the physical layer.
The device connector receives the first data link layer data sent by the diagnostic device, and specifically, the device connector receives the first data link layer data sent by the fourth physical network card in the diagnostic device through the first physical network card.
Step 402, encapsulating the first data link layer data to obtain a first network data packet.
It should be noted that, in the embodiment of the present application, after receiving the first data link layer data, the device connector may further perform data encapsulation on the first data link layer data to encapsulate the first data link layer data into the first network data packet. The specific implementation process of the device connector for encapsulating the first data link layer data to obtain the first network data packet is as follows: and respectively adding a header in front of the first data link layer data, adding a tail at the tail of the first data link layer data, and packaging the added header, the first data link layer data and the added tail together to obtain a first network data packet, wherein the header and the tail are represented by 8-bit binary numbers. For example: the first data link layer data are 1, 2, 3 and 4, 01010101 is added in front of the data 1, 10101010 is added behind the data 4, and the data of the 01010101, 1, 2, 3, 4 and 10101010 group are packaged to obtain the first network data packet. The process of data encapsulation is not particularly limited in this application.
Step 403, the first network data packet is sent to a vehicle connector, where the vehicle connector is configured to receive the first network data packet, parse the first network data packet to obtain first data link layer data, and send the first data link layer data to a vehicle to be diagnosed.
It should be noted that, in the embodiment of the present application, the second physical network card is located inside the vehicle connector, and the third physical network card is located inside the vehicle to be diagnosed.
After the device connector encapsulates the first data link layer data into the first network data packet, the first network data packet may be sent to a vehicle connector connected to the vehicle to be diagnosed by a remote communication manner, and specifically, the first network data packet may be sent to a second physical network card in the vehicle connector through a first physical network card in the device connector.
The vehicle connector receives the first network data packet sent by the device connector in a remote communication manner, and under the condition that the first network data packet is received, the first network data packet can be parsed to obtain first data link layer data, the first data link layer data is sent to a vehicle to be diagnosed connected with the vehicle connector, and specifically, the first data link layer data can be sent to a third physical network card in the vehicle to be diagnosed through a second physical network card in the vehicle connector.
The vehicle to be diagnosed receives the first data link layer data sent by the vehicle connector, and under the condition of receiving the first data link layer data, the corresponding second data link layer data of the vehicle to be diagnosed can be obtained under the indication of the first data link layer data; the diagnostic equipment completes one round of data interaction with the vehicle to be diagnosed. It should be noted that in the embodiments of the present application, each round of data interaction needs to be initiated by the diagnostic device side.
According to the method, the device connector obtains the first network data packet by packaging the first data link layer data sent by the diagnosis device, the first network data packet is sent to the vehicle connector, so that the vehicle connector analyzes the first network data packet to obtain the first data link layer data, then the first data link layer data is sent to the vehicle to be diagnosed, the vehicle to be diagnosed responds to the first data link layer data to further obtain the second data link layer data, namely, in the remote communication process between the diagnosis device and the vehicle to be diagnosed based on the data link layer, the device connector only needs to process the data link layer data, and only a physical layer is arranged below the data link layer, and therefore the device connector in the technical scheme only needs to solve the problem of data compatibility of the physical layer.
Further, in an embodiment of the present application, as shown in fig. 5, the method may further include the following steps:
step 501, a second network data packet sent by the vehicle connector is received, where the second network data packet is obtained by encapsulating, by the vehicle connector, second data link layer data, and the second data link layer data is obtained by the vehicle to be diagnosed according to the diagnosis request data.
And step 502, analyzing the second network data packet to obtain second data link layer data.
Step 503, sending the second data link layer data to the diagnostic device.
It should be noted that, in the embodiment of the present application, the second data link layer data may include the following data: functionally, diagnostic data, IP assignment data, and other ethernet communication data may be included; from the perspective of the protocol, a complete packet such as UDP, TCP, doIP, ARP, DHCP may be included.
After receiving the second data link layer data sent by the vehicle to be diagnosed, the vehicle connector may further perform data encapsulation on the second data link layer data to encapsulate the second data link layer data into a second network data packet, and further send the second network data packet to the device connector through a remote communication manner, where the second data link layer data is acquired by the vehicle to be diagnosed according to the first data link layer data.
After the device connector receives the second network data packet sent by the vehicle connector through the remote communication manner, the second network data packet may be parsed to obtain second data link layer data, and the second data link layer data may be sent to the diagnostic device connected to the device connector, and specifically, the second data link layer data may be sent to a fourth physical network card in the diagnostic device through the first physical network card in the device connector.
After receiving the second data link layer data sent by the device connector, the diagnostic device can analyze and diagnose the vehicle to be diagnosed based on the second data link layer data, and obtain a diagnosis result.
Optionally, the first data link layer data includes diagnostic request data, and the second data link layer data includes diagnostic data, wherein the diagnostic request data is used to obtain diagnostic data, and the diagnostic data is performance data of the vehicle to be diagnosed.
It should be noted that, in this embodiment of the present application, the diagnostic device remotely sends the diagnostic request data to the vehicle to be diagnosed through the device connector and the vehicle connector, after the vehicle to be diagnosed receives the diagnostic request data, the diagnostic data in the vehicle to be diagnosed may be obtained based on the diagnostic request data, that is, the diagnostic device remotely initiates the diagnostic request to the vehicle to be diagnosed, and then the vehicle to be diagnosed responds to the diagnostic request to obtain the diagnostic data, so as to establish a remote fault diagnosis channel between the diagnostic device and the vehicle to be diagnosed, and further enable the vehicle to be diagnosed to remotely feed back the diagnostic data of the vehicle to be diagnosed to the diagnostic device. Wherein the diagnostic data is performance data of the vehicle itself to be diagnosed, including but not limited to data of various electronic devices, sensors and control units inside the vehicle to be diagnosed.
Referring to fig. 6, referring to the system architecture shown in fig. 1, fig. 6 is a flow chart of another data communication method provided in an embodiment of the present application, applied to a vehicle connector, where the vehicle connector establishes a physical layer connection of an OSI model with a vehicle to be diagnosed, and the vehicle connector establishes a remote communication connection with a device connector, the data communication method includes the following steps:
step 601, receiving second data link layer data sent by a vehicle to be diagnosed.
It should be noted that, in the embodiment of the present application, the second data link layer data may include the following data: functionally, diagnostic data, IP assignment data, and other ethernet communication data may be included; from the perspective of the protocol, a complete packet such as UDP, TCP, doIP, ARP, DHCP may be included.
The second physical network card is positioned in the vehicle connector, and the third physical network card is positioned in the vehicle to be diagnosed. The connection between the vehicle connector and the vehicle to be diagnosed is required to be established in advance through a vehicle diagnosis system interface; connecting the vehicle connector to a network, for example: connecting the vehicle connector to the internet for establishing a remote communication between the device connector and the vehicle connector, thereby enabling a remote data transmission between the device connector and the vehicle connector; because the physical layer connection of the OSI model between the vehicle connector and the vehicle to be diagnosed is established in advance, the physical layer connection is also established between the second physical network card and the third physical network card, so that the physical network card in the vehicle connector and the physical network card in the vehicle to be diagnosed can perform data transmission and communication on the physical layer.
In the case where the vehicle connector is connected to the physical layer of the OSI model established by the vehicle to be diagnosed, the vehicle connector is connected to the network, and the physical layer connection is established by the second physical network card and the third physical network card, the vehicle to be diagnosed responds to remote data communication initiated by the diagnostic device to the vehicle to be diagnosed, specifically, the third physical network card in the vehicle to be diagnosed may send data of the data link layer, that is, the second data link layer data, to the second physical network card in the vehicle connector through the physical layer.
The vehicle connector receives second data link layer data sent by the vehicle to be diagnosed, specifically, the vehicle connector receives the second data link layer data sent by a second physical network card in the vehicle to be diagnosed through the second physical network card.
And step 602, encapsulating the second data link layer data to obtain a second network data packet.
It should be noted that, in the embodiment of the present application, after receiving the second data link layer data, the vehicle connector may further perform data encapsulation on the second data link layer data to encapsulate the second data link layer data into the second network data packet. The specific implementation process of the vehicle connector for encapsulating the second data link layer data to obtain the second network data packet is as follows: and adding a header to the front of the second data link layer data, adding a tail to the tail of the second data link layer data, and packaging the added header, the second data link layer data and the added tail together to obtain a second network data packet, wherein the header and the tail are represented by 8-bit binary numbers. For example: the second data link layer data are 5, 6, 7 and 8, 10110110 is added before the data 5, 11011011 is added after the data 8, and the second network data packet can be obtained by packaging the data of 10110110, 5, 6, 7, 8 and 11011011. The process of data encapsulation is not particularly limited in this application.
And step 603, sending the second network data packet to a device connector, where the device connector is configured to receive the second network data packet, parse the second network data packet to obtain second data link layer data, and send the second data link layer data to the diagnostic device.
It should be noted that, in the embodiment of the present application, the second physical network card is located inside the vehicle connector, and the third physical network card is located inside the vehicle to be diagnosed. The vehicle connector and the device connector interact data in a remote communication mode.
After the vehicle connector encapsulates the second data link layer data into the second network data packet, the second network data packet may be sent to the device connector connected to the diagnostic device by a remote communication manner, and specifically, the second network data packet may be sent to the first physical network card in the device connector through the second physical network card in the vehicle connector.
The device connector receives the second network data packet sent by the vehicle connector in a remote communication manner, and under the condition that the second network data packet is received, the second network data packet can be parsed to obtain second data link layer data, and the second data link layer data is sent to the diagnostic device connected with the device connector, specifically, the second data link layer data can be sent to a fourth physical network card in the diagnostic device through the first physical network card in the device connector.
The diagnosis device receives the second data link layer data sent by the device connector, and under the condition that the second data link layer data is received, the diagnosis device can analyze and process the second data link layer data to obtain a data processing result. So far, the vehicle to be diagnosed and the diagnosis equipment complete one round of data interaction. It should be noted that in the embodiments of the present application, each round of data interaction needs to be initiated by the side of the vehicle to be diagnosed.
According to the vehicle connector, the second network data packet is obtained by packaging the second data link layer data sent by the vehicle to be diagnosed, so that the device connector analyzes the second network data packet to obtain the second data link layer data, the second data link layer data is sent to the diagnosis device, the diagnosis device performs fault diagnosis analysis based on the second data link layer data, namely, in the remote communication process between the diagnosis device and the vehicle to be diagnosed based on the data link layer, the vehicle connector only needs to process the data link layer data, and only a physical layer is arranged below the data link layer, therefore, the vehicle connector in the technical scheme only needs to eliminate the data compatibility problem of the physical layer, compared with the remote data communication scheme based on the application layer, the success rate of the vehicle connector for transmitting the data link layer data is improved, and the success rate of remote data communication is further improved.
Further, in an embodiment of the present application, as shown in fig. 7, the method may further include the following steps:
in step 701, a first network data packet is received, where the first network data packet is obtained by encapsulating, by a device connector, first data link layer data, and the first data link layer data is obtained by a diagnostic device.
Step 702, parsing the first network data packet to obtain first data link layer data.
Step 703, transmitting the first data link layer data to the vehicle to be diagnosed.
It should be noted that, in the embodiment of the present application, the first data link layer data may include the following data: functionally, diagnostic request data, IP assignment data, and other Ethernet communication data may be included; from the perspective of the protocol, a complete packet such as UDP, TCP, doIP, ARP, DHCP may be included.
When the vehicle connector receives a first network data packet sent by the equipment connector in a remote communication mode, the first network data packet can be analyzed to obtain first data link layer data, and then a second physical network card in the vehicle connector can send the first data link layer data to a third physical network card in a vehicle to be diagnosed through the physical layer; the first network data packet is obtained by encapsulating first data link layer data of the first physical network card by the device connector, wherein the first data link layer data is obtained by the diagnostic device.
According to the vehicle connector, the first network data packet is analyzed to obtain the first data link layer data, the first data link layer data is sent to the vehicle to be diagnosed, and the vehicle to be diagnosed can respond to the first data link layer data to obtain the diagnosis data in the vehicle to be diagnosed, so that the technical effect that the vehicle to be diagnosed can remotely respond to the diagnosis equipment is achieved.
Optionally, the first data link layer data includes diagnostic request data, and the second data link layer data includes the diagnostic data, wherein the diagnostic request data is used for acquiring diagnostic data, and the diagnostic data is performance data of the vehicle to be diagnosed.
It should be noted that, in the embodiment of the present application, the vehicle to be diagnosed sends diagnostic data to the diagnostic device through the vehicle connector and the device connector, and after the diagnostic device receives the diagnostic data, the diagnostic data sent by the vehicle to be diagnosed may be analyzed and diagnosed according to a fault code library and a diagnostic algorithm preset in the diagnostic device, and a diagnostic result may be obtained; wherein the diagnostic results include, but are not limited to, fault codes, fault descriptions, and suggested maintenance protocols; the diagnosis result can be output through the display screen, so that technicians can be timely and intuitively informed of possible problems of the vehicle to be diagnosed; alternatively, the diagnosis result may be output to a mobile client associated with the vehicle to be diagnosed, and the output manner of the diagnosis result is not particularly limited herein.
The embodiment of the present application further provides an electronic device, as shown in fig. 8, including a processor 801, a communication interface 802, a memory 803, and a communication bus 804, where the processor 801, the communication interface 802, and the memory 803 complete communication with each other through the communication bus 804,
a memory 803 for storing a computer program;
the processor 801 is configured to implement the steps in the data communication method according to any one of the above embodiments when executing the program stored in the memory 803.
The communication bus mentioned by the above terminal may be a peripheral component interconnect standard (Peripheral Component Interconnect, abbreviated as PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated as EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the terminal and other devices.
The memory may include random access memory (Random Access Memory, RAM) or non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a Network Processor (NP), etc.; but also digital signal processors (Digital Signal Processing, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In yet another embodiment provided herein, a computer readable storage medium having instructions stored therein that when run on a computer cause the computer to perform the data communication method of any of the above embodiments is also provided.
In yet another embodiment provided herein, there is also provided a computer program product containing instructions that, when run on a computer, cause the computer to perform the data communication method of any of the above embodiments.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the scope of the present application. Any modifications, equivalent substitutions, improvements, etc. that are within the spirit and principles of the present application are intended to be included within the scope of the present application.

Claims (10)

1. A data communication method, characterized by being applied to a data communication system including a diagnostic device, a device connector, a vehicle connector, and a vehicle to be diagnosed, wherein the device connector establishes a physical layer connection of an open system interconnection reference model OSI model with the diagnostic device, the device connector establishes a remote communication connection with the vehicle connector, and the vehicle connector establishes a physical layer connection of the OSI model with the vehicle to be diagnosed, the method comprising:
the diagnostic device sending first data link layer data to the device connector;
the device connector receives the first data link layer data, encapsulates the first data link layer data to obtain a first network data packet, and sends the first network data packet to the vehicle connector;
the vehicle connector receives the first network data packet, analyzes the first network data packet to obtain the first data link layer data, and sends the first data link layer data to the vehicle to be diagnosed.
2. The method of claim 1, wherein after the step of transmitting the first data link layer data to the vehicle to be diagnosed, the method further comprises:
the vehicle to be diagnosed receives the first data link layer data and sends second data link layer data to the vehicle connector;
the vehicle connector receives the second data link layer data, encapsulates the second data link layer data to obtain a second network data packet, and sends the second network data packet to the equipment connector;
and the device connector receives the second network data packet, analyzes the second network data packet to obtain the second data link layer data, and sends the second data link layer data to the diagnostic device.
3. A data communication method applied to a device connector that establishes a physical layer connection of an OSI model with a diagnostic device, the device connector establishing a remote communication connection with a vehicle connector, the method comprising:
receiving first data link layer data sent by the diagnostic equipment;
encapsulating the first data link layer data to obtain a first network data packet;
And sending the first network data packet to the vehicle connector, wherein the vehicle connector is used for receiving the first network data packet, analyzing the first network data packet to obtain the first data link layer data, and sending the first data link layer data to a vehicle to be diagnosed.
4. A method according to claim 3, characterized in that the method further comprises:
receiving a second network data packet sent by the vehicle connector, wherein the second network data packet is obtained by encapsulating a second data link layer data by the vehicle connector, and the second data link layer data is obtained by the vehicle to be diagnosed according to diagnosis request data;
analyzing the second network data packet to obtain the second data link layer data;
and sending the second data link layer data to the diagnosis equipment.
5. The method of claim 4, wherein the first data link layer data comprises the diagnostic request data and the second data link layer data comprises diagnostic data, wherein the diagnostic request data is used to obtain the diagnostic data, the diagnostic data being performance data of the vehicle itself to be diagnosed.
6. A data communication method applied to a vehicle connector that establishes a physical layer connection of an OSI model with a vehicle to be diagnosed, the vehicle connector establishing a remote communication connection with a device connector, the method comprising:
receiving second data link layer data sent by a vehicle to be diagnosed;
encapsulating the second data link layer data to obtain a second network data packet;
and sending the second network data packet to a device connector, wherein the device connector is configured to receive the second network data packet, parse the second network data packet to obtain the second data link layer data, and send the second data link layer data to a diagnostic device.
7. The method of claim 6, wherein the method further comprises:
receiving a first network data packet, wherein the first network data packet is obtained by encapsulating first data link layer data by the device connector, and the first data link layer data is obtained by the diagnostic device;
analyzing the first network data packet to obtain first data link layer data;
And sending the first data link layer data to the vehicle to be diagnosed.
8. The method of claim 7, wherein the first data link layer data comprises diagnostic request data and the second data link layer data comprises diagnostic data, wherein the diagnostic request data is used to obtain the diagnostic data, the diagnostic data being performance data of the vehicle itself to be diagnosed.
9. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor, when executing the computer program, implements the method of data communication according to any of claims 3-5 or the method of data communication according to any of claims 6-8.
10. A computer storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the method of data communication according to any one of claims 3-5 or the method of data communication according to any one of claims 6-8.
CN202311340237.XA 2023-10-17 2023-10-17 Data communication method, electronic device and storage medium Pending CN117675884A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311340237.XA CN117675884A (en) 2023-10-17 2023-10-17 Data communication method, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311340237.XA CN117675884A (en) 2023-10-17 2023-10-17 Data communication method, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN117675884A true CN117675884A (en) 2024-03-08

Family

ID=90065143

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311340237.XA Pending CN117675884A (en) 2023-10-17 2023-10-17 Data communication method, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN117675884A (en)

Similar Documents

Publication Publication Date Title
CN109491357B (en) Apparatus for performing diagnostic operations on a plurality of controllers and related method and vehicle
US10756930B2 (en) Gateway device, vehicle network system, transfer method, and non-transitory computer-readable recording medium storing program
CN110083088B (en) Signal control conversion device and signal control conversion method
CN111835627B (en) Communication method of vehicle-mounted gateway, vehicle-mounted gateway and intelligent vehicle
CN112291124B (en) Vehicle-mounted network ECU communication method based on SOME/IP protocol
CN108848025B (en) Data processing method, intelligent gateway and Internet of things system
CN111427335A (en) Vehicle remote diagnosis method, equipment connector and vehicle connector
US20180103108A1 (en) Method of transmitting and receiving data in vehicle network and apparatus for the same
CN110768882B (en) Data monitoring method and system, monitoring equipment and vehicle
CN106330483B (en) Information acquisition method, client device and server device
US20200382597A1 (en) Vehicle diagnostic communication apparatus, system including the same and method thereof
CN111552266B (en) Vehicle remote diagnosis method, system, equipment connector and vehicle connector
CN114253251A (en) Vehicle remote diagnosis method and device, equipment connector and storage medium
CN111552268B (en) Vehicle remote diagnosis method, equipment connector and vehicle connector
CN117376339A (en) OTA-based vehicle ECU upgrading method, device, equipment and medium
CN107181783B (en) Method and device for transmitting data in a vehicle using Ethernet
CN117675884A (en) Data communication method, electronic device and storage medium
CN115442177B (en) Data communication method and device of CAN (controller area network)
CN114503518B (en) Detection device, vehicle, detection method, and detection program
CN113341933B (en) Diagnostic system and method for vehicle central controller
CN115396529A (en) Multichannel communication method, device, terminal equipment and storage medium
US11985217B2 (en) Network interface apparatus
CN116996592B (en) Network card, data transmission processing method and data receiving processing method
CN116074286A (en) Ethernet data transmission method, transmission gateway and transmission system
KR20230117898A (en) Vehicle heterogeneous communication system and communication method therefor

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