CN116680049A - Scheduling method, equipment and storage medium of functional blocks - Google Patents

Scheduling method, equipment and storage medium of functional blocks Download PDF

Info

Publication number
CN116680049A
CN116680049A CN202310588811.7A CN202310588811A CN116680049A CN 116680049 A CN116680049 A CN 116680049A CN 202310588811 A CN202310588811 A CN 202310588811A CN 116680049 A CN116680049 A CN 116680049A
Authority
CN
China
Prior art keywords
space
task
program
functional block
accessed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310588811.7A
Other languages
Chinese (zh)
Inventor
李友军
周亚东
唐毅
张成彬
李聪聪
戴欣欣
巴超
朱彬彬
刘拯
饶丹
张吉
沈志浩
刘千令
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Electric Power Research Institute of State Grid Shandong Electric Power Co Ltd
NARI Nanjing Control System Co Ltd
State Grid Electric Power Research Institute
Original Assignee
Electric Power Research Institute of State Grid Shandong Electric Power Co Ltd
NARI Nanjing Control System Co Ltd
State Grid Electric Power Research Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Electric Power Research Institute of State Grid Shandong Electric Power Co Ltd, NARI Nanjing Control System Co Ltd, State Grid Electric Power Research Institute filed Critical Electric Power Research Institute of State Grid Shandong Electric Power Co Ltd
Priority to CN202310588811.7A priority Critical patent/CN116680049A/en
Publication of CN116680049A publication Critical patent/CN116680049A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Quality & Reliability (AREA)
  • Storage Device Security (AREA)

Abstract

The invention discloses a scheduling method, equipment and a storage medium of a functional block, wherein the method comprises the following steps: (1) Dividing the memory space of the target equipment into a system space and a user space; dividing the user space into a plurality of function block spaces; (2) The method comprises the steps of respectively setting the accessed rights of a system space, a user space and each function block space, wherein the system space only has the accessed rights of a system program; each functional block in the user space can only access the space where the functional block is located; (3) constructing a task queue according to the task priority; (4) Each task in the task queue is controlled to be sequentially executed, and when the target equipment acquires that a first program corresponding to the task accesses the system space or the user space, whether the first program is unauthorized is judged; the invention realizes the millisecond-level response of the tasks, enables each task in the system to independently operate without mutual influence, and improves the reliability of the embedded system.

Description

