A design method of adaptive time slot scheduling based on software definition

By using the AUTBUS bus and a software-defined adaptive time slot scheduling system, combined with the least squares method and genetic algorithm, the problem of unreasonable allocation of communication resources in industrial production sites was solved, and scientific and reasonable time slot allocation and efficient communication were achieved.

CN117434842BActive Publication Date: 2026-06-26SHENYANG UNIVERSITY OF TECHNOLOGY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENYANG UNIVERSITY OF TECHNOLOGY
Filing Date
2023-11-29
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

In industrial production sites, traditional buses cannot meet the requirements for bandwidth and real-time performance, and the allocation of TDMA time slots lacks a scientific basis, resulting in unreasonable allocation of communication resources and affecting communication efficiency.

Method used

A software-defined adaptive time slot scheduling method is adopted. By combining the AUTBUS bus with the software-defined adaptive time slot scheduling system, and using the least squares method and genetic algorithm, time slots and bandwidth resources are dynamically allocated to achieve a scientific and reasonable allocation of communication resources.

Benefits of technology

It improves channel utilization, ensures deterministic information transmission, meets actual production needs, achieves scientific and fair time slot allocation, simplifies communication architecture, and saves costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117434842B_ABST
    Figure CN117434842B_ABST
Patent Text Reader

Abstract

The application discloses a design method of adaptive time slot scheduling based on software definition, and relates to the field of industrial internet of things. An adaptive time slot scheduling system based on software definition is designed; a superframe length is set; production data of the current time is transmitted to a resource control layer by a production device through the superframe; production data to be allocated at the next time and priorities thereof are acquired; the resource control layer predicts the number of time slots required by the production data to be allocated at the next time of the production device according to the production data of the current time by using a time slot prediction algorithm; the resource control layer generates a time slot allocation scheduling scheme according to the predicted number of time slots, and issues the time slot allocation scheduling scheme to the superframe; the superframe issues the time slot allocation scheduling scheme to the production device, and the production device performs the current round of communication according to the time slot scheduling scheme. The application solves the problems of allocating time slots depending on production experience, being unable to scientifically and reasonably allocate communication resources, and low communication efficiency in an industrial production site.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial Internet of Things (IIoT), and more particularly to a design method for software-defined adaptive time slot scheduling. Background Technology

[0002] In current industrial production sites, various sensors, such as thermometers, level gauges, and cameras, are used to monitor and manage the production process. Different production equipment is connected via different fieldbuses, and the different communication protocols between these buses lead to delays and inaccuracies in the transmission of signals from the production equipment, resulting in a chaotic communication structure. Furthermore, with the advancement of technology, the requirements for bus systems in production sites are becoming increasingly demanding, and traditional bus systems can no longer meet the requirements for bandwidth and real-time performance.

[0003] The AUTBUS fieldbus supports communication between multiple buses such as CAN bus, Ethernet, and RS485. It features long-distance transmission, high bandwidth, strong real-time performance, and multi-node communication. Applying AUTBUS to industrial production sites can not only solve communication problems while maintaining the existing conditions, but also save production costs without requiring large-scale changes to the site.

[0004] In a production environment, sensors and cameras generate data with different characteristics due to their inherent properties. Sensor data is relatively small in volume and periodic; video stream data from cameras is unpredictable and large in volume. When these two types of data coexist in a scenario, ensuring both timely and accurate transmission of control information and small amounts of sensor data, while also guaranteeing sufficient bandwidth to support video stream transmission, becomes a significant challenge.

[0005] In industrial production sites, TDMA (Time Division Multiple Access) is often used for communication to ensure timely and accurate data transmission. Currently, time slot allocation in TDMA is mostly based on the production experience of field staff, lacking scientific basis and being highly subjective, which can easily lead to unreasonable allocation of communication resources. Therefore, it is necessary to design a method that can allocate time slots in real time according to production conditions to rationally allocate communication resources such as time slots and bandwidth. Summary of the Invention

[0006] To address the shortcomings of existing technologies, this invention provides a software-defined adaptive time slot scheduling design method to solve problems such as reliance on production experience for time slot allocation, inability to scientifically and rationally allocate communication resources, and low communication efficiency in industrial production sites. It introduces AUTBUS into industrial production and invents a software-defined (SDN) adaptive time slot scheduling design method. Based on the overall network communication scale and maximum retransmission count, suitable superframes are configured; then, the required communication time slots for nodes are predicted using the least squares method; and finally, a genetic algorithm is used for time slot allocation.

[0007] The technical solution of this invention is as follows:

[0008] A software-defined adaptive time slot scheduling design method includes the following steps:

[0009] Step 1: Design a software-defined adaptive time slot scheduling system;

[0010] The software-defined adaptive time slot scheduling system comprises two parts: a network resource management module and a field module.

[0011] The network resource management module is used to receive the current production data sent by the field module, process and analyze the current production data to obtain a time slot scheduling scheme, and send the time slot scheduling scheme to the field module.

[0012] The field module consists of N production devices connected by an AUTBUS bus. It is used to receive time slot scheduling schemes sent by the network resource management module. The production devices perform the current round of communication according to the time slot scheduling scheme and send the production data of the next moment to the network resource management module.

[0013] Furthermore, the network resource management module includes a software-defined layer, a resource control layer, a superframe and a clock synchronization layer;

