CN109581925A - A kind of task processing method and device, computer readable storage medium - Google Patents

A kind of task processing method and device, computer readable storage medium Download PDF

Info

Publication number
CN109581925A
CN109581925A CN201811480552.1A CN201811480552A CN109581925A CN 109581925 A CN109581925 A CN 109581925A CN 201811480552 A CN201811480552 A CN 201811480552A CN 109581925 A CN109581925 A CN 109581925A
Authority
CN
China
Prior art keywords
task
tasks
logical program
bus master
sub
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
CN201811480552.1A
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.)
Beijing Hollysys Co Ltd
Original Assignee
Beijing Hollysys Co Ltd
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 Beijing Hollysys Co Ltd filed Critical Beijing Hollysys Co Ltd
Priority to CN201811480552.1A priority Critical patent/CN109581925A/en
Publication of CN109581925A publication Critical patent/CN109581925A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0421Multiprocessor system
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/22Pc multi processor system
    • G05B2219/2205Multicore
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/22Pc multi processor system
    • G05B2219/2231Master slave

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Stored Programmes (AREA)

Abstract

This application discloses a kind of task processing method and device, computer readable storage medium, the task processing method includes: to obtain one or more tasks;According to the number for the processor core for specifying operation in the configuration of the task, the task is loaded on corresponding processor core and is run.Task is loaded on corresponding processor core and runs, so that the operating condition of system is fully controllable, and then can be improved the operational efficiency of system entirety by the number of the processor core of operation specified in the configuration according to task by the application.

Description

