CN107368363A - A kind of cycle management method and device - Google Patents
A kind of cycle management method and device Download PDFInfo
- Publication number
- CN107368363A CN107368363A CN201710594513.3A CN201710594513A CN107368363A CN 107368363 A CN107368363 A CN 107368363A CN 201710594513 A CN201710594513 A CN 201710594513A CN 107368363 A CN107368363 A CN 107368363A
- Authority
- CN
- China
- Prior art keywords
- difference
- value
- scheduling
- cycle
- period
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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)
- Power Sources (AREA)
Abstract
Description
技术领域technical field
本发明属于周期管理领域,尤其涉及一种周期管理方法及装置。The invention belongs to the field of cycle management, in particular to a cycle management method and device.
背景技术Background technique
在云计算时代,系统技术架构多采用模块化,服务化进行设计,服务实现的基本形式为守护进程,在守护进程中采用循环方式接受请求、执行任务、发送响应等工作,而其中循环的周期频率成为服务整体性能的关键因素。In the era of cloud computing, the technical architecture of the system mostly adopts modularization and service-oriented design. The basic form of service implementation is a daemon process. In the daemon process, a cyclic method is used to accept requests, execute tasks, and send responses. Frequency becomes a key factor in the overall performance of the service.
循环的周期频率越高,服务响应越快,资源占用越高;循环的周期频率越慢,服务响应越慢,资源占用越低。The higher the frequency of the cycle, the faster the service response and the higher the resource usage; the slower the cycle frequency, the slower the service response and the lower the resource usage.
如何根据服务当前工作负载,自动化调整循环周期频率,使得服务响应与资源使用率最优化成为系统性能优化亟待解决的关键问题。How to automatically adjust the cycle frequency according to the current workload of the service, so as to optimize the service response and resource utilization has become a key problem to be solved in system performance optimization.
发明内容Contents of the invention
本发明提供一种周期管理方法及装置,以解决上述问题。The present invention provides a cycle management method and device to solve the above problems.
本发明实施例提供一种周期管理方法,包括以下步骤:根据获取的当前工作负载值,确定对应的调度周期;根据所述调度周期,对业务请求进行调度处理。An embodiment of the present invention provides a cycle management method, which includes the following steps: determining a corresponding scheduling cycle according to the acquired current workload value; and scheduling a service request according to the scheduling cycle.
本发明实施例还提供一种周期管理装置,包括处理器,适于实现各指令;存储设备,适于存储多条指令,所述指令适于由所述处理器加载并执行;An embodiment of the present invention also provides a cycle management device, including a processor, adapted to implement instructions; a storage device, adapted to store multiple instructions, and the instructions are adapted to be loaded and executed by the processor;
根据获取的当前工作负载值,确定对应的调度周期;Determine the corresponding scheduling period according to the obtained current workload value;
根据所述调度周期,对业务请求进行调度处理。According to the scheduling period, the service request is scheduled and processed.
本发明实施例提供的技术方案:根据获取的当前工作负载值,确定对应的调度周期;根据所述调度周期,对业务请求进行调度处理。The technical solution provided by the embodiment of the present invention: determine the corresponding scheduling period according to the obtained current workload value; and perform scheduling processing on the service request according to the scheduling period.
上述技术方案,根据当前工作负载情况,实现了调度周期的自适应调整,在保证服务响应的同时有效的提高了资源使用率。The above technical solution realizes self-adaptive adjustment of the scheduling cycle according to the current workload situation, and effectively improves the resource utilization rate while ensuring the service response.
附图说明Description of drawings
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The accompanying drawings described here are used to provide a further understanding of the present invention and constitute a part of the application. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations to the present invention. In the attached picture:
图1所示为本发明实施例1的周期管理方法流程图;Fig. 1 shows the flow chart of the cycle management method of Embodiment 1 of the present invention;
图2所示为本发明实施例2的周期管理装置结构图。FIG. 2 is a structural diagram of a period management device according to Embodiment 2 of the present invention.
具体实施方式detailed description
下文中将参考附图并结合实施例来详细说明本发明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。Hereinafter, the present invention will be described in detail with reference to the drawings and examples. It should be noted that, in the case of no conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.
本发明实施例的技术创新在于:主要依据当前工作负载,以当前服务工作负载为输入,计算出服务优化的调度周期,其中调度周期在周期最小值MIN_INTERVAL和周期最大值MAX_INTERVAL之间波动。The technical innovation of the embodiment of the present invention lies in: mainly based on the current workload and taking the current service workload as input, the scheduling cycle for service optimization is calculated, wherein the scheduling cycle fluctuates between the minimum value of the cycle MIN_INTERVAL and the maximum value of the cycle MAX_INTERVAL.
系统以初始调度周期工作,当系统工作负载高时,调度周期趋向MIN_INTERVAL调整;当系统工作负载低时,调度周期趋向MAX_INTERVAL调整。The system works with the initial scheduling period. When the system workload is high, the scheduling period tends to be adjusted to MIN_INTERVAL; when the system workload is low, the scheduling period tends to be adjusted to MAX_INTERVAL.
通过计算服务优化的调度周期,实现了调度周期的自适应调整,在保证服务响应的同时有效的提高了资源使用率。By calculating the service-optimized scheduling period, the self-adaptive adjustment of the scheduling period is realized, and the resource utilization rate is effectively improved while ensuring the service response.
具体而言:in particular:
首先,守护进程服务设置初始化调度周期,主要包括创建Load对象并完成初始调度周期设置;First, the daemon service sets the initialization scheduling cycle, which mainly includes creating a Load object and completing the initial scheduling cycle setting;
其次,守护进程服务根据当前工作负载,调用Load对象update_load()方法更新调度周期;Secondly, the daemon service calls the update_load() method of the Load object to update the scheduling cycle according to the current workload;
当工作负载值大于预警值,标志当前服务工作负载高,则将调度周期向MIN_INTERVAL调整;否则,标志当前服务工作负载低,则将调度周期向MAX_INTERVAL调整;When the workload value is greater than the warning value, it indicates that the current service workload is high, and the scheduling period is adjusted to MIN_INTERVAL; otherwise, the current service workload is indicated to be low, and the scheduling period is adjusted to MAX_INTERVAL;
最后,守护进程服务处理当前业务请求,调用Load对象get_load()方法获取调度周期,并执行等待sleep操作,释放CPU资源。Finally, the daemon service processes the current business request, calls the Load object get_load() method to obtain the scheduling period, and executes the waiting sleep operation to release CPU resources.
图1所示为本发明实施例1的周期管理方法流程图,包括以下步骤:Fig. 1 shows the flow chart of the cycle management method in Embodiment 1 of the present invention, including the following steps:
步骤101:根据获取的当前工作负载值,确定对应的调度周期;Step 101: Determine the corresponding scheduling period according to the obtained current workload value;
步骤102:根据所述调度周期,对业务请求进行调度处理。Step 102: Perform scheduling processing on the service request according to the scheduling cycle.
进一步地,根据当前工作负载值,确定对应的工作负载值范围,进而确定对应的调度周期。具体参考表1所示。Further, according to the current workload value, the corresponding workload value range is determined, and then the corresponding scheduling period is determined. Refer to Table 1 for details.
根据所述调度周期,对业务请求进行调度处理。According to the scheduling period, the service request is scheduled and processed.
工作负载值、工作负载值范围及调度周期对应关系表Correspondence table of workload value, workload value range and scheduling cycle
表1Table 1
进一步地,获取当前工作负载值与预警值之间的差值,并根据所述差值,确定对应的周期调整值;Further, obtain the difference between the current workload value and the warning value, and determine the corresponding period adjustment value according to the difference;
根据所述周期调整值对当前调度周期进行调整,获取调整后的调度周期;Adjusting the current scheduling cycle according to the cycle adjustment value to obtain an adjusted scheduling cycle;
根据调整后的调度周期,对业务请求进行调度处理。According to the adjusted scheduling period, the service request is scheduled and processed.
优选地,根据所述差值,确定对应的周期调整值的过程为:Preferably, according to the difference, the process of determining the corresponding period adjustment value is:
根据所述差值,确定对应的差值范围,进而确定对应的周期调整值。According to the difference, a corresponding difference range is determined, and then a corresponding period adjustment value is determined.
具体参考表2所示。Refer to Table 2 for details.
差值、差值范围及周期调整值对应关系表Correspondence table of difference value, difference range and period adjustment value
表2Table 2
优选地,根据所述差值,确定对应的周期调整值的过程为:Preferably, according to the difference, the process of determining the corresponding period adjustment value is:
将所述差值除以单位调整系数,获得周期调整值。The difference is divided by the unit adjustment factor to obtain the period adjustment value.
其中,所述单位调整系数可以根据需要进行灵活设定,在此不用于限定本实施例的保护范围。Wherein, the unit adjustment coefficient can be flexibly set according to needs, which is not used to limit the protection scope of this embodiment.
图2所示为本发明实施例2的周期管理装置结构图,包括处理器,适于实现各指令;存储设备,适于存储多条指令,所述指令适于由所述处理器加载并执行;Fig. 2 is a structural diagram of a period management device according to Embodiment 2 of the present invention, including a processor, adapted to implement various instructions; a storage device, adapted to store multiple instructions, and the instructions are adapted to be loaded and executed by the processor ;
根据获取的当前工作负载值,确定对应的调度周期;Determine the corresponding scheduling period according to the obtained current workload value;
根据所述调度周期,对业务请求进行调度处理。According to the scheduling period, the service request is scheduled and processed.
进一步地,根据当前工作负载值,确定对应的工作负载值范围,进而确定对应的调度周期;Further, according to the current workload value, determine the corresponding workload value range, and then determine the corresponding scheduling cycle;
根据所述调度周期,对业务请求进行调度处理。According to the scheduling period, the service request is scheduled and processed.
进一步地,获取当前工作负载值与预警值之间的差值,并根据所述差值,确定对应的周期调整值;Further, obtain the difference between the current workload value and the warning value, and determine the corresponding period adjustment value according to the difference;
根据所述周期调整值对当前调度周期进行调整,获取调整后的调度周期;Adjusting the current scheduling cycle according to the cycle adjustment value to obtain an adjusted scheduling cycle;
根据调整后的调度周期,对业务请求进行调度处理。According to the adjusted scheduling period, the service request is scheduled and processed.
优选地,根据所述差值,确定对应的周期调整值的过程为:Preferably, according to the difference, the process of determining the corresponding period adjustment value is:
根据所述差值,确定对应的差值范围,进而确定对应的周期调整值。According to the difference, a corresponding difference range is determined, and then a corresponding period adjustment value is determined.
优选地,根据所述差值,确定对应的周期调整值的过程为:Preferably, according to the difference, the process of determining the corresponding period adjustment value is:
将所述差值除以单位调整系数,获得周期调整值。The difference is divided by the unit adjustment factor to obtain the period adjustment value.
本发明实施例提供的技术方案:根据获取的当前工作负载值,确定对应的调度周期;根据所述调度周期,对业务请求进行调度处理。The technical solution provided by the embodiment of the present invention: determine the corresponding scheduling period according to the obtained current workload value; and perform scheduling processing on the service request according to the scheduling period.
上述技术方案,根据当前工作负载情况,实现了调度周期的自适应调整,在保证服务响应的同时有效的提高了资源使用率。The above technical solution realizes self-adaptive adjustment of the scheduling cycle according to the current workload situation, and effectively improves the resource utilization rate while ensuring the service response.
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and changes. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710594513.3A CN107368363A (en) | 2017-07-20 | 2017-07-20 | A kind of cycle management method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710594513.3A CN107368363A (en) | 2017-07-20 | 2017-07-20 | A kind of cycle management method and device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN107368363A true CN107368363A (en) | 2017-11-21 |
Family
ID=60307516
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201710594513.3A Pending CN107368363A (en) | 2017-07-20 | 2017-07-20 | A kind of cycle management method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN107368363A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109783211A (en) * | 2018-12-14 | 2019-05-21 | 成都四方伟业软件股份有限公司 | A kind of batch task scheduling system and dispatching method based on business diary |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101699368A (en) * | 2009-11-02 | 2010-04-28 | 中兴通讯股份有限公司 | Method and device for adaptive dynamic frequency or voltage adjustment of CPU |
| CN104978235A (en) * | 2015-06-30 | 2015-10-14 | 柏斯红 | Operating frequency prediction based load balancing method |
| US20160004564A1 (en) * | 2014-07-02 | 2016-01-07 | Samsung Electronics Co., Ltd. | Method for task scheduling and electronic device using the same |
| CN106162639A (en) * | 2015-11-25 | 2016-11-23 | 北京邮电大学 | Floodlight-based SDN wireless network management platform and authentication method |
| CN106209469A (en) * | 2016-07-21 | 2016-12-07 | 杭州迪普科技有限公司 | The method and device that process is restarted |
| CN106896897A (en) * | 2017-02-24 | 2017-06-27 | 郑州云海信息技术有限公司 | A kind of cpu performance method of adjustment and device |
-
2017
- 2017-07-20 CN CN201710594513.3A patent/CN107368363A/en active Pending
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101699368A (en) * | 2009-11-02 | 2010-04-28 | 中兴通讯股份有限公司 | Method and device for adaptive dynamic frequency or voltage adjustment of CPU |
| US20160004564A1 (en) * | 2014-07-02 | 2016-01-07 | Samsung Electronics Co., Ltd. | Method for task scheduling and electronic device using the same |
| CN104978235A (en) * | 2015-06-30 | 2015-10-14 | 柏斯红 | Operating frequency prediction based load balancing method |
| CN106162639A (en) * | 2015-11-25 | 2016-11-23 | 北京邮电大学 | Floodlight-based SDN wireless network management platform and authentication method |
| CN106209469A (en) * | 2016-07-21 | 2016-12-07 | 杭州迪普科技有限公司 | The method and device that process is restarted |
| CN106896897A (en) * | 2017-02-24 | 2017-06-27 | 郑州云海信息技术有限公司 | A kind of cpu performance method of adjustment and device |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109783211A (en) * | 2018-12-14 | 2019-05-21 | 成都四方伟业软件股份有限公司 | A kind of batch task scheduling system and dispatching method based on business diary |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US12081454B2 (en) | Systems and methods for provision of a guaranteed batch | |
| CN103530189B (en) | It is a kind of towards the automatic telescopic of stream data and the method and device of migration | |
| CN107291546B (en) | A resource scheduling method and device | |
| CN109564528B (en) | System and method for computing resource allocation in distributed computing | |
| US9304814B2 (en) | Determine variable wait time in an asynchronous call-back system based on calculated average sub-queue wait time | |
| CN107291550B (en) | A Spark platform resource dynamic allocation method and system for iterative applications | |
| CN105955809B (en) | Thread scheduling method and system | |
| CN110609742A (en) | A method and device for configuring a queue of a Kubernetes scheduler | |
| CN106933664B (en) | A resource scheduling method and device for a Hadoop cluster | |
| US20190138354A1 (en) | Method for scheduling jobs with idle resources | |
| CN108241530A (en) | A Storm-based Bipartite Graph Task Scheduling Method for Streaming Computing | |
| CN106569892B (en) | Resource scheduling method and device | |
| WO2021136068A1 (en) | Resource dispatching method and apparatus, electronic device, and computer readable medium | |
| CN106664259B (en) | Method and device for expanding virtual network function | |
| CN103986766A (en) | Self-adaptation load balancing job task scheduling method and device | |
| CN104536827A (en) | A data scheduling method and device | |
| WO2014108000A1 (en) | Task allocation method and system | |
| CN112486638A (en) | Method, apparatus, device and storage medium for executing processing task | |
| KR20140097815A (en) | Resource allocation and apparatus | |
| CN109597378B (en) | Resource-limited hybrid task energy consumption sensing method | |
| WO2019029721A1 (en) | Task scheduling method, apparatus and device, and storage medium | |
| CN108429784B (en) | An energy efficiency priority cloud resource allocation and scheduling method | |
| US20240231901A9 (en) | Job processing method and apparatus, computer device, and storage medium | |
| CN109189581B (en) | A job scheduling method and device | |
| CN113407313B (en) | Resource demand-aware multi-queue scheduling method, system and server |
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 |
Application publication date: 20171121 |
|
| RJ01 | Rejection of invention patent application after publication |