[0014] The resource control layer is used to receive the superframe setting information for the next moment set by the staff through a programmable interface, and send the obtained superframe setting information for the next moment to the software-defined layer; receive the current production data of N production equipment sent by the superframe, use the time slot prediction algorithm to obtain the predicted number of time slots for the next moment based on the current production data of N production equipment, use the time slot allocation algorithm to obtain the time slot scheduling scheme for the next moment based on the number of time slots for the next moment, and send it to the superframe; receive the superframe setting information for the next moment sent by the software-defined layer, and set the superframe according to the superframe setting information for the next moment sent by the software-defined layer; receive the time control information sent by the clock synchronization layer, send the time control information to the superframe, and send it to the software-defined layer through the programmable interface;

[0015] The software-defined layer is used to receive the superframe setting information for the next moment sent by the resource control layer, update the superframe setting information for the current moment, and send the superframe setting information for the next moment to the resource control layer through a programmable interface; and to receive time control information sent by the resource control layer.

[0016] The superframe is used to receive the current production data of N production devices connected by the AUTBUS bus in the field module and send the current production data to the resource control layer; the superframe receives the time slot scheduling scheme for the next moment sent by the resource control layer and sends the time slot scheduling scheme for the next moment to the N production devices in the field module; it also receives the time control information sent by the resource control layer and sends it to the field module.

[0017] The clock synchronization layer is used to send time control information to the resource control layer to achieve network-wide time synchronization.

[0018] Furthermore, the resource control layer includes a superframe management module, a time slot number prediction module, and a dynamic time slot allocation module;

[0019] The superframe management module is used to receive the superframe setting information for the next moment sent by the software-defined layer and set the superframe according to the superframe setting information for the next moment; and to receive the time control information sent by the time control layer and send it to the superframe.

[0020] The time slot number prediction module is used to predict the number of time slots required by the production equipment based on the production data at the current moment, obtain the number of time slots at the next moment, and send it to the dynamic time slot allocation module; and receive time control information sent by the time control layer.

[0021] The dynamic time slot allocation module is used to generate a time slot scheduling scheme for the production equipment in the next moment based on the number of time slots in the next moment and send it to the superframe; and to receive time control information sent by the time control layer.

[0022] Furthermore, the superframe comprises three parts: a beacon, a control time slot, and a data time slot;

[0023] The beacon is used to receive time control information sent by the superframe management module and send it to the field module to achieve network clock synchronization;

[0024] The control time slot is used for the field module to interact with the resource control layer on the time slot scheduling scheme.

[0025] The data time slots are used for production equipment to transmit production data;

[0026] Step 2: Set the lengths of the beacon, control slot, and data slot in the superframe;

[0027] Step 2.1: The staff sends the superframe setting information for the next moment to the resource control layer through the programmable interface. The resource control layer then forwards the superframe setting information to the software-defined layer using the programmable interface.

[0028] Step 2.2: The software-defined layer receives the superframe setting information for the next time step from the resource control layer, updates the superframe setting information for the current time step, and sends the superframe setting information for the next time step to the resource control layer through the programmable interface;

[0029] Step 2.3: The resource control layer sets the lengths of the beacon, control slots, and data slots according to the superframe settings information through the programmable interface;

[0030] The beacon has a length of T. B The control time slot length is T. C The data time slot length is T. D It consists of m elements of length T S It consists of hourly gaps.

[0031] Step 3: The production equipment transmits the current production data to the resource control layer via superframe;

[0032] Step 4: Obtain the production data to be allocated in the next moment and its priority;

[0033] Step 5: The resource control layer uses a time slot prediction algorithm based on the current production data to predict the number of time slots required for the production data to be allocated to the production equipment in the next moment, and obtains the predicted number of time slots.

[0034] Step 5.1: Collect historical data from each production device to obtain a historical data set D; the historical data includes the historical data volume T. i and T i The corresponding required number of time slots S i ;

[0035] The historical data set D is:

[0036] D={(T1,S1), (T2,S2),..., (T n ,S n )} (1)

[0037] Where D is the historical data set; T i Let S be the amount of historical data in the i-th set of historical data. i For T i The corresponding number of time slots required; n is the number of historical data sets.

[0038] Step 5.2: Based on the historical data volume of the production equipment and the corresponding required number of time slots, obtain the time slot prediction function f(T) using the least squares method. i The predicted number of time slots is obtained using the time slot prediction function.

[0039] Step 5.2.1: Based on the historical data volume of the production equipment and the corresponding required number of time slots, generate the time slot prediction function f(T) using the least squares method. i );

[0040] The time slot prediction function f(T) i )for:

[0041] f(T i )=ωT i +b (2)

[0042] Here, ω and b are two parameters of the time slot prediction function.

[0043] Step 5.2.2: Solve for the time slot prediction function f(T) using mean square error. i The parameters ω and b in )

[0044] The time slot prediction function f(T) is solved using mean square error. i The specific methods for handling parameters ω and b in the formula are as follows:

[0045] First, establish the error function ξ, then obtain the optimization function based on the error function, and use the optimization function to solve for ω and b;

[0046] The error function ξ is defined as follows:

[0047]

[0048] Where ξ is the error function;

[0049] The optimization function is:

[0050]

[0051] The method for solving ω and b using an optimization function is as follows:

[0052]

[0053]

[0054]

[0055]

[0056] in, The average of the historical data volume. This represents the average number of time slots required.

[0057] Step 5.2.3: Substitute the production data obtained in Step 3 into the time slot prediction function to obtain the predicted number of time slots;

[0058] Step 6: The resource control layer generates a time slot allocation scheduling scheme based on the predicted number of time slots using a time slot allocation algorithm, and then sends the time slot allocation scheduling scheme to the superframe.

[0059] Step 6.1: Establish a time slot allocation model;

[0060]

[0061]

[0062]

[0063]

[0064]

[0065]

[0066]

[0067]