A kind of task processing method and device, computer readable storage medium
Technical field
The present invention relates to, but not limited to field of communication technology more particularly to a kind of task processing methods and device, computer Readable storage medium storing program for executing.
Background technique
Industrial control system takes high performance processor more and more, carries out operation to the data of acquisition.With list Core processor is compared, and multi-core processor can handle more tasks within a clock cycle, it has also become at the mainstream of future market Manage the development trend of device.
Currently, for the processing of multitask, being mostly used by being in the product realization of the multi-core processor of industrial control system System is to distribute each task to corresponding processor core.Existing this method for allocating tasks, running situation is uncontrollable, can The operational efficiency that system entirety can be will lead to is lower.
Summary of the invention
The embodiment of the invention provides a kind of task processing method and devices, computer readable storage medium, enable to The operating condition of system is fully controllable, and then can be improved the operational efficiency of system entirety.
The technical solution of the embodiment of the present invention is achieved in that
The embodiment of the invention provides a kind of task processing methods, comprising:
Obtain one or more tasks;
According to the number for the processor core for specifying operation in the configuration of the task, the task is loaded into corresponding place It is run on reason device core.
In one embodiment, the method also includes:
The number of the processor core of the operation is specified according to the priority of the task.
In one embodiment, the method also includes:
By the global number that data field is divided into the privately owned private data area of each task and all tasks share According to area;
When the task run, shared complete of the privately owned private data area of the task and all tasks may have access to Office data area.
In one embodiment, the one or more tasks of the acquisition, comprising:
Operation logic program includes one or more tasks in the logical program.
In one embodiment, the logical program is the logical program of configuration, and the logical program of the configuration is for completing Operation is carried out to the data of one or more bus masters acquisition, and exports operation result to the bus master.
In one embodiment, the logical program includes one or more sub- logical programs, and the sub- logical program includes One or more tasks, one sub- logical program are used to complete to carry out the data of a bus master acquisition Operation, and operation result is exported to bus master described in this, one bus master is handled by a sub- logical program.
In one embodiment, the logical program includes one or more sub- logical programs, and the sub- logical program includes One or more tasks, one task are used to complete to transport the data of a bus master acquisition It calculates, and exports operation result to bus master described in this, one bus master is handled by a task.
The embodiment of the invention also provides a kind of computer readable storage medium, the computer-readable recording medium storage Have one or more program, one or more of programs can be executed by one or more processor, with realize such as with The step of upper described in any item task processing methods.
The embodiment of the invention also provides a kind of Task Processing Units, including processor and memory, in which:
The processor is for executing the program stored in memory, to realize the task processing as described in any of the above item The step of method.
The embodiment of the invention also provides a kind of Task Processing Unit, including task acquisition module and task loading module, Wherein:
Task acquisition module, for obtaining one or more tasks;
Task loading module, the number of the processor core for specifying operation in the configuration according to the task will be described Task is loaded on corresponding processor core and runs.
The technical solution of the embodiment of the present invention, has the following beneficial effects:
Task processing method and device provided in an embodiment of the present invention, computer readable storage medium, by according to task Configuration in specify operation processor core number, task be loaded on corresponding processor core run, so that system Operating condition is fully controllable, and then can be improved the operational efficiency of system entirety.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present invention, constitutes part of this application, this hair Bright illustrative embodiments and their description are used to explain the present invention, and are not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is a kind of flow diagram of task processing method of the embodiment of the present invention;
Fig. 2 is the relation schematic diagram of a kind of configuration software and controller of the embodiment of the present invention;
Fig. 3 is the relation schematic diagram of a seed logical program and bus master of the embodiment of the present invention;
Fig. 4 is the relation schematic diagram of a kind of task and data field of the embodiment of the present invention;
Fig. 5 is a kind of structural schematic diagram of Task Processing Unit of the embodiment of the present invention;
Fig. 6 is the structural schematic diagram of another Task Processing Unit of the embodiment of the present invention;
Fig. 7 is the structural schematic diagram of another Task Processing Unit of the embodiment of the present invention.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing to the present invention Embodiment be described in detail.It should be noted that in the absence of conflict, in the embodiment and embodiment in the application Feature can mutual any combination.
As shown in Figure 1, a kind of task processing method according to an embodiment of the present invention, comprising:
Step 101: obtaining one or more tasks;
In one embodiment of this invention, the one or more tasks of the acquisition, comprising:
Operation logic program includes multiple tasks in the logical program.
In an example of the present embodiment, the logical program is the logical program of configuration, the logical program of the configuration For completing to carry out operation to the data that one or more bus masters acquire, and operation result is exported to the bus master.
In this example, as shown in Fig. 2, the configuration of logical program can be completed by configuration software, the configuration is generated Logical program, each logical program includes several sub- logical programs, and every sub- logical program includes several tasks, and is led to Dress operation is crossed down, downloads in controller and runs;Controller is responsible for running the logical program of the configuration, completes to bus master The operations of the data of acquisition and output operation result are to bus master.N in Fig. 2 is the natural number more than or equal to 1.
In an example of the present embodiment, the logical program includes one or more sub- logical programs, the sub- logic Program includes one or more tasks, and one sub- logical program is used to complete the data to a bus master acquisition Operation is carried out, and exports operation result to bus master described in this, one bus master is by a sub- logical program Processing.
In this example, as shown in figure 3, under a bus master all variables (for example, variable 1 to variable m, m be big In or equal to 1 natural number) all belong to certain sub- logical program, i.e. a bus master and its all variables with slave station It can only all be accessed by a sub- logical program.
In another example of the present embodiment, the logical program includes one or more sub- logical programs, and the son is patrolled Collecting program includes one or more tasks, and one task is used to complete the data progress to a bus master acquisition Operation, and operation result is exported to bus master described in this, one bus master is handled by a task.
In this example, all variables under a bus master all belong to some task, i.e. a bus master and Its institute's band slave station can only be accessed by a task.
Step 102: according to the number for the processor core for specifying operation in the configuration of the task, the task being loaded into It is run on corresponding processor core.
In this step, each task specifies the number for running the processor core of the task in configuration;When by the control When device processed runs the logical program, task is tied on the core of processor according to the configuration of task and runs by the controller.
In one embodiment of this invention, the method also includes: the fortune is specified according to the priority of the task The number of capable processor core.
In one embodiment of this invention, the method also includes:
By the global data area that data field is divided into the privately owned private data area of each task and all tasks share;
When task run, which may have access to the shared global number of the privately owned private data area of the task and all tasks According to area.
In this embodiment, as shown in figure 4, each task possesses independent private data area, only the task is accessible, Other tasks do not allow to access;All tasks co-own global data area, and all tasks can access.Configuration task is being transported When row, the variable in accessible task private data area, the also variable in accessible global data area, to global number when access According to being protected.
The embodiment of the invention also provides a kind of computer readable storage medium, the computer-readable recording medium storage Have one or more program, one or more of programs can be executed by one or more processor, with realize such as with The step of upper described in any item task processing methods.
As shown in figure 5, the embodiment of the invention also provides a kind of Task Processing Unit, including processor 501 and memory 502, in which:
The processor 501 is for executing the program stored in memory 502, to realize appointing as described in any of the above item The step of processing method of being engaged in.
As shown in fig. 6, the embodiment of the invention also provides a kind of Task Processing Unit, including 601 He of task acquisition module Task loading module 602, in which:
Task acquisition module 601, for obtaining one or more tasks;
Task loading module 602, the number of the processor core for specifying operation in the configuration according to the task, by institute The task of stating is loaded on corresponding processor core and runs.
In embodiments of the present invention, each task specifies the number for running the processor core of the task in configuration;Work as institute State Task Processing Unit be industrial control system in controller when, task is tied to by the controller according to the configuration of task It is run on the core of processor.
In one embodiment of this invention, the task acquisition module 601 is also used to: according to the priority of the task come Specify the number of the processor core of the operation.
In one embodiment of this invention, as shown in fig. 7, the Task Processing Unit further includes data field division module 603, in which:
Data field division module 603, for data field to be divided into the privately owned private data area and institute of each task The global data area for having the task shared;When the task run, may have access to the privately owned private data area of the task and The shared global data area of all tasks.
In this embodiment, as shown in figure 4, each task possesses independent private data area, only the task is accessible, Other tasks do not allow to access;All tasks co-own global data area, and all tasks can access.Configuration task is being transported When row, the variable in accessible task private data area, the also variable in accessible global data area, to global number when access According to being protected.
In one embodiment of this invention, the acquisition one or more task of the task acquisition module 601, comprising: fortune Row logical program includes one or more tasks in the logical program.
In an example of the present embodiment, the logical program is the logical program of configuration, the logical program of the configuration For completing to carry out operation to the data that one or more bus masters acquire, and operation result is exported to the bus master.
In this example, as shown in Fig. 2, the configuration of logical program can be completed by configuration software, the configuration is generated Logical program, each logical program includes several sub- logical programs, and every sub- logical program includes several tasks, and is led to Dress operation is crossed down, downloads in controller and runs;Controller is responsible for running the logical program of the configuration, completes to bus master The operations of the data of acquisition and output operation result are to bus master.
In an example of the present embodiment, the logical program includes one or more sub- logical programs, the sub- logic Program includes one or more tasks, and one sub- logical program is used to complete the data to a bus master acquisition Operation is carried out, and exports operation result to bus master described in this, one bus master is by a sub- logical program Processing.
In this example, as shown in figure 3, under a bus master all variables (for example, variable 1 to variable m, m be big In or equal to 1 natural number) all belong to certain sub- logical program, i.e. a bus master and its all variables with slave station It can only all be accessed by a sub- logical program.
In another example of the present embodiment, the logical program includes one or more sub- logical programs, and the son is patrolled Collecting program includes one or more tasks, and one task is used to complete the data progress to a bus master acquisition Operation, and operation result is exported to bus master described in this, one bus master is handled by a task.
In this example, all variables under a bus master all belong to some task, i.e. a bus master and Its institute's band slave station can only be accessed by a task.
The industrial control system realized using the present invention, for multiple nucleus system, developer can be by task according to difference Priority and operating condition, be assigned on different processor core and run, so as to improve the service efficiency to processor;It is logical Crossing data separation is independent data area and global data area belonging to each task, reduces the concurrently access to same data Conflict, improves the efficiency of operation;Multiple bus masters are supported by a logical program, improve the capacity of system.
Those of ordinary skill in the art will appreciate that all or part of the steps in the above method can be instructed by program Related hardware is completed, and described program can store in computer readable storage medium, such as read-only memory, disk or CD Deng.Optionally, one or more integrated circuits also can be used to realize, accordingly in all or part of the steps of above-described embodiment Ground, each module/unit in above-described embodiment can take the form of hardware realization, can also use the shape of software function module Formula is realized.The present invention is not limited to the combinations of the hardware and software of any particular form.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field For art personnel, the invention may be variously modified and varied.All within the spirits and principles of the present invention, made any to repair Change, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.

Claims (10)

1. a kind of task processing method characterized by comprising
Obtain one or more tasks;
According to the number for the processor core for specifying operation in the configuration of the task, the task is loaded into corresponding processor It is run on core.
2. the method according to claim 1, wherein the method also includes:
The number of the processor core of the operation is specified according to the priority of the task.
3. the method according to claim 1, wherein the method also includes:
By the global data area that data field is divided into the privately owned private data area of each task and all tasks share;
When the task run, the privately owned private data area of the task and the global number that all tasks share may have access to According to area.
4. the method according to claim 1, wherein acquisition one or more task, comprising:
Operation logic program includes one or more tasks in the logical program.
5. according to the method described in claim 4, it is characterized in that, the logical program be configuration logical program, described group The logical program of state is used to complete to carry out operation to the data that one or more bus masters acquire, and exports operation result to institute State bus master.
6. according to the method described in claim 5, it is characterized in that, the logical program includes one or more sub- logic journeys Sequence, the sub- logical program include one or more tasks, and one sub- logical program is for completing to described in one The data of bus master acquisition carry out operation, and export operation result to bus master described in this, one bus master by One sub- logical program processing.
7. according to the method described in claim 5, it is characterized in that, the logical program includes one or more sub- logic journeys Sequence, the sub- logical program include one or more tasks, and one task is described total to one for completing The data of line main website acquisition carry out operation, and export operation result to bus master described in this, and one bus master is by one A task processing.
8. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage have one or Multiple programs, one or more of programs can be executed by one or more processor, to realize such as claim 1 to 7 Any one of described in task processing method the step of.
9. a kind of Task Processing Unit, which is characterized in that including processor and memory, in which:
The processor is for executing the program stored in memory, to realize appointing as described in any one of claims 1 to 7 The step of processing method of being engaged in.
10. a kind of Task Processing Unit, which is characterized in that including task acquisition module and task loading module, in which:
Task acquisition module, for obtaining one or more tasks;
Task loading module, the number of the processor core for specifying operation in the configuration according to the task, by the task It is loaded on corresponding processor core and runs.
CN201811480552.1A 2018-12-05 2018-12-05 A kind of task processing method and device, computer readable storage medium Pending CN109581925A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811480552.1A CN109581925A (en) 2018-12-05 2018-12-05 A kind of task processing method and device, computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811480552.1A CN109581925A (en) 2018-12-05 2018-12-05 A kind of task processing method and device, computer readable storage medium

Publications (1)

Publication Number Publication Date
CN109581925A true CN109581925A (en) 2019-04-05

Family

ID=65927614

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811480552.1A Pending CN109581925A (en) 2018-12-05 2018-12-05 A kind of task processing method and device, computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109581925A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110502325A (en) * 2019-08-12 2019-11-26 北京和利时系统工程有限公司 A kind of task run method and device, computer readable storage medium
CN111857061A (en) * 2019-04-28 2020-10-30 北京国电智深控制技术有限公司 Method, device and system for realizing calculation task and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101872315A (en) * 2009-04-24 2010-10-27 勒斯塔尔技术有限责任公司 The interruption optimization that is used for multiprocessor
CN102096390A (en) * 2011-01-30 2011-06-15 深圳市合信自动化技术有限公司 Programmable logic controller, program compiler, compiling system and method
CN102648453A (en) * 2009-11-24 2012-08-22 超威半导体公司 Distributed multi-core memory initialization
CN103473120A (en) * 2012-12-25 2013-12-25 北京航空航天大学 Acceleration-factor-based multi-core real-time system task partitioning method
CN107463442A (en) * 2017-07-12 2017-12-12 北京控制工程研究所 A kind of spaceborne multinuclear SoC task levels load balancing Method of Scheduling Parallel
CN107918557A (en) * 2016-10-05 2018-04-17 联发科技股份有限公司 A kind of apparatus and method and multiple nucleus system for running multiple nucleus system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101872315A (en) * 2009-04-24 2010-10-27 勒斯塔尔技术有限责任公司 The interruption optimization that is used for multiprocessor
CN102648453A (en) * 2009-11-24 2012-08-22 超威半导体公司 Distributed multi-core memory initialization
CN102096390A (en) * 2011-01-30 2011-06-15 深圳市合信自动化技术有限公司 Programmable logic controller, program compiler, compiling system and method
CN103473120A (en) * 2012-12-25 2013-12-25 北京航空航天大学 Acceleration-factor-based multi-core real-time system task partitioning method
CN107918557A (en) * 2016-10-05 2018-04-17 联发科技股份有限公司 A kind of apparatus and method and multiple nucleus system for running multiple nucleus system
CN107463442A (en) * 2017-07-12 2017-12-12 北京控制工程研究所 A kind of spaceborne multinuclear SoC task levels load balancing Method of Scheduling Parallel

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111857061A (en) * 2019-04-28 2020-10-30 北京国电智深控制技术有限公司 Method, device and system for realizing calculation task and storage medium
CN110502325A (en) * 2019-08-12 2019-11-26 北京和利时系统工程有限公司 A kind of task run method and device, computer readable storage medium