Scheduling method, equipment and storage medium of functional blocks
Technical Field
The invention belongs to the technical field of high-real-time embedded computers, and particularly relates to a method, equipment and a storage medium for scheduling functional blocks based on a memory management unit.
Background
The intelligent substation is an important component of intelligent power grid construction as an important foundation and key support of the intelligent power grid. The intelligent substation is subjected to different development stages such as sampling digital transformation, network architecture optimization, protection on-site transformation and the like, and is currently advancing towards the goals of high system integration, reasonable structural layout, advanced and applicable equipment, economy, energy conservation and environmental protection. To achieve this goal, it is necessary to put the various business modules to operate in the same hardware environment. When the multi-service function is integrated into one device, the interaction between the modules is inevitably brought about when a plurality of service function modules are operated in the device. Failure of one module program may cause another normal module to run abnormally or even cause the system to crash. After the transformer substation protection monitoring equipment integrates the multi-service functions, different functions of the equipment are required to be not affected mutually, one service module must be ensured to be abnormal, and other service modules can normally operate and are not affected. The current Linux operating system can ensure that the process operation is not affected, but the task scheduling real-time performance based on the Linux operating system can not meet the requirement of protecting the high real-time task scheduling of the monitoring equipment. Therefore, the software running environment and the system for isolating the multi-service functional program are provided, the independence of each service in running is ensured, the mutual influence is avoided, and the system is an inherent requirement of a multi-functional integrated device software and hardware architecture.
Disclosure of Invention
The invention aims to: the invention aims to provide a scheduling method, equipment and storage medium of a functional block, which are used for constructing a multi-task scheduling system under the condition of not influencing embedded high-real-time scheduling under the operating environment based on bare computers, so that one task fault does not influence the operation of other tasks, and the scheduling execution environment of multi-task isolation operation is realized.
The technical scheme is as follows: the invention relates to a scheduling method of a functional block, which comprises the following steps:
(1) Dividing the memory space of the target equipment into a system space and a user space; dividing the user space into a plurality of function block spaces;
(2) The method comprises the steps of respectively setting the accessed rights of a system space, a user space and each function block space, wherein the system space only has the accessed rights of a system program; each functional block in the user space can only access the space where the functional block is located;
(3) Constructing a task queue according to the task priority;
(4) Each task in the task queue is controlled to be sequentially executed, and when the target equipment acquires that a first program corresponding to the task accesses the system space or the user space, whether the first program is unauthorized is judged; if the first program is unauthorized, representing that the task corresponding to the first program is an abnormal task, enabling the target equipment to enter into abnormal interrupt and executing an interrupt processing program;
in the abnormal interrupt processing program, abnormal tasks are removed from the task queue, and a program execution PC pointer is set to enable the system to normally operate.
Further, the system space includes: code segments, data segments, stack segments, shared data segments; the functional block space comprises a code segment, a data segment, a stack segment and a heap segment.
Further, after the step (2), the method further includes: and storing the corresponding rights management data of the accessed rights of the system space, the user space and the functional block spaces in a memory management unit in the target device.
Further, the method further comprises the steps of constructing a task queue according to the task priority, and then: analyzing each task by utilizing an executable program file of the analysis functional block to obtain a space to be accessed corresponding to each task, and determining a target interface memory address of each space to be accessed according to the system space, the user space, the interface memory address of each functional block space and the space to be accessed corresponding to each task; and constructing a task interface queue according to the sequence of each task in the task queue by using the target interface memory address of each space to be accessed.
Further, in the abort procedure, the step (4) further includes: the system program file records the error code segment position, stack pointer position and program pointer position and stores them in the system program file.
Further, the system space is not less than 32MB, and the memory space of each program function block is not less than 16MB.
The invention relates to a scheduling system of a functional block, which comprises:
and a space dividing module: the memory space of the target equipment is divided into a system space and a user space; dividing the user space into a plurality of function block spaces;
the permission setting module: for setting the accessed rights of the memory management unit, the system space and the user space, respectively, wherein the system space has only the accessed rights of the system program; each functional block in the user space can only access the space where the functional block is located;
task priority setting module: for building task queue priority;
an exception handling module: the method comprises the steps that each task in a task queue is controlled to be sequentially executed, and when target equipment obtains a first program corresponding to the task to access a system space or a user space, whether the first program is unauthorized is judged; if the first program is unauthorized, representing that the task corresponding to the first program is an abnormal task, enabling the target equipment to enter into abnormal interrupt and executing an interrupt processing program;
in the abnormal interrupt processing program, abnormal tasks are removed from the task queue, and a program execution PC pointer is set to enable the system to normally operate.
The device comprises a memory, a processor and a program stored on the memory and capable of running on the processor, wherein the processor realizes the steps in the function block scheduling method based on the memory management unit when executing the program.
A storage medium according to the invention has a computer program stored therein, wherein the computer program is arranged to perform the above method when run.
The beneficial effects are that: compared with the prior art, the invention has the following remarkable advantages: the method comprises the steps of setting a plurality of space types for target equipment; setting access rights; the task queues are constructed according to the priorities, so that millisecond-level response of the tasks is realized, each task in the system operates independently without mutual influence, and the reliability of the embedded system is improved.
Drawings
FIG. 1 is an overall block diagram of the present invention;
FIG. 2 is a diagram illustrating memory allocation according to the present invention;
FIG. 3 is an example of a system call interface of the present invention;
FIG. 4 is a schematic diagram showing the isolation effect of the functional blocks according to the present invention.
Detailed Description
The technical scheme of the invention is further described below with reference to the accompanying drawings.
As shown in fig. 1, an embodiment of the present invention provides a method for scheduling functional blocks, including the following steps:
(1) Dividing the memory space of the target equipment into a system space and a user space; dividing the user space into a plurality of function block spaces; the system space includes: code segments, data segments, stack segments, shared data segments; the functional block space comprises a code segment, a data segment, a stack segment and a heap segment. The system space is not less than 32MB, and the memory space of each program functional block is not less than 16MB.
(2) The method comprises the steps of respectively setting the accessed rights of a system space, a user space and each function block space, wherein the system space only has the accessed rights of a system program; each functional block in the user space can only access the space where the functional block is located; and storing the corresponding rights management data of the accessed rights of the system space, the user space and the functional block spaces in a memory management unit in the target device.
(3) Constructing a task queue according to the task priority; analyzing each task by utilizing an executable program file of the analysis functional block to obtain a space to be accessed corresponding to each task, and determining a target interface memory address of each space to be accessed according to the system space, the user space, the interface memory address of each functional block space and the space to be accessed corresponding to each task; and constructing a task interface queue according to the sequence of each task in the task queue by using the target interface memory address of each space to be accessed.
The method comprises the following steps:
(31) And defining the function interfaces of each priority task of the function block program according to the unified rule. And the upper computer scans and records the addresses of all priority task interfaces, and affixes the addresses to the last executable program file of the functional block, and the compiled executable file retains the function interface information through-g compiling options. Such as xxx_leve1 ()/xxx_leve2 (), etc. . And the target equipment records the task interface memory address of the functional block by analyzing the executable file.
(32) The system program imports the function block executable programs one by one according to the sequence of the configuration files. Each imported function block executable program classifies the task interface addresses of the function blocks according to the priorities and adds the task interface addresses into task queues with corresponding priorities. If xxx_level1 () task interface address is added to the first priority task queue, xxx_level2 () task interface address is added to the second priority task queue, and so on.
(33) The task queue is constructed in a linked list mode, and each node of the task interface address comprises a pointer pointing to the next task interface address, the interface address of the task, a functional block to which the task belongs and other information.
Each priority task queue corresponds to an interrupt service routine with the same priority, and the interrupt service routine calls the task queue with the corresponding priority.
(4) Each task in the task queue is controlled to be sequentially executed, and when the target equipment acquires that a first program corresponding to the task accesses the system space or the user space, whether the first program is unauthorized is judged; if the first program is unauthorized, representing that the task corresponding to the first program is an abnormal task, enabling the target equipment to enter into abnormal interrupt and executing an interrupt processing program;
in the abnormal interrupt processing program, abnormal tasks are removed from a task queue, and a program execution PC pointer is set to enable the system to normally operate; the system program file records the error code segment position, stack pointer position and program pointer position and stores them in the system program file.
The method comprises the following steps:
the memory management unit is a dynamic memory management component integrated inside the processor and is responsible for managing memory access and memory translation. During the execution of the user space program function block, the memory management unit checks each memory reading and writing instruction, if out-of-range access is found, the memory abnormal interrupt with the highest priority is triggered, and in the memory abnormal interrupt service program, the code segment position, stack pointer position and program pointer position of the access error are judged and recorded in a file; stopping execution of the erroneous program function block, and deleting the task to which the abnormal program function block belongs from the task scheduling queue; and skipping the executing task, setting the position of the program pointer, and continuing to execute other tasks in the task queue. The memory abort service program belongs to a part of a system program and runs in a system space.
The embodiment of the invention also provides a scheduling system of the functional blocks, which comprises the following steps:
and a space dividing module: the memory space of the target equipment is divided into a system space and a user space; dividing the user space into a plurality of function block spaces;
the permission setting module: for setting the accessed rights of the memory management unit, the system space and the user space, respectively, wherein the system space has only the accessed rights of the system program; each functional block in the user space can only access the space where the functional block is located;
task priority setting module: for building task queue priority;
an exception handling module: if the system space or the user space is unauthorized, the target equipment is abnormal and enters into abnormal program interruption; and in the exception handling program, eliminating the exception task, and setting a program execution PC pointer to enable the system to normally operate.
The embodiment of the invention also provides equipment, which comprises a memory, a processor and a program stored on the memory and capable of running on the processor, wherein the processor realizes the steps in the function block scheduling method based on the memory management unit when executing the program.
The embodiment of the invention also provides a storage medium, wherein the storage medium stores a computer program, and the computer program is configured to execute the method when running.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein. The scheme in the embodiment of the invention can be realized by adopting various computer languages, such as object-oriented programming language Java, an transliteration script language JavaScript and the like.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (9)

