WO2022007682A1 - Method and device for sending data - Google Patents
Method and device for sending data Download PDFInfo
- Publication number
- WO2022007682A1 WO2022007682A1 PCT/CN2021/103659 CN2021103659W WO2022007682A1 WO 2022007682 A1 WO2022007682 A1 WO 2022007682A1 CN 2021103659 W CN2021103659 W CN 2021103659W WO 2022007682 A1 WO2022007682 A1 WO 2022007682A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- network node
- data
- controlled device
- time period
- control
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04Q—SELECTING
- H04Q11/00—Selecting arrangements for multiplex systems
- H04Q11/0001—Selecting arrangements for multiplex systems using optical switching
- H04Q11/0062—Network aspects
- H04Q11/0067—Provisions for optical access or distribution networks, e.g. Gigabit Ethernet Passive Optical Network (GE-PON), ATM-based Passive Optical Network (A-PON), PON-Ring
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/004—Arrangements for detecting or preventing errors in the information received by using forward error control
- H04L1/0056—Systems characterized by the type of code used
- H04L1/0061—Error detection codes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04Q—SELECTING
- H04Q11/00—Selecting arrangements for multiplex systems
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04Q—SELECTING
- H04Q11/00—Selecting arrangements for multiplex systems
- H04Q11/0001—Selecting arrangements for multiplex systems using optical switching
- H04Q11/0062—Network aspects
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W72/00—Local resource management
- H04W72/04—Wireless resource allocation
Definitions
- the present application relates to the field of communications, and in particular, to a method and apparatus for sending data.
- the industrial control network connects the control device and the controlled device, and the control device can control the controlled device through the industrial control network.
- the controlled device can be an industrial robot, and the control device can control the industrial robot through an industrial control network, so that the industrial robot can perform production operations.
- the current industrial control network can be carried by passive optical network (PON).
- PON includes optical line terminal (OLT) and multiple optical network units (ONU).
- OLT is connected to each connected to each ONU.
- the control equipment is connected with the OLT, and each controlled equipment is connected with an ONU.
- the time slot corresponding to each ONU in the PON in one cycle is determined in advance.
- the OLT receives the control command from the control device and sends the control command to the ONU connected to the controlled device; the ONU sends the control command to the controlled device and receives the controlled device Returns response data for this control command.
- the ONU sends the response data to the control device through the OLT.
- the time slot corresponding to the ONU in the current cycle is outdated, and in the time slot corresponding to the ONU in the next cycle, the ONU sends the response data to the control device through the OLT. This solution may result in a longer delay in data transmission.
- the present application provides a method and apparatus for sending data, so as to reduce the delay of data sending.
- the technical solution is as follows:
- the present application provides a method for sending data, and the method is applied in a network including a plurality of controlled devices.
- the first network node receives control data sent by the control device, where the control data is used to control at least one controlled device among the multiple controlled devices.
- the first network node sends a first data frame to the second network node, where the first data frame includes control data and configuration information of the first time period, the second network node is connected to the at least one controlled device, and the time of the first time period
- the length is determined based on the data volume corresponding to the second network node, the data volume is equal to the cumulative value of the data volume of the response data that needs to be sent by each controlled device in the at least one controlled device, and the configuration information is used for the second network node.
- the network node determines the first time period and forwards the response data sent by each controlled device in the first time period.
- the second network node connected to the at least one controlled device needs to send the response data of the controlled device to the first network node, so that at the second network node
- the first time period is allocated to the second network node, and the first time period is used to send response data, and there is no need to wait for the arrival of the first time period for a long time, which avoids wasting time resources and reducing time. Small delay for sending data.
- the first time period is allocated according to the data volume corresponding to the second network node, it is ensured that the first time period can be just used for the second network node to send data, thereby further avoiding the waste of time resources.
- the first network node allocates the first time period to the second network node according to the attribute information of the second network node and the data amount corresponding to the second network node.
- the start time of the first time period of the second network node is determined according to the attribute information of each second network node, thereby ensuring that the first network node can continuously and uninterruptedly receive response data sent by different second network nodes.
- the attribute information of the second network node includes a performance parameter of the second network node and/or a transmission delay from the second network node to the first network node. Since different second network nodes have different performances and different distances from different second network nodes to the first network node, when the attribute information includes the performance parameters and/or the transmission time delay of the second network node, according to the second network node's The attribute information allocates the first time period to ensure that the first network node can continuously and uninterruptedly receive response data sent by different second network nodes.
- the first network node acquires attribute information of the second network node.
- the number of control devices connected to the first network node is multiple, each control device in the multiple control devices corresponds to a different second time period, and at least one controlled device is controlled by multiple control devices. Controlled by one of the control devices, the first time period is within the second time period corresponding to the one control device. In this way, an industrial control network can be used for different control equipment to control the controlled equipment, and the utilization rate of the industrial control network can be improved.
- the first network node acquires, according to the control data, the data amount of response data that needs to be sent by each controlled device. In this way, the amount of data corresponding to the second network node can be further obtained, so that the first time period can be accurately calculated.
- control data includes commands for controlling each controlled device.
- the first network node acquires, according to the type of the command of each controlled device, the data amount of response data that needs to be sent by each controlled device.
- the first network node receives response data of each controlled device sent by the second network node within the first time period.
- the first network node sends a second data frame to the control device, where the second data frame includes the response data of each controlled device arranged according to the sequence of receiving the response data of each controlled device.
- the present application provides an apparatus for sending data, which is used to execute the method in the first aspect or any possible implementation manner of the first aspect.
- the apparatus includes means for performing the method of the first aspect or any one of possible implementations of the first aspect.
- the present application provides an apparatus for sending data, the apparatus comprising: a processor, a memory and a transceiver.
- the processor, the memory and the transceiver may be connected through a bus system.
- the memory is used to store one or more programs, and the processor is used to execute the one or more programs in the memory to cause the apparatus to perform the method of the first aspect or any possible implementation of the first aspect.
- the present application provides a computer-readable storage medium, where program codes are stored in the computer-readable storage medium, and when the computer-readable storage medium runs on a multi-link device, the multi-link device enables the multi-link device to perform the above-mentioned first aspect or the first aspect.
- the present application provides a computer program product comprising program code, which, when the program code runs on a network node, enables the network node to execute the method in the first aspect or any possible implementation manner of the first aspect .
- FIG. 1 is a schematic diagram of a network architecture provided by an embodiment of the present application.
- FIG. 2 is a schematic diagram of another network architecture provided by an embodiment of the present application.
- FIG. 3 is a flowchart of a method for sending data provided by an embodiment of the present application.
- FIG. 4 is a schematic diagram of time period allocation provided by an embodiment of the present application.
- FIG. 5 is a schematic diagram of a data frame transmission provided by an embodiment of the present application.
- FIG. 6 is a schematic structural diagram of an apparatus for sending data provided by an embodiment of the present application.
- FIG. 7 is a schematic structural diagram of another apparatus for sending data provided by an embodiment of the present application.
- an ONU When an ONU sends response data, it may wait until the time slot corresponding to the ONU in the next cycle before sending, resulting in a long delay in data sending.
- the time slot corresponding to some ONUs in a cycle arrives, but the ONU has no data to send to the control device, or the length of the data that the ONU needs to send is short, and the time required to send the data is shorter than the time slot
- the length of the time slot corresponding to the ONU causes waste of time slot resources; or, the length of the data that the ONU needs to send is longer, the time length required to send the data is greater than the length of the time slot, and the ONU needs the ONU in multiple cycles.
- the data is sent in the corresponding time slot, resulting in a long delay in data sending.
- an embodiment of the present application provides a network architecture, and the network architecture may be a point-to-multipoint tree network architecture.
- the network architecture includes a first network node and a plurality of second network nodes. A network connection is established between the first network node and each of the second network nodes.
- any second network node there is no other network node on the network connection between the first network node and the second network node. That is, the data sent by the first network node to the second network node or the data sent by the second network node to the first network node may not need to be forwarded by other network nodes. or,
- the network connection between the first network node and the second network node may also include one or more forwarding nodes, and the forwarding nodes are used for transmitting Data communicated between the first network node and the second network node.
- the network architecture can be used as an industrial control network for the control device to control multiple controlled devices.
- the control device communicates with the first network node, and each controlled device communicates with a second network node.
- the process that the control device controls the controlled device may include: the control device sends the control data corresponding to each of the N controlled devices to the first network node, where N is an integer greater than 0.
- the first network node determines M second network nodes according to the control data corresponding to each controlled device, and each second network node in the M second network nodes is connected to one or more of the N controlled devices.
- a controlled device is different from the controlled device connected to each second network node.
- the first network node allocates a different first time period to each second network node, and sends control data corresponding to the controlled device connected to each second network node to each second network node. For any second network node, the second network node sends the control data corresponding to the controlled device to the controlled device connected to it, receives the response data from the controlled device in response to the control data, and the second network node corresponds to the control data.
- the response data of the controlled device is sent to the first network node in the first time period.
- the first network node sends the response data of the controlled device to the control device.
- the control device manages three controlled devices: controlled devices 1 to 3, the controlled device 1 communicates with the second network node 1, the controlled device 2 communicates with the second network node 2, and the controlled device 3 Communicate with the second network node 3 .
- the second network nodes 1 to 3 communicate with the first network node, respectively.
- the control device sends the control data corresponding to each of the controlled devices 1 to 3 to the first network node, and the first network node receives the control data corresponding to each of the controlled devices 1 to 3 according to the received control data. It is determined that the controlled devices 1 to 3 communicate with the first network node via the second network nodes 1 to 3 respectively.
- the first network node allocates the first time period 1 to the second network node 1, the first network node allocates the first time period 2 to the second network node 2, and the first network node allocates the first time period 3 to the second network node 3 .
- the first network node sends the control data corresponding to the controlled device 1 to the second network node 1, sends the control data corresponding to the controlled device 2 to the second network node 2, and sends the control data corresponding to the controlled device 3 to the second network node 3. corresponding control data.
- the second network node 1 receives the response data sent by the controlled device 1, and sends the response data of the controlled device 1 to the first network node in the first time period 1; the second network node 2 receives the response data sent by the controlled device 2, Send the response data of the controlled device 2 to the first network node in the first time period 2; the second network node 3 receives the response data sent by the controlled device 3, and sends the controlled device to the first network node in the first time period 3. 3 response data.
- the second network node 1 can also communicate with the controlled device 4, send to the controlled device 4 the control data corresponding to the controlled device 4 sent by the control device via the first network node, and will be sent to the controlled device 4 by the control device via the first network node.
- the response data sent by the control device 4 is sent to the first network node.
- control devices may also be included, and other control devices and the control device in FIG. 1 may share load or form a master-standby relationship.
- the first network node is connected to multiple control devices, and each control device corresponds to a group of controlled devices.
- each controlled device in a group of controlled devices corresponding to the control device is connected to a second network node.
- the control device controls a group of controlled devices corresponding to the control device through the network architecture.
- the first network node is connected to the control device 1 and the control device 2, and a group of controlled devices corresponding to the control device 1 includes the controlled device 1, the controlled device 2, and the controlled device 3.
- the controlled device 1 , the controlled device 2 and the controlled device 3 are respectively connected to the second network node 1 , the second network node 2 and the second network node 3 .
- a set of controlled devices corresponding to control device 2 includes controlled device 4, controlled device 5 and controlled device 6.
- the network node 2 is connected to the second network node 3 .
- the first network node is connected to one or more control devices through an interface.
- the interface may be a high-speed serial computer expansion bus standard (peripheral component interconnect express, PCIe) interface or an Ethernet (ethernet, Eth) interface, or the like.
- the second network node is connected to the controlled device through an interface.
- the interface may be an input/output (input/output, I/O) interface or the like.
- the network architecture is a PON
- the first network node is an OLT
- the second network node is an ONU.
- the network architecture is a wireless network architecture
- the network connection between the first network node and each second network node is a wireless connection.
- the controlled devices connected to each second network node are powered by strong electricity, and the network architecture is a PON or wireless network architecture, so that the network architecture will not be disturbed and affected by the strong electricity. .
- the first network node is connected to the optical splitter, and each second network node is connected to the optical splitter, thereby ensuring that the first network node can communicate with multiple second network nodes.
- a network connection is established between.
- the optical splitter is an optical splitter with a split ratio of 1:64
- the optical splitter can be connected to 64 second network nodes, that is to say, the first network node can be established with 64 second network nodes through the optical splitter Internet connection.
- the first network node may be connected to multiple optical splitters, so that the first network node may establish network connections with more second network nodes, thereby expanding the scale of the industrial control network.
- a multi-stage optical splitter is included between the first network node and the second network node.
- control device may be a programmable logic controller (programmable logic controller, PLC), and the above-mentioned controlled device may be an industrial robot, a robotic arm, a sensor, a switch, or the like.
- PLC programmable logic controller
- an embodiment of the present application provides a method for sending data, and the method can be applied to the network architecture shown in FIG. 1 or FIG. 2 , including:
- Step 301 The first network node receives control data corresponding to each of the N controlled devices sent by the control device, where N is an integer greater than 0.
- control data of the controlled device includes an identifier of the controlled device and a command for controlling the controlled device.
- control data of the controlled device further includes the data volume of the response data that the controlled device needs to respond to the command.
- the command is a read command
- the control data may include the data amount of response data of the controlled device in response to the read command.
- the response data is the data that the control device needs to read from the controlled device.
- control data of the controlled device may also not include the data amount of the response data that the controlled device needs to respond to the command.
- the type of response data that the controlled device responds to the command is obtained, and the type of response data is often data of a fixed size. Therefore, the data volume of the response data sent by the controlled device can be determined according to the control data of the controlled device.
- control device sends an Ethernet packet or an Ethernet frame to the first network node, where the Ethernet packet or Ethernet frame includes control data corresponding to each of the N controlled devices.
- the command included in the control data of the controlled device is a command used to control the switch to be turned on or off
- the response data of the controlled device in response to the command is a turn-on success indication message, a turn-on failure indication message, a turn-off success indication message or a turn-off indication message.
- the data volume of the failure indication message, the open success indication message, the open failure indication message, the close success indication message, and the close failure indication message are all equal and have a fixed size.
- the command included in the control data of the controlled device is a positioning command
- the response data of the controlled device in response to the command is the location information of the controlled device, and the data including the location information of the controlled device is often fixed-size data. .
- the first network node is connected to multiple control devices, each control device corresponds to a group of controlled devices, and the N controlled devices belong to a group of controlled devices corresponding to one control device, that is, the N controlled devices. Devices are controlled by the same control device.
- the first network node may receive control data of the controlled device sent by different control devices, and determine the control of the controlled device controlled by each control device from the received control data of the controlled device. data.
- Step 302 The first network node determines M second network nodes, and acquires the data amount corresponding to each second network node, where M is an integer greater than 0 and less than or equal to N.
- Each of the M second network nodes is connected to one or more of the N controlled devices, wherein the controlled device connected to each of the second network nodes is different.
- the data volume corresponding to the second network node is equal to the data volume of response data sent by the controlled device connected to the second network node.
- the first network node determines the M second network nodes according to the control data of each of the N controlled devices.
- the first network node determines a second device connected to the controlled device according to the identifier of the controlled device included in the control data of the controlled device network node.
- the first network node stores a correspondence between the identifier of the second network node and the identifier of the controlled device, and any record in the correspondence includes the identifier of a second network node and the identifier of the second network node.
- the first network node for each controlled device in the N controlled devices, the first network node, according to the identifier of the controlled device included in the control data of the controlled device, from the second network node.
- the identifier of the second network node connected to the controlled device is obtained from the corresponding relationship between the identifier and the identifier of the controlled device, and the second network node connected to the controlled device is determined according to the identifier of the second network node.
- the first network node obtains data corresponding to the second network node according to the control data of each controlled device connected to the second network node quantity.
- control data of the controlled device includes the data volume of the response data that the controlled device needs to send
- the control data from the controlled device Obtain the data volume of the response data that the controlled device needs to send in the , determine the type of response data that the controlled device needs to send, and determine the data volume of the response data that the controlled device needs to send according to the type.
- the data amount of response data that needs to be sent by each controlled device connected to the second network node is accumulated to obtain the data amount corresponding to the second network node.
- the first network node may store a correspondence between the type of response data and the amount of data, and any record in the correspondence includes a type and amount of response data.
- the data volume of the response data to be sent by the controlled device is obtained from the correspondence between the type of response data and the data volume according to the type.
- Step 303 For each second network node, the first network node allocates a first time period to the second network node according to the data volume corresponding to the second network node.
- the time length of the first time period of the second network node is determined based on the amount of data corresponding to the second network node.
- the first network node determines the time period length of the second network node according to the data amount corresponding to the second network node.
- the first network node calculates the time length of the first time period of each second network node according to the data volume corresponding to each second network node and the uplink bandwidth corresponding to each second network node.
- the time length of the first time period of the second network node 1 is determined to be 20 milliseconds;
- the time length of the first time period of the network node 2 is 25 milliseconds;
- the time length of the first time period of the second network node 3 is determined to be 15 milliseconds.
- the first network node determines the start time of the first time period of the second network node according to the time length of the first time period of the second network node, so as to obtain the first time period of the second network node.
- the first time period of each second network node may be obtained in the following first and second manners.
- the two methods are:
- the delay of each of the M second network nodes is the same, and the first network node determines that each of the M second network nodes sends response data According to the time length of the first time period of each second network node and the order in which each second network node sends the response data, determine the start time of the first time period of each second network node, so as to obtain A first time period for each second network node.
- the delay of the second network node is equal to the transmission delay from the second network node to the first network node, the processing delay of the second network node, or the transmission delay of the second network node and the processing delay of the second network node accumulated value.
- the transmission delay of the second network node is determined by the distance from the second network node to the first network node, and the processing delay of the second network node is determined by the processing performance of the second network node.
- the M second network nodes include second network node 1 , second network node 2 and second network node 3 .
- the determined sequence is the second network node 1, the second network node 2, and the second network node 3, based on the time length of the first time period of the second network node 1 of 20 milliseconds, the first time of the second network node 2
- the time length of the segment is 25 milliseconds
- the time length of the first time segment of the third network node 3 is 15 milliseconds
- the first time segment of the second network node 1 is determined to be 0 to 20 milliseconds
- the first The time period is the 21st to 45th milliseconds
- the first time period of the second network node 3 is the 46th to 60th milliseconds.
- the first network node sends the control data 1 of the controlled device 1, the control data 2 of the controlled device 2, and the control of the controlled device 3 to the second network node 1, the second network node 2, and the second network node 3, respectively.
- Data 3 After sending the control data 1 to the controlled device 1 , the second network node 1 continuously sends response data 1 with a length of 20 milliseconds to the first network node, and the response data 1 is the data sent by the controlled device 1 .
- the second network node 2 sends the control data 2 to the controlled device 2, when the delay reaches the 21st millisecond, it continuously sends the response data 2 with a length of 25 milliseconds to the first network node, and the response data 2 is the data sent by the controlled device 2. .
- the second network node 3 After the second network node 3 sends the control data 3 to the controlled device 3, when the delay reaches the 46th millisecond, it continuously sends the response data 3 with a length of 15 milliseconds to the first network node, and the response data 3 is the data sent by the controlled device 3. .
- the first network node may randomly assign the order in which each second network node sends the response data.
- the first network node allocates a first time period to the second network node according to the data volume corresponding to the second network node and attribute information of the second network node .
- the transmission delays from different second network nodes to the first network node are different, and/or the processing performance of different second network nodes is different, resulting in different transmission delays from different second network nodes to the first network node.
- the second network node has different processing delays.
- the delay of each second network node can be calculated according to the attribute information of each second network node, and the delay of the second network node is equal to the transmission delay and processing delay of the second network node. Or the accumulated value of the transmission delay and the processing delay of the second network node.
- the maximum delay and the maximum time length may be selected from the delay of each second network node and the time length of the first time period, and the maximum delay time, the maximum time length and the The time length of the first time period of each second network node is obtained, and the start time of the first time period of each second network node is obtained, thereby obtaining the first time period of each second network node.
- the delay of the second network node 1 is 10 milliseconds
- the delay of the second network node 2 is 12 milliseconds
- the delay of the second network node 3 is 15 milliseconds.
- the maximum time length is 25 milliseconds.
- the time length of the first time period is 20 milliseconds, that is, the first time period of the second network node 1 is the 35th to 54th milliseconds.
- the first network node sends the control data 1 to the second network node 1 , and after 10 milliseconds, the second network node 1 sends the control data 1 to the controlled device 1 .
- the second network node 1 After the second network node 1 sends the control data 1, when the delay reaches the 35th millisecond, it sends the response data 1 with a length of 20 milliseconds, and the response data 1 is the data sent by the controlled device 1.
- the response data 1 is received by the first network node after another 10 milliseconds.
- the time length of the first time period is 25 milliseconds, that is, the first time period of the second network node 1 is the 31st to 55th milliseconds.
- the first network node sends the control data 2 to the second network node 1 after a delay of 20 milliseconds, and the second network node 2 sends the control data 2 to the controlled device 2 after 12 milliseconds.
- the second network node 2 After the second network node 2 sends the control data 2, when the delay reaches the 31st millisecond, it sends the response data 2 with a length of 25 milliseconds, and the response data 2 is the data sent by the controlled device 2.
- the response data 2 is received by the first network node after another 12 milliseconds.
- the time period is the 75th to 99th milliseconds.
- the time length of the first time period is 15 milliseconds, that is, the first time period of the second network node 3 is the 25th to 39th milliseconds.
- the first network node sends the control data 3 to the second network node 3 after a delay of 45 (20+25) milliseconds, and the second network node 3 sends the control data 3 to the controlled device 3 after 15 milliseconds.
- the second network node 3 After the second network node 3 sends the control data 3, when the delay reaches the 25th millisecond, it sends the response data 3 with a length of 15 milliseconds, and the response data 3 is the data sent by the controlled device 3.
- the response data 3 is received by the first network node after another 15 milliseconds.
- the period of 3 is the 100th to 114th milliseconds.
- the first network node delays sending the control data to each second network node, and the first network node may also send the control data of each second network node without delay.
- Another example is given next. as described below:
- the time length of the first time period is 20 milliseconds, that is, the first time period of the second network node 1 is the 35th to 54th milliseconds.
- the first network node sends the control data 1 to the second network node 1 , and after 10 milliseconds, the second network node 1 sends the control data 1 to the controlled device 1 .
- the second network node 1 After the second network node 1 sends the control data 1, when the delay reaches the 35th millisecond, it sends the response data 1 with a length of 20 milliseconds, and the response data 1 is the data sent by the controlled device 1.
- the response data 1 is received by the first network node after another 10 milliseconds.
- the time length of the first time period of the second network node 2 is 25 milliseconds, that is, the first time period of the second network node 2 is the 51st to 75th milliseconds.
- the first network node sends the control data 2 to the second network node 2
- the second network node 2 sends the control data 2 to the controlled device 2 .
- the second network node 2 After the second network node 2 sends the control data 2, when the delay reaches the 51st millisecond, it sends the response data 2 with a length of 25 milliseconds, and the response data 2 is the data sent by the controlled device 2.
- the response data 2 is received by the first network node after another 12 milliseconds.
- the first network node sends the control data 3 to the second network node 3 , and after 15 milliseconds, the second network node 3 sends the control data 3 to the controlled device 3 .
- the second network node 3 sends the control data 3, when the delay reaches the 70th millisecond, it sends the response data 3 with a length of 15 milliseconds, and the response data 3 is the data sent by the controlled device 3.
- the response data 3 is received by the first network node after another 15 milliseconds.
- the attribute information of the second network node includes performance parameters of the second network node and/or the distance between the second network node and the first network node.
- the performance parameter of the second network node may include one or more of the number of central processing unit (central processing unit, CPU) cores and the CPU processing frequency of the second network node.
- CPU central processing unit
- the first network node when the first network node is connected to multiple control devices, the N controlled devices are controlled by one control device, the first network node determines the second time period corresponding to the one control device, and the second The time period includes at least the first time period of each of the M second network nodes.
- the first network node allocates a different first time period within the second time period to each second network node according to the data amount corresponding to each of the M second network nodes.
- the first network node allocates a different first time period within the second time period to each second network node according to the attribute information of each second network node and the data amount corresponding to each second network node.
- the first network node further acquires attribute information of each second network node, and saves the attribute information of each second network node. In this way, when the attribute information of the second network node is used, the stored attribute information of the second network node is directly obtained.
- the first network node may measure the transmission delay from the first network node to each second network node respectively.
- the first network node may query each second network node for the performance parameter of each second network node respectively.
- the performance parameters of each second network node are pre-configured in the first network node.
- the first network node acquires the performance parameter of each second network node from the network management device.
- each second network node connected to the at least one controlled device determines the time period corresponding to the other control device, and Each second network node is allocated a different time period within the time period.
- Step 304 For each second network node, the first network node sends a first data frame to the second network node, and the first data frame includes the control data of the controlled device connected to the second network node and the second network node. Configuration information of the first time period of the node.
- the configuration information of the first time period is used by the second network node to determine the first time period.
- the configuration information of the first time period may include information such as the start time and time length of the first time period.
- the first network node generates a first data frame, the first data frame includes the control data of each controlled device and the configuration information of the first time period of each second network node, and is sent to each A second network node sends the first data frame.
- the first network node may generate M first data frames, the M first data frames are in one-to-one correspondence with the M second network nodes, and the payload of the first data frame corresponding to the second network node includes the The control data of the controlled device connected to the second network node and the configuration information of the first time period of the second network node are sent to each second network node.
- the first data frame corresponding to each second network node is sent to each second network node.
- the first data frame may be an Ethernet frame
- the first network node uses the control data of each controlled device and the configuration information of the first time period of each second network node as the payload, on the basis of the payload. Add the Ethernet frame header to get the first data frame.
- the first network node further generates a first check code according to the payload, and the first data frame further includes the first check code.
- the first network node may use a forward error correction (forward error correction, FEC) mechanism to generate the first check code according to the payload.
- FEC forward error correction
- the first network node receives the control data of the controlled device 1, the control data of the controlled device 2 and the control data of the controlled device 3, and sends the control data of the controlled device 1 to the control data of the controlled device 2.
- Data and control data of the controlled device 3 and the configuration information of the first time period of the second network node 1, the configuration information of the second network node 2 of the first time period, and the configuration of the second network node 3 of the first time period The information is used as the payload, and the first check data is generated according to the payload, and the first data frame is generated.
- the first data frame includes the Eth frame header, the control data of the controlled device 1, the control data of the controlled device 2, and the controlled device. 3 of the control data and the first check data.
- the first data frame is sent to the second network node 1 connected to the controlled device 1 , the second network node 2 connected to the controlled device 2 , and the second network node 3 connected to the controlled device 3 .
- Step 305 The second network node receives the control data of the controlled device connected to itself, and sends the control data of the controlled device to the controlled device.
- the second network node For each of the M second network nodes, the second network node is connected to one or more controlled devices among the N controlled devices.
- the second network node sends control data of each controlled device to each controlled device connected to itself.
- the first data frame includes control data of each of the N controlled devices, and the second network node receives the first data frame from the first data frame.
- the control data of each controlled device connected to itself is obtained in the data frame, and the control data of each controlled device is respectively sent to each controlled device.
- the second network node determines whether the controlled device is connected to itself according to the identifier of the controlled device included in the control data of the controlled device, and if so, obtains the controlled device from the first data frame.
- Control data of the controlled device and configuration information of its own first time period send the control data of the controlled device to the controlled device according to the identifier of the controlled device, and determine the first time period according to the configuration information.
- the second network node checks the payload of the first data frame according to the first check data. If there is no error in the payload, the second network node obtains the control data of each controlled device connected to itself from the first data frame. If an error is detected in the payload of the first data frame, the second network node discards the first data frame.
- the second network node uses an FEC mechanism to verify the payload of the first data frame according to the first verification data.
- the controlled device For each controlled device that communicates with the second network node, the controlled device receives control data of the controlled device, and sends response data for the command to the second network node according to the command included in the control data.
- the response data sent by the controlled device to the second network node is a turn-on success indication message or a turn-on failure indication message.
- the response data sent by the controlled device to the second network node is a closing success indication message or a closing failure indication message.
- the command is a positioning command
- the response data sent by the controlled device to the second network node is the location information of the controlled device.
- Step 306 The second network node receives the response data of each controlled device connected to itself, and sends the response data of each controlled device to the first network node within the first time period of the second network node.
- the second network node generates a third data frame, where the third data frame includes response data of each controlled device connected to the second network node, and sends the third data frame to the first network node.
- the third data frame may be a burst (burst, Bst) frame
- the first network node uses the control data of each controlled device as a payload, and adds a Bst frame header on the basis of the payload to obtain the first data frame.
- the second network node further generates a second check code according to the payload, and the third data frame further includes the second check code.
- the second network node may use the FEC mechanism to generate the second check code according to the payload.
- the second network node 1 receives the response data of the controlled device 1, uses the response data of the controlled device 1 as the payload, generates the second check data 1 according to the payload, and generates the third data frame 1 , the third data frame 1 includes the Bst frame header, the response data of the controlled device 1 and the second check data 1 , and sends the third data frame 1 to the first network node within the first time period of the second network node 1 .
- the second network node 2 receives the response data of the controlled device 2, uses the response data of the controlled device 2 as the payload, generates the second check data 2 according to the payload, generates the third data frame 2, and the third data frame 2
- the third data frame 2 is sent to the first network node within the first time period of the second network node 2 including the Bst frame header, the response data of the controlled device 2 and the second check data 2 . as well as,
- the second network node 3 receives the response data of the controlled device 3, uses the response data of the controlled device 3 as the payload, generates the second check data 3 according to the payload, generates the third data frame 3, and the third data frame 3
- the third data frame 3 is sent to the first network node within the first time period of the second network node 3 including the Bst frame header, the response data of the controlled device 3 and the second check data 3 .
- Step 307 For each second network node, the first network node receives data sent by the second network node within the first time period of the second network node, and the data sent by the second network node includes data sent by the second network node. The response data of the controlled device connected to the network node.
- the first network node receives the third data frame sent by the second network node, and obtains the data from the third data frame and the second network node. Response data of each controlled device connected to the network node.
- each second network node in the M second network nodes transmits a third data frame within a respective first time period.
- the interval between two adjacent first time periods may be small, or zero. Therefore, the first network node can continuously receive the data sequence composed of the third data frames, that is, the data sequence includes a plurality of third data frames.
- the frame header of the third data frame is a Bst frame header
- the Bst frame header includes Bst information
- the Bst frame header of each third data frame includes the same Bst information. Therefore, the first network node can identify each third data frame from the received data sequence based on the Bst information.
- the first network node checks the payload of the third data frame according to the second check data. If there is no error in the payload, the first network node obtains the response data with the controlled device from the third data frame. If an error is detected in the payload of the third data frame, the first network node discards the third data frame.
- the first network node uses an FEC mechanism to verify the payload of the third data frame according to the second verification data.
- the first network node receives the third data frame 1, and checks the payload (response data 1 of the controlled device 1) included in the third data frame 1 according to the second check data 1 included in the third data frame 1 , if it is verified that there is no error in the payload of the third data frame 1, the response data 1 of the controlled device 1 is obtained from the third data frame 1.
- the first network node receives the third data frame 2, and checks the payload (response data 2 of the controlled device 2) included in the third data frame 2 according to the second verification data 2 included in the third data frame 2. If It is verified that there is no error in the payload of the third data frame 2 , and the response data 2 of the controlled device 2 is obtained from the third data frame 2 . as well as,
- the first network node receives the third data frame 3, and checks the payload (response data 3 of the controlled device 3) included in the third data frame 3 according to the second verification data 3 included in the third data frame 3. If It is verified that there is no error in the payload of the third data frame 3 , and the response data 3 of the controlled device 3 is obtained from the third data frame 3 .
- Step 308 The first network node sends the response data of each of the N controlled devices to the control device.
- the first network node sends a second data frame to the control device, and the second data frame includes the response data of each controlled device arranged according to the sequence of receiving the response data of each controlled device.
- the generated second data frame includes the response data 1 of the controlled device 1, the The response data 2 of the controlling device 2 and the response data 3 of the controlled device 3 are sent to the controlling device, and the second data frame is sent.
- the second data frame may be an Eth frame
- the first network node uses the response data of each controlled device as a payload, and adds an Eth frame header on the basis of the payload to obtain the second data frame.
- the first network node determines M second network nodes connected to the N controlled devices according to the control data of the N controlled devices, and obtains the N controlled devices according to the control data of the N controlled devices For the data volume corresponding to each second network node in the M second network nodes, different first time periods are allocated to each second network node according to the data volume of each second network node. Since each second network node needs to forward the response data of the controlled device and dynamically allocate the first time period to each second network node, each second network node does not need to wait for a long time for the arrival of the respective first time period , thereby reducing the delay in sending data by each second network node.
- the length of the first time period of each second network node is allocated based on the amount of data corresponding to each second network node, so as to ensure that the length of time required by each second network node to send response data is equal to that of each second network node.
- the time length of the first time period of the network node so that each second network node can send the response data that it needs to send within a first time period, reducing the delay for each second network node to send data and avoid wasting time and resources.
- an embodiment of the present application provides an apparatus 500 for sending data.
- the apparatus 500 may be deployed in the first network node provided in any of the foregoing embodiments, and used in a network including multiple controlled devices, including : processing unit 501, receiving unit 502 and sending unit 503;
- a receiving unit 502 configured to receive control data sent by the control device, where the control data is used to control at least one controlled device in the plurality of controlled devices;
- a sending unit 503 is configured to send a first data frame to a second network node, where the first data frame includes the control data and configuration information of a first time period, the second network node is connected to at least one controlled device, and the first time period
- the length of time is determined by the processing unit 501 based on the data volume corresponding to the second network node, and the data volume is equal to the cumulative value of the data volume of the response data that needs to be sent by each controlled device in the at least one controlled device.
- This configuration The information is used by the second network node to determine the first time period and forward the response data sent by each controlled device during the first time period.
- processing unit 501 determining the time length of the first time period of the second network node, reference may be made to the relevant content in step 303 of the embodiment shown in FIG. 3 , which will not be described in detail here.
- processing unit 501 is used for:
- a first time period is allocated to the second network node according to the attribute information of the second network node and the data amount corresponding to the second network node.
- the attribute information of the second network node includes a performance parameter of the second network node and/or a transmission delay from the second network node to the apparatus 500 .
- processing unit 501 is further configured to:
- the number of control devices connected to the device 500 is multiple, each control device in the multiple control devices corresponds to a different second time period, and the at least one controlled device is one of the multiple control devices. Controlled by one control device, the first time period is located within the second time period corresponding to the one control device.
- processing unit 501 is further configured to:
- control data the data volume of the response data that needs to be sent by each controlled device is obtained.
- processing unit 501 for acquiring the data amount corresponding to the second network node for the detailed operation of the processing unit 501 for acquiring the data amount corresponding to the second network node, reference may be made to the relevant content in step 302 of the embodiment shown in FIG. 3 , which will not be described in detail here.
- control data includes commands for controlling each controlled device
- the processing unit 501 is configured to acquire, according to the type of the command of each controlled device, the data amount of the response data that each controlled device needs to send.
- the receiving unit 502 is used to receive the response data of each controlled device sent by the second network node in the first time period of the second network node;
- the sending unit 503 is configured to send a second data frame to the control device, where the second data frame includes the response data of each controlled device arranged according to the order of receiving the response data of each controlled device.
- the number of control devices connected to the device 500 is multiple, each of the multiple control devices corresponds to a different time period, and the N controlled devices are one of the multiple controlled devices. controlled;
- the processing unit 501 is configured to allocate to each second network node different time periods within the time period corresponding to the one control device according to the data volume corresponding to each second network node.
- the processing unit allocates the first time period to the second network node, and the first time period of the second network node is used to send the response data. In addition, it is not necessary to wait for the arrival of the first time period for a long time, which avoids waste of time resources and reduces the delay of sending data.
- the processing unit acquires the data volume corresponding to the second network node, and allocates the first time period to the second network node according to the data volume corresponding to the second network node, this ensures that the first time period of the second network node can be used just for the second network node.
- the second network node sends data, thereby further avoiding waste of time resources.
- an embodiment of the present application provides a schematic diagram of an apparatus 600 for sending data.
- the apparatus 600 may be the first network node in any of the above embodiments.
- the apparatus 600 includes at least one processor 601 , internal connections 602 , memory 603 and at least one transceiver 604 .
- the apparatus 600 is an apparatus with a hardware structure, and can be used to implement the functional modules in the apparatus 500 described in FIG. 6 .
- the processing unit 501 in the apparatus 500 shown in FIG. 6 can be implemented by calling the code in the memory 603 by the at least one processor 601, and the receiving unit 502 and the receiving unit 502 in the apparatus 500 shown in FIG.
- the sending unit 503 can be implemented by the transceiver 604 .
- the apparatus 600 can also be used to implement the function of configuring the device in any of the foregoing embodiments.
- processor 601 may be a general-purpose central processing unit (central processing unit, CPU), network processor (network processor, NP), microprocessor, application-specific integrated circuit (application-specific integrated circuit, ASIC) , or one or more integrated circuits used to control the execution of the program of this application.
- CPU central processing unit
- NP network processor
- ASIC application-specific integrated circuit
- the internal connection 602 described above may include a path to transfer information between the above described components.
- the internal connection 602 is a single board or a bus or the like.
- the above transceiver 604 is used to communicate with other devices or communication networks.
- the above-mentioned memory 603 can be a read-only memory (read-only memory, ROM) or other types of static storage devices that can store static information and instructions, a random access memory (random access memory, RAM) or other types of storage devices that can store information and instructions.
- ROM read-only memory
- RAM random access memory
- Types of dynamic storage devices which can also be electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM), or other optical disk storage, optical disks storage (including compact discs, laser discs, compact discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or capable of carrying or storing desired program code in the form of instructions or data structures and capable of being accessed by Any other medium accessed by the computer, but not limited to this.
- the memory can exist independently and be connected to the processor through a bus.
- the memory can also be integrated with the processor.
- the memory 603 is used for storing the application program code for executing the solution of the present application, and the execution is controlled by the processor 601.
- the processor 601 is used to execute the application program code stored in the memory 603 and cooperate with at least one transceiver 604, so that the device 600 can realize the functions in the method of the present patent.
- the processor 601 may include one or more CPUs, such as CPU0 and CPU1 in FIG. 7 .
- the apparatus 600 may include multiple processors, for example, the processor 601 and the processor 607 in FIG. 7 .
- processors can be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor.
- a processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Small-Scale Networks (AREA)
Abstract
The present application relates to the field of communications, and discloses a method and device for sending data. The method comprises: a first network node receives control data sent by a control device, the control data being used to control at least one controlled device among a plurality of controlled devices; the first network node sends a first data frame to a second network node, the first data frame comprising the control data and configuration information of a first time period, the second network node being connected to the at least one controlled device, the time length of the first time period being determined on the basis of a data amount corresponding to the second network node, the data amount being equal to a cumulative value of the data amount of response data requiring sending by each controlled device among the at least one controlled device, and the configuration information being used by the second network node to determine the first time period and forward in the first time period the response data sent by each controlled device. The present application can reduce the latency in sending data.
Description
本申请要求于2020年07月06日提交的申请号为202010641892.9、发明名称为“OLT、ONU及网络系统”以及,于2020年9月28日提交的申请号为202011045588.4、发明名称为“发送数据的方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requires the application number 202010641892.9 submitted on July 06, 2020, the invention name is "OLT, ONU and network system", and the application number 202011045588.4 submitted on September 28, 2020, the invention name is "Transmission data" The priority of the Chinese Patent Application for "Method and Apparatus", the entire contents of which are incorporated herein by reference.
本申请涉及通信领域,特别涉及一种发送数据的方法及装置。The present application relates to the field of communications, and in particular, to a method and apparatus for sending data.
工业控制网络连接控制设备与被控设备,控制设备可以通过工业控制网络对被控设备进行控制。例如,被控设备可以为工业机器人,控制设备可以通过工业控制网络对工业机器人进行控制,以使工业机器人进行生产作业。The industrial control network connects the control device and the controlled device, and the control device can control the controlled device through the industrial control network. For example, the controlled device can be an industrial robot, and the control device can control the industrial robot through an industrial control network, so that the industrial robot can perform production operations.
目前的工业控制网络可以使用无源光网络(passive optical network,PON)来承载,PON包括光线路终端(optical line terminal,OLT)和多个光网络单元(optical network unit,ONU),OLT与每个ONU相连。控制设备与OLT相连,每个被控设备与一个ONU相连。事先确定PON中的每个ONU在一个周期内对应的时隙。The current industrial control network can be carried by passive optical network (PON). PON includes optical line terminal (OLT) and multiple optical network units (ONU). OLT is connected to each connected to each ONU. The control equipment is connected with the OLT, and each controlled equipment is connected with an ONU. The time slot corresponding to each ONU in the PON in one cycle is determined in advance.
在控制设备控制某个被控设备时,OLT接收来自控制设备的控制命令,向与该被控设备相连的ONU发送该控制命令;该ONU向该被控设备发送控制命令,接收该被控设备返回针对该控制命令的响应数据。在该ONU对应的时隙,该ONU通过OLT向控制设备发送该响应数据。在当前周期内该ONU对应的时隙已过时,在下一个周期该ONU对应的时隙,该ONU通过OLT向控制设备发送该响应数据。该方案可能导致数据发送的时延较长。When the control device controls a controlled device, the OLT receives the control command from the control device and sends the control command to the ONU connected to the controlled device; the ONU sends the control command to the controlled device and receives the controlled device Returns response data for this control command. In the time slot corresponding to the ONU, the ONU sends the response data to the control device through the OLT. The time slot corresponding to the ONU in the current cycle is outdated, and in the time slot corresponding to the ONU in the next cycle, the ONU sends the response data to the control device through the OLT. This solution may result in a longer delay in data transmission.
发明内容SUMMARY OF THE INVENTION
本申请提供了一种发送数据的方法及装置,以减小数据发送的时延。所述技术方案如下:The present application provides a method and apparatus for sending data, so as to reduce the delay of data sending. The technical solution is as follows:
第一方面,本申请提供了一种发送数据的方法,所述方法应用于包括多个被控设备的网络中。在所述方法中:第一网络节点接收控制设备发送的控制数据,控制数据用于控制多个被控设备中的至少一个被控设备。第一网络节点向第二网络节点发送第一数据帧,第一数据帧包括控制数据和第一时间段的配置信息,第二网络节点与该至少一个被控设备相连,第一时间段的时间长度是基于第二网络节点对应的数据量确定的,该数据量等于该至少一个被控设备中的每个被控设备需要发送的响应数据的数据量的累加值,该配置信息用于第二网络节点确定第一时间段并在第一时间段转发每个被控设备发送的响应数据。In a first aspect, the present application provides a method for sending data, and the method is applied in a network including a plurality of controlled devices. In the method: the first network node receives control data sent by the control device, where the control data is used to control at least one controlled device among the multiple controlled devices. The first network node sends a first data frame to the second network node, where the first data frame includes control data and configuration information of the first time period, the second network node is connected to the at least one controlled device, and the time of the first time period The length is determined based on the data volume corresponding to the second network node, the data volume is equal to the cumulative value of the data volume of the response data that needs to be sent by each controlled device in the at least one controlled device, and the configuration information is used for the second network node. The network node determines the first time period and forwards the response data sent by each controlled device in the first time period.
其中,由于该至少一个被控设备需要向控制设备发送响应数据,与该至少一个被控设备相连的第二网络节点需要向第一网络节点发送被控设备的响应数据,这样在第二网络节点需要发送数据时,才为第二网络节点分配第一时间段,第一时间段都被用来发送响应数据,且不需要长时间等待第一时间段的到达,避免了时间资源的浪费以及减小发送数据的时延。又由于根据第二网络节点对应的数据量,分配第一时间段,这样保证第一时间段可刚好用于该 第二网络节点发送数据,从而进一步地避免了时间资源的浪费。Wherein, since the at least one controlled device needs to send response data to the control device, the second network node connected to the at least one controlled device needs to send the response data of the controlled device to the first network node, so that at the second network node When data needs to be sent, the first time period is allocated to the second network node, and the first time period is used to send response data, and there is no need to wait for the arrival of the first time period for a long time, which avoids wasting time resources and reducing time. Small delay for sending data. In addition, because the first time period is allocated according to the data volume corresponding to the second network node, it is ensured that the first time period can be just used for the second network node to send data, thereby further avoiding the waste of time resources.
在一种可能的实现方式中,第一网络节点根据第二网络节点的属性信息和第二网络节点对应的数据量,为第二网络节点分配第一时间段。其中,根据每个第二网络节点的属性信息确定第二网络节点的第一时间段的起始时间,从而保证第一网络节点能够连续不间断地接收不同第二网络节点发送的响应数据。In a possible implementation manner, the first network node allocates the first time period to the second network node according to the attribute information of the second network node and the data amount corresponding to the second network node. The start time of the first time period of the second network node is determined according to the attribute information of each second network node, thereby ensuring that the first network node can continuously and uninterruptedly receive response data sent by different second network nodes.
在另一种可能的实现方式中,第二网络节点的属性信息包括第二网络节点的性能参数和/或第二网络节点到所述第一网络节点的传输时延。由于不同第二网络节点的性能不同以及不同第二网络节点到第一网络节点的距离不同,因此在属性信息包括第二网络节点的性能参数和/或传输时延时,根据第二网络节点的属性信息分配第一时间段,保证第一网络节点能够连续不间断地接收不同第二网络节点发送的响应数据。In another possible implementation manner, the attribute information of the second network node includes a performance parameter of the second network node and/or a transmission delay from the second network node to the first network node. Since different second network nodes have different performances and different distances from different second network nodes to the first network node, when the attribute information includes the performance parameters and/or the transmission time delay of the second network node, according to the second network node's The attribute information allocates the first time period to ensure that the first network node can continuously and uninterruptedly receive response data sent by different second network nodes.
在另一种可能的实现方式中,第一网络节点获取第二网络节点的属性信息。In another possible implementation manner, the first network node acquires attribute information of the second network node.
在另一种可能的实现方式中,与第一网络节点相连的控制设备数目为多个,多个控制设备中的每个控制设备对应不同的第二时间段,至少一个被控设备是被多个控制设备中的一个控制设备所控制,第一时间段位于所述一个控制设备对应的第二时间段内。这样可以将一个工业控制网络用于不同的控制设备对被控设备进行控制,提供工业控制网络的利用率。In another possible implementation manner, the number of control devices connected to the first network node is multiple, each control device in the multiple control devices corresponds to a different second time period, and at least one controlled device is controlled by multiple control devices. Controlled by one of the control devices, the first time period is within the second time period corresponding to the one control device. In this way, an industrial control network can be used for different control equipment to control the controlled equipment, and the utilization rate of the industrial control network can be improved.
在另一种可能的实现方式中,第一网络节点根据该控制数据,获取每个被控设备需要发送的响应数据的数据量。这样可以进一步得到第二网络节点对应的数据量,从而可以准确地计算出第一时间段。In another possible implementation manner, the first network node acquires, according to the control data, the data amount of response data that needs to be sent by each controlled device. In this way, the amount of data corresponding to the second network node can be further obtained, so that the first time period can be accurately calculated.
在另一种可能的实现方式中,该控制数据包括用于控制每个被控设备的命令。第一网络节点根据每个被控设备的命令的类型,获取每个被控设备需要发送的响应数据的数据量。In another possible implementation, the control data includes commands for controlling each controlled device. The first network node acquires, according to the type of the command of each controlled device, the data amount of response data that needs to be sent by each controlled device.
在另一种可能的实现方式中,第一网络节点接收第二网络节点在第一时间段内发送的每个被控设备的响应数据。第一网络节点向控制设备发送第二数据帧,第二数据帧包括根据接收每个被控设备的响应数据的顺序,排列的每个被控设备的响应数据。In another possible implementation manner, the first network node receives response data of each controlled device sent by the second network node within the first time period. The first network node sends a second data frame to the control device, where the second data frame includes the response data of each controlled device arranged according to the sequence of receiving the response data of each controlled device.
第二方面,本申请提供了一种发送数据的装置,用于执行第一方面或第一方面的任意一种可能实现方式中的方法。具体地,所述装置包括用于执行第一方面或第一方面的任意一种可能实现方式的方法的单元。In a second aspect, the present application provides an apparatus for sending data, which is used to execute the method in the first aspect or any possible implementation manner of the first aspect. Specifically, the apparatus includes means for performing the method of the first aspect or any one of possible implementations of the first aspect.
第三方面,本申请提供了一种发送数据的装置,所述装置包括:处理器、存储器和收发器。其中,所述处理器、所述存储器和所述收发器之间可以通过总线系统相连。所述存储器用于存储一个或多个程序,所述处理器用于执行所述存储器中的一个或多个程序,使得所述装置完成第一方面或第一方面的任意可能实现方式中的方法。In a third aspect, the present application provides an apparatus for sending data, the apparatus comprising: a processor, a memory and a transceiver. Wherein, the processor, the memory and the transceiver may be connected through a bus system. The memory is used to store one or more programs, and the processor is used to execute the one or more programs in the memory to cause the apparatus to perform the method of the first aspect or any possible implementation of the first aspect.
第四方面,本申请提供了一种计算机可读存储介质,计算机可读存储介质中存储有程序代码,当其在多链路设备上运行时,使得多链路设备执行上述第一方面或第一方面的任意可能实现方式中的方法。In a fourth aspect, the present application provides a computer-readable storage medium, where program codes are stored in the computer-readable storage medium, and when the computer-readable storage medium runs on a multi-link device, the multi-link device enables the multi-link device to perform the above-mentioned first aspect or the first aspect. A method in any possible implementation of an aspect.
第五方面,本申请提供了一种包含程序代码的计算机程序产品,当所述程序代码在网络节点上运行时,使得网络节点执行上述第一方面或第一方面的任意可能实现方式中的方法。In a fifth aspect, the present application provides a computer program product comprising program code, which, when the program code runs on a network node, enables the network node to execute the method in the first aspect or any possible implementation manner of the first aspect .
图1是本申请实施例提供的一种网络架构的示意图;1 is a schematic diagram of a network architecture provided by an embodiment of the present application;
图2是本申请实施例提供的另一种网络架构的示意图;2 is a schematic diagram of another network architecture provided by an embodiment of the present application;
图3是本申请实施例提供的一种发送数据的方法流程图;3 is a flowchart of a method for sending data provided by an embodiment of the present application;
图4是本申请实施例提供的时间段分配示意图;4 is a schematic diagram of time period allocation provided by an embodiment of the present application;
图5是本申请实施例提供的一种数据帧传输的示意图;5 is a schematic diagram of a data frame transmission provided by an embodiment of the present application;
图6是本申请实施例提供的一种发送数据的装置结构示意图;6 is a schematic structural diagram of an apparatus for sending data provided by an embodiment of the present application;
图7是本申请实施例提供的另一种发送数据的装置结构示意图。FIG. 7 is a schematic structural diagram of another apparatus for sending data provided by an embodiment of the present application.
下面将结合附图对本申请实施方式作进一步地详细描述。The embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
在实现本申请的过程中,发明人发现现有技术至少存在以下问题:In the process of realizing this application, the inventor found that the prior art has at least the following problems:
ONU在发送响应数据时可能要等待到下一个周期该ONU对应的时隙才能发送,导致数据发送的时延较长。在一个周期内的某些ONU对应的时隙到达时,但该ONU没有需要向控制设备发送的数据,或者,该ONU需要发送的数据长度较短,发送该数据所需的时长小于该时隙的长度,导致该ONU对应的时隙资源浪费;或者,该ONU需要发送的数据长度较长,发送该数据所需的时长大于该时隙的长度,该ONU需要在多个周期中的该ONU对应的时隙内发送该数据,导致数据发送的时延较长。When an ONU sends response data, it may wait until the time slot corresponding to the ONU in the next cycle before sending, resulting in a long delay in data sending. When the time slot corresponding to some ONUs in a cycle arrives, but the ONU has no data to send to the control device, or the length of the data that the ONU needs to send is short, and the time required to send the data is shorter than the time slot The length of the time slot corresponding to the ONU causes waste of time slot resources; or, the length of the data that the ONU needs to send is longer, the time length required to send the data is greater than the length of the time slot, and the ONU needs the ONU in multiple cycles. The data is sent in the corresponding time slot, resulting in a long delay in data sending.
参见图1,本申请实施例提供了一种网络架构,该网络架构可以为点到多点的树状网络架构。该网络架构包括第一网络节点和多个第二网络节点。第一网络节点与每个第二网络节点之间建立有网络连接。Referring to FIG. 1 , an embodiment of the present application provides a network architecture, and the network architecture may be a point-to-multipoint tree network architecture. The network architecture includes a first network node and a plurality of second network nodes. A network connection is established between the first network node and each of the second network nodes.
可选的,对于任一个第二网络节点,第一网络节点与该第二网络节点之间的网络连接上没有其他网络节点。也就是说,第一网络节点向该第二网络节点发送的数据或该第二网络节点向第一网络节点发送的数据可以不需要其他网络节点来转发。或者,Optionally, for any second network node, there is no other network node on the network connection between the first network node and the second network node. That is, the data sent by the first network node to the second network node or the data sent by the second network node to the first network node may not need to be forwarded by other network nodes. or,
可选的,在一些实施例中,对于任一个第二网络节点,第一网络节点与该第二网络节点之间的网络连接上也可以包括一个或多个转发节点,该转发节点用于传输所述第一网络节点与所述第二网络节点之间互通的数据。Optionally, in some embodiments, for any second network node, the network connection between the first network node and the second network node may also include one or more forwarding nodes, and the forwarding nodes are used for transmitting Data communicated between the first network node and the second network node.
可选的,该网络架构可作为工业控制网络,用于控制设备对多个被控设备进行控制。控制设备与第一网络节点通信,每个被控设备与一个第二网络节点通信。这样,控制设备对被 控设备进行控制的过程可以包括:控制设备向第一网络节点发送该N个被控设备中的每个被控设备对应的控制数据,N为大于0的整数。第一网络节点根据每个被控设备对应的控制数据,确定M个第二网络节点,该M个第二网络节点中的每个第二网络节点连接该N个被控设备中的一个或多个被控设备,与每个第二网络节点连接的被控设备不同。第一网络节点为每个第二网络节点分配不同的第一时间段,以及向每个第二网络节点发送与每个第二网络节点相连的被控设备对应的控制数据。对于任一个第二网络节点,该第二网络节点向与其相连的被控设备发送该被控设备对应的控制数据,接收该被控设备响应该控制数据的响应数据,在该第二网络节点对应的第一时间段向第一网络节点发送该被控设备的响应数据。第一网络节点向控制设备发送该被控设备的响应数据。Optionally, the network architecture can be used as an industrial control network for the control device to control multiple controlled devices. The control device communicates with the first network node, and each controlled device communicates with a second network node. In this way, the process that the control device controls the controlled device may include: the control device sends the control data corresponding to each of the N controlled devices to the first network node, where N is an integer greater than 0. The first network node determines M second network nodes according to the control data corresponding to each controlled device, and each second network node in the M second network nodes is connected to one or more of the N controlled devices. A controlled device is different from the controlled device connected to each second network node. The first network node allocates a different first time period to each second network node, and sends control data corresponding to the controlled device connected to each second network node to each second network node. For any second network node, the second network node sends the control data corresponding to the controlled device to the controlled device connected to it, receives the response data from the controlled device in response to the control data, and the second network node corresponds to the control data. The response data of the controlled device is sent to the first network node in the first time period. The first network node sends the response data of the controlled device to the control device.
如图1所示,控制设备管理3个被控设备:被控设备1~3,被控设备1与第二网络节点1通信,被控设备2与第二网络节点2通信,被控设备3与第二网络节点3通信。第二网络节点1~3分别与第一网络节点通信。控制设备向第一网络节点发送被控设备1~3中每个被控设备对应的控制数据,第一网络节点根据收到的被控设备1~3中每个被控设备对应的控制数据,确定被控设备1~3分别经由第二网络节点1~3与第一网络节点通信。第一网络节点为第二网络节点1分配第一时间段1,第一网络节点为第二网络节点2分配第一时间段2,第一网络节点为第二网络节点3分配第一时间段3。第一网络节点向第二网络节点1发送与被控设备1对应的控制数据,向第二网络节点2发送与被控设备2对应的控制数据,向第二网络节点3发送与被控设备3对应的控制数据。第二网络节点1接收被控设备1发送的响应数据,在第一时间段1向第一网络节点发送被控设备1的响应数据;第二网络节点2接收被控设备2发送的响应数据,在第一时间段2向第一网络节点发送被控设备2的响应数据;第二网络节点3接收被控设备3发送的响应数据,在第一时间段3向第一网络节点发送被控设备3的响应数据。在图1的方案基础上,第二网络节点1也可以与被控设备4通信,向被控设备4发送控制设备经由第一网络节点发送的、对应被控设备4的控制数据,并将被控设备4发送的响应数据发送给第一网络节点。As shown in Figure 1, the control device manages three controlled devices: controlled devices 1 to 3, the controlled device 1 communicates with the second network node 1, the controlled device 2 communicates with the second network node 2, and the controlled device 3 Communicate with the second network node 3 . The second network nodes 1 to 3 communicate with the first network node, respectively. The control device sends the control data corresponding to each of the controlled devices 1 to 3 to the first network node, and the first network node receives the control data corresponding to each of the controlled devices 1 to 3 according to the received control data. It is determined that the controlled devices 1 to 3 communicate with the first network node via the second network nodes 1 to 3 respectively. The first network node allocates the first time period 1 to the second network node 1, the first network node allocates the first time period 2 to the second network node 2, and the first network node allocates the first time period 3 to the second network node 3 . The first network node sends the control data corresponding to the controlled device 1 to the second network node 1, sends the control data corresponding to the controlled device 2 to the second network node 2, and sends the control data corresponding to the controlled device 3 to the second network node 3. corresponding control data. The second network node 1 receives the response data sent by the controlled device 1, and sends the response data of the controlled device 1 to the first network node in the first time period 1; the second network node 2 receives the response data sent by the controlled device 2, Send the response data of the controlled device 2 to the first network node in the first time period 2; the second network node 3 receives the response data sent by the controlled device 3, and sends the controlled device to the first network node in the first time period 3. 3 response data. On the basis of the solution in FIG. 1 , the second network node 1 can also communicate with the controlled device 4, send to the controlled device 4 the control data corresponding to the controlled device 4 sent by the control device via the first network node, and will be sent to the controlled device 4 by the control device via the first network node. The response data sent by the control device 4 is sent to the first network node.
在图1的方案基础上,也可以包括其他控制设备,其他控制设备与图1的控制设备可以负载分担或构成主备关系。On the basis of the solution in FIG. 1 , other control devices may also be included, and other control devices and the control device in FIG. 1 may share load or form a master-standby relationship.
其中,第一网络节点为每个第二网络节点分配第一时间段的详细实现过程,将在后续实施例进行详细说明,在此先不详细介绍。The detailed implementation process of allocating the first time period by the first network node to each second network node will be described in detail in subsequent embodiments, and will not be described in detail here.
可选的,参见图2,第一网络节点与多个控制设备相连,每个控制设备对应一组被控设备。对于任一个控制设备,该控制设备对应的一组被控设备中的每个被控设备连接到一个第二网络节点。该控制设备通过该网络架构对该控制设备对应的一组被控设备进行控制。Optionally, referring to FIG. 2 , the first network node is connected to multiple control devices, and each control device corresponds to a group of controlled devices. For any control device, each controlled device in a group of controlled devices corresponding to the control device is connected to a second network node. The control device controls a group of controlled devices corresponding to the control device through the network architecture.
例如,参见图2,第一网络节点与控制设备1和控制设备2相连,控制设备1对应的一组被控设备包括被控设备1、被控设备2和被控设备3,被控设备1、被控设备2和被控设备3分别与第二网络节点1、第二网络节点2和第二网络节点3相连。控制设备2对应的一组被控设备包括被控设备4、被控设备5和被控设备6,被控设备4、被控设备5和被控设备6分别与第二网络节点1、第二网络节点2和第二网络节点3相连。For example, referring to FIG. 2 , the first network node is connected to the control device 1 and the control device 2, and a group of controlled devices corresponding to the control device 1 includes the controlled device 1, the controlled device 2, and the controlled device 3. The controlled device 1 , the controlled device 2 and the controlled device 3 are respectively connected to the second network node 1 , the second network node 2 and the second network node 3 . A set of controlled devices corresponding to control device 2 includes controlled device 4, controlled device 5 and controlled device 6. The network node 2 is connected to the second network node 3 .
可选的,第一网络节点通过接口与一个或多个控制设备相连。可选的,该接口可以为高速串行计算机扩展总线标准(peripheral component interconnect express,PCIe)接口或以太网(ethernet,Eth)接口等。Optionally, the first network node is connected to one or more control devices through an interface. Optionally, the interface may be a high-speed serial computer expansion bus standard (peripheral component interconnect express, PCIe) interface or an Ethernet (ethernet, Eth) interface, or the like.
可选的,第二网络节点通过接口与被控设备相连。可选的,该接口可以为输入/输出(input/output,I/O)接口等。Optionally, the second network node is connected to the controlled device through an interface. Optionally, the interface may be an input/output (input/output, I/O) interface or the like.
可选的,该网络架构为PON,第一网络节点为OLT,第二网络节点为ONU。或者,该网络架构为无线网络架构,第一网络节点与每个第二网络节点之间的网络连接为无线连接。Optionally, the network architecture is a PON, the first network node is an OLT, and the second network node is an ONU. Alternatively, the network architecture is a wireless network architecture, and the network connection between the first network node and each second network node is a wireless connection.
由于该网络架构部署在工业现场,与每个第二网络节点相连的被控设备使用强电供电,而该网络架构为PON或无线网络架构,这样该网络架构不会受到强电的干扰和影响。Since the network architecture is deployed on the industrial site, the controlled devices connected to each second network node are powered by strong electricity, and the network architecture is a PON or wireless network architecture, so that the network architecture will not be disturbed and affected by the strong electricity. .
可选的,在该网络架构为PON的情况下,第一网络节点与分光器相连,每个第二网络节点连接到该分光器,从而保证第一网络节点可以与多个第二网络节点之间建立有网络连接。Optionally, when the network architecture is a PON, the first network node is connected to the optical splitter, and each second network node is connected to the optical splitter, thereby ensuring that the first network node can communicate with multiple second network nodes. A network connection is established between.
例如,假设该分光器是分光比为1:64的分光器,该分光器可以与64个第二网络节点连接,也就是说第一网络节点可以通过该分光器与64个第二网络节点建立网络连接。For example, assuming that the optical splitter is an optical splitter with a split ratio of 1:64, the optical splitter can be connected to 64 second network nodes, that is to say, the first network node can be established with 64 second network nodes through the optical splitter Internet connection.
可选的,第一网络节点可以与多个分光器连接,这样第一网络节点可以与更多的第二网络节点之间建立网络连接,扩大工业控制网络的规模。Optionally, the first network node may be connected to multiple optical splitters, so that the first network node may establish network connections with more second network nodes, thereby expanding the scale of the industrial control network.
在一些实施例中,第一网络节点与第二网络节点之间包括多级分光器。In some embodiments, a multi-stage optical splitter is included between the first network node and the second network node.
可选的,上述控制设备可以为可编程逻辑控制器(programmable logic controller,PLC),上述被控设备可以为工业机器人、机械臂、传感器或开关等。Optionally, the above-mentioned control device may be a programmable logic controller (programmable logic controller, PLC), and the above-mentioned controlled device may be an industrial robot, a robotic arm, a sensor, a switch, or the like.
参见图3,本申请实施例提供了一种发送数据的方法,该方法可以应用于图1或图2所示的网络架构,包括:Referring to FIG. 3 , an embodiment of the present application provides a method for sending data, and the method can be applied to the network architecture shown in FIG. 1 or FIG. 2 , including:
步骤301:第一网络节点接收控制设备发送的N个被控设备中的每个被控设备对应的控制数据,N为大于0的整数。Step 301: The first network node receives control data corresponding to each of the N controlled devices sent by the control device, where N is an integer greater than 0.
对于任一个被控设备,该被控设备的控制数据包括该被控设备的标识和用于控制该被控设备的命令。For any controlled device, the control data of the controlled device includes an identifier of the controlled device and a command for controlling the controlled device.
可选的,该被控设备的控制数据还包括该被控设备需要响应该命令的响应数据的数据量。Optionally, the control data of the controlled device further includes the data volume of the response data that the controlled device needs to respond to the command.
例如,该命令为读取命令,该控制数据可以包括该被控设备响应该读取命令的响应数据的数据量。该响应数据为控制设备需要从该被控设备中读取的数据。For example, the command is a read command, and the control data may include the data amount of response data of the controlled device in response to the read command. The response data is the data that the control device needs to read from the controlled device.
可选的,该被控设备的控制数据也可能不包括该被控设备需要响应该命令的响应数据的数据量。但基于该被控设备的控制数据包括的命令的类型,得出该被控设备响应该命令的响应数据的类型,该类型的响应数据往往是固定大小的数据。因此,可以根据被控设备的控制数据,确定该被控设备发送的响应数据的数据量。Optionally, the control data of the controlled device may also not include the data amount of the response data that the controlled device needs to respond to the command. However, based on the type of the command included in the control data of the controlled device, the type of response data that the controlled device responds to the command is obtained, and the type of response data is often data of a fixed size. Therefore, the data volume of the response data sent by the controlled device can be determined according to the control data of the controlled device.
可选的,控制设备向第一网络节点发送以太报文或以太帧,该以太报文或以太帧包括该N个被控设备中的每个被控设备对应的控制数据。Optionally, the control device sends an Ethernet packet or an Ethernet frame to the first network node, where the Ethernet packet or Ethernet frame includes control data corresponding to each of the N controlled devices.
例如,假设该被控设备的控制数据包括的命令为用于控制开关开启或关闭的命令,被控设备响应该命令的响应数据为开启成功指示消息,开启失败指示消息、关闭成功指示消息或关闭失败指示消息,开启成功指示消息,开启失败指示消息、关闭成功指示消息和关闭失败指示消息的数据量均相等且均为固定大小。再如,假设该被控设备的控制数据包括的命令为定位命令,被控设备响应该命令的响应数据为被控设备的位置信息,包括被控设备的位置信息的数据往往也是固定大小的数据。For example, it is assumed that the command included in the control data of the controlled device is a command used to control the switch to be turned on or off, and the response data of the controlled device in response to the command is a turn-on success indication message, a turn-on failure indication message, a turn-off success indication message or a turn-off indication message. The data volume of the failure indication message, the open success indication message, the open failure indication message, the close success indication message, and the close failure indication message are all equal and have a fixed size. For another example, assuming that the command included in the control data of the controlled device is a positioning command, the response data of the controlled device in response to the command is the location information of the controlled device, and the data including the location information of the controlled device is often fixed-size data. .
可选的,第一网络节点与多个控制设备相连,每个控制设备对应一组被控设备,该N个被控设备属于一个控制设备对应的一组被控设备,即该N个被控设备被同一个控制设备所控 制。Optionally, the first network node is connected to multiple control devices, each control device corresponds to a group of controlled devices, and the N controlled devices belong to a group of controlled devices corresponding to one control device, that is, the N controlled devices. Devices are controlled by the same control device.
可选的,在本步骤中,第一网络节点可以接收不同控制设备发送的被控设备的控制数据,从接收的被控设备的控制数据中确定每个控制设备所控制的被控设备的控制数据。Optionally, in this step, the first network node may receive control data of the controlled device sent by different control devices, and determine the control of the controlled device controlled by each control device from the received control data of the controlled device. data.
步骤302:第一网络节点确定M个第二网络节点,以及获取每个第二网络节点对应的数据量,M为大于0且小于或等于N的整数。Step 302: The first network node determines M second network nodes, and acquires the data amount corresponding to each second network node, where M is an integer greater than 0 and less than or equal to N.
该M个第二网络节点中的每个第二网络节点连接该N个被控设备中的一个或多个被控设备,其中与每个第二网络节点连接的被控设备不同。Each of the M second network nodes is connected to one or more of the N controlled devices, wherein the controlled device connected to each of the second network nodes is different.
对于该M个第二网络节点中的任一个第二网络节点,该第二网络节点对应的数据量等于与该第二网络节点相连的被控设备发送的响应数据的数据量。For any second network node among the M second network nodes, the data volume corresponding to the second network node is equal to the data volume of response data sent by the controlled device connected to the second network node.
在本步骤中,可以通过如下3021至3022的操作来实现。该3021-3022的操作分别为:In this step, it can be implemented through the following operations 3021 to 3022 . The operations of the 3021-3022 are:
3021:第一网络节点根据该N个被控设备中的每个被控设备的控制数据,确定该M个第二网络节点。3021: The first network node determines the M second network nodes according to the control data of each of the N controlled devices.
在3021中,对于该N个被控设备中的每个被控设备,第一网络节点根据该被控设备的控制数据包括的该被控设备的标识,确定与该被控设备相连的第二网络节点。In 3021, for each controlled device among the N controlled devices, the first network node determines a second device connected to the controlled device according to the identifier of the controlled device included in the control data of the controlled device network node.
可选的,第一网络节点中保存有第二网络节点的标识与被控设备的标识的对应关系,该对应关系中的任一记录包括一个第二网络节点的标识和与该一个第二网络节点相连的各被控设备的标识。Optionally, the first network node stores a correspondence between the identifier of the second network node and the identifier of the controlled device, and any record in the correspondence includes the identifier of a second network node and the identifier of the second network node. The identifier of each controlled device connected to the node.
可选的,在3021中,对于该N个被控设备中的每个被控设备,第一网络节点根据该被控设备的控制数据包括的该被控设备的标识,从第二网络节点的标识与被控设备的标识的对应关系中获取与该被控设备相连的第二网络节点的标识,根据该第二网络节点的标识,确定与该被控设备相连的第二网络节点。Optionally, in 3021, for each controlled device in the N controlled devices, the first network node, according to the identifier of the controlled device included in the control data of the controlled device, from the second network node. The identifier of the second network node connected to the controlled device is obtained from the corresponding relationship between the identifier and the identifier of the controlled device, and the second network node connected to the controlled device is determined according to the identifier of the second network node.
3022:对于该M个第二网络节点中的每个第二网络节点,第一网络节点根据与该第二网络节点相连的每个被控设备的控制数据,获取该第二网络节点对应的数据量。3022: For each second network node in the M second network nodes, the first network node obtains data corresponding to the second network node according to the control data of each controlled device connected to the second network node quantity.
在3022中,对于与该第二网络节点相连的每个被控设备,如果该被控设备的控制数据包括该被控设备需要发送的响应数据的数据量,则从该被控设备的控制数据中获取该被控设备需要发送的响应数据的数据量;如果该被控设备的控制数据没有包括该被控设备需要发送的响应数据的数据量,则根据该被控设备的控制数据包括的命令,确定该被控设备需要发送的响应数据的类型,根据该类型确定该被控设备需要发送的响应数据的数据量。对与该第二网络节点相连的每个被控设备需要发送的响应数据的数据量进行累加,得到该第二网络节点对应的数据量。In 3022, for each controlled device connected to the second network node, if the control data of the controlled device includes the data volume of the response data that the controlled device needs to send, the control data from the controlled device Obtain the data volume of the response data that the controlled device needs to send in the , determine the type of response data that the controlled device needs to send, and determine the data volume of the response data that the controlled device needs to send according to the type. The data amount of response data that needs to be sent by each controlled device connected to the second network node is accumulated to obtain the data amount corresponding to the second network node.
可选的,第一网络节点可以保存响应数据的类型与数据量的对应关系,该对应关系中的任一条记录包括一个响应数据的类型和数据量。Optionally, the first network node may store a correspondence between the type of response data and the amount of data, and any record in the correspondence includes a type and amount of response data.
可选的,在确定该被控设备需要发送的响应数据的类型时,根据该类型,从响应数据的类型与数据量的对应关系中获取该被控设备需要发送的响应数据的数据量。Optionally, when determining the type of response data to be sent by the controlled device, the data volume of the response data to be sent by the controlled device is obtained from the correspondence between the type of response data and the data volume according to the type.
步骤303:对于每个第二网络节点,第一网络节点根据该第二网络节点对应的数据量,为该第二网络节点分配第一时间段。Step 303: For each second network node, the first network node allocates a first time period to the second network node according to the data volume corresponding to the second network node.
对于每个第二网络节点,该第二网络节点的第一时间段的时间长度是基于该第二网络节点对应的数据量确定的。For each second network node, the time length of the first time period of the second network node is determined based on the amount of data corresponding to the second network node.
在本步骤中,可以通过如下3031至3032的操作来实现,该3031至3032的操作分别为:In this step, it can be implemented by the following operations from 3031 to 3032. The operations from 3031 to 3032 are respectively:
3031:对于每个第二网络节点,第一网络节点根据该第二网络节点对应的数据量,确定第二网络节点的时间段长度。3031: For each second network node, the first network node determines the time period length of the second network node according to the data amount corresponding to the second network node.
可选的,第一网络节点根据每个第二网络节点对应的数据量和每个第二网络节点对应的上行带宽,计算每个第二网络节点的第一时间段的时间长度。Optionally, the first network node calculates the time length of the first time period of each second network node according to the data volume corresponding to each second network node and the uplink bandwidth corresponding to each second network node.
例如,参见图1,假设根据第二网络节点1对应的数据量,确定第二网络节点1的第一时间段的时间长度为20毫秒;根据第二网络节点2对应的数据量,确定第二网络节点2的第一时间段的时间长度为25毫秒;根据第二网络节点3对应的数据量,确定第二网络节点3的第一时间段的时间长度为15毫秒。For example, referring to FIG. 1 , it is assumed that according to the data volume corresponding to the second network node 1, the time length of the first time period of the second network node 1 is determined to be 20 milliseconds; The time length of the first time period of the network node 2 is 25 milliseconds; according to the data volume corresponding to the second network node 3, the time length of the first time period of the second network node 3 is determined to be 15 milliseconds.
3032:第一网络节点根据该第二网络节点的第一时间段的时间长度确定该第二网络节点的第一时间段的起始时间,从而得到该第二网络节点的第一时间段。3032: The first network node determines the start time of the first time period of the second network node according to the time length of the first time period of the second network node, so as to obtain the first time period of the second network node.
可选的,在3032中可以通过如下第一和第二两种方式,得到每个第二网络节点的第一时间段。该两种方式分别为:Optionally, in 3032, the first time period of each second network node may be obtained in the following first and second manners. The two methods are:
在第一种方式中,该M个第二网络节点中的每个第二网络节点的时延相同,第一网络节点确定该M个第二网络节点中的每个第二网络节点发送响应数据的顺序,根据每个第二网络节点的第一时间段的时间长度和每个第二网络节点发送响应数据的顺序,确定每个第二网络节点的第一时间段的起始时间,从而得到每个第二网络节点的第一时间段。In the first manner, the delay of each of the M second network nodes is the same, and the first network node determines that each of the M second network nodes sends response data According to the time length of the first time period of each second network node and the order in which each second network node sends the response data, determine the start time of the first time period of each second network node, so as to obtain A first time period for each second network node.
第二网络节点的时延等于第二网络节点到第一网络节点的传输时延、第二网络节点的处理时延,或者,第二网络节点的传输时延与第二网络节点的处理时延的累加值。其中第二网络节点的传输时延由第二网络节点到第一网络节点的距离决定的,第二网络节点的处理时延由第二网络节点的处理性能决定的。The delay of the second network node is equal to the transmission delay from the second network node to the first network node, the processing delay of the second network node, or the transmission delay of the second network node and the processing delay of the second network node accumulated value. The transmission delay of the second network node is determined by the distance from the second network node to the first network node, and the processing delay of the second network node is determined by the processing performance of the second network node.
例如,该M个第二网络节点包括第二网络节点1、第二网络节点2和第二网络节点3。假设,确定的顺序为第二网络节点1、第二网络节点2和第二网络节点3,基于第二网络节点1的第一时间段的时间长度20毫秒、第二网络节点2的第一时间段的时间长度25毫秒、第三络网络节点3的第一时间段的时间长度15毫秒,确定第二网络节点1的第一时间段为第0至20毫秒,第二网络节点2的第一时间段为第21至45毫秒,第二网络节点3的第一时间段为第46至60毫秒。For example, the M second network nodes include second network node 1 , second network node 2 and second network node 3 . Assuming that the determined sequence is the second network node 1, the second network node 2, and the second network node 3, based on the time length of the first time period of the second network node 1 of 20 milliseconds, the first time of the second network node 2 The time length of the segment is 25 milliseconds, the time length of the first time segment of the third network node 3 is 15 milliseconds, and the first time segment of the second network node 1 is determined to be 0 to 20 milliseconds, and the first The time period is the 21st to 45th milliseconds, and the first time period of the second network node 3 is the 46th to 60th milliseconds.
这样,第一网络节点向第二网络节点1、第二网络节点2、第二网络节点3分别发送被控设备1的控制数据1、被控设备2的控制数据2和被控设备3的控制数据3。第二网络节点1在向被控设备1发送控制数据1后,向第一网络节点连续发送20毫秒长度的响应数据1,响应数据1是被控设备1发送的数据。第二网络节点2在向被控设备2发送控制数据2后,延迟到第21毫秒时,向第一网络节点连续发送25毫秒长度的响应数据2,响应数据2是被控设备2发送的数据。第二网络节点3在向被控设备3发送控制数据3后,延迟到第46毫秒时,向第一网络节点连续发送15毫秒长度的响应数据3,响应数据3是被控设备3发送的数据。In this way, the first network node sends the control data 1 of the controlled device 1, the control data 2 of the controlled device 2, and the control of the controlled device 3 to the second network node 1, the second network node 2, and the second network node 3, respectively. Data 3. After sending the control data 1 to the controlled device 1 , the second network node 1 continuously sends response data 1 with a length of 20 milliseconds to the first network node, and the response data 1 is the data sent by the controlled device 1 . After the second network node 2 sends the control data 2 to the controlled device 2, when the delay reaches the 21st millisecond, it continuously sends the response data 2 with a length of 25 milliseconds to the first network node, and the response data 2 is the data sent by the controlled device 2. . After the second network node 3 sends the control data 3 to the controlled device 3, when the delay reaches the 46th millisecond, it continuously sends the response data 3 with a length of 15 milliseconds to the first network node, and the response data 3 is the data sent by the controlled device 3. .
可选的,对于每个第二网络节点发送响应数据的顺序,第一网络节点可以随机分配每个第二网络节点发送响应数据的顺序。Optionally, for the order in which each second network node sends the response data, the first network node may randomly assign the order in which each second network node sends the response data.
在第二种方式中,对于每个第二网络节点,第一网络节点根据该第二网络节点对应的数据量和该第二网络节点的属性信息,为该第二网络节点分配第一时间段。In the second manner, for each second network node, the first network node allocates a first time period to the second network node according to the data volume corresponding to the second network node and attribute information of the second network node .
由于不同第二网络节点到第一网络节点之间的距离不同,导致不同第二网络节点到第一网络节点的传输时延不同,和/或,不同第二网络节点的处理性能不同,导致不同第二网络节 点处理时延不同。Due to the different distances between different second network nodes and the first network node, the transmission delays from different second network nodes to the first network node are different, and/or the processing performance of different second network nodes is different, resulting in different transmission delays from different second network nodes to the first network node. The second network node has different processing delays.
在第二种方式中,可以根据每个第二网络节点的属性信息计算每个第二网络节点的时延,第二网络节点的时延等于该第二网络节点的传输时延、处理时延或该第二网络节点的传输时延和处理时延的累加值。根据每个第二网络节点的时延和第一时间段的时间长度确定每个第二网络节点发送响应数据的起始时间,即得到每个第二网络节点的第一时间段的起始时间,从而得到每个第二网络节点的第一时间段。In the second method, the delay of each second network node can be calculated according to the attribute information of each second network node, and the delay of the second network node is equal to the transmission delay and processing delay of the second network node. Or the accumulated value of the transmission delay and the processing delay of the second network node. Determine the start time for each second network node to send response data according to the delay of each second network node and the time length of the first time period, that is, to obtain the start time of the first time period for each second network node , so as to obtain the first time period of each second network node.
可选的,在第二种方式中,可以从每个第二网络节点的时延和第一时间段的时间长度,选择最大时延和最大时间长度,根据该最大时延、最大时间长度和每个第二网络节点的第一时间段的时间长度,得到每个第二网络节点的第一时间段的起始时间,从而得到每个第二网络节点的第一时间段。Optionally, in the second manner, the maximum delay and the maximum time length may be selected from the delay of each second network node and the time length of the first time period, and the maximum delay time, the maximum time length and the The time length of the first time period of each second network node is obtained, and the start time of the first time period of each second network node is obtained, thereby obtaining the first time period of each second network node.
例如,参见图4所示的实例,假设第二网络节点1的时延为10毫秒、第二网络节点2的时延为12毫秒和第二网络节点3的时延为15毫秒。For example, referring to the example shown in FIG. 4 , it is assumed that the delay of the second network node 1 is 10 milliseconds, the delay of the second network node 2 is 12 milliseconds, and the delay of the second network node 3 is 15 milliseconds.
从第二网络节点1的第一时间段的时间长度20毫秒、第二网络节点2的第一时间段的时间长度25毫秒、第三网络节点3的第一时间段的时间长度15毫秒,选择最大时间长度25毫秒。从第二网络节点1的时延10毫秒、第二网络节点2的时延12毫秒和第二网络节点3的时延15毫秒,选择最大时延15毫秒。基于最大时间长度25毫秒和最大时延15毫秒,计算基准时延等于25+2*15=55毫秒。From the time length of the first time period of the second network node 1 20 ms, the time length of the first time period of the second network node 2 25 ms, the time length of the first time period of the third network node 3 15 ms, select The maximum time length is 25 milliseconds. The maximum delay of 15 milliseconds is selected from the delay of the second network node 1 of 10 milliseconds, the delay of the second network node 2 of 12 milliseconds, and the delay of the second network node 3 of 15 milliseconds. Based on the maximum time length of 25 milliseconds and the maximum delay of 15 milliseconds, the calculated reference delay is equal to 25+2*15=55 milliseconds.
根据基准时延55毫秒和第二网络节点1的时延10毫秒,获取第二网络节点1的第一时间段的起始时间为55-2*10=35毫秒,而第二网络节点1的第一时间段的时间长度20毫秒,即第二网络节点1的第一时间段为第35至54毫秒。其中,第一网络节点向第二网络节点1发送控制数据1,经过10毫秒后,第二网络节点1向被控设备1发送控制数据1。第二网络节点1发送控制数据1后,延迟到第35毫秒时,发送20毫秒长度的响应数据1,响应数据1是被控设备1发送的数据。响应数据1再经过10毫秒后被第一网络节点接收到,第一网络节点接收响应数据1的起始时间为10+35+10=55毫秒,所以第一网络节点接收响应数据1的时间段为第55至74毫秒。According to the reference delay of 55 milliseconds and the delay of the second network node 1 of 10 milliseconds, the starting time of the first time period of the second network node 1 is obtained as 55-2*10=35 milliseconds. The time length of the first time period is 20 milliseconds, that is, the first time period of the second network node 1 is the 35th to 54th milliseconds. The first network node sends the control data 1 to the second network node 1 , and after 10 milliseconds, the second network node 1 sends the control data 1 to the controlled device 1 . After the second network node 1 sends the control data 1, when the delay reaches the 35th millisecond, it sends the response data 1 with a length of 20 milliseconds, and the response data 1 is the data sent by the controlled device 1. The response data 1 is received by the first network node after another 10 milliseconds. The starting time for the first network node to receive the response data 1 is 10+35+10=55 milliseconds, so the time period for the first network node to receive the response data 1 for the first 55 to 74 ms.
根据基准时延55毫秒和第二网络节点2的时延12毫秒,获取第二网络节点2的第一时间段的起始时间为55-2*12=31毫秒,而第二网络节点2的第一时间段的时间长度25毫秒,即第二网络节点1的第一时间段为第31至55毫秒。其中,第一网络节点延迟20毫秒后,向第二网络节点1发送控制数据2,经过12毫秒后,第二网络节点2向被控设备2发送控制数据2。第二网络节点2发送控制数据2后,延迟到第31毫秒时,发送25毫秒长度的响应数据2,响应数据2是被控设备2发送的数据。响应数据2再经过12毫秒后被第一网络节点接收到,第一网络节点接收响应数据2的起始时间为20+12+31+12=75毫秒,所以第一网络节点接收响应数据2的时间段为第75至99毫秒。According to the reference delay of 55 milliseconds and the delay of the second network node 2 of 12 milliseconds, the starting time of the first time period of the second network node 2 is obtained as 55-2*12=31 milliseconds. The time length of the first time period is 25 milliseconds, that is, the first time period of the second network node 1 is the 31st to 55th milliseconds. The first network node sends the control data 2 to the second network node 1 after a delay of 20 milliseconds, and the second network node 2 sends the control data 2 to the controlled device 2 after 12 milliseconds. After the second network node 2 sends the control data 2, when the delay reaches the 31st millisecond, it sends the response data 2 with a length of 25 milliseconds, and the response data 2 is the data sent by the controlled device 2. The response data 2 is received by the first network node after another 12 milliseconds. The start time for the first network node to receive the response data 2 is 20+12+31+12=75 milliseconds, so the first network node receives the response data 2. The time period is the 75th to 99th milliseconds.
根据基准时延55毫秒和第二网络节点3的时延15毫秒,获取第二网络节点3的第一时间段的起始时间为55-2*15=25毫秒,而第二网络节点3的第一时间段的时间长度15毫秒,即第二网络节点3的第一时间段为第25至39毫秒。其中,第一网络节点延迟45(20+25)毫秒后,向第二网络节点3发送控制数据3,经过15毫秒后,第二网络节点3向被控设备3发送控制数据3。第二网络节点3发送控制数据3后,延迟到第25毫秒时,发送15毫秒长度的响应数据3,响应数据3是被控设备3发送的数据。响应数据3再经过15毫秒后被第一 网络节点接收到,第一网络节点接收响应数据3的起始时间为20+25+15+25+15=100毫秒,所以第一网络节点接收响应数据3的时间段为第100至114毫秒。According to the reference delay of 55 milliseconds and the delay of the second network node 3 of 15 milliseconds, the starting time of the first time period of the second network node 3 is obtained as 55-2*15=25 milliseconds. The time length of the first time period is 15 milliseconds, that is, the first time period of the second network node 3 is the 25th to 39th milliseconds. The first network node sends the control data 3 to the second network node 3 after a delay of 45 (20+25) milliseconds, and the second network node 3 sends the control data 3 to the controlled device 3 after 15 milliseconds. After the second network node 3 sends the control data 3, when the delay reaches the 25th millisecond, it sends the response data 3 with a length of 15 milliseconds, and the response data 3 is the data sent by the controlled device 3. The response data 3 is received by the first network node after another 15 milliseconds. The start time of the first network node receiving the response data 3 is 20+25+15+25+15=100 milliseconds, so the first network node receives the response data. The period of 3 is the 100th to 114th milliseconds.
在上述例子中,第一网络节点延迟向每个第二网络节点发送控制数据,第一网络节点也可不延迟发送每个第二网络节点的控制数据,接下来列举另一种例子。如下所述:In the above example, the first network node delays sending the control data to each second network node, and the first network node may also send the control data of each second network node without delay. Another example is given next. as described below:
根据基准时延55毫秒和第二网络节点1的时延10毫秒,获取第二网络节点1的第一时间段的起始时间为55-2*10=35毫秒,而第二网络节点1的第一时间段的时间长度20毫秒,即第二网络节点1的第一时间段为第35至54毫秒。其中,第一网络节点向第二网络节点1发送控制数据1,经过10毫秒,第二网络节点1向被控设备1发送控制数据1。第二网络节点1发送控制数据1后,延迟到第35毫秒时,发送20毫秒长度的响应数据1,响应数据1是被控设备1发送的数据。响应数据1再经过10毫秒后被第一网络节点接收到,第一网络节点接收响应数据1的起始时间为10+35+10=55毫秒,所以第一网络节点接收响应数据1的时间段为第55至74毫秒。According to the reference delay of 55 milliseconds and the delay of the second network node 1 of 10 milliseconds, the starting time of the first time period of the second network node 1 is obtained as 55-2*10=35 milliseconds. The time length of the first time period is 20 milliseconds, that is, the first time period of the second network node 1 is the 35th to 54th milliseconds. The first network node sends the control data 1 to the second network node 1 , and after 10 milliseconds, the second network node 1 sends the control data 1 to the controlled device 1 . After the second network node 1 sends the control data 1, when the delay reaches the 35th millisecond, it sends the response data 1 with a length of 20 milliseconds, and the response data 1 is the data sent by the controlled device 1. The response data 1 is received by the first network node after another 10 milliseconds. The starting time for the first network node to receive the response data 1 is 10+35+10=55 milliseconds, so the time period for the first network node to receive the response data 1 for the first 55 to 74 ms.
根据基准时延55毫秒、第二网络节点2的时延12毫秒和第一网络节点1的第一时间段的时间长度20毫秒,获取第二网络节点2的第一时间段的起始时间为55-2*12+20=51毫秒,而第二网络节点2的第一时间段的时间长度25毫秒,即第二网络节点2的第一时间段为第51至75毫秒。其中,第一网络节点向第二网络节点2发送控制数据2,经过12毫秒后,第二网络节点2向被控设备2发送控制数据2。第二网络节点2发送控制数据2后,延迟到第51毫秒时,发送25毫秒长度的响应数据2,响应数据2是被控设备2发送的数据。响应数据2再经过12毫秒后被第一网络节点接收到,第一网络节点接收响应数据2的起始时间为12+51+12=75毫秒,所以第一网络节点接收响应数据2的时间段为第75至99毫秒。According to the reference delay of 55 milliseconds, the delay of the second network node 2 of 12 milliseconds, and the length of the first time period of the first network node 1 of 20 milliseconds, the starting time of the first time period of the second network node 2 is obtained as 55-2*12+20=51 milliseconds, and the time length of the first time period of the second network node 2 is 25 milliseconds, that is, the first time period of the second network node 2 is the 51st to 75th milliseconds. The first network node sends the control data 2 to the second network node 2 , and after 12 milliseconds, the second network node 2 sends the control data 2 to the controlled device 2 . After the second network node 2 sends the control data 2, when the delay reaches the 51st millisecond, it sends the response data 2 with a length of 25 milliseconds, and the response data 2 is the data sent by the controlled device 2. The response data 2 is received by the first network node after another 12 milliseconds. The start time for the first network node to receive the response data 2 is 12+51+12=75 milliseconds, so the time period for the first network node to receive the response data 2 for the first 75 to 99 ms.
根据基准时延55毫秒、第二网络节点3的时延15毫秒、第二网络节点1的第一时间段的时间长度20毫秒和第二网络节点2的第一时间段的时间长度25毫秒,获取第二网络节点3的第一时间段的起始时间为55-2*15+20+25=70毫秒,而第二网络节点3的第一时间段的时间长度15毫秒,即第二网络节点3的第一时间段为第70至89毫秒。其中,第一网络节点向第二网络节点3发送控制数据3,经过15毫秒后,第二网络节点3向被控设备3发送控制数据3。第二网络节点3发送控制数据3后,延迟到第70毫秒时,发送15毫秒长度的响应数据3,响应数据3是被控设备3发送的数据。响应数据3再经过15毫秒后被第一网络节点接收到,第一网络节点接收响应数据3的起始时间为15+70+15=100毫秒,所以第一网络节点接收响应数据3的时间段为第100至114毫秒。According to the reference delay of 55 milliseconds, the delay of the second network node 3 of 15 milliseconds, the time length of the first time period of the second network node 1 of 20 milliseconds, and the time length of the first time period of the second network node 2 of 25 milliseconds, The start time of obtaining the first time period of the second network node 3 is 55-2*15+20+25=70 milliseconds, and the time length of the first time period of the second network node 3 is 15 milliseconds, that is, the second network The first time period for node 3 is the 70th to 89th milliseconds. The first network node sends the control data 3 to the second network node 3 , and after 15 milliseconds, the second network node 3 sends the control data 3 to the controlled device 3 . After the second network node 3 sends the control data 3, when the delay reaches the 70th millisecond, it sends the response data 3 with a length of 15 milliseconds, and the response data 3 is the data sent by the controlled device 3. The response data 3 is received by the first network node after another 15 milliseconds. The start time for the first network node to receive the response data 3 is 15+70+15=100 milliseconds, so the time period for the first network node to receive the response data 3 for the 100th to 114th ms.
第二网络节点的属性信息包括第二网络节点的性能参数和/或第二网络节点与第一网络节点之间的距离。The attribute information of the second network node includes performance parameters of the second network node and/or the distance between the second network node and the first network node.
第二网络节点的性能参数可以包括第二网络节点的中央处理器(central processing unit,CPU)核数目和CPU处理频率等中的一个或多个。The performance parameter of the second network node may include one or more of the number of central processing unit (central processing unit, CPU) cores and the CPU processing frequency of the second network node.
可选的,在第一网络节点与多个控制设备相连的情况下,该N个被控设备被一个控制设备所控制,第一网络节点确定该一个控制设备对应的第二时间段,第二时间段至少包括该M个第二网络节点中的每个第二网络节点的第一时间段。第一网络节点根据该M个第二网络节点中的每个第二网络节点对应的数据量,为每个第二网络节点分配在第二时间段内的不同第一时间段。或者,第一网络节点根据每个第二网络节点的属性信息和每个第二网络节点对应的数据量,为每个第二网络节点分配在第二时间段内的不同第一时间段。Optionally, when the first network node is connected to multiple control devices, the N controlled devices are controlled by one control device, the first network node determines the second time period corresponding to the one control device, and the second The time period includes at least the first time period of each of the M second network nodes. The first network node allocates a different first time period within the second time period to each second network node according to the data amount corresponding to each of the M second network nodes. Alternatively, the first network node allocates a different first time period within the second time period to each second network node according to the attribute information of each second network node and the data amount corresponding to each second network node.
可选的,第一网络节点还获取每个第二网络节点的属性信息,并保存每个第二网络节点的属性信息。这样在使用到第二网络节点的属性信息的情况下,直接获取保存的第二网络节点的属性信息。Optionally, the first network node further acquires attribute information of each second network node, and saves the attribute information of each second network node. In this way, when the attribute information of the second network node is used, the stored attribute information of the second network node is directly obtained.
可选的,对于第一网络节点到每个第二网络节点的传输时延,第一网络节点可以分别测量第一网络节点到每个第二网络节点的传输时延。Optionally, for the transmission delay from the first network node to each second network node, the first network node may measure the transmission delay from the first network node to each second network node respectively.
可选的,对于每个第二网络节点的性能参数,第一网络节点可以向每个第二网络节点中分别查询每个第二网络节点的性能参数。或者,预先在第一网络节点中配置每个第二网络节点的性能参数。或者,第一网络节点从网管设备中获取每个第二网络节点的性能参数。Optionally, for the performance parameter of each second network node, the first network node may query each second network node for the performance parameter of each second network node respectively. Alternatively, the performance parameters of each second network node are pre-configured in the first network node. Or, the first network node acquires the performance parameter of each second network node from the network management device.
对于其他控制设备所控制的至少一个被控设备,也按上述步骤302至303的操作,确定与该至少一个被控设备相连的每个第二网络节点,确定该其他控制设备对应的时间段以及分配每个第二网络节点在该时间段内的不同时间段。For at least one controlled device controlled by other control devices, also according to the operations of the above steps 302 to 303, determine each second network node connected to the at least one controlled device, determine the time period corresponding to the other control device, and Each second network node is allocated a different time period within the time period.
步骤304:对于每个第二网络节点,第一网络节点向第二网络节点发送第一数据帧,第一数据帧包括与该第二网络节点相连的被控设备的控制数据和该第二网络节点的第一时间段的配置信息。Step 304: For each second network node, the first network node sends a first data frame to the second network node, and the first data frame includes the control data of the controlled device connected to the second network node and the second network node. Configuration information of the first time period of the node.
第一时间段的配置信息用于第二网络节点确定第一时间段。第一时间段的配置信息可以包括第一时间段的起始时间和时间长度等信息。The configuration information of the first time period is used by the second network node to determine the first time period. The configuration information of the first time period may include information such as the start time and time length of the first time period.
可选的,在本步骤中,第一网络节点生成第一数据帧,第一数据帧包括每个被控设备的控制数据和每个第二网络节点的第一时间段的配置信息,向每个第二网络节点发送第一数据帧。或者,第一网络节点可以生成M个第一数据帧,该M个第一数据帧分别与M个第二网络节点一一对应,第二网络节点对应的第一数据帧的净荷包括与该第二网络节点相连的被控设备的控制数据和该第二网络节点的第一时间段的配置信息,向每个第二网络节点发送每个第二网络节点对应的第一数据帧。Optionally, in this step, the first network node generates a first data frame, the first data frame includes the control data of each controlled device and the configuration information of the first time period of each second network node, and is sent to each A second network node sends the first data frame. Alternatively, the first network node may generate M first data frames, the M first data frames are in one-to-one correspondence with the M second network nodes, and the payload of the first data frame corresponding to the second network node includes the The control data of the controlled device connected to the second network node and the configuration information of the first time period of the second network node are sent to each second network node. The first data frame corresponding to each second network node is sent to each second network node.
可选的,第一数据帧可以为以太帧,第一网络节点将每个被控设备的控制数据和每个第二网络节点的第一时间段的配置信息作为净荷,在该净荷基础上添加以太帧头,得到第一数据帧。Optionally, the first data frame may be an Ethernet frame, and the first network node uses the control data of each controlled device and the configuration information of the first time period of each second network node as the payload, on the basis of the payload. Add the Ethernet frame header to get the first data frame.
可选的,第一网络节点还根据该净荷生成第一校验码,第一数据帧还包括第一校验码。Optionally, the first network node further generates a first check code according to the payload, and the first data frame further includes the first check code.
可选的,第一网络节点可以根据该净荷,采用前向纠错码(forward error correction,FEC)机制生成第一校验码。Optionally, the first network node may use a forward error correction (forward error correction, FEC) mechanism to generate the first check code according to the payload.
例如,参见图5,第一网络节点接收被控设备1的控制数据,被控设备2的控制数据和被控设备3的控制数据,将被控设备1的控制数据,被控设备2的控制数据和被控设备3的控制数据以及第二网络节点1的第一时间段的配置信息、第二网络节点2的第一时间段的配置信息和第二网络节点3的第一时间段的配置信息作为净荷,根据该净荷生成第一校验数据,生成第一数据帧,第一数据帧包括Eth帧头、被控设备1的控制数据,被控设备2的控制数据、被控设备3的控制数据和第一校验数据。向与被控设备1相连的第二网络节点1、与被控设备2相连的第二网络节点2和与被控设备3相连的第二网络节点3发送第一数据帧。For example, referring to FIG. 5 , the first network node receives the control data of the controlled device 1, the control data of the controlled device 2 and the control data of the controlled device 3, and sends the control data of the controlled device 1 to the control data of the controlled device 2. Data and control data of the controlled device 3 and the configuration information of the first time period of the second network node 1, the configuration information of the second network node 2 of the first time period, and the configuration of the second network node 3 of the first time period The information is used as the payload, and the first check data is generated according to the payload, and the first data frame is generated. The first data frame includes the Eth frame header, the control data of the controlled device 1, the control data of the controlled device 2, and the controlled device. 3 of the control data and the first check data. The first data frame is sent to the second network node 1 connected to the controlled device 1 , the second network node 2 connected to the controlled device 2 , and the second network node 3 connected to the controlled device 3 .
步骤305:第二网络节点接收与自身相连的被控设备的控制数据,向该被控设备发送该被控设备的控制数据。Step 305: The second network node receives the control data of the controlled device connected to itself, and sends the control data of the controlled device to the controlled device.
对于该M个第二网络节点中的每个第二网络节点,该第二网络节点与该N个被控设备中的一个或多个被控设备相连。该第二网络节点向与自身相连的每个被控设备分别发送每个被 控设备的控制数据。For each of the M second network nodes, the second network node is connected to one or more controlled devices among the N controlled devices. The second network node sends control data of each controlled device to each controlled device connected to itself.
可选的,在该第二网络节点接收到第一数据帧的情况下,第一数据帧包括该N个被控设备中的每个被控设备的控制数据,该第二网络节点从第一数据帧中获取与自身相连的每个被控设备的控制数据,向该每个被控设备分别发送每个被控设备的控制数据。在实现时:Optionally, when the second network node receives the first data frame, the first data frame includes control data of each of the N controlled devices, and the second network node receives the first data frame from the first data frame. The control data of each controlled device connected to itself is obtained in the data frame, and the control data of each controlled device is respectively sent to each controlled device. When implemented:
对于每个被控设备,该第二网络节点根据该被控设备的控制数据包括的该被控设备的标识,确定该被控设备是否与自身相连,如果相连,从第一数据帧中获取该被控设备的控制数据和自身的第一时间段的配置信息,根据该被控设备的标识向该被控设备发送该被控设备的控制数据,以及根据该配置信息确定第一时间段。For each controlled device, the second network node determines whether the controlled device is connected to itself according to the identifier of the controlled device included in the control data of the controlled device, and if so, obtains the controlled device from the first data frame. Control data of the controlled device and configuration information of its own first time period, send the control data of the controlled device to the controlled device according to the identifier of the controlled device, and determine the first time period according to the configuration information.
可选的,在第一数据帧包括第一校验数据的情况下,该第二网络节点根据第一校验数据对第一数据帧的净荷进行校验,如果检验出第一数据帧的净荷没有发生错误,则该第二网络节点从第一数据帧中获取与自身相连的每个被控设备的控制数据。如果检验出第一数据帧的净荷发生错误,则该第二网络节点丢弃第一数据帧。Optionally, in the case where the first data frame includes the first check data, the second network node checks the payload of the first data frame according to the first check data. If there is no error in the payload, the second network node obtains the control data of each controlled device connected to itself from the first data frame. If an error is detected in the payload of the first data frame, the second network node discards the first data frame.
可选的,该第二网络节点根据第一校验数据,采用FEC机制对第一数据帧的净荷进行校验。Optionally, the second network node uses an FEC mechanism to verify the payload of the first data frame according to the first verification data.
对于与该第二网络节点通信的每个被控设备,该被控设备接收该被控设备的控制数据,根据该控制数据包括的命令向该第二网络节点发送针对该命令的响应数据。For each controlled device that communicates with the second network node, the controlled device receives control data of the controlled device, and sends response data for the command to the second network node according to the command included in the control data.
例如,假设该命令为用于开启开关的命令,该被控设备向该第二网络节点发送的响应数据为开启成功指示消息或开启失败指示消息。再例如,假设该命令为用于关闭开关的命令,该被控设备向该第二网络节点发送的响应数据为关闭成功指示消息或关闭失败指示消息。还例如,该命令为定位命令,该被控设备向该第二网络节点发送的响应数据为该被控设备的位置信息。For example, assuming that the command is a command for turning on a switch, the response data sent by the controlled device to the second network node is a turn-on success indication message or a turn-on failure indication message. For another example, assuming that the command is a command for closing the switch, the response data sent by the controlled device to the second network node is a closing success indication message or a closing failure indication message. For another example, the command is a positioning command, and the response data sent by the controlled device to the second network node is the location information of the controlled device.
步骤306:第二网络节点接收与自身相连的每个被控设备的响应数据,在该第二网络节点的第一时间段内向第一网络节点发送该每个被控设备的响应数据。Step 306: The second network node receives the response data of each controlled device connected to itself, and sends the response data of each controlled device to the first network node within the first time period of the second network node.
可选的,第二网络节点生成第三数据帧,第三数据帧包括与该第二网络节点相连的每个被控设备的响应数据,向第一网络节点发送第三数据帧。Optionally, the second network node generates a third data frame, where the third data frame includes response data of each controlled device connected to the second network node, and sends the third data frame to the first network node.
可选的,第三数据帧可以为突发脉冲(burst,Bst)帧,第一网络节点将每个被控设备的控制数据作为净荷,在该净荷基础上添加Bst帧头,得到第三数据帧。Optionally, the third data frame may be a burst (burst, Bst) frame, and the first network node uses the control data of each controlled device as a payload, and adds a Bst frame header on the basis of the payload to obtain the first data frame. Three data frames.
可选的,第二网络节点还根据该净荷生成第二校验码,第三数据帧还包括第二校验码。Optionally, the second network node further generates a second check code according to the payload, and the third data frame further includes the second check code.
可选的,第二网络节点可以根据该净荷,采用FEC机制生成第二校验码。Optionally, the second network node may use the FEC mechanism to generate the second check code according to the payload.
例如,参见图5,第二网络节点1接收被控设备1的响应数据,将被控设备1的响应数据作为净荷,根据该净荷生成第二校验数据1,生成第三数据帧1,第三数据帧1包括Bst帧头、被控设备1的响应数据和第二校验数据1,在第二网络节点1的第一时间段内向第一网络节点发送第三数据帧1。For example, referring to FIG. 5 , the second network node 1 receives the response data of the controlled device 1, uses the response data of the controlled device 1 as the payload, generates the second check data 1 according to the payload, and generates the third data frame 1 , the third data frame 1 includes the Bst frame header, the response data of the controlled device 1 and the second check data 1 , and sends the third data frame 1 to the first network node within the first time period of the second network node 1 .
第二网络节点2接收被控设备2的响应数据,将被控设备2的响应数据作为净荷,根据该净荷生成第二校验数据2,生成第三数据帧2,第三数据帧2包括Bst帧头、被控设备2的响应数据和第二校验数据2,在第二网络节点2的第一时间段内向第一网络节点发送第三数据帧2。以及,The second network node 2 receives the response data of the controlled device 2, uses the response data of the controlled device 2 as the payload, generates the second check data 2 according to the payload, generates the third data frame 2, and the third data frame 2 The third data frame 2 is sent to the first network node within the first time period of the second network node 2 including the Bst frame header, the response data of the controlled device 2 and the second check data 2 . as well as,
第二网络节点3接收被控设备3的响应数据,将被控设备3的响应数据作为净荷,根据该净荷生成第二校验数据3,生成第三数据帧3,第三数据帧3包括Bst帧头、被控设备3的 响应数据和第二校验数据3,在第二网络节点3的第一时间段内向第一网络节点发送第三数据帧3。The second network node 3 receives the response data of the controlled device 3, uses the response data of the controlled device 3 as the payload, generates the second check data 3 according to the payload, generates the third data frame 3, and the third data frame 3 The third data frame 3 is sent to the first network node within the first time period of the second network node 3 including the Bst frame header, the response data of the controlled device 3 and the second check data 3 .
步骤307:对于每个第二网络节点,第一网络节点接收该第二网络节点在该第二网络节点的第一时间段内发送的数据,该第二网络节点发送的数据包括与该第二网络节点相连的被控设备的响应数据。Step 307: For each second network node, the first network node receives data sent by the second network node within the first time period of the second network node, and the data sent by the second network node includes data sent by the second network node. The response data of the controlled device connected to the network node.
可选的,对于该M个第二网络节点中的每个第二网络节点,第一网络节点接收该第二网络节点发送的第三数据帧,从该第三数据帧中获取与该第二网络节点相连的每个被控设备的响应数据。Optionally, for each second network node in the M second network nodes, the first network node receives the third data frame sent by the second network node, and obtains the data from the third data frame and the second network node. Response data of each controlled device connected to the network node.
对于该M个第二网络节点中的每个第二网络节点,每个第二网络节点分别在各自的第一时间段内发送第三数据帧。在每个第二网络节点的第一时间段中,相邻两个第一时间段之间的间隔可能很小,或为0。所以第一网络节点可以连续接收到由第三数据帧组成的数据序列,即该数据序列包括多个第三数据帧。For each second network node in the M second network nodes, each second network node transmits a third data frame within a respective first time period. In the first time period of each second network node, the interval between two adjacent first time periods may be small, or zero. Therefore, the first network node can continuously receive the data sequence composed of the third data frames, that is, the data sequence includes a plurality of third data frames.
可选的,第三数据帧的帧头为Bst帧头,该Bst帧头中包括Bst信息,每个第三数据帧的Bst帧头包括的Bst信息相同。所以第一网络节点基于该Bst信息可以从接收的数据序列中识别出一个个第三数据帧。Optionally, the frame header of the third data frame is a Bst frame header, the Bst frame header includes Bst information, and the Bst frame header of each third data frame includes the same Bst information. Therefore, the first network node can identify each third data frame from the received data sequence based on the Bst information.
可选的,在第三数据帧包括第二校验数据的情况下,该第一网络节点根据第二校验数据对第三数据帧的净荷进行校验,如果检验出第三数据帧的净荷没有发生错误,则第一网络节点从第三数据帧中获取与被控设备的响应数据。如果检验出第三数据帧的净荷发生错误,则第一网络节点丢弃第三数据帧。Optionally, when the third data frame includes the second check data, the first network node checks the payload of the third data frame according to the second check data. If there is no error in the payload, the first network node obtains the response data with the controlled device from the third data frame. If an error is detected in the payload of the third data frame, the first network node discards the third data frame.
可选的,第一网络节点根据第二校验数据,采用FEC机制对第三数据帧的净荷进行校验。Optionally, the first network node uses an FEC mechanism to verify the payload of the third data frame according to the second verification data.
例如,第一网络节点接收第三数据帧1,根据第三数据帧1包括的第二校验数据1对第三数据帧1包括的净荷(被控设备1的响应数据1)进行校验,如果校验出第三数据帧1的净荷没有发生错误,从第三数据帧1中获取被控设备1的响应数据1。For example, the first network node receives the third data frame 1, and checks the payload (response data 1 of the controlled device 1) included in the third data frame 1 according to the second check data 1 included in the third data frame 1 , if it is verified that there is no error in the payload of the third data frame 1, the response data 1 of the controlled device 1 is obtained from the third data frame 1.
第一网络节点接收第三数据帧2,根据第三数据帧2包括的第二校验数据2对第三数据帧2包括的净荷(被控设备2的响应数据2)进行校验,如果校验出第三数据帧2的净荷没有发生错误,从第三数据帧2中获取被控设备2的响应数据2。以及,The first network node receives the third data frame 2, and checks the payload (response data 2 of the controlled device 2) included in the third data frame 2 according to the second verification data 2 included in the third data frame 2. If It is verified that there is no error in the payload of the third data frame 2 , and the response data 2 of the controlled device 2 is obtained from the third data frame 2 . as well as,
第一网络节点接收第三数据帧3,根据第三数据帧3包括的第二校验数据3对第三数据帧3包括的净荷(被控设备3的响应数据3)进行校验,如果校验出第三数据帧3的净荷没有发生错误,从第三数据帧3中获取被控设备3的响应数据3。The first network node receives the third data frame 3, and checks the payload (response data 3 of the controlled device 3) included in the third data frame 3 according to the second verification data 3 included in the third data frame 3. If It is verified that there is no error in the payload of the third data frame 3 , and the response data 3 of the controlled device 3 is obtained from the third data frame 3 .
步骤308:第一网络节点向控制设备发送该N个被控设备中的每个被控设备的响应数据。Step 308: The first network node sends the response data of each of the N controlled devices to the control device.
在本步骤中,第一网络节点向控制设备发送第二数据帧,第二数据帧包括根据接收每个被控设备的响应数据的顺序,排列的每个被控设备的响应数据。In this step, the first network node sends a second data frame to the control device, and the second data frame includes the response data of each controlled device arranged according to the sequence of receiving the response data of each controlled device.
例如,参见图5,假设第一网络节点依次接收到第三数据帧1、第三数据帧2和第三数据帧3,则生成的第二数据帧包括被控设备1的响应数据1、被控设备2的响应数据2和被控设备3的响应数据3,向控制设备发送第二数据帧。For example, referring to FIG. 5 , assuming that the first network node receives the third data frame 1, the third data frame 2 and the third data frame 3 in sequence, the generated second data frame includes the response data 1 of the controlled device 1, the The response data 2 of the controlling device 2 and the response data 3 of the controlled device 3 are sent to the controlling device, and the second data frame is sent.
可选的,第二数据帧可以为Eth帧,第一网络节点将每个被控设备的响应数据作为净荷,在该净荷基础上添加Eth帧头,得到第二数据帧。Optionally, the second data frame may be an Eth frame, and the first network node uses the response data of each controlled device as a payload, and adds an Eth frame header on the basis of the payload to obtain the second data frame.
在本申请实施例中,由于第一网络节点根据N个被控设备的控制数据,确定与该N个被控设备相连的M个第二网络节点,根据N个被控设备的控制数据获取该M个第二网络节点 中的每个第二网络节点对应的数据量,根据每个第二网络节点的数据量为每个第二网络节点分配不同第一时间段。由于每个第二网络节点需要转发被控设备的响应数据,且动态为每个第二网络节点分配第一时间段,所以每个第二网络节点不需要长时间等待各自的第一时间段到达,从而减小了每个第二网络节点发送数据的时延。另外,每个第二网络节点的第一时间段长度基于每个第二网络节点对应的数据量分配的,这样可以保证每个第二网络节点发送响应数据需要的时间长度分别等于每个第二网络节点的第一时间段的时间长度,从而每个第二网络节点在一个第一时间段内就可以发送完自身需要发送的响应数据,减小了每个第二网络节点发送数据的时延以及避免时间资源浪费。In the embodiment of the present application, since the first network node determines M second network nodes connected to the N controlled devices according to the control data of the N controlled devices, and obtains the N controlled devices according to the control data of the N controlled devices For the data volume corresponding to each second network node in the M second network nodes, different first time periods are allocated to each second network node according to the data volume of each second network node. Since each second network node needs to forward the response data of the controlled device and dynamically allocate the first time period to each second network node, each second network node does not need to wait for a long time for the arrival of the respective first time period , thereby reducing the delay in sending data by each second network node. In addition, the length of the first time period of each second network node is allocated based on the amount of data corresponding to each second network node, so as to ensure that the length of time required by each second network node to send response data is equal to that of each second network node. The time length of the first time period of the network node, so that each second network node can send the response data that it needs to send within a first time period, reducing the delay for each second network node to send data and avoid wasting time and resources.
参见图6,本申请实施例提供了一种发送数据的装置500,所述装置500可以部署在上述任意实施例提供的第一网络节点中,用于包括多个被控设备的网络中,包括:处理单元501、接收单元502和发送单元503;Referring to FIG. 6 , an embodiment of the present application provides an apparatus 500 for sending data. The apparatus 500 may be deployed in the first network node provided in any of the foregoing embodiments, and used in a network including multiple controlled devices, including : processing unit 501, receiving unit 502 and sending unit 503;
接收单元502,用于接收控制设备发送的控制数据,该控制数据用于控制该多个被控设备中的至少一个被控设备;a receiving unit 502, configured to receive control data sent by the control device, where the control data is used to control at least one controlled device in the plurality of controlled devices;
发送单元503,用于向第二网络节点发送第一数据帧,第一数据帧包括该控制数据和第一时间段的配置信息,第二网络节点与至少一个被控设备相连,第一时间段的时间长度是处理单元501基于第二网络节点对应的数据量确定的,该数据量等于该至少一个被控设备中的每个被控设备需要发送的响应数据的数据量的累加值,该配置信息用于第二网络节点确定第一时间段并在第一时间段转发每个被控设备发送的响应数据。A sending unit 503 is configured to send a first data frame to a second network node, where the first data frame includes the control data and configuration information of a first time period, the second network node is connected to at least one controlled device, and the first time period The length of time is determined by the processing unit 501 based on the data volume corresponding to the second network node, and the data volume is equal to the cumulative value of the data volume of the response data that needs to be sent by each controlled device in the at least one controlled device. This configuration The information is used by the second network node to determine the first time period and forward the response data sent by each controlled device during the first time period.
可选的,处理单元501确定第二网络节点的第一时间段的时间长度的详细操作,可以参见图3所示实施例的步骤303中的相关内容,在此不再详细说明。Optionally, for the detailed operation of the processing unit 501 determining the time length of the first time period of the second network node, reference may be made to the relevant content in step 303 of the embodiment shown in FIG. 3 , which will not be described in detail here.
可选的,处理单元501,用于:Optionally, the processing unit 501 is used for:
根据该第二网络节点的属性信息和该第二网络节点对应的数据量,为该第二网络节点分配第一时间段。A first time period is allocated to the second network node according to the attribute information of the second network node and the data amount corresponding to the second network node.
可选的,第二网络节点的属性信息包括第二网络节点的性能参数和/或第二网络节点到所述装置500的传输时延。Optionally, the attribute information of the second network node includes a performance parameter of the second network node and/or a transmission delay from the second network node to the apparatus 500 .
可选的,处理单元501,还用于:Optionally, the processing unit 501 is further configured to:
获取每个第二网络节点的属性信息。Obtain attribute information of each second network node.
可选的,与所述装置500相连的控制设备数目为多个,多个控制设备中的每个控制设备对应不同的第二时间段,该至少一个被控设备是被多个控制设备中的一个控制设备所控制,第一时间段位于该一个控制设备对应的第二时间段内。Optionally, the number of control devices connected to the device 500 is multiple, each control device in the multiple control devices corresponds to a different second time period, and the at least one controlled device is one of the multiple control devices. Controlled by one control device, the first time period is located within the second time period corresponding to the one control device.
可选的,处理单元501,还用于:Optionally, the processing unit 501 is further configured to:
根据控制数据,获取每个被控设备需要发送的响应数据的数据量。According to the control data, the data volume of the response data that needs to be sent by each controlled device is obtained.
可选的,处理单元501获取第二网络节点对应的数据量的详细操作,可以参见图3所示实施例的步骤302中的相关内容,在此不再详细说明。Optionally, for the detailed operation of the processing unit 501 for acquiring the data amount corresponding to the second network node, reference may be made to the relevant content in step 302 of the embodiment shown in FIG. 3 , which will not be described in detail here.
可选的,控制数据包括用于控制该每个被控设备的命令;Optionally, the control data includes commands for controlling each controlled device;
处理单元501,用于根据该每个被控设备的命令的类型,获取该每个被控设备需要发送的响应数据的数据量。The processing unit 501 is configured to acquire, according to the type of the command of each controlled device, the data amount of the response data that each controlled device needs to send.
可选的,接收单元502,用于接收该第二网络节点在该第二网络节点的第一时间段内发 送的该每个被控设备的响应数据;Optionally, the receiving unit 502 is used to receive the response data of each controlled device sent by the second network node in the first time period of the second network node;
发送单元503,用于向控制设备发送第二数据帧,第二数据帧包括根据接收每个被控设备的响应数据的顺序,排列的每个被控设备的响应数据。The sending unit 503 is configured to send a second data frame to the control device, where the second data frame includes the response data of each controlled device arranged according to the order of receiving the response data of each controlled device.
可选的,与所述装置500相连的控制设备数目为多个,多个控制设备中的每个控制设备对应不同时间段,该N个被控设备是被多个控制设备中的一个控制设备所控制;Optionally, the number of control devices connected to the device 500 is multiple, each of the multiple control devices corresponds to a different time period, and the N controlled devices are one of the multiple controlled devices. controlled;
处理单元501,用于根据每个第二网络节点对应的数据量,为每个第二网络节点分配在该一个控制设备对应的时间段内的不同时间段。The processing unit 501 is configured to allocate to each second network node different time periods within the time period corresponding to the one control device according to the data volume corresponding to each second network node.
在本申请实施例中,由于该至少一个被控设备需要向控制设备发送响应数据,对于与该至少一个被控设备相连的第二网络节点,该第二网络节点需要向第一网络节点发送每个被控设备的响应数据,这样在第二网络节点需要发送数据时,处理单元才为第二网络节点分配第一时间段,第二网络节点的第一时间段都被用来发送响应数据,且不需要长时间等待该第一时间段的到达,避免了时间资源的浪费以及减小发送数据的时延。又由于处理单元获取第二网络节点对应的数据量,根据第二网络节点对应的数据量,为第二网络节点分配第一时间段,这样保证第二网络节点的第一时间段可刚好用于该第二网络节点发送数据,从而进一步地避免了时间资源的浪费。In this embodiment of the present application, since the at least one controlled device needs to send response data to the control device, for the second network node connected to the at least one controlled device, the second network node needs to send each response data to the first network node. In this way, when the second network node needs to send data, the processing unit allocates the first time period to the second network node, and the first time period of the second network node is used to send the response data. In addition, it is not necessary to wait for the arrival of the first time period for a long time, which avoids waste of time resources and reduces the delay of sending data. Since the processing unit acquires the data volume corresponding to the second network node, and allocates the first time period to the second network node according to the data volume corresponding to the second network node, this ensures that the first time period of the second network node can be used just for the second network node. The second network node sends data, thereby further avoiding waste of time resources.
参见图7,本申请实施例提供了一种发送数据的装置600示意图。该装置600可以是上述任一实施例中的第一网络节点。该装置600包括至少一个处理器601,内部连接602,存储器603以及至少一个收发器604。Referring to FIG. 7 , an embodiment of the present application provides a schematic diagram of an apparatus 600 for sending data. The apparatus 600 may be the first network node in any of the above embodiments. The apparatus 600 includes at least one processor 601 , internal connections 602 , memory 603 and at least one transceiver 604 .
该装置600是一种硬件结构的装置,可以用于实现图6所述的装置500中的功能模块。例如,本领域技术人员可以想到图6所示的装置500中的处理单元501可以通过该至少一个处理器601调用存储器603中的代码来实现,图6所示的装置500中的接收单元502和发送单元503可以通过该收发器604来实现。The apparatus 600 is an apparatus with a hardware structure, and can be used to implement the functional modules in the apparatus 500 described in FIG. 6 . For example, those skilled in the art can think that the processing unit 501 in the apparatus 500 shown in FIG. 6 can be implemented by calling the code in the memory 603 by the at least one processor 601, and the receiving unit 502 and the receiving unit 502 in the apparatus 500 shown in FIG. The sending unit 503 can be implemented by the transceiver 604 .
可选的,该装置600还可用于实现上述任一实施例中配置设备的功能。Optionally, the apparatus 600 can also be used to implement the function of configuring the device in any of the foregoing embodiments.
可选的,上述处理器601可以是一个通用中央处理器(central processing unit,CPU),网络处理器(network processor,NP),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本申请方案程序执行的集成电路。Optionally, the above-mentioned processor 601 may be a general-purpose central processing unit (central processing unit, CPU), network processor (network processor, NP), microprocessor, application-specific integrated circuit (application-specific integrated circuit, ASIC) , or one or more integrated circuits used to control the execution of the program of this application.
上述内部连接602可包括一通路,在上述组件之间传送信息。可选的,内部连接602为单板或总线等。The internal connection 602 described above may include a path to transfer information between the above described components. Optionally, the internal connection 602 is a single board or a bus or the like.
上述收发器604,用于与其他设备或通信网络通信。The above transceiver 604 is used to communicate with other devices or communication networks.
上述存储器603可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过总线与处理器相连接。存储器也可以和处理器集成在一起。The above-mentioned memory 603 can be a read-only memory (read-only memory, ROM) or other types of static storage devices that can store static information and instructions, a random access memory (random access memory, RAM) or other types of storage devices that can store information and instructions. Types of dynamic storage devices, which can also be electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM), or other optical disk storage, optical disks storage (including compact discs, laser discs, compact discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or capable of carrying or storing desired program code in the form of instructions or data structures and capable of being accessed by Any other medium accessed by the computer, but not limited to this. The memory can exist independently and be connected to the processor through a bus. The memory can also be integrated with the processor.
其中,存储器603用于存储执行本申请方案的应用程序代码,并由处理器601来控制执 行。处理器601用于执行存储器603中存储的应用程序代码,以及配合至少一个收发器604,从而使得该装置600实现本专利方法中的功能。Wherein, the memory 603 is used for storing the application program code for executing the solution of the present application, and the execution is controlled by the processor 601. The processor 601 is used to execute the application program code stored in the memory 603 and cooperate with at least one transceiver 604, so that the device 600 can realize the functions in the method of the present patent.
在具体实现中,作为一种实施例,处理器601可以包括一个或多个CPU,例如图7中的CPU0和CPU1。In a specific implementation, as an embodiment, the processor 601 may include one or more CPUs, such as CPU0 and CPU1 in FIG. 7 .
在具体实现中,作为一种实施例,该装置600可以包括多个处理器,例如图7中的处理器601和处理器607。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。In a specific implementation, as an embodiment, the apparatus 600 may include multiple processors, for example, the processor 601 and the processor 607 in FIG. 7 . Each of these processors can be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps of implementing the above embodiments can be completed by hardware, or can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. The storage medium mentioned may be a read-only memory, a magnetic disk or an optical disk, etc.
以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above are only optional embodiments of the present application, and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the principles of the present application shall be included in the protection scope of the present application. Inside.
Claims (19)
- 一种发送数据的方法,其特征在于,所述方法应用于包括多个被控设备的网络中,所述方法包括:A method for sending data, characterized in that the method is applied in a network including a plurality of controlled devices, and the method includes:第一网络节点接收控制设备发送的控制数据,所述控制数据用于控制所述多个被控设备中的至少一个被控设备;The first network node receives control data sent by the control device, where the control data is used to control at least one controlled device in the plurality of controlled devices;所述第一网络节点向第二网络节点发送第一数据帧,所述第一数据帧包括所述控制数据和第一时间段的配置信息,所述第二网络节点与所述至少一个被控设备相连,所述第一时间段的时间长度是基于所述第二网络节点对应的数据量确定的,所述数据量等于所述至少一个被控设备中的每个被控设备需要发送的响应数据的数据量的累加值,所述配置信息用于所述第二网络节点确定所述第一时间段并在所述第一时间段转发所述每个被控设备发送的响应数据。The first network node sends a first data frame to the second network node, the first data frame includes the control data and the configuration information of the first time period, the second network node and the at least one controlled devices are connected, and the time length of the first time period is determined based on the amount of data corresponding to the second network node, and the amount of data is equal to the response that needs to be sent by each of the at least one controlled device The accumulated value of the data amount of the data, and the configuration information is used by the second network node to determine the first time period and forward the response data sent by each controlled device during the first time period.
- 如权利要求1所述的方法,其特征在于,还包括:The method of claim 1, further comprising:所述第一网络节点根据所述第二网络节点的属性信息和所述第二网络节点对应的数据量,为所述第二网络节点分配所述第一时间段。The first network node allocates the first time period to the second network node according to the attribute information of the second network node and the data amount corresponding to the second network node.
- 如权利要求2所述的方法,其特征在于,所述第二网络节点的属性信息包括所述第二网络节点的性能参数和/或所述第二网络节点到所述第一网络节点的传输时延。The method according to claim 2, wherein the attribute information of the second network node comprises performance parameters of the second network node and/or transmission from the second network node to the first network node time delay.
- 如权利要求2或3所述的方法,其特征在于,还包括:The method of claim 2 or 3, further comprising:所述第一网络节点获取所述第二网络节点的属性信息。The first network node acquires attribute information of the second network node.
- 如权利要求2至4任一项的所述的方法,其特征在于,与所述第一网络节点相连的控制设备数目为多个,多个控制设备中的每个控制设备对应不同的第二时间段,所述至少一个被控设备是被多个控制设备中的一个控制设备所控制,所述第一时间段位于所述一个控制设备对应的第二时间段内。The method according to any one of claims 2 to 4, wherein the number of control devices connected to the first network node is multiple, and each control device in the multiple control devices corresponds to a different second A time period, the at least one controlled device is controlled by one control device among a plurality of control devices, and the first time period is located within a second time period corresponding to the one control device.
- 如权利要求1至5任一项所述的方法,其特征在于,还包括:The method of any one of claims 1 to 5, further comprising:所述第一网络节点根据所述控制数据,获取所述每个被控设备需要发送的响应数据的数据量。The first network node acquires, according to the control data, the data amount of the response data that needs to be sent by each controlled device.
- 如权利要求6所述的方法,其特征在于,所述控制数据包括用于控制所述每个被控设备的命令;The method of claim 6, wherein the control data includes commands for controlling each of the controlled devices;所述第一网络节点根据所述控制数据,获取所述每个被控设备需要发送的响应数据的数据量,包括:The first network node obtains, according to the control data, the data amount of the response data that each controlled device needs to send, including:所述第一网络节点根据所述每个被控设备的命令的类型,获取所述每个被控设备需要发送的响应数据的数据量。The first network node acquires, according to the type of the command of each controlled device, the data amount of response data that needs to be sent by each controlled device.
- 如权利要求1至7任一项所述的方法,其特征在于,还包括:The method of any one of claims 1 to 7, further comprising:所述第一网络节点接收所述第二网络节点在所述第一时间段内发送的所述每个被控设备的响应数据;receiving, by the first network node, response data of each controlled device sent by the second network node within the first time period;所述第一网络节点向所述控制设备发送第二数据帧,所述第二数据帧包括根据接收每个被控设备的响应数据的顺序,排列的所述每个被控设备的响应数据。The first network node sends a second data frame to the control device, where the second data frame includes the response data of each controlled device arranged according to the order in which the response data of each controlled device is received.
- 一种发送数据的装置,其特征在于,所述装置应用于包括多个被控设备的网络中,包括:接收单元、发送单元和处理单元;An apparatus for sending data, characterized in that the apparatus is applied in a network including a plurality of controlled devices, including: a receiving unit, a sending unit, and a processing unit;所述接收单元,用于接收控制设备发送的控制数据,所述控制数据用于控制所述多个被控设备中的至少一个被控设备;the receiving unit, configured to receive control data sent by the control device, where the control data is used to control at least one controlled device among the plurality of controlled devices;所述发送单元,用于向第二网络节点发送第一数据帧,所述第一数据帧包括所述控制数据和第一时间段的配置信息,所述第二网络节点与所述至少一个被控设备相连,所述第一时间段的时间长度是所述处理单元基于所述第二网络节点对应的数据量确定的,所述数据量等于所述至少一个被控设备中的每个被控设备需要发送的响应数据的数据量的累加值,所述配置信息用于所述第二网络节点确定所述第一时间段并在所述第一时间段转发所述每个被控设备发送的响应数据。The sending unit is configured to send a first data frame to a second network node, where the first data frame includes the control data and configuration information of the first time period, the second network node and the at least one The time length of the first time period is determined by the processing unit based on the data volume corresponding to the second network node, and the data volume is equal to each controlled device in the at least one controlled device. The cumulative value of the data volume of response data that the device needs to send, and the configuration information is used by the second network node to determine the first time period and forward the data sent by each controlled device during the first time period. response data.
- 如权利要求9所述的装置,其特征在于,所述处理单元还用于:The apparatus of claim 9, wherein the processing unit is further configured to:根据所述每个第二网络节点的属性信息和所述每个第二网络节点对应的数据量,为所述第二网络节点分配所述第一时间段。The first time period is allocated to the second network node according to the attribute information of each second network node and the data amount corresponding to each second network node.
- 如权利要求10所述的装置,其特征在于,第二网络节点的属性信息包括所述第二网络节点的性能参数和/或所述第二网络节点到所述装置的传输时延。The apparatus according to claim 10, wherein the attribute information of the second network node includes a performance parameter of the second network node and/or a transmission delay from the second network node to the apparatus.
- 如权利要求10或11所述的装置,其特征在于,所述处理单元还用于:The apparatus according to claim 10 or 11, wherein the processing unit is further configured to:获取所述第二网络节点的属性信息。Obtain attribute information of the second network node.
- 如权利要求10至12任一项所述的装置,其特征在于,与所述装置相连的控制设备数目为多个,多个控制设备中的每个控制设备对应不同的第二时间段,所述至少一个被控设备是被多个控制设备中的一个控制设备所控制,所述第一时间段位于所述一个控制设备对应的第二时间段内。The device according to any one of claims 10 to 12, wherein the number of control devices connected to the device is multiple, and each control device in the multiple control devices corresponds to a different second time period, so The at least one controlled device is controlled by one control device among multiple control devices, and the first time period is within a second time period corresponding to the one control device.
- 如权利要求13所述的装置,其特征在于,所述处理单元还用于:The apparatus of claim 13, wherein the processing unit is further configured to:根据所述控制数据,获取所述每个被控设备需要发送的响应数据的数据量。According to the control data, the data amount of the response data to be sent by each controlled device is acquired.
- 如权利要求14所述的装置,其特征在于,所述控制数据包括用于控制所述每个被控设备的命令;15. The apparatus of claim 14, wherein the control data includes commands for controlling each of the controlled devices;所述处理单元,用于根据所述每个被控设备的命令的类型,获取所述每个被控设备需要发送的响应数据的数据量。The processing unit is configured to acquire, according to the type of the command of each controlled device, the data amount of the response data that each controlled device needs to send.
- 如权利要求9至15任一项所述的装置,其特征在于,The device according to any one of claims 9 to 15, characterized in that,所述接收单元,还用于接收所述第二网络节点在所述第一时间段内发送的所述每个被控设备的响应数据;The receiving unit is further configured to receive the response data of each controlled device sent by the second network node within the first time period;所述发送单元,还用于向所述控制设备发送第二数据帧,所述第二数据帧包括根据接收每个被控设备的响应数据的顺序,排列的所述每个被控设备的响应数据。The sending unit is further configured to send a second data frame to the control device, where the second data frame includes the response of each controlled device arranged according to the order in which the response data of each controlled device is received data.
- 一种发送数据的装置,其特征在于,包括处理器,所述处理器执行程序,使得所述装置执行权利要求1至8任一项所述的方法。An apparatus for sending data, characterized by comprising a processor, and the processor executes a program, so that the apparatus executes the method according to any one of claims 1 to 8.
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储程序,当执行所述程序时,使得计算机执行权利要求1至8任一项所述的方法。A computer-readable storage medium, characterized in that the computer-readable storage medium stores a program, which, when executed, causes a computer to execute the method according to any one of claims 1 to 8.
- 一种计算机程序产品,其特征在于,所述计算机程序产品包括在计算机可读存储介质中存储的计算机程序,并且所述计算程序通过处理器进行加载来实现如权利要求1-8任一项所述的方法。A computer program product, characterized in that, the computer program product includes a computer program stored in a computer-readable storage medium, and the computing program is loaded by a processor to implement any one of claims 1-8. method described.
Applications Claiming Priority (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010641892.9 | 2020-07-06 | ||
CN202010641892 | 2020-07-06 | ||
CN202011045588.4A CN113905292A (en) | 2020-07-06 | 2020-09-28 | Method and device for sending data |
CN202011045588.4 | 2020-09-28 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022007682A1 true WO2022007682A1 (en) | 2022-01-13 |
Family
ID=79186247
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2021/103659 WO2022007682A1 (en) | 2020-07-06 | 2021-06-30 | Method and device for sending data |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN113905292A (en) |
WO (1) | WO2022007682A1 (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101136703A (en) * | 2006-09-01 | 2008-03-05 | 华为技术有限公司 | Data transmission method, system and device |
US20090214211A1 (en) * | 2006-10-13 | 2009-08-27 | Hitachi Communication Technologies, Ltd. | Apparatus of adjusting optical signal transmission timing |
CN101686421A (en) * | 2008-09-26 | 2010-03-31 | 日立通讯技术株式会社 | Passive optical network system and operating method thereof |
CN110249592A (en) * | 2017-02-10 | 2019-09-17 | 日本电信电话株式会社 | Bandwidth allocation device and bandwidth allocation methods |
-
2020
- 2020-09-28 CN CN202011045588.4A patent/CN113905292A/en active Pending
-
2021
- 2021-06-30 WO PCT/CN2021/103659 patent/WO2022007682A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101136703A (en) * | 2006-09-01 | 2008-03-05 | 华为技术有限公司 | Data transmission method, system and device |
US20090214211A1 (en) * | 2006-10-13 | 2009-08-27 | Hitachi Communication Technologies, Ltd. | Apparatus of adjusting optical signal transmission timing |
CN101686421A (en) * | 2008-09-26 | 2010-03-31 | 日立通讯技术株式会社 | Passive optical network system and operating method thereof |
CN110249592A (en) * | 2017-02-10 | 2019-09-17 | 日本电信电话株式会社 | Bandwidth allocation device and bandwidth allocation methods |
Also Published As
Publication number | Publication date |
---|---|
CN113905292A (en) | 2022-01-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5895153B2 (en) | Interface device and bus system | |
JP6265058B2 (en) | Network transmission system, its master node, slave node | |
WO2023030336A1 (en) | Data transmission method, tsn node, and computer readable storage medium | |
WO2022089175A1 (en) | Network congestion control method and apparatus | |
KR20130137539A (en) | System for performing data cut-through | |
US20170177509A1 (en) | Host controller and program executed by host controller | |
WO2017190442A1 (en) | Method of registering on passive optical network, device, and passive optical network | |
US20220255831A1 (en) | Method and apparatus for detecting link status | |
JP2020080059A (en) | Evaluation device, evaluation method and evaluation program | |
US11979335B2 (en) | Network controller | |
WO2021233313A1 (en) | Port state configuration method, apparatus, system, and storage medium | |
WO2022007682A1 (en) | Method and device for sending data | |
EP3985991A1 (en) | Bandwidth assignment method and apparatus, and bandwidth check method and apparatus | |
JP2015517140A (en) | Method and apparatus for forming software fault containment units (SFCCUs) in a distributed real-time system | |
WO2021092760A1 (en) | Data transmission method and ble device | |
US20220137604A1 (en) | Coordination Device and Method for Providing Control Applications via a Communication Network for Transmitting Time-Critical Data | |
CN114095901A (en) | Communication data processing method and device | |
CN114039909B (en) | Method for realizing rapid real-time spanning tree protocol | |
CN113468086B (en) | PXIe chassis expansion method, device and medium | |
CN111404705B (en) | SDN optimization method and device and computer readable storage medium | |
CN108924066B (en) | Message forwarding method and device | |
WO2024152888A1 (en) | Connection establishment method, controller, node, communication system, and storage medium | |
JP2016076184A (en) | File system, control program of management device and control method of file system | |
US20230403488A1 (en) | Optical bus communication method and system, device, and medium | |
JP7388561B2 (en) | Computer system and arithmetic processing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21837330 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 21837330 Country of ref document: EP Kind code of ref document: A1 |