Method and device for controlling equipment in time-sensitive network, and electronic equipment
By calculating the least common multiple of the data transmission period in a time-sensitive network to generate a gating table, the problem of inability to efficiently generate a gating table in the existing technology is solved, and low-latency and low-jitter data transmission is achieved.
Patent Information
- Application Number
- CN202410613525.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-16
- Publication Date
- 2024-08-23
AI Technical Summary
Gating tables cannot be efficiently generated in existing time-sensitive networks (TSN), resulting in data flow scheduling conflicts and increased delays.
By obtaining the network topology diagram, the least common multiple of the data sending period is calculated as the super period, and a gating table is generated based on the super period to determine the gating status of the bridge device to avoid scheduling conflicts.
It achieves efficient generation of gate control tables in TSN scenarios, avoids scheduling conflicts between data streams, ensures low latency and low jitter, and improves data transmission efficiency.
Smart Images

Figure CN118540184A
Abstract
Description
Technical Field
[0001] The present application belongs to the field of network communication technology, and in particular, relates to a control method, device and electronic device for devices in a time-sensitive network. Background Art
[0002] Time-Sensitive Networking (TSN) refers to a set of "sub-standards" developed under the IEEE802.1 standard framework based on specific application requirements. It aims to establish a "universal" time-sensitive mechanism for the Ethernet protocol to ensure the time determinism of network data transmission.
[0003] In general, traffic scheduling in time-sensitive networks can be divided into two categories: one is the time-slot scheduling based on the IEEE 802.1Qbv protocol, and the other is the scheduling based on QoS. Among them, the time-slot scheduling based on the IEEE 802.1Qbv protocol involves the idea of gating, but the protocol does not provide a specific solution for determining the gating state, nor does it provide a solution for determining the gating table, that is, it is currently impossible to efficiently generate the gating table. Summary of the invention
[0004] The embodiments of the present application provide a control method, apparatus, electronic device and computer-readable storage medium for devices in a time-sensitive network, which can solve the problem that a gating table cannot be generated efficiently at present.
[0005] In a first aspect, an embodiment of the present application provides a method for controlling a device in a time-sensitive network, comprising: obtaining a network topology diagram in a TSN scenario, wherein the network topology diagram is a connection structure diagram of multiple electronic devices in the network, wherein the multiple electronic devices include: at least two data sending ends that send data streams to the same bridge device and the bridge device; obtaining characteristics of all arrived data streams flowing to the bridge device based on the network topology diagram, wherein the arrived data stream is a data stream that has arrived at the bridge device, wherein the characteristics include a data sending period, and the arrived data stream includes a key stream; calculating a super period according to the data sending periods corresponding to all the key streams, wherein the super period is the least common multiple of the data sending periods corresponding to all the key streams; calculating the values of flow variables corresponding to the at least two data sending ends based on the super period, wherein the flow variables are used to indicate the time when the data stream to be arrived is planned to arrive at the bridge device, wherein the data stream to be arrived is the data stream to be arrived at the bridge device; generating a gating table based on the values of the flow variables corresponding to the at least two data sending ends; and controlling the operation of the bridge device according to the gating table.
[0006] In a possible implementation manner of the first aspect, the calculation of the values of the flow variables corresponding to the at least two data sending ends based on the super period includes: performing the following steps for each of the flow variables: establishing constraints on the flow variables based on the super period, the constraints including: a first constraint and a second constraint, wherein the first constraint includes: the flow variable minus the corresponding transmission delay is greater than or equal to the data flow start sending time corresponding to the p-th data sending period of the data sending end corresponding to the flow variable, and the second constraint includes: the flow variable is less than or equal to the data flow start sending time corresponding to the p+1-th data sending period of the data sending end corresponding to the flow variable, wherein p is equal to t+1, t∈[0,N], wherein N is equal to the quotient obtained by dividing the super period by the data sending period corresponding to the data sending end corresponding to the flow variable minus 1; calculating the corresponding value of the flow variable based on the constraints corresponding to the flow variable.
[0007] In a possible implementation of the first aspect, the generating of the gating table based on the values of the flow variables corresponding to the at least two data sending ends includes: sorting the values of the flow variables corresponding to the at least two data sending ends and the super period according to the priorities of the flow variables corresponding to the at least two data sending ends and the sizes of the values of the flow variables corresponding to the at least two data sending ends to obtain a sorting result; and generating the gating table according to the sorting result.
[0008] In a possible implementation of the first aspect, the last element in the sorting result is a super cycle. Correspondingly, generating a gating table based on the sorting result includes: determining the gating state corresponding to the super cycle of all queues corresponding to the priorities in the bridge device as a gated open state, thereby generating a gating table.
[0009] In a possible implementation of the first aspect, generating a gating table according to the sorting results includes: determining the gating states corresponding to queues of all priorities in the bridge device according to the sorting results; and generating a gating table according to the gating states corresponding to queues of all priorities.
[0010] In a possible implementation manner of the first aspect, generating a gating table according to the sorting result includes:
[0011] Step b1, let q=1, the initial value of the total time-consuming variable is 0, if the first time value in the sorting result is greater than the specified time, then the gating state of the queues corresponding to all main priorities in the time period between the specified time and the first time value is determined as the gated closed state, and the gating state of the queues corresponding to all secondary priorities in the time period between the specified time and the first time value is determined as the gated open state; based on the time period between the specified time and the first time value, the total time-consuming variable is updated, wherein q is used to represent the sequence number corresponding to the time value in the sorting result, the main priority is the priority related to the time value in the sorting result, and the secondary priority is: the priority that is irrelevant to all time values in the sorting result;
[0012] Step b2, according to the latest time value corresponding to q, the priority corresponding to the latest time value corresponding to q, and the transmission delay, determine the gating state and gating state duration corresponding to the queues corresponding to all priorities, and update the total time-consuming variable based on the gating state duration described in step b2;
[0013] Step b3, let q=q+1. If the latest q is less than Q, return to execute the step b2; if the latest q is equal to Q, determine whether the latest total time variable is equal to the super period; if the latest total time variable is equal to the super period, form a gating table based on all determined gating states, wherein Q is used to represent the total number of elements in the sorting result.
[0014] In a possible implementation of the first aspect, after acquiring the characteristics of all arrived data flows flowing to the bridge device based on the network topology map, it includes: calculating the network utilization of the network based on the characteristics; correspondingly, calculating the values of the flow variables corresponding to the at least two data sending ends based on the super period, including: if the network utilization is less than or equal to 1, calculating the values of the flow variables corresponding to the at least two data sending ends based on the super period.
[0015] In a second aspect, an embodiment of the present application provides a control device for a device in a time-sensitive network, including:
[0016] A first acquisition unit is used to acquire a network topology diagram in a TSN scenario, wherein the network topology diagram is a connection structure diagram of multiple electronic devices in a network, wherein the multiple electronic devices include: at least two data sending ends that send data streams to the same bridge device and the bridge device;
[0017] A second acquisition unit is used to acquire characteristics of all arrived data flows flowing to the bridge device based on the network topology diagram, wherein the arrived data flows are data flows that have reached the bridge device, the characteristics include a data sending period, and the arrived data flows include key flows;
[0018] A first calculation unit, configured to calculate a super period according to the data transmission periods corresponding to all the key flows, wherein the super period is the least common multiple of the data transmission periods corresponding to all the key flows;
[0019] A second calculation unit, configured to calculate the value of a flow variable corresponding to the at least two data sending ends based on the super period, wherein the flow variable is used to indicate the time when the data flow to be arrived is scheduled to arrive at the bridge device, and the data flow to be arrived is a data flow to be arrived at the bridge device;
[0020] A gating table generating unit, configured to generate a gating table based on the values of the flow variables corresponding to the at least two data sending ends;
[0021] A control unit is used to control the operation of the bridge device according to the gating table.
[0022] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above-described methods when executing the computer program.
[0023] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements any of the methods described above.
[0024] It can be understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.
[0025] Compared with the prior art, the embodiments of the present application have the following beneficial effects: the control method of a device in a time-sensitive network in the embodiments of the present application includes: obtaining a network topology diagram in a TSN scenario, wherein the network topology diagram is a connection structure diagram of multiple electronic devices in the network, wherein the multiple electronic devices include at least two data sending ends that send data streams to the same bridge device and the bridge device; based on the network topology diagram, obtaining the characteristics of all data streams that have arrived at the bridge device, wherein the data streams that have arrived at the bridge device include a data sending period, and the data streams that have arrived include a key stream; according to all the The data transmission cycle corresponding to the key flow calculates the super cycle, wherein the super cycle is the least common multiple of the data transmission cycles corresponding to all the key flows; based on the super cycle, the value of the flow variable corresponding to the at least two data transmission ends is calculated, and the flow variable is used to indicate the time when the planned data flow to be arrived at the bridge device is to be arrived at the bridge device; the gating table is generated based on the value of the flow variable corresponding to the at least two data transmission ends; the bridge device is controlled to work according to the gating table, so that the control of the bridge device by the gating table can accurately avoid scheduling conflicts between data flows. The method of generating the gating table in the present application is relatively convenient and fast, that is, the method of generating the gating table is more efficient in the TSN scenario. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0027] Figure 1 It is a flowchart of a method for controlling a device in a time-sensitive network provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0029] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0030] It should also be understood that the term “or / and” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0031] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0032] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0033] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0034] Embodiment 1
[0035] Figure 1 A flow chart of a method for controlling a device in a time-sensitive network provided by an embodiment of the present application is shown. The method for controlling a device in a time-sensitive network includes: step S101, step S102, step S103, step S104, step S105, and step S106, which are described in detail as follows:
[0036] Step S101, obtaining a network topology diagram in a TSN scenario, wherein the network topology diagram is a connection structure diagram of multiple electronic devices in a network, wherein the multiple electronic devices include: at least two data sending ends that send data streams to the same bridge device and the bridge device.
[0037] As an example but not limitation, the at least two data sending ends include a first data sending end and a second data sending end, and at least two data streams flow from the first data sending end and the second data sending end to the designated data receiving end via the bridge device.
[0038] Step S102: based on the network topology diagram, obtain characteristics of all arrived data flows flowing to the bridge device, wherein the arrived data flows are data flows that have reached the bridge device, and the characteristics include a data sending cycle, and the arrived data flows include key flows.
[0039] As an example but not limitation, the feature also includes at least one of the following: data flow size, priority corresponding to the queue corresponding to the data flow, bandwidth of the channel transmitting the data flow, transmission delay requirement, and data flow start sending time. The data sending period is the period of the data sending end sending the data volume, and the data flow start sending time is the time when the data sending end starts sending the data flow. In addition, assuming that there is only a first data sending end and a second data sending end sending data flows to the same bridge device, for the sake of convenience of description, the data flow that the first data sending end sent to the bridge device the most recently is called the first data flow, and the data flow that the second data sending end sent to the bridge device the most recently is called the second data flow, and all the data flows that have reached the bridge device include: the first data flow and the second data flow; the characteristics of all the data flows that have reached the bridge device based on the network topology diagram include: the characteristics of the first data flow and the characteristics of the second data flow that are obtained based on the network topology diagram. All the data flows that have reached the bridge device may also include non-critical flows, for example, the non-critical flows have an uninterrupted period, that is, they are always sending packets. Or / and, the key stream is a data stream with a priority greater than or equal to a specified level, and the key stream is a data stream with a priority less than a specified level. The larger the number representing the priority, the higher the priority level.
[0040] In addition, the queues described in this article are used in the bridge device to temporarily store data (flows) to be forwarded, and each queue has its own corresponding priority.
[0041] This embodiment can obtain the characteristics of all data flows that have arrived at the same bridge device based on the network topology diagram, and adaptively create a gating table suitable for the actual situation in combination with subsequent steps, thereby improving data transmission efficiency.
[0042] Step S103: Calculate a super period according to the data transmission periods corresponding to all the key flows, wherein the super period is the least common multiple of the data transmission periods corresponding to all the key flows.
[0043] For example, assuming that all key streams only include the first data stream and the second data stream, the data sending period corresponding to the first data stream and the data sending period corresponding to the second data stream are 3us and 10us respectively. Since the least common multiple of 3us and 10us is 30us, the super period is 30us.
[0044] Step S104, calculating the values of the flow variables corresponding to the at least two data sending ends based on the super period, the flow variables are used to indicate the time when the planned data flow to be arrived at the bridge device, and the data flow to be arrived is the data flow to be arrived at the bridge device.
[0045] Optionally, the step S104 includes: executing step a1 and step a2 for each of the flow variables, wherein:
[0046] Step a1, establishing constraints of the flow variable based on the super period, the constraints include: a first constraint and a second constraint, wherein the first constraint includes: the flow variable minus the corresponding transmission delay is greater than or equal to the data flow start sending time corresponding to the p-th data sending period of the data sending end corresponding to the flow variable, and the second constraint includes: the flow variable is less than or equal to the data flow start sending time corresponding to the p+1-th data sending period of the data sending end corresponding to the flow variable, wherein p is equal to t+1, t∈[0,N], wherein N is equal to the quotient obtained by dividing the super period by the data sending period corresponding to the data sending end corresponding to the flow variable minus 1.
[0047] Step a2: Calculate the value corresponding to the flow variable based on the constraint condition corresponding to the flow variable.
[0048] As an example but not a limitation, citing the above example, assuming that the data transmission period corresponding to the first data stream and the data transmission period corresponding to the second data stream are 3us and 10us respectively, and the reference time starts from time 0, for the convenience of description, t corresponding to the first data sending end is recorded as i, and the flow variable corresponding to the first data sending end is recorded as x i , i∈[0,9], t corresponding to the second data sending end is recorded as j, and the flow variable corresponding to the second data sending end is recorded as y j , j∈[0,2], unit is us, x i The corresponding transmission delay is 1us, y j The corresponding transmission delay is 2us, for x i, based on the super period of 30us, the first constraint condition is established: 3×i≤x i -1; Second constraint: x i ≤3×(i+1); for y j , based on the super period 30us, the first constraint condition is established: 10×j≤y j -2; Second constraint: y j ≤10×(j+1). Based on the principle of satisfying the constraint condition, we can find the solution of x={1,4,7,10,13,16,19,22,25,28},y={2,12,22}. In this way, the value of the flow variable can be accurately calculated.
[0049] In some embodiments, the data streams within a super period satisfy a third condition, where the third condition is: the sum of target data of channels corresponding to all data streams within the super period is less than or equal to 1.
[0050] The target data of the channel corresponding to the data stream refers to the result of dividing the next hop transmission delay of the channel corresponding to the data stream by the corresponding data transmission period. The next hop transmission delay is equal to the current data stream size divided by the next hop bandwidth.
[0051] As an example but not limitation, assuming that the next-hop transmission delay of the channel corresponding to the first data stream and the next-hop transmission delay of the channel corresponding to the second data stream are 1 and 2 respectively, and the data sending period of the channel corresponding to the first data stream and the data sending period of the channel corresponding to the second data stream are 3 and 10 respectively, correspondingly, the data stream within the super period satisfies the third condition which can be expressed as: 1 / 3+2 / 10<1.
[0052] Optionally, after step S102, the method further includes: calculating the network utilization of the network based on the feature; correspondingly, calculating the values of the flow variables corresponding to the at least two data sending ends based on the super period, including: if the network utilization is less than or equal to 1, calculating the values of the flow variables corresponding to the at least two data sending ends based on the super period. When the network utilization is less than or equal to 1, it is possible to effectively avoid excessive transmission delay of the channel in the network.
[0053] The network utilization is a weighted average of channel utilizations of all channels in the network.
[0054] In some embodiments, if the network utilization is greater than 1, the process of generating the gating table is terminated, that is, the generation of the gating table is abandoned.
[0055] Step S105: Generate a gating table based on the values of the flow variables corresponding to the at least two data sending ends.
[0056] Specifically, a gating table is generated based on the values of the flow variables corresponding to the at least two data sending ends and the super period.
[0057] Optionally, the step S105 includes: sorting the values of the flow variables corresponding to the at least two data sending ends and the super period according to the priorities corresponding to the flow variables corresponding to the at least two data sending ends and the sizes of the values of the flow variables corresponding to the at least two data sending ends to obtain a sorting result; and generating a gating table according to the sorting result.
[0058] As an example but not limitation, the values of the flow variables corresponding to the at least two data sending ends and the super-period are sorted according to the priorities of the flow variables corresponding to the at least two data sending ends and the sizes of the values of the flow variables corresponding to the at least two data sending ends to obtain a sorting result, including: sorting the sizes of the values of the flow variables corresponding to the at least two data sending ends according to a strategy of ascending value size, the strategy of ascending value size means that smaller values are sorted before larger values, and when there are at least two identical values, the values with higher priorities among the identical values are sorted before the values with lower priorities; and the super-period is sorted at the end, so as to obtain a sorting result, that is, the last element in the sorting result is the super-period, and the sorting result is an ordered set.
[0059] In some embodiments, the last element in the sorting result is a super cycle. Correspondingly, generating a gating table based on the sorting result includes: determining the gating state of queues corresponding to all priorities in the bridge device corresponding to the super cycle time value as a gated open state, thereby generating a gating table.
[0060] For example, assuming that the super period is equal to 30 us, if the last element in the sorting result is the super period, the gating state of the queues corresponding to all priorities corresponding to the bridge device at the 30th us is determined to be the gating open state.
[0061] In addition, generating a gating table according to the sorting result may include: determining the gating states corresponding to queues of all priorities in the bridge device according to the sorting result; and generating a gating table according to the gating states corresponding to queues of all priorities.
[0062] In addition, in the present application, the elements in the sorting result are the time values in the sorting result.
[0063] In some embodiments, generating a gating table according to the sorting result includes: referring to the priority involved in the elements in the sorting result as the primary priority, and referring to all other priorities except the primary priority as the secondary priority, wherein the secondary priority is the priority that is irrelevant to all time values in the sorting result, that is, the secondary priority is the priority that is not involved in all elements in the sorting result. In addition, the serial number corresponding to the element in the sorting result is represented as q, for example, the q corresponding to the first element in the sorting result is equal to 1, and the q corresponding to the second element in the sorting result is equal to 2; the total number of elements in the sorting result is represented as Q. Determining the gating status corresponding to the queues corresponding to all priorities in the bridge device according to the sorting result; generating a gating table according to the gating status corresponding to the queues corresponding to all priorities includes: step b1, step b2, and step b3.
[0064] Step b1, let q=1, the initial value of the total time-consuming variable is 0, if the first time value in the sorting result is greater than the specified time, the specified time can be the basic time for the gating start, the specified time can be recorded as 0, then the gating state of the queues corresponding to all main priorities in the time period between the specified time and the first time value is determined as the gating closed state, and the gating state of the queues corresponding to all secondary priorities in the time period between the specified time and the first time value is determined as the gating open state; based on the time period between the specified time and the first time value, the total time-consuming variable is updated, wherein q is used to represent the sequence number corresponding to the time value in the sorting result, for example, q corresponding to the first time value in the sorting result is equal to 1, and q corresponding to the second time value in the sorting result is equal to 2; the main priority is the priority related to the time value in the sorting result, and the secondary priority is: the priority that is irrelevant to all time values in the sorting result, that is, the secondary priority is the priority that is not involved in all elements in the sorting result;
[0065] Step b2, according to the latest time value corresponding to q, the priority corresponding to the latest time value corresponding to q, and the transmission delay, determine the gating state and gating state duration corresponding to the queues corresponding to all priorities, and update the total time-consuming variable based on the gating state duration described in step b2;
[0066] Step b3, let q=q+1, that is, the latest q is equal to the previous q plus 1. If the latest q is less than Q, return to execute step b2; if the latest q is equal to Q, determine whether the latest total time variable is equal to the super period; if the latest total time variable is equal to the super period, form a gating table based on all determined gating states.
[0067] The total time consumption variable is used to represent: during the execution of step b1 and step b2, the real-time cumulative result of the duration of each gating state of a single priority level.
[0068] In some embodiments, determining the gating status corresponding to queues of all priorities in the bridge device according to the sorting result includes: determining the gating status corresponding to queues of all priorities in the bridge device according to the sorting result and the transmission delay corresponding to the key flow.
[0069] As an example but not limitation, assume that the key stream includes a first data stream and a second data stream, and the priority of the first data stream and the priority of the second data stream are 7 and 6 respectively. The larger the priority number, the higher the priority level. The transmission delay of the queue corresponding to the first data stream and the transmission delay of the queue corresponding to the second data stream are 1us and 2us respectively, and the super period is 30us. The value of the flow variable corresponding to the first data sending end is x={1,4,7,10,13,16,19,22,25,28}, and the value of the flow variable corresponding to the second data sending end is y={2,12,22}. Correspondingly, the sorting result is {1,2(y),4,7,10,12(y),13,16,19,22,22(y),25,28,30}, that is, the elements / time values in the sorting result include: 1, 2, 4, 7, 10, 12, 13, 16, 19, 22, 22, 25, 28, 30; correspondingly, the gating state of all priorities during the period from 0us to 1us is expressed as 00111111, the first digit 0 of 00111111 is used to indicate that the gating state corresponding to the queue corresponding to the first data flow during the period from 0us to 1us is 0, and 0 is used to indicate the gating off state, the second digit 0 of 00111111 is used to indicate that the gating state corresponding to the queue corresponding to the second data flow during the period from 0us to 1us is 0, and the gating states corresponding to other priorities are 1, and 1 is used to indicate the gating on state; then, the gating state of the queue corresponding to the first data flow during the period from 0us to 1us is 0, and the gating state corresponding to other priorities is 1, and 1 is used to indicate the gating on state; then, the gating state of the queue corresponding to the first data flow during the period from 0us to 1us is 0, and the gating state corresponding to the second data flow during the period from 0us to 1us is 0, and the gating state corresponding to the other priorities is 1, and the gating state corresponding to the first data flow during the period from 1us to 1us is 0, and the gating state corresponding to the first data flow during the period from 1us to 1us is 0, and the gating state corresponding to the second data flow during the period from 1us to 1us is 0, and the gating state corresponding to the other priorities is 1, and the gating state corresponding to the first data flow during the period from 1us to 1us ... The gating state of all priorities during the period from s to the 2us is expressed as 10000000, that is, the gating state of the priority corresponding to the first time value in the sorting result is determined as the gated open state, and the gating state corresponding to the queue corresponding to the other priorities is determined as the gated closed state, and the gating state corresponding to the queue corresponding to the priority is the gating state of the priority; the gating state of all priorities during the period from the 2us to the 4us is expressed as 01000000, the gating state of all priorities during the period from the 4us to the 5us is expressed as 10000000, and the gating state of all priorities during the period from the 5us to the 7us is expressed as 001 11111, when it is the 5th us, the total time variable is equal to 5us, and there is a gap of 2us between it and the next time value 7us in the sorting result. During the period from 5us to 7us, the gating state of all main priorities is determined to be the gate-off state, and the gating state of all secondary priorities is determined to be the gate-open state; during the period from 7us to 8us, the gating state of all priorities is expressed as 10000000, during the period from 8us to 10us, the gating state of all priorities is expressed as 00111111, and during the period from 10us to 11us, the gating state of all priorities is expressed as 10000000, and so on.
[0070] In addition, when it is determined that the gating state of all priorities during the period from 0us to 1us is expressed as 00111111, the total time variable is updated to 1us, that is, the latest total time variable is 1us; when it is determined that the gating state of all priorities during the period from 1us to 2us is 10000000, the latest total time variable is 2us; when it is determined that the gating state of all priorities during the period from 2us to 4us is 01000000, the latest total time variable is 4us; when it is determined that the gating state of all priorities during the period from 4us to 5us is 10000000, the latest total time variable is 5us.
[0071] In the present application, the method of generating the gating table is relatively convenient and fast, that is, the method of generating the gating table in the TSN scenario is highly efficient and can ensure low latency and low jitter of the TSN key flow.
[0072] Step S106: Control the operation of the bridge device according to the gating table.
[0073] Specifically, the gating table is sent to the bridge device, and the bridge device works based on the gating table. In this embodiment, the generated gating table can accurately avoid scheduling conflicts between data streams, and the data streams can pass through the bridge device according to the planned time and then be transmitted to the designated data receiving end, ensuring low latency and low jitter of TSN key streams, and ensuring that data streams corresponding to high priorities can pass first, making TSN easier to implement in some complex scenarios, which may include: industrial Internet, high-speed vehicle networks, etc.
[0074] In the embodiment of the present application, the gating table is generated by the above method; the bridge device is controlled to work according to the gating table, so that the bridge device can be controlled to work by the gating table to accurately avoid scheduling conflicts between data streams. The method of generating the gating table in the present application is relatively convenient and fast, that is, the method of generating the gating table is more efficient in the TSN scenario.
[0075] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0076] Embodiment 2
[0077] Corresponding to the control method of a device in a time-sensitive network described in the above embodiment, an embodiment of the present application provides a control device for a device in a time-sensitive network. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0078] The control device of the device in the time-sensitive network includes: a first acquisition unit 201, a second acquisition unit 202, a first calculation unit 203, a second calculation unit 204, a gating table generation unit 205 and a control unit 206, wherein:
[0079] The first acquisition unit 201 is used to acquire a network topology diagram in a TSN scenario, where the network topology diagram is a connection structure diagram of multiple electronic devices in a network, where the multiple electronic devices include: at least two data sending terminals that send data streams to the same bridge device and the bridge device;
[0080] A second acquisition unit 202 is used to acquire characteristics of all arrived data flows flowing to the bridge device based on the network topology diagram, wherein the arrived data flows are data flows that have reached the bridge device, the characteristics include a data sending period, and the arrived data flows include key flows;
[0081] A first calculation unit 203, configured to calculate a super period according to the data transmission periods corresponding to all the key flows, wherein the super period is the least common multiple of the data transmission periods corresponding to all the key flows;
[0082] A second calculation unit 204 is used to calculate the value of the flow variable corresponding to the at least two data sending ends based on the super period, the flow variable is used to indicate the time when the data flow to be arrived is planned to arrive at the bridge device, and the data flow to be arrived is the data flow to arrive at the bridge device;
[0083] A gating table generating unit 205, configured to generate a gating table based on the values of the flow variables corresponding to the at least two data sending ends;
[0084] The control unit 206 is used to control the operation of the bridge device according to the gating table.
[0085] Optionally, the control device of the equipment in the time-sensitive network also includes a third calculation unit, which is used to calculate the network utilization of the network based on the characteristics after the second acquisition unit 202 executes the method of acquiring the characteristics of all arrived data flows flowing to the bridge device based on the network topology map; correspondingly, when the second calculation unit 204 executes the method of calculating the values of the flow variables corresponding to the at least two data sending ends based on the super period, it is used to: if the network utilization is less than or equal to 1, then calculate the values of the flow variables corresponding to the at least two data sending ends based on the super period.
[0086] It should be noted that for technical details not described in detail in this embodiment, reference may be made to the control method for a device in a time-sensitive network provided in each embodiment in the above-mentioned embodiment 1.
[0087] Embodiment 3
[0088] The electronic device 3 in this embodiment includes: at least one processor 31, a memory 32, and a computer program 33 stored in the memory 32 and executable on the at least one processor 31. When the processor 31 executes the computer program 33, the steps in any of the above-mentioned control method embodiments for devices in a time-sensitive network are implemented.
[0089] When the processor 31 executes the computer program 33, the steps in the above-mentioned control method embodiments of the device in the time-sensitive network are implemented, for example: Figure 1 Alternatively, when the processor 31 executes the computer program 33, the functions of each unit in the above-mentioned device embodiments are realized, for example, the functions of the units 201 to 206.
[0090] Those skilled in the art will understand that this embodiment is merely an example of the electronic device 3 and does not constitute a limitation on the electronic device 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components, for example, it may also include input and output devices, network access devices, etc.
[0091] The processor 31 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0092] In some embodiments, the memory 32 may be an internal storage unit of the electronic device 3, such as a hard disk or memory of the electronic device 3. In other embodiments, the memory 32 may also be an external storage device of the electronic device 3, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 3. Further, the memory 32 may also include both an internal storage unit and an external storage device of the electronic device 3. The memory 32 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program 33. The memory 32 may also be used to temporarily store data that has been output or is to be output.
[0093] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0094] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0095] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program 33. When the computer program 33 is executed by the processor 31, the steps in the above-mentioned method embodiments can be implemented.
[0096] The embodiment of the present application provides a computer program 33 product. When the computer program 33 product runs on the electronic device 3, the electronic device 3 can implement the steps in the above-mentioned method embodiments when executing.
[0097] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program 33, and the computer program 33 can be stored in a computer-readable storage medium. When the computer program 33 is executed by the processor 31, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program 33 includes a computer program 33 code, and the computer program 33 code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program 33 code to the electronic device 3, a recording medium, a computer memory 32, a read-only memory 32 (ROM, Read-Only Memory), a random access memory 32 (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0098] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0099] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0100] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0101] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0102] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for controlling a device in a time-sensitive network, characterized in that: include: Acquire a network topology diagram in a TSN scenario, wherein the network topology diagram is a connection structure diagram of multiple electronic devices in a network, wherein the multiple electronic devices include: at least two data sending ends that send data streams to the same bridge device and the bridge device; Acquire characteristics of all arrived data flows flowing to the network bridge device based on the network topology diagram, the arrived data flows are data flows that have reached the network bridge device, the characteristics include a data sending cycle, and the arrived data flows include key flows; Calculating a super period according to the data transmission periods corresponding to all the key flows, wherein the super period is the least common multiple of the data transmission periods corresponding to all the key flows; Calculating the values of the flow variables corresponding to the at least two data sending ends based on the super period, the flow variables are used to indicate the time when the data flow to be arrived is planned to arrive at the bridge device, and the data flow to be arrived is the data flow to be arrived at the bridge device; Generate a gating table based on the values of the flow variables corresponding to the at least two data sending ends; The bridge device is controlled to operate according to the gating table.
2. The method for controlling a device in a time-sensitive network according to claim 1, characterized in that: The calculating, based on the super period, the values of the flow variables corresponding to the at least two data sending ends comprises: For each of the flow variables, perform the following steps: Establishing constraints for the flow variable based on the super period, the constraints include: a first constraint and a second constraint, wherein the first constraint includes: the flow variable minus the corresponding transmission delay is greater than or equal to the data flow start sending time corresponding to the p-th data sending period of the data sending end corresponding to the flow variable, and the second constraint includes: the flow variable is less than or equal to the data flow start sending time corresponding to the p+1-th data sending period of the data sending end corresponding to the flow variable, wherein p is equal to t+1, t∈[0,N], wherein N is equal to the quotient obtained by dividing the super period by the data sending period corresponding to the data sending end corresponding to the flow variable minus 1; The value corresponding to the flow variable is calculated based on the constraint condition corresponding to the flow variable.
3. The method for controlling a device in a time-sensitive network according to claim 1, characterized in that: The generating a gating table based on the values of the flow variables corresponding to the at least two data sending ends includes: According to the priorities corresponding to the flow variables corresponding to the at least two data sending ends and the values of the flow variables corresponding to the at least two data sending ends, sorting the values of the flow variables corresponding to the at least two data sending ends and the super period to obtain a sorting result; A gating table is generated according to the sorting result.
4. The method for controlling a device in a time-sensitive network according to claim 3, characterized in that: The last element in the sorting result is a super cycle. Correspondingly, generating a gating table according to the sorting result includes: The gating state of the queues corresponding to all priorities in the bridge device corresponding to the super period is determined to be a gating open state, and then a gating table is generated.
5. The method for controlling a device in a time-sensitive network according to claim 3, wherein: Generating a gating table according to the sorting result comprises: Determine the gating states corresponding to the queues of all priorities in the bridge device according to the sorting result; A gating table is generated according to the gating states corresponding to the queues corresponding to all the priorities.
6. The method for controlling a device in a time-sensitive network according to claim 3, characterized in that: Generating a gating table according to the sorting result comprises: Step b1, let q=1, the initial value of the total time-consuming variable is 0, if the first time value in the sorting result is greater than the specified time, then the gating state of the queues corresponding to all main priorities in the time period between the specified time and the first time value is determined as the gated closed state, and the gating state of the queues corresponding to all secondary priorities in the time period between the specified time and the first time value is determined as the gated open state; based on the time period between the specified time and the first time value, the total time-consuming variable is updated, wherein q is used to represent the sequence number corresponding to the time value in the sorting result, the main priority is the priority related to the time value in the sorting result, and the secondary priority is: the priority that is irrelevant to all time values in the sorting result; Step b2, according to the latest time value corresponding to q, the priority corresponding to the latest time value corresponding to q, and the transmission delay, determine the gating state and gating state duration corresponding to the queues corresponding to all priorities, and update the total time-consuming variable based on the gating state duration described in step b2; Step b3, let q=q+1. If the latest q is less than Q, return to execute the step b2; if the latest q is equal to Q, determine whether the latest total time variable is equal to the super period; if the latest total time variable is equal to the super period, form a gating table based on all determined gating states, wherein Q is used to represent the total number of elements in the sorting result.
7. The method for controlling a device in a time-sensitive network according to claim 1, characterized in that: After acquiring the characteristics of all data flows reaching the bridge device based on the network topology diagram, the method further comprises: calculating a network utilization rate of the network based on the characteristics; Correspondingly, the calculating, based on the super period, the values of the flow variables corresponding to the at least two data sending ends includes: If the network utilization is less than or equal to 1, the values of the flow variables corresponding to the at least two data sending ends are calculated based on the super period.
8. A control device for a device in a time-sensitive network, characterized in that: include: A first acquisition unit is used to acquire a network topology diagram in a TSN scenario, wherein the network topology diagram is a connection structure diagram of multiple electronic devices in a network, wherein the multiple electronic devices include: at least two data sending ends that send data streams to the same bridge device and the bridge device; A second acquisition unit is used to acquire characteristics of all arrived data flows flowing to the bridge device based on the network topology diagram, wherein the arrived data flows are data flows that have reached the bridge device, the characteristics include a data sending period, and the arrived data flows include key flows; A first calculation unit, configured to calculate a super period according to the data transmission periods corresponding to all the key flows, wherein the super period is the least common multiple of the data transmission periods corresponding to all the key flows; A second calculation unit, configured to calculate the value of a flow variable corresponding to the at least two data sending ends based on the super period, wherein the flow variable is used to indicate the time when the data flow to be arrived is scheduled to arrive at the bridge device, and the data flow to be arrived is a data flow to be arrived at the bridge device; A gating table generating unit, configured to generate a gating table based on the values of the flow variables corresponding to the at least two data sending ends; A control unit is used to control the operation of the bridge device according to the gating table.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
