WO2023284171A1 - 一种系统重启后的资源分配方法、系统及相关组件 - Google Patents

一种系统重启后的资源分配方法、系统及相关组件 Download PDF

Info

Publication number
WO2023284171A1
WO2023284171A1 PCT/CN2021/127518 CN2021127518W WO2023284171A1 WO 2023284171 A1 WO2023284171 A1 WO 2023284171A1 CN 2021127518 W CN2021127518 W CN 2021127518W WO 2023284171 A1 WO2023284171 A1 WO 2023284171A1
Authority
WO
WIPO (PCT)
Prior art keywords
resources
resource pool
recovery
requirements
requirement
Prior art date
Application number
PCT/CN2021/127518
Other languages
English (en)
French (fr)
Inventor
孔祥斐
Original Assignee
苏州浪潮智能科技有限公司
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 苏州浪潮智能科技有限公司 filed Critical 苏州浪潮智能科技有限公司
Priority to US18/260,127 priority Critical patent/US20240061710A1/en
Publication of WO2023284171A1 publication Critical patent/WO2023284171A1/zh

Links

Images

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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1438Restarting or rejuvenating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • 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/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5044Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering hardware capabilities

Definitions

  • the present application relates to the field of server control, in particular to a resource allocation method, system and related components after system restart.
  • initialization pre-application preparation phase application
  • recovery phase IO Input/Output, input/output
  • the purpose of this application is to provide a resource allocation method, system and related components after system restart, so as to ensure the smooth progress of resource allocation after system restart.
  • the specific plan is as follows:
  • a resource allocation method after system restart comprising:
  • the first judging step includes: judging whether there is an IO recovery requirement, and if there is an IO recovery requirement, according to the IO recovery requirement, allocating a fourth part of resources from the resource pool to the IO processing module, so that the IO processing
  • the module processes the original interrupt IO, and triggers the cache module to refresh, so as to release the second part of resources corresponding to the recovered cache data to the resource pool, and enter the second judgment step, if not If there is an IO recovery requirement, directly enter the second judgment step;
  • the second judging step includes: judging whether the preparation stage application requirement and the IO recovery requirement are fully satisfied, and if the preparation stage application requirement and the IO recovery requirement are completely satisfied, jump out of the loop.
  • the process of allocating the third part of resources from the resource pool to the caching module according to the application requirements in the preparation stage further includes:
  • the preset data structure is updated.
  • the process of allocating a fourth part of resources from the resource pool to the IO processing module according to the IO recovery requirement includes:
  • the process of dividing the multiple IO recovery requirements into the first type of recovery requirements that can be satisfied by the current remaining resources and the second type of recovery requirements that cannot be satisfied by the current remaining resources includes:
  • the multiple IO recovery requirements are divided into the first type of recovery requirements that can be satisfied by the current remaining resources and the second type of recovery requirements that cannot be satisfied by the current remaining resources;
  • the priorities of the multiple sets of IO recovery requirements from high to low are respectively corresponding to multiple sets of sorting results of the total requirements from small to large.
  • the preset data structure is specifically a linked list or a queue.
  • the process of judging whether the current remaining resources in the resource pool can meet the application requirements of the cache module in the preparation stage specifically includes:
  • this application also discloses a resource allocation system after system restart, including:
  • the first module is used to allocate the first part of resources from the resource pool to the initialization pre-application module according to the pre-application requirements;
  • the second module is configured to allocate a second part of resources from the resource pool to the cache module according to the cache restoration requirement, so that the cache module restores the cache data to be restored in the initialization phase;
  • the third module is used to cycle through the following steps:
  • IO recovery requirement allocate a fourth part of resources from the resource pool to the IO processing module, so that the IO processing module processes the original interrupted IO, and triggers the cache module to refresh, so that the releasing the second part of resources corresponding to the restored cache data to the resource pool;
  • this application also discloses a resource allocation device after system restart, including:
  • a processor configured to implement the steps of the method for allocating resources after system restart as described in any one of the above when executing the computer program.
  • the present application also discloses a readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the resource allocation after system restart as described in any one of the above items is realized method steps.
  • This application changes the method of resource allocation to asynchronous.
  • the cycle of judging whether it can be allocated, allocating, and triggering resource release is repeated until the application requirements and IO recovery requirements in the preparation stage are equal. If it is satisfied, then jump out of the loop, which ensures the smooth progress of resource allocation, finally meets all resource allocation requirements, and solves the problem of process interruption that may occur in existing solutions.
  • FIG. 1 is a flow chart of the steps of a resource allocation method after a system restart in an embodiment of the present application
  • FIG. 2 is a sub-step flowchart of a resource allocation method after a system restart in an embodiment of the present application
  • FIG. 3 is a structural distribution diagram of a resource allocation system after a system restart in an embodiment of the present application.
  • initialization pre-application Currently, resources need to be re-allocated after the system is restarted.
  • the allocation process goes through several stages: initialization pre-application, preparation phase application, and recovery phase IO application. Once the initialization pre-application phase occupies too many resources, the remaining resources in the resource pool cannot be used. Satisfying the application in the preparation stage or the application in the recovery stage will cause the process to be interrupted, and the system will not be able to proceed with the subsequent process.
  • This application changes the method of resource allocation to asynchronous.
  • the cycle of judging whether it can be allocated, allocating, and triggering resource release is repeated until the application requirements and IO recovery requirements in the preparation stage are equal. If it is satisfied, then jump out of the loop, which ensures the smooth progress of resource allocation, finally meets all resource allocation requirements, and solves the problem of process interruption that may occur in existing solutions.
  • the embodiment of the present application discloses a resource allocation method after system restart, as shown in FIG. 1 , including:
  • the first judging step is step S15, which includes:
  • step S17 which includes:
  • step S17 Determine whether the application requirements in the preparation stage and the IO recovery requirements are fully satisfied, and jump out of the loop if the application requirements in the preparation stage and the IO recovery requirements are completely satisfied. If the application requirements and IO recovery requirements in the preparation stage are not fully satisfied, go to step S13.
  • step S13 can be directly executed after step S17 ends, but the whole method thread will take up more CPU (Central Processing Unit, central processing unit) like this, in order to reduce occupation,
  • the corresponding trigger timing can be set according to the preset frequency for the whole cycle, and the trigger point can be set in step S13. Therefore, the process of judging whether the current remaining resources in the resource pool can meet the application requirements of the cache module in the preparation stage in step S13 specifically includes :
  • the preset frequency it is judged whether the current remaining resources in the resource pool can meet the application requirements of the cache module in the preparation stage.
  • step S13 and S16 when the judgment actions of steps S13 and S16 are executed in this embodiment, relevant content can be recorded for content query in subsequent operations, especially for unsatisfied preparatory stage application requirements and/or IO recovery
  • the demand is recorded in the preset data structure, and the preset data structure can be in the form of a linked list or a queue.
  • the process of judging whether the current remaining resources in the resource pool can meet the application requirements of the cache module in the preparation stage in step S13 also includes:
  • step S14 is the process of allocating the third part of resources from the resource pool to the cache module according to the application requirements in the preparation phase, which also includes:
  • the action of updating the preset data structure is specifically to delete the application requirements in the preparation stage that have been responded to by the third part of the resource in the preset data structure.
  • step S16 allocates the fourth part of resources from the resource pool to the IO processing module according to the IO recovery requirement. process, including:
  • step S23 if the current remaining resources cannot satisfy any IO recovery requirement, the first type of recovery requirement is 0, and only step S24 is performed, and step S25 is ignored.
  • step S23 divides multiple IO recovery requirements into the first type of recovery requirements that can be satisfied by the current remaining resources and the second type of recovery requirements that cannot be satisfied by the current remaining resources, including:
  • multiple IO recovery needs are divided into the first type of recovery needs that can be satisfied by the current remaining resources and the second type of recovery needs that cannot be satisfied by the current remaining resources;
  • the priority order of multiple groups of IO recovery requirements from high to low corresponds to the sorting results of multiple groups of total requirements from small to large.
  • temporarily unsatisfiable requirements are recorded in the preset data structure.
  • the requirements include application requirements in the preparation stage and IO recovery requirements.
  • the number and quantity of requirements are not consistent. It must be carried out according to the order of resources, traversing the preset data structure, and assigning resources to that demand if it can meet the demand. As long as there is no problem with the trigger mechanism of each cache module's refresh, the normal progress of the cycle can be guaranteed. There will be a problem in the prior art that the system restarts and gets stuck in resource application.
  • This application changes the method of resource allocation to asynchronous.
  • the cycle of judging whether it can be allocated, allocating, and triggering resource release is repeated until the application requirements and IO recovery requirements in the preparation stage are equal. If it is satisfied, then jump out of the loop, which ensures the smooth progress of resource allocation, finally meets all resource allocation requirements, and solves the problem of process interruption that may occur in existing solutions.
  • the embodiment of the present application also discloses a resource allocation system after the system is restarted, as shown in FIG. 3 , including:
  • the first module 1 is used to allocate the first part of resources from the resource pool to the initialization pre-application module according to the pre-application requirements;
  • the second module 2 is configured to allocate a second part of resources from the resource pool to the cache module according to the cache restoration requirement, so that the cache module restores the cache data to be restored in the initialization phase;
  • the third module 3 is used to cycle the following steps:
  • the first judging step includes: judging whether there is an IO recovery requirement, and if there is an IO recovery requirement, according to the IO recovery requirement, allocating a fourth part of resources from the resource pool to the IO processing module, so that the IO processing module processes Originally interrupt the IO, and trigger the cache module to refresh, so as to release the second part of resources corresponding to the recovered cache data to the resource pool, and enter the second judgment step, if there is no IO If the demand is restored, then directly enter the second judgment step;
  • the second judging step includes: judging whether the preparation stage application requirement and the IO recovery requirement are fully satisfied, and if the preparation stage application requirement and the IO recovery requirement are completely satisfied, jump out of the loop.
  • This application changes the method of resource allocation to asynchronous.
  • the cycle of judging whether it can be allocated, allocating, and triggering resource release is repeated until the application requirements and IO recovery requirements in the preparation stage are equal. If it is satisfied, then jump out of the loop, which ensures the smooth progress of resource allocation, finally meets all resource allocation requirements, and solves the problem of process interruption that may occur in existing solutions.
  • the processor is configured to implement the steps of the method for allocating resources after system restart as described in any one of the above embodiments when executing the computer program.
  • the embodiment of the present application also discloses a readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the system restarts as described in any of the above embodiments.
  • the steps of the resource allocation method are described in any of the above embodiments.
  • the resource allocation device and the readable storage medium after the system is restarted in this embodiment all have the same technical effects as those in the above embodiment, and will not be repeated here.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

