WO2023231864A1 - Timeliness guarantee method, apparatus and system - Google Patents
Timeliness guarantee method, apparatus and system Download PDFInfo
- Publication number
- WO2023231864A1 WO2023231864A1 PCT/CN2023/096053 CN2023096053W WO2023231864A1 WO 2023231864 A1 WO2023231864 A1 WO 2023231864A1 CN 2023096053 W CN2023096053 W CN 2023096053W WO 2023231864 A1 WO2023231864 A1 WO 2023231864A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data frame
- aging
- time
- network device
- delay
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 164
- 230000005540 biological transmission Effects 0.000 claims abstract description 79
- 238000004891 communication Methods 0.000 claims abstract description 65
- 230000008569 process Effects 0.000 claims abstract description 46
- 230000032683 aging Effects 0.000 claims description 272
- 230000004044 response Effects 0.000 claims description 222
- 238000012545 processing Methods 0.000 claims description 116
- 238000003860 storage Methods 0.000 claims description 29
- 238000003672 processing method Methods 0.000 claims description 20
- 238000004590 computer program Methods 0.000 claims description 19
- 238000005516 engineering process Methods 0.000 abstract description 14
- 238000010586 diagram Methods 0.000 description 19
- 230000006870 function Effects 0.000 description 6
- 238000013461 design Methods 0.000 description 4
- 238000007726 management method Methods 0.000 description 3
- 230000007774 longterm Effects 0.000 description 2
- 238000010295 mobile communication Methods 0.000 description 2
- 238000013500 data storage Methods 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 230000008570 general process Effects 0.000 description 1
- 238000009776 industrial production Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04J—MULTIPLEX COMMUNICATION
- H04J3/00—Time-division multiplex systems
- H04J3/02—Details
- H04J3/06—Synchronising arrangements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W28/00—Network traffic management; Network resource management
- H04W28/02—Traffic management, e.g. flow control or congestion control
- H04W28/08—Load balancing or load distribution
Definitions
- This application relates to the field of communication technology, and specifically to a timeliness guarantee method, device and system.
- the existing technical solution requires the deployment of a high-precision clock server in the industrial Ethernet.
- the requester and responder ensure that the system time of both parties is consistent with the time of the high-precision clock server through a clock synchronization algorithm.
- the requester adds timestamp information in the query and control instructions.
- the responder can determine whether the instruction needs to be executed based on the timestamp and system time in the instruction, where the requester can be the controller and the responder can be the executor (Actuator).
- Actuator executor
- a high-precision time synchronization server needs to be deployed within the network, and there is a deployment cost.
- the embodiments of this application disclose a timeliness guarantee method, device and system.
- the network device and/or the receiving end can update the timeliness information of the data frame, so that the receiving end can determine whether the data frame is valid based on the updated timeliness information.
- This method does not need to keep the time of the sending end, the receiving end and the network device. Synchronization can reduce the deployment cost of deploying time synchronization server.
- embodiments of the present application disclose a timeliness guarantee method, which is applied to network equipment.
- the method includes:
- the data frame includes aging information, and the aging information is used to indicate the remaining aging of the data frame;
- the transmission delay is obtained
- the overall forwarding delay is obtained
- the sending end can send a data frame carrying aging information, and the network device and the receiving end can update the aging information of the data frame, so that the receiving end can determine whether the data frame is valid based on the updated aging information.
- This method does not need to keep sending. By synchronizing the time of the end, receiving end and network equipment, you can determine whether the data frame is within the time limit. This method can reduce the deployment cost of deploying a time synchronization server.
- the transmission delay is the time difference between the start time and the end time; the start time is the time when the start bit of the data frame is received, and the end time is the time when the data frame is received. The moment of the end position;
- the remaining aging in the updated data frame is the remaining aging in the data frame minus the difference between the transmission delay and the overall forwarding delay.
- the overall forwarding delay includes a receiving processing delay and a sending processing delay; based on the transmission delay and the overall forwarding delay, updating the aging information includes:
- the first aging is the remaining aging of the data frame minus the difference between the transmission delay and the reception processing delay;
- the reception processing delay is the link layer reception The time required for the protocol stack or application layer to receive and process the data frame after the data frame;
- the remaining aging of the first data frame is the first aging;
- the pre-frame protocol stack or application layer sends the time required to process the first data frame; the remaining aging of the updated data frame is the second aging.
- the method before sending the updated data frame, the method further includes:
- a processing method for the first data frame is determined; the processing method includes priority forwarding, normal forwarding, or discarding.
- the network device can also make a forwarding decision based on the first timeliness, thereby determining whether to forward the data frame preferentially, forward it normally, or discard the data frame.
- invalid data frames can be avoided and forwarding efficiency can be accelerated; it can also avoid transmission of invalid data frames, causing a waste of network resources.
- determining a processing method for the first data frame includes:
- a processing method for the first data frame is determined.
- the network device may determine whether to preferentially forward the data frame based on the reliability level corresponding to the data frame and the real-time level corresponding to the data frame. With this method, important messages can be forwarded with priority.
- the data frame carries any one of a request message, a response message, and an active notification message.
- the request message includes a query instruction or a control instruction
- the response message is in response to the query instruction or control instruction.
- the reply message generated by the command.
- the data frame carries a response message generated by the responder in response to the query instruction of the first requester, and the method further includes:
- the network device stores the parsed message content of the data frame.
- the network device can also store the received response message, so that when other requesting parties request the response message, the network device can send the response message to other requesting parties.
- This method can achieve nearby response and improve response efficiency.
- the response message is stored, including:
- the response message is stored.
- the network device can only store data frames without invalidation to avoid wasting storage space.
- the method further includes:
- sending a response message to the second requester includes:
- the request message is sent to the responder.
- the network device may send the data frame to other requesters after determining that the data frame is not invalid. This method avoids sending invalid data frames to other requesters.
- embodiments of the present application disclose a timeliness guarantee method, which is applied to the sending end.
- the method includes:
- the sending end sends a data frame to the receiving end;
- the data frame includes aging information, and the aging information of the data frame is used to indicate the remaining aging of the data frame;
- the receiving end is used to update the remaining aging of the data frame based on the link delay and the reception processing delay;
- the link delay is obtained based on the starting time of the receiving end's link layer receiving the data frame and the end time of the link layer receiving the data frame.
- the reception processing delay is the time required for the protocol stack or application layer to receive and process the data frame after the link layer receives the data frame.
- embodiments of the present application disclose a timeliness guarantee method, which is applied to the receiving end.
- the method includes:
- the receiving end receives the data frame from the sending end;
- the data frame includes aging information, and the aging information of the data frame is used to indicate the remaining aging of the data frame;
- the receiving end obtains the link delay based on the starting time when the receiving end's link layer receives the data frame and the ending time when the receiving end's link layer receives the data frame;
- the reception processing delay is the time required for the protocol stack or application layer to receive and process the data frame after the link layer receives the data frame.
- the sending end can send a data frame carrying aging information, and the data end can update the aging information of the data frame, so that the receiving end can determine whether the data frame is valid based on the updated aging information.
- This method does not require keeping the sending end and the receiving end.
- End-to-end time synchronization can reduce the deployment cost of deploying a time synchronization server.
- the data frame carries a request message, and the request message includes a query instruction or a control instruction; the method further includes:
- the receiving end determines that the request message is valid based on the remaining aging and the preset threshold, it executes the query instruction or the control instruction.
- the receiving end receives a data frame from the sending end, including:
- the receiving end receives the data frame from the requesting party via at least one network device
- At least one network device is used to update the remaining aging of the data frame based on the transmission delay and the overall forwarding delay; the transmission delay is based on the starting time of the link layer of the network device receiving the data frame and the link layer of the network device receiving the data frame. The termination time is obtained; the overall forwarding delay is obtained based on the time required for the protocol stack or application layer of the network device to process the data frame.
- this application provides an aging guarantee device, which includes:
- a receiving unit configured to receive a data frame, the data frame includes aging information, and the aging information is used to indicate the remaining aging of the data frame;
- the first processing unit is used to obtain the transmission delay based on the start time of the link layer receiving the data frame and the end time of the link layer receiving the data frame based on the network device;
- the second processing unit is used to obtain the overall forwarding delay based on the time required for the protocol stack or application layer of the network device to process the data frame;
- the update unit is used to update the aging information based on the transmission delay and the overall forwarding delay
- the sending unit is used to send the updated data frame.
- the transmission delay is the time difference between the start time and the end time; the start time is the time when the start bit of the data frame is received, and the end time is the time when the data frame is received. The moment of the end position;
- the remaining aging in the updated data frame is the remaining aging in the data frame minus the difference between the transmission delay and the overall forwarding delay.
- the overall forwarding delay includes receiving processing delay and sending processing delay.
- Latency; update unit is used for:
- the first aging is the remaining aging of the data frame minus the difference between the transmission delay and the reception processing delay;
- the reception processing delay is the link layer reception The time required for the protocol stack or application layer to receive and process the data frame after the data frame;
- the remaining aging of the first data frame is the first aging;
- the pre-frame protocol stack or application layer sends the time required to process the first data frame; the remaining aging of the updated data frame is the second aging.
- the device before the sending unit sends the updated data frame, the device further includes a processing unit, and the processing unit is configured to:
- a processing method for the first data frame is determined; the processing method includes priority forwarding, normal forwarding, or discarding.
- the processing unit is used to:
- a processing method for the first data frame is determined.
- the data frame carries any one of a request message, a response message and an active notification message.
- the request message includes a query instruction or a control instruction, and the response message is in response to the query instruction or control instruction.
- the reply message generated by the command.
- the data frame carries a response message generated by the responder in response to the query instruction of the first requester
- the device further includes a storage unit, and the storage unit is used for:
- the storage unit is used for:
- the response message is stored.
- the receiving unit is configured to receive a query instruction from the second requester, and the query instruction from the second requester is used to request a response message;
- a sending unit configured to send a response message to the second requester.
- the sending unit is used for:
- the request message is sent to the responder.
- an aging guarantee device which includes:
- the receiving unit is used to receive the data frame from the sending end;
- the data frame includes aging information, and the aging information of the data frame is used to indicate the remaining aging of the data frame;
- a processing unit configured to obtain the link delay based on the starting time when the link layer at the receiving end receives the data frame and the end time when the link layer at the receiving end receives the data frame;
- the update unit is used to update the remaining aging based on the link delay and the reception processing delay; the reception processing delay is the time required for the protocol stack or the application layer to receive and process the data frame after the link layer receives the data frame.
- the data frame carries a request message, and the request message includes a query instruction or a control instruction;
- the device further includes an execution unit, and the execution unit is used to:
- the query instruction or the control instruction is executed.
- the receiving unit is used for:
- At least one network device is used to update the remaining aging of the data frame based on the transmission delay and the overall forwarding delay; the transmission delay is based on the starting time of the link layer of the network device receiving the data frame and the link layer of the network device receiving the data frame. The termination time is obtained; the overall forwarding delay is obtained based on the time required for the protocol stack or application layer of the network device to process the data frame.
- a timeliness guarantee device which includes a processor and a communication interface.
- the processor is configured to call a computer program stored in a memory to implement the first aspect or any possibility of the first aspect. The method described in the implementation.
- a timeliness guarantee device which includes a processor and a communication interface.
- the processor is configured to call a computer program stored in a memory to implement the second aspect or any possibility of the second aspect. way of implementation.
- embodiments of the present application disclose a timeliness guarantee device, which includes a processor and a communication interface.
- the processor is configured to call a computer program stored in a memory to implement the third aspect or any possibility of the third aspect. way of implementation.
- embodiments of the present application further provide a chip system.
- the chip system includes at least one processor and a communication interface.
- the communication interface is used to send and/or receive data.
- the at least one processor is used to call at least A computer program stored in a memory, so that the device where the chip system is located implements the first aspect or the method described in any possible implementation of the first aspect; or implements the second aspect or any of the second aspects The method described in one possible implementation manner; or the method described in any possible implementation manner of implementing the third aspect or the third aspect.
- embodiments of the present application further provide a communication system, including a receiving end, a network device, and a sending end.
- the network device is used to implement the method described in the first aspect or any possible implementation manner of the first aspect; and the sending end implements the method described in the first aspect or any possible implementation manner of the first aspect.
- the described method; the receiving end is used to implement the method described in the first aspect or any possible implementation manner of the first aspect.
- embodiments of the present application disclose a computer-readable storage medium.
- a computer program is stored in the computer-readable storage medium.
- the first step is executed.
- the embodiment of the present application discloses a computer program product.
- the computer program product When the computer program product is run on one or more processors, it executes the first aspect or any possible implementation manner of the first aspect.
- the described method or perform the second aspect or the method described in any possible implementation manner of the second aspect; or implement the third aspect or the method described in any possible implementation manner of the third aspect .
- Figure 1 is a schematic diagram of a method for ensuring message timeliness in the prior art provided by an embodiment of the present application
- Figure 2A is a schematic diagram of a possible communication system provided by an embodiment of the present application.
- Figure 2B is a schematic diagram of another possible communication system provided by an embodiment of the present application.
- Figure 2C is a schematic diagram of another possible communication system provided by an embodiment of the present application.
- FIG. 3 is a schematic diagram of yet another possible communication system provided by an embodiment of the present application.
- Figure 4 is a schematic flowchart of an aging guarantee method provided by an embodiment of the present application.
- Figure 5 is a schematic flowchart of a network device updating aging information provided by an embodiment of the present application
- Figure 6A is a schematic flowchart of another timeliness guarantee method provided by an embodiment of the present application.
- Figure 6B is a flow chart of a method for updating the request message by a network device according to an embodiment of the present application
- Figure 7 is a schematic diagram of the specific implementation of an aging guarantee method provided by an embodiment of the present application.
- Figure 8 is a flow chart of yet another timeliness guarantee method provided by an embodiment of the present application.
- Figure 9 is a schematic flowchart of a response message transmission process provided by an embodiment of the present application.
- Figure 10 is a schematic flowchart of a query method provided by an embodiment of the present application.
- Figure 11 is a scene diagram of a nearby response provided by an embodiment of the present application.
- Figure 12 is a schematic structural diagram of an aging guarantee device 120 provided by an embodiment of the present application.
- Figure 13 is a schematic structural diagram of an aging guarantee device 130 provided by an embodiment of the present application.
- Figure 14 is a schematic structural diagram of an aging guarantee device 140 provided by an embodiment of the present application.
- At least one mentioned in the embodiments of this application means one or more, and “multiple” means two or more. “At least one of the following” or similar expressions thereof refers to any combination of these items, including any combination of a single item (items) or a plurality of items (items).
- at least one of a, b, or c can represent: a, b, c, (a and b), (a and c), (b and c), or (a and b and c), where a, b, c can be single or multiple.
- “And/or” describes the relationship between related objects, indicating that there can be three relationships. For example, A and/or B can mean: A alone exists, A and B exist simultaneously, and B exists alone, where A and B can be singular or plural. The character "/" generally indicates that the related objects are in an "or” relationship.
- ordinal numbers such as “first” and “second” in the embodiments of this application is used to distinguish multiple objects and is not used to limit the order, timing, priority or importance of multiple objects. degree.
- first information and the second information are only used to distinguish different information, but do not indicate the difference in content, priority, sending order or importance of the two types of information.
- IP Industrial Protocol
- IP Ethernet Industrial Ethernet
- PLC Programmable Logic Controller
- Actuator can receive instructions issued by the controller and execute corresponding production actions.
- Figure 1 is a schematic diagram of an existing industrial Ethernet deployment provided by an exemplary embodiment of the present application.
- the industrial Ethernet includes a requester, N industrial gateways, a responder and a clock server, where N is a positive integer;
- the clock server can be a high-precision time synchronization server, and the requester can be a PLC controller , the responder is the Actuator.
- the requester and responder can use a clock synchronization algorithm to ensure that the system time of both parties is consistent with the high-precision clock server time.
- the requester can send a query instruction or a control instruction to the responder.
- the query instruction or control instruction includes timestamp information; the responder can determine whether the instruction satisfies the requirements based on the timestamp and system time in the above instruction. Timeliness requirements to determine whether the instruction needs to be executed; the responder can send a response message to the requester after receiving the query instruction.
- the inventor of this application found that in this method, a high-precision time synchronization server needs to be deployed in the network, which involves deployment costs.
- embodiments of the present application propose an aging guarantee method, device and system.
- This method updates the aging information in the instruction through the network device.
- the responder can determine whether execution needs to be performed based on the remaining aging in the instruction. this directive.
- This method does not require the deployment of a high-precision time synchronization server.
- Figure 2A is a schematic diagram of a possible communication system provided by an embodiment of the present application.
- the communication system 10 includes a requester 101, a network device 102 and a responder 103. in:
- the requester 101 is connected to the responder 103 via the network device 102.
- the requester 101 sends a request message to the network device 102, and the request message may include a query instruction or a control instruction; the network device 102 sends the request message to the responder 103.
- the responder 103 may send an active notification message or a response message to the network device 102, and the network device 102 then sends the active notification message or response message to the requesting party 101.
- the requester 101 can be the sender and the responder 103 can be the receiver; or the responder 103 can be the sender and the requester 101 can be the receiver, which can be determined according to specific scenarios.
- the requester 101 may include at least one requester; the network device 102 may include at least one network device, and the network device may be a gateway, a switch, a network bridge, etc.
- the requester 101 can be a controller, and the responder 103 can be an executor. This is only an example and should not limit the requester 101 and the responder 103.
- the sender 301 and the receiver The terminal 302 can be different devices, which are not limited here.
- the requester can communicate with the responder through some of the multiple network devices; different requesters can communicate with the responder through the same network device.
- the responder makes a communication connection or can establish a communication connection with the responder through different network devices, which is not limited here.
- FIG. 2B is a schematic diagram of another possible communication system provided by an embodiment of the present application.
- FIG. 2B exemplarily shows that the communication system 20 includes a requester, n network devices and a responder, where the requester includes requester 1 and requester 2; the n network devices are network device 1 and network device 2 respectively.
- n is a positive integer greater than 2.
- requester 1 establishes a communication connection with network device 1, and requester 1 is connected to the responder through n network devices such as network device 1, network device 2, and network device n;
- requester 2 establishes communication with network device 2.
- Connection, requester 2 is connected to the responder via n-1 network devices from network device 2 to network device n.
- the communication link between the requester 101, the network device 102 and the responder 103 may include various types of connection media, including wired links (such as optical fibers), wireless links, or a combination of wired links and wireless links. Combination etc.
- short-range connection technologies include 802.11b/g, Bluetooth (blue tooth), Zigbee, radio frequency identification technology (radio frequency identification, RFID), ultra wideband (UWB) technology, and wireless short-range communication systems (such as vehicle-mounted wireless short-range communication systems), etc.
- long-distance connection technologies include communication technologies based on Long Term Evolution (Long Term Evolution), fifth generation mobile communication technologies (5th generation mobile networks or 5th generation wireless systems, 5th-Generation (referred to as 5G or 5G technology), global system for mobile communications (GSM), general packet radio service (GPRS), universal mobile telecommunications system , UMTS) and other wireless access type technologies.
- the above communication system may also include other network elements or devices, which are not limited here.
- Figure 2C is a schematic diagram of another possible communication system provided by an embodiment of the present application.
- the communication system 30 only includes a sending end 301 and a receiving end 302.
- the sending end 301 may include one or more sending ends. in:
- the sending end 301 is used to send a data frame to the receiving end 302.
- the data frame includes aging information, and the aging information of the data frame is used to indicate the remaining aging of the data frame;
- the receiving end 302 is used to receive the data frame based on the link layer of the receiving end 302.
- the start time and the end time of the link layer receiving the data frame are obtained to obtain the link delay, and then based on the link delay and the reception processing delay, the remaining timeliness of the data frame is updated.
- the receiving end 302 can also determine whether the data frame is valid based on the updated remaining timeliness.
- the data frame includes a query instruction or a control instruction.
- the receiving end can execute the query instruction or control instruction;
- operations such as discarding the data frame or replying an error code to the sending end can be performed.
- the data frame carries a request message
- the request message includes a query instruction or a control instruction. Then the receiving end 302 can determine whether the request message is valid based on the updated remaining time limit and the preset threshold. When determining that the request message is valid, Execute query instructions or control instructions.
- the sending end 301 can be the above-mentioned requester, and the receiving end 302 can be the above-mentioned responder; or, the sending end 301 can be the above-mentioned responder, and then the receiving end 302 can be the above-mentioned requester.
- the requester can be a controller and the responder can be an executor. This is only an example and should not limit the sending end 301 and the receiving end 302. In different application scenarios, the sending end 301 and the receiving end 302 It can be different devices and is not limited here.
- the following takes the industrial Ethernet environment as an example to further introduce the above communication system.
- Figure 3 is a schematic diagram of yet another possible communication system provided by an embodiment of the present application.
- the communication system includes N requesters, N network devices and responders, where N is a positive integer. It should be noted that in other embodiments, the number of requesters and the number of network devices may be the same or different, depending on the actual situation. N here is only an example and should not cause the number of requesters to be different from the number of network devices. Limitation on the number of network devices. in:
- Figure 3 exemplarily shows the query and control scenario between the requester and the responder in the industrial Ethernet, where multiple requesters in the industrial Ethernet communicate with the responder via one or more network devices. connected.
- Figure 3 exemplarily shows Requester-1, Requester-2 and Requestor-N, as well as Network Device 1 and Network Device N, where Requester-1 and Requester-2 both establish communication with Network Device 1 Connection, the requester-N establishes a communication connection with the network device N.
- the network device can be used to cache the received information, such as caching the response message; and to perform timeliness management on the received information, that is, to update the timeliness information in the message; and can also perform message forwarding scheduling, such as forwarding a certain message based on timeliness priority. information.
- requester-1 can send query instructions and/or control instructions to network device 1, and then the instructions reach the responder after passing through other network devices.
- N network devices can respond to the received The aging information in the instruction is updated; after receiving the instruction, the responder can determine whether to execute the instruction based on the aging information dynamically updated by N network devices; the responder can also send the response message corresponding to the instruction through other networks. The device sends it to network device 1, and then network device 1 will send the response message to requester-1.
- N network devices can update the timeliness information in the received response message; N network devices can cache the reception response message received.
- the network device After the network device caches the received response message, when other requesters request the response message from the responder through the network device, the network device nearby the other requester can send the cached response message to the requester.
- the requester-2 can send a query instruction and/or a control instruction to the network device 2.
- the network device 2 After the network device 2 queries that there is a response message corresponding to the instruction in the storage and determines that the response message has not expired, the network device 2 can send the response message. The message is sent to requester-2.
- N requesters Regarding the communication relationship between N requesters, N network devices and responders, as well as the implementation of timeliness update, please refer to the relevant description below for details, which will not be elaborated here.
- Figure 3 exemplarily shows functional units in a network device, such as an information caching unit, an aging management unit, and a forwarding unit.
- the information cache unit is used to cache the information results obtained by the requester from the responder's query;
- the timeliness management unit is used to update the timeliness information of requests and response messages in real time;
- the forwarding unit can make decisions based on the real-time and reliability requirements of the information or instructions.
- Request and response messages are forwarded first, forwarded normally or discarded.
- network device may also include more or less functional units as shown in Figure 3, which is not limited here.
- Figure 4 is a schematic flowchart of an aging guarantee method provided by an embodiment of the present application. Further, the method can be implemented based on the architecture shown in Figure 1, Figure 2A or Figure 2B. The method may include some or all of the following steps:
- Step S401 The sending end sends a data frame to the receiving end.
- the data frame includes aging information.
- the aging information of the data frame is used to indicate the remaining aging of the data frame.
- the data frame can carry any one of the request message, response message and active notification message;
- the request message can include a query instruction or a control instruction
- the response message can be a reply message generated in response to the query instruction or control instruction
- the active notification message It is a message automatically sent by the sender to the receiver, such as notification messages sent regularly according to preset rules.
- Step S402 The receiving end obtains the link delay based on the starting time of the receiving end's link layer receiving the data frame and the ending time of the link layer receiving the data frame.
- the receiving end may determine the time difference between the start time and the end time as the link delay, where the start time may be the time when the start bit of the data frame is received, and the end time may be the time when the start bit of the data frame is received.
- the start bit and the stop bit comply with the start bit coding (preamble or frame start delimiter) and stop coding (frame check sequence FCS) defined by the link layer frame format of the data frame.
- Step S403 The receiving end updates the remaining aging based on the link delay and the reception processing delay.
- the reception processing delay is the time required for the protocol stack or the application layer to receive and process the data frame after the link layer receives the data frame.
- the receiving end can subtract the link delay and the reception processing delay from the remaining aging in the data frame to obtain the updated remaining aging. Furthermore, the receiving end can also determine whether the data frame is within the time limit based on the updated remaining time limit. For example, the data frame includes a query instruction or a control instruction. When the receiving end determines that the data frame is valid, it can execute the query instruction or control instruction; when it determines that the data frame is invalid, it can discard the data frame or reply an error code to the sending end. Wait for operations.
- the data frame carries a request message, and the request message includes a query instruction or a control instruction, then the receiving end Whether the request message is valid can be determined based on the updated remaining aging and the preset threshold; further, when it is determined that the request message is valid, the query instruction or the control instruction is executed.
- the sending end sends the data frame to the receiving end via at least one network device, and the network device can dynamically update the remaining validity of the received data frame.
- Figure 5 is a schematic flowchart of a network device updating aging information provided by an embodiment of the present application. The method includes some or all of the following steps:
- Step S501 The network device receives a data frame, the data frame includes aging information, and the aging information is used to indicate the remaining aging of the data frame.
- the data frame can carry any of a request message, a response message and an active notification message; the request message can include a query instruction or a control instruction, and the response message can be a reply message generated in response to the query instruction or control instruction.
- Step S502 The network device obtains the transmission delay based on the starting time when the link layer of the network device receives the data frame and the end time when the link layer receives the data frame.
- the transmission delay may be the time difference between the start time and the end time, where the start time is the time when the start bit of the data frame is received, and the end time is the time when the stop bit of the data frame is received. ;
- the remaining aging in the updated data frame is the remaining aging in the data frame minus the difference between the transmission delay and the overall forwarding delay.
- Step S503 The network device obtains the overall forwarding delay based on the time required for the protocol stack or application layer of the network device to process the data frame.
- the overall forwarding delay includes receiving processing delay and sending processing delay; receiving processing delay is the time required for the protocol stack or application layer to receive and process the data frame after the link layer receives the data frame; sending processing time Delay is the time required for the protocol stack or the application layer to send and process the first data frame before the link layer sends the updated data frame.
- the reception and processing delay may specifically be the time difference from the time when the link layer receives the data frame to the time when the protocol stack or application layer completes parsing the data frame; the protocol stack or application layer receiving and processing the data frame may specifically include The data frame is parsed and processed; the protocol stack or the application layer sends and processes the first data frame, which may specifically include packetizing the data frame.
- Step S504 The network device updates the aging information based on the transmission delay and the overall forwarding delay.
- the network device can update the remaining aging of the data frame to the first aging to obtain the first data frame.
- the first aging is the remaining aging of the data frame minus the difference between the transmission delay and the reception processing delay.
- the remaining aging of the first data frame is the first aging; then update the remaining aging of the first data frame to the second aging to obtain the updated data frame.
- the second aging is the difference between the first aging and the transmission processing delay,
- the remaining aging of the updated data frame is the second aging.
- the network device may determine a processing method for the first data frame based on the first timeliness; the processing method includes priority forwarding, normal forwarding, or discarding. For example, when it is determined that the first data frame should be forwarded first, the first data frame should be sent from the protocol stack or application layer to the link layer first, so that the network device can send the first data frame to the next network device as soon as possible. or responding party.
- the processing method for the first data frame may be determined based on at least one of the reliability level corresponding to the data frame and the real-time level corresponding to the data frame and the first timeliness.
- the network device may also store the first data frame.
- the data frame is a data frame that carries a response message generated by the responder in response to the query instruction of the first requester, and the network device can store the response message.
- the network device may update the remaining timeliness of the data frame to the first timeliness and obtain the first data frame, and then store the first data frame when the first timeliness and the real-time level corresponding to the response message satisfy the cache decision. Then, if the network device receives a query instruction from another requester, and the network device stores a response message requested by the query instruction, the network device can send a response message to the second requester.
- the network device may store the first data frame, or the first data frame may carry The response message may specifically be the message content of the first data frame, such as the query content corresponding to the query instruction in the request message, etc.
- the network device may send the response message to the second requester after determining that the stored response message is valid; and forward the request message to the responder when determining that the response message has expired.
- the network device can obtain the first aging corresponding to the response message and the time when the response message is stored; when the time difference between the current time and the time when the response message is stored is not greater than the first aging, send the response message to the second requester; at the current time When the time difference from the time when the response message is stored is greater than the first time limit, a request message is sent to the responder.
- Step S505 The network device sends the updated data frame.
- the network device after updating the timeliness information of the data frame, the network device forwards the updated data frame to the next network device or responder.
- Figure 6A is a schematic flowchart of another timeliness guarantee method provided by an embodiment of the present application. This method can be implemented based on the architecture shown in Figure 2A.
- the timeliness guarantee method may include the following steps:
- Step S601 The requesting party sends a request message to at least one network device.
- the request message is used to request the responder to respond to the control instruction or query instruction in the request message.
- the request message includes aging information, and the aging information is used to indicate the request message. Remaining time limit.
- the request message may include a query instruction or a control instruction.
- the request message includes a query instruction or a control instruction, and the timing information of the instruction.
- the aging information may be indication information or a numerical value used to indicate the remaining aging.
- the aging information may be 1 second or indication information indicating 1 second.
- At least one network device may be one or more network devices.
- the requesting party sends a request message to at least one network device, that is, the requesting party sends a request message to the network device, and the network device sends the request message to the responder; in at least one network
- the requesting direction sends a request message to at least one network device.
- the requesting direction sends a request message to one network device among the multiple network devices.
- the network device among the multiple network devices will send a request message to the responder based on the request.
- the data communication link forwards the request message in sequence until it is forwarded to the responder.
- Step S602 Each network device in at least one network device updates the aging information in the received request message.
- At least one network device includes network device N.
- the following takes network device N as an example to introduce a specific implementation of the network device's timeliness update of the request message.
- FIG. 6B is a flow chart of a method for a network device to update the timeliness of a request message according to an embodiment of the present application. The method includes some or all of the following steps:
- Step S6021 Based on the received request message, network device N calculates the transmission delay and the overall forwarding delay.
- the overall forwarding delay includes the receiving processing delay and the sending processing delay.
- the network device N may be a first network device that directly communicates with the requesting party, or may be a second network device that communicates with the requesting party indirectly. As shown in Figure 3, assuming that the requesting party is requesting party-N, then network device N is a network device that directly communicates with the requesting party (that is, the above-mentioned first network device), that is, the requesting party directly sends the request message to the first network device. ; Assume that the requesting party is requesting party-1, and the network device N is a network device that indirectly communicates with the requesting party (ie, the above-mentioned second network device).
- the processing time T is the time when the data frame is processed in the protocol stack or application layer.
- the specific processing may include operations such as parsing the data frame.
- transmission delay can also be called link delay.
- link delay For convenience of description, it is referred to as transmission delay below.
- Step S6022 Network device N calculates the first aging Pn based on the transmission delay and the reception processing delay.
- network device N may subtract the transmission delay and the reception processing delay from the remaining timeliness in the received request message to obtain the first timeliness.
- Step S6023 Network device N updates the remaining aging in the request message to the first aging Pn, and obtains the cached message.
- network device N may update the remaining age in the request message to the first age Pn to obtain the cached message.
- Step S6024 Network device N accelerates forwarding, normally forwards, or discards the cached message based on the first timeliness Pn, real-time requirements, and reliability requirements.
- the network device N accelerates forwarding or normally forwards the cached message. Specifically, the network device N accelerates forwarding or normally forwards the cached message in the process of sending the cached message from the protocol stack or application layer to the link layer.
- normal forwarding is to send the messages in the sending queue from the protocol stack or application layer to the link layer in order from front to back; assuming that there are several messages in the sending queue in front of the cached message, then normal forwarding is, the network
- the device sequentially sends several messages from the protocol stack or application layer to the link layer, and then sends the cached message from the protocol stack or application layer to the link layer; priority forwarding is to first send the cached message from the protocol stack or application layer Send to the link layer, and then send several messages from the protocol stack or application layer to the link layer in turn.
- Q>Qhigh high priority is given.
- Level forwarding, Qhigh ⁇ Q ⁇ Qdrop means normal forwarding, or Q ⁇ Qdrop means discarding the message.
- Step S6025 Network device N updates the remaining aging in the cached message to the second aging P'n to obtain the updated request message.
- the second aging is the time period obtained by subtracting the transmission processing delay from the first aging.
- the network device receives the cached message at the link layer, and updates the remaining aging in the cached message to the second aging P'n in the link layer summary.
- the second aging is the time period obtained by subtracting the transmission processing delay from the first aging.
- Step S6026 Network device N forwards the updated request message to the next network device or responder.
- the next network device refers to the network device next to the network device N on the communication link from the requester to the responder. For example, when the requester sends a message to the responder, it needs to be sent by the requester to network device N, which is forwarded to network device N+1, and then sent by network device N+1 to the responder. Then the next network device of the network device is Refers to network device N+1.
- Step S603 At least one network device sends the updated request message to the responder.
- each network device in at least one network device updates the remaining aging in the received request message, and sends the request message after all network devices have updated the aging to the responder.
- the request message from the requester is sent to the responder after passing through two network devices, and the initial remaining time limit in the request message is T1; after the first network device receives the request message sent by the requester, it sends the remaining time limit of the request message to the responder.
- the time limit is updated to T2, which is T1 minus the transmission delay and overall forwarding delay calculated by the first network device; after receiving the request message sent by the first network device, the second network device transfers the remainder of the request message.
- the timeliness is updated to T3, which is T2 minus the transmission delay calculated by the second network device and the overall forwarding delay; finally, the second network device sends the updated request message.
- the remaining time limit for the responder to receive the request message is T3, and the responder can determine whether the request message meets the time limit based on T3.
- T1, T2, and T3 are all positive numbers. It is understandable that T1>T2>T3.
- Step S604 In response to the received request message, the responder sends a response message to at least one network device.
- the response message includes aging information, and the aging information is used to indicate the remaining aging of the response message.
- the request message includes a query instruction or a control instruction, as well as the instruction's aging information; after receiving the request, the responder can first determine whether the instruction is valid based on the aging information, execute the instruction when it is valid, and generate the The response message corresponding to the command.
- the responder when the query instruction is valid, can perform a query in response to the query instruction and obtain the query information; and then generate a response message, which includes the query information.
- the responder when the control instruction is valid, can perform control operations in response to the instruction; it can also generate a response message, which includes control results or control parameters.
- the responder can determine whether the request message is valid based on the timeliness information, and the determination method is not limited here. For example, the responder may determine that the message has expired when the remaining age of the message is less than 0; or determine that the message has expired when the remaining age of the message is less than a preset threshold. It can be understood that in the embodiment of the present application, the responder does not need to establish time synchronization with the requester. The responder can determine whether the message is valid based only on the remaining time limit and the preset threshold.
- the responder when receiving the request message, calculates the link delay and the reception processing delay of the request message; and then updates the remaining messages of the request message based on the link delay and the reception processing delay.
- the remaining aging determines whether the request message is valid.
- the link delay can be obtained based on the start time and end time of the responder receiving the data frame carrying the request message.
- the reception processing delay is the protocol stack or application layer after the responder's link layer receives the data frame. The time required to receive and process a data frame.
- the responder to calculate the link delay and the reception processing delay please refer to the relevant content of the network device to calculate the transmission delay and the reception processing delay, and will not be described again here.
- Step S605 Each network device in at least one network device updates the aging information of the received response message.
- the process of updating the aging information of the received response message by each network device in at least one network device may be consistent with the process of updating the aging information of the request message.
- the process of updating the aging information of the request message may be consistent with the process of updating the aging information of the request message.
- Step S606 At least one network device sends the updated response message to the first requester.
- each network device in at least one network device updates the remaining aging in the received response message, and sends the response message after all network devices have updated the aging to the responder.
- FIG. 7 exemplarily shows a requester, a responder, and network device N and network device N+1 among multiple network devices.
- the requester can send a request message to the responder via multiple network devices, and the responder can send a response message to the requester via multiple network devices.
- the requester when the requester sends a request message to the responder via multiple network devices, the requester is the sender and the responder is the receiver; when the responder sends a response message to the requester via multiple network devices, the responder is the sender, and the requester is the receiver.
- the request message carries the aging information P of the instruction;
- the response message of the query instruction also carries the query information ID and information value V as well as the information aging information P.
- Figure 7 exemplarily shows the information included in the request message and the response message, such as information ID, information value V and aging information.
- the network device N can calculate Pn and P'n based on the transmission delay and the overall forwarding delay.
- the specific formula for calculating Pn and P'n by network device N can be shown in Figure 7.
- R' when Q>Qhigh, high-priority forwarding is performed, Qhigh ⁇ Q ⁇ Qdrop, normal forwarding is performed, or Q ⁇ Qdrop, the message is discarded.
- Qhigh and Qdrop can be preset values.
- each network device on the link can update the remaining aging information in the message.
- network device N Before forwarding the request message, network device N can further update the aging based on ⁇ Tp'n. As shown in Figure 7, the aging in the message forwarded by network device N is P'n.
- each network device does not need to rely on an external clock server and only needs to calculate the transmission delay based on the data frame structure of the instruction; the network device can update the remaining timeliness of the message in real time based on the transmission path of the request message and response message; the network The device can improve the response speed of instructions by combining the remaining timeliness of the request message and response message with the real-time requirements and reliability requirements of the message.
- the network device may process the response message differently from the request message.
- the network device on the communication link between the requester (first requester) and the responder can store the updated response message, so that other requesters (ie, the second requester) can request the same response message when , network devices on the communication link can send stored response messages to other requesters.
- the above steps S604 to step S606 can be replaced by step S802 in the embodiment of the present application.
- Figure 8 is a flow chart of yet another timeliness guarantee method provided by an embodiment of the present application. The method includes the following steps:
- Step S801 The first requester sends a query instruction to the responder via at least one network device, and the at least one network device includes network device N.
- the query instruction may include aging information corresponding to the instruction, and the aging information is used to indicate the remaining aging of the query instruction.
- the process of the first requester sending a query instruction to the responder via at least one network device also includes sending aging information corresponding to the instruction; each network device in the at least one network device can update the received query instruction. Corresponding aging information; furthermore, the responder can receive the aging information updated by each network device, and determine whether the query instruction is valid based on the remaining aging of the query instruction.
- Step S802 In response to the received query instruction, the responder sends a response message to the first requester via at least one network device, where the response message includes aging information indicating the remaining aging.
- the responder after receiving the query instruction, performs a query to obtain the target information; then, generates a response message that includes the target information; and then sends the response message to the first network device via at least one network device. requesting party.
- each network device in at least one network device can update the remaining time limit in the response message; the response message can also be stored.
- the following takes network device N as an example to introduce in detail a specific operation of network device N after receiving the response message.
- Step S8021 After receiving the response message, network device N updates the remaining aging indicated by the aging information to the first aging and obtains the cached message.
- the first aging is the time period of the remaining aging minus the transmission delay and the reception processing delay. .
- the specific process of the network device N calculating the transmission delay and the reception processing delay can be found in the relevant description above, and will not be described again here.
- Step S8022 Network device N stores the cached message when the first delay meets the preset condition.
- Storing the cache message may specifically store the cache message, or may store the message content corresponding to the cache message. For example, it may store the content requested by the query instruction corresponding to the response message, etc.
- each of at least one network device stores the cached message. Then, when a requester in direct communication with the network device requests a response message corresponding to the query instruction, the network device can send the cached message. to the requesting party. It is understandable that this method can achieve nearby response and improve the speed of response.
- content such as network device query cache messages, please refer to the following descriptions of steps S8026 to S8028.
- some of the network devices in at least one network device may store the cached message, which may be determined according to the actual situation, and is not limited here.
- Step S8023 Based on the first delay, network device N determines whether to forward the buffered message with priority or to forward it normally.
- the process by which the network device N determines whether to forward the cached message first or normally based on the first delay may refer to the relevant content in step S6024, which will not be described again here.
- Step S8024 Network device N updates the remaining aging of the cached message to the second aging to obtain the updated response message.
- the second aging is the time period of the first aging minus the transmission processing delay.
- step S6025 For the process of the network device N updating the remaining aging of the cached message to the second aging, please refer to the relevant content in step S6025, which will not be described again here.
- Step S8025 Network device N sends the updated response message to the next network device or the first requester.
- the next network device refers to the network device next to the network device N on the communication link from the responder to the requester. For example, when the requester sends a message to the responder, it needs to be sent by the requester to network device N, which is forwarded to network device N-1, and then sent by network device N-1 to the responder. Then the next network device of the network device is Refers to network device N-1.
- Figure 9 takes the scenario where the responder responds to the query instruction sent by the requester-1 and sends a response message to the requester-1 as an example. Introduce the transmission process of response messages. It should be noted that the process of the requester-1 sending the query instruction to the responder can be found in the relevant description above and will not be described again here.
- Figure 9 is a schematic flowchart of a response message transmission process provided by an embodiment of the present application.
- the communication link between the requester-1 and the responder for message transmission includes multiple network devices.
- Figure 9 exemplarily shows network device 1 and network device N, where network device 1 and the requesting party Party-1 establishes a communication connection.
- the requester-1 can send a query command to the network device 1, and then the network device 1 sends the query command to the next network device on the communication link, and so on, until the last network device sends the query command.
- the responder can respond to the query command and generate a response message, which can carry the information ID, information value V and aging information; the response message is sent to network device 1 via multiple network devices on the communication link,
- the response message is sent by network device 1 to requester-1.
- the response message includes a remaining time limit that is continuously updated dynamically with the network equipment on the communication link. The remaining time limit can be used by the requesting party-1 to determine whether the response message is valid based on the remaining time limit.
- S>Sstore the information is stored for subsequent network devices.
- Sstore can be a default value.
- the aging in the response message received by network device N is P' n+1 .
- the information is stored for rapid processing when subsequent network devices receive query instructions for the same information; furthermore, the network device N
- the response message can be forwarded based on the timeliness Pn, and the response message can be forwarded with high priority or normal forwarding.
- the network device N updates the timeliness information in the response message and updates the timeliness to P' n , where the timeliness P' n is the aging time after Pn minus the transmission processing delay.
- the specific process of the network device N calculating the transmission delay, the reception processing delay, and the sending processing delay can be found in the relevant content above.
- embodiments of the present application provide a query method.
- the network device since the network device stores the response message transmitted through it, the network device can directly send the stored response message to the requesting party when receiving a query instruction to query the response message.
- Figure 10 is a schematic flow chart of a query method provided by an embodiment of the present application. As shown in Figure 10, the query method may include all or part of the following steps:
- Step S8026 Network device N receives the query instruction from the second requester.
- the network device N may be a network device that directly communicates with the second requester; it may also be a network device that indirectly communicates with the second requester.
- Step S8027 Network device N queries the storage for the response message corresponding to the query instruction.
- the network device N may first query the stored cache message to see whether there is a response message corresponding to the query instruction.
- Step S8028 When the queried response message meets the preset conditions, the network device N sends a response message to the second requester.
- the network device N when the queried response message is not invalid, the network device N sends a response message to the second requester.
- the network device N may determine whether the response message is invalid based on the remaining timeliness of the response message. For example, network device N Query the storage time and current time of the response message, calculate the time difference between the storage time and the current time, and then subtract the above time difference from the remaining aging. If the remaining aging is less than the preset threshold, the response message is determined to be invalid. If the remaining aging is greater than the preset
- the threshold value determines that the response message is valid, where the preset threshold value can be 0 or other values, which is not limited here.
- network devices when other requesters in the network query the responder for information through network devices, network devices at all levels check the local information cache first. If the information cache exists and has not expired, the locally cached information will be responded to, otherwise it will be forwarded. This query is directed to the responder.
- network device N is a network device that indirectly communicates with the second requester.
- the second requester communicates with the responder through two network devices.
- the second requester sends a query command to network device N-1, and then network device N-1 updates the aging information of the query command and forwards it to the network device.
- N is finally sent to the responder by network device N, then network device N is a network device that indirectly communicates with the second requester.
- the network device N-1 does not store the response message corresponding to the query command
- the network device N-1 updates the timeliness information of the query command and forwards the updated query command to the network device N.
- network device N After the network device N queries When querying the response message corresponding to the instruction, network device N can send the response message to network device N-1, and then network device N-1 sends the response message to the second requester. When the network device N sends the response message to the second requester via the network device N-1, both the network device N and the network device N-1 can update the remaining aging in the response message.
- the network device is a network device that establishes a direct communication connection with the requesting party. Then, the network device executes the query method shown in Figure 10 above to achieve a nearby response; the network device is a network device that establishes an indirect communication connection with the requesting party. , it can also reduce the time that originally needs to be sent to the responder.
- Figure 11 is a scene diagram of a nearby response provided by an embodiment of the present application.
- Figure 11 exemplarily shows Requester-1, Requester-2 and Requester-N, as well as Network Device 1 and Network Device N, where Requester-1 and Requester-2 both A communication connection is established with network device 1, and the requester-N establishes a communication connection with network device N.
- requester-1 is the above-mentioned first requester
- requester-2 and requester-N are the above-mentioned second requesters.
- the communication between requester-1 and the responder includes multiple network devices such as network device 1 and network device N shown in Figure 11 .
- the requester-1 sends a query instruction to the network device 1, and then, in the process of the responder sending the response message corresponding to the query instruction to the requester-1 through the above-mentioned multiple network devices, multiple network devices all respond to the response message. It is updated within the time limit, and multiple network devices store the updated response messages.
- the network device 2 can first query the response message corresponding to the query command in the storage, and after querying the corresponding response message, send the response message to the requester Party-2;
- the network device 2 can first query whether there is a response message corresponding to the query instruction in the storage, and after querying the corresponding response message, send the response message To Requester-N.
- the response message stored by the network device may be updated with the response message received by the network device to a response message after the first aging (such as the cache message mentioned above), and the network device performs aging update on the response message. See the relevant description above and will not go into details here.
- Figure 11 exemplarily shows the information carried in the response message, such as information ID, information value and aging information.
- the initial timeliness of the response message generated by the responder is P
- multiple network devices can update the timeliness information in the response message.
- network device N updates the timeliness of the response message to Pn
- network device 1 updates the timeliness of the response message to Pn .
- the response message is updated to P 1 .
- Figure 12 is a schematic structural diagram of an aging guarantee device 120 provided by an embodiment of the present application.
- Setting 120 can be a network device.
- the device 120 can also be a component in a network device, such as a chip or an integrated circuit.
- the device 120 can include a receiving unit 1201, a first processing unit 1202, a second processing unit 1203, an updating unit 1204 and a sending unit 1205. .
- the aging guarantee device 120 is used to implement the aforementioned aging guarantee method, such as the aging guarantee method in any embodiment shown in Figure 5 or Figure 6B.
- the receiving unit 1201 is configured to receive a data frame, the data frame includes aging information, and the aging information is used to indicate the remaining aging of the data frame;
- the first processing unit 1202 is used to obtain the transmission delay based on the starting time of the link layer receiving the data frame and the ending time of the link layer receiving the data frame of the network device;
- the second processing unit 1203 is used to obtain the overall forwarding delay based on the time required for the protocol stack or application layer of the network device to process the data frame;
- the update unit 1204 is used to update the aging information based on the transmission delay and the overall forwarding delay;
- the sending unit 1205 is used to send the updated data frame.
- the transmission delay is the time difference between the start time and the end time; the start time is the time when the start bit of the data frame is received, and the end time is the time when the stop bit of the data frame is received. ;
- the remaining aging in the updated data frame is the remaining aging in the data frame minus the difference between the transmission delay and the overall forwarding delay.
- the overall forwarding delay includes receiving processing delay and sending processing delay; the update unit 1204 is used to:
- the first aging is the remaining aging of the data frame minus the difference between the transmission delay and the reception processing delay;
- the reception processing delay is the link layer reception The time required for the protocol stack or application layer to receive and process the data frame after the data frame;
- the remaining aging of the first data frame is the first aging;
- the pre-frame protocol stack or application layer sends the time required to process the first data frame; the remaining aging of the updated data frame is the second aging.
- the device before the sending unit 1205 sends the updated data frame, the device further includes a processing unit, and the processing unit is configured to:
- a processing method for the first data frame is determined; the processing method includes priority forwarding, normal forwarding, or discarding.
- the processing unit is used for:
- a processing method for the first data frame is determined.
- the data frame carries any one of a request message, a response message and an active notification message.
- the request message includes a query instruction or a control instruction
- the response message is a reply message generated in response to the query instruction or control instruction.
- the data frame carries a response message generated by the responder in response to the query instruction of the first requester.
- the device further includes a storage unit, and the storage unit is used for:
- the storage unit is used for:
- the response message is stored.
- the receiving unit 1201 is configured to receive a query instruction from the second requester, and the query instruction from the second requester is used to request a response message;
- the sending unit 1205 is used to send a response message to the second requester.
- the sending unit 1205 is used to:
- the request message is sent to the responder.
- each unit may also correspond to the corresponding description with reference to the embodiment shown in FIG. 6A or FIG. 8 .
- the timeliness guarantee device 120 may be the network device in the embodiment shown in FIG. 6A or FIG. 8 .
- the division of multiple units or modules is only a logical division based on functions and does not limit the specific structure of the device.
- some functional modules may be subdivided into more small functional modules, and some functional modules may also be combined into one functional module.
- the device 120 is paired with The general process performed is the same.
- the receiving unit 1201 and the sending unit 1205 in the above-mentioned device 120 can also be integrated into a communication unit, and the communication unit can realize the functions realized by the receiving unit 1201 and the sending unit 1205.
- each unit corresponds to its own program code (or program instruction). When the corresponding program codes of these units are run on the processor, the unit is controlled by the processing unit and executes the corresponding process to realize the corresponding function.
- Figure 13 is a schematic structural diagram of a timeliness guarantee device 130 provided by an embodiment of the present application.
- the device 130 can be a receiving end.
- the device 130 can also be a device in the receiving end, such as a chip or an integrated circuit.
- the device 130 can include a receiving unit 1301, a processing unit 1302 and an updating unit 1303.
- the timeliness guarantee device 130 may be the responder or the requester in the above embodiment, and is used to implement the aforementioned timeliness guarantee method, such as the timeliness guarantee method in any embodiment shown in FIG. 6A or FIG. 8 .
- the device includes:
- the receiving unit 1301 is used to receive a data frame from the sending end; the data frame includes aging information, and the aging information of the data frame is used to indicate the remaining aging of the data frame;
- the processing unit 1302 is configured to obtain the link delay based on the starting time of the receiving end's link layer receiving the data frame and the ending time of the receiving end's link layer receiving the data frame;
- the update unit 1303 is used to update the remaining aging based on the link delay and the reception processing delay; the reception processing delay is the time required for the protocol stack or the application layer to receive and process the data frame after the link layer receives the data frame.
- the data frame carries a request message, and the request message includes a query instruction or a control instruction;
- the device also includes an execution unit 1304, and the execution unit 1304 is used to:
- the query instruction or the control instruction is executed.
- the receiving unit 1301 is used for:
- At least one network device is used to update the remaining aging of the data frame based on the transmission delay and the overall forwarding delay; the transmission delay is based on the starting time of the link layer of the network device receiving the data frame and the link layer of the network device receiving the data frame. The termination time is obtained; the overall forwarding delay is obtained based on the time required for the protocol stack or application layer of the network device to process the data frame.
- each unit may also correspond to the corresponding description with reference to the embodiment shown in FIG. 6A or FIG. 8 .
- the timeliness guarantee device 130 may be the responder or requester in the embodiment shown in FIG. 6A or FIG. 8 .
- Figure 14 is a schematic structural diagram of a timeliness guarantee device 140 provided by an embodiment of the present application.
- the timeliness guarantee device 140 can be a node or a device in the node, such as a chip or an integrated circuit. Should be installed
- the device 140 may include at least one processor 1402 and a communication interface 1404. Further optionally, the timeliness guarantee device may also include at least one memory 1401. Further optionally, a bus 1403 may also be included, wherein the memory 1401, the processor 1402 and the communication interface 1404 are connected through the bus 1403.
- the memory 1401 is used to provide storage space, and data such as operating systems and computer programs can be stored in the storage space.
- the memory 1401 may be a random access memory (RAM), a read-only memory (ROM), an erasable programmable read only memory (EPROM), or a portable read-only memory.
- RAM random access memory
- ROM read-only memory
- EPROM erasable programmable read only memory
- portable read-only memory One or more combinations of memory (compact disc read-only memory, CD-ROM), etc.
- the processor 1402 is a module that performs arithmetic operations and/or logical operations, and may be a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor unit (MPU), Application Specific Integrated Circuit (ASIC), Field Programmable Gate Array (FPGA), Complex programmable logic device (CPLD), co-processor (assist the central processor to complete Corresponding processing and application), microcontroller unit (Microcontroller Unit, MCU) and other processing modules or a combination thereof.
- CPU central processing unit
- GPU graphics processing unit
- MPU microprocessor unit
- ASIC Application Specific Integrated Circuit
- FPGA Field Programmable Gate Array
- CPLD Complex programmable logic device
- Communication interface 1404 may be used to provide information input or output to the at least one processor. And/or the communication interface can be used to receive data sent from the outside and/or send data to the outside. It can be a wired link interface such as an Ethernet cable, or a wireless link (Wi-Fi, Bluetooth, Universal wireless transmission, vehicle short-distance communication technology, etc.) interface. Optionally, the communication interface 1404 may also include a transmitter (such as a radio frequency transmitter, an antenna, etc.) or a receiver coupled to the interface.
- a transmitter such as a radio frequency transmitter, an antenna, etc.
- the processor 1402 in the device 140 is used to read the computer program stored in the memory 1401 and execute the aforementioned aging guarantee method, such as the aging guarantee method described in the embodiment shown in FIG. 6A or FIG. 8 .
- the timeliness guarantee device 140 may be the network device in the embodiment shown in FIG. 6A or FIG. 8 .
- the processor 1402 in the device 140 is used to read the computer program stored in the memory 1401 and execute the method embodiment shown in FIG. 6A or FIG. 8 .
- the timeliness guarantee device 140 may be the requester or the responder in the embodiment shown in FIG. 6A or FIG. 8 .
- the processor 1402 in the device 140 is used to read the computer program stored in the memory 1401 and execute the method embodiment shown in FIG. 6A or FIG. 8 above.
- Embodiments of the present application also provide a computer-readable storage medium.
- a computer program is stored in the computer-readable storage medium.
- FIG. 6A and FIG. 6B are implemented. , the method described in the embodiment shown in Figure 8 or Figure 10.
- Embodiments of the present application also provide a chip system.
- the chip system includes at least one processor and a communication interface.
- the communication interface is used to send and/or receive data.
- the at least one processor is used to call at least one memory.
- the stored computer program implements the method described in the embodiment shown in FIG. 6A, FIG. 6B, FIG. 8 or FIG. 10.
- the at least one processor may include at least one of a CPU, MPU, MCU or a co-processor.
- Embodiments of the present application also provide a computer program product.
- the computer program product is run on one or more processors, the embodiments described in Figure 6A, Figure 6B, Figure 8 or Figure 10 can be implemented. Methods.
- the computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
- the computer instructions may be stored in or transmitted over a computer-readable storage medium.
- the computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center integrated with one or more available media. Available media may be magnetic media (eg, floppy disk, hard disk, tape), optical media (eg, DVD), or semiconductor media (eg, solid state disk (SSD)), etc.
- Modules in the device embodiments of the present application can be merged, divided, and deleted according to actual needs.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Embodiments of the present application provide a timeliness guarantee method, apparatus and system, applied to the communication technology. The method comprises: a network device receiving a data frame, the data frame comprising timeliness information; obtaining a transmission delay on the basis of a start moment of a link layer of the network device receiving the data frame and a termination moment of the link layer receiving the data frame; obtaining an overall forwarding delay on the basis of the time required by a protocol stack or an application layer of the network device to process the data frame; updating the timeliness information on the basis of the transmission delay and the overall forwarding delay; and sending the updated data frame. According to the present application, the network device and/or a receiving terminal can update the timeliness information of the data frame, such that the receiving terminal can determine whether the data frame is valid or not on the basis of the updated timeliness information. The method does not need to keep the time synchronization of a sending terminal, the receiving terminal, and the network device.
Description
本申请要求于2022年05月28日提交中国专利局、申请号为202210592686.2、申请名称为“一种时效保证方法、装置及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application submitted to the China Patent Office on May 28, 2022, with the application number 202210592686.2 and the application title "A timeliness guarantee method, device and system", the entire content of which is incorporated herein by reference. Applying.
本申请涉及通信技术领域,具体涉及一种时效保证方法、装置及系统。This application relates to the field of communication technology, and specifically to a timeliness guarantee method, device and system.
在工业以太网环境下,为保证工业生产的稳定运行,对其中的查询、控制指令的时效性有一定的要求。In the industrial Ethernet environment, in order to ensure the stable operation of industrial production, there are certain requirements for the timeliness of query and control instructions.
现有的技术方案要求工业以太网内部署高精度时钟服务器,请求方和响应方通过时钟同步算法保证双方系统时间与该高精度时钟服务器时间一致,请求方在查询、控制指令中添加时间戳信息,响应方可以根据指令中的时间戳和系统时间判断该指令是否需要执行,其中,请求方可以为控制器,响应方可以为执行器(Actuator)。该方法中,网络内需要部署高精度时间同步服务器,存在部署成本。The existing technical solution requires the deployment of a high-precision clock server in the industrial Ethernet. The requester and responder ensure that the system time of both parties is consistent with the time of the high-precision clock server through a clock synchronization algorithm. The requester adds timestamp information in the query and control instructions. , the responder can determine whether the instruction needs to be executed based on the timestamp and system time in the instruction, where the requester can be the controller and the responder can be the executor (Actuator). In this method, a high-precision time synchronization server needs to be deployed within the network, and there is a deployment cost.
发明内容Contents of the invention
本申请实施例公开了一种时效保证方法、装置及系统。通过本申请,网络设备和/或接收端可以对数据帧的时效信息进行更新,从而接收端可以基于更新的时效信息确定数据帧是否有效,该方法无需保持发送端、接收端和网络设备的时间同步,可以减少部署时间同步服务器的部署成本。The embodiments of this application disclose a timeliness guarantee method, device and system. Through this application, the network device and/or the receiving end can update the timeliness information of the data frame, so that the receiving end can determine whether the data frame is valid based on the updated timeliness information. This method does not need to keep the time of the sending end, the receiving end and the network device. Synchronization can reduce the deployment cost of deploying time synchronization server.
第一方面,本申请实施例公开了一种时效保证方法,应用于网络设备,该方法包括:In the first aspect, embodiments of the present application disclose a timeliness guarantee method, which is applied to network equipment. The method includes:
接收数据帧,数据帧包括时效信息,时效信息用于指示数据帧的剩余时效;Receive a data frame, the data frame includes aging information, and the aging information is used to indicate the remaining aging of the data frame;
基于网络设备的链路层接收数据帧的起始时刻和链路层接收数据帧的终止时刻,得到传输时延;Based on the start time of the network device's link layer receiving the data frame and the end time of the link layer receiving the data frame, the transmission delay is obtained;
基于网络设备的协议栈或应用层处理数据帧所需的时间,得到整体转发时延;Based on the time required for the protocol stack or application layer of the network device to process the data frame, the overall forwarding delay is obtained;
基于传输时延和整体转发时延,更新时效信息;Update aging information based on transmission delay and overall forwarding delay;
发送更新后的数据帧。Send updated data frame.
通过本申请,发送端可以发送携带时效信息的数据帧,网络设备和接收端可以对数据帧的时效信息进行更新,从而接收端可以基于更新的时效信息确定数据帧是否有效,该方法无需保持发送端、接收端和网络设备的时间同步,即可确定数据帧是否在时效范围内,该方法可以减少部署时间同步服务器的部署成本。Through this application, the sending end can send a data frame carrying aging information, and the network device and the receiving end can update the aging information of the data frame, so that the receiving end can determine whether the data frame is valid based on the updated aging information. This method does not need to keep sending. By synchronizing the time of the end, receiving end and network equipment, you can determine whether the data frame is within the time limit. This method can reduce the deployment cost of deploying a time synchronization server.
结合第一方面,在一种可能的实施方式中,传输时延为起始时刻和终止时刻的时间差;起始时刻为接收到数据帧的起始位时的时刻,终止时刻为接收到数据帧的终止位的时刻;Combined with the first aspect, in a possible implementation, the transmission delay is the time difference between the start time and the end time; the start time is the time when the start bit of the data frame is received, and the end time is the time when the data frame is received. The moment of the end position;
更新后的数据帧中的剩余时效为数据帧中的剩余时效减去传输时延和整体转发时延的差值。The remaining aging in the updated data frame is the remaining aging in the data frame minus the difference between the transmission delay and the overall forwarding delay.
结合第一方面,在一种可能的实施方式中,整体转发时延包括接收处理时延和发送处理时延;基于传输时延和整体转发时延,更新时效信息,包括:
Combined with the first aspect, in a possible implementation, the overall forwarding delay includes a receiving processing delay and a sending processing delay; based on the transmission delay and the overall forwarding delay, updating the aging information includes:
将数据帧的剩余时效更新为第一时效,得到第一数据帧;第一时效为数据帧的剩余时效减去传输时延和接收处理时延的差值;接收处理时延为链路层接收数据帧后协议栈或应用层接收处理数据帧所需的时间;第一数据帧的剩余时效为第一时效;Update the remaining aging of the data frame to the first aging to obtain the first data frame; the first aging is the remaining aging of the data frame minus the difference between the transmission delay and the reception processing delay; the reception processing delay is the link layer reception The time required for the protocol stack or application layer to receive and process the data frame after the data frame; the remaining aging of the first data frame is the first aging;
将第一数据帧的剩余时效更新为第二时效,得到更新后的数据帧;第二时效为第一时效与发送处理时延的差值,发送处理时延为链路层发送更新后的数据帧前协议栈或应用层发送处理第一数据帧所需的时间;更新后的数据帧的剩余时效为第二时效。Update the remaining aging of the first data frame to the second aging to obtain the updated data frame; the second aging is the difference between the first aging and the transmission processing delay, and the transmission processing delay is the link layer sending the updated data The pre-frame protocol stack or application layer sends the time required to process the first data frame; the remaining aging of the updated data frame is the second aging.
结合第一方面,在一种可能的实施方式中,在发送更新后的数据帧之前,方法还包括:Combined with the first aspect, in a possible implementation, before sending the updated data frame, the method further includes:
基于第一时效,确定对第一数据帧的处理方式;处理方式包括优先转发、正常转发或丢弃。Based on the first timeliness, a processing method for the first data frame is determined; the processing method includes priority forwarding, normal forwarding, or discarding.
本申请实施例中,网络设备还可以基于第一时效,进行转发决策,从而确定优先转发、正常转发或丢弃该数据帧。该方法中,可以避免数据帧失效,加快转发效率;还可以避免传输失效的数据帧,造成网络资源浪费。In this embodiment of the present application, the network device can also make a forwarding decision based on the first timeliness, thereby determining whether to forward the data frame preferentially, forward it normally, or discard the data frame. In this method, invalid data frames can be avoided and forwarding efficiency can be accelerated; it can also avoid transmission of invalid data frames, causing a waste of network resources.
结合第一方面,在一种可能的实施方式中,基于第一时效,确定对第一数据帧的处理方式,包括:In conjunction with the first aspect, in a possible implementation, based on the first timeliness, determining a processing method for the first data frame includes:
基于数据帧对应的可靠性等级和数据帧对应的实时性等级中的至少一项和第一时效,确定对第一数据帧的处理方式。Based on at least one of the reliability level corresponding to the data frame and the real-time level corresponding to the data frame and the first timeliness, a processing method for the first data frame is determined.
本申请实施例中,网络设备可以结合该数据帧对应的可靠性等级和数据帧对应的实时性等级,确定是否优先转发该数据帧。通过该方法,可以优先转发重要消息。In this embodiment of the present application, the network device may determine whether to preferentially forward the data frame based on the reliability level corresponding to the data frame and the real-time level corresponding to the data frame. With this method, important messages can be forwarded with priority.
结合第一方面,在一种可能的实施方式中,数据帧承载请求消息、响应消息和主动通知消息中的任一种,请求消息包括查询指令或控制指令,响应消息为响应于查询指令或控制指令生成的回复消息。In conjunction with the first aspect, in a possible implementation, the data frame carries any one of a request message, a response message, and an active notification message. The request message includes a query instruction or a control instruction, and the response message is in response to the query instruction or control instruction. The reply message generated by the command.
结合第一方面,在一种可能的实施方式中,数据帧承载响应方响应于第一请求方的查询指令生成的响应消息,方法还包括:In conjunction with the first aspect, in a possible implementation, the data frame carries a response message generated by the responder in response to the query instruction of the first requester, and the method further includes:
存储响应消息。Store the response message.
在一种可能的实施方式中,网络设备存储的是数据帧解析后的报文内容。In a possible implementation, the network device stores the parsed message content of the data frame.
本申请实施例中,网络设备还可以存储接收到的响应消息,从而在其他请求方请求该响应消息时,向其他请求方发送该响应消息。该方法可以实现就近响应,提高响应效率。In this embodiment of the present application, the network device can also store the received response message, so that when other requesting parties request the response message, the network device can send the response message to other requesting parties. This method can achieve nearby response and improve response efficiency.
结合第一方面,在一种可能的实施方式中,在将数据帧的剩余时效更新为第一时效,得到第一数据帧后,存储响应消息,包括:Combined with the first aspect, in a possible implementation, after updating the remaining timeliness of the data frame to the first timeliness and obtaining the first data frame, the response message is stored, including:
在第一时效和响应消息对应的实时性等级满足缓存决策时,存储响应消息。When the first timeliness and the real-time level corresponding to the response message satisfy the cache decision, the response message is stored.
本申请实施例中,网络设备可以仅存储没有失效的数据帧,避免存储空间的浪费。In this embodiment of the present application, the network device can only store data frames without invalidation to avoid wasting storage space.
结合第一方面,在一种可能的实施方式中,方法还包括:Combined with the first aspect, in a possible implementation, the method further includes:
接收来自第二请求方的查询指令,来自第二请求方的查询指令用于请求响应消息;Receive a query instruction from the second requester, and the query instruction from the second requester is used to request a response message;
向第二请求方发送响应消息。Send a response message to the second requester.
结合第一方面,在一种可能的实施方式中,向第二请求方发送响应消息,包括:Combined with the first aspect, in a possible implementation, sending a response message to the second requester includes:
获取响应消息对应的第一时效和存储响应消息的时刻;Obtain the first aging corresponding to the response message and the time when the response message is stored;
在当前时刻和存储响应消息的时刻的时间差不大于第一时效时,向第二请求方发送响应消息;When the time difference between the current time and the time when the response message is stored is not greater than the first aging, send the response message to the second requester;
在当前时刻和存储响应消息的时刻的时间差大于第一时效时,向响应方发送请求消息。When the time difference between the current time and the time when the response message is stored is greater than the first aging, the request message is sent to the responder.
本申请实施例中,网络设备可以在确定该数据帧未失效时,再将该数据帧发送至其他请求方。该方法可以避免向其他请求方发送失效的数据帧。
In this embodiment of the present application, the network device may send the data frame to other requesters after determining that the data frame is not invalid. This method avoids sending invalid data frames to other requesters.
第二方面,本申请实施例公开了一种时效保证方法,应用于发送端,该方法包括:In the second aspect, embodiments of the present application disclose a timeliness guarantee method, which is applied to the sending end. The method includes:
发送端向接收端发送数据帧;数据帧包括时效信息,数据帧的时效信息用于指示数据帧的剩余时效;The sending end sends a data frame to the receiving end; the data frame includes aging information, and the aging information of the data frame is used to indicate the remaining aging of the data frame;
接收端用于基于链路时延和接收处理时延更新数据帧的剩余时效;链路时延是基于接收端的链路层接收数据帧的起始时刻和链路层接收数据帧的终止时刻得到的;接收处理时延为链路层接收数据帧后协议栈或应用层接收处理数据帧所需的时间。The receiving end is used to update the remaining aging of the data frame based on the link delay and the reception processing delay; the link delay is obtained based on the starting time of the receiving end's link layer receiving the data frame and the end time of the link layer receiving the data frame. ; the reception processing delay is the time required for the protocol stack or application layer to receive and process the data frame after the link layer receives the data frame.
第三方面,本申请实施例公开了一种时效保证方法,应用于接收端,该方法包括:In the third aspect, embodiments of the present application disclose a timeliness guarantee method, which is applied to the receiving end. The method includes:
接收端接收来自发送端的数据帧;数据帧包括时效信息,数据帧的时效信息用于指示数据帧的剩余时效;The receiving end receives the data frame from the sending end; the data frame includes aging information, and the aging information of the data frame is used to indicate the remaining aging of the data frame;
接收端基于接收端的链路层接收数据帧的起始时刻和接收端的链路层接收数据帧的终止时刻,得到链路时延;The receiving end obtains the link delay based on the starting time when the receiving end's link layer receives the data frame and the ending time when the receiving end's link layer receives the data frame;
基于链路时延和接收处理时延,更新剩余时效;接收处理时延为链路层接收数据帧后协议栈或应用层接收处理数据帧所需的时间。Based on the link delay and the reception processing delay, the remaining aging is updated; the reception processing delay is the time required for the protocol stack or application layer to receive and process the data frame after the link layer receives the data frame.
通过本申请,发送端可以发送携带时效信息的数据帧,数据端可以对数据帧的时效信息进行更新,从而接收端可以基于更新的时效信息确定数据帧是否有效,该方法无需保持发送端和接收端的时间同步,可以减少部署时间同步服务器的部署成本。Through this application, the sending end can send a data frame carrying aging information, and the data end can update the aging information of the data frame, so that the receiving end can determine whether the data frame is valid based on the updated aging information. This method does not require keeping the sending end and the receiving end. End-to-end time synchronization can reduce the deployment cost of deploying a time synchronization server.
结合第三方面,在一种可能的实施方式中,数据帧承载请求消息,请求消息包括查询指令或控制指令;方法还包括:Combined with the third aspect, in a possible implementation, the data frame carries a request message, and the request message includes a query instruction or a control instruction; the method further includes:
接收端在基于剩余时效和预设阈值确定请求消息有效时,执行查询指令或控制指令。When the receiving end determines that the request message is valid based on the remaining aging and the preset threshold, it executes the query instruction or the control instruction.
结合第三方面,在一种可能的实施方式中,接收端接收来自发送端的数据帧,包括:Combined with the third aspect, in a possible implementation, the receiving end receives a data frame from the sending end, including:
接收端经至少一个网络设备接收来自请求方的数据帧;The receiving end receives the data frame from the requesting party via at least one network device;
至少一个网络设备用于基于传输时延和整体转发时延更新数据帧的剩余时效;传输时延是基于网络设备的链路层接收数据帧的起始时刻和网络设备的链路层接收数据帧的终止时刻得到的;整体转发时延是基于网络设备的协议栈或应用层处理数据帧所需的时间得到的。At least one network device is used to update the remaining aging of the data frame based on the transmission delay and the overall forwarding delay; the transmission delay is based on the starting time of the link layer of the network device receiving the data frame and the link layer of the network device receiving the data frame. The termination time is obtained; the overall forwarding delay is obtained based on the time required for the protocol stack or application layer of the network device to process the data frame.
第四方面,本申请提供了一种时效保证装置,该装置包括:In the fourth aspect, this application provides an aging guarantee device, which includes:
接收单元,用于接收数据帧,数据帧包括时效信息,时效信息用于指示数据帧的剩余时效;a receiving unit, configured to receive a data frame, the data frame includes aging information, and the aging information is used to indicate the remaining aging of the data frame;
第一处理单元,用于基于网络设备的链路层接收数据帧的起始时刻和链路层接收数据帧的终止时刻,得到传输时延;The first processing unit is used to obtain the transmission delay based on the start time of the link layer receiving the data frame and the end time of the link layer receiving the data frame based on the network device;
第二处理单元,用于基于网络设备的协议栈或应用层处理数据帧所需的时间,得到整体转发时延;The second processing unit is used to obtain the overall forwarding delay based on the time required for the protocol stack or application layer of the network device to process the data frame;
更新单元,用于基于传输时延和整体转发时延,更新时效信息;The update unit is used to update the aging information based on the transmission delay and the overall forwarding delay;
发送单元,用于发送更新后的数据帧。The sending unit is used to send the updated data frame.
结合第四方面,在一种可能的实施方式中,传输时延为起始时刻和终止时刻的时间差;起始时刻为接收到数据帧的起始位时的时刻,终止时刻为接收到数据帧的终止位的时刻;Combined with the fourth aspect, in a possible implementation, the transmission delay is the time difference between the start time and the end time; the start time is the time when the start bit of the data frame is received, and the end time is the time when the data frame is received. The moment of the end position;
更新后的数据帧中的剩余时效为数据帧中的剩余时效减去传输时延和整体转发时延的差值。The remaining aging in the updated data frame is the remaining aging in the data frame minus the difference between the transmission delay and the overall forwarding delay.
结合第四方面,在一种可能的实施方式中,整体转发时延包括接收处理时延和发送处理
时延;更新单元用于:Combined with the fourth aspect, in a possible implementation, the overall forwarding delay includes receiving processing delay and sending processing delay. Latency; update unit is used for:
将数据帧的剩余时效更新为第一时效,得到第一数据帧;第一时效为数据帧的剩余时效减去传输时延和接收处理时延的差值;接收处理时延为链路层接收数据帧后协议栈或应用层接收处理数据帧所需的时间;第一数据帧的剩余时效为第一时效;Update the remaining aging of the data frame to the first aging to obtain the first data frame; the first aging is the remaining aging of the data frame minus the difference between the transmission delay and the reception processing delay; the reception processing delay is the link layer reception The time required for the protocol stack or application layer to receive and process the data frame after the data frame; the remaining aging of the first data frame is the first aging;
将第一数据帧的剩余时效更新为第二时效,得到更新后的数据帧;第二时效为第一时效与发送处理时延的差值,发送处理时延为链路层发送更新后的数据帧前协议栈或应用层发送处理第一数据帧所需的时间;更新后的数据帧的剩余时效为第二时效。Update the remaining aging of the first data frame to the second aging to obtain the updated data frame; the second aging is the difference between the first aging and the transmission processing delay, and the transmission processing delay is the link layer sending the updated data The pre-frame protocol stack or application layer sends the time required to process the first data frame; the remaining aging of the updated data frame is the second aging.
结合第四方面,在一种可能的实施方式中,在发送单元发送更新后的数据帧之前,装置还包括处理单元,处理单元用于:Combined with the fourth aspect, in a possible implementation, before the sending unit sends the updated data frame, the device further includes a processing unit, and the processing unit is configured to:
基于第一时效,确定对第一数据帧的处理方式;处理方式包括优先转发、正常转发或丢弃。Based on the first timeliness, a processing method for the first data frame is determined; the processing method includes priority forwarding, normal forwarding, or discarding.
结合第四方面,在一种可能的实施方式中,处理单元用于:Combined with the fourth aspect, in a possible implementation, the processing unit is used to:
基于数据帧对应的可靠性等级和数据帧对应的实时性等级中的至少一项和第一时效,确定对第一数据帧的处理方式。Based on at least one of the reliability level corresponding to the data frame and the real-time level corresponding to the data frame and the first timeliness, a processing method for the first data frame is determined.
结合第四方面,在一种可能的实施方式中,数据帧承载请求消息、响应消息和主动通知消息中的任一种,请求消息包括查询指令或控制指令,响应消息为响应于查询指令或控制指令生成的回复消息。In conjunction with the fourth aspect, in a possible implementation, the data frame carries any one of a request message, a response message and an active notification message. The request message includes a query instruction or a control instruction, and the response message is in response to the query instruction or control instruction. The reply message generated by the command.
结合第四方面,在一种可能的实施方式中,数据帧承载响应方响应于第一请求方的查询指令生成的响应消息,装置还包括存储单元,存储单元用于:In conjunction with the fourth aspect, in a possible implementation, the data frame carries a response message generated by the responder in response to the query instruction of the first requester, and the device further includes a storage unit, and the storage unit is used for:
存储响应消息。Store the response message.
结合第四方面,在一种可能的实施方式中,存储单元用于:Combined with the fourth aspect, in a possible implementation, the storage unit is used for:
在第一时效和响应消息对应的实时性等级满足缓存决策时,存储响应消息。When the first timeliness and the real-time level corresponding to the response message satisfy the cache decision, the response message is stored.
结合第四方面,在一种可能的实施方式中,接收单元,用于接收来自第二请求方的查询指令,来自第二请求方的查询指令用于请求响应消息;In conjunction with the fourth aspect, in a possible implementation, the receiving unit is configured to receive a query instruction from the second requester, and the query instruction from the second requester is used to request a response message;
发送单元,用于向第二请求方发送响应消息。A sending unit, configured to send a response message to the second requester.
结合第四方面,在一种可能的实施方式中,发送单元用于:Combined with the fourth aspect, in a possible implementation, the sending unit is used for:
获取响应消息对应的第一时效和存储响应消息的时刻;Obtain the first aging corresponding to the response message and the time when the response message is stored;
在当前时刻和存储响应消息的时刻的时间差不大于第一时效时,向第二请求方发送响应消息;When the time difference between the current time and the time when the response message is stored is not greater than the first aging, send the response message to the second requester;
在当前时刻和存储响应消息的时刻的时间差大于第一时效时,向响应方发送请求消息。When the time difference between the current time and the time when the response message is stored is greater than the first aging, the request message is sent to the responder.
第五方面,本申请实施例提供了一种时效保证装置,该装置包括:In the fifth aspect, embodiments of the present application provide an aging guarantee device, which includes:
接收单元,用于接收来自发送端的数据帧;数据帧包括时效信息,数据帧的时效信息用于指示数据帧的剩余时效;The receiving unit is used to receive the data frame from the sending end; the data frame includes aging information, and the aging information of the data frame is used to indicate the remaining aging of the data frame;
处理单元,用于基于接收端的链路层接收数据帧的起始时刻和接收端的链路层接收数据帧的终止时刻,得到链路时延;A processing unit configured to obtain the link delay based on the starting time when the link layer at the receiving end receives the data frame and the end time when the link layer at the receiving end receives the data frame;
更新单元,用于基于链路时延和接收处理时延,更新剩余时效;接收处理时延为链路层接收数据帧后协议栈或应用层接收处理数据帧所需的时间。The update unit is used to update the remaining aging based on the link delay and the reception processing delay; the reception processing delay is the time required for the protocol stack or the application layer to receive and process the data frame after the link layer receives the data frame.
结合第五方面,在一种可能的实施方式中,数据帧承载请求消息,请求消息包括查询指令或控制指令;装置还包括执行单元,执行单元用于:In conjunction with the fifth aspect, in a possible implementation, the data frame carries a request message, and the request message includes a query instruction or a control instruction; the device further includes an execution unit, and the execution unit is used to:
在基于剩余时效和预设阈值确定请求消息有效时,执行查询指令或控制指令。
When it is determined that the request message is valid based on the remaining aging and the preset threshold, the query instruction or the control instruction is executed.
结合第五方面,在一种可能的实施方式中,接收单元用于:Combined with the fifth aspect, in a possible implementation, the receiving unit is used for:
经至少一个网络设备接收来自请求方的数据帧;receiving data frames from the requesting party via at least one network device;
至少一个网络设备用于基于传输时延和整体转发时延更新数据帧的剩余时效;传输时延是基于网络设备的链路层接收数据帧的起始时刻和网络设备的链路层接收数据帧的终止时刻得到的;整体转发时延是基于网络设备的协议栈或应用层处理数据帧所需的时间得到的。At least one network device is used to update the remaining aging of the data frame based on the transmission delay and the overall forwarding delay; the transmission delay is based on the starting time of the link layer of the network device receiving the data frame and the link layer of the network device receiving the data frame. The termination time is obtained; the overall forwarding delay is obtained based on the time required for the protocol stack or application layer of the network device to process the data frame.
第六方面,本申请实施例公开了一种时效保证装置,包括处理器和通信接口,所述处理器用于调用存储器中存储的计算机程序,以实现第一方面或者第一方面的任意一种可能的实施方式所描述的方法。In a sixth aspect, embodiments of the present application disclose a timeliness guarantee device, which includes a processor and a communication interface. The processor is configured to call a computer program stored in a memory to implement the first aspect or any possibility of the first aspect. The method described in the implementation.
第七方面,本申请实施例公开了一种时效保证装置,包括处理器和通信接口,所述处理器用于调用存储器中存储的计算机程序,以实现第二方面或者第二方面的任意一种可能的实现方式。In a seventh aspect, embodiments of the present application disclose a timeliness guarantee device, which includes a processor and a communication interface. The processor is configured to call a computer program stored in a memory to implement the second aspect or any possibility of the second aspect. way of implementation.
第八方面,本申请实施例公开了一种时效保证装置,包括处理器和通信接口,所述处理器用于调用存储器中存储的计算机程序,以实现第三方面或者第三方面的任意一种可能的实现方式。In an eighth aspect, embodiments of the present application disclose a timeliness guarantee device, which includes a processor and a communication interface. The processor is configured to call a computer program stored in a memory to implement the third aspect or any possibility of the third aspect. way of implementation.
第九方面,本申请实施例还提供一种芯片系统,所述芯片系统包括至少一个处理器和通信接口,所述通信接口用于发送和/或接收数据,所述至少一个处理器用于调用至少一个存储器中存储的计算机程序,以使得所述芯片系统所在的装置实现第一方面或者第一方面的任意一种可能的实施方式所描述的方法;又或者实现第二方面或者第二方面的任意一种可能的实施方式所描述的方法;又或者实现第三方面或者第三方面的任意一种可能的实施方式所描述的方法。In a ninth aspect, embodiments of the present application further provide a chip system. The chip system includes at least one processor and a communication interface. The communication interface is used to send and/or receive data. The at least one processor is used to call at least A computer program stored in a memory, so that the device where the chip system is located implements the first aspect or the method described in any possible implementation of the first aspect; or implements the second aspect or any of the second aspects The method described in one possible implementation manner; or the method described in any possible implementation manner of implementing the third aspect or the third aspect.
第十方面,本申请实施例还提供一种通信系统,包括接收端、网络设备和发送端。其中,所述网络设备用于实现第一方面或者第一方面的任意一种可能的实施方式所描述的方法;所述发送端实现第一方面或者第一方面的任意一种可能的实施方式所描述的方法;所述接收端用于实现第一方面或者第一方面的任意一种可能的实施方式所描述的方法。In a tenth aspect, embodiments of the present application further provide a communication system, including a receiving end, a network device, and a sending end. Wherein, the network device is used to implement the method described in the first aspect or any possible implementation manner of the first aspect; and the sending end implements the method described in the first aspect or any possible implementation manner of the first aspect. The described method; the receiving end is used to implement the method described in the first aspect or any possible implementation manner of the first aspect.
第十一方面,本申请实施例公开了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,当所述计算机程序在一个或多个处理器上运行时,执行第一方面或第一方面的任意一种可能的实施方式所描述的方法,又或者执行第二方面或第二方面的任意一种可能的实施方式所描述的方法;又或者实现第三方面或者第三方面的任意一种可能的实施方式所描述的方法。In an eleventh aspect, embodiments of the present application disclose a computer-readable storage medium. A computer program is stored in the computer-readable storage medium. When the computer program is run on one or more processors, the first step is executed. The method described in one aspect or any possible implementation of the first aspect, or the method described in the second aspect or any possible implementation of the second aspect, or the implementation of the third aspect or the method described in any possible implementation of the second aspect. The method described in any possible implementation manner of the three aspects.
第十二方面,本申请实施例公开了一种计算机程序产品,当所述计算机程序产品在一个或多个处理器上运行时,执行第一方面或第一方面的任意一种可能的实施方式所描述的方法,又或者执行第二方面或第二方面的任意一种可能的实施方式所描述的方法;又或者实现第三方面或者第三方面的任意一种可能的实施方式所描述的方法。In a twelfth aspect, the embodiment of the present application discloses a computer program product. When the computer program product is run on one or more processors, it executes the first aspect or any possible implementation manner of the first aspect. The described method, or perform the second aspect or the method described in any possible implementation manner of the second aspect; or implement the third aspect or the method described in any possible implementation manner of the third aspect .
以下对本申请实施例用到的附图进行介绍。The drawings used in the embodiments of this application are introduced below.
图1是本申请实施例提供的一种现有技术中保证消息时效的方法示意图;Figure 1 is a schematic diagram of a method for ensuring message timeliness in the prior art provided by an embodiment of the present application;
图2A是本申请实施例提供的一种可能的通信系统的示意图;Figure 2A is a schematic diagram of a possible communication system provided by an embodiment of the present application;
图2B是本申请实施例提供的另一种可能的通信系统的示意图;
Figure 2B is a schematic diagram of another possible communication system provided by an embodiment of the present application;
图2C是本申请实施例提供的又一种可能的通信系统的示意图;Figure 2C is a schematic diagram of another possible communication system provided by an embodiment of the present application;
图3是本申请实施例提供的再一种可能的通信系统的示意图;Figure 3 is a schematic diagram of yet another possible communication system provided by an embodiment of the present application;
图4是本申请实施例提供的一种时效保证方法的流程示意图;Figure 4 is a schematic flowchart of an aging guarantee method provided by an embodiment of the present application;
图5是本申请实施例提供的一种网络设备更新时效信息的流程示意图;Figure 5 is a schematic flowchart of a network device updating aging information provided by an embodiment of the present application;
图6A是本申请实施例提供的另一种时效保证方法的流程示意图;Figure 6A is a schematic flowchart of another timeliness guarantee method provided by an embodiment of the present application;
图6B是本申请实施例提供的一种网络设备对请求消息进行时效更新的方法流程图;Figure 6B is a flow chart of a method for updating the request message by a network device according to an embodiment of the present application;
图7是本申请实施例提供的一种时效保证方法的具体实现的示意图;Figure 7 is a schematic diagram of the specific implementation of an aging guarantee method provided by an embodiment of the present application;
图8是本申请实施例提供的又一种时效保证方法的流程图;Figure 8 is a flow chart of yet another timeliness guarantee method provided by an embodiment of the present application;
图9是本申请实施例提供的一种响应消息传输过程的流程示意图;Figure 9 is a schematic flowchart of a response message transmission process provided by an embodiment of the present application;
图10是本申请实施例提供的一种查询方法的流程示意图;Figure 10 is a schematic flowchart of a query method provided by an embodiment of the present application;
图11是本申请实施例提供的一种就近响应的场景图;Figure 11 is a scene diagram of a nearby response provided by an embodiment of the present application;
图12是本申请实施例提供的一种时效保证装置120的结构示意图;Figure 12 is a schematic structural diagram of an aging guarantee device 120 provided by an embodiment of the present application;
图13是本申请实施例提供的一种时效保证装置130的结构示意图;Figure 13 is a schematic structural diagram of an aging guarantee device 130 provided by an embodiment of the present application;
图14是本申请实施例提供的一种时效保证装置140的结构示意图。Figure 14 is a schematic structural diagram of an aging guarantee device 140 provided by an embodiment of the present application.
下面结合本申请实施例中的附图对本申请实施例进行描述。需要说明的是,本申请中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其他实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。The embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. It should be noted that in this application, words such as “exemplary” or “for example” are used to represent examples, illustrations or explanations. Any embodiment or design described herein as "exemplary" or "such as" is not intended to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the words "exemplary" or "such as" is intended to present the concept in a concrete manner.
本申请中实施例提到的“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a、b、或c中的至少一项(个),可以表示:a、b、c、(a和b)、(a和c)、(b和c)、或(a和b和c),其中a、b、c可以是单个,也可以是多个。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A、同时存在A和B、单独存在B这三种情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。"At least one" mentioned in the embodiments of this application means one or more, and "multiple" means two or more. "At least one of the following" or similar expressions thereof refers to any combination of these items, including any combination of a single item (items) or a plurality of items (items). For example, at least one of a, b, or c can represent: a, b, c, (a and b), (a and c), (b and c), or (a and b and c), where a, b, c can be single or multiple. "And/or" describes the relationship between related objects, indicating that there can be three relationships. For example, A and/or B can mean: A alone exists, A and B exist simultaneously, and B exists alone, where A and B can be singular or plural. The character "/" generally indicates that the related objects are in an "or" relationship.
以及,除非有相反的说明,本申请实施例使用“第一”、“第二”等序数词是用于对多个对象进行区分,不用于限定多个对象的顺序、时序、优先级或者重要程度。例如,第一信息和第二信息,只是为了区分不同的信息,而并不是表示这两种信息的内容、优先级、发送顺序或者重要程度等的不同。And, unless otherwise stated, the use of ordinal numbers such as "first" and "second" in the embodiments of this application is used to distinguish multiple objects and is not used to limit the order, timing, priority or importance of multiple objects. degree. For example, the first information and the second information are only used to distinguish different information, but do not indicate the difference in content, priority, sending order or importance of the two types of information.
在介绍本申请实施例之前,先对本申请实施例中出现的技术术语进行介绍。Before introducing the embodiments of the present application, technical terms appearing in the embodiments of the present application are first introduced.
1、工业协议(Industrial Protocol,IP)/工业以太网(Industrial Ethernet),应用于工业控制领域的以太网技术。1. Industrial Protocol (IP)/Industrial Ethernet (Industrial Ethernet), Ethernet technology used in the field of industrial control.
2、可编程逻辑控制器(Programmable Logic Controller,PLC),是一种专门为在工业环境下应用而设计的数字运算操作的电子装置。2. Programmable Logic Controller (PLC) is an electronic device for digital operation specially designed for application in industrial environments.
3、执行器(Actuator),可以接收控制器下发的指令并执行相应的生产动作。3. Actuator can receive instructions issued by the controller and execute corresponding production actions.
以下结合图1,介绍现有技术中工业以太网为保证消息时效的方法。
In the following, combined with Figure 1, the existing technology method for ensuring message timeliness in industrial Ethernet is introduced.
请参见图1,图1是本申请实施例示例性提供的一种现有的工业以太网部署示意图。如图1所示,该工业以太网包括请求方、N个工业网关、响应方和时钟服务器,其中,N为正整数;该时钟服务器可以为高精度时间同步服务器,请求方可以为PLC控制器,响应方为Actuator执行器。Please refer to Figure 1. Figure 1 is a schematic diagram of an existing industrial Ethernet deployment provided by an exemplary embodiment of the present application. As shown in Figure 1, the industrial Ethernet includes a requester, N industrial gateways, a responder and a clock server, where N is a positive integer; the clock server can be a high-precision time synchronization server, and the requester can be a PLC controller , the responder is the Actuator.
在一种实现中,请求方和响应方通可以过时钟同步算法保证双方系统时间与该高精度时钟服务器时间一致。请参见图1,请求方可以向响应方发送查询指令或控制指令,其中,查询指令或控制指令中包括时间戳信息;响应方可以根据上述指令中的时间戳和系统时间,判断该指令是否满足时效要求,从而确定是否需要执行该指令;响应方可以向在接收到查询指令后,向请求方发送响应消息。In one implementation, the requester and responder can use a clock synchronization algorithm to ensure that the system time of both parties is consistent with the high-precision clock server time. Please refer to Figure 1. The requester can send a query instruction or a control instruction to the responder. The query instruction or control instruction includes timestamp information; the responder can determine whether the instruction satisfies the requirements based on the timestamp and system time in the above instruction. Timeliness requirements to determine whether the instruction needs to be executed; the responder can send a response message to the requester after receiving the query instruction.
本申请的发明人发现该方法中,网络内需要部署高精度时间同步服务器,存在部署成本。The inventor of this application found that in this method, a high-precision time synchronization server needs to be deployed in the network, which involves deployment costs.
因此,本申请实施例提出了一种时效保证方法、设备和系统,该方法通过网络设备更新指令中的时效信息,响应方在接收到该指令时可以基于该指令中的剩余时效确定是否需要执行该指令。该方法不需要部署高精度时间同步服务器。Therefore, embodiments of the present application propose an aging guarantee method, device and system. This method updates the aging information in the instruction through the network device. When receiving the instruction, the responder can determine whether execution needs to be performed based on the remaining aging in the instruction. this directive. This method does not require the deployment of a high-precision time synchronization server.
下面对本申请实施例的系统架构和业务场景进行描述。需要说明的是,本申请描述的系统架构及业务场景是为了更加清楚的说明本申请的技术方案,并不构成对于本申请提供的技术方案的限定,本领域普通技术人员可知,随着系统架构的演变和新业务场景的出现,本申请提供的技术方案对于类似的技术问题,同样适用。The system architecture and business scenarios of the embodiments of this application are described below. It should be noted that the system architecture and business scenarios described in this application are for the purpose of explaining the technical solution of this application more clearly and do not constitute a limitation on the technical solution provided by this application. Those of ordinary skill in the art will know that with the system architecture With the evolution of the Internet and the emergence of new business scenarios, the technical solutions provided in this application are also applicable to similar technical problems.
请参见图2A,图2A是本申请实施例提供的一种可能的通信系统的示意图,该通信系统10包括请求方101、网络设备102和响应方103。其中:Please refer to Figure 2A. Figure 2A is a schematic diagram of a possible communication system provided by an embodiment of the present application. The communication system 10 includes a requester 101, a network device 102 and a responder 103. in:
如图2A所示,请求方101经网络设备102与响应方103相连。例如,请求方101向网络设备102发送请求消息,该请求消息可以包括查询指令或控制指令;网络设备102将该请求消息发送至响应方103。又例如,响应方103可以向网络设备102发送主动通知消息或响应消息,网络设备102再将主动通知消息或响应消息发送至请求方101。可以理解的,可以是请求方101为发送端,响应方103可以为接收端;也可以是响应方103为发送端,请求方101为接收端,可以根据具体场景确定。As shown in Figure 2A, the requester 101 is connected to the responder 103 via the network device 102. For example, the requester 101 sends a request message to the network device 102, and the request message may include a query instruction or a control instruction; the network device 102 sends the request message to the responder 103. For another example, the responder 103 may send an active notification message or a response message to the network device 102, and the network device 102 then sends the active notification message or response message to the requesting party 101. It can be understood that the requester 101 can be the sender and the responder 103 can be the receiver; or the responder 103 can be the sender and the requester 101 can be the receiver, which can be determined according to specific scenarios.
其中,请求方101可以包括至少一个请求方;网络设备102可以包括至少一个网络设备,网络设备可以为网关、交换机或网桥等。其中,请求方101可以为控制器,响应方103可以为执行器,此处仅为示例,不应造成对请求方101和响应方103的限定,在不同的应用场景中,发送端301和接收端302可以为不同的设备,此处不做限定。Among them, the requester 101 may include at least one requester; the network device 102 may include at least one network device, and the network device may be a gateway, a switch, a network bridge, etc. Among them, the requester 101 can be a controller, and the responder 103 can be an executor. This is only an example and should not limit the requester 101 and the responder 103. In different application scenarios, the sender 301 and the receiver The terminal 302 can be different devices, which are not limited here.
需要说明的是,在多个请求方和多个网络设备的情况下,请求方可以经多个网络设备中的部分网络设备与响应方进行通信连接;不同的请求方可以经相同的网络设备与响应方进行通信连接,也可以经不同的网络设备与响应方建立通信连接,此处不做限定。It should be noted that in the case of multiple requesters and multiple network devices, the requester can communicate with the responder through some of the multiple network devices; different requesters can communicate with the responder through the same network device. The responder makes a communication connection or can establish a communication connection with the responder through different network devices, which is not limited here.
请参见图2B,图2B是本申请实施例提供的另一种可能的通信系统的示意图。图2B示例性的示出了该通信系统20包括请求方、n个网络设备和响应方,其中,请求方包括请求方1和请求方2;n个网络设备分别为网络设备1、网络设备2直至网络设备n,n为大于2的正整数。其中,其中,请求方1与网络设备1建立通信连接,请求方1分别经网络设备1、网络设备2至网络设备n等n个网络设备与响应方相连;请求方2与网络设备2建立通信连接,请求方2分别经网络设备2至网络设备n等n-1个网络设备与响应方相连。Please refer to Figure 2B, which is a schematic diagram of another possible communication system provided by an embodiment of the present application. FIG. 2B exemplarily shows that the communication system 20 includes a requester, n network devices and a responder, where the requester includes requester 1 and requester 2; the n network devices are network device 1 and network device 2 respectively. Until network device n, n is a positive integer greater than 2. Among them, requester 1 establishes a communication connection with network device 1, and requester 1 is connected to the responder through n network devices such as network device 1, network device 2, and network device n; requester 2 establishes communication with network device 2. Connection, requester 2 is connected to the responder via n-1 network devices from network device 2 to network device n.
其中,请求方101、网络设备102和响应方103之间通信的链路可以包括各种类型的连接介质,包括有线链路(例如光纤)、无线链路、或者有线链路和无线链路的组合等。例如可
以为近距离连接技术包括802.11b/g、蓝牙(blue tooth)、紫蜂(Zigbee)、无线射频识别技术(radio frequency identification,RFID)、超宽带(ultra wideband,UWB)技术、无线短距通信系统(例如车载无线短距通信系统)等,再如还可以为远距离连接技术包括基于长期演进(Long Term Evolution,长期演进)的通信技术、第五代移动通信技术(5th generation mobile networks或5th generation wireless systems、5th-Generation,简称5G或5G技术)、全球移动通信系统(global System for mobile communications,GSM)、通用分组无线业务(general packet radio Service,GPRS)、通用移动通信系统(universal mobile telecommunications system,UMTS)等无线接入类型技术。Wherein, the communication link between the requester 101, the network device 102 and the responder 103 may include various types of connection media, including wired links (such as optical fibers), wireless links, or a combination of wired links and wireless links. Combination etc. For example, you can It is believed that short-range connection technologies include 802.11b/g, Bluetooth (blue tooth), Zigbee, radio frequency identification technology (radio frequency identification, RFID), ultra wideband (UWB) technology, and wireless short-range communication systems (such as vehicle-mounted wireless short-range communication systems), etc., and for example, long-distance connection technologies include communication technologies based on Long Term Evolution (Long Term Evolution), fifth generation mobile communication technologies (5th generation mobile networks or 5th generation wireless systems, 5th-Generation (referred to as 5G or 5G technology), global system for mobile communications (GSM), general packet radio service (GPRS), universal mobile telecommunications system , UMTS) and other wireless access type technologies.
当然,还有其他无线通信技术可以用于支撑本申请提供的通信系统中各网元或设备进行通信。Of course, there are other wireless communication technologies that can be used to support communication between network elements or devices in the communication system provided by this application.
需要说明的是,上述通信系统上还可以包括其它网元或设备,此处不作限定。It should be noted that the above communication system may also include other network elements or devices, which are not limited here.
请参见图2C,图2C是本申请实施例提供的又一种可能的通信系统的示意图。Please refer to Figure 2C, which is a schematic diagram of another possible communication system provided by an embodiment of the present application.
如图2C所示,该通信系统30仅包括发送端301和接收端302,发送端301可以包括一个或多个发送端。其中:As shown in FIG. 2C , the communication system 30 only includes a sending end 301 and a receiving end 302. The sending end 301 may include one or more sending ends. in:
发送端301用于向接收端302发送数据帧,该数据帧包括时效信息,数据帧的时效信息用于指示数据帧的剩余时效;接收端302用于基于接收端302的链路层接收数据帧的起始时刻和链路层接收数据帧的终止时刻,得到链路时延,再基于链路时延和接收处理时延,更新数据帧的剩余时效。The sending end 301 is used to send a data frame to the receiving end 302. The data frame includes aging information, and the aging information of the data frame is used to indicate the remaining aging of the data frame; the receiving end 302 is used to receive the data frame based on the link layer of the receiving end 302. The start time and the end time of the link layer receiving the data frame are obtained to obtain the link delay, and then based on the link delay and the reception processing delay, the remaining timeliness of the data frame is updated.
进一步的,接收端302还可以基于更新后的剩余时效确定该数据帧是否有效,例如该数据帧包括查询指令或控制指令,接收端在确定数据帧有效时,可以执行该查询指令或控制指令;在确定该数据帧无效时,可以执行丢弃该数据帧或向发送端回复错误码等操作。Further, the receiving end 302 can also determine whether the data frame is valid based on the updated remaining timeliness. For example, the data frame includes a query instruction or a control instruction. When the receiving end determines that the data frame is valid, the receiving end can execute the query instruction or control instruction; When it is determined that the data frame is invalid, operations such as discarding the data frame or replying an error code to the sending end can be performed.
在一些实施例中,数据帧承载请求消息,请求消息包括查询指令或控制指令,则接收端302可以基于更新后的剩余时效和预设阈值确定请求消息是否有效,在确定该请求消息有效时,执行查询指令或控制指令。In some embodiments, the data frame carries a request message, and the request message includes a query instruction or a control instruction. Then the receiving end 302 can determine whether the request message is valid based on the updated remaining time limit and the preset threshold. When determining that the request message is valid, Execute query instructions or control instructions.
其中,发送端301可以为上述请求方,则接收端302为上述响应方;或者,发送端301为上述响应方,则接收端302为上述请求方。其中,请求方可以为控制器,响应方可以为执行器,此处仅为示例,不应造成对发送端301和接收端302的限定,在不同的应用场景中,发送端301和接收端302可以为不同的设备,此处不做限定。Among them, the sending end 301 can be the above-mentioned requester, and the receiving end 302 can be the above-mentioned responder; or, the sending end 301 can be the above-mentioned responder, and then the receiving end 302 can be the above-mentioned requester. Among them, the requester can be a controller and the responder can be an executor. This is only an example and should not limit the sending end 301 and the receiving end 302. In different application scenarios, the sending end 301 and the receiving end 302 It can be different devices and is not limited here.
下面以工业以太网环境为例,对上述通信系统做进一步的介绍。The following takes the industrial Ethernet environment as an example to further introduce the above communication system.
请参见图3,图3是本申请实施例提供的再一种可能的通信系统的示意图,该通信系统包括N个请求方、N个网络设备和响应方,其中,N为正整数。需要说明的是,其他实施例中,请求方的个数与网络设备的个数可以相同,也可以不同,据实际情况而定,此处N仅为示例,不应造成请求方的个数与网络设备的个数的限定。其中:Please refer to Figure 3. Figure 3 is a schematic diagram of yet another possible communication system provided by an embodiment of the present application. The communication system includes N requesters, N network devices and responders, where N is a positive integer. It should be noted that in other embodiments, the number of requesters and the number of network devices may be the same or different, depending on the actual situation. N here is only an example and should not cause the number of requesters to be different from the number of network devices. Limitation on the number of network devices. in:
如图3所示,图3示例性示出了工业以太网内请求方与响应方之间的查询、控制场景,其中,工业以太网内多个请求方经一个或多个网络设备与响应方相连。图3示例性的画出了请求方-1,请求方-2和请求方-N,以及网络设备1和网络设备N,其中,请求方-1和请求方-2均与网络设备1建立通信连接,请求方-N与网络设备N建立通信连接。其中,网络设备可以用于对接收到的信息进行缓存,例如缓存响应消息;以及对接收到信息进行时效管理,即更新消息中的时效信息;还可以消息进行转发调度,例如基于时效优先转发某消息。
As shown in Figure 3, Figure 3 exemplarily shows the query and control scenario between the requester and the responder in the industrial Ethernet, where multiple requesters in the industrial Ethernet communicate with the responder via one or more network devices. connected. Figure 3 exemplarily shows Requester-1, Requester-2 and Requestor-N, as well as Network Device 1 and Network Device N, where Requester-1 and Requester-2 both establish communication with Network Device 1 Connection, the requester-N establishes a communication connection with the network device N. Among them, the network device can be used to cache the received information, such as caching the response message; and to perform timeliness management on the received information, that is, to update the timeliness information in the message; and can also perform message forwarding scheduling, such as forwarding a certain message based on timeliness priority. information.
以请求方-1为例,请求方-1可以向网络设备1发送查询指令和/或控制指令,进而,该指令经过其他网络设备后到达响应方,其中,N个网络设备可以对接收到的指令中的时效信息进行更新;响应方在接收到该指令后,可以基于经N个网络设备动态更新后的时效信息确定是否执行该指令;响应方还可以将该指令对应的响应消息通过其他网络设备发送至网络设备1,进而,网络设备1将将响应消息发送至请求方-1,其中,N个网络设备可以对接收到的响应消息中的时效信息进行更新;N个网络设备可以缓存接收到的响应消息。Taking requester-1 as an example, requester-1 can send query instructions and/or control instructions to network device 1, and then the instructions reach the responder after passing through other network devices. Among them, N network devices can respond to the received The aging information in the instruction is updated; after receiving the instruction, the responder can determine whether to execute the instruction based on the aging information dynamically updated by N network devices; the responder can also send the response message corresponding to the instruction through other networks. The device sends it to network device 1, and then network device 1 will send the response message to requester-1. Among them, N network devices can update the timeliness information in the received response message; N network devices can cache the reception response message received.
在网络设备缓存了接收到响应消息后,其他请求方在经网络设备向响应方请求该响应消息时,其他请求方就近的网络设备可以将缓存的响应消息发送至该请求方。例如,请求方-2可以向网络设备2发送查询指令和/或控制指令,网络设备2在查询到存储中有该指令对应的响应消息,并确定该响应消息未超过时效时,可以将将响应消息发送至请求方-2。After the network device caches the received response message, when other requesters request the response message from the responder through the network device, the network device nearby the other requester can send the cached response message to the requester. For example, the requester-2 can send a query instruction and/or a control instruction to the network device 2. After the network device 2 queries that there is a response message corresponding to the instruction in the storage and determines that the response message has not expired, the network device 2 can send the response message. The message is sent to requester-2.
关于N个请求方、N个网络设备和响应方之间的通信关系以及时效更新等实现可以具体参见下文中的相关描述,此处不再展开。Regarding the communication relationship between N requesters, N network devices and responders, as well as the implementation of timeliness update, please refer to the relevant description below for details, which will not be elaborated here.
如图3所示,图3示例性示出了网络设备中的功能单元,如信息缓存单元、时效管理单元和转发单元。其中,信息缓存单元用于缓存请求方从响应方查询得到的信息结果;时效管理单元用于实时更新请求、响应消息得时效信息;转发单元可根据信息或指令的实时性、可靠性要求等决策请求、响应消息优先转发、普通转发或丢弃。As shown in Figure 3, Figure 3 exemplarily shows functional units in a network device, such as an information caching unit, an aging management unit, and a forwarding unit. Among them, the information cache unit is used to cache the information results obtained by the requester from the responder's query; the timeliness management unit is used to update the timeliness information of requests and response messages in real time; the forwarding unit can make decisions based on the real-time and reliability requirements of the information or instructions. Request and response messages are forwarded first, forwarded normally or discarded.
关于网络设备中的功能单元的具体描述可以具体参见下文中的相关描述,此处不再展开。For a detailed description of the functional units in the network device, please refer to the relevant description below and will not be elaborated here.
需要说明的是,网络设备还可以包括图3中或多或少的功能单元,此处不作限定。It should be noted that the network device may also include more or less functional units as shown in Figure 3, which is not limited here.
请参见图4,图4是本申请实施例提供的一种时效保证方法的流程示意图。进一步的,该方法可以基于图1、图2A或图2B所示的架构来实现。该方法可以包括以下部分或全部步骤:Please refer to Figure 4. Figure 4 is a schematic flowchart of an aging guarantee method provided by an embodiment of the present application. Further, the method can be implemented based on the architecture shown in Figure 1, Figure 2A or Figure 2B. The method may include some or all of the following steps:
步骤S401:发送端向接收端发送数据帧,数据帧包括时效信息,数据帧的时效信息用于指示数据帧的剩余时效。Step S401: The sending end sends a data frame to the receiving end. The data frame includes aging information. The aging information of the data frame is used to indicate the remaining aging of the data frame.
其中,数据帧可以承载请求消息、响应消息和主动通知消息中的任一种;请求消息可以包括查询指令或控制指令,响应消息可以为响应于查询指令或控制指令生成的回复消息,主动通知消息为发送端自动发送至接收端的消息,例如按照预设规则定时发送的通知消息等。Among them, the data frame can carry any one of the request message, response message and active notification message; the request message can include a query instruction or a control instruction, the response message can be a reply message generated in response to the query instruction or control instruction, and the active notification message It is a message automatically sent by the sender to the receiver, such as notification messages sent regularly according to preset rules.
步骤S402:接收端基于接收端的链路层接收数据帧的起始时刻和链路层接收数据帧的终止时刻,得到链路时延。Step S402: The receiving end obtains the link delay based on the starting time of the receiving end's link layer receiving the data frame and the ending time of the link layer receiving the data frame.
在一些实施例中,接收端可以将起始时刻和终止时刻的时间差确定为链路时延,其中,起始时刻可以为接收到数据帧的起始位时的时刻,终止时刻可以为接收到数据帧的终止位的时刻。其中,起始位、终止位遵守数据帧的链路层帧格式定义的起始位编码(前导码或帧起始定界符)和终止编码(帧校验序列FCS)。In some embodiments, the receiving end may determine the time difference between the start time and the end time as the link delay, where the start time may be the time when the start bit of the data frame is received, and the end time may be the time when the start bit of the data frame is received. The moment of the end bit of the data frame. Among them, the start bit and the stop bit comply with the start bit coding (preamble or frame start delimiter) and stop coding (frame check sequence FCS) defined by the link layer frame format of the data frame.
步骤S403:接收端基于链路时延和接收处理时延,更新剩余时效,接收处理时延为链路层接收数据帧后协议栈或应用层接收处理数据帧所需的时间。Step S403: The receiving end updates the remaining aging based on the link delay and the reception processing delay. The reception processing delay is the time required for the protocol stack or the application layer to receive and process the data frame after the link layer receives the data frame.
在一种实现中,接收端可以将数据帧中的剩余时效减去链路时延和接收处理时延,得到更新后的剩余时效。进而,接收端还可以基于更新后的剩余时效,确定该数据帧是否在时效范围内。例如该数据帧包括查询指令或控制指令,接收端在确定数据帧有效时,可以执行该查询指令或控制指令;在确定该数据帧无效时,可以执行丢弃该数据帧或向发送端回复错误码等操作。In one implementation, the receiving end can subtract the link delay and the reception processing delay from the remaining aging in the data frame to obtain the updated remaining aging. Furthermore, the receiving end can also determine whether the data frame is within the time limit based on the updated remaining time limit. For example, the data frame includes a query instruction or a control instruction. When the receiving end determines that the data frame is valid, it can execute the query instruction or control instruction; when it determines that the data frame is invalid, it can discard the data frame or reply an error code to the sending end. Wait for operations.
在一些实施例中,数据帧承载请求消息,请求消息包括查询指令或控制指令,则接收端
可以基于更新后的剩余时效和预设阈值确定请求消息是否有效;进而,在确定该请求消息有效时,执行查询指令或控制指令。In some embodiments, the data frame carries a request message, and the request message includes a query instruction or a control instruction, then the receiving end Whether the request message is valid can be determined based on the updated remaining aging and the preset threshold; further, when it is determined that the request message is valid, the query instruction or the control instruction is executed.
在另一些实施例中,发送端经至少一个网络设备向接收端发送数据帧,则网络设备可以对接收到的数据帧的剩余时效进行动态更新。请参见图5,图5是本申请实施例提供的一种网络设备更新时效信息的流程示意图。该方法包括以下部分或全部步骤:In some other embodiments, the sending end sends the data frame to the receiving end via at least one network device, and the network device can dynamically update the remaining validity of the received data frame. Please refer to Figure 5. Figure 5 is a schematic flowchart of a network device updating aging information provided by an embodiment of the present application. The method includes some or all of the following steps:
步骤S501:网络设备接收数据帧,数据帧包括时效信息,时效信息用于指示数据帧的剩余时效。Step S501: The network device receives a data frame, the data frame includes aging information, and the aging information is used to indicate the remaining aging of the data frame.
其中,数据帧可以承载请求消息、响应消息和主动通知消息中的任一种;请求消息可以包括查询指令或控制指令,响应消息可以为响应于查询指令或控制指令生成的回复消息。The data frame can carry any of a request message, a response message and an active notification message; the request message can include a query instruction or a control instruction, and the response message can be a reply message generated in response to the query instruction or control instruction.
步骤S502:网络设备基于网络设备的链路层接收数据帧的起始时刻和链路层接收数据帧的终止时刻,得到传输时延。Step S502: The network device obtains the transmission delay based on the starting time when the link layer of the network device receives the data frame and the end time when the link layer receives the data frame.
在一些实施例中,传输时延可以为起始时刻和终止时刻的时间差,其中,起始时刻为接收到数据帧的起始位时的时刻,终止时刻为接收到数据帧的终止位的时刻;更新后的数据帧中的剩余时效为数据帧中的剩余时效减去传输时延和整体转发时延的差值。In some embodiments, the transmission delay may be the time difference between the start time and the end time, where the start time is the time when the start bit of the data frame is received, and the end time is the time when the stop bit of the data frame is received. ;The remaining aging in the updated data frame is the remaining aging in the data frame minus the difference between the transmission delay and the overall forwarding delay.
步骤S503:网络设备基于网络设备的协议栈或应用层处理数据帧所需的时间,得到整体转发时延。Step S503: The network device obtains the overall forwarding delay based on the time required for the protocol stack or application layer of the network device to process the data frame.
在一些实施例中,整体转发时延包括接收处理时延和发送处理时延;接收处理时延为链路层接收数据帧后协议栈或应用层接收处理数据帧所需的时间;发送处理时延为链路层发送更新后的数据帧前协议栈或应用层发送处理第一数据帧所需的时间。In some embodiments, the overall forwarding delay includes receiving processing delay and sending processing delay; receiving processing delay is the time required for the protocol stack or application layer to receive and process the data frame after the link layer receives the data frame; sending processing time Delay is the time required for the protocol stack or the application layer to send and process the first data frame before the link layer sends the updated data frame.
其中,接收处理时延具体可以为链路层接收完所述数据帧的时刻至协议栈或应用层将该数据帧解析完成的时刻的时间差;协议栈或应用层接收处理数据帧具体可以包括对该数据帧进行解析等处理;协议栈或应用层发送处理第一数据帧具体可以包括对该数据帧进行封包等处理。The reception and processing delay may specifically be the time difference from the time when the link layer receives the data frame to the time when the protocol stack or application layer completes parsing the data frame; the protocol stack or application layer receiving and processing the data frame may specifically include The data frame is parsed and processed; the protocol stack or the application layer sends and processes the first data frame, which may specifically include packetizing the data frame.
步骤S504:网络设备基于传输时延和整体转发时延,更新时效信息。Step S504: The network device updates the aging information based on the transmission delay and the overall forwarding delay.
在一种实现中,网络设备可以将数据帧的剩余时效更新为第一时效,得到第一数据帧,第一时效为数据帧的剩余时效减去传输时延和接收处理时延的差值,第一数据帧的剩余时效为第一时效;再将第一数据帧的剩余时效更新为第二时效,得到更新后的数据帧,第二时效为第一时效与发送处理时延的差值,更新后的数据帧的剩余时效为第二时效。In one implementation, the network device can update the remaining aging of the data frame to the first aging to obtain the first data frame. The first aging is the remaining aging of the data frame minus the difference between the transmission delay and the reception processing delay. The remaining aging of the first data frame is the first aging; then update the remaining aging of the first data frame to the second aging to obtain the updated data frame. The second aging is the difference between the first aging and the transmission processing delay, The remaining aging of the updated data frame is the second aging.
在一些实施例中,网络设备可以基于第一时效,确定对第一数据帧的处理方式;处理方式包括优先转发、正常转发或丢弃。例如,在确定优先转发该第一数据帧时,优先将该第一数据帧从协议栈或应用层发送至链路层,以使网络设备可以尽快将该第一数据帧发送至下一个网络设备或响应方。In some embodiments, the network device may determine a processing method for the first data frame based on the first timeliness; the processing method includes priority forwarding, normal forwarding, or discarding. For example, when it is determined that the first data frame should be forwarded first, the first data frame should be sent from the protocol stack or application layer to the link layer first, so that the network device can send the first data frame to the next network device as soon as possible. or responding party.
可选地,可以基于数据帧对应的可靠性等级和数据帧对应的实时性等级中的至少一项和第一时效,确定对第一数据帧的处理方式。Optionally, the processing method for the first data frame may be determined based on at least one of the reliability level corresponding to the data frame and the real-time level corresponding to the data frame and the first timeliness.
在另一些实施例中,网络设备还可以存储第一数据帧。例如数据帧为承载响应方响应于第一请求方的查询指令生成的响应消息的数据帧,则网络设备可以存储响应消息。例如,网络设备可以在将数据帧的剩余时效更新为第一时效,得到第一数据帧后,在第一时效和响应消息对应的实时性等级满足缓存决策时,存储第一数据帧。那么,若网络设备接收来自其他请求方的查询指令,而网络设备存储有该查询指令请求的响应消息,则网络设备可以向第二请求方发送响应消息。其中,网络设备存储的可以是第一数据帧,也可以是第一数据帧承载
的响应消息,具体可以是第一数据帧的报文内容,例如请求消息中的查询指令对应的查询内容等。In other embodiments, the network device may also store the first data frame. For example, the data frame is a data frame that carries a response message generated by the responder in response to the query instruction of the first requester, and the network device can store the response message. For example, the network device may update the remaining timeliness of the data frame to the first timeliness and obtain the first data frame, and then store the first data frame when the first timeliness and the real-time level corresponding to the response message satisfy the cache decision. Then, if the network device receives a query instruction from another requester, and the network device stores a response message requested by the query instruction, the network device can send a response message to the second requester. Among them, the network device may store the first data frame, or the first data frame may carry The response message may specifically be the message content of the first data frame, such as the query content corresponding to the query instruction in the request message, etc.
可选地,网络设备可以在确定存储的响应消息有效后,向第二请求方发送该响应消息;在确定该响应消息已经失效时,将该请求消息转发至响应方。例如,网络设备可以获取响应消息对应的第一时效和存储响应消息的时刻;在当前时刻和存储响应消息的时刻的时间差不大于第一时效时,向第二请求方发送响应消息;在当前时刻和存储响应消息的时刻的时间差大于第一时效时,向响应方发送请求消息。Optionally, the network device may send the response message to the second requester after determining that the stored response message is valid; and forward the request message to the responder when determining that the response message has expired. For example, the network device can obtain the first aging corresponding to the response message and the time when the response message is stored; when the time difference between the current time and the time when the response message is stored is not greater than the first aging, send the response message to the second requester; at the current time When the time difference from the time when the response message is stored is greater than the first time limit, a request message is sent to the responder.
步骤S505:网络设备发送更新后的数据帧。Step S505: The network device sends the updated data frame.
在一些实施例中,网络设备在更新数据帧的时效信息后,将该更新后的数据帧转发至下一个网络设备或响应方。In some embodiments, after updating the timeliness information of the data frame, the network device forwards the updated data frame to the next network device or responder.
以上图4和图5所示的方法实施例中包含了很多可能的实现方案,下面结合图6A至图11对其中的部分实现方案进行举例说明,需要说明的是,图6A至图11未解释到的相关概念、操作或者逻辑关系可以参照图4和图5所示实施例中的相应描述。The above method embodiments shown in Figures 4 and 5 include many possible implementation solutions. Some of the implementation solutions are illustrated below with reference to Figures 6A to 11. It should be noted that Figures 6A to 11 are not explained. For related concepts, operations or logical relationships, please refer to the corresponding descriptions in the embodiments shown in Figures 4 and 5.
请参见图6A,图6A是本申请实施例提供的另一种时效保证方法的流程示意图,该方法可以基于图2A所示的架构来实现。该时效保证方法可以包括如下步骤:Please refer to Figure 6A. Figure 6A is a schematic flowchart of another timeliness guarantee method provided by an embodiment of the present application. This method can be implemented based on the architecture shown in Figure 2A. The timeliness guarantee method may include the following steps:
步骤S601:请求方向至少一个网络设备发送请求消息,该请求消息用于请求响应方响应于该请求消息中的控制指令或查询指令,该请求消息包括时效信息,该时效信息用于指示请求消息的剩余时效。Step S601: The requesting party sends a request message to at least one network device. The request message is used to request the responder to respond to the control instruction or query instruction in the request message. The request message includes aging information, and the aging information is used to indicate the request message. Remaining time limit.
其中,该请求消息可以包括查询指令或控制指令。例如,该请求消息包括查询指令或控制指令,以及该指令的时效信息。其中,时效信息可以为用于指示剩余时效的指示信息或数值,例如,时效信息可以为1秒或用于指示1秒的指示信息。The request message may include a query instruction or a control instruction. For example, the request message includes a query instruction or a control instruction, and the timing information of the instruction. The aging information may be indication information or a numerical value used to indicate the remaining aging. For example, the aging information may be 1 second or indication information indicating 1 second.
其中,至少一个网络设备可以为一个或多个网络设备。例如,在至少一个网络设备为一个网络设备时,请求方向至少一个网络设备发送请求消息即是,请求方向该网络设备发送请求消息,该网络设备将该请求消息发送至响应方;在至少一个网络设备为多个网络设备时,请求方向至少一个网络设备发送请求消息即是,请求方向多个网络设备中的一个网络设备发送请求消息,多个网络设备中的网络设备会基于请求方向响应方发送数据的通信链路依次转发该请求消息,直至转发至响应方。Wherein, at least one network device may be one or more network devices. For example, when at least one network device is a network device, the requesting party sends a request message to at least one network device, that is, the requesting party sends a request message to the network device, and the network device sends the request message to the responder; in at least one network When the device is multiple network devices, the requesting direction sends a request message to at least one network device. The requesting direction sends a request message to one network device among the multiple network devices. The network device among the multiple network devices will send a request message to the responder based on the request. The data communication link forwards the request message in sequence until it is forwarded to the responder.
步骤S602:至少一个网络设备中每一个网络设备均对接收到的请求消息中的时效信息进行更新。Step S602: Each network device in at least one network device updates the aging information in the received request message.
假设上述至少一个网络设备中包括网络设备N,以下示例性的以网络设备N为例,介绍网络设备对请求消息进行时效更新的一种具体实现。Assume that the above-mentioned at least one network device includes network device N. The following takes network device N as an example to introduce a specific implementation of the network device's timeliness update of the request message.
请参见图6B,图6B是本申请实施例提供的一种网络设备对请求消息进行时效更新的方法流程图。该方法包括如下部分或全部步骤:Please refer to FIG. 6B. FIG. 6B is a flow chart of a method for a network device to update the timeliness of a request message according to an embodiment of the present application. The method includes some or all of the following steps:
步骤S6021:网络设备N基于接收到的请求消息,计算传输时延和整体转发时延,该整体转发时延包括接收处理时延和发送处理时延。Step S6021: Based on the received request message, network device N calculates the transmission delay and the overall forwarding delay. The overall forwarding delay includes the receiving processing delay and the sending processing delay.
其中,网络设备N可以为与请求方直接通信的第一网络设备,也可以为与请求方间接通信的第二网络设备。如图3所示,假设请求方为请求方-N,则网络设备N为与请求方直接通信的网络设备(即上述第一网络设备),即请求方直接向第一网络设备发送该请求消息;假设请求方为请求方-1,网络设备N为与请求方间接通信的网络设备(即上述第二网络设备)。The network device N may be a first network device that directly communicates with the requesting party, or may be a second network device that communicates with the requesting party indirectly. As shown in Figure 3, assuming that the requesting party is requesting party-N, then network device N is a network device that directly communicates with the requesting party (that is, the above-mentioned first network device), that is, the requesting party directly sends the request message to the first network device. ; Assume that the requesting party is requesting party-1, and the network device N is a network device that indirectly communicates with the requesting party (ie, the above-mentioned second network device).
在一些实施例中,考虑到工业以太网场景,请求方与响应方部署位置相近,指令的数据
帧在网络设备间的传输时延,可等价为网元接收端口接收数据帧的起始位时刻Ts和终止位时刻Te的时间差ΔTt=Te–Ts;数据帧在网络设备内的转发时延,可分为两部分,接收处理时延ΔTp=T–Te和发送处理时延ΔTp’=Ts'–T,其中Ts’为发送端口发送指令的数据帧的起始位的时刻,整体转发时延可表示为ΔTf=ΔTp+ΔTp’。其中,处理时刻T为数据帧在协议栈或应用层处理完成的时刻,具体处理可以为解析该数据帧等操作。In some embodiments, considering the industrial Ethernet scenario, the requester and the responder are deployed close to each other, and the data of the instruction The transmission delay of frames between network devices can be equivalent to the time difference between the start bit time Ts and the end bit time Te of the network element receiving port receiving the data frame ΔTt = Te – Ts; the forwarding delay of the data frame within the network device , can be divided into two parts, the receiving processing delay ΔTp = T – Te and the sending processing delay ΔTp’ = Ts’ – T, where Ts’ is the time when the sending port sends the starting bit of the data frame of the instruction, and the overall forwarding time It can be expressed as ΔTf=ΔTp+ΔTp'. The processing time T is the time when the data frame is processed in the protocol stack or application layer. The specific processing may include operations such as parsing the data frame.
需要说明的是,上述传输时延也可以称为链路时延,为方便表述,以下均称为传输时延。It should be noted that the above-mentioned transmission delay can also be called link delay. For convenience of description, it is referred to as transmission delay below.
步骤S6022:网络设备N基于传输时延和接收处理时延,计算第一时效Pn。Step S6022: Network device N calculates the first aging Pn based on the transmission delay and the reception processing delay.
在一些实施例中,网络设备N可以将接收到的请求消息中的剩余时效减去传输时延和接收处理时延,得到第一时效。In some embodiments, network device N may subtract the transmission delay and the reception processing delay from the remaining timeliness in the received request message to obtain the first timeliness.
步骤S6023:网络设备N将请求消息中的剩余时效更新为第一时效Pn,得到缓存消息。Step S6023: Network device N updates the remaining aging in the request message to the first aging Pn, and obtains the cached message.
在一些实施例中,网络设备N可以将请求消息中的剩余时效更新为第一时效Pn,得到缓存消息。In some embodiments, network device N may update the remaining age in the request message to the first age Pn to obtain the cached message.
步骤S6024:网络设备N基于第一时效Pn、实时性要求和可靠性要求,加速转发、正常转发或丢弃该缓存消息。Step S6024: Network device N accelerates forwarding, normally forwards, or discards the cached message based on the first timeliness Pn, real-time requirements, and reliability requirements.
其中,网络设备N加速转发、正常转发该缓存消息具体可以是指,网络设备N在将缓存消息从协议栈或应用层发送至链路层的过程中加速转发或正常转发该缓存消息。The network device N accelerates forwarding or normally forwards the cached message. Specifically, the network device N accelerates forwarding or normally forwards the cached message in the process of sending the cached message from the protocol stack or application layer to the link layer.
例如,正常转发是将发送队列中的消息按照从前到后的排列顺序从协议栈或应用层发送至链路层;假设在发送队列中存在若干个消息位于缓存消息前面,则正常转发是,网络设备依次将若干个消息从协议栈或应用层发送至链路层,再将该缓存消息从协议栈或应用层发送至链路层;而优先转发是先将该缓存消息从协议栈或应用层发送至链路层,再依次将若干个消息从协议栈或应用层发送至链路层。For example, normal forwarding is to send the messages in the sending queue from the protocol stack or application layer to the link layer in order from front to back; assuming that there are several messages in the sending queue in front of the cached message, then normal forwarding is, the network The device sequentially sends several messages from the protocol stack or application layer to the link layer, and then sends the cached message from the protocol stack or application layer to the link layer; priority forwarding is to first send the cached message from the protocol stack or application layer Send to the link layer, and then send several messages from the protocol stack or application layer to the link layer in turn.
在一种实现中,网络设备N可以基于Pn结合指令的实时性要求R、可靠性要求R’计算消息的优先等级Q=f(Pn|R|R’),当Q>Qhigh则进行高优先级转发、Qhigh≥Q≥Qdrop则进行普通转发,或者Q<Qdrop则丢弃该消息。其中,Qhigh和Qdrop可以为预设阈值,Q=f(Pn|R|R’)为预设函数。In one implementation, the network device N can calculate the priority level Q=f(Pn|R|R') of the message based on Pn combined with the real-time requirement R and reliability requirement R' of the instruction. When Q>Qhigh, high priority is given. Level forwarding, Qhigh≥Q≥Qdrop means normal forwarding, or Q<Qdrop means discarding the message. Among them, Qhigh and Qdrop can be preset thresholds, and Q=f(Pn|R|R') is a preset function.
步骤S6025:网络设备N将该缓存消息中的剩余时效更新为第二时效P'n,得到更新后的请求消息,该第二时效为第一时效减去发送处理时延得到的时间段。Step S6025: Network device N updates the remaining aging in the cached message to the second aging P'n to obtain the updated request message. The second aging is the time period obtained by subtracting the transmission processing delay from the first aging.
在一种实现中,网络设备在链路层接收到该缓存消息,在链路层汇总中将该缓存消息中剩余时效更新为第二时效P'n。其中,第二时效为第一时效减去发送处理时延得到的时间段。In one implementation, the network device receives the cached message at the link layer, and updates the remaining aging in the cached message to the second aging P'n in the link layer summary. The second aging is the time period obtained by subtracting the transmission processing delay from the first aging.
步骤S6026:网络设备N将更新后的请求消息转发至下一个网络设备或响应方。Step S6026: Network device N forwards the updated request message to the next network device or responder.
其中,下一个网络设备是指请求方至响应方的通信连路上网络设备N的下一个网络设备。例如请求方向响应方发送消息,需要由请求方发送至网络设备N,网络设备N转发至网络设备N+1,再由网络设备N+1发送至响应方,则网络设备的下一个网络设备是指网络设备N+1。The next network device refers to the network device next to the network device N on the communication link from the requester to the responder. For example, when the requester sends a message to the responder, it needs to be sent by the requester to network device N, which is forwarded to network device N+1, and then sent by network device N+1 to the responder. Then the next network device of the network device is Refers to network device N+1.
步骤S603:至少一个网络设备将更新后的请求消息发送至响应方。Step S603: At least one network device sends the updated request message to the responder.
在一些实施例中,至少一个网络设备中每一个网络设备更新接收到的请求消息中剩余时效,将经所有网络设备更新时效后的请求消息发送至响应方。In some embodiments, each network device in at least one network device updates the remaining aging in the received request message, and sends the request message after all network devices have updated the aging to the responder.
假设,请求方的请求消息经两个网络设备后发送至响应方,该请求消息中的初始剩余时效为T1;第一个网络设备接收到请求方发送的请求消息后,将该请求消息的剩余时效更新为T2,T2为T1减去第一个网络设备计算的传输时延和整体转发时延;第二个网络设备在接收到第一网络设备发送的请求消息后,将该请求消息的剩余时效更新为T3,T3为T2减去第二个网络设备计算的传输时延和整体转发时延;最后,第二个网络设备将更新后的请求消息发
送至响应方,响应方接收到该请求消息的剩余时效为T3,响应方可以基于T3确定该请求消息是否符合时效。其中,T1、T2、T3均为正数。可以理解的,T1>T2>T3。Assume that the request message from the requester is sent to the responder after passing through two network devices, and the initial remaining time limit in the request message is T1; after the first network device receives the request message sent by the requester, it sends the remaining time limit of the request message to the responder. The time limit is updated to T2, which is T1 minus the transmission delay and overall forwarding delay calculated by the first network device; after receiving the request message sent by the first network device, the second network device transfers the remainder of the request message. The timeliness is updated to T3, which is T2 minus the transmission delay calculated by the second network device and the overall forwarding delay; finally, the second network device sends the updated request message. Sent to the responder, the remaining time limit for the responder to receive the request message is T3, and the responder can determine whether the request message meets the time limit based on T3. Among them, T1, T2, and T3 are all positive numbers. It is understandable that T1>T2>T3.
步骤S604:响应方响应于接收到的请求消息,向至少一个网络设备发送响应消息,该响应消息包括时效信息,该时效信息用于指示该响应消息的剩余时效。Step S604: In response to the received request message, the responder sends a response message to at least one network device. The response message includes aging information, and the aging information is used to indicate the remaining aging of the response message.
其中,该请求消息包括查询指令或控制指令,以及指令的时效信息;则响应方在接收到该请求后,可以先基于时效信息确定该指令是否有效,在指令有效时执行该指令,并生成该指令对应的响应消息。The request message includes a query instruction or a control instruction, as well as the instruction's aging information; after receiving the request, the responder can first determine whether the instruction is valid based on the aging information, execute the instruction when it is valid, and generate the The response message corresponding to the command.
例如,响应方在查询指令有效时,可以响应于该查询指令进行查询,得到查询信息;进而,生成响应消息,该响应消息包括查询信息。又例如,响应方在控制指令有效时,可以响应于该指令进行控制操作;还可以生成响应消息,该响应消息包括控制结果或控制参数等消息。For example, when the query instruction is valid, the responder can perform a query in response to the query instruction and obtain the query information; and then generate a response message, which includes the query information. For another example, when the control instruction is valid, the responder can perform control operations in response to the instruction; it can also generate a response message, which includes control results or control parameters.
其中,响应方可以基于时效信息判断该请求消息是否有效,关于判定方法此处不作限定。例如,响应方可以在该消息的剩余时效小于0时,确定该消息已失效;又或者在该消息的剩余时效小于预设阈值时,确定该消息已失效。可以理解的,本申请实施例中,响应方不需要与请求方建立时间同步,响应方仅基于剩余时效和预设阈值即可确定消息是否有效。The responder can determine whether the request message is valid based on the timeliness information, and the determination method is not limited here. For example, the responder may determine that the message has expired when the remaining age of the message is less than 0; or determine that the message has expired when the remaining age of the message is less than a preset threshold. It can be understood that in the embodiment of the present application, the responder does not need to establish time synchronization with the requester. The responder can determine whether the message is valid based only on the remaining time limit and the preset threshold.
在一些实施例中,响应方在接收请求消息时,计算请求消息的链路时延和接收处理时延;进而,基于链路时延和接收处理时延更新该请求消息的剩余消息,基于更新的剩余时效确定该请求消息是否有效。其中,该链路时延可以是基于响应方接收承载该请求消息的数据帧的起始时刻和终止时刻得到的,接收处理时延为响应方的链路层接收数据帧后协议栈或应用层接收处理数据帧所需的时间。关于响应方计算链路时延和接收处理时延的具体方法可以参见网络设备计算传输时延和接收处理时延的相关内容,此处不再赘述。In some embodiments, when receiving the request message, the responder calculates the link delay and the reception processing delay of the request message; and then updates the remaining messages of the request message based on the link delay and the reception processing delay. The remaining aging determines whether the request message is valid. Among them, the link delay can be obtained based on the start time and end time of the responder receiving the data frame carrying the request message. The reception processing delay is the protocol stack or application layer after the responder's link layer receives the data frame. The time required to receive and process a data frame. For the specific method for the responder to calculate the link delay and the reception processing delay, please refer to the relevant content of the network device to calculate the transmission delay and the reception processing delay, and will not be described again here.
步骤S605:至少一个网络设备中每一个网络设备均对接收到的响应消息的时效信息进行更新。Step S605: Each network device in at least one network device updates the aging information of the received response message.
在一些实施例中,至少一个网络设备中每一个网络设备对接收到的响应消息的时效信息进行更新的过程,可以与其对请求消息的时效更新的过程一致,具体可以参见上述网络设备对请求消息进行时效更新的相关内容,此处不再赘述。In some embodiments, the process of updating the aging information of the received response message by each network device in at least one network device may be consistent with the process of updating the aging information of the request message. For details, please refer to the above-mentioned network device updating the request message. The relevant content of timeliness update will not be described again here.
步骤S606:至少一个网络设备将更新后的响应消息发送至第一请求方。Step S606: At least one network device sends the updated response message to the first requester.
在一些实施例中,至少一个网络设备中每一个网络设备更新接收到的响应消息中剩余时效,将经所有网络设备更新时效后的响应消息发送至响应方。In some embodiments, each network device in at least one network device updates the remaining aging in the received response message, and sends the response message after all network devices have updated the aging to the responder.
以下结合图7,示例性的详细介绍上述步骤S601至步骤S606的一种可能的具体实现。A possible specific implementation of the above steps S601 to S606 will be described in detail below with reference to FIG. 7 .
如图7所示,图7中示例性示出了请求方、响应方以及多个网络设备中的网络设备N和网络设备N+1。其中,请求方可以经多个网络设备向响应方发送请求消息,响应方可以经多个网络设备向请求方发送响应消息。As shown in FIG. 7 , FIG. 7 exemplarily shows a requester, a responder, and network device N and network device N+1 among multiple network devices. The requester can send a request message to the responder via multiple network devices, and the responder can send a response message to the requester via multiple network devices.
可以理解的,在请求方经多个网络设备向响应方发送请求消息时,请求方为发送端,响应方为接收端;在响应方经多个网络设备向请求方发送响应消息时,响应方为发送端,请求方为接收端。It can be understood that when the requester sends a request message to the responder via multiple network devices, the requester is the sender and the responder is the receiver; when the responder sends a response message to the requester via multiple network devices, the responder is the sender, and the requester is the receiver.
其中,请求方发送查询、控制指令时,请求消息中携带该指令的时效信息P;查询指令的回应消息中也携带查询信息ID和信息值V以及信息时效信息P。如图7所示,图7示例性示出了请求消息和响应消息包括的信息,如信息ID、信息值V和时效信息。Among them, when the requesting party sends a query or control instruction, the request message carries the aging information P of the instruction; the response message of the query instruction also carries the query information ID and information value V as well as the information aging information P. As shown in Figure 7, Figure 7 exemplarily shows the information included in the request message and the response message, such as information ID, information value V and aging information.
考虑到工业以太网场景,请求方与响应方部署位置相近,指令的数据帧在网络设备间的
传输时延,可等价为网元接收端口接收数据帧的起始位时刻Ts和终止位时刻Te的时间差ΔTt=Te–Ts;数据帧在网络设备内的转发时延,可分为两部分,接收处理时延ΔTp=T–Te和发送处理时延ΔTp'=Ts'–T,其中,T为协议栈或应用接收处理完毕的时刻,Ts'为发送端口发送指令的数据帧的起始位的时刻,整体转发时延可表示为ΔTf=ΔTp+ΔTp’。Considering the industrial Ethernet scenario, the requester and responder are deployed close to each other, and the instruction data frame is transmitted between network devices. The transmission delay can be equivalent to the time difference ΔTt = Te – Ts between the start bit time Ts and the end bit time Te of the data frame received by the network element receiving port; the forwarding delay of the data frame in the network device can be divided into two parts , the receiving processing delay ΔTp=T–Te and the sending processing delay ΔTp’=Ts’–T, where T is the time when the protocol stack or application reception processing is completed, and Ts’ is the start of the data frame of the sending port sending instructions bit time, the overall forwarding delay can be expressed as ΔTf=ΔTp+ΔTp'.
以网络设备N为例,如图7所示,网络设备N接收端口接收数据帧的起始位时刻Tsn和终止位时刻Ten的时间差ΔTtn=Ten–Tsn;数据帧在网络设备内的转发时延,可分为两部分,接收处理时延ΔTpn=Tn–Ten和发送处理时延ΔTp'n=Ts'n–Tn,其中,Tn为协议栈或应用接收处理完毕的时刻,Ts'n为发送端口发送指令的数据帧的起始位的时刻,整体转发时延可表示为ΔTfn=ΔTp n+ΔTp'n。Taking network device N as an example, as shown in Figure 7, the time difference between the start bit time Tsn and the end bit time Ten of the data frame received by the receiving port of network device N is ΔTtn = Ten – Tsn; the forwarding delay of the data frame within the network device , can be divided into two parts, the receiving processing delay ΔTpn=Tn–Ten and the sending processing delay ΔTp'n=Ts'n–Tn, where Tn is the time when the protocol stack or application reception processing is completed, and Ts'n is the sending time. At the time when the port sends the starting bit of the data frame of the command, the overall forwarding delay can be expressed as ΔTfn = ΔTp n + ΔTp'n.
进而,网络设备N可以基于传输时延和整体转发时延计算Pn和P'n。网络设备N计算Pn和P'n具体公式可以如图7所示,网络设备N接收到请求消息的时效为P'n-1,Pn=P'n-1–ΔTtn–ΔTpn,其中,ΔTtn为网络设备N计算的传输时延,ΔTpn为网络设备N计算的接收处理时延;P'n=Pn–ΔTp'n,其中,ΔTp'n为网络设备N计算的发送处理时延。Furthermore, the network device N can calculate Pn and P'n based on the transmission delay and the overall forwarding delay. The specific formula for calculating Pn and P'n by network device N can be shown in Figure 7. The timeliness for network device N to receive the request message is P' n-1 , Pn=P' n-1 – ΔTtn – ΔTpn, where ΔTtn is The transmission delay calculated by network device N, ΔTpn is the receiving processing delay calculated by network device N; P'n=Pn-ΔTp'n, where ΔTp'n is the sending processing delay calculated by network device N.
其中,链路上的各网络设备更新请求消息、响应消息中剩余时效信息Pn,并根据Pn结合指令的实时性要求R、可靠性要求R'计算消息的优先等级Q=f(Pn|R|R'),当Q>Qhigh则进行高优先级转发、Qhigh≥Q≥Qdrop则进行普通转发,或者Q<Qdrop则丢弃该消息。其中,Qhigh和Qdrop可以为预设值。Among them, each network device on the link updates the remaining timeliness information Pn in the request message and response message, and calculates the message priority Q=f(Pn|R| based on Pn combined with the real-time requirement R and reliability requirement R' of the instruction). R'), when Q>Qhigh, high-priority forwarding is performed, Qhigh≥Q≥Qdrop, normal forwarding is performed, or Q<Qdrop, the message is discarded. Among them, Qhigh and Qdrop can be preset values.
在转发消息之前,链路上的各网络设备可以将消息中剩余时效信息进行更新。为以网络设备N为例,网络设备N在转发请求消息前,可以基于ΔTp'n对时效进一步的更新,如图7所示,网络设备N转发的消息中的时效为P'n。Before forwarding the message, each network device on the link can update the remaining aging information in the message. Taking network device N as an example, before forwarding the request message, network device N can further update the aging based on ΔTp'n. As shown in Figure 7, the aging in the message forwarded by network device N is P'n.
可以理解的,各网络设备无需借助外部时钟服务器,仅需根据指令的数据帧结构即可计算传输时延;网络设备可根据请求消息、响应消息的传输路径,实时更新该消息的剩余时效;网络设备可结合请求消息、响应消息的剩余时效和消息的实时性要求、可靠性要求等,提升指令的响应速度。It is understandable that each network device does not need to rely on an external clock server and only needs to calculate the transmission delay based on the data frame structure of the instruction; the network device can update the remaining timeliness of the message in real time based on the transmission path of the request message and response message; the network The device can improve the response speed of instructions by combining the remaining timeliness of the request message and response message with the real-time requirements and reliability requirements of the message.
在另一些实施例中,网络设备对响应消息的处理可以与对请求消息的处理也可以不同。In other embodiments, the network device may process the response message differently from the request message.
以下示例性的介绍本申请实施例提供的另一种时效保证方法。The following is an exemplary introduction to another timeliness guarantee method provided by the embodiment of the present application.
该方法中,请求方(第一请求方)与响应方的通信链路上的网络设备可以存储更新后的响应消息,以使其它请求方(即第二请求方)在请求相同的响应消息时,通信链路上的网络设备可以将存储的响应消息发送至其它请求方。可以理解的,上文中步骤S604至步骤S606可以替换为本申请实施例中的步骤S802。In this method, the network device on the communication link between the requester (first requester) and the responder can store the updated response message, so that other requesters (ie, the second requester) can request the same response message when , network devices on the communication link can send stored response messages to other requesters. It can be understood that the above steps S604 to step S606 can be replaced by step S802 in the embodiment of the present application.
请参见图8,图8是本申请实施例提供的又一种时效保证方法的流程图,该方法包括以下步骤:Please refer to Figure 8. Figure 8 is a flow chart of yet another timeliness guarantee method provided by an embodiment of the present application. The method includes the following steps:
步骤S801:第一请求方经至少一个网络设备向响应方发送查询指令,至少一个网络设备包括网络设备N。Step S801: The first requester sends a query instruction to the responder via at least one network device, and the at least one network device includes network device N.
其中,查询指令可以包括该指令对应的时效信息,该时效信息用于指示该查询指令的剩余时效。The query instruction may include aging information corresponding to the instruction, and the aging information is used to indicate the remaining aging of the query instruction.
在一些实施例中,第一请求方经至少一个网络设备向响应方发送查询指令的过程中还包括发送该指令对应的时效信息;至少一个网络设备中每一个网络设备可以更新接收到的查询指令对应的时效信息;进而,响应方可以接收到经每一个网络设备更新后的时效信息,基于该查询指令的剩余时效确定该查询指令是否有效。
In some embodiments, the process of the first requester sending a query instruction to the responder via at least one network device also includes sending aging information corresponding to the instruction; each network device in the at least one network device can update the received query instruction. Corresponding aging information; furthermore, the responder can receive the aging information updated by each network device, and determine whether the query instruction is valid based on the remaining aging of the query instruction.
需要说明的是,第一请求方经至少一个网络设备向响应方发送查询指令的具体实现还可以参见上文中步骤S601至步骤S603的相关内容,此处不作赘述。It should be noted that for the specific implementation of the first requester sending the query instruction to the responder via at least one network device, please refer to the relevant content of steps S601 to S603 above, which will not be described again here.
步骤S802:响应方响应于接收到的查询指令,经至少一个网络设备向第一请求方发送响应消息,该响应消息包括用于指示剩余时效的时效信息。Step S802: In response to the received query instruction, the responder sends a response message to the first requester via at least one network device, where the response message includes aging information indicating the remaining aging.
在一些实施例中,响应方在接收到查询指令后,进行查询,得到目标信息;然后,生成响应消息,该响应消息包括目标信息;进而,将该响应消息经至少一个网络设备发送至第一请求方。In some embodiments, after receiving the query instruction, the responder performs a query to obtain the target information; then, generates a response message that includes the target information; and then sends the response message to the first network device via at least one network device. requesting party.
其中,至少一个网络设备中每一个网络设备在接收到响应消息后,可以对该响应消息中的剩余时效进行更新;还可以存储该响应消息。Wherein, after receiving the response message, each network device in at least one network device can update the remaining time limit in the response message; the response message can also be stored.
以下以网络设备N为例,详细介绍网络设备N在接收到响应消息后的一种具体操作。The following takes network device N as an example to introduce in detail a specific operation of network device N after receiving the response message.
步骤S8021:网络设备N在接收到响应消息后,将时效信息指示的剩余时效更新为第一时效,得到缓存消息,第一时效为该剩余时效减去传输时延和接收处理时延的时间段。Step S8021: After receiving the response message, network device N updates the remaining aging indicated by the aging information to the first aging and obtains the cached message. The first aging is the time period of the remaining aging minus the transmission delay and the reception processing delay. .
其中,网络设备N计算传输时延和接收处理时延的具体过程可参见上文中的相关描述,此处不再赘述。Among them, the specific process of the network device N calculating the transmission delay and the reception processing delay can be found in the relevant description above, and will not be described again here.
步骤S8022:网络设备N在第一时延满足预设条件时,存储该缓存消息。Step S8022: Network device N stores the cached message when the first delay meets the preset condition.
在一种实现中,网络设备N可以基于第一时延,进行缓存决策,确定是否存储该缓存消息。例如,各网络设备可以根据响应消息中信息的剩余时效信息Pn结合该信息的实时性要求计算存储等级S=f’(Pn|R),当S>Sstore时存储该信息,用于后续网络设备收到相同信息的查询指令时的快速处理。其中,Sstore可以为预设阈值,S=f’(Pn|R)为预设函数。In one implementation, network device N can make a caching decision based on the first delay to determine whether to store the cached message. For example, each network device can calculate the storage level S=f'(Pn|R) based on the remaining timeliness information Pn of the information in the response message combined with the real-time requirements of the information, and store the information when S>Sstore for subsequent network devices. Quick processing when receiving query instructions for the same information. Among them, Sstore can be a preset threshold, and S=f'(Pn|R) is a preset function.
其中,存储该缓存消息具体可以是存储该缓存消息,也可以是存储该缓存消息对应的报文内容,例如可以是存储该响应消息对应的查询指令要求查询的内容等。Storing the cache message may specifically store the cache message, or may store the message content corresponding to the cache message. For example, it may store the content requested by the query instruction corresponding to the response message, etc.
在一些实施例中,至少一个网络设备中每一个网络设备均存储该缓存消息,那么,与该网络设备直接通信的请求方请求该查询指令对应的响应消息时,网络设备可以将该缓存消息发送至请求方。可以理解的,该方法可以实现就近响应,提高响应的速度。其中,关于网络设备查询缓存消息等内容可以参见以下步骤S8026至步骤S8028的相关描述。In some embodiments, each of at least one network device stores the cached message. Then, when a requester in direct communication with the network device requests a response message corresponding to the query instruction, the network device can send the cached message. to the requesting party. It is understandable that this method can achieve nearby response and improve the speed of response. For content such as network device query cache messages, please refer to the following descriptions of steps S8026 to S8028.
需要说明的是,在另一些实施例中,也可以是至少一个网络设备中部分网络设备存储有该缓存消息,可以根据实际情况而定,此处不做限定。It should be noted that in other embodiments, some of the network devices in at least one network device may store the cached message, which may be determined according to the actual situation, and is not limited here.
步骤S8023:网络设备N基于第一时延,确定优先转发或普通转发缓存消息。Step S8023: Based on the first delay, network device N determines whether to forward the buffered message with priority or to forward it normally.
其中,网络设备N基于第一时延,确定优先转发或普通转发缓存消息的过程可以参见步骤S6024中的相关内容,此处不再赘述。The process by which the network device N determines whether to forward the cached message first or normally based on the first delay may refer to the relevant content in step S6024, which will not be described again here.
步骤S8024:网络设备N将缓存消息的剩余时效更新为第二时效,得到更新后的响应消息,第二时效为第一时效减去发送处理时延的时间段。Step S8024: Network device N updates the remaining aging of the cached message to the second aging to obtain the updated response message. The second aging is the time period of the first aging minus the transmission processing delay.
其中,网络设备N将缓存消息的剩余时效更新为第二时效的过程可以参见步骤S6025中的相关内容,此处不再赘述。For the process of the network device N updating the remaining aging of the cached message to the second aging, please refer to the relevant content in step S6025, which will not be described again here.
步骤S8025:网络设备N将更新后的响应消息发送至下一个网络设备或第一请求方。Step S8025: Network device N sends the updated response message to the next network device or the first requester.
其中,下一个网络设备是指响应方至请求方的通信连路上网络设备N的下一个网络设备。例如请求方向响应方发送消息,需要由请求方发送至网络设备N,网络设备N转发至网络设备N-1,再由网络设备N-1发送至响应方,则网络设备的下一个网络设备是指网络设备N-1。The next network device refers to the network device next to the network device N on the communication link from the responder to the requester. For example, when the requester sends a message to the responder, it needs to be sent by the requester to network device N, which is forwarded to network device N-1, and then sent by network device N-1 to the responder. Then the next network device of the network device is Refers to network device N-1.
以下结合图9,介绍图8所示的时效保证方法的一种可能的具体实现。A possible specific implementation of the timeliness guarantee method shown in Figure 8 is introduced below with reference to Figure 9 .
图9以响应方响应于请求方-1发送的查询指令,向请求方-1发送响应消息的场景为例,
对响应消息的传输过程进行介绍。需要说明的是,请求方-1向响应方发送查询指令的过程可以参见上文中的相关描述,此处不作赘述。Figure 9 takes the scenario where the responder responds to the query instruction sent by the requester-1 and sends a response message to the requester-1 as an example. Introduce the transmission process of response messages. It should be noted that the process of the requester-1 sending the query instruction to the responder can be found in the relevant description above and will not be described again here.
请参见图9,图9是本申请实施例提供的一种响应消息传输过程的流程示意图。Please refer to Figure 9. Figure 9 is a schematic flowchart of a response message transmission process provided by an embodiment of the present application.
如图9所示,请求方-1和响应方进行消息传输的通信链路上包括多个网络设备,图9中示例性示出了网络设备1和网络设备N,其中,网络设备1与请求方-1建立通信连接。具体的,请求方-1可以向网络设备1发送查询指令,进而,网络设备1将该查询指令发送至通信链路上的下一个网络设备,依次类推,直至最后一个网络设备将该查询指令发送至响应方;响应方可以响应于该查询指令,生成响应消息,响应消息可以携带信息ID、信息值V和时效信息;该响应消息经通信链路上的多个网络设备发送至网络设备1,由网络设备1将该响应消息发送至请求方-1。其中,该响应消息中包括随通信链路上的网络设备不断动态更新的剩余时效,该剩余时效可以用于请求方-1基于该剩余时效判断该响应消息是否有效。As shown in Figure 9, the communication link between the requester-1 and the responder for message transmission includes multiple network devices. Figure 9 exemplarily shows network device 1 and network device N, where network device 1 and the requesting party Party-1 establishes a communication connection. Specifically, the requester-1 can send a query command to the network device 1, and then the network device 1 sends the query command to the next network device on the communication link, and so on, until the last network device sends the query command. to the responder; the responder can respond to the query command and generate a response message, which can carry the information ID, information value V and aging information; the response message is sent to network device 1 via multiple network devices on the communication link, The response message is sent by network device 1 to requester-1. The response message includes a remaining time limit that is continuously updated dynamically with the network equipment on the communication link. The remaining time limit can be used by the requesting party-1 to determine whether the response message is valid based on the remaining time limit.
其中,各网络设备可以根据响应消息中信息的剩余时效信息Pn结合该信息的实时性要求计算存储等级S=f’(Pn|R),当S>Sstore时存储该信息,用于后续网络设备收到相同信息的查询指令时的快速处理。其中,Sstore可以为预设值。Among them, each network device can calculate the storage level S=f'(Pn|R) based on the remaining timeliness information Pn of the information in the response message combined with the real-time requirements of the information. When S>Sstore, the information is stored for subsequent network devices. Quick processing when receiving query instructions for the same information. Among them, Sstore can be a default value.
以网络设备N为例,网络设备N接收到的响应消息中的时效为P'n+1,网络设备N可以先基于时效P'n+1计算时效Pn,其中,时效Pn为P'n+1减去传输时延和接收处理时延后的时效;进而,网络设备N可以基于时效Pn对该响应消息进行缓存决策,具体的,网络设备N可以根据响应消息中信息的剩余时效信息Pn结合该信息的实时性要求计算存储等级S=f’(Pn|R),当S>Sstore时存储该信息,用于后续网络设备收到相同信息的查询指令时的快速处理;进而,网络设备N可以基于时效Pn对该响应消息进行转发决策,确定高优先级转发或普通转发该响应消息;最后,网络设备N更新响应消息中的时效信息,将时效更新为P'n,其中,时效P'n为Pn减去发送处理时延后的时效。Taking network device N as an example, the aging in the response message received by network device N is P' n+1 . Network device N can first calculate the aging Pn based on the aging P' n+1 , where the aging Pn is P' n+ 1 The aging after subtracting the transmission delay and the reception processing delay; furthermore, the network device N can make a caching decision for the response message based on the aging Pn. Specifically, the network device N can combine the remaining aging information Pn of the information in the response message. The real-time nature of this information requires calculating the storage level S=f'(Pn|R). When S>Sstore, the information is stored for rapid processing when subsequent network devices receive query instructions for the same information; furthermore, the network device N The response message can be forwarded based on the timeliness Pn, and the response message can be forwarded with high priority or normal forwarding. Finally, the network device N updates the timeliness information in the response message and updates the timeliness to P' n , where the timeliness P' n is the aging time after Pn minus the transmission processing delay.
其中,网络设备N计算传输时延、接收处理时延和发送处理时延的具体过程可以参见上文中的相关内容。Among them, the specific process of the network device N calculating the transmission delay, the reception processing delay, and the sending processing delay can be found in the relevant content above.
基于图8和图9所示的时效保证方法,本申请实施例提供了一种查询方法。该方法中,由于网络设备存储经其传输的响应消息,因此,网络设备可以在接收到查询该响应消息的查询指令时,直接向请求方发送存储的该响应消息。Based on the timeliness guarantee method shown in Figures 8 and 9, embodiments of the present application provide a query method. In this method, since the network device stores the response message transmitted through it, the network device can directly send the stored response message to the requesting party when receiving a query instruction to query the response message.
以下以网络设备N为例,结合图10,介绍该查询方法。请参见图10,图10是本申请实施例提供的一种查询方法的流程示意图,如图10所示,该查询方法可以包括以下全部或部分步骤:The following uses network device N as an example to introduce the query method in conjunction with Figure 10. Please refer to Figure 10. Figure 10 is a schematic flow chart of a query method provided by an embodiment of the present application. As shown in Figure 10, the query method may include all or part of the following steps:
步骤S8026:网络设备N接收来自第二请求方的查询指令。Step S8026: Network device N receives the query instruction from the second requester.
其中,网络设备N可以为与第二请求方直接通信的网络设备;也可以为与第二请求方间接通信的网络设备。The network device N may be a network device that directly communicates with the second requester; it may also be a network device that indirectly communicates with the second requester.
步骤S8027:网络设备N在存储中查询该查询指令对应的响应消息。Step S8027: Network device N queries the storage for the response message corresponding to the query instruction.
在一些实施例中,网络设备N在接收到查询指令后,可以先在存储的缓存消息中查询是否存有该查询指令对应的响应消息。In some embodiments, after receiving the query instruction, the network device N may first query the stored cache message to see whether there is a response message corresponding to the query instruction.
步骤S8028:网络设备N在查询到的响应消息满足预设条件时,向第二请求方发送响应消息。Step S8028: When the queried response message meets the preset conditions, the network device N sends a response message to the second requester.
在一种实现中,网络设备N在查询到的响应消息未失效时,向第二请求方发送响应消息。其中,网络设备N可以基于响应消息的剩余时效确定该响应消息是否失效。例如网络设备N
查询该响应消息的存储时间和当前时间,计算存储时间和当前时间的时间差,再从剩余时效中减去上述时间差,若剩余时效小于预设阈值则判定该响应消息失效,若剩余时效大于预设阈值则判定该响应消息有效,其中,预设阈值可以为0,也可以为其他值,此处不做限定。In one implementation, when the queried response message is not invalid, the network device N sends a response message to the second requester. The network device N may determine whether the response message is invalid based on the remaining timeliness of the response message. For example, network device N Query the storage time and current time of the response message, calculate the time difference between the storage time and the current time, and then subtract the above time difference from the remaining aging. If the remaining aging is less than the preset threshold, the response message is determined to be invalid. If the remaining aging is greater than the preset The threshold value determines that the response message is valid, where the preset threshold value can be 0 or other values, which is not limited here.
在一些实施例中,网络内其他请求方经网络设备向响应方查询信息时,各级网络设备优先检查本地信息缓存,若存在该信息缓存且未超出时效,则响应本地缓存的信息,否则转发该查询指令至响应方。In some embodiments, when other requesters in the network query the responder for information through network devices, network devices at all levels check the local information cache first. If the information cache exists and has not expired, the locally cached information will be responded to, otherwise it will be forwarded. This query is directed to the responder.
在一种可能的实现中,网络设备N为与第二请求方间接通信的网络设备。例如,第二请求方经两个网络设备与响应方通信,第二请求方将查询指令发送至网络设备N-1,再由网络设备N-1更新该查询指令的时效信息后转发给网络设备N,最后由网络设备N发送至响应方,那么网络设备N为与第二请求方间接通信的网络设备。在网络设备N-1未存储该查询指令对应的响应消息时,网络设备N-1将该查询指令的时效信息更新后,将更新后的查询指令转发给网络设备N,在网络设备N查询到该查询指令对应的响应消息时,网络设备N可以将该响应消息发送至网络设备N-1,再由网络设备N-1将该响应消息发送至第二请求方。其中,网络设备N将该响应消息经网络设备N-1发送至第二请求方时,网络设备N和网络设备N-1均可以对该响应消息中的剩余时效进行更新。In a possible implementation, network device N is a network device that indirectly communicates with the second requester. For example, the second requester communicates with the responder through two network devices. The second requester sends a query command to network device N-1, and then network device N-1 updates the aging information of the query command and forwards it to the network device. N, is finally sent to the responder by network device N, then network device N is a network device that indirectly communicates with the second requester. When the network device N-1 does not store the response message corresponding to the query command, the network device N-1 updates the timeliness information of the query command and forwards the updated query command to the network device N. After the network device N queries When querying the response message corresponding to the instruction, network device N can send the response message to network device N-1, and then network device N-1 sends the response message to the second requester. When the network device N sends the response message to the second requester via the network device N-1, both the network device N and the network device N-1 can update the remaining aging in the response message.
可以理解的,网络设备为与请求方建立直接通信连接的网络设备,那么,网络设备执行上述图10所示的查询方法,可以实现就近响应;网络设备为与请求方建立间接通信连接的网络设备时,同样可以减少原本需要发送至响应方时所要花费的时间。It can be understood that the network device is a network device that establishes a direct communication connection with the requesting party. Then, the network device executes the query method shown in Figure 10 above to achieve a nearby response; the network device is a network device that establishes an indirect communication connection with the requesting party. , it can also reduce the time that originally needs to be sent to the responder.
请参见图11,图11是本申请实施例提供的一种就近响应的场景图。Please refer to Figure 11, which is a scene diagram of a nearby response provided by an embodiment of the present application.
如图11所示,图11示例性的画出了请求方-1,请求方-2和请求方-N,以及网络设备1和网络设备N,其中,请求方-1和请求方-2均与网络设备1建立通信连接,请求方-N与网络设备N建立通信连接。As shown in Figure 11, Figure 11 exemplarily shows Requester-1, Requester-2 and Requester-N, as well as Network Device 1 and Network Device N, where Requester-1 and Requester-2 both A communication connection is established with network device 1, and the requester-N establishes a communication connection with network device N.
示例性的,请求方-1为上述第一请求方,请求方-2和请求方-N为上述第二请求方。具体的,请求方-1与响应方的通信经包括图11所示的网络设备1和网络设备N等多个网络设备。假设请求方-1向网络设备1发送查询指令,进而,在响应方经上述多个网络设备将该查询指令对应的响应消息发送至请求方-1的过程中,多个网络设备均对响应消息中的时效进行更新,多个网络设备均存储更新后的响应消息。For example, requester-1 is the above-mentioned first requester, and requester-2 and requester-N are the above-mentioned second requesters. Specifically, the communication between requester-1 and the responder includes multiple network devices such as network device 1 and network device N shown in Figure 11 . Assume that the requester-1 sends a query instruction to the network device 1, and then, in the process of the responder sending the response message corresponding to the query instruction to the requester-1 through the above-mentioned multiple network devices, multiple network devices all respond to the response message. It is updated within the time limit, and multiple network devices store the updated response messages.
那么,在请求方-2向网络设备2发送上述查询指令时,网络设备2可以先在存储中查询该查询指令对应的响应消息,在查询到对应的响应消息后,将该响应消息发送至请求方-2;请求方-N向网络设备N发送查询指令时,网络设备2可以先在存储中查询是否有该查询指令对应的响应消息,在查询到对应的响应消息后,将该响应消息发送至请求方-N。Then, when the requester-2 sends the above query command to the network device 2, the network device 2 can first query the response message corresponding to the query command in the storage, and after querying the corresponding response message, send the response message to the requester Party-2; When the requesting party-N sends a query instruction to the network device N, the network device 2 can first query whether there is a response message corresponding to the query instruction in the storage, and after querying the corresponding response message, send the response message To Requester-N.
其中,网络设备存储的响应消息可以为该网络设备接收到的响应消息更新为第一时效后的响应消息(如上文所述的缓存消息),关于网络设备对响应消息进行时效更新。参见上文中的相关描述,此处不再赘述。The response message stored by the network device may be updated with the response message received by the network device to a response message after the first aging (such as the cache message mentioned above), and the network device performs aging update on the response message. See the relevant description above and will not go into details here.
图11示例性的示出了响应消息携带的信息,如信息ID、信息值和时效信息。可以理解的,响应方生成的响应消息的初始时效为P,多个网络设备可以对响应消息中的时效信息进行更新,如网络设备N将该响应消息的时效更新为Pn,网络设备1将该响应消息更新为P1。Figure 11 exemplarily shows the information carried in the response message, such as information ID, information value and aging information. It can be understood that the initial timeliness of the response message generated by the responder is P, and multiple network devices can update the timeliness information in the response message. For example, network device N updates the timeliness of the response message to Pn, and network device 1 updates the timeliness of the response message to Pn . The response message is updated to P 1 .
上述详细阐述了本申请实施例的方法,下面提供了本申请实施例的装置。The method of the embodiment of the present application is described in detail above, and the device of the embodiment of the present application is provided below.
请参见图12,图12是本申请实施例提供的一种时效保证装置120的结构示意图,该装
置120可以为网络设备。当然,该装置120也可以为网络设备中的一个器件,例如芯片或者集成电路等,该装置120可以包括接收单元1201、第一处理单元1202、第二处理单元1203、更新单元1204和发送单元1205。该时效保证装置120用于实现前述的时效保证方法,例如图5或图6B所示的任意一个实施例的时效保证方法。Please refer to Figure 12. Figure 12 is a schematic structural diagram of an aging guarantee device 120 provided by an embodiment of the present application. Setting 120 can be a network device. Of course, the device 120 can also be a component in a network device, such as a chip or an integrated circuit. The device 120 can include a receiving unit 1201, a first processing unit 1202, a second processing unit 1203, an updating unit 1204 and a sending unit 1205. . The aging guarantee device 120 is used to implement the aforementioned aging guarantee method, such as the aging guarantee method in any embodiment shown in Figure 5 or Figure 6B.
在一种可能的实施方式中,接收单元1201,用于接收数据帧,数据帧包括时效信息,时效信息用于指示数据帧的剩余时效;In a possible implementation, the receiving unit 1201 is configured to receive a data frame, the data frame includes aging information, and the aging information is used to indicate the remaining aging of the data frame;
第一处理单元1202,用于基于网络设备的链路层接收数据帧的起始时刻和链路层接收数据帧的终止时刻,得到传输时延;The first processing unit 1202 is used to obtain the transmission delay based on the starting time of the link layer receiving the data frame and the ending time of the link layer receiving the data frame of the network device;
第二处理单元1203,用于基于网络设备的协议栈或应用层处理数据帧所需的时间,得到整体转发时延;The second processing unit 1203 is used to obtain the overall forwarding delay based on the time required for the protocol stack or application layer of the network device to process the data frame;
更新单元1204,用于基于传输时延和整体转发时延,更新时效信息;The update unit 1204 is used to update the aging information based on the transmission delay and the overall forwarding delay;
发送单元1205,用于发送更新后的数据帧。The sending unit 1205 is used to send the updated data frame.
在一种可能的实施方式中,传输时延为起始时刻和终止时刻的时间差;起始时刻为接收到数据帧的起始位时的时刻,终止时刻为接收到数据帧的终止位的时刻;In a possible implementation, the transmission delay is the time difference between the start time and the end time; the start time is the time when the start bit of the data frame is received, and the end time is the time when the stop bit of the data frame is received. ;
更新后的数据帧中的剩余时效为数据帧中的剩余时效减去传输时延和整体转发时延的差值。The remaining aging in the updated data frame is the remaining aging in the data frame minus the difference between the transmission delay and the overall forwarding delay.
在一种可能的实施方式中,整体转发时延包括接收处理时延和发送处理时延;更新单元1204用于:In a possible implementation, the overall forwarding delay includes receiving processing delay and sending processing delay; the update unit 1204 is used to:
将数据帧的剩余时效更新为第一时效,得到第一数据帧;第一时效为数据帧的剩余时效减去传输时延和接收处理时延的差值;接收处理时延为链路层接收数据帧后协议栈或应用层接收处理数据帧所需的时间;第一数据帧的剩余时效为第一时效;Update the remaining aging of the data frame to the first aging to obtain the first data frame; the first aging is the remaining aging of the data frame minus the difference between the transmission delay and the reception processing delay; the reception processing delay is the link layer reception The time required for the protocol stack or application layer to receive and process the data frame after the data frame; the remaining aging of the first data frame is the first aging;
将第一数据帧的剩余时效更新为第二时效,得到更新后的数据帧;第二时效为第一时效与发送处理时延的差值,发送处理时延为链路层发送更新后的数据帧前协议栈或应用层发送处理第一数据帧所需的时间;更新后的数据帧的剩余时效为第二时效。Update the remaining aging of the first data frame to the second aging to obtain the updated data frame; the second aging is the difference between the first aging and the transmission processing delay, and the transmission processing delay is the link layer sending the updated data The pre-frame protocol stack or application layer sends the time required to process the first data frame; the remaining aging of the updated data frame is the second aging.
在一种可能的实施方式中,在发送单元1205发送更新后的数据帧之前,装置还包括处理单元,处理单元用于:In a possible implementation, before the sending unit 1205 sends the updated data frame, the device further includes a processing unit, and the processing unit is configured to:
基于第一时效,确定对第一数据帧的处理方式;处理方式包括优先转发、正常转发或丢弃。Based on the first timeliness, a processing method for the first data frame is determined; the processing method includes priority forwarding, normal forwarding, or discarding.
在一种可能的实施方式中,处理单元用于:In a possible implementation, the processing unit is used for:
基于数据帧对应的可靠性等级和数据帧对应的实时性等级中的至少一项和第一时效,确定对第一数据帧的处理方式。Based on at least one of the reliability level corresponding to the data frame and the real-time level corresponding to the data frame and the first timeliness, a processing method for the first data frame is determined.
在一种可能的实施方式中,数据帧承载请求消息、响应消息和主动通知消息中的任一种,请求消息包括查询指令或控制指令,响应消息为响应于查询指令或控制指令生成的回复消息。In a possible implementation, the data frame carries any one of a request message, a response message and an active notification message. The request message includes a query instruction or a control instruction, and the response message is a reply message generated in response to the query instruction or control instruction. .
在一种可能的实施方式中,数据帧承载响应方响应于第一请求方的查询指令生成的响应消息,装置还包括存储单元,存储单元用于:In a possible implementation, the data frame carries a response message generated by the responder in response to the query instruction of the first requester. The device further includes a storage unit, and the storage unit is used for:
存储响应消息。Store the response message.
在一种可能的实施方式中,存储单元用于:In a possible implementation, the storage unit is used for:
在第一时效和响应消息对应的实时性等级满足缓存决策时,存储响应消息。When the first timeliness and the real-time level corresponding to the response message satisfy the cache decision, the response message is stored.
在一种可能的实施方式中,接收单元1201,用于接收来自第二请求方的查询指令,来自第二请求方的查询指令用于请求响应消息;In a possible implementation, the receiving unit 1201 is configured to receive a query instruction from the second requester, and the query instruction from the second requester is used to request a response message;
发送单元1205,用于向第二请求方发送响应消息。
The sending unit 1205 is used to send a response message to the second requester.
在一种可能的实施方式中,发送单元1205用于:In a possible implementation, the sending unit 1205 is used to:
获取响应消息对应的第一时效和存储响应消息的时刻;Obtain the first aging corresponding to the response message and the time when the response message is stored;
在当前时刻和存储响应消息的时刻的时间差不大于第一时效时,向第二请求方发送响应消息;When the time difference between the current time and the time when the response message is stored is not greater than the first aging, send the response message to the second requester;
在当前时刻和存储响应消息的时刻的时间差大于第一时效时,向响应方发送请求消息。When the time difference between the current time and the time when the response message is stored is greater than the first aging, the request message is sent to the responder.
需要说明的是,各个单元的实现还可以对应参照图6A或者图8所示的实施例的相应描述。该时效保证装置120可以为图6A或者图8所示实施例中的网络设备。It should be noted that the implementation of each unit may also correspond to the corresponding description with reference to the embodiment shown in FIG. 6A or FIG. 8 . The timeliness guarantee device 120 may be the network device in the embodiment shown in FIG. 6A or FIG. 8 .
可以理解的,本申请各个装置实施例中,对多个单元或者模块的划分仅是一种根据功能进行的逻辑划分,不作为对装置具体的结构的限定。在具体实现中,其中部分功能模块可能被细分为更多细小的功能模块,部分功能模块也可能组合成一个功能模块,但无论这些功能模块是进行了细分还是组合,装置120在配对的过程中所执行的大致流程是相同的。例如,上述装置120中的接收单元1201和发送单元1205也可以集成为通信单元,该通信单元可以实现接收单元1201和发送单元1205所实现的功能。通常,每个单元都对应有各自的程序代码(或者程序指令),这些单元各自对应的程序代码在处理器上运行时,使得该单元受处理单元的控制而执行相应的流程从而实现相应功能。It can be understood that in each device embodiment of the present application, the division of multiple units or modules is only a logical division based on functions and does not limit the specific structure of the device. In specific implementation, some functional modules may be subdivided into more small functional modules, and some functional modules may also be combined into one functional module. However, no matter whether these functional modules are subdivided or combined, the device 120 is paired with The general process performed is the same. For example, the receiving unit 1201 and the sending unit 1205 in the above-mentioned device 120 can also be integrated into a communication unit, and the communication unit can realize the functions realized by the receiving unit 1201 and the sending unit 1205. Usually, each unit corresponds to its own program code (or program instruction). When the corresponding program codes of these units are run on the processor, the unit is controlled by the processing unit and executes the corresponding process to realize the corresponding function.
请参见图13,图13是本申请实施例提供的一种时效保证装置130的结构示意图,该装置130可以接收端。当然,该装置130也可以为接收端中的一个器件,例如芯片或者集成电路等,该装置130可以包括接收单元1301、处理单元1302和更新单元1303。该时效保证装置130可以为上述实施例中的响应方或请求方,用于实现前述的时效保证方法,例如图6A或者图8所示的任意一个实施例的时效保证方法。Please refer to Figure 13. Figure 13 is a schematic structural diagram of a timeliness guarantee device 130 provided by an embodiment of the present application. The device 130 can be a receiving end. Of course, the device 130 can also be a device in the receiving end, such as a chip or an integrated circuit. The device 130 can include a receiving unit 1301, a processing unit 1302 and an updating unit 1303. The timeliness guarantee device 130 may be the responder or the requester in the above embodiment, and is used to implement the aforementioned timeliness guarantee method, such as the timeliness guarantee method in any embodiment shown in FIG. 6A or FIG. 8 .
在一种可能的实施方式中,该装置包括:In a possible implementation, the device includes:
接收单元1301,用于接收来自发送端的数据帧;数据帧包括时效信息,数据帧的时效信息用于指示数据帧的剩余时效;The receiving unit 1301 is used to receive a data frame from the sending end; the data frame includes aging information, and the aging information of the data frame is used to indicate the remaining aging of the data frame;
处理单元1302,用于基于接收端的链路层接收数据帧的起始时刻和接收端的链路层接收数据帧的终止时刻,得到链路时延;The processing unit 1302 is configured to obtain the link delay based on the starting time of the receiving end's link layer receiving the data frame and the ending time of the receiving end's link layer receiving the data frame;
更新单元1303,用于基于链路时延和接收处理时延,更新剩余时效;接收处理时延为链路层接收数据帧后协议栈或应用层接收处理数据帧所需的时间。The update unit 1303 is used to update the remaining aging based on the link delay and the reception processing delay; the reception processing delay is the time required for the protocol stack or the application layer to receive and process the data frame after the link layer receives the data frame.
在一种可能的实施方式中,数据帧承载请求消息,请求消息包括查询指令或控制指令;装置还包括执行单元1304,执行单元1304用于:In a possible implementation, the data frame carries a request message, and the request message includes a query instruction or a control instruction; the device also includes an execution unit 1304, and the execution unit 1304 is used to:
在基于剩余时效和预设阈值确定请求消息有效时,执行查询指令或控制指令。When it is determined that the request message is valid based on the remaining aging and the preset threshold, the query instruction or the control instruction is executed.
在一种可能的实施方式中,接收单元1301用于:In a possible implementation, the receiving unit 1301 is used for:
经至少一个网络设备接收来自请求方的数据帧;receiving data frames from the requesting party via at least one network device;
至少一个网络设备用于基于传输时延和整体转发时延更新数据帧的剩余时效;传输时延是基于网络设备的链路层接收数据帧的起始时刻和网络设备的链路层接收数据帧的终止时刻得到的;整体转发时延是基于网络设备的协议栈或应用层处理数据帧所需的时间得到的。At least one network device is used to update the remaining aging of the data frame based on the transmission delay and the overall forwarding delay; the transmission delay is based on the starting time of the link layer of the network device receiving the data frame and the link layer of the network device receiving the data frame. The termination time is obtained; the overall forwarding delay is obtained based on the time required for the protocol stack or application layer of the network device to process the data frame.
需要说明的是,各个单元的实现还可以对应参照图6A或者图8所示的实施例的相应描述。该时效保证装置130可以为图6A或者图8所示实施例中的响应方或请求方。It should be noted that the implementation of each unit may also correspond to the corresponding description with reference to the embodiment shown in FIG. 6A or FIG. 8 . The timeliness guarantee device 130 may be the responder or requester in the embodiment shown in FIG. 6A or FIG. 8 .
请参见图14,图14是本申请实施例提供的一种时效保证装置140的结构示意图,该时效保证装置140可以为节点,也可以为节点中的一个器件,例如芯片或者集成电路等。该装
置140可以包括至少一个处理器1402和通信接口1404。进一步可选的,所述时效保证装置还可以包括至少一个存储器1401。更进一步可选的,还可以包含总线1403,其中,存储器1401、处理器1402和通信接口1404通过总线1403相连。Please refer to Figure 14. Figure 14 is a schematic structural diagram of a timeliness guarantee device 140 provided by an embodiment of the present application. The timeliness guarantee device 140 can be a node or a device in the node, such as a chip or an integrated circuit. Should be installed The device 140 may include at least one processor 1402 and a communication interface 1404. Further optionally, the timeliness guarantee device may also include at least one memory 1401. Further optionally, a bus 1403 may also be included, wherein the memory 1401, the processor 1402 and the communication interface 1404 are connected through the bus 1403.
其中,存储器1401用于提供存储空间,存储空间中可以存储操作系统和计算机程序等数据。存储器1401可以是随机存储记忆体(random access memory,RAM)、只读存储器(read-only memory,ROM)、可擦除可编程只读存储器(erasable programmable read only memory,EPROM)、或便携式只读存储器(compact disc read-only memory,CD-ROM)等等中的一种或者多种的组合。Among them, the memory 1401 is used to provide storage space, and data such as operating systems and computer programs can be stored in the storage space. The memory 1401 may be a random access memory (RAM), a read-only memory (ROM), an erasable programmable read only memory (EPROM), or a portable read-only memory. One or more combinations of memory (compact disc read-only memory, CD-ROM), etc.
处理器1402是进行算术运算和/或逻辑运算的模块,具体可以是中央处理器(central processing unit,CPU)、图片处理器(graphics processing unit,GPU)、微处理器(microprocessor unit,MPU)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程逻辑门阵列(Field Programmable Gate Array,FPGA)、复杂可编程逻辑器件(Complex programmable logic device,CPLD)、协处理器(协助中央处理器完成相应处理和应用)、微控制单元(Microcontroller Unit,MCU)等处理模块中的一种或者多种的组合。The processor 1402 is a module that performs arithmetic operations and/or logical operations, and may be a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor unit (MPU), Application Specific Integrated Circuit (ASIC), Field Programmable Gate Array (FPGA), Complex programmable logic device (CPLD), co-processor (assist the central processor to complete Corresponding processing and application), microcontroller unit (Microcontroller Unit, MCU) and other processing modules or a combination thereof.
通信接口1404可以用于为所述至少一个处理器提供信息输入或者输出。和/或所述通信接口可以用于接收外部发送的数据和/或向外部发送数据,可以为包括诸如以太网电缆等的有线链路接口,也可以是无线链路(Wi-Fi、蓝牙、通用无线传输、车载短距通信技术等)接口。可选的,通信接口1404还可以包括与接口耦合的发射器(如射频发射器、天线等),或者接收器等。Communication interface 1404 may be used to provide information input or output to the at least one processor. And/or the communication interface can be used to receive data sent from the outside and/or send data to the outside. It can be a wired link interface such as an Ethernet cable, or a wireless link (Wi-Fi, Bluetooth, Universal wireless transmission, vehicle short-distance communication technology, etc.) interface. Optionally, the communication interface 1404 may also include a transmitter (such as a radio frequency transmitter, an antenna, etc.) or a receiver coupled to the interface.
该装置140中的处理器1402用于读取所述存储器1401中存储的计算机程序,用于执行前述的时效保证方法,例如图6A或者图8所示实施例所描述的时效保证方法。The processor 1402 in the device 140 is used to read the computer program stored in the memory 1401 and execute the aforementioned aging guarantee method, such as the aging guarantee method described in the embodiment shown in FIG. 6A or FIG. 8 .
在一种设计中,该时效保证装置140可以为图6A或者图8所示实施例中的网络设备。该装置140中的处理器1402用于读取所述存储器1401中存储的计算机程序,用于执行上述图6A或者图8所示的方法实施例。In one design, the timeliness guarantee device 140 may be the network device in the embodiment shown in FIG. 6A or FIG. 8 . The processor 1402 in the device 140 is used to read the computer program stored in the memory 1401 and execute the method embodiment shown in FIG. 6A or FIG. 8 .
在另一种设计中,该时效保证装置140可以为图6A或者图8所示实施例中的请求方或响应方。该装置140中的处理器1402用于读取所述存储器1401中存储的计算机程序,用于执行以上图6A或者图8所示的方法实施例。In another design, the timeliness guarantee device 140 may be the requester or the responder in the embodiment shown in FIG. 6A or FIG. 8 . The processor 1402 in the device 140 is used to read the computer program stored in the memory 1401 and execute the method embodiment shown in FIG. 6A or FIG. 8 above.
具体实现还可以参考图6A、图6B、图8或者图10所示实施例中的详细描述,此处不再赘述。For specific implementation, reference may also be made to the detailed description in the embodiment shown in FIG. 6A, FIG. 6B, FIG. 8 or FIG. 10, which will not be described again here.
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,当所述计算机程序在一个或多个处理器上运行时,实现图6A、图6B、图8或者图10所示的实施例所述的方法。Embodiments of the present application also provide a computer-readable storage medium. A computer program is stored in the computer-readable storage medium. When the computer program is run on one or more processors, FIG. 6A and FIG. 6B are implemented. , the method described in the embodiment shown in Figure 8 or Figure 10.
本申请实施例还提供了一种芯片系统,所述芯片系统包括至少一个处理器和通信接口,所述通信接口用于发送和/或接收数据,所述至少一个处理器用于调用至少一个存储器中存储的计算机程序,实现图6A、图6B、图8或者图10所示的实施例所述的方法。Embodiments of the present application also provide a chip system. The chip system includes at least one processor and a communication interface. The communication interface is used to send and/or receive data. The at least one processor is used to call at least one memory. The stored computer program implements the method described in the embodiment shown in FIG. 6A, FIG. 6B, FIG. 8 or FIG. 10.
进一步,所述至少一个处理器可以包含CPU、MPU、MCU或者协处理器中的至少一个。Further, the at least one processor may include at least one of a CPU, MPU, MCU or a co-processor.
本申请实施例还提供一种计算机程序产品,当所述计算机程序产品在一个或多个处理器上运行时,可以实现如图6A、图6B、图8或者图10所示的实施例所描述的方法。Embodiments of the present application also provide a computer program product. When the computer program product is run on one or more processors, the embodiments described in Figure 6A, Figure 6B, Figure 8 or Figure 10 can be implemented. Methods.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof.
当使用软件实现时,可以全部或部分地以计算机指令产品的形式实现。
When implemented using software, it may be implemented in whole or in part in the form of a computer instruction product.
在计算机上加载和执行该计算机指令时,可以全部或部分地实现本申请实施例所描述的流程或功能。该计算机可以是通用计算机、专用计算机、计算机网络、或者其它可编程装置。该计算机指令可以存储在计算机可读存储介质中,或者通过计算机可读存储介质进行传输。该计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如,固态硬盘(solid state disk,SSD))等。When the computer instructions are loaded and executed on the computer, the processes or functions described in the embodiments of this application can be realized in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device. The computer instructions may be stored in or transmitted over a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center integrated with one or more available media. Available media may be magnetic media (eg, floppy disk, hard disk, tape), optical media (eg, DVD), or semiconductor media (eg, solid state disk (SSD)), etc.
本申请方法实施例中的步骤可以根据实际需要进行顺序调整、合并和删减。The steps in the method embodiments of this application can be sequence adjusted, combined, and deleted according to actual needs.
本申请装置实施例中的模块可以根据实际需要进行合并、划分和删减。
Modules in the device embodiments of the present application can be merged, divided, and deleted according to actual needs.
Claims (30)
- 一种时效保证方法,其特征在于,应用于网络设备,所述方法包括:A timeliness guarantee method, characterized in that it is applied to network equipment, and the method includes:接收数据帧,所述数据帧包括时效信息,所述时效信息用于指示所述数据帧的剩余时效;Receive a data frame, the data frame including aging information, the aging information being used to indicate the remaining aging of the data frame;基于所述网络设备的链路层接收所述数据帧的起始时刻和所述链路层接收所述数据帧的终止时刻,得到传输时延;Obtain the transmission delay based on the starting time when the link layer of the network device receives the data frame and the ending time when the link layer receives the data frame;基于所述网络设备的协议栈或应用层处理所述数据帧所需的时间,得到整体转发时延;Based on the time required for the protocol stack or application layer of the network device to process the data frame, the overall forwarding delay is obtained;基于所述传输时延和所述整体转发时延,更新所述时效信息;Based on the transmission delay and the overall forwarding delay, update the aging information;发送所述更新后的数据帧。Send the updated data frame.
- 根据权利要求1中所述的方法,其特征在于,所述传输时延为所述起始时刻和所述终止时刻的时间差;所述起始时刻为接收到所述数据帧的起始位时的时刻,所述终止时刻为接收到所述数据帧的终止位的时刻;The method according to claim 1, characterized in that the transmission delay is the time difference between the starting time and the ending time; the starting time is when the starting bit of the data frame is received. time, and the termination time is the time when the termination bit of the data frame is received;所述更新后的数据帧中的剩余时效为所述数据帧中的剩余时效减去所述传输时延和所述整体转发时延的差值。The remaining timeliness in the updated data frame is the remaining timeliness in the data frame minus the difference between the transmission delay and the overall forwarding delay.
- 根据权利要求1或2中所述的方法,其特征在于,所述整体转发时延包括接收处理时延和发送处理时延;所述基于所述传输时延和所述整体转发时延,更新所述时效信息,包括:The method according to claim 1 or 2, characterized in that the overall forwarding delay includes a receiving processing delay and a sending processing delay; and based on the transmission delay and the overall forwarding delay, update The timeliness information includes:将所述数据帧的剩余时效更新为第一时效,得到第一数据帧;所述第一时效为所述数据帧的剩余时效减去所述传输时延和所述接收处理时延的差值;所述接收处理时延为所述链路层接收所述数据帧后所述协议栈或所述应用层接收处理所述数据帧所需的时间;所述第一数据帧的剩余时效为所述第一时效;Update the remaining aging of the data frame to the first aging to obtain the first data frame; the first aging is the remaining aging of the data frame minus the difference between the transmission delay and the reception processing delay ; The reception and processing delay is the time required for the protocol stack or the application layer to receive and process the data frame after the link layer receives the data frame; the remaining aging of the first data frame is the The first statute of limitations is mentioned;将所述第一数据帧的剩余时效更新为第二时效,得到所述更新后的数据帧;所述第二时效为所述第一时效与所述发送处理时延的差值,所述发送处理时延为所述链路层发送所述更新后的数据帧前所述协议栈或所述应用层发送处理所述第一数据帧所需的时间;所述更新后的数据帧的剩余时效为所述第二时效。Update the remaining aging of the first data frame to a second aging to obtain the updated data frame; the second aging is the difference between the first aging and the sending processing delay, and the sending The processing delay is the time required for the protocol stack or the application layer to send and process the first data frame before the link layer sends the updated data frame; the remaining aging of the updated data frame is the second aging period.
- 根据权利要求3所述的方法,其特征在于,在所述发送所述更新后的数据帧之前,所述方法还包括:The method according to claim 3, characterized in that, before sending the updated data frame, the method further includes:基于所述第一时效,确定对所述第一数据帧的处理方式;所述处理方式包括优先转发、正常转发或丢弃。Based on the first aging, a processing method for the first data frame is determined; the processing method includes priority forwarding, normal forwarding, or discarding.
- 根据权利要求4所述的方法,其特征在于,所述基于所述第一时效,确定对所述第一数据帧的处理方式,包括:The method of claim 4, wherein determining a processing method for the first data frame based on the first timeliness includes:基于所述数据帧对应的可靠性等级和所述数据帧对应的实时性等级中的至少一项和所述第一时效,确定对所述第一数据帧的处理方式。Based on at least one of the reliability level corresponding to the data frame and the real-time level corresponding to the data frame and the first timeliness, a processing method for the first data frame is determined.
- 根据权利要求1-5任一项中所述的方法,其特征在于,所述数据帧承载请求消息、响应消息和主动通知消息中的任一种,所述请求消息包括查询指令或控制指令,所述响应消息为响应于查询指令或控制指令生成的回复消息。The method according to any one of claims 1 to 5, characterized in that the data frame carries any one of a request message, a response message and an active notification message, and the request message includes a query instruction or a control instruction, The response message is a reply message generated in response to the query instruction or the control instruction.
- 根据权利要求1-6任一项所述的方法,其特征在于,所述数据帧承载响应方响应于第 一请求方的查询指令生成的响应消息,所述方法还包括:The method according to any one of claims 1-6, characterized in that the data frame carries the responder's response to the first A response message generated by the query instruction of the requesting party, the method further includes:存储所述响应消息。Store the response message.
- 根据权利要求7所述的方法,其特征在于,在所述将所述数据帧的剩余时效更新为第一时效,得到第一数据帧后,所述存储所述响应消息,包括:The method according to claim 7, characterized in that, after updating the remaining time limit of the data frame to the first time limit and obtaining the first data frame, storing the response message includes:在所述第一时效和所述响应消息对应的实时性等级满足缓存决策时,存储所述响应消息。When the first timeliness and the real-time level corresponding to the response message satisfy the cache decision, the response message is stored.
- 根据权利要求7或8所述的方法,其特征在于,所述方法还包括:The method according to claim 7 or 8, characterized in that, the method further includes:接收来自第二请求方的查询指令,所述来自第二请求方的查询指令用于请求所述响应消息;Receive a query instruction from the second requester, the query instruction from the second requester being used to request the response message;向所述第二请求方发送所述响应消息。Send the response message to the second requester.
- 根据权利要求9所述的方法,其特征在于,向所述第二请求方发送所述响应消息,包括:The method according to claim 9, characterized in that sending the response message to the second requester includes:获取所述响应消息对应的第一时效和存储所述响应消息的时刻;Obtain the first aging corresponding to the response message and the time when the response message is stored;在当前时刻和存储所述响应消息的时刻的时间差不大于所述第一时效时,向所述第二请求方发送所述响应消息;When the time difference between the current time and the time when the response message is stored is not greater than the first aging, send the response message to the second requester;在当前时刻和存储所述响应消息的时刻的时间差大于所述第一时效时,向所述响应方发送所述请求消息。When the time difference between the current time and the time when the response message is stored is greater than the first aging, the request message is sent to the responder.
- 一种时效保证方法,其特征在于,应用于发送端,所述方法包括:A timeliness guarantee method, characterized in that it is applied to the sending end, and the method includes:所述发送端向接收端发送数据帧;所述数据帧包括时效信息,所述数据帧的时效信息用于指示所述数据帧的剩余时效;The sending end sends a data frame to the receiving end; the data frame includes aging information, and the aging information of the data frame is used to indicate the remaining aging of the data frame;所述接收端用于基于链路时延和接收处理时延更新所述数据帧的剩余时效;所述链路时延是基于所述接收端的链路层接收所述数据帧的起始时刻和所述链路层接收所述数据帧的终止时刻得到的;所述接收处理时延为所述链路层接收所述数据帧后所述协议栈或所述应用层接收处理所述数据帧所需的时间。The receiving end is configured to update the remaining aging of the data frame based on the link delay and the reception processing delay; the link delay is based on the starting time and the time when the link layer of the receiving end receives the data frame. The termination time of the link layer receiving the data frame is obtained; the reception processing delay is the time required by the protocol stack or the application layer to receive and process the data frame after the link layer receives the data frame. required time.
- 一种时效保证方法,其特征在于,应用于接收端,所述方法包括:A timeliness guarantee method, characterized in that it is applied to the receiving end, and the method includes:所述接收端接收来自发送端的数据帧;所述数据帧包括时效信息,所述数据帧的时效信息用于指示所述数据帧的剩余时效;The receiving end receives a data frame from the sending end; the data frame includes aging information, and the aging information of the data frame is used to indicate the remaining aging of the data frame;所述接收端基于所述接收端的链路层接收所述数据帧的起始时刻和所述接收端的链路层接收所述数据帧的终止时刻,得到链路时延;The receiving end obtains the link delay based on the starting time when the link layer of the receiving end receives the data frame and the ending time when the link layer of the receiving end receives the data frame;基于所述链路时延和接收处理时延,更新所述剩余时效;所述接收处理时延为所述链路层接收所述数据帧后所述协议栈或所述应用层接收处理所述数据帧所需的时间。Based on the link delay and the reception processing delay, the remaining time limit is updated; the reception processing delay is the time limit of the protocol stack or the application layer reception and processing after the link layer receives the data frame. The time required for the data frame.
- 根据权利要求12所述的方法,其特征在于,所述数据帧承载请求消息,所述请求消息包括查询指令或控制指令;所述方法还包括:The method according to claim 12, characterized in that the data frame carries a request message, and the request message includes a query instruction or a control instruction; the method further includes:所述接收端在基于所述剩余时效和预设阈值确定所述请求消息有效时,执行所述查询指令或所述控制指令。 The receiving end executes the query instruction or the control instruction when determining that the request message is valid based on the remaining aging and the preset threshold.
- 根据权利要求12或13所述的方法,其特征在于,所述接收端接收来自发送端的数据帧,包括:The method according to claim 12 or 13, characterized in that the receiving end receives the data frame from the sending end, including:所述接收端经至少一个网络设备接收来自请求方的数据帧;The receiving end receives the data frame from the requesting party via at least one network device;所述至少一个网络设备用于基于传输时延和整体转发时延更新所述数据帧的剩余时效;所述传输时延是基于所述网络设备的链路层接收所述数据帧的起始时刻和所述网络设备的链路层接收所述数据帧的终止时刻得到的;所述整体转发时延是基于所述网络设备的协议栈或应用层处理所述数据帧所需的时间得到的。The at least one network device is configured to update the remaining aging of the data frame based on the transmission delay and the overall forwarding delay; the transmission delay is based on the starting time of the link layer of the network device receiving the data frame. and the termination time when the link layer of the network device receives the data frame; the overall forwarding delay is obtained based on the time required for the protocol stack or application layer of the network device to process the data frame.
- 一种时效保证装置,其特征在于,所述装置包括:An aging guarantee device, characterized in that the device includes:接收单元,用于接收数据帧,所述数据帧包括时效信息,所述时效信息用于指示所述数据帧的剩余时效;A receiving unit, configured to receive a data frame, where the data frame includes aging information, and the aging information is used to indicate the remaining aging of the data frame;第一处理单元,用于基于所述网络设备的链路层接收所述数据帧的起始时刻和所述链路层接收所述数据帧的终止时刻,得到传输时延;A first processing unit configured to obtain the transmission delay based on the starting time when the link layer of the network device receives the data frame and the ending time when the link layer receives the data frame;第二处理单元,用于基于所述网络设备的协议栈或应用层处理所述数据帧所需的时间,得到整体转发时延;The second processing unit is configured to obtain the overall forwarding delay based on the time required for the protocol stack or application layer of the network device to process the data frame;更新单元,用于基于所述传输时延和所述整体转发时延,更新所述时效信息;An update unit, configured to update the aging information based on the transmission delay and the overall forwarding delay;发送单元,用于发送所述更新后的数据帧。A sending unit, configured to send the updated data frame.
- 根据权利要求15中所述的装置,其特征在于,所述传输时延为所述起始时刻和所述终止时刻的时间差;所述起始时刻为接收到所述数据帧的起始位时的时刻,所述终止时刻为接收到所述数据帧的终止位的时刻;The device according to claim 15, wherein the transmission delay is the time difference between the starting time and the ending time; the starting time is when the starting bit of the data frame is received. time, and the termination time is the time when the termination bit of the data frame is received;所述更新后的数据帧中的剩余时效为所述数据帧中的剩余时效减去所述传输时延和所述整体转发时延的差值。The remaining timeliness in the updated data frame is the remaining timeliness in the data frame minus the difference between the transmission delay and the overall forwarding delay.
- 根据权利要求15或16中所述的装置,其特征在于,所述整体转发时延包括接收处理时延和发送处理时延;所述更新单元用于:The device according to claim 15 or 16, characterized in that the overall forwarding delay includes a receiving processing delay and a sending processing delay; the updating unit is configured to:将所述数据帧的剩余时效更新为第一时效,得到第一数据帧;所述第一时效为所述数据帧的剩余时效减去所述传输时延和所述接收处理时延的差值;所述接收处理时延为所述链路层接收所述数据帧后所述协议栈或所述应用层接收处理所述数据帧所需的时间;所述第一数据帧的剩余时效为所述第一时效;Update the remaining aging of the data frame to the first aging to obtain the first data frame; the first aging is the remaining aging of the data frame minus the difference between the transmission delay and the reception processing delay ; The reception and processing delay is the time required for the protocol stack or the application layer to receive and process the data frame after the link layer receives the data frame; the remaining aging of the first data frame is the The first statute of limitations is mentioned;将所述第一数据帧的剩余时效更新为第二时效,得到所述更新后的数据帧;所述第二时效为所述第一时效与所述发送处理时延的差值,所述发送处理时延为所述链路层发送所述更新后的数据帧前所述协议栈或所述应用层发送处理所述第一数据帧所需的时间;所述更新后的数据帧的剩余时效为所述第二时效。Update the remaining aging of the first data frame to a second aging to obtain the updated data frame; the second aging is the difference between the first aging and the sending processing delay, and the sending The processing delay is the time required for the protocol stack or the application layer to send and process the first data frame before the link layer sends the updated data frame; the remaining aging of the updated data frame is the second aging period.
- 根据权利要求17所述的装置,其特征在于,在所述发送单元发送所述更新后的数据帧之前,所述装置还包括处理单元,所述处理单元用于:The device according to claim 17, characterized in that, before the sending unit sends the updated data frame, the device further includes a processing unit, the processing unit being configured to:基于所述第一时效,确定对所述第一数据帧的处理方式;所述处理方式包括优先转发、正常转发或丢弃。Based on the first aging, a processing method for the first data frame is determined; the processing method includes priority forwarding, normal forwarding, or discarding.
- 根据权利要求18所述的装置,其特征在于,所述处理单元用于: The device according to claim 18, characterized in that the processing unit is used for:基于所述数据帧对应的可靠性等级和所述数据帧对应的实时性等级中的至少一项和所述第一时效,确定对所述第一数据帧的处理方式。Based on at least one of the reliability level corresponding to the data frame and the real-time level corresponding to the data frame and the first timeliness, a processing method for the first data frame is determined.
- 根据权利要求15-19任一项中所述的装置,其特征在于,所述数据帧承载请求消息、响应消息和主动通知消息中的任一种,所述请求消息包括查询指令或控制指令,所述响应消息为响应于查询指令或控制指令生成的回复消息。The device according to any one of claims 15 to 19, characterized in that the data frame carries any one of a request message, a response message and an active notification message, and the request message includes a query instruction or a control instruction, The response message is a reply message generated in response to the query instruction or the control instruction.
- 根据权利要求15-20任一项所述的装置,其特征在于,所述数据帧承载响应方响应于第一请求方的查询指令生成的响应消息,所述装置还包括存储单元,所述存储单元用于:The device according to any one of claims 15 to 20, characterized in that the data frame carries a response message generated by the responder in response to the query instruction of the first requester, and the device further includes a storage unit, and the storage Units are used for:存储所述响应消息。Store the response message.
- 根据权利要求21所述的装置,其特征在于,所述存储单元用于:The device according to claim 21, characterized in that the storage unit is used for:在所述第一时效和所述响应消息对应的实时性等级满足缓存决策时,存储所述响应消息。When the first timeliness and the real-time level corresponding to the response message satisfy the cache decision, the response message is stored.
- 根据权利要求21或22所述的装置,其特征在于,The device according to claim 21 or 22, characterized in that:所述接收单元,用于接收来自第二请求方的查询指令,所述来自第二请求方的查询指令用于请求所述响应消息;The receiving unit is configured to receive a query instruction from the second requester, and the query instruction from the second requester is used to request the response message;所述发送单元,用于向所述第二请求方发送所述响应消息。The sending unit is configured to send the response message to the second requester.
- 根据权利要求23所述的装置,其特征在于,所述发送单元用于:The device according to claim 23, characterized in that the sending unit is used for:获取所述响应消息对应的第一时效和存储所述响应消息的时刻;Obtain the first aging corresponding to the response message and the time when the response message is stored;在当前时刻和存储所述响应消息的时刻的时间差不大于所述第一时效时,向所述第二请求方发送所述响应消息;When the time difference between the current time and the time when the response message is stored is not greater than the first aging, send the response message to the second requester;在当前时刻和存储所述响应消息的时刻的时间差大于所述第一时效时,向所述响应方发送所述请求消息。When the time difference between the current time and the time when the response message is stored is greater than the first aging, the request message is sent to the responder.
- 一种时效保证装置,其特征在于,所述装置包括:An aging guarantee device, characterized in that the device includes:接收单元,用于接收来自发送端的数据帧;所述数据帧包括时效信息,所述数据帧的时效信息用于指示所述数据帧的剩余时效;A receiving unit, configured to receive a data frame from the sending end; the data frame includes aging information, and the aging information of the data frame is used to indicate the remaining aging of the data frame;处理单元,用于基于所述接收端的链路层接收所述数据帧的起始时刻和所述接收端的链路层接收所述数据帧的终止时刻,得到链路时延;A processing unit configured to obtain the link delay based on the starting time when the link layer of the receiving end receives the data frame and the ending time when the link layer of the receiving end receives the data frame;更新单元,用于基于所述链路时延和接收处理时延,更新所述剩余时效;所述接收处理时延为所述链路层接收所述数据帧后所述协议栈或所述应用层接收处理所述数据帧所需的时间。An update unit, configured to update the remaining aging based on the link delay and the reception processing delay; the reception processing delay is the protocol stack or the application after the link layer receives the data frame. The layer receives the time required to process the data frame.
- 根据权利要求25所述的装置,其特征在于,所述数据帧承载请求消息,所述请求消息包括查询指令或控制指令;所述装置还包括执行单元,所述执行单元用于:The device according to claim 25, characterized in that the data frame carries a request message, and the request message includes a query instruction or a control instruction; the device further includes an execution unit, the execution unit is used for:在基于所述剩余时效和预设阈值确定所述请求消息有效时,执行所述查询指令或所述控制指令。When it is determined that the request message is valid based on the remaining aging and the preset threshold, the query instruction or the control instruction is executed.
- 根据权利要求25或26所述的装置,其特征在于,所述接收单元用于: The device according to claim 25 or 26, characterized in that the receiving unit is used for:经至少一个网络设备接收来自请求方的数据帧;receiving data frames from the requesting party via at least one network device;所述至少一个网络设备用于基于传输时延和整体转发时延更新所述数据帧的剩余时效;所述传输时延是基于所述网络设备的链路层接收所述数据帧的起始时刻和所述网络设备的链路层接收所述数据帧的终止时刻得到的;所述整体转发时延是基于所述网络设备的协议栈或应用层处理所述数据帧所需的时间得到的。The at least one network device is configured to update the remaining aging of the data frame based on the transmission delay and the overall forwarding delay; the transmission delay is based on the starting time of the link layer of the network device receiving the data frame. and the termination time when the link layer of the network device receives the data frame; the overall forwarding delay is obtained based on the time required for the protocol stack or application layer of the network device to process the data frame.
- 一种芯片系统,其特征在于,所述芯片系统包括至少一个处理器和通信接口,所述通信接口用于发送和/或接收数据,所述至少一个处理器用于调用至少一个存储器中存储的计算机程序,以使得所述芯片系统所在的装置实现如权利要求1-14中任一项所述的方法。A chip system, characterized in that the chip system includes at least one processor and a communication interface, the communication interface is used to send and/or receive data, and the at least one processor is used to call at least one computer stored in a memory. Program, so that the device where the chip system is located implements the method according to any one of claims 1-14.
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机程序,当所述计算机程序在一个或多个处理器上运行时,执行如权利要求1-14中任一项所述的方法。A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium. When the computer program is run on one or more processors, it executes any of claims 1-14. method described in one item.
- 一种通信系统,其特征在于,所述系统包括发送端、接收端和网络设备,所述网络设备用于执行如权利要求1-10中任一项所述的方法,所述发送端用于执行如权利要求11中任一项所述的方法,所述接收端如权利要求12-14中任一项所述的方法。 A communication system, characterized in that the system includes a sending end, a receiving end and a network device, the network device is used to perform the method according to any one of claims 1-10, and the sending end is used to The method according to any one of claims 11 is executed, and the receiving end adopts the method according to any one of claims 12-14.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210592686.2 | 2022-05-28 | ||
CN202210592686.2A CN117200921A (en) | 2022-05-28 | 2022-05-28 | Aging guarantee method, device and system |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023231864A1 true WO2023231864A1 (en) | 2023-12-07 |
Family
ID=89002091
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2023/096053 WO2023231864A1 (en) | 2022-05-28 | 2023-05-24 | Timeliness guarantee method, apparatus and system |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN117200921A (en) |
WO (1) | WO2023231864A1 (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10594423B1 (en) * | 2019-09-09 | 2020-03-17 | Cisco Technology, Inc. | Re-timing a packetized radio flow to clean noise induced by packet delay variation of a packet network |
CN111867040A (en) * | 2019-04-30 | 2020-10-30 | 华为技术有限公司 | Communication method, terminal equipment and network equipment |
CN112468371A (en) * | 2020-12-01 | 2021-03-09 | 武汉绿色网络信息服务有限责任公司 | Method and equipment for determining transmission delay information of DPI equipment |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113709804A (en) * | 2020-05-22 | 2021-11-26 | 维沃移动通信有限公司 | Data transmission method, terminal equipment and network equipment |
-
2022
- 2022-05-28 CN CN202210592686.2A patent/CN117200921A/en active Pending
-
2023
- 2023-05-24 WO PCT/CN2023/096053 patent/WO2023231864A1/en unknown
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111867040A (en) * | 2019-04-30 | 2020-10-30 | 华为技术有限公司 | Communication method, terminal equipment and network equipment |
US10594423B1 (en) * | 2019-09-09 | 2020-03-17 | Cisco Technology, Inc. | Re-timing a packetized radio flow to clean noise induced by packet delay variation of a packet network |
CN112468371A (en) * | 2020-12-01 | 2021-03-09 | 武汉绿色网络信息服务有限责任公司 | Method and equipment for determining transmission delay information of DPI equipment |
Also Published As
Publication number | Publication date |
---|---|
CN117200921A (en) | 2023-12-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111866956B (en) | Data transmission method and corresponding equipment | |
WO2021057128A1 (en) | Nf-based communication method and device, and storage medium | |
CN110944358B (en) | Data transmission method and device | |
WO2020192397A1 (en) | Adjustment method for transmitting apparatus and communication device | |
EP4161005A1 (en) | Entry synchronization method, gateway device, networking system, and storage medium | |
WO2023030336A1 (en) | Data transmission method, tsn node, and computer readable storage medium | |
WO2020147081A1 (en) | Data transmission method, related device, and computer storage medium | |
WO2021147044A1 (en) | Time-sensitive network time synchronization method and apparatus | |
US20110255523A1 (en) | Process and system for calculating distances between wireless nodes | |
WO2019015036A1 (en) | Repeater bridging method and gateway | |
CN113259874B (en) | Message processing method, electronic device and storage medium | |
WO2023231864A1 (en) | Timeliness guarantee method, apparatus and system | |
CN114126085B (en) | Industrial field bus communication method and device, electronic equipment and storage medium | |
WO2023273946A1 (en) | Seamless bidirectional forwarding detection method, system, node, and storage medium | |
WO2023283794A1 (en) | Bluetooth connection method and apparatus | |
CN114124275B (en) | Time synchronization method, device, equipment and storage medium | |
WO2021103822A1 (en) | Method for acquiring common maximum segment size (mss), and device | |
US20030091067A1 (en) | Computing system and method to select data packet | |
WO2020238764A1 (en) | Time sequence management method, device and system | |
CN110224803B (en) | LoRa communication method for realizing beacon autonomous discovery | |
WO2024174085A1 (en) | Data transmission method and related device thereof | |
WO2020150349A1 (en) | Device presence method and system for mesh network management | |
US20070147252A1 (en) | Method for reducing traffic loading in an ad-hoc network | |
WO2024027491A1 (en) | Path switching method, apparatus, and system | |
CN117856985B (en) | Method, computer device, medium, and program for messaging Wen Chong |
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: 23815048 Country of ref document: EP Kind code of ref document: A1 |