[0068] k is the number of nodes in the network; j is the node index; m is the number of data slots in the superframe; x j The number of time slots ultimately allocated to each node; α j Indicates whether the current node needs to transmit data, when α j When β = 0, the node transmits no data; otherwise, it does. lj This represents the allocation relationship between time slots and nodes, when β lj =1 indicates that node j occupies the l-th time slot; otherwise, it is 0. For the maximum allowable delay, T SP T is the length of the entire superframe. B T is the time slot length of the Beacon. C To control the time slot length, T S It is the length of a single data slot, l is a natural number, l∈[0,∞); l is the number of data slots used.

[0069] Step 6.2: Based on the predicted number of time slots, a genetic algorithm is used as the time slot allocation algorithm to generate a time slot allocation scheduling scheme according to the established time slot allocation model, and time slots are distributed according to the scheduling scheme.

[0070] Step 6.2.1: Establish input matrix U, which is a k-row, 4-column matrix, where k is the number of nodes in the network. The first column of input matrix U is the predicted number of time slots, the second column is the actual number of time slots at the previous moment, the third column is the priority of the production data to be allocated, and the fourth column is the node number.

[0071] Step 6.2.2: Set the population size n, crossover probability pc, mutation probability pm, maximum number of iterations maxgen, priority M, and an empty matrix F used to store the time slot scheduling scheme; the chromosome refers to the time slot scheduling scheme, and the gene refers to the order of time slot scheduling.

[0072] Step 6.2.3: Randomly generate n chromosomes to form an initial population. Each chromosome is a k-row, 2-column matrix, where the first column is a randomly generated natural number representing the order of time slot scheduling, and the second column is the priority of the production data to be allocated in the input matrix U. Each chromosome represents a time slot scheduling scheme, and the genes on it represent the order of time slot scheduling.

[0073] Step 6.2.4: Set the current iteration number gen to 0;

[0074] Step 6.2.5: Calculate the fitness value of each chromosome in the current population; the fitness value is the sum of the number of time slots of production data to be assigned for all priorities;

[0075] Step 6.2.6: Randomly select two chromosomes from the current population, compare the fitness values ​​of the two chromosomes, select the chromosome with the smaller fitness value as the parent chromosome, and then randomly select one chromosome from the current population as the mother chromosome.

[0076] Step 6.2.7: Generate a random number between (0,1). If the random number is less than the crossover probability pc, perform a crossover operation on the parent chromosome and the mother chromosome. Otherwise, do not perform a crossover operation and directly use the parent chromosome as the new chromosome.

[0077] The method of the crossover operation is as follows: take the first column of data from the parent chromosome as the first column of data of the new chromosome, and take the second column of data from the mother chromosome as the second column of data of the new chromosome to obtain a new chromosome;

[0078] Step 6.2.8: Generate a random number between (0,1). If the random number is less than the mutation probability pm, perform a mutation operation to obtain the result. Then, reorder the input matrix according to the time slot scheduling order in the chromosome and store it in an empty matrix F; otherwise, directly reorder the input matrix according to the time slot scheduling order in the chromosome generated in Step 6.2.7 and store it in an empty matrix F.

[0079] The mutation operation method is as follows: Increment the priority of all data in the second column of the current chromosome by 1, find the index of the row in the chromosome whose priority is greater than the set priority M, then find the predicted number of time slots corresponding to these rows in the input matrix U according to the index, calculate the average value of the found predicted time slots, and round the average value to the nearest integer to obtain the update value. Finally, update the found predicted time slots to the calculated update value.

[0080] The method for reordering the input matrix according to the time slot scheduling order in the chromosome is as follows: according to the time slot scheduling order q of the p-th row in the chromosome, the data in the p-th row of the input matrix U is placed in the q-th row.

[0081] Step 6.2.9: Add the chromosome obtained in step 6.2.8 to the current population;

[0082] Step 6.2.10: Increment the iteration count by 1;

[0083] Step 6.2.11: Determine if the number of iterations has reached the maximum number of iterations maxgen. If yes, proceed to step 6.2.12; otherwise, proceed to step 6.2.5.

[0084] Step 6.2.12: Find the chromosome corresponding to the minimum fitness value, and then find the reordered input matrix corresponding to the chromosome in the empty matrix F. That is, find a set of predicted time slots, actual time slots at the previous time step, priority and number corresponding to the minimum fitness value, and finally obtain the scheduling scheme S with the minimum total number of time slots.

[0085] Step 6.2.13: Arrange the time slot allocation scheduling scheme S in descending order of priority in the third column, and in descending order of time slot satisfaction among the same priority, to obtain the order of time slot scheduling of the production data to be allocated, and update the order of time slot scheduling in the chromosome accordingly; the time slot satisfaction refers to the absolute value of the difference between the actual number of time slots needed at the previous time and the number of time slots allocated at the previous time.

[0086] Step 6.2.14: Take the first, third and fourth columns of the sorted time slot allocation scheduling scheme S to generate the final time slot allocation scheduling scheme. The time slot allocation scheduling scheme is a k-row, 3-column matrix. The first column is the predicted number of time slots, the second column is the priority, and the third column is the corresponding node number.

[0087] Step 6.2.15: Send the final time slot allocation scheduling scheme to the superframe;

[0088] Step 7: The superframe sends the time slot allocation scheduling scheme to the production equipment, and the production equipment performs this round of communication according to the time slot scheduling scheme;