一种系统重启后的资源分配方法、系统及相关组件,该方法包括:从资源池中分配第一部分资源给初始化预申请模块(S11);从资源池中分配第二部分资源给缓存模块,以使缓存模块恢复初始化阶段的待恢复缓存数据(S12);循环以下步骤:判断资源池中当前剩余资源能否满足缓存模块的准备阶段申请需求(S13);如果是,根据准备阶段申请需求,从资源池中分配第三部分资源给缓存模块(S14);判断是否存在IO恢复需求(S15);如果是,根据IO恢复需求,从资源池中分配第四部分资源给IO处理模块(S16);判断准备阶段申请需求和IO恢复需求是否完全被满足(S17),如果是,则跳出循环。该方法将资源分配的方式改为异步,保证了资源分配能够顺利进行,最终满足了所有的资源分配需求。

Description

一种系统重启后的资源分配方法、系统及相关组件
本申请要求在2021年07月14日提交中国专利局、申请号为202110792630.7、发明名称为“一种系统重启后的资源分配方法、系统及相关组件”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及服务器控制领域,特别涉及一种系统重启后的资源分配方法、系统及相关组件。
背景技术
当前,系统重启后需要对资源重新分配,分配过程中经历初始化预申请、准备阶段申请、恢复阶段IO(Input/Output,输入/输出)申请几个阶段,其中一旦初始化预申请阶段占用了太多资源,导致资源池中剩余资源无法满足准备阶段申请或恢复阶段申请,则会导致流程中断,系统无法进行后续流程。
因此,如何提供一种解决上述技术问题的方案是目前本领域技术人员需要解决的问题。
发明内容
有鉴于此,本申请的目的在于提供一种系统重启后的资源分配方法、系统及相关组件,以确保系统重启后资源分配的顺利进行。其具体方案如下:
一种系统重启后的资源分配方法,包括:
根据预申请需求,从资源池中分配第一部分资源给初始化预申请模块;
根据缓存恢复需求,从所述资源池中分配第二部分资源给缓存模块,以使所述缓存模块恢复初始化阶段的待恢复缓存数据;
循环以下步骤:
判断所述资源池中当前剩余资源能否满足所述缓存模块的准备阶段申请需求,如果所述资源池中当前剩余资源满足所述缓存模块的准备阶段申请需求,根据所述准备阶段申请需求,从所述资源池中分配第三部分资源给所述缓存模块,并进入第一判断步骤,如果所述资源池中当前剩余资源不满足所述缓存模块的准备阶段申请需求,则直接进入所述第一判断步骤;
所述第一判断步骤包括:判断是否存在IO恢复需求,如果存在IO恢复需求,根据所述IO恢复需求,从所述资源池中分配第四部分资源给IO处理模块,以使所述IO处理模块处理原中断IO,并触发所述缓存模块下刷,以将已恢复的所述待恢复缓存数据对应的所述第二部分资源释放至所述资源池,并进入第二判断步骤,如果不存在IO恢复需求,则直接进入所述第二判断步骤;
所述第二判断步骤包括:判断所述准备阶段申请需求和所述IO恢复需求是否完全被满足,如果所述准备阶段申请需求和所述IO恢复需求完全被满足,则跳出循环。
优选的,所述判断所述资源池中当前剩余资源能否满足所述缓存模块的准备阶段申请需求的过程,还包括:
如果所述资源池中当前剩余资源不满足所述缓存模块的准备阶段申请需求,在预设数据结构中记录所述资源池未能满足的所述准备阶段申请需求;
相应的,所述根据所述准备阶段申请需求,从所述资源池中分配第三部分资源给所述缓存模块的过程,还包括:
更新所述预设数据结构。
优选的,所述根据所述IO恢复需求,从所述资源池中分配第四部分资源给IO处理模块的过程,包括:
判断所述资源池中当前剩余资源能否满足所有所述IO恢复需求;
如果所述资源池中当前剩余资源满足所有所述IO恢复需求,则根据所有所述IO恢复需求,从所述资源池中分配第四部分资源给IO处理模块;
如果所述资源池中当前剩余资源不满足所有所述IO恢复需求,将多个所述IO恢复需求划分为当前剩余资源可满足的第一类恢复需求和当前剩余资源不可满足的第二类恢复需求;
将所述第二类恢复需求记录在所述预设数据结构中;
根据所述第一类恢复需求,从所述资源池中分配所述第四部分资源给所述IO处理模块。
优选的,所述将多个所述IO恢复需求划分为当前剩余资源可满足的第一类恢复需求和当前剩余资源不可满足的第二类恢复需求的过程,包括:
将所有所述IO恢复需求按卷分组,确定每组的总需求;
按照多组所述IO恢复需求的优先级,将多个所述IO恢复需求划分为当前剩余资源可满足的第一类恢复需求和当前剩余资源不可满足的第二类恢复需求;
其中,多组所述IO恢复需求的优先级从高到低的顺序,分别对应多组所述总需求从小到大的排序结果。
优选的,所述准备阶段申请需求和所述IO恢复需求是否完全被满足,如果所述准备阶段申请需求和所述IO恢复需求完全被满足,则跳出循环的过程,具体包括:
判断所述预设数据结构是否为空,如果所述预设数据结构为空,则跳出循环。
优选的,所述预设数据结构具体为链表或队列。
优选的,所述判断所述资源池中当前剩余资源能否满足所述缓存模块的准备阶段申请需求的过程,具体包括:
按照预设频率,判断所述资源池中当前剩余资源能否满足所述缓存模块的准备阶段申请需求。
相应的,本申请还公开了一种系统重启后的资源分配系统,包括:
第一模块,用于根据预申请需求,从资源池中分配第一部分资源给初始化预申请模块;
第二模块,用于根据缓存恢复需求,从所述资源池中分配第二部分资源给缓存模块,以使所述缓存模块恢复初始化阶段的待恢复缓存数据;
第三模块,用于循环以下步骤:
判断所述资源池中当前剩余资源能否满足所述缓存模块的准备阶段申请需求;如果所述资源池中当前剩余资源满足所述缓存模块的准备阶段申请需求,根据所述准备阶段申请需求,从所述资源池中分配第三部分资源给所述缓存模块;
判断是否存在IO恢复需求;
如果存在IO恢复需求,根据IO恢复需求,从所述资源池中分配第四部分资源给IO处理模块,以使所述IO处理模块处理原中断IO,并触发所述缓存模块下刷,以将已恢复的所述待恢复缓存数据对应的所述第二部分资源释放至所述资源池;
判断所述准备阶段申请需求和所述IO恢复需求是否完全被满足,如果所述准备阶段申请需求和所述IO恢复需求完全被满足,则跳出循环。
相应的,本申请还公开了一种系统重启后的资源分配装置,包括:
存储器,用于存储计算机程序;
处理器,用于执行所述计算机程序时实现如上文任一项所述系统重启后的资源分配方法的步骤。
相应的,本申请还公开了一种可读存储介质,所述可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如上文任一项所述系统重启后的资源分配方法的步骤。
本申请将资源分配的方式改为异步,在为准备阶段申请需求和IO恢复需求分配资源时,重复了判断是否可分配、分配、触发资源释放的循环,直至准备阶段申请需求和IO恢复需求均被满足,再跳出循环,保证了资源分配能够顺利进行,最终满足了所有的资源分配需求,解决了现有方案中可能出现的流程中断问题。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。
图1为本申请实施例中一种系统重启后的资源分配方法的步骤流程图;
图2为本申请实施例中一种系统重启后的资源分配方法的子步骤流程图;
图3为本申请实施例中一种系统重启后的资源分配系统的结构分布图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
当前,系统重启后需要对资源重新分配,分配过程中经历初始化预申请、准备阶段申请、恢复阶段IO申请几个阶段,其中一旦初始化预申请阶段占用了太多资源,导致资源池中剩余资源无法满足准备阶段申请或恢复阶段申请,则会导致流程中断,系统无法进行后续流程。
本申请将资源分配的方式改为异步,在为准备阶段申请需求和IO恢复需求分配资源时,重复了判断是否可分配、分配、触发资源释放的循环,直至准备阶段申请需求和IO恢复需求均被满足,再跳出循环,保证了资源分配能够顺利进行,最终满足了所有的资源分配需求,解决了现有方案中可能出现的流程中断问题。
本申请实施例公开了一种系统重启后的资源分配方法,参见图1所示,包括:
S11:根据预申请需求,从资源池中分配第一部分资源给初始化预申请模块;
S12:根据缓存恢复需求,从资源池中分配第二部分资源给缓存模块,以使缓存模块恢复初始化阶段的待恢复缓存数据;
循环以下步骤:
S13:判断资源池中当前剩余资源能否满足缓存模块的准备阶段申请需求;如果资源池中当前剩余资源满足缓存模块的准备阶段申请需求,执行步骤S14再进入第一判断步骤,如果资源池中当前剩余资源不满足缓存模块的准备阶段申请需求,则直接进入第一判断步骤;
S14:根据准备阶段申请需求,从资源池中分配第三部分资源给缓存模块;
通常情况下,双节点系统的数据同步,准备阶段申请需求达到9600个资源申请,一旦当前剩余资源无法实现,直接跳过S14进入步骤S15。
第一判断步骤也即步骤S15,该步骤包括:
S15:判断是否存在IO恢复需求;如果存在IO恢复需求,执行步骤S16,并进入第二判断步骤,如果不存在IO恢复需求,则直接进入第二判断步骤;
S16:根据IO恢复需求,从资源池中分配第四部分资源给IO处理模块,以使IO处理模块处理原中断IO,并触发缓存模块下刷,以将已恢复的待恢复缓存数据对应的第二部分资源释放至资源池;
第二判断步骤也即步骤S17,该步骤包括:
S17:判断准备阶段申请需求和IO恢复需求是否完全被满足,如果准备阶段申请需求和IO恢复需求完全被满足,则跳出循环。如果准备阶段申请需求和IO恢复需求不完全被满足,则进入步骤S13。
具体的,步骤S13至S17的循环顺序始终不变,步骤S13可以直接接在步骤S17结束后执行,但是这样整个方法线程会占用较多CPU(Central Processing Unit,中央处理器),为了降低占用,可将整个循环可按预设频率设置相应的触发时机,触发点可设置在步骤S13,因此步骤S13所述判断资源池中当前剩余资源能否满足缓存模块的准备阶段申请需求的过程,具体包括:
按照预设频率,判断资源池中当前剩余资源能否满足缓存模块的准备阶段申请需求。
可以理解的是,本实施例中执行步骤S13和S16的判断动作时,可将相关的内容记录下,以便后续操作中内容查询,尤其是将未能满足的准备阶段申请需求和/或IO恢复需求记录到预设数据结构中,预设数据结构可选择链表或队列的形式。
因此,此时在步骤S13判断资源池中当前剩余资源能否满足缓存模块的准备阶段申请需求的过程,还包括:
如果资源池中当前剩余资源不满足缓存模块的准备阶段申请需求,在预设数据结构中记录资源池未能满足的准备阶段申请需求;
相应的,步骤S14根据准备阶段申请需求,从资源池中分配第三部分资源给缓存模块的过程,还包括:
更新预设数据结构。
具体的,更新预设数据结构的动作,具体为将预设数据结构中已被第三部分资源响应的准备阶段申请需求删除掉。
进一步的,IO恢复需求也存在无法被满足的可能,因此对于不同的IO恢 复需求的情况,参见图2所示,步骤S16根据IO恢复需求,从资源池中分配第四部分资源给IO处理模块的过程,具体包括:
S21:判断资源池中当前剩余资源能否满足所有IO恢复需求;
S22:如果资源池中当前剩余资源满足所有IO恢复需求,则根据所有IO恢复需求,从资源池中分配第四部分资源给IO处理模块;
S23:如果资源池中当前剩余资源不满足所有IO恢复需求,将多个IO恢复需求划分为当前剩余资源可满足的第一类恢复需求和当前剩余资源不可满足的第二类恢复需求;
S24:将第二类恢复需求记录在预设数据结构中;
S25:根据第一类恢复需求,从资源池中分配第四部分资源给IO处理模块。
可以理解的是,步骤S23中,如果当前剩余资源无法满足任何IO恢复需求,则第一类恢复需求为0,只执行步骤S24、忽略步骤S25即可。
进一步的,考虑缓存模块的下刷触发机制,步骤S23将多个IO恢复需求划分为当前剩余资源可满足的第一类恢复需求和当前剩余资源不可满足的第二类恢复需求的过程,包括:
将所有IO恢复需求按卷分组,确定每组的总需求;
按照多组IO恢复需求的优先级,将多个IO恢复需求划分为当前剩余资源可满足的第一类恢复需求和当前剩余资源不可满足的第二类恢复需求;
其中,多组IO恢复需求的优先级从高到低的顺序,分别对应多组总需求从小到大的排序结果。
可以理解的是,在以预设数据结构记录的情况下,步骤S17准备阶段申请需求和所述IO恢复需求是否完全被满足,如果步骤S17准备阶段申请需求和所述IO恢复需求完全被满足,则跳出循环的过程,具体包括:
判断预设数据结构是否为空,如果预设数据结构为空,则跳出循环。
可以理解的是,本实施例中将暂时无法满足的需求记录到预设数据结构中,该需求包括准备阶段申请需求和IO恢复需求,需求个数、需求量并不一致,在选择分配时,不一定要根据资源的顺序进行,遍历预设数据结构,能够满足哪个需求,便将资源分配给那个需求,只要保证每次缓存模块的下刷触发机制没有问题,则能够保证循环的正常进行,不会再出现现有技术里系统重启卡在资源申请的问题。
本申请将资源分配的方式改为异步,在为准备阶段申请需求和IO恢复需求分配资源时,重复了判断是否可分配、分配、触发资源释放的循环,直至准备阶段申请需求和IO恢复需求均被满足,再跳出循环,保证了资源分配能够顺利进行,最终满足了所有的资源分配需求,解决了现有方案中可能出现的流程中断问题。
相应的,本申请实施例还公开了一种系统重启后的资源分配系统,参见图3所示,包括:
第一模块1,用于根据预申请需求,从资源池中分配第一部分资源给初始化预申请模块;
第二模块2,用于根据缓存恢复需求,从所述资源池中分配第二部分资源给缓存模块,以使所述缓存模块恢复初始化阶段的待恢复缓存数据;
第三模块3,用于循环以下步骤:
判断所述资源池中当前剩余资源能否满足所述缓存模块的准备阶段申请需求,如果所述资源池中当前剩余资源满足所述缓存模块的准备阶段申请需求,根据所述准备阶段申请需求,从所述资源池中分配第三部分资源给所述缓存模块,并进入第一判断步骤,如果所述资源池中当前剩余资源不满足所述缓存模块的准备阶段申请需求,则直接进入所述第一判断步骤;
所述第一判断步骤包括:判断是否存在IO恢复需求,如果存在IO恢复需求,根据IO恢复需求,从所述资源池中分配第四部分资源给IO处理模块,以使所述IO处理模块处理原中断IO,并触发所述缓存模块下刷,以将已恢复的所述待恢复缓存数据对应的所述第二部分资源释放至所述资源池,并进入第二判断步骤,如果不存在IO恢复需求,则直接进入所述第二判断步骤;
所述第二判断步骤包括:判断所述准备阶段申请需求和所述IO恢复需求是否完全被满足,如果所述准备阶段申请需求和所述IO恢复需求完全被满足,则跳出循环。
本申请将资源分配的方式改为异步,在为准备阶段申请需求和IO恢复需求分配资源时,重复了判断是否可分配、分配、触发资源释放的循环,直至准备阶段申请需求和IO恢复需求均被满足,再跳出循环,保证了资源分配能够顺利进行,最终满足了所有的资源分配需求,解决了现有方案中可能出现 的流程中断问题。
相应的,本申请实施例还公开了一种系统重启后的资源分配装置,包括:
存储器,用于存储计算机程序;
处理器,用于执行所述计算机程序时实现如上文任一实施例所述系统重启后的资源分配方法的步骤。
相应的,本申请实施例还公开了一种可读存储介质,所述可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如上文任一实施例所述系统重启后的资源分配方法的步骤。
其中,本实施例中具体有关系统重启后的资源分配方法的细节内容可以参照上文实施例中的具体描述,此处不再赘述。
其中,本实施例中系统重启后的资源分配装置、可读存储介质均具有与上文实施例中相同的技术效果,此处不再赘述。
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上对本申请所提供的一种系统重启后的资源分配方法、系统及相关组件进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。

