Data transmission method, chip and storage medium
By directly transmitting data packets in the physical layer of the target node in the automotive electronic control unit (ECU), the problems of low bandwidth utilization and large delay during transmission are solved, and more efficient data transmission is achieved.
Patent Information
- Application Number
- CN202410179031.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2023-12-26
- Filing Date
- 2024-02-09
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-02-09
AI Technical Summary
During data transmission, existing automotive electronic control units (ECUs) need to undergo multi-layer protocol processing, resulting in low bandwidth utilization and large transmission delay.
By directly transmitting data packets at the physical layer of the target node, avoiding multi-layer protocol processing, the data packets are directly sent from the physical layer of the target node to the physical layer of the downstream node.
It improves the bandwidth utilization rate of data transmission, reduces transmission delay, realizes real-time data transmission of target nodes, and improves transmission efficiency.
Smart Images

Figure CN117997973B_ABST
Abstract
Description
[0001] This application claims priority to the PCT patent application with application date of August 25, 2023, application number "PCT / CN2023 / 115046", and patent name "A data forwarding method, chip and electronic device", and the PCT patent application with application date of December 26, 2023, application number "PCT / CN2023 / 142094", and patent name "Networked data transmission method, chip and communication system", all of which are hereby introduced as reference. Technical Field
[0002] The embodiments of the present application relate to the field of electronic communication technology, and in particular to a data transmission method, chip and storage medium. Background Art
[0003] As cars become more and more intelligent, there are more and more Electronic Control Units (ECU) in the car, and data transmission inside the car is achieved through the ECU.
[0004] Currently, if Figure 1 As shown, the ECU usually includes a sensor, a microcontroller unit (MCU) and an Ethernet physical layer (PHY) chip. Based on this, the specific process of ECU data transmission can be as follows: after the MCU obtains the sensor data to be transmitted from the sensor, the MCU can encapsulate the sensor data to obtain an encapsulated data packet, and then the Ethernet physical layer chip sends the encapsulated data packet to the Ethernet switch connected to the ECU. The Ethernet switch forwards the encapsulated data packet to the central processing unit, so that the central processing unit can parse the encapsulated data packet to obtain the sensor data.
[0005] However, data transmitted in accordance with standard Ethernet usually needs to be processed by multiple layers of protocols, such as Figure 2Taking the application layer protocol as Constrained Application Protocol (CoAP) as an example, the data of the external device needs to be processed by the physical layer, Media Access Control Address (MAC) layer, Internet Protocol (IP) layer, User Datagram Protocol (UDP) layer and CoAP layer in the standard network model before it can be sent to the switch to realize the transmission of data between ECU and switch. Therefore, after the above sensor data is encapsulated by MCU, the encapsulated data packet includes not only the sensor data, but also the protocol headers corresponding to the above layers. For example, refer to Figure 3 The encapsulated data packet may include a MAC header, an IP header, a UDP / Transmission Control Protocol (TCP) header, an application layer protocol header, sensor data, and cyclic redundancy check 32 (CRC32) check data, etc., and in order to transmit the above sensor data, the ECU needs to transmit an encapsulated data packet including the sensor data and more other data, so that the sensor data accounts for a small proportion in the encapsulated data packet, and therefore the bandwidth utilization rate of the ECU for data transmission is low; and when the ECU is transmitting data, the MCU obtains the data to be transmitted from the sensor, the MCU encapsulates the sensor data, the encapsulated data packet is transmitted in the switch, and the central processing unit performs parsing, etc., which will all generate delays, so the transmission delay of the ECU for data transmission is relatively large. Summary of the invention
[0006] In view of this, embodiments of the present application provide a data transmission method, a chip, and a storage medium to at least partially solve the above problems.
[0007] According to the first aspect of an embodiment of the present application, a data transmission method is provided, which is applied to a target node, and the method includes: obtaining a first data packet transmitted at a physical layer; based on a physical transmission medium used to connect a first interface of the target node and a second interface of a downstream node, sending the first data packet to a physical layer of the downstream node through the physical layer of the target node.
[0008] In a possible implementation manner, the obtaining of a first data packet transmitted at the physical layer includes: obtaining data to be transmitted, and encapsulating the data to be transmitted to obtain the first data packet.
[0009] In one possible implementation, obtaining a first data packet transmitted at the physical layer includes: based on a physical transmission medium used to connect a third interface of the target node and a fourth interface of the upstream node, receiving a second data packet transmitted at the physical layer from the physical layer of the upstream node through the physical layer of the target node; and obtaining the first data packet based on the second data packet.
[0010] In a possible implementation manner, the physical layer of the target node sends the first data packet to the physical layer of the downstream node in real-time streaming.
[0011] In a possible implementation, the first data packet includes multiple data fields, and the multiple data fields are divided into multiple time slices in time, so that the data fields arranged earlier in the multiple data fields are processed and transmitted by the target node first in time.
[0012] In one possible implementation, obtaining the first data packet based on the second data packet includes: performing at least one of the following processing on the second data packet to obtain the first data packet: i. If the second data packet includes target data, reading the target data from the second data packet, wherein the target data includes data whose destination node is the target node or public data of the transmission system where the target node is located; ii. If data to be transmitted is obtained, writing at least part of the data to be transmitted into the second data packet; iii. If the second data packet does not include data whose destination node is the target node, and the target node does not obtain the data to be transmitted, determining the second data packet as the first data packet.
[0013] In a possible implementation manner, the first data packet is obtained by the target node performing real-time streaming processing on the second data packet.
[0014] In one possible implementation, the second data packet includes at least one data field, and the data field identified as being in an idle state in the second data packet is an idle field; if the second data packet includes target data, the target data is read from the second data packet, including: if the second data packet includes a first data field for loading the target data, the target data loaded in the first data field is obtained, and the first data field where the target data is located is determined as an idle field; if the data to be transmitted is obtained, at least part of the data to be transmitted is written into the second data packet, including: if the data to be transmitted is obtained, at least part of the data to be transmitted is loaded into an idle field or a second data field in the second data packet, wherein the second data field is a data field in which the priority of the data loaded in the second data packet is less than the priority of the data to be transmitted.
[0015] In one possible implementation, if data to be transmitted is obtained, at least part of the data to be transmitted is written into the idle field or the second data field in the second data packet, including: if multiple data to be transmitted are obtained, at least part of each data to be transmitted is loaded into the idle field or the second data field in sequence according to the priority of the multiple data to be transmitted from high to low.
[0016] In a possible implementation, the method also includes: if the second data packet includes multiple first data fields, after obtaining the target data loaded in the multiple first data fields, processing the target data loaded in each first data field in order of priority from high to low.
[0017] In a possible implementation, the method further includes: if the retention time of the data to be transmitted in the target node is greater than a preset time threshold, and the priority of the data to be transmitted is lower than the second highest priority, then the priority of the data to be transmitted is increased.
[0018] In a possible implementation, the sequentially loading at least part of each of the data to be transmitted into the idle field or the second data field includes: for each of the data to be transmitted, if the data amount of the data to be transmitted is greater than the capacity of the data field, the data to be transmitted is split into at least two sub-data, and the at least two sub-data are loaded into the idle field or the second data field respectively; if the data amount of the data to be transmitted is less than or equal to the capacity of the data field, the data to be transmitted is loaded into the idle field or the second data field.
[0019] In a possible implementation manner, the data to be transmitted is data acquired by the physical layer of the target node from an external device connected to the target node or a local module included in the target node.
[0020] In a possible implementation, processing is performed according to the target data loaded in each of the first data fields, including: reading and writing an external device connected to the target node or a local module included in the target node according to the target data loaded in each of the first data fields.
[0021] In one possible implementation, the first data packet includes at least one data field, the data field includes a data sub-block and a sub-block header, the data sub-block is used to load main body data, the sub-block header is used to load attribute information of the main body data, and the attribute information of the main body data includes data type information of the main body data and data length of the main body data.
[0022] In a possible implementation, the attribute information of the main data also includes at least one or more of the idle information of the data field where the main data is located, the data transmission direction of the target node, the source node information of the main data, the destination node information of the main data, the priority information of the main data, and the sequence number information of the main data.
[0023] In a possible implementation, the first data packet includes a common header, and the common header is loaded with a preamble code corresponding to the first data packet and used for physical layer protocol identification.
[0024] In a possible implementation, the target node, the downstream node and the upstream node are applied to a transmission system, the transmission system includes a main node and multiple sub-nodes, the main node and the multiple sub-nodes are connected in sequence to form a link; the link is a ring topology, or the link is a linear topology and the first sub-node and the second sub-node are respectively located at both ends of the link, or the link is a linear topology and the main node and the third sub-node are respectively located at both ends of the link; the target node is any of the sub-nodes, and the upstream node and the downstream node are respectively two nodes adjacent to the target node in the link.
[0025] According to the second aspect of an embodiment of the present application, a chip is provided, comprising: a processor and a memory, the processor and the memory communicating with each other; the memory being used to store at least one executable instruction, the executable instruction enabling the processor to perform operations corresponding to the above-mentioned first aspect.
[0026] According to a third aspect of an embodiment of the present application, a computer storage medium is provided, on which a computer program is stored, and the program is executed by a processor to perform the method of the first aspect.
[0027] According to the data transmission scheme provided in the embodiment of the present application, the target node can obtain the first data packet transmitted in the physical layer, and transmit the first data packet to the physical layer of the downstream node through the physical layer of the target node. Thus, the transmission of the first data packet is carried out at the physical layer. Compared with the data packet encapsulation of the multi-layer protocol through the MCU, the first data packet will not include multiple protocol headers, and thus the data to be transmitted in the first data packet accounts for a large proportion, which improves the bandwidth utilization rate of the target node for data transmission; and, since the first data packet is directly transmitted to the downstream node through the physical layer of the target node, it does not need to be transmitted through a switch, nor does it need to be more complexly encapsulated through the MCU of the target node, and further, it does not need to be more complexly parsed at the downstream node, so it can reduce the transmission delay of the target node for data transmission, and realize the target node to send data to the downstream node in real time, thereby improving the transmission efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0029] Figure 1 It is a schematic diagram of a vehicle-mounted networking system of the background technology of this application;
[0030] Figure 2 It is a schematic diagram of each layer of the network model of the background technology of this application;
[0031] Figure 3 is a schematic diagram of packaged data of the background technology of this application;
[0032] Figure 4 is a flow chart of a data transmission method according to an embodiment of the present application;
[0033] Figure 5 is a schematic diagram of a target node connection method according to an embodiment of the present application;
[0034] Figure 6 is a schematic diagram of a first data packet according to an embodiment of the present application;
[0035] Figure 7 is a schematic diagram of a transmission system according to an embodiment of the present application;
[0036] Figure 8 is a schematic diagram of a transmission system according to another embodiment of the present application;
[0037] Fig. 9 is a schematic diagram of a transmission system according to another embodiment of the present application;
[0038] Fig.10 It is a schematic block diagram of a chip according to an embodiment of the present application. DETAILED DESCRIPTION
[0039] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings 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. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the embodiments of the present application should fall within the scope of protection of the embodiments of the present application.
[0040] Currently, if Figure 1 , showing a simplified schematic diagram of an example of an in-vehicle networking system in the related art, the specific process of ECU data transmission can be as follows: after the MCU included in the ECU obtains the sensor data to be transmitted from an external device such as a sensor, the MCU can encapsulate the sensor data to obtain a packaged data packet, and then the Ethernet physical layer chip included in the ECU sends the packaged data packet to the Ethernet switch connected to the ECU, and the Ethernet switch forwards the packaged data packet to the central processing unit, so that the central processing unit can parse the packaged data packet to obtain the sensor data.
[0041] However, data transmitted in accordance with standard Ethernet usually needs to be processed by multiple layers of protocols, such as Figure 2 , taking the application layer protocol as CoAP protocol as an example, the data of the external device needs to be processed by the physical layer, MAC layer, IP layer, UDP layer and CoAP layer in the standard network model before it can be sent to the switch to realize the transmission of data between ECU and switch. Therefore, after the above sensor data is encapsulated by MCU, the encapsulated data packet includes not only the sensor data, but also the protocol headers corresponding to the above layers. For example, refer to Figure 3, the encapsulated data packet may include a MAC header, an IP header, a UDP / TCP header, an application layer protocol header, sensor data, and CRC32 check data, etc., and then the ECU needs to transmit the encapsulated data packet including the sensor data and more other data in order to transmit the above sensor data, so that the sensor data accounts for a small proportion of the encapsulated data packet, so the bandwidth utilization rate of the ECU for data transmission is low; and when the ECU is transmitting data, the MCU obtains the data to be transmitted from the sensor, the MCU encapsulates the sensor data, the encapsulated data packet is transmitted in the switch, and the central processing unit performs parsing, etc., which will all cause delays, so the transmission delay of the ECU for data transmission is relatively large. For example, a typical value of a transmission delay is divided into: the delay of the MCU receiving data from an external device such as sensor data (about 1us), the delay of the MCU encapsulating the sensor data into a data packet (the data packet in the example here is a standard Ethernet data packet) (about 10us), the delay of the data packet in the two switches (about 500us), and the central processing unit parses the data packet and obtains the sensor data (about 5us). Such a large transmission delay is increasingly difficult to meet the use requirements of today's vehicle networking systems.
[0042] In view of the above problems, the embodiment of the present application provides a data transmission method. It should be noted that the technical solution of the embodiment of the present application is not limited to the networking system applied in the vehicle scenario, but can also be applied in other scenarios.
[0043] Data transmission method
[0044] The data transmission method is described in detail below through multiple embodiments.
[0045] The data transmission method is applied to a target node. For example, the data transmission method can be applied to a target node, and the target node performs data transmission with a downstream node connected thereto through the data transmission method.
[0046] In a possible implementation manner, the target node is, for example, a chip, which is used for transmission based on a physical layer.
[0047] Figure 4 FIG. 1 is a flow chart of a data transmission method according to an embodiment of the present application. Figure 4 As shown, the data transmission method includes the following steps:
[0048] Step 401: Acquire a first data packet transmitted at the physical layer.
[0049] Among them, the physical layer is the lowest layer in network communication. The first data packet is generated by the target node or obtained by the target node after processing the received data packet, and the embodiment of the present application is not limited to this; the first data packet is obtained by reading and writing data of the data packet encapsulated in the physical layer. If the first data packet is generated by the target node, the data packet encapsulated in the physical layer is encapsulated in the physical layer of the target node. If the first data packet is obtained by the target node after processing the received data packet, the data packet encapsulated in the physical layer is encapsulated in the physical layer of other nodes, and the other nodes are nodes used to generate the data packet encapsulated in the physical layer.
[0050] In a specific implementation, the target node may obtain the first data packet through its physical layer.
[0051] Step 402: Based on a physical transmission medium used to connect a first interface of the target node and a second interface of the downstream node, send a first data packet to a physical layer of the downstream node through a physical layer of the target node.
[0052] In a specific implementation, the physical layer of the target node may send the first data packet to the physical layer of the downstream node through the first interface, the physical transmission medium for connecting the first interface and the second interface, and the second interface, wherein the physical transmission medium is, for example, a coaxial cable or a twisted pair, and the twisted pair may be a shielded twisted pair or an unshielded twisted pair. Figure 5 As shown, the target node is a target chip for transmission based on the physical layer, the first interface is set on the target chip, the downstream node is a downstream chip for transmission based on the physical layer, and the second interface is set on the downstream chip. Based on this, the target chip sends the first data packet to the downstream chip through the first interface, the physical transmission medium for connecting the first interface and the second interface, and the second interface, so as to realize that the physical layer of the target node sends the first data packet to the physical layer of the downstream node. The first interface and the second interface are both used to transmit physical layer data.
[0053] In one embodiment of the present application, the target node can obtain the first data packet transmitted in the physical layer, and transmit the first data packet to the physical layer of the downstream node through the physical layer of the target node. Thus, the transmission of the first data packet is performed at the physical layer. Compared with the data packet encapsulation of the multi-layer protocol through the MCU, the first data packet will not include multiple protocol headers, and thus the data to be transmitted in the first data packet accounts for a large proportion, which improves the bandwidth utilization rate of the target node for data transmission; and, since the first data packet is directly transmitted to the downstream node through the physical layer of the target node, it does not need to be transmitted through a switch, nor does it need to be more complexly encapsulated through the MCU of the target node, and further, it does not need to be more complexly parsed at the downstream node, so it can reduce the transmission delay of the target node for data transmission, and enable the target node to send data to the downstream node in real time, thereby improving the transmission efficiency.
[0054] Corresponding to the first data packet being generated by the target node and the first data packet being obtained by the target node after processing the received data packet, there are at least two implementation methods of the above step 401:
[0055] In a possible implementation, the above step 401 includes the following specific processing: obtaining the data to be transmitted, and encapsulating the data to be transmitted to obtain a first data packet.
[0056] The first data packet is generated by the target node. In the process of the target node acquiring the first data packet, the physical layer of the target node can acquire the data to be transmitted and encapsulate the data to obtain the first data packet.
[0057] In one embodiment of the present application, when the target node generates a first data packet, it can directly encapsulate the data to be transmitted through its physical layer without the need for more complicated encapsulation through the MCU of the target node. This can shorten the encapsulation time of the first data packet, thereby reducing the transmission delay of the target node in transmitting data and improving the transmission efficiency.
[0058] In another possible implementation, the above step 401 includes the following specific processing:
[0059] receiving, through the physical layer of the target node, a second data packet transmitted at the physical layer from the physical layer of the upstream node based on a physical transmission medium used to connect the third interface of the target node and the fourth interface of the upstream node;
[0060] The first data packet is obtained according to the second data packet.
[0061] In a specific implementation, the physical layer of the target node may receive the second data packet sent by the physical layer of the upstream node through the third interface, the physical transmission medium used to connect the third interface and the fourth interface, and the fourth interface. Figure 5 As shown, the target node is a target chip for transmission based on the physical layer, the third interface is set on the target chip, the upstream node is an upstream chip for transmission based on the physical layer, and the fourth interface is set on the upstream chip. Based on this, the target chip receives the second data packet from the upstream chip through the third interface, the physical transmission medium for connecting the third interface and the fourth interface, and the fourth interface, so as to realize that the physical layer of the target node receives the second data packet from the physical layer of the upstream node.
[0062] In one embodiment of the present application, the physical layer of the target node receives the second data packet sent by the physical layer of the upstream node through the physical transmission medium, and obtains the first data packet based on the second data packet. As a result, the data packet transmission between the upstream node and the target node is directly transmitted based on the physical layer, without the need for more complex post-encapsulation forwarding processing by the MCU of the upstream node, and without more complex decapsulation processing by the target node, which can make the transmission time of the second data packet shorter, and therefore, can reduce the transmission delay of data transmission between the upstream node and the target node, and improve the transmission efficiency. It should be understood that the process of obtaining the first data packet based on the second data packet does not require re-decapsulation and encapsulation of the data packet, and only reads and writes the second data packet to obtain the first data packet.
[0063] In a possible implementation, the physical layer of the target node sends the first data packet to the physical layer of the downstream node in real-time streaming. The real-time streaming transmission and processing of the data packet means that the destination node immediately processes the data packet in real time when the data packet arrives at the destination node, rather than waiting until the entire data packet is completely received before processing or transmitting.
[0064] In one embodiment of the present application, the target node implements data transmission and processing in real-time streaming. Therefore, compared with the data packets based on switch transmission or other software-based or wireless transmission in the related art, which need to wait until all the data of the data packet is completely received before transmission or processing, the first data packet sent by the target node can be almost processed in real time by the physical layer of the downstream node, that is, the downstream node processes and transmits it immediately after obtaining a part of the data in the first data packet, thereby further reducing the data transmission delay and ensuring that the data in the first data packet can be transmitted and processed in real time.
[0065] In a possible implementation, the first data packet includes multiple data fields, and the multiple data fields are divided into multiple time slices in time, so that the data fields arranged earlier in the multiple data fields are processed and transmitted by the target node first in time.
[0066] In the first data packet, the time corresponding to the time slice of the data field arranged earlier in the order is before the time corresponding to the time slice of the data field arranged later in the order.
[0067] For example, Figure 6 is a schematic diagram of a first data packet of an embodiment of the present application, such as Figure 6 As shown, the first data packet includes data field 1, data field 2 and data field 3. The time corresponding to the time slice of data field 1 is before the time corresponding to the time slice of data field 2, and the time corresponding to the time slice of data field 3 is after the time corresponding to the time slice of data field 2. After receiving the first data packet, the target node can read and write data field 1, data field 2 and data field 3 in sequence, instead of processing the data after receiving all the data loaded in data field 1, data field 2 and data field 3, so as to achieve that the data fields arranged earlier in the first data packet are processed and transmitted earlier by the target node in time.
[0068] In one embodiment of the present application, by adopting a scheme in which each data field in the first data packet has a corresponding time slice, the target node can, after receiving the first data packet, perform data processing such as reading and writing on each data field in the first data packet in sequence according to the arrangement order of the data fields in the first data packet from front to back, so that the data fields with an earlier arrangement order in the first data packet are processed and transmitted by the target node earlier in time, so that the data fields in the first data packet can be processed and transmitted immediately after being obtained, thereby reducing the delay in data transmission and ensuring that the data in the first data packet can be transmitted and processed in real time as much as possible.
[0069] In a possible implementation, obtaining the first data packet according to the second data packet includes the following processing:
[0070] Perform at least one of the following processes on the second data packet through the physical layer of the target node to obtain the first data packet:
[0071] i. If the second data packet includes target data, the target data is read from the second data packet, wherein the target data includes data whose destination node is the target node or public data of a transmission system where the target node is located.
[0072] ii. If the data to be transmitted is obtained, at least part of the data to be transmitted is written into the second data packet.
[0073] iii. If the second data packet does not include data whose destination node is the target node, and the target node does not obtain the data to be transmitted, the second data packet is determined as the first data packet.
[0074] The data type of each data loaded in the data packet can be any one of multiple data types, and the multiple data types can be Local Interconnect Network (LIN) bus data, Pulse Width Modulation (PWM) data, Inter-Integrated Circuit (I2C) data, Serial Peripheral lnterface (SPI) bus data, Quad Serial Peripheral Interface (QSPI) bus data, General-purpose input / output port (GPIO) data, Ethernet data, Controller Area Network (CAN) bus data, Media Independent Interface (MII) and various extensions and derivative versions of the Media Independent Interface data, Universal Asynchronous Receiver / Transmitter (UART) data, Single Edge Nibble Transmission (SENT) bus data, Peripheral Sensor Interface 5 (PSI5) protocol data, Inter-IC built-in audio bus (ICA) data, and other data. Sound, I2S) data, Time-Division Multiplexing (TDM) data, Analog Microphone (AMIC) data, Digital Microphone (DMIC) data, Analog-to-digital converter (ADC) data, etc.
[0075] Based on this, the public data may be the public data that each node needs to obtain, such as including but not limited to audio data, etc., which is not limited in the embodiments of the present application.
[0076] In one embodiment of the present application, in the process of the target node obtaining the first data packet according to the second data packet, data can be obtained from the second data packet, data to be input can be written into the second data packet, or the second data packet can be directly used as the first data packet. Therefore, compared with realizing data transmission by decapsulating and repackaging data in the MCU, the target node can realize data transmission of the target node more simply and quickly by reading and writing the second data packet, thereby improving data transmission efficiency.
[0077] In one possible implementation, the physical layer of each embodiment of the present application includes an Ethernet physical layer or a private physical layer carried by a low voltage differential signal (LVDS) transmission technology. It should be understood that the embodiments of the present application do not limit the physical layer of various aspects of the present application.
[0078] In one possible implementation, the first data packet is obtained by the target node performing real-time streaming processing on the second data packet. Thus, the target node implements data transmission and processing in real-time streaming. Compared with the switch-based transmission or other software-based or wireless transmission-based data packets in the related technology, which need to wait for all the data of the data packet to be completely received before transmission or processing, the target node can process the data in the second data packet almost in real time, that is, after obtaining a part of the data in the second data packet, it processes and transmits it immediately, thereby further reducing the data transmission delay and trying to ensure that the data in the second data packet can be transmitted and processed in real time.
[0079] In a possible implementation manner, the second data packet includes at least one data field, and the data field in the second data packet that is identified as being in an idle state is an idle field, based on this:
[0080] If the second data packet includes the target data, reading the target data from the second data packet includes the following processing:
[0081] If the second data packet includes a first data field for loading target data, the target data loaded in the first data field is acquired, and the first data field where the target data is located is determined as an idle field.
[0082] Optionally, if the target data is public data, after acquiring the public data loaded in the first data field, the first data field where the public data is located may not be determined as an idle field, that is, the target node only reads the first data field and does not change the original data in the first data field.
[0083] If the data to be transmitted is obtained, at least part of the data to be transmitted is written into the second data packet, including the following processing:
[0084] If data to be transmitted is obtained, at least part of the data to be transmitted is loaded into an idle field or a second data field in the second data packet, wherein the second data field is a data field in which the priority of the data loaded in the second data packet is lower than the priority of the data to be transmitted.
[0085] When getting data from the second packet:
[0086] In a specific implementation, after the target node obtains the target data loaded in the first data field in the second data packet, the first data field corresponding to the target data whose destination node is the target node may be determined as an idle field.
[0087] When writing data to the second packet:
[0088] In a specific implementation, after the target node obtains the data to be transmitted to be written into the second data packet, the data to be transmitted may be loaded into a free field in the second data packet.
[0089] In another specific embodiment, after the target node obtains the data to be transmitted to be written into the second data packet, it can determine whether there is a data field in the second data packet whose priority is lower than the priority of the data to be transmitted. If so, the data loaded in the data field is used as the data to be transmitted and the data to be transmitted is loaded into the data field; otherwise, the data to be transmitted is loaded into the idle field.
[0090] In one embodiment of the present application, after the target node obtains the target data, the first data field where the target data of the target node is located can be determined as an idle field. After the target node obtains the data to be transmitted, the data to be transmitted can be loaded into the idle field or a data field where the priority of the loaded data is lower than the priority of the data to be transmitted. Thus, determining the first data field corresponding to the target data of the target node as an idle field can facilitate loading more data into the second data packet, thereby enabling more valid data to be loaded into the first data packet, thereby improving the efficiency of data transmission.
[0091] In addition, when loading the data to be transmitted into the second data packet, the data to be transmitted can be used to replace the data in the data field whose priority is lower than the priority of the data to be transmitted, thereby ensuring as much as possible that the data with higher priority is loaded into the first data packet first, so that when the target node transmits data based on the first data packet, the transmission delay of the data with higher requirements on data real-time performance is reduced.
[0092] Optionally, after the target node obtains the data to be transmitted to be written into the second data packet, if it is confirmed that there is a data field in the second data packet whose priority is lower than the priority of the data to be transmitted, and the priority of the data loaded in the data field is lower than the target priority, then the priority of the data loaded in the data field is increased, for example, the priority of the data loaded in the data field is increased by one level or increased to a secondary target priority, etc. The target priority is the highest priority or the second highest priority, etc., and the embodiments of the present application do not limit this. In this way, the possibility of data with a lower priority remaining in the target node for too long can be reduced, and the efficiency of data transmission can be improved.
[0093] Among them, illustratively, the priority of data in the embodiment of the present application can be, in order from high to low, the highest priority, timeout priority, high priority and low priority, and the second highest priority is the timeout priority. The embodiment of the present application does not limit the specific setting of the data priority.
[0094] In a possible implementation, if the data to be transmitted is obtained, at least part of the data to be transmitted is written into the idle field or the second data field in the second data packet, including the following processing:
[0095] If multiple data to be transmitted are acquired, at least a portion of each data to be transmitted is loaded into the idle field or the second data field in order of priority from high to low.
[0096] In one embodiment of the present application, for the data to be transmitted acquired by the target node, if there are multiple data to be transmitted, at least part of each data to be transmitted is written into the second data packet in order of corresponding priorities from high to low. Thus, the target node writes the data to be transmitted with higher priority into the second data packet in priority by setting the data priority, so that the first data packet can be loaded with data sub-blocks with higher priority first, thereby improving the transmission efficiency of the data with higher data real-time requirements when the target node performs data transmission.
[0097] In a possible implementation, the data transmission method further includes the following processing:
[0098] If the second data packet includes multiple first data fields, after obtaining the target data loaded in the multiple first data fields, the target data loaded in each first data field is processed in descending order of priority.
[0099] In one embodiment of the present application, for the target data in the second data packet acquired by the target node, the target node can process the target data in order from high to low in the corresponding priority. Thus, the target node can preferentially process the data with higher priority acquired from the second data packet, thereby improving the transmission efficiency of the data with higher real-time requirements when the target node performs data transmission.
[0100] In a possible implementation, the data transmission method further includes:
[0101] If the retention time of the data to be transmitted at the target node is greater than the preset time threshold, and the priority of the data to be transmitted is lower than the second highest priority, the priority of the data to be transmitted is increased. The time threshold can be set according to actual needs, and the embodiment of the present application does not limit this.
[0102] The priorities based on the data sub-blocks can be, in descending order, the highest priority, the timeout priority, the high priority, and the low priority, where the second highest priority is the timeout priority:
[0103] In a specific embodiment, if the priority of the data to be transmitted is lower than the timeout priority, then when the retention time of the data to be transmitted at the target node is greater than a preset time threshold, the priority of the data to be transmitted can be increased by one level, and the retention time of the data to be transmitted at the target node is recalculated. After the retention time of the data to be transmitted at the target node is greater than the preset time threshold again, the priority of the data to be transmitted is increased by one level again... until the data to be transmitted is written into the second data packet, or the priority of the data to be transmitted reaches the timeout priority.
[0104] In another specific embodiment, if the priority of the data to be transmitted is lower than the timeout priority, then when the retention time of the data to be transmitted in the target node is greater than a preset time threshold, the priority of the data to be transmitted can be raised to the timeout priority.
[0105] In one embodiment of the present application, for data to be transmitted with a priority lower than the second highest priority, if the retention time of the data sub-block to be written in the target node is greater than a preset time threshold, the priority of the data to be transmitted is increased. In this way, the possibility that the data to be transmitted is not written to the second data packet for too long due to the small number of free fields in the second data packet or the low priority of the data to be transmitted can be reduced, and the possibility that the data to be transmitted is retained in the target node for too long can be reduced, so the data transmission efficiency of the target node can be improved.
[0106] In a possible implementation, sequentially loading at least part of each to-be-transmitted data into the idle field or the second data field includes the following processing:
[0107] For each data to be transmitted, if the data amount of the data to be transmitted is greater than the capacity of the data field, the data to be transmitted is split into at least two sub-data, and the at least two sub-data are loaded into the idle field or the second data field respectively; if the data amount of the data to be transmitted is less than or equal to the capacity of the data field, the data to be transmitted is loaded into the idle field or the second data field.
[0108] In one embodiment of the present application, whether to split the data to be transmitted can be determined based on the relationship between the capacity of the data field and the size of the data to be transmitted. Thus, when the amount of data to be transmitted is large, the data to be transmitted can be split so as to facilitate loading into multiple data fields of the second data packet, thereby improving the applicability of data transmission.
[0109] In a possible implementation manner, the data to be transmitted is data acquired by the physical layer of the target node from an external device connected to the target node or a local module included in the target node.
[0110] In one embodiment of the present application, the data to be transmitted acquired by the target node is directly acquired through the physical layer, thereby eliminating the need for encapsulation or decapsulation operations, thereby reducing the transmission delay of the target node in transmitting data.
[0111] In a possible implementation, the above processing according to the target data loaded in each first data field includes the following processing:
[0112] The external device connected to the target node or the local module included in the target node is read and written according to the target data loaded in each first data field.
[0113] Among them, if the target node is connected to an external device, the external device of the target node can be a Local Interconnect Network (LIN) bus external device, a Pulse Width Modulation (PWM) driving device, an Integrated Circuit Bus (I2C) external device, a Serial Peripheral lnterface (SPI) bus external device, a Quad Serial Peripheral Interface (QSPI) bus external device, a General-purpose input / output port (GPIO) external device, an Ethernet external device, a Controller Area Network (CAN) bus external device, a Media Independent Interface (MII) and various extensions and derivative versions of the Media Independent Interface external devices, a Universal Asynchronous Receiver / Transmitter (UART) external device, a Single Edge Nibble Transmission (SENT) bus external device, a Peripheral Sensor Interface 5 (Peripheral Sensor Interface) 5, PSI5) protocol external device, integrated circuit built-in audio bus (Inter-IC Sound, I2S) external device, time division multiplexing (Time-Division Multiplexing, TDM) external device, analog microphone (AnalogMicrophone, AMIC) external device, digital microphone (Digital Microphone, DMIC) external device, analog-to-digital converter (Analog-to-digital converter, ADC) external device. At least one of the above.
[0114] The local module included in the target node may be a register set inside the target node, which is not limited in the embodiment of the present application.
[0115] In one embodiment of the present application, the target node can read and write the external device connected to the target node and / or the local module included in the target node according to the target data obtained from the second data packet. Therefore, when the target node reads and writes the external device connected to the target node and / or the local module included in the target node, it can directly use the obtained target data without encapsulation or decapsulation operations, which can reduce the transmission delay of the target node in performing data transmission.
[0116] Corresponding to the first data packet being generated by the target node and the first data packet being obtained by the target node after processing the received second data packet, the target node and the downstream node have at least the following two application scenarios:
[0117] In a possible implementation, corresponding to the first data packet being generated by a target node, the target node and the downstream node may be applied to a transmission system, the transmission system includes a main node and a plurality of sub-nodes, the main node and the plurality of sub-nodes are sequentially connected to form a link, based on this:
[0118] If the link is a ring topology, the target node is the master node, and the downstream node is any child node adjacent to the master node;
[0119] If the link is a linear topology, and the first subnode and the second subnode are located at the two ends of the link respectively, then the target node is the main node and the downstream node is any subnode adjacent to the main node, or the target node is the first subnode and the downstream node is a subnode adjacent to the first subnode, or the target node is the second subnode and the downstream node is a subnode adjacent to the second subnode;
[0120] If the link is a linear topology, and the main node and the third subnode are located at both ends of the link respectively, then the target node is the main node and the downstream node is a subnode adjacent to the main node, or the target node is the third subnode and the downstream node is a subnode adjacent to the third subnode.
[0121] In another possible implementation, the first data packet is obtained by the target node processing the received second data packet, the target node and the downstream node are applied to a transmission system, the transmission system includes a main node and multiple sub-nodes, the main node and the multiple sub-nodes are sequentially connected to form a link, based on this:
[0122] The link is a ring topology, or the link is a linear topology and the first sub-node and the second sub-node are located at two ends of the link respectively, or the link is a linear topology and the master node and the third sub-node are located at two ends of the link respectively;
[0123] The target node is any child node, and the upstream node and the downstream node are two nodes adjacent to the target node in the link.
[0124] For example, when the link is a ring topology, the structure of the transmission system can be as follows: Figure 7 When the link is a linear topology, and the first sub-node and the second sub-node are located at the two ends of the link, the structure of the transmission system can be as follows: Figure 8 As shown, Figure 8 The first subnode in the transmission system may be subnode D and the second subnode may be subnode C; when the link is a linear topology, and the master node and the third subnode are located at both ends of the link, the structure of the transmission system may be as follows: Fig. 9 As shown, Fig. 9 The third child node in is child node A.
[0125] exist Figure 7-9 In the figure, subnode A, subnode B, subnode C, subnode D, subnode E, subnode F and subnode G are all subnodes, and at least some of the subnodes are connected to at least one external device, for example, subnode E is connected to external device e1, external device e2 and external device e3.
[0126] It should be noted that the embodiment of the present application does not limit the number of sub-nodes and the number of external devices connected to the sub-nodes, and in order to make the schematic diagram as concise and clear as possible, the schematic diagram of the transmission system in the embodiment of the present application only illustrates the external devices connected to the sub-node E, namely, the external device e1, the external device e2 and the external device e3, and the external devices of the sub-nodes A, B, C, D, F and G are not shown. Figure 7-9 Indicated in.
[0127] In one embodiment of the present application, by setting the above-mentioned transmission system applied by the target node, the downstream node and the upstream node, compared with using multiple subsystems corresponding to different types of buses for transmitting multiple types of data, the transmission system can realize mixed transmission of multiple types of data through a link, so that the wiring of the transmission system is relatively simple and the weight of the wire harness is relatively small, which is convenient for the assembly and maintenance of the transmission system. In addition, different nodes in the transmission system transmit data through the physical layer, eliminating the MCU, and the transmission system does not need to use a switch, saving costs.
[0128] Alternatively, a link in a linear topology can be obtained by disconnecting any two adjacent nodes in a ring topology. For example, Figure 8 The links in Figure 7 When the sub-node C fails, the link disconnects the sub-node C and the sub-node D. Fig. 9 The links in Figure 7 The middle link is obtained by disconnecting the main node and sub-node A when sub-node A fails.
[0129] Optionally, the master node in the transmission system can periodically send and receive data packets in the link to minimize conflicts in data transmitted within the link, and can also minimize the delay of data transmission within the link to meet the more stringent delay requirements of audio data.
[0130] In one possible implementation, the first data packet includes at least one data field, and the data type of the data loaded in each data field is any one of the above-mentioned multiple data types. Therefore, the data types of different data sub-blocks in the first data packet can be the same or different, and the target node can realize mixed transmission of data corresponding to different data types through the first data packet. Compared with using nodes corresponding to different data types for data transmission in order to transmit data of multiple data types, the setting of the first data packet can enable the target node to transmit data of more data types, and thus the transmission system composed of the target nodes can be simpler and less costly.
[0131] In a possible implementation, the data field includes a data sub-block and a sub-block header. The data sub-block is used to load the main data, and the sub-block header is used to load the attribute information of the main data. The attribute information of the main data includes the data type information of the main data and the data length of the main data.
[0132] In one possible implementation, the attribute information of the main data also includes at least one or more of the idle information of the data field where the main data is located, the data transmission direction of the target node, the source node information of the main data, the destination node information of the main data, the priority information of the main data, and the sequence number information of the main data.
[0133] The following is a specific example using the attribute information of the main data loaded in the first data packet as an example:
[0134] The above data type information may be an identifier of an interface corresponding to the main body data in the source node corresponding to the main body data. The data amount of the identifier may be 5 bits. Each interface in the source node corresponding to each main body data has a corresponding data type. The data type corresponding to the same interface is single. The data types corresponding to any two different interfaces may be the same or different.
[0135] The data length may be 8 bits.
[0136] The amount of idle information data in the data field where the main data is located may be 1 bit, and the idle information may be used to identify whether the data field is in an idle state;
[0137] The data transmission direction of the target node may be a direction in which the target node transmits the first data packet in the transmission system used by the target node. Usually, when the target node is the master node, the attribute information of the subject data in the first data packet generated by the target node includes the data transmission direction. Otherwise, the attribute information of the data sub-block in the first data packet usually does not include the data transmission direction.
[0138] The above-mentioned source node information may be a source node identifier. If the source node is the above-mentioned child node or the above-mentioned main node, the data amount of the source node identifier may be 5 bits. If the source node is the above-mentioned child node or a branch node connected to the above-mentioned main node, the data amount of the source node identifier may be 3 bits.
[0139] The above-mentioned destination node information may be a destination node identifier. If the destination node is the above-mentioned child node or the above-mentioned main node, the data amount of the destination node identifier may be 5 bits. If the destination node is the above-mentioned child node or a branch node connected to the above-mentioned main node, the data amount of the destination node identifier may be 3 bits.
[0140] The priority information is used to indicate the priority of the corresponding main body data, and the data amount thereof may be 2 bits;
[0141] The above-mentioned sequence number information can be a sequence number identifier with a data volume of 2 bits. In particular, since the priority corresponding to the main data is the highest priority, the first data packet can also include an alternative field for the data field where the main data is located, so that when the destination node corresponding to the main data processes the main data, if an error occurs in the main data, it is processed according to the main data in the alternative field, thereby reducing the bit error rate of the highest priority data and improving the data transmission reliability of the highest priority data. The alternative field is exactly the same as the main data loaded in the data field, but the sequence number information in the attribute information of the two is different, so that the two are distinguished by their sequence number information; the number of alternative fields of any data field with alternative fields can be 1, 2 or 3, etc., and the embodiment of the present application does not limit the number of alternative fields of the data field with alternative fields. The number of data field intervals between a data field and its adjacent alternative field, and between two adjacent alternative fields of the same data field can be set to 0, 1 or 2, etc., and the embodiment of the present application does not limit this.
[0142] It should be noted that the above-mentioned data type information and data length are usually essential information in the attribute information of the corresponding main data. The other information included in the attribute information of the above-mentioned main data is usually related to the application scenario and / or transmission system form of the first data packet, and the embodiments of the present application do not limit this.
[0143] The attribute information of the main data loaded in the second data packet is the same as the attribute information of the main data loaded in the first data packet, and will not be described in detail in the embodiment of the present application.
[0144] Based on this, when writing the data to be transmitted into the data field in the second data packet, the data to be transmitted is used as the main data, and the attribute information of the main data is generated, so that the data to be transmitted is loaded into the data sub-block of the data field as the main data, and the attribute information of the main data is loaded into the sub-block header of the data field; when reading the target data from the data field in the second data packet, the data loaded in the data field where the main data of the target data is located in the second data packet is obtained.
[0145] In one embodiment of the present application, the sub-block header is used to load the attribute information of the main data. The attribute information of the main data is relatively comprehensive, so that the main data can be more accurately obtained from the first data packet or the second data packet, and the target node can also process the main data more accurately, thereby reducing the bit error rate of data transmission. In addition, the first data packet can also load data sub-blocks of different data types through the loaded attribute information.
[0146] In a possible implementation, the data sub-block is also used to load a check bit, and the check bit is used to check the main body data loaded in the data sub-block.
[0147] For example, the main data in any data sub-block is a plurality of first numerical values, the check bit included in the data sub-block is a second numerical value, and the check bit is used to determine whether the sum of the corresponding main data is the check bit, so that the destination node of the main data can determine the correctness of the main data. Then, in the destination node of the main data, if it is determined that the sum of the above-mentioned plurality of first numerical values is the second numerical value, the main data is correct; otherwise, the main data is incorrect.
[0148] In one embodiment of the present application, the data sub-block is also used to install a check bit for verifying the main data, which can reduce the possibility of the target node processing erroneous main data and improve the reliability of data transmission by the target node.
[0149] Furthermore, according to the actual application scenario, the master node may specify the specific format of the data loaded in the data field. For example, if it is data for local access data, the data may include read and write instructions, addresses, and data to be transmitted, etc.; for example, if it is SPI data, the data may include addresses, data lengths, and data for interacting with external devices, etc.
[0150] In one possible implementation, Figure 3 As shown, the first data packet and the second data packet also include a common header respectively, and the common header is loaded with a leading code corresponding to the first data packet for physical layer protocol identification.
[0151] In a possible implementation, the common header may also carry at least one or more of system information of the transmission system where the target node is located and data type information of at least part of the main data in the data packet where the common header is located.
[0152] The following is a specific example using the public header included in the first data packet as an example:
[0153] The above-mentioned preamble code may be a preamble code for physical coding sublayer (PCS) protocol identification of PHY;
[0154] The system information of the transmission system where the above-mentioned target node is located may include the shape identifier and the data transmission direction identifier of the above-mentioned link, and the data volume of the shape identifier and the data transmission direction identifier can both be 1 bit; in a specific example, if the above-mentioned link is a ring topology, the shape identifier is 0, if the above-mentioned link is a linear topology, the shape identifier is 1, if the above-mentioned link is a ring topology and the first data packet is transmitted in the clockwise direction of the link, then the data transmission direction identifier is 0, if the above-mentioned link is a ring topology and the first data packet is transmitted in the counterclockwise direction of the link, then the data transmission direction identifier is 1, if the above-mentioned link is a linear topology, the first subnode and the second subnode are respectively located at the two ends of the link, and the first data packet is transmitted between any two nodes on the first sub-link, then the data transmission direction identifier is 1, if the above-mentioned link is a linear topology, the first subnode and the second subnode are respectively located at the two ends of the link, and the first data packet is transmitted between any two nodes on the second sub-link, then the data transmission direction identifier is 0. The first sub-link is composed of the main node, the sub-node between the main node and the first sub-node, and the first sub-node, and the second sub-link is composed of the main node, the sub-node between the main node and the second sub-node, and the second sub-node.
[0155] The data type information of at least part of the main data in the data packet where the common header is located may include a first identifier, a second identifier, a third identifier, a fourth identifier and a fifth identifier, wherein the first identifier is used to identify whether the first data packet is loaded with main data of a data type of audio data, and the data amount may be 1 bit; the second identifier is used to identify the transmission direction of the main data of a data type of audio data loaded in the first data packet in the above-mentioned link, and the data amount may be 1 bit; the third identifier is used to identify the data length of the main data of a data type of audio data in the first data packet, and the data amount may be 5 bits; the fourth identifier is used to identify whether there is an Ethernet packet with the same transmission path on the transmission path corresponding to the first data packet in the above-mentioned link, so as to ensure as much as possible that only a single Ethernet packet can be transmitted on the same transmission path; the fifth identifier is used to indicate whether the main data of a data type of GPIO data in the first data packet needs to be expanded, and is used to identify the processing indication information when the destination node of the main data of a data type of GPIO data in the first data packet processes the main data.
[0156] It should be noted that the above-mentioned preamble code is usually essential information in the corresponding common header, and the other information loaded in the above-mentioned common header is usually related to the application scenario and / or transmission system form of the first data packet, which is not limited in this embodiment of the present application.
[0157] The public header in the second data packet is the same as the public header in the first data packet, and will not be described in detail in the embodiment of the present application.
[0158] In one embodiment of the present application, the information loaded in the public header is relatively comprehensive, so that the main data can be obtained more accurately from the first data packet or the second data packet, and the target node can also process the main data more accurately, thereby reducing the bit error rate of data transmission.
[0159] chip
[0160] Fig.10 This is a schematic block diagram of a chip provided in an embodiment of the present application. The specific embodiment of the present application does not limit the specific implementation of the chip. Fig.10 As shown, the chip may include: a processor (processor) 1002 and a memory (memory) 1006.
[0161] in:
[0162] The processor 1002 and the memory 1006 are in communication with each other.
[0163] The processor 1002 is used to execute the program 1010, and specifically can execute the relevant steps in any of the aforementioned data transmission method embodiments.
[0164] Specifically, the program 1010 may include program codes, which include computer operation instructions.
[0165] The processor 1002 may be a CPU, or an application specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0166] RISC-V is an open source instruction set architecture based on the Reduced Instruction Set (RISC) principle. It can be applied to various aspects such as single-chip microcomputers and FPGA chips. Specifically, it can be applied to the fields of IoT security, industrial control, mobile phones, personal computers, etc., and because it is designed with small, fast, and low-power realities in mind, it is particularly suitable for modern computing devices such as warehouse-scale cloud computers, high-end mobile phones, and tiny embedded systems. With the rise of artificial intelligence Internet of Things (AIoT), the RISC-V instruction set architecture has also received more and more attention and support, and is expected to become the next generation of widely used CPU architecture.
[0167] The computer operation instructions in the embodiment of the present application may be computer operation instructions based on the RISC-V instruction set architecture, and correspondingly, the processor 1002 may be designed based on the RISC-V instruction set. Specifically, the chip provided in the embodiment of the present application may be a chip designed using the RISC-V instruction set, and the chip may execute executable code based on the configured instructions, thereby implementing the data transmission method in the above embodiment.
[0168] The memory 1006 is used to store the program 1010. The memory 1006 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0169] The program 1010 can be specifically used to enable the processor 1002 to execute the data transmission method in any of the aforementioned embodiments.
[0170] The specific implementation of each step in program 1010 can refer to the corresponding description of the corresponding steps and units in any of the aforementioned data transmission method embodiments, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the aforementioned method embodiments, which will not be repeated here.
[0171] Through the chip of the embodiment of the present application, the first data packet transmitted at the physical layer can be obtained, and the first data packet can be transmitted to the physical layer of the downstream node through the physical layer of the target node. Thus, the transmission of the first data packet is carried out at the physical layer. Compared with the data packet encapsulation of the multi-layer protocol through the MCU, the first data packet will not include multiple protocol headers, and thus the data to be transmitted in the first data packet accounts for a large proportion, which improves the bandwidth utilization rate of the target node for data transmission; and, since the first data packet is directly transmitted to the downstream node through the physical layer of the target node, it does not need to be transmitted through a switch, nor does it need to be more complexly encapsulated through the MCU of the target node, and further, it does not need to be more complexly parsed at the downstream node, so it can reduce the transmission delay of the target node for data transmission, and realize the target node to send data to the downstream node in real time, thereby improving the transmission efficiency.
[0172] Computer storage media
[0173] The present application also provides a computer-readable storage medium storing instructions for causing a machine to execute the data transmission method as described herein. Specifically, a system or device equipped with a storage medium may be provided, on which a software program code implementing the functions of any of the above embodiments is stored, and a computer (or CPU or MPU) of the system or device reads and executes the program code stored in the storage medium.
[0174] In this case, the program code read from the storage medium itself can implement the function of any one of the above embodiments, so the program code and the storage medium storing the program code constitute part of the present application.
[0175] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer by a communication network.
[0176] It should be noted that the user-related information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to sample data used to train the model, data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0177] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for specific applications, but such implementation should not be considered to be beyond the scope of the embodiments of the present application.
[0178] The above implementation methods are only used to illustrate the embodiments of the present application, and are not limitations on the embodiments of the present application. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the embodiments of the present application. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present application. The scope of patent protection of the embodiments of the present application should be limited by the claims.
Claims
1. A data transmission method, characterized in that: Applied to a target node, the method comprises: Obtaining a first data packet transmitted at the physical layer; Based on a physical transmission medium for connecting a first interface of the target node and a second interface of a downstream node, sending the first data packet to a physical layer of the downstream node through a physical layer of the target node; If the first data packet is obtained by the target node processing a received data packet, the step of obtaining the first data packet transmitted at the physical layer includes: Based on a physical transmission medium for connecting a third interface of the target node and a fourth interface of the upstream node, receiving a second data packet transmitted at the physical layer from the physical layer of the upstream node through the physical layer of the target node; Obtaining the first data packet according to the second data packet through the physical layer of the target node; The step of obtaining the first data packet according to the second data packet includes: Perform at least one of the following processing on the second data packet to obtain the first data packet: i. If the second data packet includes target data, reading the target data from the second data packet, wherein the target data includes data whose destination node is the target node or public data of a transmission system where the target node is located; ii. if data to be transmitted is obtained, writing at least part of the data to be transmitted into the second data packet; iii. If the second data packet does not include data that the destination node is the target node, and the target node has not acquired the data to be transmitted, the second data packet is determined as the first data packet.
2. The method according to claim 1, characterized in that If the first data packet is generated by the target node, the step of obtaining the first data packet transmitted at the physical layer includes: The data to be transmitted is obtained, and the data to be transmitted is encapsulated to obtain the first data packet.
3. The method according to any one of claims 1 to 2, characterized in that The physical layer of the target node sends the first data packet to the physical layer of the downstream node in real-time streaming.
4. The method according to claim 3, characterized in that The first data packet includes a plurality of data fields, and the plurality of data fields are divided into a plurality of time slices in time, so that a data field arranged earlier in the plurality of data fields is processed and transmitted by the target node first in time.
5. The method according to claim 1, characterized in that The first data packet is obtained by the target node performing real-time streaming processing on the second data packet.
6. The method according to claim 1, characterized in that The second data packet includes at least one data field, and the data field in the second data packet marked as being in an idle state is an idle field; If the second data packet includes target data, reading the target data from the second data packet comprises: If the second data packet includes a first data field for loading the target data, acquiring the target data loaded in the first data field, and determining the first data field where the target data is located as an idle field; If the data to be transmitted is obtained, writing at least part of the data to be transmitted into the second data packet comprises: If data to be transmitted is obtained, at least part of the data to be transmitted is loaded into an idle field or a second data field in the second data packet, wherein the second data field is a data field in which the priority of the data loaded in the second data packet is lower than the priority of the data to be transmitted.
7. The method according to claim 6, characterized in that If the data to be transmitted is obtained, writing at least part of the data to be transmitted into the idle field or the second data field in the second data packet comprises: If a plurality of the data to be transmitted are acquired, at least a portion of each of the data to be transmitted is loaded into the idle field or the second data field in order of priority from high to low.
8. The method according to claim 6, characterized in that The method further comprises: If the second data packet includes multiple first data fields, after obtaining the target data loaded in the multiple first data fields, the target data loaded in each first data field is processed in order of priority from high to low.
9. The method according to claim 7 or 8, characterized in that: The method further comprises: If the retention time of the data to be transmitted in the target node is greater than a preset time threshold, and the priority of the data to be transmitted is lower than the second highest priority, the priority of the data to be transmitted is increased.
10. The method according to claim 7, characterized in that The step of sequentially loading at least part of each of the data to be transmitted into the idle field or the second data field comprises: For each of the data to be transmitted, if the data amount of the data to be transmitted is greater than the capacity of the data field, the data to be transmitted is split into at least two sub-data, and the at least two sub-data are loaded into the idle field or the second data field respectively; if the data amount of the data to be transmitted is less than or equal to the capacity of the data field, the data to be transmitted is loaded into the idle field or the second data field.
11. The method according to claim 1 or 2, characterized in that: The data to be transmitted is data acquired by the physical layer of the target node from an external device connected to the target node or a local module included in the target node.
12. The method according to claim 8, characterized in that Processing according to the target data loaded in each of the first data fields includes: The external device connected to the target node or the local module included in the target node is read and written according to the target data loaded in each of the first data fields.
13. The method according to claim 1, characterized in that The first data packet includes at least one data field, and the data field includes a data sub-block and a sub-block header. The data sub-block is used to load main data, and the sub-block header is used to load attribute information of the main data. The attribute information of the main data includes data type information of the main data and data length of the main data.
14. The method according to claim 13, characterized in that The attribute information of the main data also includes at least one or more of the idle information of the data field where the main data is located, the data transmission direction of the target node, the source node information of the main data, the destination node information of the main data, the priority information of the main data, and the sequence number information of the main data.
15. The method according to claim 1, characterized in that The first data packet includes a common header, and the common header is loaded with a preamble code corresponding to the first data packet and used for physical layer protocol identification.
16. The method according to claim 1, characterized in that If the first data packet is obtained by the target node processing a received data packet, the target node, the downstream node and the upstream node are applied to a transmission system, the transmission system includes a master node and a plurality of sub-nodes, and the master node and the plurality of sub-nodes are sequentially connected to form a link; The link is a ring topology, or the link is a linear topology and the first sub-node and the second sub-node are respectively located at two ends of the link, or the link is a linear topology and the master node and the third sub-node are respectively located at two ends of the link; The target node is any of the child nodes, and the upstream node and the downstream node are respectively two nodes adjacent to the target node in the link.
17. A chip, comprising: A processor and a memory, the processor and the memory communicating with each other; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the data transmission method according to any one of claims 1 to 16.
18. A computer storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the data transmission method according to any one of claims 1 to 16 is implemented.
Citation Information
Patent Citations
Node discovery and configuration in daisy chain networks
CN116529720A