Cross-system communication method and device
By introducing cross-system communication methods in vehicle-mounted systems, using data packaging and transmission technology, the complex communication problem between subsystems is solved, simple interaction and unified communication between systems are realized, and development and maintenance costs are reduced.
Patent Information
- Application Number
- CN202411762054.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-03-11
AI Technical Summary
Due to the different communication channels and protocols between subsystems in vehicle-mounted systems, interaction and communication are complicated, which increases the difficulty of development and maintenance.
A cross-system communication method is proposed. By acquiring communication data, the data is encapsulated and transmitted based on the communication protocol deployed in the data encapsulation layer of the local communication system, and data interaction between different systems is realized.
It realizes a unified communication mechanism between different systems, simplifies the interaction and communication between subsystems, and reduces the development cost and maintenance difficulty of on-board systems.
Smart Images

Figure CN119603328A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle-mounted system communications, and in particular to a cross-system communication method and device. Background Art
[0002] With the continuous development of vehicle-mounted technology, the vehicle-mounted system has continuously developed from a single vehicle machine to a domain control system and to a cabin-driver integration, realizing the integrated development of the vehicle-mounted system from a single system to multiple subsystems. The vehicle-mounted system contains more and more subsystems, including entertainment systems, driver information systems, TBOX systems (full name Telematics Box, a vehicle-mounted intelligent terminal), auxiliary driving, and automatic driving systems. The communication methods between these subsystems are diverse, including SPI (Serial Peripheral Interface), UART (Universal Asynchronous Receiver / Transmitter), Ethernet, USB (Universal Serial Bus), etc. These subsystems cooperate with each other and share information, but because the communication channels and protocols are also different, not only the interaction and synchronization are more complicated, but also the development, maintenance and use are difficult. Therefore, a cross-system communication method is urgently needed to solve the problem of complex cross-system communication caused by different communication channels and communication protocols between subsystems in the vehicle-mounted system in the prior art. Summary of the invention
[0003] In order to solve the above technical problems, the present application proposes a cross-system communication method and device for solving the complex problems of cross-system interaction and communication between subsystems in a vehicle-mounted system.
[0004] On the one hand, an embodiment of the present application provides a cross-system communication method, the method comprising:
[0005] Acquire first communication data, and based on a first communication protocol deployed in a first data encapsulation layer of a local communication system, encapsulate the first communication data to obtain first communication protocol data, and transmit the first communication protocol data to a second data encapsulation layer of the local communication system;
[0006] Based on a second communication protocol deployed at a second data encapsulation layer of the local communication system, encapsulating the first communication protocol data into a transmission type to obtain second communication protocol data, and transmitting the second communication protocol data to a data communication layer of the local communication system; the second communication protocol is a lower layer protocol of the first communication protocol;
[0007] The second communication protocol data is transmitted to the data communication layer of the target communication system through the data communication layer of the local communication system, so that the second communication protocol deployed at the second data encapsulation layer of the target communication system decapsulates the second communication protocol data to obtain first format data consistent with the first communication protocol data; and the first communication protocol deployed at the first data encapsulation layer of the target communication system decapsulates the first format data to obtain second communication data consistent with the first communication data.
[0008] Furthermore, before obtaining the first communication data, the method further includes:
[0009] Determine a physical communication interface type, and based on the physical communication interface type, perform protocol stack deployment on a data communication layer of the local communication system to obtain a data communication layer protocol;
[0010] According to the data communication layer protocol, based on a preset protocol stack deployment strategy, a protocol stack is deployed on the second data encapsulation layer of the local communication system to obtain a second communication protocol; the second communication protocol is an upper layer protocol of the data communication layer protocol;
[0011] A first communication protocol is deployed on the first data encapsulation layer of the local communication system; the first communication protocol is an upper layer protocol of the second communication protocol.
[0012] Further, the second communication protocol includes at least one of an inter-chip communication protocol and a TCP / IP protocol; the second data encapsulation layer of the local communication system is deployed with a protocol stack based on the data communication layer protocol and a preset protocol stack deployment strategy to obtain the second communication protocol, including:
[0013] When the data communication layer protocol includes any one of a USB protocol, an Ethernet protocol, and an inter-core communication protocol, based on the preset protocol stack deployment strategy, the protocol stack of the second data encapsulation layer of the local communication system is deployed as the TCP / IP protocol;
[0014] When the data communication layer protocol includes any one of the SPI protocol, the UART protocol, and the inter-core communication protocol, based on the preset protocol stack deployment strategy, the protocol stack of the second data encapsulation layer of the local communication system is deployed as the inter-chip communication protocol;
[0015] When the data communication layer protocol includes any one of the USB protocol and the Ethernet protocol, and includes any one of the SPI protocol, the UART protocol, and the inter-core communication protocol, based on the preset protocol stack deployment strategy, the protocol stack of the second data encapsulation layer of the local communication system is deployed as the TCP / IP protocol and the inter-chip communication protocol.
[0016] Further, the transmission unit of the first communication protocol is a frame; the obtaining of the first communication data and encapsulating the first communication data based on the first communication protocol deployed in the first data encapsulation layer of the local communication system to obtain the first communication protocol data includes:
[0017] Acquire the first communication data, and determine the data length and application scenario of the first communication data;
[0018] Based on the first communication protocol deployed at the first data encapsulation layer of the local communication system, encapsulate the application scenario and the data length to obtain the data frame;
[0019] The data frame is determined as the first communication protocol data.
[0020] Furthermore, the second communication protocol includes at least one of an inter-chip communication protocol and a TCP / IP protocol; the transmission unit of the second communication protocol is a packet; the second communication protocol based on the second data encapsulation layer deployed in the local communication system performs transmission type encapsulation on the first communication protocol data to obtain the second communication protocol data, including:
[0021] Determining a data transmission mode of the first communication protocol data;
[0022] Based on the second communication protocol deployed in the second data encapsulation layer of the local communication system and the data transmission mode, the data frame is encapsulated into a transmission type to obtain the data packet, and the data packet is determined as the second communication protocol data.
[0023] Further, in the case where the second communication protocol includes the inter-chip communication protocol, the second communication protocol based on the second data encapsulation layer deployed in the local communication system and the data transmission mode, performs transmission type encapsulation on the data frame to obtain the data packet, and determines the data packet as the second communication protocol data, including:
[0024] When the data transmission mode of the first communication protocol data is reliable, based on the inter-chip communication protocol and the reliability, the data frame is encapsulated for reliable transmission to obtain a handshake packet, a connection maintenance packet and a reliable packet, and the handshake packet, the connection maintenance packet and the reliable packet are determined as the second communication protocol data.
[0025] Further, the transmitting the second communication protocol data to the data communication layer of the target communication system through the data communication layer of the local communication system, so that the second communication protocol deployed at the second data encapsulation layer of the target communication system decapsulates the second communication protocol data to obtain first format data consistent with the first communication protocol data, including:
[0026] Transmitting the handshake packet to the data communication layer of the target communication system through the data communication layer of the local communication system, so that the second data encapsulation layer of the target communication system receives it, thereby establishing a data channel for the reliable packet transmission;
[0027] Transmitting the connection maintenance packet to the data communication layer of the target communication system through the data channel;
[0028] Upon receiving a feedback from the target communication system that the connection is successful, sending the reliable packet through the data channel to the second data encapsulation layer of the target communication system, so that the target communication system decapsulates the reliable packet based on the inter-chip communication protocol to obtain the first format data; and causing the target communication system to return a response packet;
[0029] Receive a response packet fed back by the target communication system, and repeat the operation of sending the reliable packet through the data channel to the second data encapsulation layer of the target communication system, so that the target communication system decapsulates the reliable packet based on the inter-chip communication protocol to obtain the first format data, until all reliable packets are transmitted to the second data encapsulation layer of the target communication system.
[0030] Further, in the case where the second communication protocol includes the inter-chip communication protocol, the second communication protocol based on the second data encapsulation layer deployed in the local communication system and the data transmission mode, performs transmission type encapsulation on the data frame to obtain the data packet, and determines the data packet as the second communication protocol data, including:
[0031] When the data transmission mode of the first communication protocol data is unreliable, based on the inter-chip communication protocol and the unreliable type, performing unreliable transmission encapsulation on the data frame to obtain an unreliable packet, and determining the unreliable packet as the second communication protocol data;
[0032] The method of transmitting the second communication protocol data to the data communication layer of the target communication system through the data communication layer of the local communication system, so that the second communication protocol deployed at the second data encapsulation layer of the target communication system decapsulates the second communication protocol data to obtain first format data consistent with the first communication protocol data, includes:
[0033] The unreliable packet is transmitted to the data communication layer of the target communication system through the data communication layer of the local communication system, so that the inter-chip communication protocol deployed in the second data encapsulation layer of the target communication system decapsulates the unreliable packet to obtain the first format data.
[0034] Furthermore, the method further comprises:
[0035] When the communication channel corresponding to the data transmission layer of the local communication system is updated, the protocol stack of the data communication layer of the local communication system is dynamically adjusted by plug-in management, so that the protocol stack of the data communication layer of the local communication system can be dynamically updated. On the other hand, the embodiment of the present application also provides a cross-system communication device, the device comprising:
[0036] A first data encapsulation and transmission module, configured to obtain first communication data, and based on a first communication protocol deployed in a first data encapsulation layer of a local communication system, encapsulate the first communication data to obtain first communication protocol data, and transmit the first communication protocol data to a second data encapsulation layer of the local communication system;
[0037] A second data encapsulation and transmission module, configured to perform transmission type encapsulation on the first communication protocol data based on a second communication protocol deployed at a second data encapsulation layer of the local communication system to obtain second communication protocol data, and transmit the second communication protocol data to a data communication layer of the local communication system; the second communication protocol is a lower layer protocol of the first communication protocol;
[0038] A data transmission module is used to transmit the second communication protocol data to the data communication layer of the target communication system through the data communication layer of the local communication system, so that the second communication protocol deployed at the second data encapsulation layer of the target communication system decapsulates the second communication protocol data to obtain first format data consistent with the first communication protocol data; and so that the first communication protocol deployed at the first data encapsulation layer of the target communication system decapsulates the first format data to obtain second communication data consistent with the first communication data.
[0039] Furthermore, the inter-system communication device further includes:
[0040] A data communication layer protocol stack deployment module, used to determine the type of physical communication interface, and based on the type of physical communication interface, perform protocol stack deployment on the data communication layer of the local communication system to obtain a data communication layer protocol;
[0041] A second data encapsulation layer protocol stack deployment module, configured to perform protocol stack deployment on the second data encapsulation layer of the local communication system according to the data communication layer protocol and based on a preset protocol stack deployment strategy to obtain a second communication protocol; the second communication protocol is an upper layer protocol of the data communication layer protocol;
[0042] The first data encapsulation layer protocol stack deployment module is used to deploy a first communication protocol on the first data encapsulation layer of the local communication system; the first communication protocol is an upper layer protocol of the second communication protocol.
[0043] Furthermore, the second data encapsulation layer protocol stack deployment module includes:
[0044] A TCP / IP protocol deployment unit, configured to deploy the protocol stack of the second data encapsulation layer of the local communication system as the TCP / IP protocol based on the preset protocol stack deployment strategy when the data communication layer protocol includes any one of the USB protocol, the Ethernet protocol, and the inter-core communication protocol;
[0045] An inter-chip communication protocol deployment unit, configured to deploy the protocol stack of the second data encapsulation layer of the local communication system as the inter-chip communication protocol based on the preset protocol stack deployment strategy when the data communication layer protocol includes any one of the SPI protocol, the UART protocol, and the inter-core communication protocol;
[0046] The TCP / IP protocol and inter-chip communication protocol deployment unit is used to deploy the protocol stack of the second data encapsulation layer of the local communication system as the TCP / IP protocol and the inter-chip communication protocol based on the preset protocol stack deployment strategy when the data communication layer protocol includes any one of the USB protocol and the Ethernet protocol, and includes any one of the SPI protocol, the UART protocol, and the inter-core communication protocol.
[0047] Furthermore, the first data encapsulation and transmission module includes:
[0048] A first determining unit, configured to obtain the first communication data and determine a data length and an application scenario of the first communication data;
[0049] A data encapsulation unit, configured to encapsulate the application scenario and the data length based on the first communication protocol deployed at the first data encapsulation layer of the local communication system to obtain the data frame;
[0050] The second determining unit is used to determine the data frame as the first communication protocol data.
[0051] Furthermore, the second data encapsulation and transmission module includes:
[0052] a data transmission mode determining unit, used to determine a data transmission mode of the first communication protocol data;
[0053] A transmission type encapsulation unit is used to perform transmission type encapsulation on the data frame based on the second communication protocol deployed in the second data encapsulation layer of the local communication system and the data transmission mode to obtain the data packet and determine the data packet as the second communication protocol data.
[0054] Furthermore, the transmission type encapsulation unit includes:
[0055] A reliable packet encapsulation unit is used to perform reliable transmission encapsulation on the data frame based on the inter-chip communication protocol and the reliability when the data transmission mode of the first communication protocol data is reliable, to obtain a handshake packet, a connection maintenance packet and a reliable packet, and to determine the handshake packet, the connection maintenance packet and the reliable packet as the second communication protocol data.
[0056] Furthermore, the data transmission module includes:
[0057] A handshake packet transmission unit, used for transmitting the handshake packet to the data communication layer of the target communication system through the data communication layer of the local communication system, so that the second data encapsulation layer of the target communication system receives it, thereby establishing a data channel for the reliable packet transmission;
[0058] A connection maintaining packet transmission unit, used for transmitting the connection maintaining packet to the data communication layer of the target communication system through the data channel;
[0059] A reliable packet transmission unit is used to, upon receiving feedback from the target communication system that the connection is successful, send the reliable packet through the data channel to the second data encapsulation layer of the target communication system, so that the target communication system decapsulates the reliable packet based on the inter-chip communication protocol to obtain the first format data; and to enable the target communication system to return a response packet; and is also used to receive the response packet fed back by the target communication system, repeat the operation of sending the reliable packet through the data channel to the second data encapsulation layer of the target communication system, so that the target communication system decapsulates the reliable packet based on the inter-chip communication protocol to obtain the first format data, until all reliable packets are transmitted to the second data encapsulation layer of the target communication system.
[0060] Furthermore, the transmission type encapsulation unit includes:
[0061] an unreliable packet encapsulation unit, configured to, when the data transmission mode of the first communication protocol data is unreliable, perform unreliable transmission encapsulation on the data frame based on the inter-chip communication protocol and the unreliable type to obtain an unreliable packet, and determine the unreliable packet as the second communication protocol data;
[0062] The data transmission module also includes:
[0063] An unreliable packet transmission unit is used to transmit the unreliable packet to the data communication layer of the target communication system through the data communication layer of the local communication system, so that the inter-chip communication protocol deployed at the second data encapsulation layer of the target communication system decapsulates the unreliable packet to obtain the first format data.
[0064] Furthermore, the inter-system communication device further includes:
[0065] A plug-in management module is used to dynamically adjust the protocol stack of the data communication layer of the local communication system by plug-in management when the communication channel corresponding to the data transmission layer of the local communication system is updated, so that the protocol stack of the data communication layer of the local communication system can be dynamically updated. On the other hand, an embodiment of the present application also provides an electronic device, the electronic device includes a processor and a memory, the memory stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement the cross-system communication method as described above.
[0066] On the other hand, an embodiment of the present application also provides a computer-readable storage medium, in which at least one instruction or at least one program is stored, and the at least one instruction or at least one program is loaded and executed by a processor to implement the cross-system communication method as described above.
[0067] On the other hand, an embodiment of the present application further provides a computer program product, which implements the above-mentioned cross-system communication method when the computer program is executed by a processor.
[0068] The present application provides a cross-system communication method and device, which has the following technical effects:
[0069] The present application obtains first communication data, and based on a first communication protocol deployed in a first data encapsulation layer of a local communication system, performs data encapsulation on the first communication data to obtain first communication protocol data, and transmits the first communication protocol data to a second data encapsulation layer of the local communication system; based on a second communication protocol deployed in a second data encapsulation layer of the local communication system, performs transmission type encapsulation on the first communication protocol data to obtain second communication protocol data, and transmits the second communication protocol data to the data communication layer of the local communication system through the data communication layer of the local communication system, and transmits the second communication protocol data to the data communication layer of the target communication system, so that the second communication protocol deployed in the second data encapsulation layer of the target communication system decapsulates the second communication protocol data to obtain first format data consistent with the first communication protocol data; and decapsulates the first format data to obtain second communication data consistent with the first communication data by the first communication protocol deployed in the first data encapsulation layer of the target communication system. The above method is used to transmit and interact data between different systems, which not only realizes the management of data transmission to the bottom, data distribution to the top and business routing, but also realizes the encapsulation and parsing of messages of the unified communication mechanism; at the same time, it unifies the communication protocols and interactions between different subsystems in the vehicle system, simplifies the interaction and communication between different systems, and reduces the development cost and maintenance difficulty of the vehicle system; business interactors only need to care about the business logic, and do not need to care about the underlying channels and sources, which makes the hardware design more flexible and the business logic easier to maintain and upgrade, and messages can flow freely between the various subsystems of the vehicle system. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0071] Figure 1 It is a schematic diagram of a cockpit hardware solution for integrating a cabin and a driver provided in an embodiment of the present application;
[0072] Figure 2 This is an example of a network topology of a communication channel between systems provided in an embodiment of the present application;
[0073] Figure 3 It is a flowchart of a cross-system communication method provided in an embodiment of the present application;
[0074] Figure 4 It is a flowchart of a protocol stack deployment method provided in an embodiment of the present application;
[0075] Figure 5 It is a flowchart of a method for obtaining first communication protocol data provided by an embodiment of the present application;
[0076] Figure 6 It is a flowchart of a reliable packet transmission method based on an inter-chip communication protocol provided in an embodiment of the present application;
[0077] Figure 7 is a schematic diagram of an extensible unified communication framework supporting multiple communication channels provided by an embodiment of the present application;
[0078] Figure 8 is a block diagram of a cross-system communication device provided in an embodiment of the present application;
[0079] Fig. 9 It is a hardware structure block diagram of a server of a cross-system communication method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0080] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0081] It should be noted that the terms "first", "second", etc. in the specification and claims of the embodiment of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the embodiment of the present application described here can be implemented in an order other than those illustrated or described here. Thus, the features defined as "first" and "second" can expressly or implicitly include one or more of the features. In the description of the present embodiment, unless otherwise specified, the meaning of "multiple" is two or more. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0082] First, some nouns or terms that appear in the description of the embodiments of the present application are explained as follows:
[0083] USB protocol: Universal Serial Bus protocol, is an external bus standard. The architecture of USB protocol is similar to a tree structure, in which each I / O (abbreviation of Input / Output) device is connected point-to-point and transmits data through a serial transmission format. The USB protocol works based on a polling mechanism, and the processor continuously checks whether the input / output device is ready to transmit data. The USB protocol supports multiple transmission modes, including control transmission, interrupt transmission, bulk transmission and isochronous transmission, and each mode has its specific application scenario. The USB protocol also includes a protocol for describing device information, namely the USB device descriptor protocol, and power management functions, including suspend and resume functions.
[0084] Ethernet protocol: It is a local area network communication protocol that specifies the data transmission method on the physical medium, including the data frame format, transmission rate, control mechanism, etc. It is based on the CSMA / CD (Carrier Sense Multiple Access / Collision Detection) mechanism, allowing multiple devices to share the same communication medium and detect conflicts during data transmission to ensure the reliability and efficiency of data transmission.
[0085] Inter-core communication protocol: The inter-core communication protocol is a mechanism that allows different processor cores to exchange data and work together in a multi-core processor system. It is implemented through shared memory, message passing, etc. Among them, RPMsg (Remote Processor Messaging) is a popular inter-core communication protocol that defines a standardized binary interface for communication between multiple cores in a heterogeneous multi-core system. The main goal of the inter-core communication protocol is to make full use of the mechanisms provided by the hardware to achieve efficient inter-core communication and provide a concise and efficient programming interface for applications that require inter-core communication.
[0086] UART protocol: UART (Universal Asynchronous Receiver / Transmitter) is a widely used serial communication protocol, mainly used for point-to-point full-duplex or half-duplex data transmission. It realizes bit-by-bit data transmission in an asynchronous manner, does not require a shared clock signal, but determines the start and end of the data through the start bit and stop bit in the data frame.
[0087] SPI protocol: SPI (Serial Peripheral Interface) is a high-speed, full-duplex, synchronous communication bus for short-distance communication, usually used for data exchange between microcontrollers and various peripheral devices in embedded systems. The SPI protocol defines the communication method between the master device (Master) and the slave device (Slave), including four signal lines: clock line (SCLK), master output slave input line (MOSI), master input slave output line (MISO) and chip select line (CS). SPI communication is master-controlled, that is, the master device controls the clock signal for data transmission and is responsible for starting and stopping data transmission. The slave device is usually activated by the chip select signal to participate in the communication. SPI supports full-duplex communication, allowing data to be transmitted in both directions at the same time, but each device can only work as a transmitter or a receiver. This protocol is widely used in the connection of memory, sensors, displays and other peripherals.
[0088] TCP / IP protocol: is a widely used set of network communication rules, which includes the core Transmission Control Protocol (TCP) and Internet Protocol (IP), as well as a variety of other supporting protocols, which together realize data transmission and communication between different computers and devices on the Internet.
[0089] See also Figure 1 and Figure 2 , Figure 1 It is a schematic diagram of a cockpit hardware solution with a cabin and a driver integrated according to an embodiment of the present application; Figure 2 This is an example of a network topology of a communication channel between systems provided according to an embodiment of the present application. Figure 1 As shown in the figure, the cabin-driver integration includes IVI (In-Vehicle Infotainment), instrument, MCU (microcontroller unit), intelligent driving, and TBOX (full name Telematics Box, a vehicle-mounted intelligent terminal, mainly responsible for vehicle-to-external communication and remote monitoring and control of the vehicle). In this hardware solution, the hardware communication methods between various domains include USB (Universal Serial Bus), SPI (Serial Peripheral Interface), UART (Universal Asynchronous Receiver / Transmitter), Ethernet, etc. Figure 2 As shown, the communication methods or communication channels of each subsystem or each domain are inconsistent, which leads to difficulties in the development, maintenance and use of vehicle-mounted technology.
[0090] Figure 1In the table, ETH is Ethernet; Switch is a network switch; FASTAVM information is fast 360-degree surround information; uart is UART, which is a universal asynchronous receiver / transmitter; virtual eth is virtual Ethernet; MCU is the abbreviation of Microcontroller Unit, which stands for microcontroller unit; R core stands for SOC R core, which refers to the real-time processor core (Real-time Core) running on the system-level chip. SOC is a chip that integrates multiple functional modules, including CPU, GPU, ISP (image signal processor), DSP (digital signal processor), baseband chip, Bluetooth chip, Wi-Fi chip and GPS chip, etc.; Linux stands for SOCLINUX core, which refers to the Linux operating system kernel running on the system-level chip (System on Chip, referred to as SoC); Android stands for SOC Android core, which refers to the Android operating system kernel running on the system-level chip.
[0091] Based on this, an embodiment of the present application provides a cross-system communication method. Figure 3 It is a flowchart of a cross-system communication method provided in an embodiment of the present application. This method is applicable to the communication or interaction between different subsystems of the vehicle-mounted system, wherein the subsystem may be IVI, instrument, MCU, smart driving, and TBOX, etc. This specification provides method operation steps such as the embodiment or flowchart, but may include more or fewer operation steps based on conventional or non-creative labor. The sequence of steps listed in the embodiment is only one way of executing the steps among many sequences and does not represent the only execution sequence. When the actual system or the fourth server product is executed, it can be executed in sequence or in parallel according to the method shown in the embodiment or the accompanying drawings (for example, a parallel processor or a multi-threaded processing environment). Specifically, Figure 3 As shown, the method may include:
[0092] S10: Acquire first communication data, and based on a first communication protocol deployed in a first data encapsulation layer of a local communication system, encapsulate the first communication data to obtain first communication protocol data, and transmit the first communication protocol data to a second data encapsulation layer of the local communication system.
[0093] In the embodiment of the present application, the local communication system refers to any subsystem in the vehicle system that has an information transmission function or an interactive function, including but not limited to an entertainment system, a driver information system, a TBOX system, an auxiliary driving system, an automatic driving system, etc. The first communication data refers to data generated in response to an operation instruction of a target object. Specifically, the target object refers to a user corresponding to the local communication system. The operation instruction can be data, a request or an instruction generated by the target object using any function of the local communication system.
[0094] A layered communication system is deployed on each subsystem of the vehicle system as a channel for interaction and data transmission. The layered communication system is also called a communication framework, which includes the first data encapsulation layer, which corresponds to the application layer, presentation layer and session layer in the OSI model (Open System Interconnection Model), that is, it can be the integration of the functions of the application layer, presentation layer and session layer, existing as a virtual layer, or it can be an overview, but in fact, the application layer, presentation layer and session layer all exist.
[0095] In order to unify the communication protocols between the various subsystems of the vehicle-mounted system and reduce the difficulty of development, the embodiment of the present application deploys the first data encapsulation layer of each subsystem of the vehicle-mounted system as the first communication protocol, or called the business data transmission protocol, so that all business data can be transmitted in a unified format throughout the system. Specifically, the main function of the first data encapsulation layer is to encapsulate the first communication data according to the deployed first communication protocol, and to transmit the encapsulated first communication protocol data downward to the second data encapsulation layer.
[0096] Optionally, when the first data encapsulation layer in the layered communication system is just a generalization of the above-mentioned application layer, presentation layer and session layer, then there are actually three layers in the layered communication system, namely, the application layer, the presentation layer and the session layer, which are divided to realize the encapsulation function and the transmission function. Specifically, the role of the application layer includes providing network services for application software; directly providing support for the user's application process, such as file transfer, email, remote login, etc.; involving the interaction between the end user and the network. The presentation layer is responsible for the representation, security and compression of data; converting the data format so that the information sent by the application layer of one system can be read by the application layer of another system; and including data encryption, decryption, data compression and decompression, etc. The session layer is used to manage data exchange, session checkpoints and recovery; responsible for establishing, managing and terminating sessions between applications; and ensuring that sessions can be reestablished after communication interruption, etc. Among them, the presentation layer is the upper layer of the session layer, and the application layer is the upper layer of the session layer. Each layer realizes its functions through the services provided by its lower layer and provides services for the upper layer.
[0097] The data encapsulation of the first communication data based on the first communication protocol deployed in the first data encapsulation layer of the local communication system refers to encapsulating the first communication data into data conforming to the format of the first communication protocol, ie, first communication protocol data.
[0098] When the first data encapsulation layer in the layered communication system exists as a virtual layer, its functions include not only the main role of the first data encapsulation layer mentioned above, but also the roles of the application layer, presentation layer and session layer mentioned above.
[0099] In the embodiment of the present application, the above-mentioned layered communication system further includes a second data encapsulation layer, which is a lower layer of the first data encapsulation layer. The second data encapsulation layer corresponds to the transport layer and the network layer of the OSI model, that is, it can be the function of integrating the transport layer and the network layer, existing as a virtual layer, or it can be an overview, and in fact, both the transport layer and the network layer exist.
[0100] S30: Based on the second communication protocol deployed in the second data encapsulation layer of the local communication system, the first communication protocol data is encapsulated in a transmission type to obtain second communication protocol data, and the second communication protocol data is transmitted to the data communication layer of the local communication system; the second communication protocol is a lower layer protocol of the first communication protocol.
[0101] In the embodiment of the present application, the main function of the second data encapsulation layer is to use the deployed second communication protocol to encapsulate the first communication protocol data received from the first data encapsulation layer in a transmission manner, and to transmit the encapsulated second communication protocol data downward to the data communication layer.
[0102] In order to unify the communication protocols between the various subsystems of the vehicle-mounted system and reduce the difficulty of development, the embodiment of the present application deploys the second data encapsulation layer of each subsystem of the vehicle-mounted system as the second communication protocol.
[0103] Optionally, when the second data encapsulation layer in the layered communication system is just a generalization of the above-mentioned transport layer and network layer, then there is actually a division of labor between the transport layer and the network layer in the layered communication system to realize the data encapsulation function and the transmission function. Specifically, the transport layer is responsible for providing reliable data transmission services between end systems; and ensuring the integrity, sequence and error recovery of data; and providing end-to-end communication. The network layer is responsible for selecting routes between the source and the destination to ensure that data packets can be transmitted correctly; as well as IP address (Internet Protocol address) allocation, routing selection, congestion control, data segmentation and reassembly, etc.; and responsible for transmitting data between multiple networks, etc. That is, the main function of the network layer is to encapsulate the data transmission type, and the main function of the transport layer is to provide transmission services. When the second data encapsulation layer in the layered communication system exists as a virtual layer, its functions include not only the main functions of the above-mentioned second data encapsulation layer, but also the functions of the above-mentioned transport layer and network layer.
[0104] The second communication protocol deployed in the second data encapsulation layer of the local communication system performs transmission type encapsulation on the first communication protocol data to obtain second communication protocol data. The first communication protocol data is encapsulated on the second communication protocol data to obtain data that conforms to the second communication protocol format, i.e., second communication protocol data.
[0105] In the embodiment of the present application, the layered communication system further includes a data communication layer, which is the lower layer of the second data encapsulation layer. The data communication layer corresponds to the data link layer and the physical layer of the OSI model, that is, it can be a function of the data link layer and the physical layer, existing as a virtual layer, or it can be an overview, and in fact, both the data link layer and the physical layer exist.
[0106] After encapsulating the first communication protocol data, the second data encapsulation layer transmits the data downward to the data communication layer.
[0107] S50: Transmitting the second communication protocol data to the data communication layer of the target communication system through the data communication layer of the local communication system, so that the second communication protocol deployed at the second data encapsulation layer of the target communication system decapsulates the second communication protocol data to obtain first format data consistent with the first communication protocol data; and so that the first communication protocol deployed at the first data encapsulation layer of the target communication system decapsulates the first format data to obtain second communication data consistent with the first communication data.
[0108] In the embodiment of the present application, the target communication system refers to any subsystem in the vehicle system that has information transmission function or interaction function, including but not limited to entertainment system, driver information system, TBOX system, auxiliary driving, automatic driving system, etc. The target communication system is inconsistent with the local communication system. For example, when the local communication system is an automatic driving system, the target communication system can be any system other than the automatic driving system.
[0109] After the second communication protocol data is transmitted to the data communication layer of the target communication system, it will continue to be transmitted upward to the second data encapsulation layer of the target communication system, and based on the second communication protocol deployed in the second data encapsulation layer of the target communication system, the second communication protocol data will be decapsulated. Because the protocol stack deployment of the second data encapsulation layer of the target communication system is consistent with that of the current communication system, the second communication protocol data can be directly parsed without protocol conversion, and the first format data obtained by parsing is consistent with the first communication protocol data.
[0110] After completing the data decapsulation, the second data encapsulation layer of the target communication system transmits the obtained first format data upward to the first data encapsulation layer of the target communication system. Because the protocols deployed by the first data encapsulation layer are all the first communication protocols, the first format data can be directly parsed to obtain the second communication data, which is the first communication data transmitted by the local communication system. That is, the first data encapsulation layer and the second data encapsulation layer in the embodiment of the present application not only have the functions of encapsulation and downward transmission based on the protocols deployed therein, but also have the functions of data decapsulation and transmission to the upper layer. Therefore, the embodiment of the present application not only realizes the management of data transmission downward, data distribution and service routing upward, but also realizes the encapsulation and parsing of messages of the unified communication mechanism.
[0111] In the embodiment of the present application, the main function of the data communication layer is to transmit the received second communication protocol data to the data communication layer of the target communication system. Regardless of the protocol deployment of the data communication layer, its upper layer, namely the second data encapsulation layer, will be based on the deployment of the protocol stack as the second communication protocol. Therefore, the method provided in the embodiment of the present application is to solve the reusability of the software solution on the hardware solution, without the need to perceive the underlying hardware path, to facilitate platformization and to cope with possible changes in hardware. Among them, the bottom layer refers to the physical layer and the data link layer. That is, using the above method, even if the physical layer and the data link layer of any system change, it will not affect its upper layer protocol, and will not affect the data interaction process.
[0112] Optionally, the data link layer is mainly responsible for transmitting data between adjacent nodes and ensuring that the data transmitted by the physical layer is correct; the physical layer is responsible for transmitting the original bit stream on the physical medium, and defines the electrical, mechanical, process and functional standards to achieve the physical connection between different devices, and may include cables, connectors, cards, physical devices, etc. Among them, the physical medium refers to the physical medium that actually transmits the data signal, such as Ethernet cables, optical fibers, radio waves, etc.
[0113] In the embodiment of the present application, the first communication protocol is deployed in the first data encapsulation layer of the local communication system and the first data encapsulation layer of the target communication system for encapsulating or parsing the communication data, and the second communication protocol is deployed in the second data encapsulation layer of the local communication system and the second data encapsulation layer of the target communication system for encapsulating or parsing the communication data, so that the business data on each operating system is packaged in a unified format, thereby providing a unified communication protocol and interface, simplifying the interaction and communication between different systems, reducing the development cost and maintenance difficulty of the vehicle-mounted system, and thus allowing business interactors to only care about the business logic, without having to care about the underlying channels and sources, making the hardware design more flexible, the business logic easier to maintain and upgrade, and the messages can flow freely between the various subsystems of the vehicle-mounted system. At the same time, the above method is used to transmit and interact data between different systems, and the data sending management to the bottom, the data distribution to the top and the business routing are also realized.
[0114] As an optional implementation, Figure 4 As shown, before the above step S10, the method further includes:
[0115] S01: Determine the type of physical communication interface, and based on the type of physical communication interface, deploy a protocol stack for the data communication layer of the local communication system to obtain a data communication layer protocol;
[0116] S03: According to the data communication layer protocol and based on the preset protocol stack deployment strategy, a protocol stack is deployed on the second data encapsulation layer of the local communication system to obtain a second communication protocol; the second communication protocol is an upper layer protocol of the data communication layer protocol;
[0117] S05: Deploy a first communication protocol on a first data encapsulation layer of a local communication system; the first communication protocol is an upper layer protocol of the second communication protocol.
[0118] In the embodiments of the present application, the physical communication interface type refers to a hardware interface used to connect computers, network devices and other communication devices to realize data transmission. For example, Ethernet interface (Ethernet), fiber interface, wireless interface, USB interface, etc. The preset protocol stack deployment strategy refers to the correspondence between the lower layer protocol type and the upper layer protocol, that is, the correspondence between the data communication layer protocol and the second data encapsulation layer.
[0119] In order to unify the communication protocols between the various subsystems of the onboard system in the cabin-driver integration, the protocol stack is deployed for the communication framework of the local communication system. The following is the deployment method of the protocol stack:
[0120] S01: Determine the type of physical communication interface. According to the type of physical communication interface, the supported protocols can be determined. The protocol stack is deployed on the data communication layer of the local communication system to obtain the data communication layer protocol. The data communication layer protocol refers to the protocol deployed at the data communication layer. When the data communication layer includes the data link layer and the physical layer, the deployed protocols are consistent.
[0121] S03: According to the data communication layer protocol, by searching the corresponding relationship in the preset protocol stack deployment strategy, the corresponding second data communication layer protocol is determined, and the corresponding second data communication layer protocol is deployed in the second data encapsulation layer, which is called the second communication protocol.
[0122] In an optional embodiment, the second communication protocol includes at least one of an inter-chip communication protocol and a TCP / IP protocol; in the above step S03, the above-mentioned data communication layer protocol is based on a preset protocol stack deployment strategy, and the second data encapsulation layer of the local communication system is deployed with a protocol stack to obtain the second communication protocol, including:
[0123] 1. When the data communication layer protocol includes any one of the USB protocol, the Ethernet protocol, and the inter-core communication protocol, based on the preset protocol stack deployment strategy, the protocol stack of the second data encapsulation layer of the local communication system is deployed as the TCP / IP protocol;
[0124] 2. When the data communication layer protocol includes any one of the SPI protocol, the UART protocol, and the inter-core communication protocol, based on the preset protocol stack deployment strategy, the protocol stack of the second data encapsulation layer of the local communication system is deployed as the inter-chip communication protocol;
[0125] 3. When the data communication layer protocol includes any one of the USB protocol and the Ethernet protocol, and includes any one of the SPI protocol, the UART protocol, and the inter-core communication protocol, based on the preset protocol stack deployment strategy, the protocol stack of the second data encapsulation layer of the local communication system is deployed as the TCP / IP protocol and the inter-chip communication protocol.
[0126] In an embodiment of the present application, the second data encapsulation layer is deployed as an inter-chip communication protocol or a TCP / IP protocol, or an inter-chip communication protocol and a TCP / IP protocol, according to the protocol stack deployment of the data communication layer. Specifically. The TCP / IP protocol is used as a lower layer protocol of the first communication protocol, and as an upper layer protocol of the USB protocol, the Ethernet protocol, and the inter-core communication protocol. The inter-chip communication protocol is a new communication protocol provided in an embodiment of the present application, which is used as a lower layer protocol of the first communication protocol, and as an upper layer protocol of the SPI protocol, the UART protocol, and the inter-core communication protocol. When the second data encapsulation layer is in the form of a network layer and a transport layer, the protocol stacks of the network layer and the transport layer are deployed based on the above strategy.
[0127] It should be noted that, in order to ensure data format consistency during communication protocol encapsulation and parsing, preferably, the second data encapsulation layer of all subsystems of the vehicle-mounted system is deployed with an inter-chip communication protocol or a TCP / IP protocol.
[0128] The embodiment of the present application deploys the protocol of the second data encapsulation layer according to a preset protocol stack deployment strategy, selects at least one of the inter-chip communication protocol and the TCP / IP protocol as the upper layer protocol of the data communication layer protocol, so that the business data is transmitted in the format of the inter-chip communication protocol or the TCP / IP protocol at the second data communication layer, thereby laying the foundation for realizing the unification of the communication protocol at the first data encapsulation layer.
[0129] S05: Deploy the protocol stack for the first data encapsulation layer of the local communication system as the first communication protocol, the first communication protocol being the upper layer protocol of the second communication protocol, i.e., the upper layer protocol of the inter-chip communication protocol and the TCP / IP protocol. When the first data encapsulation layer is in the form of a session layer, a presentation layer, and an application layer, the session layer, the presentation layer, and the application layer are all deployed as the first communication protocol.
[0130] It should be noted that the above protocol stack deployment process is described based on the local communication system. In fact, the local communication system is any subsystem in the vehicle system, that is, all subsystems in the vehicle system perform protocol stack deployment based on the above process.
[0131] The following table shows the protocol stack deployment status of each system obtained by deploying using the above-mentioned protocol stack deployment method provided in an embodiment of the present application.
[0132] Table 1 Protocol stack deployment of a vehicle system
[0133]
[0134]
[0135] In the above table, SOC LINUX core refers to the Linux operating system kernel running on the system-level chip (System on Chip, referred to as SoC). SOC is a chip that integrates multiple functional modules, including CPU, GPU, ISP (Image Signal Processor), DSP (Digital Signal Processor), baseband chip, Bluetooth chip, Wi-Fi chip and GPS chip. SOC Android core refers to the Android operating system kernel running on the system-level chip. SOC R core is the real-time processor core (Real-time Core) running on the system-level chip.
[0136] As can be seen from the above table, various protocol stacks are implemented on each processor as the underlying support for business data transmission. The business data transmission protocols corresponding to the application layer, presentation layer and session layer are deployed on each operating system. In other words, in the entire system, all business data are transmitted in a unified format. The inter-chip communication protocol or TCP / IP protocol corresponding to the transport layer and network layer is also deployed in each operating system. The inter-chip communication protocol is used as the upper layer protocol of the SPI protocol, UART protocol, and inter-core communication protocol, and the TCP / IP protocol is used as the upper layer protocol of the USB protocol, Ethernet protocol and inter-core communication protocol. The deployment of the USB protocol, SPI protocol, UART protocol, inter-core communication protocol and Ethernet protocol corresponding to the data link layer and physical layer on each operating system is different, which is determined by their respective physical communication interfaces.
[0137] It should be noted that the above table is only an exemplary description of the above deployment method. In the actual application of the method disclosed in the embodiment of the present application, the deployment of the underlying protocol may be different from the above table.
[0138] The embodiment of the present application uses the above-mentioned protocol stack deployment process to enable all business data in the entire vehicle system to be transmitted in a unified format, thereby providing a unified communication protocol and interface, simplifying the interaction and communication between different systems, reducing the development cost and maintenance difficulty of the vehicle system, and allowing business interactors to only care about business logic without having to care about underlying channels and sources, making hardware design more flexible, business logic easier to maintain and upgrade, and messages can flow freely between various subsystems of the vehicle system.
[0139] As an optional implementation, the transmission unit of the first communication protocol is a frame; in the embodiment of the present application, the first communication protocol, i.e., the service data transmission protocol, defines the representation of service data in the entire fusion domain controller, and the minimum transmission unit of the first communication protocol, i.e., the service data transmission protocol, is a frame. The format of the frame is shown in Table 2:
[0140] Table 2 Frame format
[0141] Frame ID Data length Routing ID Reserved Field 1 Reserved Field 2 data 4 bytes 1 byte 1 byte 1 byte 1 byte
[0142] A frame consists of a frame ID, data length, routing ID, reserved field, reserved field 2, and data. The following is a detailed description of the frame format:
[0143] Frame ID: The frame identifier, used to identify the frame, such as vehicle speed data, temperature data, alarm signal, etc.
[0144] Data length: The length of the data part, used to record the length of specific data.
[0145] Routing ID: Marks the destination of the frame.
[0146] Data: The specific data content is determined according to the content or requirements to be transmitted.
[0147] Reserved field 1 and reserved field 2: To ensure protocol compatibility and future extensibility, they can also be used to identify the type of frame, such as data frame, remote frame request, or error frame.
[0148] In the above step S10, if Figure 5 As shown, the above-mentioned obtaining the first communication data and encapsulating the first communication data based on the first communication protocol deployed in the first data encapsulation layer of the local communication system to obtain the first communication protocol data includes:
[0149] S11: Acquire first communication data, and determine the data length and application scenario of the first communication data.
[0150] In the embodiment of the present application, after the local communication system obtains the first communication data, the data length and application scenario of the first communication data are first determined, because in actual application, the frame needs to be further transmitted downward, and the second communication protocol, that is, the inter-chip communication protocol or the TCP / IP protocol is used to encapsulate the frame. Therefore, the overall length of the frame must be less than the data length of the minimum transmission unit of the second communication protocol. When the data length of the first communication data is greater than the data length of the minimum transmission unit of the second communication protocol, the first communication data is divided into multiple segments for transmission.
[0151] The routing ID and the frame ID of the frame are determined according to the application scenario of the frame; and the data of the frame and the data length of the frame are determined according to the data length of the first communication data.
[0152] S12: Based on the first communication protocol deployed in the first data encapsulation layer of the local communication system, data encapsulation is performed on the application scenario and the data length to obtain a data frame.
[0153] S13: Determine the data frame as first communication protocol data.
[0154] In the embodiment of the present application, after determining the application scenario and data length of the first communication data, the application scenario and data length can be processed based on the first communication protocol to determine the number of frames and the specific data of each frame: frame ID, that is, the function of the frame, represented by 4 bytes; data length, that is, the length information of the specific content of the current frame, represented by 1 byte; routing ID, that is, the destination of the current frame, represented by 1 byte; and specific data, the number of bytes is determined according to the actual data, but shall not be greater than the length of the data segment in the minimum transmission unit of the second communication protocol. Through the above process, the first communication data can be encapsulated into a data frame, and the data frame is the first communication protocol data.
[0155] The embodiment of the present application processes the first communication data and encapsulates it into a data frame that complies with the transmission format of the first communication protocol, thereby achieving message encapsulation of a unified communication mechanism and laying a foundation for simplifying interaction and communication between different systems.
[0156] As an optional implementation, the second communication protocol includes at least one of an inter-chip communication protocol and a TCP / IP protocol; the transmission unit of the second communication protocol is a packet;
[0157] In the embodiment of the present application, the transmission unit of the second communication protocol is a packet. When the second communication protocol is an inter-chip communication protocol, the total length of the packet is 512 bytes. The specific form of the packet is shown in Table 3:
[0158] Table 3 Inter-chip communication protocol packet format
[0159]
[0160]
[0161] The packet of the inter-chip communication protocol consists of a packet header, packet length, packet type, reserved, send sequence number, response sequence number, data, CRC checksum and other padding fields. The following is a specific description of the format of the packet of the inter-chip communication protocol:
[0162] Packet header: It is fixed to 0x0A, where 0x indicates that this is a hexadecimal number and 0A indicates 10 in decimal.
[0163] Packet length: the total number of bytes from the header to the CRC check code (excluding the CRC check code). Since the data length is not fixed, the packet length is not fixed, but is limited by the total length of the packet.
[0164] Package type: as shown in Table 4;
[0165] Table 4 Package Type
[0166] Identification code Type Name Data segment Send sequence number Response number 0 Reliable Package Business data efficient invalid 1 Response Packet null invalid efficient 2 Unreliable Package Business data invalid invalid 3 Handshake Packet null efficient invalid 4 Connection Keepalive Packet null invalid invalid
[0167] The following is the relationship between the packet type and other fields, as well as related explanations.
[0168] Reliable packets: These packets transmit business data that requires reliability. The next packet can only be sent after receiving a response to each packet.
[0169] Acknowledgement packet: This type of packet serves as an acknowledgement signal for a reliable packet, and is used by the receiving end to inform the sending end that the corresponding reliable packet has been received.
[0170] Unreliable packets: These packets transmit data that does not have strict reliability requirements and do not require a response from the receiving end.
[0171] Handshake packet: This type of packet is used to establish a data channel from the sender to the receiver, and synchronize the sender's sending sequence number with the receiver's response sequence number. Reliable packets can only be transmitted after the data channel is established.
[0172] Connection maintenance packets: These packets are used by the sender to notify the receiver of the connection status after a reliable packet transmission channel is established. If these packets stop being sent, it means that the sender's connection status is disconnected. At this time, the receiver should also switch the connection status to disconnected to prepare for reestablishing the connection.
[0173] Sending sequence number: 0 to 7 are sent in a loop. The receiving end needs to determine whether this sequence number is correct, and discard it if it is incorrect.
[0174] Response sequence number: 0 to 7 are sent in a loop. The receiving end needs to determine whether this sequence number is correct, and discard it if it is incorrect.
[0175] Sending sequence number and reply sequence number: These two sequence numbers are used to ensure the order and integrity of the data. The receiving end needs to determine the correctness and order of the data based on these sequence numbers.
[0176] CRC checksum (cyclic redundancy check): The CRC value of all bytes from the packet header to the CRC checksum. It is used to detect whether errors occur during data transmission. If the CRC check fails, the receiving end will discard the packet.
[0177] Padding field: If the total number of bytes from the packet header to the CRC check code (including the CRC check code) is less than 512 bytes, then 0 needs to be filled from the first byte after the CRC check code to the end of the packet.
[0178] Therefore, the inter-chip communication protocol can define two data transmission modes: reliable and unreliable. Reliable data transmission mode requires a response when sending data, which can ensure that the other party receives the data, but occupies a large bandwidth and has a low rate. It is mostly used to transmit event-type data; unreliable data transmission mode does not require a response when sending data, and cannot guarantee that the other party receives the data, but occupies a small bandwidth and has a high rate. It is mostly used to transmit data that needs to be sent periodically.
[0179] Reliable data transmission refers to the use of various mechanisms to ensure that data can be accurately transmitted from the sender to the receiver during the data communication process. Reliable transmission also involves the confirmation and retransmission mechanism of data packets. If the receiver does not receive the data packet or the received data packet has errors, it can request the sender to resend the data packet. That is, the above-mentioned reliable packets, handshake packets, connection maintenance packets and response packets are required in the transmission process.
[0180] Unreliable data transmission means that during the data communication process, there is no guarantee that the data can be accurately transmitted from the sender to the receiver. This transmission method usually does not include error detection and correction mechanisms, or even if these mechanisms are available, the data packets will not be actively retransmitted. Unreliable transmission does not guarantee the order of data packets, the integrity of data packets, or the arrival of data packets. The advantage of unreliable transmission is low transmission delay, which is suitable for application scenarios that have high real-time requirements but can tolerate a certain amount of data loss, such as video streaming, online games, etc. That is, the above unreliable packets are used for transmission.
[0181] In the embodiment of the present application, the transmission unit of the second communication protocol is a packet. When the second communication protocol is the TCP / IP protocol, it also has two data transmission modes: reliable transmission and unreliable transmission. When the data transmission type is reliable, the TCP protocol is used for transmission, and the transmission unit is also a packet. In order to distinguish it from the packet of the inter-chip communication protocol, it is named TCP packet here. The format of the TCP packet is shown in Table 5.
[0182] Table 5 TCP packet format
[0183]
[0184] Total: The minimum length of the TCP header is 20 bytes (without options and padding), and the maximum length is 60 bytes (including all options and necessary padding). The TCP header refers to the source port number to the urgent pointer.
[0185] It should be noted that the actual size of a TCP packet depends on the length of the header and the length of the data. The length of the option field is variable, so the length of the entire TCP header will also vary.
[0186] When the data transmission type is unreliable, the UDP protocol (User Datagram Protocol) can be used for transmission. The transmission unit is also a packet. In order to distinguish it from the packet of the inter-chip communication protocol, it is named UDP packet here. The format of the UDP packet is shown in Table 6.
[0187] Table 6 UDP packet format
[0188]
[0189]
[0190] It should be noted that the fixed length of the UDP header is 8 bytes, and the total length of the UDP data with variable length is not limited.
[0191] The above UDP protocol can also be replaced by IP protocol. When using IP protocol,
[0192] In the above step S30, the above second communication protocol based on the second data encapsulation layer deployed in the local communication system encapsulates the first communication protocol data in a transmission type to obtain the second communication protocol data, including:
[0193] S31: Determine a data transmission mode of the first communication protocol data;
[0194] S32: Based on the second communication protocol deployed in the second data encapsulation layer of the local communication system and the data transmission mode, the data frame is encapsulated into a transmission type to obtain a data packet, and the data packet is determined as second communication protocol data.
[0195] In the embodiment of the present application, before the first communication protocol is encapsulated, the data transmission mode is first determined, and the specific protocol of the deployed second communication protocol is determined. Based on the second communication protocol, the data frame is encapsulated to obtain a data packet, and the data packet is determined as the second communication protocol data. When the length of the data frame exceeds the data length that can be accommodated by the data packet, the above data frame is encapsulated into multiple data packets for transmission.
[0196] And in the process of encapsulating frames into packets, the number of frames contained in each packet also needs to be determined according to the application scenario of the frame. Or when the data length of the first communication data is less than the data length of the minimum transmission unit of the second communication protocol, it is necessary to further determine the transmission method according to the application scenario, and then determine the encapsulation method. Specifically, a single frame can be encapsulated into the second communication protocol data, or multiple frames can be encapsulated end to end into the second communication data. Specifically, the encapsulation method is selected according to the application scenario. For application scenarios with a small number, a single frame is selected to be encapsulated into the second communication protocol data. For scenarios with a large amount of data, a single frame is selected to be encapsulated into the second communication protocol data. The transmission efficiency is relatively high.
[0197] The embodiment of the present application determines the data transmission type, re-encapsulates the data frame, and defines the difference between the packets of reliable data and unreliable data, thereby ensuring the transmission of different data types, which is beneficial to simplify the interaction and communication between different systems, reduces the development cost and maintenance difficulty of the vehicle-mounted system, and realizes the management of data transmission.
[0198] As an optional implementation, when the second communication protocol includes an inter-chip communication protocol, in the above step S33, the second communication protocol based on the second data encapsulation layer deployed in the local communication system, and the data transmission mode, perform transmission type encapsulation on the data frame to obtain a data packet, and determine the data packet as the second communication protocol data, including:
[0199] S331: When the data transmission mode of the first communication protocol data is reliable, based on the inter-chip communication protocol and reliability, the data frame is encapsulated for reliable transmission to obtain a handshake packet, a connection maintenance packet and a reliable packet, and the handshake packet, the connection maintenance packet and the reliable packet are determined as the second communication protocol data.
[0200] In the embodiment of the present application, when the second communication protocol is deployed as an inter-chip communication protocol and the data transmission type is reliable, the data frame is encapsulated into a handshake packet, a connection maintenance packet and a reliable packet, and the handshake packet, the connection maintenance packet and the reliable packet are determined as the second communication protocol data. The handshake packet and the connection maintenance packet do not contain data frames, that is, the data segment is empty, and other fields are filled according to Table 4 in the format of the above packet; the data frame is placed in the data field of the data packet, and the packet header, packet length, etc. are added for encapsulation to obtain a reliable packet.
[0201] As an optional implementation, in the above step S50, if Figure 6 As shown, the above-mentioned second communication protocol data is transmitted to the data communication layer of the target communication system through the data communication layer of the local communication system, so that the second communication protocol deployed in the second data encapsulation layer of the target communication system decapsulates the second communication protocol data to obtain the first format data consistent with the first communication protocol data, including:
[0202] S501: Transmitting a handshake packet to a data communication layer of a target communication system through a data communication layer of a local communication system, so that the second data encapsulation layer of the target communication system receives the packet, thereby establishing a data channel for reliable packet transmission.
[0203] In the embodiment of the present application, during the transmission of a reliable packet, the handshake packet is first transmitted from the second data encapsulation layer of the local communication system to the physical communication layer of the local communication system, and then from the physical communication layer of the local communication system to the data communication layer of the target communication system, so that the second data encapsulation layer of the target communication system receives it, and the sending sequence numbers 0 to 7 in the handshake packet are sent cyclically, and the sending sequence number of the local communication system is synchronized with the response sequence number of the target communication system. The reliable packet can be transmitted only after the data channel is established. If the sending sequence number of the local communication system is not synchronized with the response sequence number of the target communication system, it is discarded and continues to be sent until synchronization is achieved.
[0204] S502: Transmit the connection maintenance packet to the data communication layer of the target communication system through the data channel.
[0205] S503: Upon receiving feedback from the target communication system indicating successful connection, the reliable packet is sent through the data channel to the second data encapsulation layer of the target communication system, so that the target communication system decapsulates the reliable packet based on the inter-chip communication protocol to obtain data in the first format; and the target communication system returns a response packet.
[0206] In the embodiment of the present application, after the reliable packet transmission channel is established, the sender notifies the target communication system of the connection status. If such packets stop being sent, it means that the sender's connection status is disconnected, and the receiver should also switch the connection status to disconnected to prepare for re-establishing the connection. The sender is the local communication system.
[0207] By using a reliable packet transmission channel, that is, a data channel to transmit reliable packets, it is possible to transmit the second data encapsulation layer from the local communication system to the second data encapsulation layer of the target communication system. The second encapsulation layer decapsulates the reliable packet based on the inter-chip communication protocol deployed by it to obtain the first format data consistent with the second communication protocol.
[0208] S504: Receive a response packet fed back by the target communication system, and repeatedly send the reliable packet through the data channel to the second data encapsulation layer of the target communication system, so that the target communication system decapsulates the reliable packet based on the inter-chip communication protocol to obtain the first format data, until all reliable packets are transmitted to the second data encapsulation layer of the target communication system.
[0209] In the embodiment of the present application, after a reliable packet is sent, the corresponding response packet must be received before the next reliable packet can be sent, i.e., the process of S503 is repeated. If the corresponding response packet is not received, it is a sending error, and the above S501-504 are repeated to retransmit data.
[0210] After receiving the reliable packet, the target communication system detects whether there is any error in the data transmission process based on the CRC check code. If the CRC check fails, the receiving end will discard the packet.
[0211] The above situation is for the case where the second data encapsulation layer of the local communication system and the target communication system both deploy the inter-chip communication protocol.
[0212] When the second data encapsulation layer of the local communication system deploys the inter-chip communication protocol and the TCP / IP protocol, but the second data encapsulation layer of the target communication system deploys only the TCP / IP protocol, data transmission is preferably performed through the TCP / IP protocol.
[0213] During the data transmission process, the target communication device pulls up the IO port (i.e., input / output interface) at a preset time interval to notify the local communication system to transmit data. After the local communication system detects that the IO port is at a high level, it drives the hardware to output the SPI waveform. The communication adopts full-duplex mode. When there is a clock signal on the bus, the local communication system and the target communication device are sending and receiving data at the same time. Specifically, the preset time interval refers to the time interval between adjacent reliable packet transmissions. Pulling up the IO port means setting the level of the IO (input / output) pin to a high level state. Full-duplex (FD) is a communication mode that allows data to be transmitted in both directions at the same time, that is, both parties in communication can send and receive information at the same time. The bus is a physical or logical channel that connects multiple devices and allows data to be transmitted between them. Here, the bus specifically refers to a physical or logical channel that supports full-duplex communication. The SPI waveform shows the timing and signal changes during the communication process. Clock signal (SCK): determines the baud rate of communication. The clock signal line is output by the local communication system and input by the target communication device. Therefore, the method provided in the embodiment of the present application can realize two-way data transmission, that is, from the local communication system to the target communication system, and from the target communication system to the local communication system.
[0214] The embodiment of the present application first sends a handshake packet to establish a data connection channel between the local communication system and the target communication system, and then sends a connection maintenance packet to determine that the local communication system and the target communication system are in a connected state, and then sends a reliable packet, and only after receiving the response packet of the target communication system will the next reliable packet be sent. Through the above method, reliable data transmission is achieved, ensuring that important data is accurately and completely sent to the target communication system, which is conducive to ensuring the stability of data transmission after the unified communication protocol. And the interaction process can be completed without caring about the underlying path.
[0215] As an optional implementation, when the second communication protocol includes an inter-chip communication protocol, in the above step S33, the second communication protocol based on the second data encapsulation layer deployed in the local communication system, and the data transmission mode, perform transmission type encapsulation on the data frame to obtain a data packet, and determine the data packet as the second communication protocol data, including:
[0216] S3301: When the data transmission mode of the first communication protocol data is unreliable, based on the inter-chip communication protocol and unreliable type, the data frame is encapsulated in an unreliable transmission mode to obtain an unreliable packet, and the unreliable packet is determined as the second communication protocol data.
[0217] In an embodiment of the present application, when the data transmission mode of the first communication protocol data is unreliable, the data frame is directly encapsulated into an unreliable packet, as the data field of the unreliable packet, a packet header and other field information are added to obtain an unreliable packet, and the unreliable packet is used as the second communication protocol data. If the number of bytes of the data frame is greater than the number of bytes that can be accommodated in the data segment in the data packet, the data frame is encapsulated into multiple unreliable packets, and the multiple unreliable packets are determined as the second communication protocol data.
[0218] During the transmission of unreliable packets, there is no need to send a send sequence number and receive a response sequence number.
[0219] In the above step S50, the above-mentioned transmitting the second communication protocol data to the data communication layer of the target communication system through the data communication layer of the local communication system, so that the second communication protocol deployed in the second data encapsulation layer of the target communication system decapsulates the second communication protocol data to obtain the first format data consistent with the first communication protocol data, including:
[0220] S5001: Transmit an unreliable packet to a data communication layer of a target communication system through a data communication layer of a local communication system, so that an inter-chip communication protocol deployed at a second data encapsulation layer of the target communication system decapsulates the unreliable packet to obtain data in a first format.
[0221] In the embodiment of the present application, the unreliable data can be directly transmitted from the second data encapsulation layer of the local communication system to the data communication layer of the local communication system, and then transmitted to the data communication layer of the target communication system through the data communication layer of the local communication system, so that the inter-chip communication protocol deployed in the second data encapsulation layer of the target communication system can decapsulate the unreliable packet to obtain the first format data. Because the unreliable packet is transmitted without strict reliability requirements, the receiving end does not need to respond, so the transmission process of the unreliable packet can be continued until all data transmission is completed.
[0222] The unreliable packets in the embodiments of the present application are sent directly after encapsulation, which ensures that data transmission does not need to care about the underlying path, so that the interaction between application developers and other systems is completed just like in the local system.
[0223] As an optional implementation, the method further includes:
[0224] When the communication channel corresponding to the data transmission layer of the local communication system is updated, the protocol stack of the data communication layer of the local communication system is dynamically adjusted by plug-in management, so that the protocol stack of the data communication layer of the local communication system can be dynamically updated.
[0225] In the embodiments of the present application, the communication channel is a path for data transmission. In computer networks, channels are divided into physical channels and logical channels. A physical channel refers to a physical path for transmitting data signals, which is composed of a transmission medium and related communication equipment; a logical channel refers to a logical path realized by both parties sending and receiving data signals through an intermediate node on the basis of a physical channel, thereby forming a logical path for transmitting data signals. Channel update in the embodiments of the present application refers to updating any channel in a physical channel or a logical channel.
[0226] In order to achieve the scalability of communication, a plug-in extension method is adopted to manage the communication link layer. Specifically, a plug-in standardized interface is deployed in the data transmission layer. When the communication channel of the local communication system changes or a new communication channel is connected, the deployed plug-in standardized interface can be identified, and then the protocol stack of the data link layer is updated through the plug-in adaptation layer to make the protocol stack of the data communication layer of the local communication system consistent with the communication channel.
[0227] Specifically, the plug-in standardized interface and the plug-in adaptation layer are deployed at the data link layer to achieve dynamic update of the data link layer. The plug-in standardized interface allows different network plug-ins to work in a consistent manner in the container management system.
[0228] Optionally, the plug-in standardized interface can be such as the VirtIO standard (an I / O paravirtualization solution), which provides a common framework and standard interface to reduce the workload of the hypervisor (paravirtualization) to adapt and develop different underlying hardware and upper-layer software. At the data link layer of the local communication system, such a standardized interface enables different network plug-ins to interact with the target communication system in a consistent manner, thereby simplifying development and maintenance. The deployment of such an interface usually involves integrating standardized APIs (Application Programming Interfaces) and protocols into the software architecture of the vehicle system to ensure compatibility and communication between different components. By using the above-mentioned plug-in standardized interface, the local communication system can be independent of specific hardware or software plug-ins, increasing the flexibility and scalability of the system. The adaptation layer further enhances the decoupling effect because it allows compatibility between old plug-ins and new interfaces or between new plug-ins and old interfaces without modifying the main system or the plug-in itself.
[0229] Optionally, the plug-in adaptation layer is responsible for implementing interface mapping and parameter conversion between different plug-ins. In the vehicle-mounted system, the adaptation layer may need to process data from different sensors and convert it into a format that can be understood by the local communication system, or convert the instructions of the local communication system into control signals for the target communication system. The deployment of the adaptation layer involves integrating adaptation logic in the system software to ensure that the old system can use the new plug-in, or that the new system is compatible with the old plug-in. The plug-in adaptation layer ensures that the existing data link configuration can still work properly even when the local communication system is upgraded or the hardware is replaced. The existence of this plug-in adaptation layer makes it possible to smoothly transition from the old version to the new version. Therefore, the layered communication system provided in the embodiment of the present application supports the injection and configuration of business messages, and is dynamically adjusted according to actual needs.
[0230] There is a clear upper and lower layer relationship, encapsulation relationship, and management relationship between the above plug-in standardized interface and the plug-in adaptation layer:
[0231] Specifically, plug-in standardized interfaces, such as CNI (Container Network Interface), are usually located in the lower layer. They define a set of standards so that different network plug-ins can interact with the local communication system in a consistent manner. The plug-in adaptation layer is located in the upper layer. It is responsible for implementing interface mapping and parameter conversion between different plug-ins, ensuring that the upper-layer application can seamlessly connect with the lower-layer standardized interface. The plug-in standardized interface provides an encapsulated interface that hides the details of the underlying implementation, so that developers do not need to care about the specific implementation and only need to develop according to the standard interface. The plug-in adaptation layer encapsulates the differences between different plug-ins and provides a unified calling method to the outside world, so that the upper-layer (i.e., the second data encapsulation layer) application can transparently use different plug-ins without having to write specific code for each plug-in. The plug-in standardized interface allows the local communication system to manage network plug-ins in a unified and standardized manner, such as by defining the format of network configuration, request protocol, etc. The plug-in adaptation layer is responsible for managing the interaction between different plug-ins, including the loading, execution and unloading of plug-ins, ensuring that the plug-ins can work correctly with the local communication system.
[0232] In an embodiment of the present application, a method for deploying a plug-in standardized interface and a plug-in adaptation layer is also provided:
[0233] First, deploy standardized plug-in interfaces at the data communication layer of the local communication system or at the data link layer to ensure that the system has a unified interface standard.
[0234] Then, the plug-in adaptation layer is deployed to ensure that different plug-ins can interact with the system according to this standard.
[0235] In an embodiment of the present application, when network configuration or data transmission is required, the local communication system will call the corresponding plug-in standardized interface through the plug-in adaptation layer to complete the specific task. Maintenance personnel can update the plug-in adaptation layer to be compatible with new plug-ins without modifying the standardized interface, which can reduce the maintenance cost and complexity of the system.
[0236] Optionally, the plug-in standardized interface can adopt CAN bus and LIN bus, AUTOSAR specification, SOA (Service-Oriented Architecture), Web Services (network-based modular components), RESTful API (representational state transfer), Message-Bus and Enterprise ServiceBus (ESB), etc.
[0237] The embodiment of the present application provides a plug-in expansion method, so that different communication channels and systems can be expanded through plug-in access, and supports the injection and configuration of business messages, and dynamic adjustment according to actual needs. Not only does it provide a unified interface and usage method, but business interactors only need to care about business logic, not underlying channels and sources; it can also be flexibly deployed. For the participation of more systems, the system only needs to meet the protocol for access to achieve interconnection.
[0238] On the other hand, Figure 7 As shown, the embodiment of the present application also provides an extensible unified communication framework supporting multiple communication channels, and the communication framework includes:
[0239] Hardware link, the hardware link is at the bottom layer of the communication framework. Each hardware link (SPI, UART, USB, shared memory, Ethernet) has its own specific driver and hardware support. These drivers implement the interaction between the hardware link and the upper-layer software. The driver is responsible for handling the specific details of the hardware, such as the conversion of electrical signals, encoding and decoding of data, etc., while the upper-layer software focuses on logic and protocol processing. The hardware link corresponds to the physical layer in the OSI model.
[0240] Plug-in management, as the upper-level management of hardware links, is built on the data link layer, including the plug-in adaptation layer and the plug-in standardized interface. The plug-in standardized interface is used to implement the access of different hardware links, so that different plug-ins can interact with the system in a unified way, simplifying the plug-in development and integration process. The plug-in adaptation layer is used by developers to use native code to implement the access of different communication channels, that is, the access of different hardware links; it can also involve configuring and customizing the behavior of plug-ins to meet the needs of different users or scenarios. Plug-in management is used to load, unload and manage plug-ins to ensure that plug-ins can be correctly integrated into the system.
[0241] Communication management, as the upper layer of plug-in management, has functions including unified communication protocol, communication channel management, data distribution, data reception, data transmission and link connection. Specifically, taking the OSI model as an example, the unified communication protocol refers to deploying the protocol stacks of the application layer, presentation layer and session layer as business data transmission protocols, deploying the protocol stacks of the transport layer and network layer as inter-chip communication protocols or TCP / IP protocols, the inter-chip communication protocol as the upper layer protocol of the SPI protocol, UART protocol and inter-core communication protocol, and the TCP / IP protocol as the upper layer protocol of the USB protocol, Ethernet protocol and inter-core communication protocol. The deployment of the USB protocol, SPI protocol, UART protocol, inter-core communication protocol and Ethernet protocol corresponding to the data link layer and the physical layer on each operating system is different, which is determined by their respective physical communication interfaces. Communication channel management refers to the use of plug-in management to manage the communication channel, so that there is no need to care about the underlying channel, the change of hardware will only affect the underlying driver, and the framework code can be reused. The data distribution and data reception components are responsible for forwarding and collecting data, and they transmit data according to the path information provided by the communication channel management. Data transmission refers to the process of the above process S10-S50, which uses a unified communication protocol for data transmission and interaction. The link link is responsible for maintaining the state of the communication link to ensure the stability and reliability of the link.
[0242] The unified communication interface provides a standardized entry for communication management, allowing communication management to operate independently of specific communication protocols and hardware links.
[0243] It should be noted that the cross-system communication method provided in the embodiment of the present application can be performed in any two subsystems of the vehicle-mounted system that have communication or data transmission capabilities. If the terms master device, master system, etc. appear, they are equivalent to the local communication system, that is, the system that is currently transmitting data; if the terms slave device, etc. appear, they are equivalent to the target communication system, that is, the system that is currently receiving data. However, since the systems can interact with each other and transmit data, the target communication system and the local communication system can be converted to each other.
[0244] The embodiment of the present application applies the above communication framework to various subsystems of the vehicle-mounted system, and has the following
[0245] Beneficial effects:
[0246] 1. Provide plug-in expansion mode. Different communication channels and systems can be expanded through plug-in access. It can support SPI, Ethernet, USB, UART communication modes, and support other modes such as expansion of shared memory; support injection and configuration of business messages, and make dynamic adjustments according to actual needs; it can be flexibly deployed. For the participation of more systems, the system only needs to meet the protocol for access to achieve interconnection.
[0247] 2. Provide a unified interface and usage method to the upper level, so that business interactors only need to care about business logic and do not need to care about the underlying channels and sources.
[0248] 3. The business data on each operating system is packaged in a unified format. The unified format corresponds to a simple and efficient protocol that is easy to implement and understand. The protocol layered structure of each operating system is consistent, and the protocol stack can be deployed according to different underlying communication methods.
[0249] 4. The interaction protocol is unified, the code is easier to maintain and port, and there is no need to worry about the underlying path. Hardware changes will only affect the underlying driver, and the framework code can be reused.
[0250] On the other hand, Figure 8 As shown, the embodiment of the present application also provides a cross-system communication device, the device comprising:
[0251] A first data encapsulation and transmission module 101 is used to obtain first communication data, and based on a first communication protocol deployed in a first data encapsulation layer of a local communication system, encapsulate the first communication data to obtain first communication protocol data, and transmit the first communication protocol data to a second data encapsulation layer of the local communication system;
[0252] A second data encapsulation and transmission module 103 is used to encapsulate the first communication protocol data into a transmission type based on a second communication protocol deployed in a second data encapsulation layer of the local communication system to obtain second communication protocol data, and transmit the second communication protocol data to a data communication layer of the local communication system; the second communication protocol is a lower layer protocol of the first communication protocol;
[0253] The data transmission module 105 is used to transmit the second communication protocol data to the data communication layer of the target communication system through the data communication layer of the local communication system, so that the second communication protocol deployed at the second data encapsulation layer of the target communication system decapsulates the second communication protocol data to obtain first format data consistent with the first communication protocol data; and so that the first communication protocol deployed at the first data encapsulation layer of the target communication system decapsulates the first format data to obtain second communication data consistent with the first communication data.
[0254] Furthermore, the inter-system communication device further includes:
[0255] A data communication layer protocol stack deployment module is used to determine the type of physical communication interface, and based on the type of physical communication interface, perform protocol stack deployment on the data communication layer of the local communication system to obtain a data communication layer protocol;
[0256] A second data encapsulation layer protocol stack deployment module is used to deploy a protocol stack on the second data encapsulation layer of the local communication system according to the data communication layer protocol and based on a preset protocol stack deployment strategy to obtain a second communication protocol; the second communication protocol is an upper layer protocol of the data communication layer protocol;
[0257] The first data encapsulation layer protocol stack deployment module is used to deploy the first communication protocol on the first data encapsulation layer of the local communication system; the first communication protocol is an upper layer protocol of the second communication protocol.
[0258] Furthermore, the second data encapsulation layer protocol stack deployment module includes:
[0259] A TCP / IP protocol deployment unit, configured to deploy the protocol stack of the second data encapsulation layer of the local communication system as the TCP / IP protocol based on a preset protocol stack deployment strategy when the data communication layer protocol includes any one of the USB protocol, the Ethernet protocol, and the inter-core communication protocol;
[0260] An inter-chip communication protocol deployment unit, configured to deploy the protocol stack of the second data encapsulation layer of the local communication system as the inter-chip communication protocol based on a preset protocol stack deployment strategy when the data communication layer protocol includes any one of the SPI protocol, the UART protocol, and the inter-core communication protocol;
[0261] The TCP / IP protocol and inter-chip communication protocol deployment unit is used to deploy the protocol stack of the second data encapsulation layer of the local communication system as the TCP / IP protocol and the inter-chip communication protocol based on the preset protocol stack deployment strategy when the data communication layer protocol includes any one of the USB protocol and the Ethernet protocol, and includes any one of the SPI protocol, the UART protocol, and the inter-core communication protocol.
[0262] Furthermore, the first data encapsulation and transmission module includes:
[0263] A first determining unit, configured to obtain first communication data and determine a data length and an application scenario of the first communication data;
[0264] A data encapsulation unit, configured to encapsulate the application scenario and the data length based on a first communication protocol deployed in a first data encapsulation layer of a local communication system to obtain a data frame;
[0265] The second determining unit is used to determine the data frame as first communication protocol data.
[0266] Furthermore, the second data encapsulation and transmission module includes:
[0267] A data transmission mode determining unit, used to determine a data transmission mode of the first communication protocol data;
[0268] The transmission type encapsulation unit is used to perform transmission type encapsulation on the data frame based on the second communication protocol deployed in the second data encapsulation layer of the local communication system and the data transmission mode to obtain a data packet and determine the data packet as second communication protocol data.
[0269] Furthermore, the transmission type encapsulation unit includes:
[0270] A reliable packet encapsulation unit is used to perform reliable transmission encapsulation on the data frame based on the inter-chip communication protocol and reliability when the data transmission mode of the first communication protocol data is reliable, to obtain a handshake packet, a connection maintenance packet and a reliable packet, and to determine the handshake packet, the connection maintenance packet and the reliable packet as the second communication protocol data.
[0271] Furthermore, the data transmission module includes:
[0272] A handshake packet transmission unit, used to transmit the handshake packet to the data communication layer of the target communication system through the data communication layer of the local communication system, so that the second data encapsulation layer of the target communication system receives it, thereby establishing a data channel for reliable packet transmission;
[0273] A connection maintenance packet transmission unit, used for transmitting the connection maintenance packet to the data communication layer of the target communication system through the data channel;
[0274] A reliable packet transmission unit is used to send a reliable packet through a data channel to a second data encapsulation layer of a target communication system upon receiving feedback that a connection is successful from a target communication system, so that the target communication system decapsulates the reliable packet based on an inter-chip communication protocol to obtain data in a first format; and to enable the target communication system to return a response packet; and is also used to receive a response packet fed back by the target communication system, and to repeat the operation of sending the reliable packet through a data channel to the second data encapsulation layer of the target communication system, so that the target communication system decapsulates the reliable packet based on an inter-chip communication protocol to obtain data in the first format, until all reliable packets are transmitted to the second data encapsulation layer of the target communication system.
[0275] Furthermore, the transmission type encapsulation unit includes:
[0276] An unreliable packet encapsulation unit, configured to, when the data transmission mode of the first communication protocol data is unreliable, perform unreliable transmission encapsulation on the data frame based on the inter-chip communication protocol and the unreliable type to obtain an unreliable packet, and determine the unreliable packet as the second communication protocol data;
[0277] The data transmission module also includes:
[0278] The unreliable packet transmission unit is used to transmit the unreliable packet to the data communication layer of the target communication system through the data communication layer of the local communication system, so that the inter-chip communication protocol deployed in the second data encapsulation layer of the target communication system decapsulates the unreliable packet to obtain the first format data.
[0279] Furthermore, the inter-system communication device further includes:
[0280] The plug-in management module is used to dynamically adjust the protocol stack of the data communication layer of the local communication system by plug-in management when the communication channel corresponding to the data communication layer of the local communication system is updated, so that the protocol stack of the data communication layer of the local communication system can be dynamically updated.
[0281] It should be noted that the cross-system communication device embodiment provided in the embodiment of the present application and the above-mentioned cross-system communication method embodiment are based on the same inventive concept.
[0282] An embodiment of the present application also provides an electronic device for cross-system communication, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement a cross-system communication method provided in any of the above embodiments.
[0283] An embodiment of the present application also provides a computer-readable storage medium, which can be set in a terminal to store at least one instruction or at least one program for implementing a cross-system communication in a method embodiment, and the at least one instruction or at least one program is loaded and executed by a processor to implement the cross-system communication method provided in the above method embodiment.
[0284] Optionally, in the embodiment of this specification, the storage medium may be located in at least one of the multiple network servers of the computer network. Optionally, in this embodiment, the above storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.
[0285] The memory of the embodiment of this specification can be used to store software programs and modules, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, applications required for functions, etc.; the data storage area may store data created according to the use of the device, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. Accordingly, the memory may also include a memory controller to provide the processor with access to the memory.
[0286] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device performs the above method embodiment to provide a cross-system communication method.
[0287] The method embodiments provided in the embodiments of the present application can be executed in a terminal, a computer terminal, a server or a similar computing device. Taking running on a server as an example, Fig. 9 FIG. 1 is a hardware structure diagram of a server of a cross-system communication method provided according to an exemplary embodiment. Fig. 9As shown, the server 400 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 410 (the central processing unit 410 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 430 for storing data, and one or more storage media 420 (such as one or more mass storage devices) for storing application programs 423 or data 422. Among them, the memory 430 and the storage medium 420 can be short-term storage or permanent storage. The program stored in the storage medium 420 may include one or more modules, each of which may include a series of instruction operations on the server. Furthermore, the central processing unit 410 can be configured to communicate with the storage medium 420 and execute a series of instruction operations in the storage medium 420 on the server 400. The server 400 may also include one or more power supplies 460, one or more wired or wireless network interfaces 450, one or more input and output interfaces 440, and / or one or more operating systems 421, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0288] The input / output interface 440 may be used to receive or send data via a network. The specific example of the network may include a wireless network provided by a communication provider of the server 400. In one example, the input / output interface 440 includes a network adapter (Network Interface Controller, NIC), which may be connected to other network devices via a base station so as to communicate with the Internet. In one example, the input / output interface 440 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0289] It can be understood by those skilled in the art that Fig. 9 The structure shown is only for illustration and does not limit the structure of the above electronic device. Fig. 9 More or fewer components as shown, or with Fig. 9 Different configurations are shown.
[0290] It should be noted that the above-mentioned sequence of the embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. The above-mentioned specific embodiments of this specification are described. Other embodiments are within the scope of the attached claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0291] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and server embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0292] A person skilled in the art will appreciate that all or part of the steps for implementing the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk, or an optical disk, etc.
[0293] The above are only preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A cross-system communication method, characterized in that: The method comprises: Acquire first communication data, and based on a first communication protocol deployed in a first data encapsulation layer of a local communication system, encapsulate the first communication data to obtain first communication protocol data, and transmit the first communication protocol data to a second data encapsulation layer of the local communication system; Based on a second communication protocol deployed at a second data encapsulation layer of the local communication system, encapsulating the first communication protocol data into a transmission type to obtain second communication protocol data, and transmitting the second communication protocol data to a data communication layer of the local communication system; the second communication protocol is a lower layer protocol of the first communication protocol; The second communication protocol data is transmitted to the data communication layer of the target communication system through the data communication layer of the local communication system, so that the second communication protocol deployed at the second data encapsulation layer of the target communication system decapsulates the second communication protocol data to obtain first format data consistent with the first communication protocol data; and the first communication protocol deployed at the first data encapsulation layer of the target communication system decapsulates the first format data to obtain second communication data consistent with the first communication data.
2. The method according to claim 1, characterized in that Before acquiring the first communication data, the method further includes: Determine a physical communication interface type, and based on the physical communication interface type, perform protocol stack deployment on a data communication layer of the local communication system to obtain a data communication layer protocol; According to the data communication layer protocol, based on a preset protocol stack deployment strategy, a protocol stack is deployed on the second data encapsulation layer of the local communication system to obtain a second communication protocol; the second communication protocol is an upper layer protocol of the data communication layer protocol; A first communication protocol is deployed on the first data encapsulation layer of the local communication system; the first communication protocol is an upper layer protocol of the second communication protocol.
3. The method according to claim 2, characterized in that The second communication protocol includes at least one of an inter-chip communication protocol and a TCP / IP protocol; the second data encapsulation layer of the local communication system is deployed with a protocol stack based on the data communication layer protocol and a preset protocol stack deployment strategy to obtain the second communication protocol, including: When the data communication layer protocol includes any one of a USB protocol, an Ethernet protocol, and an inter-core communication protocol, based on the preset protocol stack deployment strategy, the protocol stack of the second data encapsulation layer of the local communication system is deployed as the TCP / IP protocol; When the data communication layer protocol includes any one of the SPI protocol, the UART protocol, and the inter-core communication protocol, based on the preset protocol stack deployment strategy, the protocol stack of the second data encapsulation layer of the local communication system is deployed as the inter-chip communication protocol; When the data communication layer protocol includes any one of the USB protocol and the Ethernet protocol, and includes any one of the SPI protocol, the UART protocol, and the inter-core communication protocol, based on the preset protocol stack deployment strategy, the protocol stack of the second data encapsulation layer of the local communication system is deployed as the TCP / IP protocol and the inter-chip communication protocol.
4. The method according to claim 1, characterized in that The transmission unit of the first communication protocol is a frame; the obtaining of the first communication data and encapsulating the first communication data based on the first communication protocol deployed in the first data encapsulation layer of the local communication system to obtain the first communication protocol data includes: Acquire the first communication data, and determine the data length and application scenario of the first communication data; Based on the first communication protocol deployed at the first data encapsulation layer of the local communication system, encapsulate the application scenario and the data length to obtain the data frame; The data frame is determined as the first communication protocol data.
5. The method according to claim 4, characterized in that The second communication protocol includes at least one of an inter-chip communication protocol and a TCP / IP protocol; the transmission unit of the second communication protocol is a packet; the second communication protocol based on the second data encapsulation layer deployed in the local communication system encapsulates the first communication protocol data into a transmission type to obtain the second communication protocol data, including: Determining a data transmission mode of the first communication protocol data; Based on the second communication protocol deployed in the second data encapsulation layer of the local communication system and the data transmission mode, the data frame is encapsulated into a transmission type to obtain the data packet, and the data packet is determined as the second communication protocol data.
6. The method according to claim 5, characterized in that In the case where the second communication protocol includes the inter-chip communication protocol, the second communication protocol based on the second data encapsulation layer deployed in the local communication system and the data transmission mode, performing transmission type encapsulation on the data frame to obtain the data packet, and determining the data packet as the second communication protocol data, comprises: When the data transmission mode of the first communication protocol data is reliable, based on the inter-chip communication protocol and the reliability, the data frame is encapsulated for reliable transmission to obtain a handshake packet, a connection maintenance packet and a reliable packet, and the handshake packet, the connection maintenance packet and the reliable packet are determined as the second communication protocol data.
7. The method according to claim 6, characterized in that The method of transmitting the second communication protocol data to the data communication layer of the target communication system through the data communication layer of the local communication system, so that the second communication protocol deployed at the second data encapsulation layer of the target communication system decapsulates the second communication protocol data to obtain first format data consistent with the first communication protocol data, includes: Transmitting the handshake packet to the data communication layer of the target communication system through the data communication layer of the local communication system, so that the second data encapsulation layer of the target communication system receives it, thereby establishing a data channel for the reliable packet transmission; Transmitting the connection maintenance packet to the data communication layer of the target communication system through the data channel; Upon receiving a feedback from the target communication system that the connection is successful, sending the reliable packet through the data channel to the second data encapsulation layer of the target communication system, so that the target communication system decapsulates the reliable packet based on the inter-chip communication protocol to obtain the first format data; and causing the target communication system to return a response packet; Receive a response packet fed back by the target communication system, and repeat the operation of sending the reliable packet through the data channel to the second data encapsulation layer of the target communication system, so that the target communication system decapsulates the reliable packet based on the inter-chip communication protocol to obtain the first format data, until all reliable packets are transmitted to the second data encapsulation layer of the target communication system.
8. The method according to claim 5, characterized in that In the case where the second communication protocol includes the inter-chip communication protocol, the second communication protocol based on the second data encapsulation layer deployed in the local communication system and the data transmission mode, performing transmission type encapsulation on the data frame to obtain the data packet, and determining the data packet as the second communication protocol data, comprises: When the data transmission mode of the first communication protocol data is unreliable, based on the inter-chip communication protocol and the unreliable type, performing unreliable transmission encapsulation on the data frame to obtain an unreliable packet, and determining the unreliable packet as the second communication protocol data; The method of transmitting the second communication protocol data to the data communication layer of the target communication system through the data communication layer of the local communication system, so that the second communication protocol deployed at the second data encapsulation layer of the target communication system decapsulates the second communication protocol data to obtain first format data consistent with the first communication protocol data, includes: The unreliable packet is transmitted to the data communication layer of the target communication system through the data communication layer of the local communication system, so that the inter-chip communication protocol deployed in the second data encapsulation layer of the target communication system decapsulates the unreliable packet to obtain the first format data.
9. The method according to claim 2, characterized in that: The method further comprises: When the communication channel corresponding to the data transmission layer of the local communication system is updated, the protocol stack of the data communication layer of the local communication system is dynamically adjusted by plug-in management, so that the protocol stack of the data communication layer of the local communication system can be dynamically updated.
10. A cross-system communication device, characterized in that: The device comprises: A first data encapsulation and transmission module, configured to obtain first communication data, and based on a first communication protocol deployed in a first data encapsulation layer of a local communication system, encapsulate the first communication data to obtain first communication protocol data, and transmit the first communication protocol data to a second data encapsulation layer of the local communication system; A second data encapsulation and transmission module, configured to perform transmission type encapsulation on the first communication protocol data based on a second communication protocol deployed at a second data encapsulation layer of the local communication system to obtain second communication protocol data, and transmit the second communication protocol data to a data communication layer of the local communication system; the second communication protocol is a lower layer protocol of the first communication protocol; A data transmission module is used to transmit the second communication protocol data to the data communication layer of the target communication system through the data communication layer of the local communication system, so that the second communication protocol deployed at the second data encapsulation layer of the target communication system decapsulates the second communication protocol data to obtain first format data consistent with the first communication protocol data; and so that the first communication protocol deployed at the first data encapsulation layer of the target communication system decapsulates the first format data to obtain second communication data consistent with the first communication data.
Citation Information
Patent Citations
Device and method for realizing process-to-process communication of different application programs on mobile terminal
CN102137123A
Equipment management method, device and system
CN103297273A
Communication method, system and device and computer readable storage medium
CN112039824A
Data transmission method, automobile communication terminal, mobile terminal and readable storage medium
CN112509172A
Communication control method and device and electric vehicle
CN116634395A
Cited By
Compatible method and device of OAuth protocol, equipment and medium
CN120390041A