Claims (12)

  1. 一种系统重启后的资源分配方法,其特征在于,包括:
    根据预申请需求,从资源池中分配第一部分资源给初始化预申请模块;
    根据缓存恢复需求,从所述资源池中分配第二部分资源给缓存模块,以使所述缓存模块恢复初始化阶段的待恢复缓存数据;
    循环以下步骤:
    判断所述资源池中当前剩余资源能否满足所述缓存模块的准备阶段申请需求,如果所述资源池中当前剩余资源满足所述缓存模块的准备阶段申请需求,根据所述准备阶段申请需求,从所述资源池中分配第三部分资源给所述缓存模块,并进入第一判断步骤,如果所述资源池中当前剩余资源不满足所述缓存模块的准备阶段申请需求,则直接进入所述第一判断步骤;
    所述第一判断步骤包括:判断是否存在IO恢复需求,如果存在IO恢复需求,根据所述IO恢复需求,从所述资源池中分配第四部分资源给IO处理模块,以使所述IO处理模块处理原中断IO,并触发所述缓存模块下刷,以将已恢复的所述待恢复缓存数据对应的所述第二部分资源释放至所述资源池,并进入第二判断步骤,如果不存在IO恢复需求,则直接进入所述第二判断步骤;
    所述第二判断步骤包括:判断所述准备阶段申请需求和所述IO恢复需求是否完全被满足,如果所述准备阶段申请需求和所述IO恢复需求完全被满足,则跳出循环。
  2. 根据权利要求1所述资源分配方法,其特征在于,所述判断所述资源池中当前剩余资源能否满足所述缓存模块的准备阶段申请需求的过程,还包括:
    如果所述资源池中当前剩余资源不满足所述缓存模块的准备阶段申请需求,在预设数据结构中记录所述资源池未能满足的所述准备阶段申请需求;
    相应的,所述根据所述准备阶段申请需求,从所述资源池中分配第三部分资源给所述缓存模块的过程,还包括:
    更新所述预设数据结构。
  3. 根据权利要求2所述资源分配方法,其特征在于,所述根据所述IO恢复需求,从所述资源池中分配第四部分资源给IO处理模块的过程,包括:
    判断所述资源池中当前剩余资源能否满足所有所述IO恢复需求;
    如果所述资源池中当前剩余资源满足所有所述IO恢复需求,则根据所有所述IO恢复需求,从所述资源池中分配第四部分资源给IO处理模块;
    如果所述资源池中当前剩余资源不满足所有所述IO恢复需求,将多个所述IO恢复需求划分为当前剩余资源可满足的第一类恢复需求和当前剩余资源不可满足的第二类恢复需求;
    将所述第二类恢复需求记录在所述预设数据结构中;
    根据所述第一类恢复需求,从所述资源池中分配所述第四部分资源给所述IO处理模块。
  4. 根据权利要求3所述资源分配方法,其特征在于,所述将多个所述IO恢复需求划分为当前剩余资源可满足的第一类恢复需求和当前剩余资源不可满足的第二类恢复需求的过程,包括:
    将所有所述IO恢复需求按卷分组,确定每组的总需求;
    按照多组所述IO恢复需求的优先级,将多个所述IO恢复需求划分为当前剩余资源可满足的第一类恢复需求和当前剩余资源不可满足的第二类恢复需求;
    其中,多组所述IO恢复需求的优先级从高到低的顺序,分别对应多组所述总需求从小到大的排序结果。
  5. 根据权利要求3所述资源分配方法,其特征在于,所述准备阶段申请需求和所述IO恢复需求是否完全被满足,如果所述准备阶段申请需求和所述IO恢复需求完全被满足,则跳出循环的过程,具体包括:
    判断所述预设数据结构是否为空,如果所述预设数据结构为空,则跳出循环。
  6. 根据权利要求2至5中任一项所述资源分配方法,其特征在于,所述预设数据结构具体为链表或队列。
  7. 根据权利要求6所述资源分配方法,其特征在于,所述判断所述资源池中当前剩余资源能否满足所述缓存模块的准备阶段申请需求的过程,具体包括:
    按照预设频率,判断所述资源池中当前剩余资源能否满足所述缓存模块的准备阶段申请需求。
  8. 根据权利要求1所述资源分配方法,其特征在于,所述第一判断步骤还包括:
    判断是否存在IO恢复需求,如果存在IO恢复需求,根据所述资源池中当前剩余资源可满足的所述IO恢复需求,从所述资源池中分配第四部分资源给IO处理模块,以使所述IO处理模块处理原中断IO,并触发所述缓存模块下刷,以将已恢复的所述待恢复缓存数据对应的所述第二部分资源释放至所述资源池,并进入第二判断步骤,如果不存在IO恢复需求,则直接进入所述第二判断步骤。
  9. 一种系统重启后的资源分配系统,其特征在于,包括:
    第一模块,用于根据预申请需求,从资源池中分配第一部分资源给初始化预申请模块;
    第二模块,用于根据缓存恢复需求,从所述资源池中分配第二部分资源给缓存模块,以使所述缓存模块恢复初始化阶段的待恢复缓存数据;
    第三模块,用于循环以下步骤:
    判断所述资源池中当前剩余资源能否满足所述缓存模块的准备阶段申请需求;如果所述资源池中当前剩余资源满足所述缓存模块的准备阶段申请需求,根据所述准备阶段申请需求,从所述资源池中分配第三部分资源给所述缓存模块,并进入第一判断步骤,如果所述资源池中当前剩余资源不满足所述缓存模块的准备阶段申请需求,则直接进入所述第一判断步骤;
    所述第一判断步骤包括:判断是否存在IO恢复需求,如果存在IO恢复需求,根据IO恢复需求,从所述资源池中分配第四部分资源给IO处理模块,以使所述IO处理模块处理原中断IO,并触发所述缓存模块下刷,以将已恢复的所述待恢复缓存数据对应的所述第二部分资源释放至所述资源池,并进入第二判断步骤,如果不存在IO恢复需求,则直接进入所述第二判断步骤;
    所述第二判断步骤包括:判断所述准备阶段申请需求和所述IO恢复需求是否完全被满足,如果所述准备阶段申请需求和所述IO恢复需求完全被满足,则跳出循环。
  10. 根据权利要求9所述资源分配系统,其特征在于,所述第一判断步骤包括:
    判断是否存在IO恢复需求,如果存在IO恢复需求,根据所述资源池中当前剩余资源可满足的所述IO恢复需求,从所述资源池中分配第四部分资源给IO处理模块,以使所述IO处理模块处理原中断IO,并触发所述缓存模块下刷,以将已恢复的所述待恢复缓存数据对应的所述第二部分资源释放至所述资源池,并进入第二判断步骤,如果不存在IO恢复需求,则直接进入所述第二判断步骤。
  11. 一种系统重启后的资源分配装置,其特征在于,包括:
    存储器,用于存储计算机程序;
    处理器,用于执行所述计算机程序时实现如权利要求1至8任一项所述系统重启后的资源分配方法的步骤。
  12. 一种可读存储介质,其特征在于,所述可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至8任一项所述系统重启后的资源分配方法的步骤。
