The invention discloses a PLC scheduling
algorithm based on a multi-core soft real-time
operating system, and relates to the technical field of
voltage control, and the
algorithm comprises the following four steps: 1, starting a target
industrial control system, completing hardware self-inspection, memory allocation and communication module starting, and sending an initialization ready
signal after confirming that an
assembly is normal; 2, according to PLC task functions and real-time performance, four types of standardized tasks are divided, priority levels are defined, sub-priorities are configured, a dependency relationship is identified, and a task chain is established; 3, counting the number of tasks and task chains, distributing resources by using multiple binding cores, and constructing a global ready
queue to adapt to dynamic scheduling; and 4, monitoring an interrupt event through an interrupt manager, realizing high-priority task
preemption by semaphores, and allocating tasks to corresponding CPU cores, so that the problems of soft real-time multi-core task
preemption and data conflict are solved, the scheduling real-time performance and the
data security are improved, the
system failure rate is reduced, and the industrial control efficiency and stability are improved.