1. A method for scheduling a functional block, comprising the steps of:
(1) Dividing the memory space of the target equipment into a system space and a user space; dividing the user space into a plurality of function block spaces;
(2) The method comprises the steps of respectively setting the accessed rights of a system space, a user space and each function block space, wherein the system space only has the accessed rights of a system program; each functional block in the user space can only access the space where the functional block is located;
(3) Constructing a task queue according to the task priority;
(4) Each task in the task queue is controlled to be sequentially executed, and when the target equipment acquires that a first program corresponding to the task accesses the system space or the user space, whether the first program is unauthorized is judged; if the first program is unauthorized, representing that the task corresponding to the first program is an abnormal task, enabling the target equipment to enter into abnormal interrupt and executing an interrupt processing program;
in the abnormal interrupt processing program, abnormal tasks are removed from the task queue, and a program execution PC pointer is set to enable the system to normally operate.
2. The method for scheduling a functional block according to claim 1, wherein the system space comprises: code segments, data segments, stack segments, shared data segments; the functional block space comprises a code segment, a data segment, a stack segment and a heap segment.
3. The method for scheduling a functional block according to claim 1, wherein after the step (2), further comprising: and storing the corresponding rights management data of the accessed rights of the system space, the user space and the functional block spaces in a memory management unit in the target device.
4. The method for scheduling a functional block according to claim 1, wherein the task queue is constructed according to task priorities, and further comprising: analyzing each task by utilizing an executable program file of the analysis functional block to obtain a space to be accessed corresponding to each task, and determining a target interface memory address of each space to be accessed according to the system space, the user space, the interface memory address of each functional block space and the space to be accessed corresponding to each task; and constructing a task interface queue according to the sequence of each task in the task queue by using the target interface memory address of each space to be accessed.
5. The method according to claim 1, wherein the step (4) further comprises, in an abort program: the system program file records the error code segment position, stack pointer position and program pointer position and stores them in the system program file.
6. The method of claim 1, wherein the system space is not less than 32MB and the memory space of each program function block is not less than 16MB.
7. A system for scheduling functional blocks, comprising:
and a space dividing module: the memory space of the target equipment is divided into a system space and a user space; dividing the user space into a plurality of function block spaces;
the permission setting module: the system space is used for setting the accessed rights of the system space, the user space and the functional block spaces respectively, wherein the system space only has the accessed rights of the system program; each functional block in the user space can only access the space where the functional block is located;
task priority setting module: for building task queue priority;
an exception handling module: the method comprises the steps that each task in a task queue is controlled to be sequentially executed, and when target equipment obtains a first program corresponding to the task to access a system space or a user space, whether the first program is unauthorized is judged; if the first program is unauthorized, representing that the task corresponding to the first program is an abnormal task, enabling the target equipment to enter into abnormal interrupt and executing an interrupt processing program;
in the abnormal interrupt processing program, abnormal tasks are removed from the task queue, and a program execution PC pointer is set to enable the system to normally operate.
8. An apparatus comprising a memory, a processor and a program stored on the memory and executable on the processor, wherein the processor performs the steps of a memory management unit based function block scheduling method according to any one of claims 1-6 when executing the program.
9. A storage medium having a computer program stored therein, wherein the computer program is arranged to perform the method of any of claims 1-6 when run.
CN202310588811.7A 2023-05-23 2023-05-23 Scheduling method, equipment and storage medium of functional blocks Pending CN116680049A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310588811.7A CN116680049A (en) 2023-05-23 2023-05-23 Scheduling method, equipment and storage medium of functional blocks

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310588811.7A CN116680049A (en) 2023-05-23 2023-05-23 Scheduling method, equipment and storage medium of functional blocks