[0089] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0090] This invention introduces the next-generation fieldbus AUTBUS, enabling communication with currently used Ethernet, CAN, RS485, etc., without additional overhead, simplifying the communication architecture and saving costs. Simultaneously, the designed software-defined adaptive time slot scheduling method eliminates the need for field personnel to allocate time slots based on experience, achieving more scientific and rational time slot allocation. It allocates the number of time slots according to node communication needs, improving channel utilization; uses TDMA for time slot allocation to ensure deterministic information transmission; divides nodes into different priorities, conforming to actual production; and compensates nodes with high time slot satisfaction during time slot allocation, ensuring fairness in time slot allocation. Attached Figure Description

[0091] Figure 1 This is a superframe diagram in this embodiment;

[0092] Figure 2 This is a diagram of the dynamic TDMA structure in this embodiment;

[0093] Figure 3 This is a flowchart of a software-defined adaptive time slot scheduling design method in this embodiment. Detailed Implementation

[0094] The main idea of ​​this invention is to address the problems of the variety of fieldbuses used in current industrial production sites, the complexity of communication structures, the coexistence of various types of data, and the inability to rationally allocate communication resources. This invention introduces the next-generation industrial broadband bus AUTBUS to uniformly configure the network. At the same time, it designs a software-defined adaptive time slot scheduling method. Under the premise of ensuring deterministic communication, it predicts and allocates time slots according to the needs of each node, thereby improving channel utilization and ensuring communication quality.

[0095] AUTBUS can communicate with buses such as Ethernet, CAN, and RS485, and boasts advantages such as high bandwidth, high real-time performance, and long-distance transmission capabilities. Applying AUTBUS to industrial production can simplify current communication architectures and eliminate the need for additional signal conversion equipment, thus saving costs. In AUTBUS communication, each terminal is considered a node, meaning each field device is a node, and each node transmits information through its assigned time slots. Currently, time slot allocation is configured by field personnel based on experience, lacking a scientific allocation system. Therefore, implementing adaptive time slot allocation based on AUTBUS is essential.

[0096] This invention, combined with practical industrial production, designs a software-defined adaptive time-slot scheduling method. The system consists of two parts: a network resource management module and a field module. Each device in the field module is connected via an AUTBUS bus. Information is transmitted between these two parts through a designed superframe, such as... Figure 1 As shown; the network resource management module includes a software-defined layer, a resource control layer, a clock synchronization layer, and a superframe. The software-defined layer and the resource control layer interact through a programmable interface. The system structure is as follows: Figure 2 As shown, the software-defined layer can change superframes according to actual production needs through a programmable interface. The resource control layer can not only manage superframes but also predict the number of time slots required by each device in the entire network. Finally, production data is prioritized according to data characteristics, and the predicted time slots are allocated according to priority. The workflow of the entire system is as follows: Figure 3 As shown, the present invention will now be described in further detail.

[0097] A software-defined adaptive time slot scheduling design method, such as Figure 3 As shown, it includes the following steps:

[0098] Step 1: Design a software-defined adaptive time slot scheduling system;

[0099] The software-defined adaptive time slot scheduling system comprises two parts: a network resource management module and a field module.

[0100] The network resource management module is used to receive the current production data sent by the field module, process and analyze the current production data to obtain a time slot scheduling scheme, and send the time slot scheduling scheme to the field module.

[0101] The field module consists of N production devices connected by an AUTBUS bus. It is used to receive time slot scheduling schemes sent by the network resource management module. The production devices perform the current round of communication according to the time slot scheduling scheme and send the production data of the next moment to the network resource management module.

[0102] Furthermore, the network resource management module includes a software-defined layer, a resource control layer, a superframe and a clock synchronization layer;

[0103] The resource control layer is used to receive the superframe setting information for the next moment set by the staff through a programmable interface, and send the obtained superframe setting information for the next moment to the software-defined layer; receive the current production data of N production equipment sent by the superframe, use the time slot prediction algorithm to obtain the predicted number of time slots for the next moment based on the current production data of N production equipment, use the time slot allocation algorithm to obtain the time slot scheduling scheme for the next moment based on the number of time slots for the next moment, and send it to the superframe; receive the superframe setting information for the next moment sent by the software-defined layer, and set the superframe according to the superframe setting information for the next moment sent by the software-defined layer; receive the time control information sent by the clock synchronization layer, send the time control information to the superframe, and send it to the software-defined layer through the programmable interface;

[0104] The software-defined layer is used to receive the superframe setting information for the next moment sent by the resource control layer, update the superframe setting information for the current moment, and send the superframe setting information for the next moment to the resource control layer through a programmable interface; and to receive time control information sent by the resource control layer.

[0105] The superframe is used to receive the current production data of N production devices connected by the AUTBUS bus in the field module and send the current production data to the resource control layer; the superframe receives the time slot scheduling scheme for the next moment sent by the resource control layer and sends the time slot scheduling scheme for the next moment to the N production devices in the field module; it also receives the time control information sent by the resource control layer and sends it to the field module.

[0106] The clock synchronization layer is used to send time control information to the resource control layer to achieve network-wide time synchronization.

[0107] Furthermore, the resource control layer includes a superframe management module, a time slot number prediction module, and a dynamic time slot allocation module;

[0108] The superframe management module is used to receive the superframe setting information for the next moment sent by the software-defined layer and set the superframe according to the superframe setting information for the next moment; and to receive the time control information sent by the time control layer and send it to the superframe.

[0109] The time slot number prediction module is used to predict the number of time slots required by the production equipment based on the production data at the current moment, obtain the number of time slots at the next moment, and send it to the dynamic time slot allocation module; and receive time control information sent by the time control layer.

[0110] The dynamic time slot allocation module is used to generate a time slot scheduling scheme for the production equipment in the next moment based on the number of time slots in the next moment and send it to the superframe; and to receive time control information sent by the time control layer.