PCT/CN2021/127518 2021-07-14 2021-10-29 一种系统重启后的资源分配方法、系统及相关组件 WO2023284171A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US18/260,127 US20240061710A1 (en) 2021-07-14 2021-10-29 Resource allocation method and system after system restart and related component

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110792630.7 2021-07-14
CN202110792630.7A CN113254223B (zh) 2021-07-14 2021-07-14 一种系统重启后的资源分配方法、系统及相关组件

Publications (1)

Publication Number Publication Date
WO2023284171A1 true WO2023284171A1 (zh) 2023-01-19

Family

ID=77191217

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/127518 WO2023284171A1 (zh) 2021-07-14 2021-10-29 一种系统重启后的资源分配方法、系统及相关组件

Country Status (3)

Country Link
US (1) US20240061710A1 (zh)
CN (1) CN113254223B (zh)
WO (1) WO2023284171A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113254223B (zh) * 2021-07-14 2021-10-15 苏州浪潮智能科技有限公司 一种系统重启后的资源分配方法、系统及相关组件
CN113656162A (zh) * 2021-08-18 2021-11-16 恒生电子股份有限公司 资源的申请方法、装置、电子设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090172460A1 (en) * 2007-12-28 2009-07-02 International Business Machines Corporation Defining a computer recovery process that matches the scope of outage
CN105630602A (zh) * 2015-12-18 2016-06-01 山东海量信息技术研究院 一种计算机系统资源动态调整的方法
CN111258746A (zh) * 2018-11-30 2020-06-09 阿里巴巴集团控股有限公司 资源分配方法和服务设备
CN113254223A (zh) * 2021-07-14 2021-08-13 苏州浪潮智能科技有限公司 一种系统重启后的资源分配方法、系统及相关组件
CN113656162A (zh) * 2021-08-18 2021-11-16 恒生电子股份有限公司 资源的申请方法、装置、电子设备及存储介质

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6333936B1 (en) * 1998-04-29 2001-12-25 Telefonaktiebolaget Lm Ericsson (Publ) Method and apparatus for allocating processing resources
GB2517780A (en) * 2013-09-02 2015-03-04 Ibm Improved checkpoint and restart
CN105245372A (zh) * 2015-10-12 2016-01-13 浪潮软件集团有限公司 一种基于缓存和异步机制的加载网络资源的优化方法
CN109857541A (zh) * 2018-12-12 2019-06-07 浪潮(北京)电子信息产业有限公司 一种服务器的资源分配方法、系统及相关组件
CN112269659A (zh) * 2020-10-23 2021-01-26 苏州浪潮智能科技有限公司 一种资源管理方法、系统及电子设备和存储介质
CN112269658B (zh) * 2020-10-23 2022-07-22 苏州浪潮智能科技有限公司 一种复合资源申请方法、系统及电子设备和存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090172460A1 (en) * 2007-12-28 2009-07-02 International Business Machines Corporation Defining a computer recovery process that matches the scope of outage
CN105630602A (zh) * 2015-12-18 2016-06-01 山东海量信息技术研究院 一种计算机系统资源动态调整的方法
CN111258746A (zh) * 2018-11-30 2020-06-09 阿里巴巴集团控股有限公司 资源分配方法和服务设备
CN113254223A (zh) * 2021-07-14 2021-08-13 苏州浪潮智能科技有限公司 一种系统重启后的资源分配方法、系统及相关组件
CN113656162A (zh) * 2021-08-18 2021-11-16 恒生电子股份有限公司 资源的申请方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN113254223B (zh) 2021-10-15
CN113254223A (zh) 2021-08-13
US20240061710A1 (en) 2024-02-22

