A gateway for a synchronous distributed collaborative network
By combining a synchronous distributed collaborative network module and a memory data management module, the real-time and data out-of-order issues of the vehicle gateway are resolved, global single clock collaboration is achieved, the real-time performance and security of the system are improved, development costs are reduced and bandwidth is saved.
Patent Information
- Application Number
- CN202411683951.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-11-22
AI Technical Summary
Existing vehicle gateways operate on traditional Ethernet, resulting in poor real-time performance, low bandwidth utilization, and data out-of-order communication and resource contention when multiple heterogeneous ports communicate, leading to security incidents.
The Synchronous Distributed Cooperative Network (SDCN) module is adopted. By identifying the step cycle through scheduling frames, combined with the memory data management module and the heterogeneous communication module, fair arbitration and framing of data are achieved, ensuring that each communication port has the opportunity to send and receive data in each step cycle. Global single clock coordination is adopted to avoid data out-of-order and resource preemption.
It improves the real-time performance and determinism of gateway devices, reduces development costs, enhances system security and stability, and saves network bandwidth.
Smart Images

Figure CN119583487B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of network, and particularly relates to a gateway for a synchronous distributed collaborative network. BACKGROUND
[0002] The vehicle-mounted network is an early point-to-point connection mode for communication between internal sensors, controls and actuators of a vehicle, which is connected into a complex mesh structure. With the increasing complexity of the electronic control system and the growing communication ability requirements between the electronic control units with control functions in the vehicle, the point-to-point connection mode will increase the wire harness in the vehicle, causing troubles in vehicle design and manufacturing. Therefore, in order to reduce the internal wiring, realize data sharing and fast exchange, and improve reliability, the vehicle-mounted network emerges as the times require. It is based on the CAN (Controller Area Network), LAN (Local Area Network), LIN (Local Interconnect Network), MOST (Media Oriented System Transport) and other basic automotive electronic network systems, aiming to realize data sharing and fast exchange through computer network, and improve the efficiency and reliability of vehicle design.
[0003] The vehicle-mounted gateway is the core component of the vehicle-mounted network. In the prior art, the patent application with publication number CN115460044A provides a vehicle-mounted gateway based on a SOC chip, which includes a SOC core processing module, an Ethernet interface module, a CAN interface module, a storage module and a power management module. The Ethernet interface module, the CAN interface module, the storage module, the USB module and the power management module are connected with the SOC core processing module. The FPGA unit of the SOC core processing module adopts a two-layer switching network design, including a main switching module SW1, an auxiliary switching module SW2 and a switching module switching and redundancy control module. When it is detected that the SW1 forwarding state is normal, the SW2 is controlled to discard the received data and not to forward the data. When it is detected that the SW1 forwarding state is abnormal, the SW1 is controlled to no longer forward the data, and switches to the SW2 for data transmission and reception, and the SW1 is reset at the same time.
[0004] However, the above vehicle-mounted gateway has the following problems:
[0005] 1. Since it is based on traditional Ethernet operation, it needs to perform local time alignment through time frames, and the real-time performance is poor. Due to the existence of time frames, the bandwidth utilization is low;
[0006] 2. When multiple heterogeneous ports simultaneously communicate, it may cause data out-of-order, and the outdated data is still used, affecting the data determinacy.
[0007] 3. Multiple heterogeneous communication modules share an Ethernet transmit port and transmit data in a time-priority order. When a large volume of data is received on a single port, communication resources are preempted, making it difficult for other ports to transmit data in a timely manner, which can easily lead to security incidents. Summary of the Invention
[0008] To address the aforementioned problems in the prior art, this invention provides a gateway for synchronous distributed collaborative networks.
[0009] The technical problem to be solved by this invention is achieved through the following technical solution:
[0010] A gateway for a synchronous distributed cooperative network includes: a synchronous distributed cooperative network (SDCN) module, a memory data management module, and a heterogeneous communication module; wherein, the SDCN module is used to receive scheduling frames sent by the SDCN, and to identify different stepping cycles based on the number of stepping beats in the scheduling frame;
[0011] Within each step cycle:
[0012] The heterogeneous communication module is used to receive uplink data from each communication port and store the received uplink data into the first uplink FIFO corresponding to each communication port.
[0013] The memory data management module is used to sequentially extract one frame of uplink data from each of the first uplink FIFOs and store it into the first circular buffer; and extract uplink data from the first circular buffer and send it to the second uplink FIFO.
[0014] The SDCN module is used to obtain uplink data from the second uplink FIFO, frame it, and send it to the SDCN; wherein, in the framed uplink data, real-time data carries the number of step beats corresponding to the current step cycle, and all data has a port identifier;
[0015] The SDCN module is also used to receive data frames sent by the SDCN and extract downlink data from them to store in the first downlink FIFO;
[0016] The memory data management module is further configured to extract downlink data from the first downlink FIFO and store it in the second circular buffer, and store the frame information of the downlink data in the frame information FIFO; by reading the frame information FIFO, the downlink data to be sent to each communication port in the second circular buffer is extracted sequentially, and the extracted downlink data is sent to the second downlink FIFO corresponding to each communication port respectively; wherein, the frame information is used to indicate the communication port corresponding to the downlink data and the storage location of the downlink data in the second circular buffer;
[0017] The isomerous communication module is further configured to send the downlink data in each second downlink FIFO to a corresponding communication port.
[0018] Optionally, the real-time data in the framed uplink data further carries a step offset value; the step offset value is used to distinguish the order of different uplink data entering the SDCN in the same step period; and the timestamp of the real-time data is determined by the step beat number and the step offset value.
[0019] Optionally, the gateway further comprises a gateway configuration module.
[0020] The gateway configuration module is configured to perform gateway parameter configuration on the gateway when the gateway is powered on for the first time; and the gateway parameters at least include the step period.
[0021] Optionally, the communication ports comprise one or more of the following modules:
[0022] ADC module, IO module, CAN module, serial port module and Ethernet module.
[0023] Optionally, the SDCN module acquires uplink data from the second uplink FIFO, frames the uplink data and then sends the framed uplink data to the SDCN, and the process comprises:
[0024] acquiring uplink data from the second uplink FIFO;
[0025] for uplink data from the Ethernet module, replacing the bytes where the checksum in the IP frame header is located to carry the gateway ID and port identifier by using the replaced bytes, so as to frame the uplink data from the Ethernet module;
[0026] for uplink data from the ADC module, IO module, CAN module and serial port module, converting the uplink data into a data frame of the SDCN, so as to frame the uplink data from the Ethernet module; wherein the data frame contains an SDCN frame header; and the SDCN frame header carries the step beat number, step offset value and port identifier;
[0027] sending the framed uplink data to the SDCN.
[0028] Optionally, the SDCN module comprises an uplink module and a downlink module; and the uplink module and the downlink module work in parallel.
[0029] The downlink module is configured to receive a scheduling frame sent by the SDCN, so as to identify different step periods according to the step beat number in the scheduling frame.
[0030] The uplink module is configured to obtain uplink data from the second uplink FIFO in each step cycle, frame the uplink data, and send the framed uplink data to the SDCN.
[0031] The downlink module is further configured to receive data frames from the SDCN in each step cycle, extract downlink data from the data frames, and store the downlink data in the first downlink FIFO.
[0032] Optionally, for uplink data from different communication ports in the same step cycle, the SDCN module generates different step offset values according to the order of framing.
[0033] The gateway for the synchronous distributed collaborative network provided by the application has the following beneficial effects:
[0034] 1. The gateway realizes data interaction between heterogeneous communication ports and the synchronous distributed collaborative network, and reduces development costs by compatibility of the heterogeneous ports and compatibility with existing vehicle buses.
[0035] 2. The gateway realizes cooperation with the global single clock provided by the synchronous distributed collaborative network by receiving scheduling frames from the SDCN, identifying different step cycles according to the number of step beats in the scheduling frames, and thus improving real-time performance and determinacy of the gateway device by controlling gateway communication functions based on the global single clock rather than the local clock of the gateway.
[0036] 3. The gateway adopts a fair arbitration mechanism for data from each communication port, and each communication port has an opportunity to send / receive data in each step cycle, thereby realizing local queuing of uplink / downlink data in the gateway, adaptive flow adjustment, prevention of data out-of-order and safety problems caused by non-real-time delivery of old data, and avoidance of problems of blocked information transmission / reception of other ports caused by sudden large flow data of a single port, thereby greatly improving safety and stability of the system.
[0037] 4. The gateway works based on the synchronous distributed collaborative network rather than the traditional Ethernet, and thus saves network bandwidth without a large number of time frames.
[0038] The application will be further described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS
[0039] Figure 1 is a structure diagram of a scheduling frame of the synchronous distributed collaborative network;
[0040] Figure 2 is a structure diagram of a data frame of the synchronous distributed collaborative network;
[0041] Figure 3is a structural schematic diagram of a gateway for a synchronous distributed collaborative network provided by an embodiment of the present application;
[0042] Figure 4 is a timing schematic diagram showing that the gateway provided by an embodiment of the present application works based on a step cycle;
[0043] Figure 5 is a schematic diagram of data uplink and downlink of the gateway provided by an embodiment of the present application;
[0044] Figure 6 is a schematic diagram of the gateway performing framing on uplink data encapsulated by a traditional Ethernet provided by an embodiment of the present application;
[0045] Figure 7 is a schematic diagram of the gateway performing framing on uplink data sent by a UART module provided by an embodiment of the present application;
[0046] Figure 8 is a schematic diagram of the gateway performing framing on uplink data sent by a CAN module provided by an embodiment of the present application;
[0047] Figure 9 is a schematic diagram of the gateway performing framing on uplink data sent by an ADC module and an IO module provided by an embodiment of the present application;
[0048] Figure 10 in the specific structural composition of a gateway for a synchronous distributed collaborative network is schematically shown;
[0049] Figure 11 in the specific structural composition of a gateway for a synchronous distributed collaborative network is schematically shown; Figure 10 a fair arbitration mechanism in uplink data of the gateway is shown;
[0050] Figure 12 a fair arbitration mechanism in uplink data of the gateway is shown; Figure 10 a fair arbitration mechanism in downlink data of the gateway is shown. DETAILED DESCRIPTION
[0051] The present application will be further described in detail below in conjunction with specific embodiments, but the embodiments of the present application are not limited thereto.
[0052] Most existing vehicle gateways use traditional Ethernet or time-sensitive networks, which struggle to simultaneously meet the demands for real-time performance, determinism, and efficient bandwidth utilization. Furthermore, their self-clock-based communication scheduling and port information processing mechanisms make it difficult to guarantee the determinism of data transmission. When multiple heterogeneous ports communicate simultaneously, the lack of arbitration can lead to out-of-order data transmission and the continued use of outdated data, compromising data determinism. Multiple heterogeneous communication modules sharing an Ethernet transmission port and transmitting data according to time priority can result in communication resource preemption when a single port receives large volumes of data, hindering timely data transmission to other ports and increasing the risk of security incidents.
[0053] To address the numerous problems existing in current vehicle gateways, this invention provides a gateway for a Synchronous Distributed Collaborative Network (SDCN). The SDCN is a next-generation, highly real-time, and deterministic network used in vehicle, airborne, and laboratory environments. Based on a globally unified single clock and the characteristic of unified step-triggered operation across nodes, the SDCN achieves distributed collaboration among network devices (see Chinese invention patents CN114039692B and CN114039693B). The top-level device (root node) strictly follows the step cycle to send scheduling frames to lower-level nodes. Each scheduling frame contains a step count to represent the step cycle. Nodes receiving the scheduling frame align their clocks based on this step count. Therefore, the time base of the entire network depends only on the absolute time of the root node, thus achieving globally unified single-clock collaboration.
[0054] Figure 1 The frame structure of the scheduling frame is shown in the figure, and its frame structure is similar to that of the SDCN data frame (see Figure 2 The SDCN header and data frame header are identical, containing SFD (preamble), Ethernet frame header, SDCN frame header, data payload, and CRC (cyclic redundancy check). The data payload of the scheduling frame is the scheduling frame content, while the data payload of the data frame is the actual data. The SDCN frame header includes network fragmentation, REID, step count, and step offset. Network fragmentation is used to reassemble multiple data frames when the data is too large. REID, also known as Region Entity ID, is used to indicate the data source; in this embodiment, REID is also called port identifier. Step count is the number of step counts; all data frames belonging to the same step cycle have the same number of step counts. Therefore, for data frames arriving at different times, as long as their SDCN frame headers have the same number of step counts, it can be known that these two data frames belong to the same step cycle. The step offset is the offset relative to the starting point of the step cycle within the step cycle.
[0055] Inside the SDCN, the step offset value represents the time experienced by the node when receiving the scheduling frame relative to the time when the root node sends the scheduling frame. For example, assuming that the step period is 50 ms, the step beat in the scheduling frame / data frame received by a node in the SDCN is 5, and the step offset value is 10 ms, it indicates that the node has experienced 10 ms relative to the time when the root node sends the frame, and the time has passed 5*50 ms+10 ms relative to the time when the root node sends the first scheduling frame.
[0056] When forwarding the received scheduling frame / data frame, the node in the SDCN updates the step offset value, which is the sum of the link delay between the previous node and the local timing duration after the node receives the scheduling frame. The link delay can be obtained by referring to the calculation formula of the measured link delay in CN114039692B, and the link delay is basically fixed after the topology of the synchronous distributed network system is fixed. The local timing duration starts timing when the node receives the scheduling frame, and stops timing when the node forwards the scheduling frame or sends the data frame in the current step period. The timing time unit is microsecond or nanosecond.
[0057] Since the synchronous distributed collaborative network strictly operates according to the step period, the timing of the step period is performed by the root node at the top layer of the network, so the overall time of the network is only related to the root node, all nodes are based on the step period number generated by the root node, and the operation related to time is realized through the step offset value, and the step offset value is also irrelevant to the absolute time of the nodes below the root node, so in the SDCN, the global single clock collaboration can be realized based on the step beat number and the step offset value.
[0058] Outside the SDCN, the synchronous distributed collaborative network and other heterogeneous communication ports, bus protocols in vehicle, airborne and laboratory environments are not communicated with each other, so the gateway for the synchronous distributed collaborative network provided by the embodiment of the application can realize data interaction and information communication between the heterogeneous interfaces and the synchronous distributed collaborative network, so that the synchronous distributed collaborative network is better compatible with the heterogeneous communication ports and bus protocols in the vehicle, airborne and laboratory environments, and solves many problems existing in the application of the existing vehicle gateway in such environments.
[0059] Referring to Figure 3 The gateway for the synchronous distributed collaborative network provided by the embodiment of the application includes: a synchronous distributed collaborative network SDCN module, a memory data management and control module, and a heterogeneous communication module.
[0060] The SDCN module is configured to receive a scheduling frame sent by the SDCN, and identify different step periods according to the step beat number in the scheduling frame.
[0061] According to the foregoing, the scheduling frame is issued by the root node in the SDCN, is transmitted in the SDCN, and the gateway is connected with the nodes in the SDCN, so that the gateway can receive the scheduling frame from the SDCN, and the scheduling frame contains the step beat number, so that the gateway can identify different step periods according to the step beat number in the scheduling frame, thereby synchronizing with the SDCN based on this.
[0062] Figure 4 The timing diagram of the gateway working based on the step period is shown, as shown in Figure 4 In each step period, the first frame data issued by the SDCN is a scheduling frame, and the uplink and downlink transmission of data is performed after the scheduling frame.
[0063] In each step period, the SDCN module, the memory data management module and the heterogeneous communication module in the gateway work cooperatively to realize the uplink transmission of data, and the cooperative process of each step period is described as follows:
[0064] The heterogeneous communication module receives the uplink data sent by each communication port and stores the received uplink data in the first uplink FIFO corresponding to each communication port.
[0065] Specifically, the heterogeneous communication module includes a plurality of heterogeneous communication ports for communicating with external devices. As shown in Figure 5 The data flow from the heterogeneous communication port to the gateway to the SDCN is referred to as data uplink, and the data flow from the SDCN to the gateway to the heterogeneous communication port is referred to as data downlink.
[0066] The first uplink FIFO is a FIFO dedicated to the heterogeneous communication module, which stores the uplink data sent by each communication port according to the port type. For example, the communication ports can include an ADC module, an IO module, a CAN module, a serial port module and an Ethernet module, but are not limited thereto. On this basis, five first uplink FIFOs can be provided in the heterogeneous communication module, each corresponding to one of the five modules, and each first uplink FIFO stores the uplink data sent by the corresponding communication port.
[0067] The memory data management module is used to extract a frame of uplink data from each first uplink FIFO in sequence and store it in the first ring buffer, and extract the uplink data from the first ring buffer and send it to the second uplink FIFO.
[0068] Specifically, the memory data management module interacts with all communication interfaces in the heterogeneous communication module, and the memory data management module includes a memory write module and a memory read module. When data is uploaded, the memory write module detects the uploaded data in each first uplink FIFO according to the order, extracts the uploaded data according to the fair arbitration mode of extracting one frame of data for each communication port, and the mode enables each communication port to have an opportunity to send data to the SDCN in each step cycle, avoiding the problem that a single port suddenly appears large flow communication data, occupies the communication resource of the sending port, and thus other ports cannot communicate in time. Then, the memory write module adds memory framing information to the extracted uploaded data and writes the uploaded data into the first ring buffer, and when the first ring buffer is full, the new data will overwrite the old data, realizing the discarding of outdated data. The memory framing information includes information (such as data length) for facilitating DDR3 framing and data type information, and the data type information can be used to distinguish the communication port to which the data corresponds. Then, the memory read module regularly detects whether the second uplink FIFO has enough space. If it has enough space, the memory read module extracts the uploaded data in the first ring buffer and sends the uploaded data to the second uplink FIFO. Here, the second uplink FIFO is a special FIFO of the SDCN module, and its function is to receive and store the uploaded data sent by the memory data management module.
[0069] The SDCN module is also used to obtain the uploaded data from the second uplink FIFO, frame the uploaded data, and send the framed uploaded data to the SDCN. Among the framed uploaded data, the real-time data carries the step beat number corresponding to the current step cycle to indicate the step cycle to which the data belongs, and all the data have port identifiers to indicate the communication port from which the data comes.
[0070] In addition, among the formatted uploaded data, the real-time data also carries a step offset value; the step offset value can be used to distinguish the order in which different uploaded data in the same step cycle enters the SDCN. Therefore, the timestamp of the real-time data can be determined by the step beat number and the step offset value when data is uploaded. Thus, the step beat number and the step offset value can express the order relationship of all data in the gateway, so that the size of the network delay can be ignored, and global time alignment is not required.
[0071] The step offset value in the data frame transmitted in the SDCN is different from the step offset value in the data uplink in the gateway, which is generated by the SDCN module. Specifically, the SDCN module generates different step offset values according to the sequence of framing for the uplink data from different communication ports in the same step period. That is, in the same step period, the uplink data extracted by the memory data control module and transmitted to the SDCN module first is framed and transmitted to the SDCN first, and the step offset value in the data frame formed by the uplink data is small; the uplink data extracted by the memory data control module and transmitted to the SDCN module later is framed later, and the step offset value in the data frame formed by the uplink data is increased accordingly.
[0072] In the embodiment of the application, the format conversion of the uplink data by the SDCN module not only adds the port identifier, the step period and the step offset value, but also involves the conversion between protocols. Specifically, the SDCN module acquires the uplink data from the second uplink FIFO, frames the uplink data and then transmits the framed uplink data to the SDCN, which specifically includes:
[0073] (1) acquiring the uplink data from the second uplink FIFO;
[0074] (2-a) for the uplink data from the Ethernet module, replacing the bytes in which the checksum in the IP frame header is located (see Figure 6 ) to carry the gateway ID and the port identifier by the replaced bytes, so as to frame the uplink data from the Ethernet module;
[0075] (2-b) for the uplink data from the ADC module, the IO module, the CAN module and the serial port module, converting the uplink data into the data frame of the SDCN to frame the uplink data from these modules; wherein the data frame contains the SDCN frame header; the SDCN frame header carries the step beat number, the step offset value and the port identifier, as shown in Figure 2 ;
[0076] (3) transmitting the framed uplink data to the SDCN.
[0077] It can be understood that the uplink data from the Ethernet module is non-real-time data, which does not need to be ensured real-time based on the step beat number and the step offset value, and even in the SDCN, it is only relayed, so the SDCN module only needs to replace the bytes in which the checksum in the IP frame header is located, as shown in Figure 6 , so as to carry the gateway ID and the port identifier by the replaced bytes. Correspondingly, in the data downlink, the gateway ID and the port identifier will be replaced by the checksum by the SDCN module again.
[0078] For uplink data from UART module, SDCN module packs it directly into the data part of data frame and sets the REID part in SDCN frame header as the value corresponding to UART, indicating that the frame data is from the serial port connected to the gateway, as shown in Figure 7 Correspondingly, for downlink data, according to the REID in the data frame received from SDCN, it can be determined that the downlink data is for UART module, so the data payload to be sent to UART can be extracted from the data part of the data frame.
[0079] For uplink data from CAN module, SDCN module packs it directly into the data part of data frame and sets the REID part in SDCN frame header as the value corresponding to CAN bus, indicating that the frame data is from the CAN bus connected to the gateway, as shown in Figure 8 Correspondingly, for downlink data, according to the REID in the data frame received from SDCN, it can be determined that the downlink data is for CAN bus, so the data payload to be sent to CAN bus can be directly extracted from the data part of the data frame.
[0080] For IO module and ADC module, in data uplink, they perform data uplink according to pre-set filter period, and there can be multiple filter periods in one step period. ADC module is only responsible for converting analog signal into digital signal, so there is no downlink data for this port. SDCN module encapsulates uplink data from IO module and ADC module into the same data frame for data uplink, as shown in Figure 9 When data downlink, the data part in the data frame sent by SDCN only contains data payload to be sent to IO module, so SDCN module can directly extract the data payload to be sent to IO module from the data part of the data frame.
[0081] The above is the data uplink process inside the gateway. It can be understood that in data uplink, the gateway actually adopts a fair arbitration principle to avoid data out-of-order, so that in each step period, the uplink data of each communication port sending data can ensure that there is a data frame sent to SDCN by SDCN module.
[0082] The following is the data downlink process inside the gateway.
[0083] SDCN module receives the data frame sent by SDCN and extracts the downlink data to store in the first downlink FIFO. Here, the first downlink FIFO is a special FIFO of SDCN module, which is used to store the downlink data sent by SDCN in order.
[0084] Wherein, when the SDCN module extracts the downlink data from the data frame, the data frame is mainly parsed to extract the data payload, the number of step beats and the port identifier from the data frame, so as to determine the data of the same step cycle according to the number of step beats, and determine the communication port to which the data payload is to be sent according to the port identifier.
[0085] The memory data management module is used to extract the downlink data from the first downlink FIFO and store the downlink data to the second ring buffer, and store the frame information of the downlink data into the frame information FIFO, the frame information being used to indicate the communication port corresponding to the downlink data and the storage position of the downlink data in the second ring buffer. Then, the memory data management module extracts the downlink data to be sent to each communication port in the second ring buffer in turn by reading the frame information FIFO, and sends the extracted downlink data to the second downlink FIFO corresponding to each communication port. Here, the second downlink FIFO is a special FIFO of the heterogeneous communication module, the number of which corresponds to the number of communication ports, and its function is to store the downlink data sent by the memory data management module to each communication interface.
[0086] Specifically, the memory write module reads the first downlink FIFO to obtain the downlink data, converts the 11-bit data to 128-bit wide data, adds the memory framing information (annotates the data type, length, port identifier, port number, etc.), and forms the memory frame to be written into the second ring buffer in the memory. And, the frame information FIFO is additionally established in the memory read module, which is used to store the frame information. When the memory write module writes data into the second ring buffer, the frame information is also written into the frame information FIFO, and the data can be directly read from the second ring buffer according to the frame information stored in the frame information FIFO, avoiding frequent reading of the memory. Then, the memory read module detects whether the second downlink FIFO has enough storage space, if the space is enough, the memory read module only needs to extract the data from the second ring buffer according to the fair arbitration mode of each communication port once to send to the corresponding second downlink FIFO, avoiding the time-sensitive data that cannot be timely issued due to the data of a single heterogeneous communication port occupying the resources of the receiving port. Wherein, when the memory read module extracts data from the second ring buffer according to the fair arbitration mode, it first reads the frame information FIFO to find the frame information of the downlink data of the communication port to be sent each time, and then extracts the data from the second ring buffer according to the read frame information.
[0087] In the embodiment of the present application, the frame information is written into the additionally established frame information FIFO, and the port identifier is subsequently found by reading the frame information FIFO, which has the effect of improving the reading efficiency. Specifically, since one SDCN module corresponds to multiple communication ports during data download, if the port identifier is stored together with the downlink data in the second ring buffer, when the port identifier of the downlink data of the current communication port to be sent is subsequently found in the fair arbitration process, all the data stored in the second ring buffer needs to be frequently traversed, resulting in that the specific downlink data of all the communication ports is also read multiple times but discarded, and the reading efficiency is low. In addition, compared with finding the port identifier by reading the frame information FIFO, the speed of finding the port identifier by frequently reading the second ring buffer is much slower. As can be seen, in the embodiment of the present application, the frame information is written into the additionally established frame information FIFO, and the port identifier is found by reading the additionally established frame information FIFO, which can significantly improve the reading efficiency.
[0088] Then, the heterogeneous communication module sends the downlink data in each second downlink FIFO to the corresponding communication port, thereby completing the data download process.
[0089] It can be understood that, during data download, the gateway also adopts a fair arbitration principle to adaptively adjust the flow sequence, and in each step cycle, the downlink data corresponding to each communication port sent by the SDCN can be ensured to be received by the communication port, avoiding the situation that the data of a single heterogeneous communication port occupies the resources of the receiving port, resulting in that the time-sensitive data cannot be timely delivered.
[0090] The above completes the description of the data uplink and downlink process in a single step cycle. In a step cycle, the data download and the data uplink are synchronously performed, when a new scheduling frame arrives at the gateway, a new step cycle starts, and the step rhythm of the uplink data sent by the gateway to the SDCN is updated according to the new scheduling frame, thereby the gateway realizes the triggering work based on the scheduling frame rather than the local time triggering.
[0091] In the embodiment of the present application, the data uplink and the data downlink are independent of each other and do not interfere with each other, and the memory reading module and the memory writing module in the memory data management module are respectively provided with two sets, one set of memory reading module and memory writing module cooperates with the first ring buffer to serve the data uplink, and the other set of memory reading module and memory writing module cooperates with the second ring buffer to serve the data downlink.
[0092] Similarly, the SDCN module can include an uplink module and a downlink module; the uplink module and the downlink module work in parallel;
[0093] The downlink module is configured to receive the scheduling frame sent by the SDCN, so as to identify different step cycles according to the step rhythm number in the scheduling frame.
[0094] The uplink module is configured to acquire uplink data from the second uplink FIFO in each step cycle, and send the uplink data to the SDCN after framing.
[0095] The downlink module is further configured to receive data frames from the SDCN in each step cycle, and store downlink data extracted from the data frames to the first downlink FIFO.
[0096] In summary, the gateway for the synchronous distributed collaborative network provided by the embodiment of the present application realizes data interaction between the heterogeneous communication ports and the synchronous distributed collaborative network, and the compatibility of the heterogeneous ports, the compatibility of the existing bus of the vehicle, the vehicle can retain the existing bus without the need for complete reconstruction into the synchronous distributed collaborative network, reduces the development cost, and at the same time, expands the application range of the synchronous distributed collaborative network, including laboratory environment, vehicle-mounted environment, etc.
[0097] The gateway provided by the embodiment of the present application realizes the cooperation with the global single clock provided by the synchronous distributed collaborative network by receiving the scheduling frame sent by the SDCN and identifying different step cycles according to the number of step beats in the scheduling frame, thereby realizing the management and control of the gateway communication function based on the global single clock rather than the local clock of the gateway, and improving the real-time performance and determinacy of the gateway device.
[0098] The gateway provided by the embodiment of the present application adopts the mechanism of fair arbitration of data from each communication port inside the gateway, and each communication port has the opportunity of data sending and data receiving in each step cycle, realizes the local queuing of the uplink / downlink data inside the gateway, realizes adaptive flow adjustment, prevents data out-of-order and old data from being delivered in real time to cause safety problems, and at the same time, avoids the problem that the information transmission and reception of the remaining ports are blocked due to the sudden large flow data of a single port, greatly improves the safety and stability of the system.
[0099] Moreover, instead of being based on the traditional Ethernet, the gateway is based on the synchronous distributed collaborative network and does not need a large number of time frames, so that the network bandwidth can be saved and the bandwidth utilization rate can be increased.
[0100] In one embodiment, the gateway for the synchronous distributed collaborative network provided by the embodiment of the present application can further include a gateway configuration module.
[0101] The gateway configuration module is configured to perform gateway parameter configuration on the gateway when the gateway is powered on for the first time, and the gateway parameters at least include the step cycle and can further include the gateway ID, the maximum number of stored frames of the port, etc.
[0102] Specifically, the gateway configuration module is responsible for reading and writing the on-board flash memory in the gateway. When the gateway is powered on for the first time, the gateway parameters are configured by the host computer, and the gateway configuration module burns the received configuration to the default location of the flash memory. When the default configuration is configured, the gateway configuration module uses the default configuration. After the host computer sends the configuration, the gateway configuration module writes the parameters to the flash memory and reads the flash memory again. The read configuration parameters are framed as data frames and returned to the host computer. The host computer confirms whether the configuration is successful by comparing the parameters.
[0103] The host computer can be a node in the SDCN. The node sends a data frame to the gateway to issue configuration parameters to the gateway. The data frame contains configuration parameters, so it can also be called a configuration frame. Generally, the gateway receives the configuration frame in the first step cycle after power-on, and completes the configuration. After the configuration is completed, the gateway transmits and receives normal data frames with the SDCN, for example Figure 4 The step cycle 0 in the above is the first step cycle of the gateway after power-on, and the step cycle 2 and the step cycle 3 are normal data transmission and reception.
[0104] In the embodiment of the application, the FPGA of the gateway is used to implement the service logic of the gateway, which can be implemented by the FPGA or the single-chip microcomputer.
[0105] In a specific example, referring to Figure 10 , the FPGA is used to implement the service logic of the gateway, the model of the FPGA is XC7K325T 2ffg676I, the model of the memory is ddr3 1G, and the flash memory uses a 128M size flash memory. In terms of physical interface, the gateway has two synchronous distributed cooperative network interfaces of gigabit / megabit, which are M12 aviation plugs; two gigabit Ethernet interfaces, which are RJ45; two RS422 interfaces; two CAN bus interfaces, which can be converted into PCIE protocol to access the FPGA through the C6138 chip or directly access the FPGA pin; one GPIO interface, which has 16 independent IOs; and one AD interface, which has four analog input channels and has an analog filtering function. The gateway power supply can select 220V AC power supply or wide 12V DC power supply, which is convenient for use in a vehicle environment.
[0106] The gateway arbitration order is set as: Ethernet, serial port, CAN, GPIO, AD (only data uplink). That is, when the memory data control module extracts uplink data from each first uplink FIFO in turn, it extracts from the first uplink FIFO corresponding to these modules in turn according to this order, as shown in Figure 11 . Correspondingly, when downlink data is extracted from the second ring buffer in turn, it is also extracted according to this order, as shown in Figure 12 . The gateway arbitration order can be fixed in the flash memory of the gateway or configured by the gateway configuration module.
[0107] It should be noted that the terms "first", "second", and so on are used herein to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all the embodiments consistent with the present disclosure. Rather, they are merely examples of devices and methods consistent with some aspects of the present disclosure.
[0108] In the description of the present specification, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" and the like means that the specific features or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in the present specification.
[0109] Although the present application is described herein in conjunction with various embodiments, other variations of the disclosed embodiments can be understood and implemented by those skilled in the art with reference to the drawings and the disclosure. In the description of the present application, the word "comprising" does not exclude other components or steps, "one" or "an" does not exclude a plurality, and "plurality" means two or more, unless otherwise explicitly specified. In addition, some measures are described in different embodiments, but this does not mean that these measures cannot be combined to produce good results.
[0110] The above is a further detailed description of the present application in conjunction with specific preferred embodiments, and cannot be considered as limiting the specific implementation of the present application to these descriptions. For those skilled in the art to which the present application belongs, without departing from the concept of the present application, a number of simple deductions or replacements can be made, which should be considered as falling within the scope of protection of the present application.
Claims
1. A gateway for synchronous distributed cooperative networks, characterized in that, include: The system includes a synchronous distributed collaborative network (SDCN) module, a memory data management module, and a heterogeneous communication module. The SDCN module is used to receive scheduling frames sent by the SDCN and identify different step cycles based on the number of step beats in the scheduling frame. Within each step cycle: The heterogeneous communication module is used to receive uplink data from each communication port and store the received uplink data into the first uplink FIFO corresponding to each communication port. The memory data management module is used to sequentially extract one frame of uplink data from each of the first uplink FIFOs and store it into the first circular buffer; and extract uplink data from the first circular buffer and send it to the second uplink FIFO. The SDCN module is used to obtain uplink data from the second uplink FIFO, frame it, and send it to the SDCN; wherein, in the framed uplink data, real-time data carries the number of step beats corresponding to the current step cycle, and all data has a port identifier; The SDCN module is also used to receive data frames sent by the SDCN and extract downlink data from them to store in the first downlink FIFO; The memory data management module is further configured to extract downlink data from the first downlink FIFO and store it in the second circular buffer, and store the frame information of the downlink data in the frame information FIFO; by reading the frame information FIFO, the downlink data to be sent to each communication port in the second circular buffer is extracted sequentially, and the extracted downlink data is sent to the second downlink FIFO corresponding to each communication port respectively; wherein, the frame information is used to indicate the communication port corresponding to the downlink data and the storage location of the downlink data in the second circular buffer; The heterogeneous communication module is also used to send downlink data in each of the second downlink FIFOs to the corresponding communication ports.
2. The gateway for synchronous distributed cooperative networks according to claim 1, characterized in that, In the uplink data after framing, the real-time data also carries a step offset value; the step offset value is used to distinguish the order in which different uplink data enter the SDCN within the same step cycle; the timestamp of the real-time data is determined by the number of step beats and the step offset value.
3. The gateway for synchronous distributed cooperative networks according to claim 1, characterized in that, Also includes: Gateway configuration module; The gateway configuration module is used to configure gateway parameters when the gateway is powered on for the first time. The gateway parameters include at least the stepping cycle.
4. The gateway for synchronous distributed cooperative networks according to claim 1, characterized in that, Each communication port includes one or more of the following modules: ADC module, IO module, CAN module, serial port module and Ethernet module.
5. The gateway for synchronous distributed cooperative networks according to claim 4, characterized in that, The SDCN module acquires uplink data from the second uplink FIFO, frames it, and then sends it to the SDCN, including: Obtain uplink data from the second uplink FIFO; For uplink data from the Ethernet module, the byte containing the checksum in its IP frame header is replaced, so that the replaced byte carries the gateway ID and port identifier, thereby enabling the framing of uplink data from the Ethernet module. Uplink data from the ADC module, IO module, CAN module, and serial port module is converted into SDCN data frames to frame uplink data from the Ethernet module. The data frames contain SDCN frame headers, which carry step count, step offset, and port identifier. The framed uplink data is sent to the SDCN.
6. The gateway for synchronous distributed cooperative networks according to claim 1, characterized in that, The SDCN module includes an uplink module and a downlink module; the uplink module and the downlink module operate in parallel. The downlink module is used to receive scheduling frames sent by SDCN, and to identify different step cycles based on the number of step beats in the scheduling frame; The uplink module is used to acquire uplink data from the second uplink FIFO in each step cycle, frame the data, and then send it to the SDCN. The downlink module is also used to receive data frames sent by SDCN in each step cycle, extract downlink data from them and store it in the first downlink FIFO.
7. The gateway for synchronous distributed cooperative networks according to claim 2, characterized in that, For uplink data from different communication ports within the same step cycle, the SDCN module generates different step offset values based on the order of frame assembly.
Citation Information
Patent Citations
A hard clock synchronization method
CN114039692B
A Single-Clock Synchronous Concurrent Network and Its Data Transfer Method
CN114039693B
Vehicle-mounted gateway based on SOC chip, control method and vehicle-mounted device
CN115460044A
Heterogeneous multiport aggregation network resource sharing method
CN107396397A
Network device and method for exchange, routing and / or gateway of data
CN116569533A