[0111] Furthermore, the superframe comprises three parts: a beacon, a control time slot, and a data time slot;

[0112] The beacon is used to receive time control information sent by the superframe management module and send it to the field module to achieve network clock synchronization;

[0113] The control time slot is used for the field module to interact with the resource control layer on the time slot scheduling scheme.

[0114] The data time slots are used for production equipment to transmit production data;

[0115] Step 2: Set the lengths of the beacon, control slot, and data slot in the superframe;

[0116] Step 2.1: The staff sends the superframe setting information for the next moment to the resource control layer through the programmable interface. The resource control layer then forwards the superframe setting information to the software-defined layer using the programmable interface.

[0117] Step 2.2: The software-defined layer receives the superframe setting information for the next time step from the resource control layer, updates the superframe setting information for the current time step, and sends the superframe setting information for the next time step to the resource control layer through the programmable interface;

[0118] Step 2.3: The resource control layer sets the lengths of the beacon, control slots, and data slots according to the superframe settings information through the programmable interface;

[0119] In this embodiment, the Beacon length is T. B The control time slot length is T. C The data time slot length is T. D It consists of m elements of length T S It consists of hourly gaps.

[0120] Step 3: The production equipment transmits the current production data to the resource control layer via superframe;

[0121] Step 4: Obtain the production data to be allocated in the next moment and its priority;

[0122] Step 5: The resource control layer uses a time slot prediction algorithm based on the current production data to predict the number of time slots required for the production data to be allocated to the production equipment in the next moment, and obtains the predicted number of time slots.

[0123] Step 5.1: Collect historical data from each production device to obtain a historical data set D; the historical data includes the historical data volume T. i and T i The corresponding required number of time slots S i ;

[0124] Given n sets of historical data, D can be represented as:

[0125] D={(T1,S1), (T2,S2),..., (T n ,S n )} (1)

[0126] Where D is the historical data set; T i Let S be the amount of historical data in the i-th set of historical data. i For T i The corresponding number of time slots required; n is the number of historical data sets.

[0127] Step 5.2: Based on the historical data volume of the production equipment and the corresponding required number of time slots, obtain the time slot prediction function f(T) using the least squares method. i The predicted number of time slots is obtained using the time slot prediction function.

[0128] Step 5.2.1: Based on the historical data volume of the production equipment and the corresponding required number of time slots, generate the time slot prediction function f(T) using the least squares method. i );

[0129] In this implementation method, since only the amount of historical data T is considered in the least squares method... i This factor, therefore, sets the time slot prediction function f(T) i The equation is a linear equation, as shown below:

[0130] f(T i )=ωT i +b (2)

[0131] Here, ω and b are two parameters of the time slot prediction function.

[0132] Step 5.2.2: Solve for the time slot prediction function f(T) using mean square error. i The parameters ω and b in )

[0133] The purpose of time slot prediction is to make S i With f(T) i To find the best prediction function, we use mean squared error to solve for ω and b, making the two values ​​as equal as possible.

[0134] The time slot prediction function f(T) is solved using mean square error. i The specific methods for handling parameters ω and b in the formula are as follows:

[0135] First, establish the error function ξ, then obtain the optimization function based on the error function, and use the optimization function to solve for ω and b;

[0136] The error function ξ is defined as follows:

[0137]

[0138] Where ξ is the error function;

[0139] The optimization function is:

[0140]

[0141] The method for solving ω and b using an optimization function is as follows:

[0142]

[0143]

[0144]

[0145]

[0146] in, The average of the historical data volume. This represents the average number of time slots required.

[0147] Step 5.2.3: Substitute the production data obtained in Step 3 into the time slot prediction function to obtain the predicted number of time slots;

[0148] Step 6: The resource control layer generates a time slot allocation scheduling scheme based on the predicted number of time slots using a time slot allocation algorithm, and then sends the time slot allocation scheduling scheme to the superframe.

[0149] Step 6.1: Establish a time slot allocation model;

[0150]

[0151]

[0152]

[0153]

[0154]

[0155]

[0156]

[0157]