Similar Documents

Publication Publication Date Title
US10037233B2 (en) System having in-memory buffer service, temporary events file storage system and events file uploader service
CN109582466B (zh) 一种定时任务执行方法、分布式服务器集群及电子设备
JP6893284B2 (ja) リソーススケジューリング方法、スケジューリングサーバ、クラウドコンピューティングシステム、及び記憶媒体
WO2023284171A1 (zh) 一种系统重启后的资源分配方法、系统及相关组件
JP5088234B2 (ja) メッセージ紐付け処理装置、方法及びプログラム
EP1716486B1 (en) Methods and apparatus for task management in a multi-processor system
US6948172B1 (en) Preemptive multi-tasking with cooperative groups of tasks
US8862703B2 (en) Address server
US20200133718A1 (en) Virtual machine migration task management
WO2017101475A1 (zh) 一种基于Spark大数据处理平台的查询方法
US20180136842A1 (en) Partition metadata for distributed data objects
CN107391279B (zh) 一种消息队列容器创建方法、装置及消息队列容器
JP6412244B2 (ja) 負荷に基づく動的統合
WO2005081104A2 (en) Methods and apparatus for processor task migration in a multi-processor system
WO2017024908A1 (zh) 语音处理方法与装置
US11960941B2 (en) Managing virtual machine memory balloon using time series predictive data
CN112800026B (zh) 一种数据转移节点、方法、系统及计算机可读存储介质
US5355488A (en) Method for adaptively building a library of program threads
US20240036921A1 (en) Cascading of Graph Streaming Processors
EP3401784A1 (en) Multicore processing system
US20230376357A1 (en) Scaling virtualization resource units of applications
US10289329B2 (en) Burst buffer dynamic logical volume sizing in high performance computing environment
US10824640B1 (en) Framework for scheduling concurrent replication cycles
JP2017010473A (ja) ジョブ実行制御システム及び方法
US9384063B2 (en) Eliding synchronization in a concurrent data structure

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21949944

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 18260127

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE