Virtual serial communication method and system based on CAN bus
By configuring the virtual CAN adaptation layer on the sender and receiver, splitting and grouping application layer data packets, the compatibility problem between the CAN bus and the traditional serial communication interface is solved, and seamless docking and freedom of application layer data is achieved. Transmission reduces development difficulty and improves efficiency, and supports networking and broadcasting communication.
Patent Information
- Application Number
- CN202411076783.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-08-07
AI Technical Summary
In the existing serial communication technology, the CAN bus is incompatible with the traditional serial communication interface and requires the formulation of the application layer communication protocol separately. Due to the limited single packet data length of the CAN basic protocol, it leads to high development difficulty and low efficiency.
By configuring the virtual CAN adaptation layer on the sender and receiver, splitting and grouping application layer data packets to adapt to the transmission requirements of the CAN protocol layer, seamless docking and free transmission of application layer data is achieved, and development difficulty is reduced and improve efficiency.
Avoid the need to formulate application layer protocols separately, realize seamless connection with traditional serial communication protocols, reduce development difficulty and improve development efficiency, and effectively utilize the characteristics of the CAN bus to support networking, multicast and broadcast communications. , improves network flexibility and communication efficiency.
Smart Images

Figure CN118612012B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of digital information transmission, electric digital data processing, etc., and in particular to a virtual serial communication method and system based on a CAN bus. Background Art
[0002] Traditional serial communication interfaces, such as UART, RS232, RS485, RS422, etc., work at the physical layer of the OSI reference model and only support single-point communication. In serial communication technology, there is also CAN (Controller Area Network) bus communication technology. CAN bus is a communication protocol bus for real-time applications. It works at the physical layer and data link layer of the OSI reference model. It uses twisted pair to transmit signals and is one of the most widely used field buses in the world. Compared with traditional serial communication interfaces, CAN bus has higher transmission rate, longer transmission distance and better anti-interference ability, and can also support multi-node networking. However, the CAN bus protocol works at the physical layer (PHY) and data link layer (MAC) of the OSI seven-layer model. It is limited by the standard CAN bus protocol (for example, CAN 1.0 A / B and CAN2.0 A / B) data segment maximum 8 bytes requirement. Many products directly develop a set of application layer communication protocols based on the CAN bus protocol, which is inconvenient to develop and maintain. It should be noted that there are multiple versions of the standard CAN protocol. CAN 1.0A and CAN 2.0B are the first generation CAN protocols, with a data transmission rate of only 1 Mbps at most, and a maximum data length of 8 bytes for each data frame. The data frame is divided into an 11-bit identifier and four additional control bits. CAN 2.0A and CAN 2.0B are the second generation CAN protocols, with a data transmission rate of up to 1 Mbps and a maximum data length of 8 bytes for each data frame. The main difference between them lies in the length and structure of the identifier of the data frame, where CAN 2.0A uses an 11-bit identifier and CAN 2.0B uses a 29-bit identifier. CAN FD (Flexible Data-Rate) protocol is a high-speed CAN protocol proposed in 2012, supporting data transmission rates up to 5 Mbps and a data length of 64 bytes. It uses an identifier structure similar to CAN 2.0B and introduces some new features, such as bit time modulation and improved anti-interference performance. The hardware implementation cost of the CAN FD protocol is relatively high, and its application scenarios are not as extensive as CAN1.0 and CAN 2.0. In addition, when supporting a serial communication interface, due to product requirements (such as the need for better speed, communication distance, and anti-interference capability), the serial communication interface is changed to a CAN bus interface or a CAN bus interface is directly added. It is necessary to develop a separate application layer communication protocol based on the CAN bus protocol. The newly added application layer communication protocol has nothing to do with the original serial bus protocol. When the two protocols support the same functions, two sets of protocols need to be developed and maintained, which increases the workload and reduces development efficiency.
[0003] In summary, the existing serial communication technology has the problems that the CAN bus is incompatible with the traditional serial communication interface, and a separate application layer communication protocol needs to be formulated. The application layer is limited by the single packet data length of the CAN basic protocol, and the communication development is difficult and the development efficiency is low. Summary of the invention
[0004] In view of the deficiencies in the above-mentioned prior art, the present invention provides a virtual serial communication method and system based on the CAN bus, so as to avoid the need to separately formulate a set of application layer communication protocols, so that the application layer can get rid of the limitation of the single packet data length of the CAN basic protocol, freely transmit application layer data, and achieve seamless connection with the traditional serial communication application layer protocol, thereby reducing the development difficulty and improving the development efficiency.
[0005] In a first aspect, the present invention provides a virtual serial communication method based on a CAN bus, comprising the following steps:
[0006] A virtual sender CAN adaptation layer is configured on the data sender, and a virtual receiver CAN adaptation layer is configured on the data receiver;
[0007] When the sender of the data sends data to the receiver of the data through the sender application layer, the sender CAN adaptation layer splits the application layer data packet sent by the sender application layer to obtain several sub-data packets and sends them to the CAN protocol layer, and the CAN protocol layer transmits the several sub-data packets to the receiver CAN adaptation layer;
[0008] When the receiving CAN adaptation layer receives the plurality of sub-data packets, the receiving CAN adaptation layer assembles the received plurality of sub-data packets to obtain a complete data packet and then reports it to the receiving application layer of the receiving party of the data.
[0009] Further, the receiving CAN adaptation layer groups the received several sub-data packets, including: the receiving CAN adaptation layer performs integrity judgment on the several sub-data packets, and when it is determined that the several sub-data packets are complete, groups the received several sub-data packets to obtain the complete data packet.
[0010] Furthermore, the receiving CAN adaptation layer verifies the complete data packet, and reports the verified complete data packet to the receiving application layer of the data receiver.
[0011] Furthermore, the sender CAN adaptation layer and the receiver CAN adaptation layer perform multi-channel session concurrent management on the transmission of multi-channel data.
[0012] Furthermore, each of the sub-data packets has control information and data content.
[0013] Further, the application layer data packet directly multiplexes the traditional serial interface application layer data packet, and the traditional serial interface includes a UART serial interface, an RS232 serial interface, an RS485 serial interface or an RS422 serial interface. Wherein, the traditional serial interface is not limited to serial interfaces such as a UART serial interface, an RS232 serial interface, an RS485 serial interface, and an RS422 serial interface.
[0014] Furthermore, the sender CAN adaptation layer and the receiver CAN adaptation layer use the same CAN adaptation layer protocol frame structure.
[0015] Furthermore, the CAN adaptation layer protocol frame structure includes a message identifier CAN ID on the CAN bus and a packet data bearer Data in the CAN frame.
[0016] Furthermore, the message identifier CAN ID on the CAN bus includes a sender device address SrcAddr, a receiver device address DstAddr, a frame type identifier PacketType, a session ID identifier SessionID between devices, and a specific packet information carrier PacketInfo.
[0017] In a second aspect, the present invention provides a virtual serial communication system based on a CAN bus, comprising: a sender application layer for connecting communication, a sender CAN adaptation layer, a receiver CAN adaptation layer, a CAN protocol layer and a receiver application layer; the virtual serial communication system based on the CAN bus runs any of the above-mentioned virtual serial communication methods based on the CAN bus.
[0018] Compared with the prior art, the present invention has the following beneficial effects:
[0019] The present invention provides a virtual serial communication method and system based on CAN bus. A virtual sender CAN adaptation layer is configured on the sender of data, and a virtual receiver CAN adaptation layer is configured on the receiver of data. When the sender of data sends data to the receiver of data through the sender application layer, the sender CAN adaptation layer splits the application layer data packet sent by the sender application layer to obtain a plurality of sub-data packets and sends them to the CAN protocol layer. The CAN protocol layer transmits the plurality of sub-data packets to the receiver CAN adaptation layer. When the receiver CAN adaptation layer receives the plurality of sub-data packets, the receiver CAN adaptation layer assembles the plurality of sub-data packets received to obtain a complete data packet and then reports it to the receiver application layer of the receiver of the data, thereby avoiding the need to formulate a set of application layer communication protocols separately, so that the application layer can get rid of the limitation of the single packet data length of the CAN basic protocol, freely transmit application layer data, realize seamless connection with the traditional serial communication application layer protocol, reduce the communication development difficulty, and improve the development efficiency. In addition, compared with the traditional serial communication unicast solution, the virtual serial communication method based on CAN bus can effectively utilize the bus characteristics of CAN to realize networking, multicast and broadcast communication, and improve the application flexibility and communication efficiency of the network. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their description are used to explain the present invention and do not constitute an improper limitation of the present invention. Some specific embodiments of the present invention will be described in detail in an exemplary and non-restrictive manner with reference to the drawings. The same reference numerals in the drawings indicate the same or similar components or parts. It should be understood by those skilled in the art that these drawings are not necessarily drawn to scale. In the drawings:
[0021] Figure 1 It is a flow chart of a virtual serial communication method based on CAN bus according to an embodiment of the present invention;
[0022] Figure 2 It is a schematic diagram of an architecture of a virtual serial communication system based on a CAN bus according to an embodiment of the present invention;
[0023] Figure 3 It is a protocol structure diagram of a virtual serial communication method based on CAN bus according to an embodiment of the present invention;
[0024] Figure 4 It is a structural diagram of a CAN adaptation layer protocol frame structure according to an embodiment of the present invention;
[0025] Figure 5 It is a protocol structure diagram of a traditional serial interface. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only an embodiment of a part of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work should fall within the scope of protection of the present invention.
[0027] See also Figure 1-Figure 5 An embodiment of the present invention provides a virtual serial communication method based on a CAN bus, comprising step S101, step S102 and step S103.
[0028] S101, configuring a virtual sender CAN adaptation layer at the data sender, and configuring a virtual receiver CAN adaptation layer at the data receiver;
[0029] S102, when the sender of the data sends data to the receiver of the data through the sender application layer, the sender CAN adaptation layer splits the application layer data packet sent by the sender application layer to obtain a plurality of sub-data packets and sends them to the CAN protocol layer, and the CAN protocol layer transmits the plurality of sub-data packets to the receiver CAN adaptation layer;
[0030] S103. When the receiving CAN adaptation layer receives the plurality of sub-data packets, the receiving CAN adaptation layer assembles the received plurality of sub-data packets to obtain a complete data packet and then reports the complete data packet to the receiving application layer of the receiving party of the data.
[0031] It should be noted that, in this embodiment, a virtual sender CAN adaptation layer is configured at the sender of the data, and a virtual receiver CAN adaptation layer is configured at the receiver of the data. When the sender of the data sends data to the receiver of the data through the sender application layer, the sender CAN adaptation layer splits the application layer data packet sent by the sender application layer to obtain several sub-data packets and sends them to the CAN protocol layer. The CAN protocol layer transmits the several sub-data packets to the receiver CAN adaptation layer. When the receiver CAN adaptation layer receives the several sub-data packets, the receiver CAN adaptation layer assembles the several received sub-data packets to obtain a complete data packet and reports it to the receiver application layer of the receiver of the data, thereby avoiding the need to separately formulate a set of application layer communication protocols, so that the application layer can get rid of the limitation of the single packet data length of the CAN basic protocol, freely transmit application layer data, and achieve seamless connection with the traditional serial communication application layer protocol, reduce the difficulty of communication development, and improve development efficiency.
[0032] In step S101, by configuring virtual CAN adaptation layers at the data sender and receiver, respectively, data packet splitting and packet assembly can be implemented, and transparent transmission of application layer data can be achieved, so that the application layer does not need to consider the limitations of the CAN protocol layer. It can be understood that in this embodiment, through the configuration of the CAN adaptation layer, the data splitting and packet assembly functions can be modularized, which helps to improve the scalability and maintainability of the system, hide the complexity of the CAN protocol layer, and enable application layer developers to focus on business logic without having to care about the details of the underlying communication protocol, thereby improving development efficiency and reducing development difficulty and cost.
[0033] In step S102, considering that the CAN bus protocol stipulates the maximum length of each data packet (generally 8 bytes), it is necessary to split the larger application layer data packet. It should be noted that the CAN FD standard supports a maximum data packet length of 64 bytes, but the hardware cost is relatively high, and the application is relatively less extensive than the CAN 1.0A / B and CAN2.0A / B protocols that only support 8-byte data packet fields. In this embodiment, by splitting, the large data packet is divided into multiple small data packets that meet the requirements of the CAN protocol to ensure that the data can be effectively transmitted. It can be understood that the split data packet can meet the CAN protocol's restrictions on the data packet size, thereby ensuring that the data can be transmitted normally on the CAN bus. At the same time, according to the actual data packet size, the application layer data packet is reasonably split into several sub-data packets, which can maximize the use of the CAN bus bandwidth and improve data transmission efficiency.
[0034] In step S103, the received multiple sub-data packets need to be reassembled into the original complete data packet so that the application layer can correctly process the received data. In this embodiment, the packet assembly mechanism can ensure that the data is not lost or repeated during the transmission process. It can be understood that in this embodiment, the split sub-data packets are reassembled into a complete data packet to restore the original application layer data. Through the packet assembly process, errors in transmission can be detected and processed to ensure the integrity and reliability of the data.
[0035] In some preferred embodiments, the receiving CAN adaptation layer performs packet grouping on the received several sub-data packets, including: the receiving CAN adaptation layer performs integrity judgment on the several sub-data packets, and when the several sub-data packets are judged to be complete, the received several sub-data packets are grouped to obtain the complete data packet. It should be noted that in this embodiment, it is considered that the CAN bus may have problems such as data loss and disordered data packets during data transmission. Therefore, it is necessary to perform integrity judgment on the received sub-data packets to ensure that all sub-data packets have been correctly received. In addition, during the receiving process, sub-data packets may be repeatedly received due to network jitter and other reasons. Through integrity judgment, repeated sub-data packets can be eliminated to avoid data errors. It can be understood that in this embodiment, through integrity judgment, errors in transmission can be discovered and corrected to ensure that the final packaged data is complete. Only after the data integrity is confirmed, the package grouping process is performed, which can prevent erroneous package grouping caused by incomplete data, thereby improving the reliability of data transmission. At the same time, by eliminating repeated data packets, errors in data transmission can be reduced, and the stability and reliability of the system can be improved. Moreover, in a complex network environment, the uncertainty of data transmission is relatively high. The integrity judgment mechanism can improve the system's ability to respond to various transmission anomalies and enhance the system's robustness.
[0036] In some preferred embodiments, the receiving CAN adapter layer verifies the complete data packet and reports the complete data packet that has passed the verification to the receiving application layer of the receiving party of the data. It should be noted that the integrity judgment ensures that all sub-data packets have been received and can be packaged, but it cannot guarantee the correctness of the data content. The verification step further verifies whether the packaged data is correct. The data may be tampered with during the transmission process, and the verification can detect this situation to ensure the authenticity of the data. It can detect data errors caused by factors such as noise and interference during data transmission to ensure the correctness of the data. It can be understood that in this embodiment, by verifying that the data packet is correct, it can prevent damaged or erroneous data from entering the application layer, ensure that only high-quality data enters the application layer, and avoid the impact of erroneous data on the logic and functions of the application layer. The application layer can assume that the received data is correct, reduce the burden of data verification, and simplify the development of the application layer. The application layer does not require additional error handling logic because the received data has been verified, thereby improving development efficiency.
[0037] In some preferred embodiments, the sender CAN adaptation layer and the receiver CAN adaptation layer perform multi-channel session concurrent management for the transmission of multi-channel data. It should be noted that in this embodiment, through multi-channel session concurrent management, multiple data streams can be transmitted simultaneously, thereby improving the overall data transmission efficiency and reducing the waiting time of single-channel transmission. Concurrent management can better utilize CAN bus bandwidth resources, avoid single-path data congestion, and improve bandwidth utilization. Moreover, in modern applications, it is often necessary to process multiple data types (such as sensor data, control instructions, etc.) at the same time, and multi-channel session concurrent management can support such multi-tasking requirements. For data that requires high real-time performance (such as control instructions), through concurrent management, it can be ensured that these data can be transmitted in time and are not blocked by other low-priority data. Moreover, through concurrent management, the transmission load of different data streams can be balanced to avoid transmission delays or failures caused by overloading a single path. If there is a problem with a certain data channel (such as data loss, transmission error), it will not affect the transmission of other data streams, thereby enhancing the robustness and stability of communication.
[0038] In some preferred embodiments, each of the sub-data packets has control information and data content. It should be noted that in this embodiment, the control information may include the sequence number of the data packet, the total number of data packets, verification information, etc., which helps the receiver to confirm the order and integrity of the data packet and ensure that each data packet can be assembled correctly. The actual data content is the core of communication. By transmitting the control information and the data content together, it is ensured that the receiver can correctly parse and process each data packet. It can be understood that the control information can help detect and correct errors in transmission, such as confirming whether the data packet is correctly received by verification information, thereby reducing the need for retransmission due to errors. If a sub-data packet is lost or erroneous, the control information can help the receiver identify and request retransmission of a specific sub-data packet instead of retransmitting the entire data packet. The control information may include management information for multiplex transmission, support simultaneous transmission of multiple data streams, and meet the needs of complex application scenarios. The control information may include priority information of the data packet, and the receiver can perform data processing and resource allocation according to the priority information to ensure timely transmission of high-priority data. Through the checksum and sequence number in the control information, the receiver can quickly detect faults in transmission and perform corresponding recovery processing to improve the robustness and stability of communication. In addition, control information can help coordinate the transmission of different data streams, prevent congestion and conflicts of data packets, and improve overall transmission performance.
[0039] In some preferred embodiments, the application layer data packet directly reuses the application layer data packet of the traditional serial interface, and the traditional serial interface includes a UART serial interface, an RS232 serial interface, an RS485 serial interface or an RS422 serial interface. It should be noted that many existing systems and devices use traditional serial interfaces. By directly reusing the data packets of these interfaces, it is possible to avoid redesigning and developing new interfaces and protect existing investments. At the same time, by being compatible with traditional serial interfaces, the existing system can be smoothly upgraded to a new system, reducing the modification of existing hardware and software and simplifying the upgrade process. In addition, developers can reuse the data packet processing code of the existing serial interface without redevelopment, reducing development complexity and time cost. Developers are familiar with the protocols and data packet formats of traditional serial interfaces, and by directly reusing, the cost of learning new protocols and data packet formats can also be reduced. In addition, by supporting multiple traditional serial interfaces, various devices and systems can be flexibly integrated to improve the compatibility and adaptability of communication. The protocols and data packet formats of traditional serial interfaces have been used and verified for a long time, and have high stability and reliability. These advantages can be inherited by reusing, reducing errors and failures introduced by new protocols and improving the reliability of data transmission.
[0040] In some preferred embodiments, the sender CAN adaptation layer and the receiver CAN adaptation layer use the same CAN adaptation layer protocol frame structure. The CAN adaptation layer protocol frame structure includes a message identifier CAN ID on the CAN bus and a packet data carrier Data in the CAN frame. The message identifier CAN ID on the CAN bus includes a sender device address SrcAddr, a receiver device address DstAddr, a frame type identifier PacketType, a session ID identifier SessionID between devices, and a specific packet information carrier PacketInfo. It should be noted that in this embodiment, the same CAN adaptation layer protocol frame structure is used to standardize data transmission and ensure that the sender and receiver can accurately understand and process data frames. A unified protocol frame structure can simplify system design and development and reduce the complexity of protocol parsing. The sender and receiver device addresses are identified by the sender device address SrcAddr and the receiver device address DstAddr to achieve multicast and broadcast communications that cannot be achieved with traditional one-to-one serial interfaces, ensuring that data frames can be correctly transmitted between devices. The frame type identifier PacketType is used to distinguish different types of data frames (such as data frames, packet start frames, etc.), so that the receiver can perform corresponding processing according to the frame type. The session ID identifier SessionID between devices is used to identify the session between devices. It can support multi-session parallel transmission to ensure that the data of different sessions are not confused. The data of multiple sessions can be transmitted in parallel on the same physical channel to improve communication efficiency. The specific packet information carrier PacketInfo carries specific packet information (such as data packet sequence number, data length, packet CRC check code, etc., the specific information format is determined by PacketType), ensuring that the receiver can correctly parse and reassemble the data packet, perform data packet integrity check, and ensure that the data is not lost or repeated during transmission.
[0041] Embodiment 2
[0042] See also Figure 1-Figure 5This embodiment provides a virtual serial communication system based on the CAN bus, including: a sender application layer for connecting communication, a sender CAN adaptation layer, a receiver CAN adaptation layer, a CAN protocol layer and a receiver application layer; the virtual serial communication system based on the CAN bus runs the virtual serial communication method based on the CAN bus described in any of the above embodiments. The virtual serial communication method based on the CAN bus configures a virtual sender CAN adaptation layer on the sender of the data and a virtual receiver CAN adaptation layer on the receiver of the data. When the sender of the data sends data to the receiver of the data through the sender application layer, the sender CAN adaptation layer splits the application layer data packet sent by the sender application layer to obtain a plurality of sub-data packets and sends them to the CAN protocol layer. The CAN protocol layer transmits the plurality of sub-data packets to the receiver CAN adaptation layer. When the receiver CAN adaptation layer receives the plurality of sub-data packets, the receiver CAN adaptation layer assembles the plurality of sub-data packets received to obtain a complete data packet and then reports it to the receiver application layer of the receiver of the data, thereby avoiding the need to formulate a set of application layer communication protocols separately, so that the application layer can get rid of the limitation of the single packet data length of the CAN basic protocol, freely transmit application layer data, realize seamless connection with the traditional serial communication application layer protocol, reduce the difficulty of communication development, and improve development efficiency.
[0043] It should be pointed out that the length of each field defined by the CAN protocol adaptation layer is not specifically limited by the present invention and can be determined according to the specific application scenario. The present invention does not limit the standard CAN protocol version and can be determined according to the specific application scenario. If CAN FD is used as the underlying CAN version, the present invention can also be used to achieve longer application layer data packet communications. In addition, the above embodiments are only preferred specific implementation methods of the present invention, and the protection scope of the present invention is not limited thereto. Any changes or replacements that can be easily thought of by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention, and the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A virtual serial communication method based on CAN bus, characterized in that: include: A virtual sender CAN adaptation layer is configured on the data sender, and a virtual receiver CAN adaptation layer is configured on the data receiver; When the sender of the data sends data to the receiver of the data through the sender application layer, the sender CAN adaptation layer splits the application layer data packet sent by the sender application layer to obtain several sub-data packets and sends them to the CAN protocol layer, and the CAN protocol layer transmits the several sub-data packets to the receiver CAN adaptation layer; When the receiving CAN adaptation layer receives the plurality of sub-data packets, the receiving CAN adaptation layer assembles the received plurality of sub-data packets to obtain a complete data packet and then reports it to the receiving application layer of the receiving party of the data.
2. The virtual serial communication method based on CAN bus as claimed in claim 1, characterized in that: The receiving CAN adaptation layer groups the received sub-data packets, including: the receiving CAN adaptation layer performs integrity judgment on the sub-data packets, and when it is determined that the sub-data packets are complete, groups the received sub-data packets to obtain the complete data packet.
3. The virtual serial communication method based on CAN bus as claimed in claim 2, characterized in that: The receiving CAN adaptation layer verifies the complete data packet, and reports the verified complete data packet to the receiving application layer of the data receiver.
4. The virtual serial communication method based on CAN bus as claimed in claim 1, characterized in that: The sending CAN adaptation layer and the receiving CAN adaptation layer perform multi-channel session concurrent management on the transmission of multi-channel data.
5. The virtual serial communication method based on CAN bus as claimed in claim 1, characterized in that: Each of the sub-data packets has control information and data content.
6. The virtual serial communication method based on CAN bus as claimed in claim 1, characterized in that: The application layer data packet directly multiplexes the traditional serial interface application layer data packet, and the traditional serial interface includes a UART serial interface, an RS232 serial interface, an RS485 serial interface or an RS422 serial interface.
7. The virtual serial communication method based on CAN bus according to any one of claims 1 to 6, characterized in that: The sending CAN adaptation layer and the receiving CAN adaptation layer use the same CAN adaptation layer protocol frame structure.
8. The virtual serial communication method based on CAN bus as claimed in claim 7, characterized in that: The CAN adaptation layer protocol frame structure includes a message identifier CAN ID on the CAN bus and a packet data carrier Data in the CAN frame.
9. The virtual serial communication method based on CAN bus as claimed in claim 8, characterized in that: The message identifier CAN ID on the CAN bus includes a sender device address SrcAddr, a receiver device address DstAddr, a frame type identifier PacketType, a session ID identifier SessionID between devices, and a specific packet information carrier PacketInfo.
10. A virtual serial communication system based on CAN bus, characterized in that: include: The sender application layer, the sender CAN adaptation layer, the receiver CAN adaptation layer, the CAN protocol layer and the receiver application layer of the connected communication; the virtual serial communication system based on the CAN bus runs the virtual serial communication method based on the CAN bus as described in any one of claims 1-9.