Publications (1)

Publication Number Publication Date
CN116680049A true CN116680049A (en) 2023-09-01

Family

ID=87778016

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310588811.7A Pending CN116680049A (en) 2023-05-23 2023-05-23 Scheduling method, equipment and storage medium of functional blocks

Country Status (1)

Country Link
CN (1) CN116680049A (en)

Similar Documents

Publication Publication Date Title
US3771146A (en) Data processing system interrupt arrangements
CN110297689B (en) Intelligent contract execution method, device, equipment and medium
CN105022630B (en) A kind of assembly management system and assembly management method
CN105184166A (en) Kernel-based Android application real-time behavior analysis method and system
CN104461876B (en) A kind of concurrent program based on operation snapshot sequence reappears adjustment method
CN103440457B (en) Based on the binary program analytic system of process simulation
CN102792280A (en) Information processing device, information processing method, and program
CN111625289B (en) Method and device for quickly starting application program and electronic equipment
CN103365668B (en) A kind of dynamic link library loads and the method, apparatus of link
CN112650539B (en) Heterogeneous many-core processor-oriented dynamic link operation support method
CN102063328A (en) System for detecting interrupt-driven type program data competition
CN109213813A (en) Data export method and device
CN111027054A (en) Method and system for judging running of application program in multi-open environment based on android system
Gold et al. KVM/370 in retrospect
US20140222410A1 (en) Hybrid emulation and kernel function processing systems and methods
CN111914251A (en) Intelligent terminal safety protection method and system based on hybrid control technology
CN107368739A (en) A kind of monitoring method and apparatus of kernel-driven
CN114579091A (en) Robot process automation system and method across operating systems
CN113176926A (en) API dynamic monitoring method and system based on virtual machine introspection technology
CN103019865B (en) Virtual machine monitoring method and system
CN116680049A (en) Scheduling method, equipment and storage medium of functional blocks
CN115795489B (en) Software vulnerability static analysis method and device based on hardware-level process tracking
CN102521397B (en) Data transmission method
CN102737198B (en) Object protection method and device
CN102446113B (en) Method and device for simulating bottom-layer message interface

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination