CN106569886B - Policy scheduling method and policy scheduling system - Google Patents
Policy scheduling method and policy scheduling system Download PDFInfo
- Publication number
- CN106569886B CN106569886B CN201610950592.2A CN201610950592A CN106569886B CN 106569886 B CN106569886 B CN 106569886B CN 201610950592 A CN201610950592 A CN 201610950592A CN 106569886 B CN106569886 B CN 106569886B
- Authority
- CN
- China
- Prior art keywords
- task
- strategy
- policy
- time slice
- idle
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a strategy scheduling method and a strategy scheduling system, wherein the strategy scheduling method comprises the following steps: acquiring a strategy and a time slice; within the time slice, subdividing the tasks corresponding to the strategies into task blocks according to the task granularity, and executing the tasks by taking the task granularity as a unit according to the strategies; when the time slice is exhausted, continuing to execute and completing the task block when the time slice is exhausted; and performing policy switching. The invention divides the task corresponding to the strategy into task blocks according to the task granularity in the time slice, executes the task by taking the task granularity as a unit, and continuously executes and completes the task blocks when the time slice is exhausted and then carries out strategy switching, thereby improving the throughput performance of data backup.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a strategy scheduling method and a strategy scheduling system for data backup.
Background
The strategy is information for setting backup operation by a user and is also the core of the backup system. The policy scheduling is to perform the system backup operation according to the policy. Ensuring fair scheduling of policies is critical in application requirements. At the same time, a high throughput is required.
One existing method of policy scheduling is to perform slice-based slice polling on the policies. The time slice polling refers to executing tasks according to a strategy in the time slice of the strategy, and traversing the next strategy when the time slice is exhausted if the tasks are executed in the time slice of the strategy all the time.
The existing strategy scheduling method of the backup system adopts a strategy scheduling method of time slice polling. When the time slice is exhausted, it is immediately forced to switch to a new policy, or when there is no task under the policy, it is necessary to switch the policy frequently to get the next suitable policy. The behavior of forcing a switch to a new policy and frequently switching policies to get the next policy will affect the throughput performance of the backup system data backup.
Aiming at the problem of poor throughput performance of data backup caused by a policy scheduling method when a time slice is exhausted and when no task exists under a policy in the related art, an effective solution is not provided at present.
Disclosure of Invention
The invention provides a strategy scheduling method and a strategy scheduling system, aiming at the problem that the throughput performance of data backup is poor due to the strategy scheduling method when a time slice is exhausted and when no task exists under a strategy in the related art, and the throughput performance of the data backup can be improved.
The technical scheme of the invention is realized as follows:
according to an aspect of the present invention, there is provided a policy scheduling method, including: acquiring a strategy and a time slice; within the time slice, subdividing the tasks corresponding to the strategies into task blocks according to the task granularity, and executing the tasks by taking the task granularity as a unit according to the strategies; when the time slice is exhausted, continuing to execute and completing the task block when the time slice is exhausted; and performing policy switching.
According to an embodiment of the present invention, after obtaining the policy and the time slice, the method further comprises: when the strategy is an idle strategy, switching to a non-idle strategy through an elevator scanning algorithm to execute a task; wherein the non-idle policy includes a task.
According to an embodiment of the present invention, before executing the policy in units of task granularity according to the policy, the method further includes: a policy context is generated according to the policy.
According to one embodiment of the invention, executing tasks in units of task granularity according to a policy comprises: comparing the policy context with the corresponding thread context; and when the policy context is the same as the thread context, executing the task by taking the task granularity as a unit.
According to one embodiment of the present invention, executing tasks in units of task granularity according to a policy further includes: when the policy context is different from the thread context, the policy context is switched.
According to an embodiment of the present invention, when the policy is an idle policy, switching to a non-idle policy and executing the non-idle policy within a time slice includes: saving the policy context; acquiring a non-idle strategy through an elevator scanning algorithm and switching to the non-idle strategy; executing tasks in a time slice by taking task granularity as a unit according to a non-idle strategy; and when the time slice is exhausted, reverting to the policy context.
According to one embodiment of the invention, the task granularity is 4M.
According to one embodiment of the invention, the time slices are all the same size.
According to one embodiment of the invention, each time slice is 1 second in size.
According to another aspect of the present invention, there is provided a policy scheduling system, including: the strategy acquisition module is used for acquiring strategies and time slices; the execution module is used for subdividing the tasks corresponding to the strategies into task blocks according to the task granularity in a time slice, and executing the tasks by taking the task granularity as a unit instead of idle; the task block is also used for continuing to execute and completing the time slice exhausted task block when the time slice is exhausted; and a strategy switching module for switching the strategy.
The invention divides the task corresponding to the strategy into task blocks according to the task granularity in the time slice, executes the task by taking the task granularity as a unit, and continuously executes and completes the task blocks when the time slice is exhausted and then carries out strategy switching, thereby improving the throughput performance of data backup.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
FIG. 1 is a flow chart of a policy scheduling method according to an embodiment of the present invention;
FIG. 2 is a schematic flow diagram of data backup by a backup system according to an embodiment of the invention;
FIG. 3 is a flow chart of idle policy and non-idle policy switching of a policy scheduling method according to an embodiment of the present invention;
fig. 4 is a flowchart of a policy scheduling method for backing up data according to policies according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments given herein are intended to be within the scope of the present invention.
According to an embodiment of the present invention, a policy scheduling method is provided.
As shown in fig. 1, a policy scheduling method according to an embodiment of the present invention includes the following steps:
s101, acquiring a strategy and a time slice;
s103, in a time slice, subdividing tasks corresponding to the strategy into task blocks according to task granularity, and executing the tasks by taking the task granularity as a unit according to the strategy; the tasks may include backup tasks, scan tasks, or other tasks; wherein the task is a backup task;
s105, when the time slice is exhausted, continuing to execute and completing the task block when the time slice is exhausted;
s107, strategy switching is carried out; the strategy switching is to switch and transfer strategies one by one according to the order of first-in first-out.
According to the technical scheme, the tasks corresponding to the strategies are subdivided into the task blocks in the time slice according to the task granularity, the tasks are executed by taking the task granularity as a unit, and when the time slice is exhausted, the tasks are continuously executed and the strategy switching is performed after the task blocks when the time slice is exhausted.
According to one embodiment of the invention, the task granularity is 4M. I.e., subdividing the backup load into 4M data blocks. When the time slice is exhausted, the strategy switching is not carried out immediately, but the 4M data block is switched after the backup is carried out.
Fig. 2 is a schematic flow chart illustrating data backup in the backup system according to an embodiment of the present invention. The client 201 adds and/or deletes policies through the policy controller 204. The policy controller 204 may distribute a policy to a plurality of backup task execution ends (202, 203) according to the policy scheduling method of the present invention, where the plurality of backup task execution ends (the first backup task execution end 202 and the second backup task execution end 203) execute backup tasks according to the distributed policy and the time slice; when the time slice is depleted, the backup data is stopped and the policy enforcement authority is handed back. The throughput performance of data backup can be improved.
According to one embodiment of the invention, the time slices are all the same size. Preferably, the time slices are of a fixed size of 1 second, i.e. each time slice is of a size of 1 second.
According to an embodiment of the present invention, after step S101, the method further includes: when the strategy is an idle strategy, acquiring a non-idle strategy through an elevator scanning algorithm and switching to the non-idle strategy; wherein, the non-idle policy should include a backup task. That is to say, when the time slice of the strategy is idle, the time slice is given to the strategy with the minimum switching cost, and the strategy with the minimum switching cost is searched and an elevator scanning algorithm is adopted. Compared with the prior art, the problem that the throughput performance of data backup is influenced by frequently switching the strategy to obtain the next strategy when no task exists in the strategy is solved, and the throughput performance of the data backup is further improved.
Specifically, when the policy is an idle policy, switching to a non-idle policy and executing the non-idle policy in a time slice includes: saving the policy context; acquiring and switching to a non-idle strategy; executing tasks in a time slice by taking task granularity as a unit according to a non-idle strategy; and when the time slice is exhausted, reverting to the policy context.
Fig. 3 is a flowchart illustrating idle policy and non-idle policy switching of a policy scheduling method according to an embodiment of the present invention. The current strategy has a spare time slice, and the time slice is given out. Yielding the time slice requires traversing all policies, finding the appropriate policy, and avoiding excessive handover policy contexts. When the strategy is idle, the backup task scheduling searches the next strategy and adopts an elevator scanning algorithm. The method specifically comprises the following steps: step S301, switching policy context; step S302, saving the current strategy context; step S303, when the current strategy is judged to be the idle strategy, step S304 is further performed; step S304, sending the current policy context to the policy execution thread, and recording as A; step S305, executing a strategy thread to judge that the current context has a backup task and executing the strategy; step S306, after the strategy is executed, the current strategy context is restored to be A. In the above process, if the current policy is idle, the policy context with the backup task needs to be found next. Wherein, the next non-idle strategy with a backup task needs to be searched, and an elevator algorithm is adopted.
According to an embodiment of the present invention, before executing the policy in units of task granularity according to the policy, the method further includes: a policy context is generated according to the policy.
Further, step S103 includes: comparing the policy context with the corresponding thread context; and when the policy context is the same as the thread context, executing the task by taking the task granularity as a unit. And, when the policy context is different from the thread context, switching the policy context.
As shown in fig. 4, it is a flowchart of a policy scheduling method for backing up data according to policies according to an embodiment of the present invention, and the method includes the following steps: step S401, firstly generating a policy context when executing the policy, and then comparing the policy context with the context stored by the thread to judge whether the policy context is switched; step S402, when the policy context is not equal to the context saved by the thread, the context execution policy is switched to select the executable execution policy; step S403, when the policy context is equal to the context stored in the thread, executing the policy according to the policy context, and reading a file list corresponding to the policy according to the policy; step S404, reading one task block, namely 4M data each time and backing up the 4M data to a target end; step S405, the policy context is saved, and the policy thread context and the thread context are updated. The above steps are then repeated.
According to an embodiment of the present invention, there is also provided a policy scheduling system, including:
the strategy acquisition module is used for acquiring strategies and time slices;
the execution module is used for subdividing the tasks corresponding to the strategies into task blocks according to the task granularity in a time slice, and executing the tasks by taking the task granularity as a unit instead of idle; the task block is also used for continuing to execute and completing the time slice exhausted task block when the time slice is exhausted; and
and the strategy switching module is used for carrying out strategy switching.
In summary, with the above technical solution of the present invention, by subdividing the task corresponding to the policy in the time slice into task blocks according to the task granularity, executing the task in units of the task granularity, and when the time slice is exhausted, continuing to execute and completing the task block when the time slice is exhausted, and then performing policy switching, it is avoided that the task block is immediately and forcibly switched to a new policy when the time slice is exhausted, thereby improving the throughput performance of data backup; and the time slice of the idle strategy is allocated to the non-idle strategy with the minimum strategy switching cost, so that the problem that the throughput performance of data backup is influenced because the strategy needs to be frequently switched to obtain the next strategy when no task exists under the strategy is avoided, and the throughput performance of the data backup is further improved.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (9)
1. A method for policy scheduling, comprising:
acquiring a strategy and a time slice; when the strategy is an idle strategy, searching a strategy with the minimum switching cost through an elevator scanning algorithm so as to switch the idle strategy to a non-idle strategy to execute a task; the strategy is information for setting backup operation by a user, the strategy scheduling is to execute system backup operation according to the strategy, and the non-idle strategy comprises tasks;
within the time slice, subdividing the tasks corresponding to the strategies into task blocks according to task granularity, and executing the tasks by taking the task granularity as a unit according to the strategies;
when the time slice is exhausted, continuing to execute and completing the task block when the time slice is exhausted; and
the policy switch is performed after continuing execution and completing the task block when the time slice is exhausted.
2. The method according to claim 1, further comprising, before executing the task in units of the task granularity according to the policy:
and generating a policy context according to the policy.
3. The method of claim 2, wherein executing the task according to the policy in units of the task granularity comprises:
comparing the policy context to a corresponding thread context;
and when the policy context is the same as the thread context, executing the task by taking the task granularity as a unit.
4. The method of claim 3, wherein executing the task according to the policy in units of the task granularity further comprises:
and when the policy context is different from the thread context, switching the policy context.
5. The policy scheduling method according to claim 2, wherein switching the idle policy to a non-idle policy to execute the task comprises:
saving the policy context;
acquiring a non-idle strategy through an elevator scanning algorithm and switching to the non-idle strategy;
executing the task in the time slice by taking the task granularity as a unit according to the non-idle strategy; and
when the time slice is exhausted, reverting to the policy context.
6. The policy scheduling method according to claim 1,
the task granularity is 4M.
7. The policy scheduling method according to claim 6,
the time slices are all the same size.
8. The policy scheduling method according to claim 7,
the size of each time slice is 1 second.
9. A policy scheduling system, comprising:
the strategy acquisition module is used for acquiring strategies and time slices; when the strategy is an idle strategy, searching a strategy with the minimum switching cost through an elevator scanning algorithm so as to switch the idle strategy to a non-idle strategy to execute a task; the strategy is information for setting backup operation by a user, the strategy scheduling is to execute system backup operation according to the strategy, and the non-idle strategy comprises tasks;
the execution module is used for subdividing the tasks corresponding to the strategies into task blocks according to task granularity in the time slice and executing the tasks by taking the task granularity as a unit according to the strategies; the task block is also used for continuing to execute and completing the time slice exhausted task block when the time slice is exhausted; and
and the strategy switching module is used for switching the strategies after the task blocks when the time slices are exhausted are continuously executed and completed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610950592.2A CN106569886B (en) | 2016-10-26 | 2016-10-26 | Policy scheduling method and policy scheduling system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610950592.2A CN106569886B (en) | 2016-10-26 | 2016-10-26 | Policy scheduling method and policy scheduling system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106569886A CN106569886A (en) | 2017-04-19 |
CN106569886B true CN106569886B (en) | 2020-10-16 |
Family
ID=58536627
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610950592.2A Active CN106569886B (en) | 2016-10-26 | 2016-10-26 | Policy scheduling method and policy scheduling system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106569886B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109918187B (en) * | 2019-03-12 | 2021-10-08 | 北京同城必应科技有限公司 | Task scheduling method, device, equipment and storage medium |
CN114880102B (en) * | 2022-07-04 | 2022-10-25 | 北京智芯半导体科技有限公司 | Security chip, multitask scheduling method and device thereof, and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101489304A (en) * | 2009-02-27 | 2009-07-22 | 南京邮电大学 | Media access control method based on differentiate service of wireless multimedia sensor network |
CN103577263A (en) * | 2013-11-07 | 2014-02-12 | 广东电网公司佛山供电局 | Power quality data real-time collection method and device |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8997111B2 (en) * | 2012-05-09 | 2015-03-31 | Wind River Systems, Inc. | System and method for deterministic context switching in a real-time scheduler |
-
2016
- 2016-10-26 CN CN201610950592.2A patent/CN106569886B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101489304A (en) * | 2009-02-27 | 2009-07-22 | 南京邮电大学 | Media access control method based on differentiate service of wireless multimedia sensor network |
CN103577263A (en) * | 2013-11-07 | 2014-02-12 | 广东电网公司佛山供电局 | Power quality data real-time collection method and device |
Non-Patent Citations (1)
Title |
---|
"通过任务分割提高嵌入式系统的实时性";高建平 等;《单片机与嵌入式系统应用》;20031001(第10期);第12-14页 * |
Also Published As
Publication number | Publication date |
---|---|
CN106569886A (en) | 2017-04-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP2977854B1 (en) | Method, apparatus, and user terminal for removing malicious power consuming application | |
EP2742426B1 (en) | Network-aware coordination of virtual machine migrations in enterprise data centers and clouds | |
CN107450971B (en) | Task processing method and device | |
RU2599967C2 (en) | Application lifecycle management | |
US9477460B2 (en) | Non-transitory computer-readable storage medium for selective application of update programs dependent upon a load of a virtual machine and related apparatus and method | |
US8713573B2 (en) | Synchronization scheduling apparatus and method in real-time multi-core system | |
CN101241456B (en) | Data protection method and device | |
US8341439B2 (en) | Power management apparatus and method thereof and power control system | |
US8190857B2 (en) | Deleting a shared resource node after reserving its identifier in delete pending queue until deletion condition is met to allow continued access for currently accessing processor | |
CN109445927B (en) | Task management method and device for storage cluster | |
CN103746838B (en) | A kind of method for scheduling task of non-stop layer node computer network | |
US9442784B2 (en) | Management device, management method, and medium storing management program | |
CN106569886B (en) | Policy scheduling method and policy scheduling system | |
US20190227621A1 (en) | System management device | |
US20140115601A1 (en) | Data processing method and data processing system | |
US11038783B2 (en) | Method and apparatus for managing network connection, and storage medium | |
US20150026694A1 (en) | Method of processing information, storage medium, and information processing apparatus | |
US20160266808A1 (en) | Information processing device, information processing method, and recording medium | |
CN105653556B (en) | Data aging method and device | |
CN106843890B (en) | Sensor network, node and operation method thereof based on intelligent decision | |
US20220092008A1 (en) | Managing input/output-critical tasks and background tasks within a computer device | |
US20230205770A1 (en) | Opportunistic cloud data platform pipeline scheduler | |
CN115809126A (en) | Job scheduling method and device in mixed deployment scene and electronic equipment | |
US20150178140A1 (en) | Information processing system and monitoring method | |
EP3396553A1 (en) | Method and device for processing data after restart of node |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20220805 Address after: 100089 building 36, courtyard 8, Dongbeiwang West Road, Haidian District, Beijing Patentee after: Dawning Information Industry (Beijing) Co.,Ltd. Patentee after: DAWNING INFORMATION INDUSTRY Co.,Ltd. Address before: 100193 No. 36 Building, No. 8 Hospital, Wangxi Road, Haidian District, Beijing Patentee before: Dawning Information Industry (Beijing) Co.,Ltd. |