Similar Documents

Publication Publication Date Title
CN111149166B (en) Memory-based distributed processor architecture
CN104570846B (en) FPGA reconfiguration control methods
EP3861489A1 (en) Parcelled quantum resources
WO2014140971A1 (en) Deploying parallel data integration applications to distributed computing environments
CN105988872A (en) CPU (central processing unit) resource allocation method and device and electronic equipment
CN109154897A (en) Reconfigurable distributed treatment
CN105653204A (en) Distributed graph calculation method based on disk
CN109581925A (en) A kind of task processing method and device, computer readable storage medium
CN104850866A (en) SoC-FPGA-based self-reconstruction K-means cluster technology realization method
CN103646005A (en) Reconfigurable processor based on mini-cores, schedule apparatus, and method thereof
CN109992366A (en) Method for scheduling task and dispatching device
CN105808342A (en) Method used for allocating client requests and judgment apparatus and system
CN106325989A (en) Task execution method and device
CN108415912A (en) Data processing method based on MapReduce model and equipment
CN107357630A (en) A kind of method, apparatus and storage medium for realizing that virtual machine is synchronous
US20230185991A1 (en) Multi-processor simulation on a multi-core machine
EP3516515B1 (en) Scheduling of tasks in a multiprocessor device
CN109634714A (en) A kind of method and device of intelligent scheduling
CN109740725A (en) Neural network model operation method and device and storage medium
CN104090804B (en) A kind of DSP embedded system virtual memory expansion methods in real time
CN117311990B (en) Resource adjustment method and device, electronic equipment, storage medium and training platform
CN106293736B (en) Two-stage programmer and its calculation method for coarseness multicore computing system
CN104597832B (en) PLC program scheduler IP core based on AMBA bus
CN107273527A (en) A kind of Hadoop clusters and distributed system
CN110245024A (en) The dynamic allocation system and its method of static storage block

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190405