A controller scheduling method, device, equipment and storage medium
By using a non-real-time communication mechanism in a multi-channel control system to obtain and convert instruction setting requests and parameter setting requests, they are sent to the controller in real time, solving the problem of incompatibility between real-time and non-real-time system communication and improving system performance.
Patent Information
- Application Number
- CN202411902640.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-12-23
AI Technical Summary
The communication protocol and implementation methods of real-time systems in existing multi-channel control systems are incompatible with non-real-time systems, resulting in data transmission errors and reducing the working performance of the system.
By introducing a controller scheduling method in a multi-channel control system, the non-real-time communication mechanism is used to obtain instruction setting requests and parameter setting requests, and convert them into real-time data and send them to the controller in real-time, real-time and non-real-time communication compatibility is achieved.
It improves compatibility between the real-time part and the non-real-time part in the multi-channel control system, reduces data transmission errors, and improves the working performance of the system.
Smart Images

Figure CN119356265B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer communication technology, and in particular to a scheduling method, device, equipment and storage medium of a controller. Background Art
[0002] With the increasing complexity of modern industrial sites, multi-channel control systems have been widely used to achieve precise and real-time control of different physical quantities under multiple controllers, thereby improving the efficiency of task execution.
[0003] In existing multi-channel control systems, there are usually two parts: real-time system and non-real-time system. Among them, the real-time system is used for tasks with precise time control and fast response, such as real-time control of multi-channel controllers; the non-real-time system is usually used for tasks with relatively low time requirements, such as data recording and storage.
[0004] However, since the communication protocols and implementation methods of the real-time system and the non-real-time system in the multi-channel control system are different and cannot be compatible, data transmission errors may occur, thereby reducing the working performance of the multi-channel control system. Summary of the invention
[0005] Based on the above problems, the present application provides a controller scheduling method, device, equipment and storage medium, the purpose of which is to improve the compatibility between the real-time part and the non-real-time part in a multi-channel control system and improve the system's working performance.
[0006] The embodiments of the present application disclose the following technical solutions:
[0007] In a first aspect, the present application provides a controller scheduling method, which is applied to a multi-channel control system, wherein the multi-channel control system includes a multi-channel controller and a host computer, including:
[0008] In response to the instruction setting request sent by the host computer, determining the instruction data of each controller in the multi-channel controller from the instruction setting request, and sending the instruction data to the controller in real time; the instruction setting request is obtained by adopting a non-real-time communication mechanism;
[0009] In response to a parameter setting request sent by the host computer, a target parameter of each controller in the multi-channel controller is determined from the parameter setting request, and the target parameter is sent to the controller in real time; the parameter setting request is obtained by adopting a non-real-time communication mechanism;
[0010] A non-real-time communication mechanism is used to send the real-time data obtained from the controller to the host computer.
[0011] Optionally, in the method as described above, in response to the instruction setting request sent by the host computer, determining the instruction data of each controller in the multi-channel controller from the instruction setting request, and sending the instruction data to the controller in real time, includes:
[0012] In response to the instruction setting request sent by the host computer, the valid instruction data in the instruction setting request is converted into a data structure to obtain an instruction planning request;
[0013] Splitting the instruction parameters in the instruction planning request into a plurality of target instructions; each target instruction in the plurality of target instructions corresponds one-to-one to each controller in the multi-channel controller;
[0014] Determine the instruction data corresponding to the target instruction, and send the instruction data to the controller in real time.
[0015] Optionally, in the method described above, the multi-channel control system communicates with an external system through an analog interface, and if the target instruction is an external instruction, determining instruction data corresponding to the target instruction, and sending the instruction data to the controller in real time, includes:
[0016] Acquire first instruction data from the external system based on an external instruction, and send the first instruction data to the controller in real time;
[0017] If the target instruction is an internal cycle instruction, determining instruction data corresponding to the target instruction and sending the instruction data to the controller in real time includes:
[0018] Determine the second instruction data within the preset control period according to the preset control period and the acquired waveform parameters, and store the second instruction data in the data buffer;
[0019] Based on the preset control cycle, the second instruction data is sent to the controller in real time.
[0020] Optionally, in the method as described above, in response to the parameter setting request sent by the host computer, determining the target parameters of each controller in the multi-channel controller from the parameter setting request, and sending the target parameters to the controller in real time, includes:
[0021] In response to the parameter setting request sent by the host computer, convert the valid parameters in the parameter setting request into a data structure to obtain configuration parameters;
[0022] Splitting the configuration parameter into a plurality of target parameters; each target parameter in the plurality of target parameters corresponds one-to-one to each controller in the multi-channel controller;
[0023] The target parameters are distributed in real time to the controllers corresponding to the target parameters.
[0024] Optionally, the method as described above further includes:
[0025] In response to the parameter update request, convert the parameters in the parameter update request into a data structure to obtain target configuration parameters;
[0026] An update parameter and a target controller are determined from the target configuration parameters, and the update parameter is sent to the target controller in real time.
[0027] Optionally, in the method as described above, the adopting of a non-real-time communication mechanism to send the real-time data acquired from the controller to the host computer includes:
[0028] Based on the preset control cycle, the acquired real-time data of the plurality of controllers are stored as a data queue, and the data queue is cached in the data buffer;
[0029] Obtaining a target data queue from the data buffer according to a preset time; the preset time is greater than a preset control period;
[0030] Based on the ROS non-real-time communication mechanism, the target data queue is filled into a publishing data packet, and the publishing data packet is sent to the host computer.
[0031] In a second aspect, the present application provides a scheduling device of a controller, comprising:
[0032] A real-time instruction determination module, for responding to an instruction setting request sent by the host computer, determining instruction data of each controller in the multi-channel controller from the instruction setting request, and sending the instruction data to the controller in real time; the instruction setting request is obtained by adopting a non-real-time communication mechanism;
[0033] A controller parameter determination module, for responding to a parameter setting request sent by the host computer, determining a target parameter of each controller in the multi-channel controller from the parameter setting request, and sending the target parameter to the controller in real time; the parameter setting request is obtained by adopting a non-real-time communication mechanism;
[0034] The real-time data acquisition module is used to send the real-time data acquired from the controller to the host computer using a non-real-time communication mechanism.
[0035] In a third aspect, the present application provides a multi-channel control system, including: a scheduling device of a controller, an EtherCAT interface, an Ethernet interface, a multi-channel controller, and a host computer;
[0036] Wherein, the scheduling device of the controller communicates with the multi-channel controller in real time through the EtherCAT interface, and the real-time scheduling device communicates with the host computer in non-real time through the Ethernet interface;
[0037] The scheduling device of the controller is used to implement the scheduling method of the controller described in any of the above embodiments.
[0038] In a fourth aspect, the present application provides an electronic device, the device comprising: a processor, and a memory communicatively connected to the processor;
[0039] Memory stores computer-executable instructions;
[0040] The processor executes the computer-executable instructions stored in the memory to implement the scheduling method of the controller described in any of the above embodiments.
[0041] In a fifth aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the scheduling method of the controller described in any of the above embodiments.
[0042] The present application responds to an instruction setting request obtained by a non-real-time communication mechanism, determines the instruction data of each controller in the multi-channel controller from the instruction setting request, and sends the instruction data to the controller in real time to set the execution instruction of the controller; then responds to a parameter setting request obtained by a non-real-time communication mechanism, determines the target parameters of each controller in the multi-channel controller from the parameter setting request, and sends the target parameters to the controller in real time to set the relevant parameters of the controller. Finally, the real-time data obtained from the controller is sent to the host computer by a non-real-time communication mechanism, so as to achieve the compatibility of real-time communication and non-real-time communication in the multi-channel control system, thereby improving the working performance of the multi-channel control system. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0044] Figure 1 A flowchart of an embodiment of a controller scheduling method provided by the present application;
[0045] Figure 2 A flowchart of another embodiment of a controller scheduling method provided by the present application;
[0046] Figure 3 A flowchart of another embodiment of a controller scheduling method provided in the present application;
[0047] Figure 4 A flowchart of another embodiment of a controller scheduling method provided by the present application;
[0048] Figure 5 A schematic diagram of the structure of an embodiment of a scheduling device of a controller provided in the present application;
[0049] Figure 6 A schematic structural diagram of another embodiment of a scheduling device of a controller provided by the present application;
[0050] Figure 7 A schematic diagram of the structure of an embodiment of a multi-channel control system provided by the present application;
[0051] Figure 8 A schematic structural diagram of an embodiment of an electronic device provided in the present application. DETAILED DESCRIPTION
[0052] As described above, in current multi-channel control systems, real-time systems and non-real-time systems are directly connected. Due to the different communication methods between real-time and non-real-time systems, real-time and non-real-time systems are incompatible, resulting in data transmission errors during the communication process, reducing system performance.
[0053] After research, the inventors proposed a controller scheduling method, device, equipment and storage medium to solve the technical problems in the prior art that real-time and non-real-time are incompatible and the system performance is low.
[0054] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0055] See also Figure 1 , which is a flow chart of an embodiment of a controller scheduling method provided by the present application. The method is applied to a multi-channel control system, wherein the multi-channel control system includes a multi-channel controller and a host computer. Figure 1 As shown, the method includes:
[0056] S101: In response to an instruction setting request sent by a host computer, instruction data of each controller in the multi-channel controller is determined from the instruction setting request, and the instruction data is sent to the controller in real time.
[0057] The instruction setting request is obtained by adopting a non-real-time communication mechanism.
[0058] In this embodiment, in response to the instruction setting request sent by the host computer based on the ROS request / service mechanism, the valid instruction data in the instruction setting request is converted into an internal data structure, thereby obtaining an instruction planning request. The instruction parameters in the instruction planning request are then split and processed to obtain multiple target instructions. Among them, each target instruction in the multiple target instructions corresponds to each controller in the multi-channel controller one by one, so that the instruction data corresponding to the determined target instruction is sent to the controller corresponding to the target instruction in real time through the EtherCAT interface.
[0059] S102: In response to the parameter setting request sent by the host computer, a target parameter of each controller in the multi-channel controller is determined from the parameter setting request, and the target parameter is sent to the controller in real time.
[0060] The parameter setting request is obtained by using a non-real-time communication mechanism.
[0061] In this embodiment, it is necessary to set the parameters for the operation of each controller. Specifically, in response to the parameter setting request sent by the host computer based on the ROS request / service mechanism, the valid parameters in the parameter setting request are converted into an internal data structure to obtain the configuration parameters. The configuration parameters are then split to obtain multiple target parameters. Among them, each target parameter in the multiple target parameters corresponds to each controller in the multi-channel controller one by one, so that the obtained target parameters are distributed to the controller corresponding to the target parameter in real time through the EtherCAT interface.
[0062] S103: Using a non-real-time communication mechanism to send the real-time data obtained from the controller to the host computer.
[0063] In this embodiment, for example, the controller frequency of each channel is preset to be not less than 1kHz, so that the preset maximum control cycle is 1ms. Based on the preset control cycle, the real-time data collected from the multi-channel controller is transmitted from the EtherCAT interface in the form of EtherCAT PDO and integrated into multiple data frames. The multiple acquired data frames are then stored as a data queue in chronological order to cache the data queue in the data buffer. Then, according to the preset time, the target data queue is obtained from the data buffer, and according to the requirements of ROS topic publishing / subscription in the non-real-time communication mechanism of the Robot Operating System (ROS), the data frames in the target data queue are filled into the publishing data packet for ROS publishing information, so as to send the publishing data packet to the host computer according to the ROS protocol.
[0064] In this embodiment, in response to the instruction setting request obtained by the non-real-time communication mechanism, the instruction data of each controller in the multi-channel controller is determined from the instruction setting request, and the instruction data is sent to the controller in real time to set the execution instruction of the controller; and in response to the parameter setting request obtained by the non-real-time communication mechanism, the target parameter of each controller in the multi-channel controller is determined from the parameter setting request, and the target parameter is sent to the controller in real time to set the relevant parameters of the controller. Finally, the real-time data obtained from the controller is sent to the host computer by the non-real-time communication mechanism, so as to realize the compatibility of real-time communication and non-real-time communication in the multi-channel control system, thereby improving the working performance of the multi-channel control system.
[0065] See also Figure 2 , which is a flow chart of another embodiment of a controller scheduling method provided by the present application. Figure 1 , Figure 2 A specific implementation method of "the step of responding to the instruction setting request sent by the host computer, determining the instruction data of each controller in the multi-channel controller from the instruction setting request, and sending the instruction data to the controller in real time" in S101 is shown, specifically in combination with Figure 2 Introduced in S1011-S1013.
[0066] S1011: In response to the instruction setting request sent by the host computer, the valid instruction data in the instruction setting request is converted into a data structure to obtain an instruction planning request.
[0067] In response to an instruction setting request obtained from a host computer using ROS non-real-time communication, the instruction setting request is parsed to obtain valid instruction data, and then the obtained valid instruction data is converted into a data structure, so that the valid instruction data is converted into an instruction planning request of an internal data structure.
[0068] Specifically, the valid instruction data obtained from the host computer is a multi-channel instruction setting request, and the internal data structure of the controller in each channel is different. By converting the data structure of the valid instruction data in the instruction setting request, an instruction planning request of an internal data structure that can be directly used by each controller is obtained for subsequent control of the controller.
[0069] S1012: Split the instruction parameters in the instruction planning request into multiple target instructions.
[0070] Each target instruction in the plurality of target instructions corresponds one-to-one to each controller in the multi-channel controller.
[0071] The instruction parameters are extracted from the instruction planning request and split and processed to generate multiple target instructions. For example, target instruction 1 corresponds to controller 1 in the multi-channel controller; target instruction 2 corresponds to controller 2 in the multi-channel controller; and target instruction 3 corresponds to controller 3 in the multi-channel controller.
[0072] S1013: Determine instruction data corresponding to the target instruction, and send the instruction data to the controller in real time.
[0073] Based on the target instruction, corresponding instruction data is obtained from the data buffer in a preset control cycle or instruction data is directly obtained from an external system, and the instruction data is sent to the controller corresponding to the target instruction.
[0074] In this embodiment, in response to an instruction setting request obtained by a non-real-time communication mechanism, the valid instruction data in the instruction setting request is converted into a data structure to obtain an instruction planning request. The instruction parameters in the instruction planning request are split into multiple target instructions. The instruction data corresponding to the target instruction is determined, and the instruction data is sent to the controller in real time, so that the non-real-time instruction setting request is sent to the corresponding controller in real time, which solves the problem that non-real-time and real-time data are not well compatible during the communication process, improves the working performance of the multi-channel control system, and reduces transmission errors during data transmission.
[0075] Further, based on the above embodiment, the multi-channel control system communicates with the external system through an analog interface. If the target instruction is an external instruction, a specific implementation of "determining instruction data corresponding to the target instruction and sending the instruction data to the controller in real time" in S1013 includes:
[0076] Acquire first instruction data from an external system based on an external instruction, and send the first instruction data to the controller in real time.
[0077] In this embodiment, if the target instruction is an external instruction, an interface for communicating with an external system is called to directly obtain first instruction data from the external system, and the first instruction data is sent to a controller corresponding to the instruction in real time.
[0078] If the target instruction is an internal cycle instruction, a specific implementation of "determining instruction data corresponding to the target instruction and sending the instruction data to the controller" in S1013 includes:
[0079] According to the preset control period and the acquired waveform parameters, second instruction data within the preset control period is determined, and the second instruction data is stored in the data buffer.
[0080] In this embodiment, if the target instruction is an external instruction, the second instruction data within the preset control period is calculated according to the preset control period and the waveform parameters obtained from the external system, and the second instruction data is stored in the data buffer.
[0081] Based on a preset control cycle, the second instruction data is sent to the controller in real time.
[0082] According to the preset control cycle, the second instruction data is obtained from the data buffer area once or cyclically in each control cycle, and is sent to the controller corresponding to the instruction in real time in the form of EtherCAT PDO through the EtherCAT interface.
[0083] In this embodiment, if the target instruction is an external instruction, the first instruction data is directly obtained from the external system; if the target instruction is an external instruction, the second instruction data is determined according to the preset control cycle and the waveform parameters obtained from the host computer. Then, the obtained first instruction data and / or second instruction data are sent to the corresponding controller in real time based on the preset control cycle.
[0084] See also Figure 3 , which is a flow chart of another embodiment of a controller scheduling method provided by the present application. Figure 1 , Figure 3 A specific implementation method of "responding to a parameter setting request sent by the host computer, determining a target parameter of each controller in the multi-channel controller from the parameter setting request, and sending the target parameter to the controller in real time" in S102 is shown, specifically in combination with Figure 3 Introduced in S1021-S1023.
[0085] S1021: In response to the parameter setting request sent by the host computer, convert the valid parameters in the parameter setting request into a data structure to obtain configuration parameters.
[0086] In response to a parameter setting request obtained from a host computer using ROS non-real-time communication, the parameter setting request is parsed to obtain valid parameters, and then the obtained valid parameters are converted into a data structure so that the valid parameters are converted into configuration parameters of an internal data structure.
[0087] S1022: Split the configuration parameters into multiple target parameters.
[0088] Each target parameter in the plurality of target parameters corresponds one-to-one to each controller in the multi-channel controller.
[0089] The configuration parameters are split and processed to generate multiple target parameters. For example, target parameter 1 corresponds to controller 1 in the multi-channel controller; target parameter 2 corresponds to controller 2 in the multi-channel controller; and target parameter 3 corresponds to controller 3 in the multi-channel controller.
[0090] S1023: The target parameters are distributed to the controllers corresponding to the target parameters in real time.
[0091] Based on the target parameter, the target parameter is allocated in real time to the controller corresponding to the target parameter.
[0092] In this embodiment, in response to a parameter setting request obtained by a non-real-time communication mechanism, the valid parameters in the parameter setting request are converted into a data structure to obtain configuration parameters. The configuration parameters are split into multiple target parameters, and the target parameters are sent to the controller in real time, so that the non-real-time parameter setting request is sent to the corresponding controller in real time, which solves the problem that non-real-time and real-time data are not well compatible during the communication process, improves the working performance of the multi-channel control system, and reduces transmission errors during data transmission.
[0093] Furthermore, based on the above embodiment, the method may further include:
[0094] In response to the parameter update request, convert the parameters in the parameter update request into a data structure to obtain target configuration parameters;
[0095] An update parameter and a target controller are determined from the target configuration parameters, and the update parameter is sent to the target controller in real time.
[0096] In this embodiment, if the parameters of the controller need to be updated, the parameters in the parameter update request are converted into a data structure in response to the parameter update request sent by the upper computer to obtain the target configuration parameters; then the update parameters and the target controller are determined from the target configuration parameters, and the update parameters are sent to the target controller in real time.
[0097] In this embodiment, the parameters in the parameter update request are converted into a data structure to obtain the target configuration parameters, and then the update parameters and the target controller are determined from the target configuration parameters, and the update parameters are sent to the target controller in real time, thereby realizing non-real-time acquisition of parameter update requests and real-time control of the controller according to the parameter update requests, achieving compatibility between non-real-time communication and real-time communication, and improving the compatibility of multi-channel control systems.
[0098] See also Figure 4 , which is a flow chart of another embodiment of a controller scheduling method provided by the present application. Figure 1 , Figure 4 A specific implementation method of "using a non-real-time communication mechanism to send real-time data obtained from the controller to the host computer" in S103 is shown. Figure 4 Introduced in S1031-S1033.
[0099] S1031: Based on a preset control cycle, the acquired real-time data of multiple controllers are stored as a data queue, and the data queue is cached in a data buffer.
[0100] In this embodiment, according to the preset control cycle, the real-time data of each controller is obtained from the multi-channel controller through the EtherCAT interface and integrated into a data frame. Taking controller 1 as an example, the data frames integrated through the EtherCAT interface include data frame 1_1, data frame 1_2, data frame 1_3, ..., data frame 1_m; wherein m is a positive integer. Then, the data frames corresponding to each controller are stored as a data queue in chronological order, and the data queue corresponding to each controller is cached in the data buffer. For example, the data queue corresponding to controller 1 is [data frame 1_1, data frame 1_2, data frame 1_3, ..., data frame 1_m].
[0101] S1032: Obtain a target data queue from the data buffer according to a preset time.
[0102] The preset time is greater than the preset control period;
[0103] In this embodiment, for example, the preset control period is 1 ms, and the preset time is 1 minute. According to the preset time of 1 minute, the target data queue is extracted from the data buffer.
[0104] S1033: Based on the ROS non-real-time communication mechanism, fill the target data queue into the published data packet, and send the published data packet to the host computer.
[0105] Based on the ROS non-real-time communication mechanism, the data frames in the target data queue are filled into the publishing data packet of the ROS publishing message according to the requirements of ROS topic publishing / subscription, so as to send the publishing data packet to the host computer according to the ROS protocol.
[0106] In this embodiment, based on a preset control cycle, the acquired real-time data of multiple controllers are stored as a data queue, and the data queue is cached in a data buffer, ensuring the real-time and integrity of the data. Then, according to the preset time, the target data queue is obtained from the data buffer in a non-real-time form, and based on the ROS non-real-time communication mechanism, the target data queue is filled into the release data packet, and the release data packet is sent to the host computer, so as to achieve compatibility between real-time communication and non-real-time communication, and improve the compatibility and working performance of the multi-channel control system.
[0107] See also Figure 5 , which is a schematic diagram of the structure of an embodiment of a scheduling device of a controller provided by the present application. Figure 5 As shown, the device includes: a real-time instruction determination module 51, a controller parameter determination module 52 and a real-time data acquisition module 53.
[0108] The real-time instruction determination module 51 is used to respond to the instruction setting request sent by the host computer, determine the instruction data of each controller in the multi-channel controller from the instruction setting request, and send the instruction data to the controller.
[0109] The controller parameter determination module 52 is used to respond to the parameter setting request sent by the host computer, determine the target parameters of each controller in the multi-channel controller from the parameter setting request, and send the target parameters to the controller.
[0110] The real-time data acquisition module 53 is used to send the real-time data acquired from the controller to the host computer using a non-real-time communication mechanism.
[0111] A scheduling device of a controller provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0112] Further, based on the above embodiment, Figure 6 As shown, the real-time instruction determination module 51 may include an instruction acquisition unit 511 , an instruction splitting unit 512 , and an instruction generating unit 513 .
[0113] The instruction acquisition unit 511 is used to respond to the instruction setting request sent by the host computer, convert the valid instruction data in the instruction setting request into a data structure, and obtain an instruction planning request.
[0114] The instruction splitting unit 512 is used to split the instruction parameters in the instruction planning request into multiple target instructions; each target instruction in the multiple target instructions corresponds one-to-one to each controller in the multi-channel controller.
[0115] The instruction generation unit 513 is used to determine instruction data corresponding to the target instruction and send the instruction data to the controller.
[0116] A scheduling device of a controller provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0117] Further, based on the above embodiment, the instruction generation unit 513 is specifically used to obtain first instruction data from an external system based on an external instruction, and send the first instruction data to the controller; if the target instruction is an internal cycle instruction, the instruction data corresponding to the target instruction is determined, and the instruction data is sent to the controller, including: according to the preset control cycle and the acquired waveform parameters, determining the second instruction data within the preset control cycle, and storing the second instruction data in the data buffer; based on the preset control cycle, sending the second instruction data to the controller.
[0118] A scheduling device of a controller provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0119] Further, based on the above embodiment, Figure 6 As shown in the solid line box, the controller parameter determination module 52 may include a parameter acquisition unit 521 and a parameter allocation unit 522 .
[0120] The parameter acquisition unit 521 is used to respond to the parameter setting request sent by the host computer, convert the valid parameters in the parameter setting request into a data structure, and obtain the configuration parameters.
[0121] The parameter allocation unit 522 is used to split the configuration parameters into multiple target parameters; each target parameter in the multiple target parameters corresponds one-to-one to each controller in the multi-channel controller; and allocate the target parameters to the controllers corresponding to the target parameters.
[0122] A scheduling device of a controller provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0123] Further, based on the above embodiment, Figure 6 As shown in the dashed box, the controller parameter determination module 52 may further include a parameter refreshing unit 523 .
[0124] The parameter refresh unit 523 is used to respond to the parameter update request, convert the parameters in the parameter update request into data structures, obtain target configuration parameters, determine update parameters and target controller from the target configuration parameters, and send the update parameters to the target controller in real time.
[0125] A scheduling device of a controller provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0126] Further, based on the above embodiment, Figure 6 As shown, the real-time data acquisition module 53 may include a data acquisition unit 531 , a data packaging unit 532 , and a data publishing unit 533 .
[0127] Among them, the data acquisition unit 531 is used to store the real-time data of multiple controllers acquired as a data queue based on a preset control cycle, and cache the data queue to a data buffer; obtain the target data queue from the data buffer according to a preset time; the preset time is greater than the preset control cycle.
[0128] The data packaging unit 532 is used to fill the target data queue into the published data packet based on the ROS non-real-time communication mechanism.
[0129] The data publishing unit 533 is used to send the published data packet to the host computer.
[0130] A scheduling device of a controller provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0131] See also Figure 7 , which is a flow chart of an embodiment of a multi-channel control system provided by the present application. Figure 7 As shown, the multi-channel control system includes a controller scheduling device 50, an EtherCAT interface 60, an Ethernet interface 70, a multi-channel controller 80 and a host computer 90.
[0132] The controller's scheduling device 50 communicates with the multi-channel controller 80 in real time via the EtherCAT interface 60 , and the controller's scheduling device 50 communicates with the host computer 90 in non-real time via the Ethernet interface 70 .
[0133] A scheduling device of a controller provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0134] It can be understood that in order to realize real-time communication between the controller's scheduling device 50 and the multi-channel controller 80 through the EtherCAT interface 60, data communication between the EtherCAT interface 60 and the multi-channel controller 80 is realized through the EtherCAT switch, and time synchronization between multiple controllers in the multi-channel controller is realized through the IEEE1588 timing protocol.
[0135] See also Figure 8 , which is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. The electronic device 80 may include: a processor 81 and a memory 82.
[0136] The processor 81 is in communication connection with the memory 82 , and the memory 82 is used to store computer-executable instructions; the processor 81 is configured to execute the technical solution in any of the aforementioned method embodiments by executing the computer-executable instructions stored in the memory 82 .
[0137] Optionally, the memory 82 may be independent or integrated with the processor 81. Optionally, when the memory 82 is a device independent of the processor 81, the electronic device 80 may further include: a bus for connecting the above devices.
[0138] The electronic device is used to execute the technical solution in any of the aforementioned method embodiments, and its implementation principle and technical effect are similar and will not be repeated here.
[0139] An embodiment of the present application also provides a computer-readable storage medium, which stores computer execution instructions. When the computer execution instructions are executed by a processor, they are used to implement the above-mentioned method. The implementation principle and technical effect are similar and will not be repeated here.
[0140] It should be noted that each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components indicated as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0141] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A controller scheduling method, characterized in that: Applied to a multi-channel control system, the multi-channel control system includes a multi-channel controller and a host computer, including: In response to the instruction setting request sent by the host computer, determining the instruction data of each controller in the multi-channel controller from the instruction setting request, and sending the instruction data to the controller in real time; the instruction setting request is obtained by adopting a non-real-time communication mechanism; In response to a parameter setting request sent by the host computer, a target parameter of each controller in the multi-channel controller is determined from the parameter setting request, and the target parameter is sent to the controller in real time; the parameter setting request is obtained by using the non-real-time communication mechanism; The non-real-time communication mechanism is used to send the real-time data obtained from the controller to the host computer; The step of responding to the instruction setting request sent by the host computer, determining instruction data of each controller in the multi-channel controller from the instruction setting request, and sending the instruction data to the controller in real time includes: In response to the instruction setting request sent by the host computer, the valid instruction data in the instruction setting request is converted into a data structure to obtain an instruction planning request; Splitting the instruction parameters in the instruction planning request into a plurality of target instructions; each target instruction in the plurality of target instructions corresponds one-to-one to each controller in the multi-channel controller; Determine the instruction data corresponding to the target instruction, and send the instruction data to the controller in real time.
2. The method according to claim 1, characterized in that The multi-channel control system communicates with an external system through an analog interface. If the target instruction is an external instruction, the instruction data corresponding to the target instruction is determined, and the instruction data is sent to the controller in real time, including: Acquire first instruction data from the external system based on an external instruction, and send the first instruction data to the controller in real time; If the target instruction is an internal cycle instruction, determining instruction data corresponding to the target instruction and sending the instruction data to the controller in real time includes: Determine the second instruction data within the preset control period according to the preset control period and the acquired waveform parameters, and store the second instruction data in the data buffer; Based on the preset control cycle, the second instruction data is sent to the controller in real time.
3. The method according to claim 1, characterized in that The step of responding to the parameter setting request sent by the host computer, determining the target parameters of each controller in the multi-channel controller from the parameter setting request, and sending the target parameters to the controller in real time includes: In response to the parameter setting request sent by the host computer, convert the valid parameters in the parameter setting request into a data structure to obtain configuration parameters; Splitting the configuration parameter into a plurality of target parameters; each target parameter in the plurality of target parameters corresponds one-to-one to each controller in the multi-channel controller; The target parameters are distributed in real time to the controllers corresponding to the target parameters.
4. The method according to claim 3, characterized in that: The method further comprises: In response to the parameter update request, converting the parameters in the parameter update request into a data structure to obtain target configuration parameters; An update parameter and a target controller are determined from the target configuration parameters, and the update parameter is sent to the target controller in real time.
5. The method according to any one of claims 1 to 4, characterized in that The method of using a non-real-time communication mechanism to send the real-time data obtained from the controller to the host computer includes: Based on a preset control cycle, the acquired real-time data of the plurality of controllers are stored as a data queue, and the data queue is cached in a data buffer; Obtaining a target data queue from the data buffer according to a preset time; the preset time is greater than the preset control period; Based on the ROS non-real-time communication mechanism, the target data queue is filled into a publishing data packet, and the publishing data packet is sent to the host computer.
6. A controller scheduling device, characterized in that: include: A real-time instruction determination module, for responding to an instruction setting request sent by a host computer, determining instruction data of each controller in the multi-channel controller from the instruction setting request, and sending the instruction data to the controller in real time; the instruction setting request is obtained by adopting a non-real-time communication mechanism; a controller parameter determination module, for responding to a parameter setting request sent by the host computer, determining a target parameter of each controller in the multi-channel controller from the parameter setting request, and sending the target parameter to the controller in real time; the parameter setting request is obtained by adopting the non-real-time communication mechanism; A real-time data acquisition module, used to send the real-time data acquired from the controller to the host computer using the non-real-time communication mechanism; The instruction determination module includes an instruction acquisition unit, an instruction splitting unit and an instruction generation unit; The instruction acquisition unit is used to respond to the instruction setting request sent by the host computer, convert the valid instruction data in the instruction setting request into a data structure, and obtain an instruction planning request; The instruction splitting unit is used to split the instruction parameters in the instruction planning request into multiple target instructions; Each target instruction in the plurality of target instructions corresponds one-to-one to each controller in the multi-channel controller; The instruction generation unit is used to determine instruction data corresponding to the target instruction and send the instruction data to the controller.
7. A multi-channel control system, characterized in that: include: The controller’s dispatching device, EtherCAT interface, Ethernet interface, multi-channel controller, and host computer; Wherein, the dispatching device of the controller communicates with the multi-channel controller in real time through the EtherCAT interface, and the dispatching device of the controller communicates with the host computer in non-real time through the Ethernet interface; The scheduling of the controller is used to implement the method according to any one of claims 1-5.
8. An electronic device, characterized in that: The device comprises: a processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 5.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 5 when executed by a processor.
Citation Information
Patent Citations
Edge computing system of intelligent sensor based on TSN network standard
CN113259420A