A method, device, medium and program product for scheduling concurrent acquisition tasks
By dynamically adjusting the acquisition cycle of PLC devices in industrial automation systems, the problems of network congestion and resource contention caused by concurrent acquisition tasks are solved, achieving stability and balance in task execution, especially prioritizing critical tasks when resources are limited.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BINZHOU WEIQIAO NATIONAL SCIENCE & TECHNOLOGY ADVANCED TECHNOLOGY RESEARCH INSTITUTE
- Filing Date
- 2026-03-25
- Publication Date
- 2026-06-30
AI Technical Summary
In industrial automation systems, concurrent data acquisition tasks from PLC devices can cause instantaneous network congestion and resource contention, affecting the stability and balance of task execution, and leaving resources idle during non-acquisition periods.
By acquiring the current running parameters, preset acquisition cycle, and priority of concurrent acquisition tasks, the load adjustment coefficient is calculated, and the actual acquisition cycle is dynamically adjusted to achieve adaptive scheduling.
It improves the stability and balance of concurrent data collection tasks, avoids network congestion and resource contention, and prioritizes the execution of critical tasks.
Smart Images

Figure CN122308284A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of industrial automation and industrial communication technology, and in particular to a scheduling method, device, medium and program product for concurrent data acquisition tasks. Background Technology
[0002] In industrial automation systems, it is often necessary to control the production process and monitor the equipment status. For example, a Programmable Logic Controller (PLC) is used to connect to a host computer via an industrial communication network to perform data acquisition, monitoring, and analysis.
[0003] In existing industrial automation systems, PLC devices collect data from a host computer at fixed acquisition cycles. The host computer then processes acquisition tasks from multiple PLC devices concurrently. As the number of PLC devices increases, the concurrency surges, leading to a large number of acquisitions triggered at the same time, causing instantaneous network congestion and resource contention, affecting the stability of task execution and resulting in a high acquisition failure rate. Conversely, during non-acquisition periods, resources are idle, resulting in poor task execution balance. Summary of the Invention
[0004] This invention provides a scheduling method, device, medium, and program product for concurrent data acquisition tasks, which adaptively schedules concurrent data acquisition tasks to improve the stability and balance of task execution.
[0005] According to one aspect of the present invention, a method for scheduling concurrent acquisition tasks is provided, the method comprising: Obtain the current collection and operation parameters of multiple concurrent collection tasks, the preset collection period of each collection task, and the priority of each collection task; The load adjustment coefficient for concurrent multi-acquisition tasks is determined based on the current acquisition operation parameters. The actual acquisition period of each acquisition task is determined based on the preset acquisition period, the priority, and the load adjustment coefficient of each acquisition task. The corresponding data collection task is triggered based on the actual data collection cycle.
[0006] According to another aspect of the present invention, a scheduling device for concurrent acquisition tasks is provided, the device comprising: The task data acquisition module is used to acquire the current acquisition running parameters of multiple concurrent acquisition tasks, the preset acquisition period of each acquisition task, and the priority of each acquisition task. The load adjustment coefficient determination module is used to determine the load adjustment coefficient of concurrent multi-acquisition tasks based on the current acquisition operation parameters. The actual acquisition cycle determination module is used to determine the actual acquisition cycle of each acquisition task based on the preset acquisition cycle, the priority, and the load adjustment coefficient of each acquisition task. The task execution triggering module is used to trigger the execution of the corresponding acquisition task according to the actual acquisition cycle.
[0007] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: At least one processor; and a memory communicatively connected to said at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the concurrent acquisition task scheduling method described in any embodiment of the present invention.
[0008] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions, the computer instructions being configured to cause a processor to execute and implement the scheduling method for concurrent acquisition tasks as described in any embodiment of the present invention.
[0009] According to another aspect of the present invention, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the concurrent acquisition task scheduling method described in any embodiment of the present invention.
[0010] The technical solution of this invention solves the dynamic scheduling problem of concurrent acquisition tasks in industrial automation by acquiring the current acquisition operation parameters, the preset acquisition period of each acquisition task, and the priority of each acquisition task; determining the load adjustment coefficient of the concurrent acquisition tasks based on the current acquisition operation parameters; determining the actual acquisition period of each acquisition task based on the preset acquisition period, priority, and load adjustment coefficient; and triggering the execution of the corresponding acquisition task according to the actual acquisition period. By determining the load adjustment coefficient based on the acquisition task operation parameters and dynamically adjusting the actual acquisition period based on the real-time load adjustment coefficient, adaptive acquisition scheduling of concurrent acquisition tasks is achieved, improving the stability and balance of task execution.
[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0012] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 This is a flowchart of a scheduling method for concurrent data acquisition tasks provided in Embodiment 1 of the present invention; Figure 2 This is a flowchart of another method for scheduling concurrent acquisition tasks provided in Embodiment 1 of the present invention; Figure 3 This is a flowchart of a scheduling method for concurrent data acquisition tasks provided according to Embodiment 2 of the present invention; Figure 4 This is a schematic diagram of a scheduling device for concurrent data acquisition tasks provided in Embodiment 3 of the present invention; Figure 5 This is a schematic diagram of the structure of an electronic device that implements the scheduling method for concurrent acquisition tasks according to embodiments of the present invention. Detailed Implementation
[0014] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0015] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0016] Example 1 Figure 1This is a flowchart of a concurrent data acquisition task scheduling method according to Embodiment 1 of the present invention. This embodiment is applicable to situations in industrial automation systems where multiple PLC devices perform concurrent production process control and equipment status monitoring data acquisition. The method can be executed by a concurrent data acquisition task scheduling device, which can be implemented in hardware and / or software and can be configured in electronic devices such as computers, servers, controllers, or host computers. Figure 1 As shown, the method includes: Step 110: Obtain the current acquisition parameters of the concurrent multi-acquisition tasks, the preset acquisition period of each acquisition task, and the priority of each acquisition task.
[0017] Concurrent multi-data acquisition tasks can involve multiple PLC devices communicating with a host computer to collect monitoring data on production process control and equipment status within an automated industrial system. Multiple PLC devices can be connected in a concurrent acquisition task. Each PLC device can have a device name, communication parameters (such as IP address, port number, PLC path, etc.), sampling interval, PLC acquisition task priority, and a unique PLC identifier. The unique PLC identifier can be generated based on the IP address and port number. Each PLC device can have a preset acquisition period, which can be the desired acquisition period for the PLC device. Each PLC device can have tags. A tag can be understood as a variable, and the data it represents can be accessed through the tag. By subscribing to tags, data in the tags can be read periodically according to the sampling interval for viewing or use. The priority of the acquisition task can be set according to requirements; for example, priorities can be divided into first priority, second priority, and third priority, with the first priority being higher than the second priority, and the second priority being higher than the third priority.
[0018] The current data acquisition and operation parameters can include the data acquisition task execution status, PLC device communication status, and data processing and publishing status. The data acquisition task execution status can include: the number of PLCs currently executing data acquisition tasks (concurrent tasks), the actual time taken from task initiation to completion (current execution time), and the waiting, queuing, or blocking status in the data acquisition task queue (data acquisition task waiting time). The PLC device communication status can include: the response time of PLC device communication requests, the number of communication timeouts, identifications, or retries, and whether there are any communication calls that have not returned for a long time. The data processing and publishing status can include: the time taken to parse and process the acquired data, whether there is a backlog in the data publishing queue, and whether there is any blocking or delay in data publishing.
[0019] There are various ways to obtain the current data collection and operation parameters. For example, the current data collection and operation parameters can be obtained through real-time data collection or through a sliding window statistical method.
[0020] Step 120: Determine the load adjustment coefficient for concurrent multi-acquisition tasks based on the current acquisition operation parameters.
[0021] The load adjustment factor characterizes the current load condition. This is used to quantify the load on the current data acquisition link. For example, the number of concurrent tasks in the current data acquisition operation parameters is positively correlated with the load adjustment coefficient; that is, the higher the number of concurrent tasks, the higher the load adjustment coefficient. Similarly, the current execution time in the current data acquisition operation parameters is also positively correlated with the load adjustment coefficient; that is, the longer the current execution time, the higher the load adjustment coefficient. Finally, the number of data acquisition tasks waiting in the current data acquisition operation parameters is also positively correlated with the load adjustment coefficient; that is, the longer the number of data acquisition tasks waiting, the higher the load adjustment coefficient.
[0022] By evaluating the load in concurrent data acquisition tasks and determining the load adjustment coefficient, the concurrent data acquisition tasks can be dynamically scheduled based on the load adjustment coefficient.
[0023] Optionally, the current acquisition operation parameters include: the number of concurrent acquisition tasks and the current execution time; the load adjustment coefficient of the concurrent acquisition tasks is determined based on the current acquisition operation parameters, including: when the number of concurrent tasks is greater than the concurrent acquisition capacity, determining a first load coefficient based on the number of concurrent tasks and the concurrent acquisition capacity; determining a second load coefficient based on the current execution time and the historical execution time baseline; and determining the load adjustment coefficient of the concurrent acquisition tasks based on the first load coefficient and the second load coefficient.
[0024] The concurrent acquisition capacity can be defined as the number of concurrent acquisition tasks that can be stably handled within the current concurrent acquisition task. The concurrent acquisition capacity can be a preset value, for example, determined based on the number of threads in the concurrent acquisition task. Alternatively, the concurrent acquisition capacity can be a dynamically adjustable value, for example, dynamically adjusted based on the current acquisition parameters during the execution of the concurrent acquisition task.
[0025] The historical latency baseline can be the average latency during the stable operation of concurrent data acquisition tasks. Stable operation of concurrent data acquisition tasks can be defined as no communication with the PLC device, no data acquisition failures, and no waiting, queuing, or blocking of data acquisition tasks.
[0026] The first load factor can be the difference between the number of concurrent tasks and the concurrent data collection capacity, or it can be the proportion by which the number of concurrent tasks exceeds the concurrent data collection capacity. The second load factor can be the difference between the current execution time and the historical execution time baseline, or it can be the degree to which the current execution time exceeds the historical execution time baseline. The load adjustment factor can be determined based on the first and second load factors. For example, the load adjustment factor can be a weighted sum of the first and second load factors.
[0027] For example, the load adjustment factor is expressed by the formula Confirmed. Among them, The first load factor, For concurrent task volume, This is to determine the concurrent data collection capacity. The second load factor can be the difference between the current execution time and the historical execution time baseline. The weight of the first load factor, This is the weight for the second load factor, and the weight can be adjusted. For example, It can be set to 0.6. It can be set to 0.4. By using the first load factor and the second load factor, the load adjustment factor can be smoothly increased when the load increases, avoiding drastic changes in the acquisition cycle caused by instantaneous fluctuations in the load adjustment factor.
[0028] Optionally, the method further includes: when the number of concurrent tasks is less than or equal to the concurrent acquisition capacity, determining the load adjustment coefficient of the concurrent multi-acquisition tasks as a preset load value.
[0029] When the number of concurrent tasks is less than or equal to the concurrent data acquisition capacity, the load of the concurrent data acquisition tasks is controllable, and the load adjustment coefficient can be determined as a preset load value. For example, the preset load value can be 1 or a value with a preset distance from 1. The preset distance can be a value less than or equal to 0.1.
[0030] Step 130: Determine the actual acquisition cycle of each acquisition task based on the preset acquisition cycle, priority, and load adjustment coefficient of each acquisition task.
[0031] The actual data acquisition period can be obtained by adjusting the acquisition period based on the preset period, the priority of the acquisition tasks, and the load adjustment factor. For example, the actual acquisition period can be calculated using the formula... Confirmed. Among them, This refers to the actual data collection period. To preset the collection period, This is a quantized value for the task priority. The level of priority is negatively correlated with the quantized value. For example, the quantized value of the first priority is less than the quantized value of the second priority, and the quantized value of the second priority is less than the quantized value of the third priority. For example, the quantized value of the first priority... Less than 1, or a value close to 1; second priority quantization value. Equals 1; the quantization value of the third priority. Greater than 1.
[0032] By considering priorities when determining the actual acquisition cycle of acquisition tasks, critical acquisition tasks can be prioritized when the load of concurrent acquisition tasks is limited.
[0033] Step 140: Trigger the corresponding data collection task to execute according to the actual data collection cycle.
[0034] By triggering the execution of each acquisition task according to the adjusted actual acquisition cycle, concurrent acquisition tasks can be smoothly and dynamically adjusted according to the load, making them adaptable to the load and avoiding the synchronous sudden load caused by the fixed acquisition cycle; critical tasks can be prioritized when the load is high.
[0035] The technical solution of this embodiment solves the dynamic scheduling problem of concurrent acquisition tasks in industrial automation by acquiring the current acquisition operation parameters, the preset acquisition period of each acquisition task, and the priority of each acquisition task; determining the load adjustment coefficient of the concurrent acquisition tasks based on the current acquisition operation parameters; determining the actual acquisition period of each acquisition task based on the preset acquisition period, priority, and load adjustment coefficient; and triggering the execution of the corresponding acquisition task according to the actual acquisition period. By determining the load adjustment coefficient based on the acquisition task operation parameters and dynamically adjusting the actual acquisition period based on the real-time load adjustment coefficient, adaptive acquisition scheduling of concurrent acquisition tasks is achieved, improving the stability and balance of task execution; especially when acquisition task resources are limited, smooth scheduling of acquisition tasks is achieved.
[0036] Figure 2 This is a flowchart of another method for scheduling concurrent data acquisition tasks according to Embodiment 1 of the present invention. Figure 2 As shown, concurrent data acquisition tasks allow for the management of multiple PLCs, including the registration and maintenance of basic PLC device information. For example, PLC management can maintain a PLC list, preset acquisition cycles for each PLC device, and the priority of each PLC device. Concurrent data acquisition tasks also allow for the monitoring of the operating status of multiple PLC devices to obtain current operating parameters. Furthermore, load adjustment coefficients can be calculated based on the operating status monitoring data. The corresponding quantization value is determined based on the priority of the PLC device. Then, based on the preset acquisition cycle and load adjustment coefficient of each PLC device... and the quantization value corresponding to the priority The actual acquisition cycle is determined. Each PLC device executes its acquisition task according to the corresponding actual acquisition cycle. The data acquired by the PLC device can be published externally. For example, the acquired data can be formatted and the acquisition results can be published through message mechanisms. The technical solution of this embodiment of the invention dynamically determines the concurrent acquisition capability by the running status of concurrent acquisition tasks, and dynamically and adaptively schedules the acquisition of multiple PLC devices. It is suitable for industrial acquisition scenarios where multiple PLC devices have the same acquisition cycle or cross-acquisition.
[0037] Example 2 Figure 3 This is a flowchart of a concurrent data acquisition task scheduling method according to Embodiment 2 of the present invention. This embodiment is a further refinement of the above technical solution, and the technical solution in this embodiment can be combined with various optional solutions in one or more of the above embodiments. Figure 3 As shown, the method includes: Step 310: Obtain the current collection operation parameters of the concurrent multi-collection tasks, the preset collection period of each collection task, and the priority of each collection task; wherein, the current collection operation parameters include: the number of concurrent tasks and the current execution time of the concurrent multi-collection tasks.
[0038] Step 320: When the number of concurrent tasks exceeds the concurrent data acquisition capacity, determine the first load factor based on the number of concurrent tasks and the concurrent data acquisition capacity.
[0039] Optionally, the method further includes, in the concurrent execution of multiple acquisition tasks: obtaining the initial concurrent acquisition capacity; detecting the change in current execution time, acquisition failure rate, and the number of acquisition tasks waiting in the task queue for the concurrent multiple acquisition tasks under the concurrent task capacity; and updating the initial concurrent acquisition capacity based on the concurrent task capacity when it is determined that the concurrent task capacity meets the inflection point condition based on at least one of the change in current execution time, acquisition failure rate, and number of acquisition tasks waiting.
[0040] The initial concurrent data acquisition capacity can be a preset value. This initial concurrent data acquisition capacity can be a value obtained by evaluating the concurrent data acquisition capability during initialization. Optionally, obtaining the initial concurrent data acquisition capacity includes: determining the initial concurrent data acquisition capacity based on the number of concurrent threads and preset adjustment parameters during the initialization of concurrent multi-data acquisition tasks. For example, through the formula... Determine the initial concurrent data acquisition capacity. For the number of concurrent threads, This is the preset adjustment parameter. The preset adjustment parameter can be any value within the range [0.7, 0.9].
[0041] During the execution of concurrent data acquisition tasks, the concurrent data acquisition capacity can be dynamically adjusted based on the current data acquisition parameters under the concurrent task volume. The change in current execution time can be the difference between the average execution time of each data acquisition task and the historical baseline execution time. A threshold condition for the concurrent task volume to be met can be defined as follows: the change in current execution time under the concurrent task volume changes from no more than a preset change in execution time to more than a preset change in execution time; or, the data acquisition failure rate under the concurrent task volume changes from 0 to greater than 0; or the waiting time for data acquisition tasks changes from 0 to greater than 0. When the concurrent task volume meets the threshold condition, updating the initial concurrent data acquisition capacity based on the concurrent task volume can be achieved by using the concurrent task volume corresponding to the threshold as the concurrent data acquisition capacity.
[0042] During the actual execution of concurrent data acquisition tasks, acquisition parameters at different concurrency levels can be recorded. For example, when increasing the number of concurrent tasks, if the average acquisition time of the PLC devices does not increase significantly compared to the historical baseline, and the acquisition failure rate is 0, and the task waiting time is 0, it indicates that the communication resources can still handle the load. At this point, the number of concurrent tasks can continue to increase until the average acquisition time of some PLC devices increases significantly compared to the historical baseline, or the acquisition failure rate is not 0, or the task waiting time is not 0. At this point, the current number of concurrent tasks is determined as an "inflection point," indicating that the concurrent acquisition tasks have reached the communication capacity boundary. The current number of concurrent tasks is then set as the concurrent acquisition capacity. In subsequent operations, the concurrent acquisition capacity can be continuously fine-tuned.
[0043] By dynamically adjusting the concurrent acquisition capacity in concurrent acquisition tasks, the concurrent acquisition capacity can accurately reflect the concurrent capacity of resources, improve the reliability of load capacity assessment, and thus achieve accurate determination of the acquisition cycle, ensuring the smooth operation of acquisition tasks.
[0044] Step 330: Determine the second load factor based on the current execution time and the historical execution time baseline.
[0045] The current execution time can be the average execution time calculated within the sliding window. Optionally, before determining the second load coefficient based on the current execution time and the historical execution time baseline, the method further includes: determining the length of the first sliding window based on the actual acquisition cycle of each acquisition task in the concurrent multi-acquisition tasks; acquiring the execution time data of each acquisition task within the first sliding window; and determining the current execution time based on the execution time data.
[0046] The first sliding window length can be the window length for determining the current execution time. Within the first sliding window length, the execution time of each data acquisition task can be calculated, and the average execution time can be used as the current execution time. The first sliding window length can be determined based on the actual acquisition cycle of each data acquisition task in a concurrent multi-data acquisition task. For example, the least common multiple of the actual acquisition cycles of each data acquisition task can be used as the first sliding window length, taking into account the execution time of each task, so that the current execution time reflects the execution time of each task, thus better reflecting the actual load situation. Alternatively, the product of the least common multiple of the actual acquisition cycles of each data acquisition task and a preset number of loops can be used as the first sliding window length.
[0047] The historical execution time baseline can be the average execution time statistically analyzed during the stable operation of concurrent data acquisition tasks within a sliding window. Optionally, before determining the second load factor based on the current execution time and the historical execution time baseline, the process further includes: determining the length of the second sliding window based on the failure rate of concurrent data acquisition tasks, the number of data acquisition tasks waiting in the task queue, and the actual acquisition cycle of each data acquisition task; acquiring the execution time data of each data acquisition task within the second sliding window, and determining the historical execution time baseline based on the execution time data.
[0048] For example, when the failure rate of concurrent multi-acquisition tasks is 0 and the waiting time for acquisition tasks is 0, the length of the second sliding window can be determined based on the actual acquisition cycle of each acquisition task. For instance, when the failure rate is 0 and the waiting time for acquisition tasks is 0, the length of N acquisitions performed by each acquisition task can be selected as the length of the second sliding window based on the actual acquisition cycle of each task. By determining the historical latency baseline within the second sliding window length, the historical latency baseline can reflect the load situation during stable operation of the acquisition tasks. Therefore, based on the historical latency baseline, the impact of the current acquisition task on load fluctuations can be determined, thereby accurately determining the load adjustment coefficient for adaptive adjustment of the acquisition cycle.
[0049] In this embodiment of the invention, when determining the current execution time and historical time baseline using a sliding window, old data can be removed and new data added when the window is full, ensuring the dynamic real-time nature of the current execution time and historical time baseline. Simultaneously, using a sliding window can avoid interference caused by network jitter or momentary busyness of the PLC device, preventing misjudgments.
[0050] Step 340: Determine the load adjustment coefficient for concurrent multi-acquisition tasks based on the first load coefficient and the second load coefficient.
[0051] Step 350: When the number of concurrent tasks is less than or equal to the concurrent acquisition capacity, the load adjustment coefficient of the concurrent multi-acquisition tasks is determined as the preset load value.
[0052] Step 360: Determine the actual acquisition cycle of each acquisition task based on the preset acquisition cycle, priority, and load adjustment coefficient of each acquisition task.
[0053] Step 370: Trigger the corresponding data collection task to execute according to the actual data collection cycle.
[0054] The technical solution of this invention addresses the dynamic scheduling problem of concurrent acquisition tasks in industrial automation by acquiring the current acquisition operation parameters, the preset acquisition cycle of each acquisition task, and the priority of each acquisition task. The current acquisition operation parameters include the concurrent task volume and current execution time of the concurrent acquisition tasks. When the concurrent task volume exceeds the concurrent acquisition capacity, a first load factor is determined based on the concurrent task volume and the concurrent acquisition capacity. A second load factor is determined based on the current execution time and historical execution time baseline. A load adjustment factor for the concurrent acquisition tasks is determined based on the first and second load factors. When the concurrent task volume is less than or equal to the concurrent acquisition capacity, the load adjustment factor for the concurrent acquisition tasks is set to a preset load value. The actual acquisition cycle of each acquisition task is determined based on its preset acquisition cycle, priority, and load adjustment factor. The corresponding acquisition task is triggered based on the actual acquisition cycle, thus solving the dynamic scheduling problem of concurrent acquisition tasks in industrial automation and enabling dynamic adjustment of the actual acquisition cycle. It allows the actual data acquisition cycle to be based on business expectations and reflect the carrying capacity under current operating conditions; it meets user acquisition expectations as much as possible when the operating status is good; it automatically adjusts the acquisition execution rhythm when the load increases to ensure the stability of acquisition task execution; thus, in scenarios where multiple PLC devices acquire data concurrently, it avoids synchronous burst loads caused by fixed acquisition cycles; it achieves smooth scheduling of acquisition tasks when network and computing resources are limited; it dynamically and adaptively adjusts the acquisition rhythm of PLC devices according to the operating status of acquisition tasks; it ensures improved stability and balance of task execution based on the PLC acquisition cycle based on the preset acquisition cycle; when concurrent acquisition capability is available, it allows multiple PLC devices to acquire data concurrently within the same time window; it automatically schedules acquisition tasks in a distributed rhythm mode when the task execution load increases; it realizes adaptive switching between concurrent acquisition and distributed acquisition modes, which is especially suitable for industrial acquisition scenarios where multiple PLC devices have the same acquisition cycle or cross acquisition.
[0055] Example 3 Figure 4 This is a schematic diagram of a scheduling device for concurrent data acquisition tasks provided according to Embodiment 3 of the present invention. Figure 4 As shown, the device includes: a task data acquisition module 410, a load adjustment coefficient determination module 420, an actual acquisition cycle determination module 430, and a task execution triggering module 440. Wherein: The task data acquisition module 410 is used to acquire the current acquisition operation parameters of the concurrent multi-acquisition tasks, the preset acquisition period of each acquisition task, and the priority of each acquisition task. The load adjustment coefficient determination module 420 is used to determine the load adjustment coefficient of concurrent multi-acquisition tasks based on the current acquisition operation parameters; The actual acquisition cycle determination module 430 is used to determine the actual acquisition cycle of each acquisition task based on the preset acquisition cycle, priority, and load adjustment coefficient of each acquisition task. The task execution triggering module 440 is used to trigger the execution of the corresponding collection task according to the actual collection cycle.
[0056] Optionally, the current data collection parameters include: the number of concurrent data collection tasks and the current execution time; The load adjustment factor determination module 420 includes: The first load factor determination unit is used to determine the first load factor based on the concurrent task volume and the concurrent acquisition capacity when the concurrent task volume is greater than the concurrent acquisition capacity. The second load factor determination unit is used to determine the second load factor based on the current execution time and the historical execution time baseline. The first load adjustment coefficient determination unit is used to determine the load adjustment coefficient of concurrent multi-acquisition tasks based on the first load coefficient and the second load coefficient.
[0057] Optionally, the load adjustment factor determination module 420 also includes: The second load adjustment coefficient determination unit is used to determine the load adjustment coefficient of the concurrent multi-acquisition tasks as a preset load value when the number of concurrent tasks is less than or equal to the concurrent acquisition capacity.
[0058] Optionally, in the concurrent execution of multiple acquisition tasks, the device further includes: The initial concurrent data acquisition capacity acquisition module is used to obtain the initial concurrent data acquisition capacity. The concurrent task data detection module is used to detect the changes in the current execution time, failure rate, and waiting number of multiple concurrent data collection tasks under the concurrent task volume. The concurrent acquisition capacity update module is used to update the initial concurrent acquisition capacity based on the concurrent task volume when it is determined that the concurrent task volume meets the inflection point condition based on at least one of the current execution time change, acquisition failure rate, and acquisition task waiting time.
[0059] Optional, the initial concurrent data acquisition capacity acquisition module includes: The initial concurrent acquisition capacity acquisition unit is used to determine the initial concurrent acquisition capacity based on the number of concurrent threads and preset adjustment parameters during the initialization of multiple concurrent acquisition tasks.
[0060] Optionally, the load adjustment factor determination module 420 also includes: The first sliding window length determination unit is used to determine the length of the first sliding window based on the actual acquisition cycle of each acquisition task in the concurrent multi-acquisition tasks before determining the second load coefficient based on the current execution time and the historical time baseline. The current execution time determination unit is used to acquire the time consumption data of each acquisition task within the first sliding window, and determine the current execution time based on the time consumption data.
[0061] Optionally, the load adjustment factor determination module 420 also includes: The second sliding window length determination unit is used to determine the second sliding window length based on the acquisition failure rate in concurrent multi-acquisition tasks, the waiting amount of acquisition tasks in the task queue, and the actual acquisition cycle of each acquisition task before determining the second load coefficient based on the current execution time and the historical time baseline. The historical time baseline determination unit is used to acquire the time data of each acquisition task within the second sliding window and determine the historical time baseline based on the time data.
[0062] The concurrent acquisition task scheduling device provided in the embodiments of the present invention can execute the concurrent acquisition task scheduling method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0063] Example 4 Figure 5 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0064] like Figure 5As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) or random access memory (RAM), communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded into the RAM 13 from the storage unit 18. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. Input / output (I / O) interfaces are also connected to the bus 14.
[0065] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0066] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as scheduling methods for concurrent acquisition tasks.
[0067] In some embodiments, the scheduling method for concurrent acquisition tasks may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the scheduling method for concurrent acquisition tasks described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the scheduling method for concurrent acquisition tasks by any other suitable means (e.g., by means of firmware).
[0068] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0069] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0070] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, RAM, ROM, erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0071] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0072] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0073] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0074] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0075] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A scheduling method for concurrent data acquisition tasks, characterized in that, include: Obtain the current collection and operation parameters of multiple concurrent collection tasks, the preset collection period of each collection task, and the priority of each collection task; The load adjustment coefficient for concurrent multi-acquisition tasks is determined based on the current acquisition operation parameters. The actual acquisition period of each acquisition task is determined based on the preset acquisition period, the priority, and the load adjustment coefficient of each acquisition task. The corresponding data collection task is triggered based on the actual data collection cycle.
2. The method according to claim 1, characterized in that, The current data acquisition parameters include: the number of concurrent data acquisition tasks and the current execution time; The load adjustment coefficient for concurrent multi-acquisition tasks is determined based on the current acquisition operation parameters, including: When the number of concurrent tasks exceeds the concurrent data acquisition capacity, a first load factor is determined based on the number of concurrent tasks and the concurrent data acquisition capacity. The second load factor is determined based on the current execution time and the historical execution time baseline; Based on the first load factor and the second load factor, determine the load adjustment factor for concurrent multi-acquisition tasks.
3. The method according to claim 2, characterized in that, Also includes: When the number of concurrent tasks is less than or equal to the concurrent acquisition capacity, the load adjustment coefficient of the concurrent multi-acquisition tasks is determined as a preset load value.
4. The method according to claim 2, characterized in that, In concurrent execution of multiple data acquisition tasks, the following are also included: Obtain the initial concurrent data collection capacity; The current execution time change, acquisition failure rate, and waiting amount of acquisition tasks in the task queue are detected under the aforementioned concurrent task volume. When it is determined that the concurrent task volume meets the inflection point condition based on at least one of the current execution time change, the acquisition failure rate, and the acquisition task waiting amount, the initial concurrent acquisition capacity is updated according to the concurrent task volume.
5. The method according to claim 4, characterized in that, Obtain the initial concurrent data collection capacity, including: During the initialization of concurrent multi-acquisition tasks, the initial concurrent acquisition capacity is determined based on the number of concurrent threads and preset adjustment parameters.
6. The method according to claim 2, characterized in that, Before determining the second load factor based on the current execution time and the historical execution time baseline, the process also includes: The length of the first sliding window is determined based on the actual acquisition cycle of each acquisition task in the concurrent multi-acquisition tasks. Within the first sliding window, acquire the time consumption data of each acquisition task, and determine the current execution time based on the time consumption data.
7. The method according to claim 2, characterized in that, Before determining the second load factor based on the current execution time and the historical execution time baseline, the process also includes: The length of the second sliding window is determined based on the failure rate of the concurrent multi-acquisition tasks, the waiting amount of acquisition tasks in the task queue, and the actual acquisition cycle of each acquisition task. The time consumption data of each acquisition task is obtained within the second sliding window, and the historical time consumption baseline is determined based on the time consumption data.
8. An electronic device, characterized in that, The electronic device includes: At least one processor; and a memory communicatively connected to said at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the scheduling method for concurrent acquisition tasks according to any one of claims 1-7.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the scheduling method for concurrent acquisition tasks according to any one of claims 1-7.
10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the scheduling method for concurrent acquisition tasks according to any one of claims 1-7.