[0158] k is the number of nodes in the network; j is the node index; m is the number of data slots in the superframe; xj The number of time slots ultimately allocated to each node, x in formula (9) j It is the sum of the total number of time slots actually allocated; α j This indicates whether the current node needs to transmit data. In formula (10), when α j When β = 0, the node transmits no data; otherwise, it does. lj This represents the allocation relationship between time slots and nodes, when β lj =1 indicates that node j occupies the l-th time slot, otherwise it is 0; Formula (12) indicates that a time slot can only be allocated to one node; Formula (13) states that the total number of time slots allocated to each node should be less than the number of available time slots m; Formula (14) can guarantee the delay requirement, where For the maximum allowable delay, T SP T is the length of the entire superframe. B T is the time slot length of the Beacon. C To control the time slot length, T S is the length of a single data slot, where l is a natural number (l∈[0,∞). l is the number of data slots used.

[0159] Step 6.2: Based on the predicted number of time slots, a genetic algorithm is used as the time slot allocation algorithm to generate a time slot allocation scheduling scheme according to the established time slot allocation model, and time slots are distributed according to the scheduling scheme.

[0160] This implementation introduces the concept of time slot satisfaction, which refers to the absolute value of the difference between the actual needed time slots and the allocated time slots. It measures the time slot allocation situation; the lower the satisfaction level, the more the allocated time slots meet the actual needs, and vice versa. This implementation uses a genetic algorithm as the time slot allocation algorithm.

[0161] Step 6.2.1: Establish input matrix U, which is a k-row, 4-column matrix, where k is the number of nodes in the network. The first column of input matrix U is the predicted number of time slots, the second column is the actual number of time slots at the previous moment, the third column is the priority of the production data to be allocated, and the fourth column is the node number.

[0162] Step 6.2.2: Set the population size n, crossover probability pc, mutation probability pm, maximum number of iterations maxgen, priority M, and an empty matrix F to store the time slot scheduling scheme; in this genetic algorithm, chromosome refers to the time slot scheduling scheme, and gene refers to the order of time slot scheduling.

[0163] Step 6.2.3: Randomly generate n chromosomes to form an initial population. Each chromosome is a k-row, 2-column matrix, where the first column is a randomly generated natural number representing the order of time slot scheduling, and the second column is the priority of the production data to be allocated in the input matrix U. Each chromosome represents a time slot scheduling scheme, and the genes on it represent the order of time slot scheduling.

[0164] Step 6.2.4: Set the current iteration number gen to 0;

[0165] Step 6.2.5: Calculate the fitness value of each chromosome in the current population; the fitness value is the sum of the number of time slots of production data to be assigned for all priorities;

[0166] Step 6.2.6: Randomly select two chromosomes from the current population, compare the fitness values ​​of the two chromosomes, select the chromosome with the smaller fitness value as the parent chromosome, and then randomly select one chromosome from the current population as the mother chromosome.

[0167] Step 6.2.7: Generate a random number between (0,1). If the random number is less than the crossover probability pc, perform a crossover operation on the parent chromosome and the mother chromosome. Otherwise, do not perform a crossover operation and directly use the parent chromosome as the new chromosome.

[0168] The method of the crossover operation is as follows: take the first column of data from the parent chromosome as the first column of data of the new chromosome, and take the second column of data from the mother chromosome as the second column of data of the new chromosome to obtain a new chromosome;

[0169] Step 6.2.8: Generate a random number between (0,1). If the random number is less than the mutation probability pm, perform a mutation operation to obtain the result. Then, reorder the input matrix according to the time slot scheduling order in the chromosome and store it in an empty matrix F; otherwise, directly reorder the input matrix according to the time slot scheduling order in the chromosome generated in Step 6.2.7 and store it in an empty matrix F.

[0170] The mutation operation method is as follows: Increment the priority of all data in the second column of the current chromosome by 1, find the index of the row in the chromosome whose priority is greater than the set priority M, then find the predicted number of time slots corresponding to these rows in the input matrix U according to the index, calculate the average value of the found predicted time slots, and round the average value to the nearest integer to obtain the update value. Finally, update the found predicted time slots to the calculated update value.

[0171] The method for reordering the input matrix according to the time slot scheduling order in the chromosome is as follows: according to the time slot scheduling order q of the p-th row in the chromosome, the data in the p-th row of the input matrix U is placed in the q-th row.

[0172] Step 6.2.9: Add the chromosome obtained in step 6.2.8 to the current population;

[0173] Step 6.2.10: Increment the iteration count by 1;

[0174] Step 6.2.11: Determine if the number of iterations has reached the maximum number of iterations maxgen. If yes, proceed to step 6.2.12; otherwise, proceed to step 6.2.5.

[0175] Step 6.2.12: Find the chromosome corresponding to the minimum fitness value, and then find the reordered input matrix corresponding to the chromosome in the empty matrix F. That is, find a set of predicted time slots, actual time slots at the previous time step, priority and number corresponding to the minimum fitness value, and finally obtain the scheduling scheme S with the minimum total number of time slots.

[0176] Step 6.2.13: Arrange the time slot allocation scheduling scheme S in descending order of priority in the third column, and in descending order of time slot satisfaction among the same priority, to obtain the order of time slot scheduling of the production data to be allocated, and update the order of time slot scheduling in the chromosome accordingly; the time slot satisfaction refers to the absolute value of the difference between the actual number of time slots needed at the previous time and the number of time slots allocated at the previous time.

[0177] Step 6.2.14: Take the first, third and fourth columns of the sorted time slot allocation scheduling scheme S to generate the final time slot allocation scheduling scheme. The time slot allocation scheduling scheme is a k-row, 3-column matrix. The first column is the predicted number of time slots, the second column is the priority, and the third column is the corresponding node number.

[0178] Step 6.2.15: Send the final time slot allocation scheduling scheme to the superframe;

[0179] Step 7: The superframe sends the time slot allocation scheduling scheme to the production equipment, and the production equipment performs this round of communication according to the time slot scheduling scheme;

[0180] In summary: First, the lengths of the Beacon, control slots, and data slots in the superframe are set. Then, the least squares method is used to generate a slot prediction function based on the historical data of each node, and the number of slots required for the next data moment is predicted based on this function. Finally, a genetic algorithm is used to allocate slots according to the priority of the field nodes, with higher priority slots allocated first among different priority nodes, and slots with higher satisfaction among the same priority nodes allocated first.

[0181] This invention simplifies the field communication structure and achieves deterministic transmission using TDMA communication; predicting time slots based on data volume avoids uneven time slot allocation and improves the overall utilization of communication resources; allocating time slots based on priority ensures that important information is transmitted first, which is in line with actual production; and introducing time slot satisfaction and prioritizing allocation to those with higher satisfaction improves the fairness of time slot allocation.

Claims

1. A design method for software-defined adaptive time slot scheduling, characterized in that, Includes the following steps: Step 1: Design a software-defined adaptive time slot scheduling system; The software-defined adaptive time slot scheduling system comprises two parts: a network resource management module and a field module; the network resource management module includes a software-defined layer, a resource control layer, a superframe and clock synchronization layer. Step 2: Set the lengths of the beacon, control slot, and data slot in the superframe; Step 3: The production equipment transmits the current production data to the resource control layer via superframe; Step 4: Obtain the production data to be allocated in the next moment and its priority; Step 5: The resource control layer uses a time slot prediction algorithm based on the current production data to predict the number of time slots required for the production data to be allocated to the production equipment in the next moment, and obtains the predicted number of time slots. Step 6: The resource control layer generates a time slot allocation scheduling scheme based on the predicted number of time slots using a time slot allocation algorithm, and then sends the time slot allocation scheduling scheme to the superframe. Step 7: The superframe sends the time slot allocation scheduling scheme to the production equipment, and the production equipment performs this round of communication according to the time slot scheduling scheme.

2. The design method for software-defined adaptive time slot scheduling according to claim 1, characterized in that, The network resource management module mentioned in step 1 is used to receive the production data of the current moment sent by the field module, process and analyze the production data of the current moment to obtain the time slot scheduling scheme, and send the time slot scheduling scheme to the field module. The field module consists of N production devices connected by an AUTBUS bus. It is used to receive time slot scheduling schemes sent by the network resource management module. The production devices perform the current round of communication according to the time slot scheduling scheme and send the production data of the next moment to the network resource management module.

3. The design method for software-defined adaptive time slot scheduling according to claim 1, characterized in that, The resource control layer described in step 1 is used to receive the superframe setting information for the next moment set by the staff through a programmable interface, and send the obtained superframe setting information for the next moment to the software-defined layer; receive the current production data of N production equipment sent by the superframe, use the time slot prediction algorithm to obtain the predicted number of time slots for the next moment based on the current production data of N production equipment, use the time slot allocation algorithm to obtain the time slot scheduling scheme for the next moment based on the number of time slots for the next moment, and send it to the superframe; receive the superframe setting information for the next moment sent by the software-defined layer, and set the superframe according to the superframe setting information for the next moment sent by the software-defined layer; receive the time control information sent by the clock synchronization layer, send the time control information to the superframe, and send it to the software-defined layer through the programmable interface; The software-defined layer is used to receive the superframe setting information for the next moment sent by the resource control layer, update the superframe setting information for the current moment, and send the superframe setting information for the next moment to the resource control layer through a programmable interface; and to receive time control information sent by the resource control layer. The superframe is used to receive the current production data of N production devices connected by the AUTBUS bus in the field module and send the current production data to the resource control layer; the superframe receives the time slot scheduling scheme for the next moment sent by the resource control layer and sends the time slot scheduling scheme for the next moment to the N production devices in the field module; it also receives the time control information sent by the resource control layer and sends it to the field module. The clock synchronization layer is used to send time control information to the resource control layer to achieve network-wide time synchronization.

4. The design method for software-defined adaptive time slot scheduling according to claim 3, characterized in that, The resource control layer includes a superframe management module, a time slot number prediction module, and a dynamic time slot allocation module; The superframe management module is used to receive the superframe setting information for the next moment sent by the software-defined layer and set the superframe according to the superframe setting information for the next moment; and to receive the time control information sent by the time control layer and send it to the superframe. The time slot number prediction module is used to predict the number of time slots required by the production equipment based on the production data at the current moment, obtain the number of time slots at the next moment, and send it to the dynamic time slot allocation module; and receive time control information sent by the time control layer. The dynamic time slot allocation module is used to generate a time slot scheduling scheme for the production equipment in the next moment based on the number of time slots in the next moment and send it to the superframe; and to receive time control information sent by the time control layer.

5. The design method for software-defined adaptive time slot scheduling according to claim 3, characterized in that, The superframe consists of three parts: a beacon, a control time slot, and a data time slot. The beacon is used to receive time control information sent by the superframe management module and send it to the field module to achieve network clock synchronization. The control time slot is used for the field module to interact with the resource control layer on the time slot scheduling scheme. The data time slots are used for production equipment to transmit production data.

6. The design method for software-defined adaptive time slot scheduling according to claim 1, characterized in that, Step 2 includes: Step 2.1: The staff sends the superframe setting information for the next moment to the resource control layer through the programmable interface. The resource control layer then forwards the superframe setting information to the software-defined layer using the programmable interface. Step 2.2: The software-defined layer receives the superframe setting information for the next time step from the resource control layer, updates the superframe setting information for the current time step, and sends the superframe setting information for the next time step to the resource control layer through the programmable interface; Step 2.3: The resource control layer sets the lengths of the beacon, control slots, and data slots according to the superframe settings information through the programmable interface; The beacon has a length of T. B The control time slot length is T. C The data time slot length is T. D It consists of m elements of length T S It consists of hourly gaps.

7. The design method for software-defined adaptive time slot scheduling according to claim 1, characterized in that, Step 5 includes: Step 5.1: Collect historical data from each production device to obtain a historical data set D; the historical data includes the amount of historical data. and The corresponding number of time slots ; The historical data set D is: (1) Where D is the historical data set; For the first The amount of historical data in the set of historical data. for The corresponding required number of time slots; n is the number of historical data sets; Step 5.2: Based on the historical data volume of the production equipment and the corresponding required number of time slots, obtain the time slot prediction function using the least squares method. The predicted number of time slots is obtained using this time slot prediction function.

8. The design method for software-defined adaptive time slot scheduling according to claim 7, characterized in that, Step 6 includes: Step 6.1: Establish a time slot allocation model; (9) (10) (11) (12) (13) (14) (15) (16) k is the number of nodes in the network; is the node sequence number; m is the number of data slots in the superframe; The number of time slots ultimately allocated to each node; Indicates whether the current node has data to transmit. When the node is active, there is no data transmission; otherwise, there is. This indicates the allocation relationship between time slots and nodes. This indicates that node j occupies the l-th time slot; otherwise, it is 0. For the maximum allowable delay, T SP T is the length of the entire superframe. B T is the time slot length of the Beacon. C To control the time slot length, T S It is the length of a single data slot. It is a natural number. ; The number of data time slots used; Step 6.2: Based on the predicted number of time slots, a genetic algorithm is used as the time slot allocation algorithm. A time slot allocation scheduling scheme is generated based on the established time slot allocation model, and time slots are distributed according to the scheduling scheme.

9. The design method for software-defined adaptive time slot scheduling according to claim 8, characterized in that, Step 5.2 includes: Step 5.2.1: Based on the historical data volume of the production equipment and the corresponding required number of time slots, generate a time slot prediction function using the least squares method. ; The time slot prediction function for: (2) in, and These are the two parameters of the time slot prediction function; Step 5.2.2: Solve the time slot prediction function using mean square error. Parameters in and b; The time slot prediction function is solved using mean square error. Parameters in The specific method for b is as follows: First, establish the error function. Then, the optimization function is obtained based on the error function, and the optimization function is used to solve the problem. and b; Let the error function be... for: (3) in, It is the error function; The optimization function is: (4) The method of solving using optimization functions The method for b is: (5) (6) (7) (8) in, The average of the historical data volume. This represents the average number of time slots required. Step 5.2.3: Substitute the production data obtained in Step 3 into the time slot prediction function to obtain the predicted number of time slots.

10. The design method for software-defined adaptive time slot scheduling according to claim 8, characterized in that, Step 6.2 includes: Step 6.2.1: Establish input matrix U, which is a k-row, 4-column matrix, where k is the number of nodes in the network. The first column of input matrix U is the predicted number of time slots, the second column is the actual number of time slots at the previous moment, the third column is the priority of the production data to be allocated, and the fourth column is the node number. Step 6.2.2: Set the population size n, crossover probability pc, mutation probability pm, maximum number of iterations maxgen, priority M, and an empty matrix F used to store the time slot scheduling scheme; Step 6.2.3: Randomly generate n chromosomes to form an initial population. Each chromosome is a k-row, 2-column matrix, where the first column is a randomly generated natural number representing the order of time slot scheduling, and the second column is the priority of the production data to be allocated in the input matrix U. Each chromosome represents a time slot scheduling scheme, and the genes on it represent the order of time slot scheduling. Step 6.2.4: Set the current iteration number gen to 0; Step 6.2.5: Calculate the fitness value of each chromosome in the current population; the fitness value is the sum of the number of time slots of production data to be assigned for all priorities; Step 6.2.6: Randomly select two chromosomes from the current population, compare the fitness values ​​of the two chromosomes, select the chromosome with the smaller fitness value as the parent chromosome, and then randomly select one chromosome from the current population as the mother chromosome. Step 6.2.7: Generate a random number between (0,1). If the random number is less than the crossover probability pc, perform a crossover operation on the parent chromosome and the mother chromosome. Otherwise, do not perform a crossover operation and directly use the parent chromosome as the new chromosome. The method of the crossover operation is as follows: take the first column of data from the parent chromosome as the first column of data of the new chromosome, and take the second column of data from the mother chromosome as the second column of data of the new chromosome to obtain a new chromosome; Step 6.2.8: Generate a random number between (0,1). If the random number is less than the mutation probability pm, perform a mutation operation to obtain the result. Then, reorder the input matrix according to the time slot scheduling order in the chromosome and store it in an empty matrix F; otherwise, directly reorder the input matrix according to the time slot scheduling order in the chromosome generated in Step 6.2.7 and store it in an empty matrix F. The mutation operation method is as follows: Increment the priority of all data in the second column of the current chromosome by 1, find the index of the row in the chromosome whose priority is greater than the set priority M, then find the predicted number of time slots corresponding to these rows in the input matrix U according to the index, calculate the average value of the found predicted time slots, and round the average value to the nearest integer to obtain the update value. Finally, update the found predicted time slots to the calculated update value. The method for reordering the input matrix according to the time slot scheduling order in the chromosome is as follows: according to the time slot scheduling order q of the p-th row in the chromosome, place the data of the p-th row in the input matrix U into the q-th row; Step 6.2.9: Add the chromosome obtained in step 6.2.8 to the current population; Step 6.2.10: Increment the iteration count by 1; Step 6.2.11: Determine if the number of iterations has reached the maximum number of iterations maxgen. If yes, proceed to step 6.2.12; otherwise, proceed to step 6.2.

5. Step 6.2.12: Find the chromosome corresponding to the minimum fitness value, and then find the reordered input matrix corresponding to the chromosome in the empty matrix F. That is, find a set of predicted time slots, actual time slots at the previous time step, priority and number corresponding to the minimum fitness value, and finally obtain the scheduling scheme S with the minimum total number of time slots. Step 6.2.13: Arrange the time slot allocation scheduling scheme S in descending order of priority in the third column, and in descending order of time slot satisfaction among the same priority, to obtain the order of time slot scheduling of the production data to be allocated, and update the order of time slot scheduling in the chromosome accordingly; the time slot satisfaction refers to the absolute value of the difference between the actual number of time slots needed at the previous time and the number of time slots allocated at the previous time. Step 6.2.14: Take the first, third, and fourth columns of the sorted time slot allocation scheduling scheme S to generate the final time slot allocation scheduling scheme. The time slot allocation scheduling scheme is a k-row, 3-column matrix. The first column is the predicted number of time slots, the second column is the priority, and the third column is the corresponding node number. Step 6.2.15: Send the final time slot allocation scheduling scheme to the superframe.