一种控制用户使用资源的方法、装置、介质及设备Method, device, medium and device for controlling user use resources
本申请要求在2018年1月19日提交中国专利局、申请号为201810054007.X、发明名称为“一种控制用户使用资源的方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to Chinese Patent Application, filed on Jan. 19, 2018, to the Chinese Patent Office, Application No. 201 810 054 007.X, entitled "A Method and Apparatus for Controlling User Use of Resources", the entire contents of which are incorporated by reference. Combined in this application.
技术领域Technical field
本发明实施例涉及但不限于涉及互联网技术领域,尤其涉及一种控制用户使用资源的方法、装置、介质及设备。Embodiments of the present invention relate to, but are not limited to, the field of Internet technologies, and in particular, to a method, an apparatus, a medium, and a device for controlling a user to use a resource.
背景技术Background technique
云存储***提供各种资源,不同的用户访问并使用云存储***提供的各种资源。由于云存储***的处理能力是有限的,如果用户短时间内大量的增加访问量时,有可能极大的消耗云存储***的处理能力,甚至使云存储***发生***崩溃的情况,以至于不能正常提供服务,直接影响其它用户的正常访问。The cloud storage system provides various resources, and different users access and use various resources provided by the cloud storage system. Because the processing capacity of the cloud storage system is limited, if the user increases the amount of access in a short period of time, the processing capacity of the cloud storage system may be greatly consumed, or even the system crash of the cloud storage system may be impossible. The normal provision of services directly affects the normal access of other users.
发明内容Summary of the invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics detailed in this document. This Summary is not intended to limit the scope of the claims.
本文中的控制用户使用资源的方法,包括:The methods in this article that control user usage of resources include:
为用户设置单位时间内的资源使用量阈值;Set the resource usage threshold per unit time for the user;
监测各节点模块上报的用户使用的资源量;Monitor the amount of resources used by users reported by each node module;
根据所述用户的单位时间内的资源使用量阈值和所述用户在各节点模块使用的资源量确定所述用户在当前时间后的N个单位时间中每个单位时间内可用资源量,将所述可用资源量分配至节点模块;N为正整数。Determining, according to the resource usage threshold of the user in the unit time and the amount of resources used by the user in each node module, the amount of resources available in the unit time of the user in the N unit time after the current time, The amount of available resources is allocated to the node module; N is a positive integer.
上述控制用户使用资源的方法还具有以下特点:The above method of controlling user usage resources also has the following characteristics:
所述为用户设置单位时间内的资源使用量阈值包括:为用户设置单位时间内不同资源类型的资源使用量阈值;The setting a resource usage threshold for the user in a unit time includes: setting a resource usage threshold of different resource types in a unit time for the user;
所述监测各节点模块上报的用户使用的资源量包括:监测各节点模块上报的用户使用的不同资源类型的资源量;The monitoring the amount of resources used by the user reported by each node module includes: monitoring the amount of resources of different resource types used by the user reported by each node module;
所述根据所述用户的单位时间内的资源使用量阈值和所述用户在各节点模块使用的资源量确定所述用户在当前时间后的N个单位时间中每个单位时间内可用资源量包括:根据所述用户的单位时间内的各资源类型的资源使用量阈值和所述用户在各节点模块使用的各资源类型的资源量确定所述用户在当前时间后的N个单位时间中每个单位时间内各资源类型的可用资源量。Determining, according to the resource usage threshold of the user in a unit time period and the amount of resources used by the user in each node module, the amount of available resources in each unit time of the N unit time after the current time of the user includes Determining, according to the resource usage threshold of each resource type in the unit time of the user, and the resource amount of each resource type used by each user in each node module, each of the N unit time after the current time of the user. The amount of resources available for each resource type per unit time.
上述控制用户使用资源的方法还具有以下特点:The above method of controlling user usage resources also has the following characteristics:
将所述可用资源量分配至节点模块之前,所述方法还包括:统计在当前时间之前的预设时段内所述用户在各节点模块上使用资源量的比例;Before the amount of the available resources is allocated to the node module, the method further includes: counting a proportion of the amount of resources used by the user on each node module within a preset time period before the current time;
所述将所述可用资源量分配至节点模块包括:根据所述比例将所述可用资源量分配至不同的节点模块。The allocating the available resource amount to the node module includes: allocating the available resource amount to different node modules according to the ratio.
上述控制用户使用资源的方法还具有以下特点:The above method of controlling user usage resources also has the following characteristics:
所述方法还包括:所述节点模块从所述中心模块获取所述用户在当前时间后的N个单位时间中每个单位时间内可用资源量后,检测所述用户在单位时间内的资源使用量,在所述用户在单位时间内的资源使用量大于此单位时间内的可用资源量后,拒绝所述用户的访问。The method further includes: after the node module acquires the available resources of the user in each unit time in the N unit time after the current time, the node module detects the resource usage of the user in a unit time. The amount is denied after the user's resource usage per unit time is greater than the available resource amount in the unit time.
上述控制用户使用资源的方法还具有以下特点:The above method of controlling user usage resources also has the following characteristics:
所述根据所述用户的单位时间内的资源使用量阈值和所述用户在各节点模块使用的资源量确定所述用户在当前时间后的N个单位时间中每个单位时间内可用资源量包括:在每个单位时间内将所述用户的可用资源量增加一所述资源使用量阈值,从节点模块接收到其上报的用户使用的资源量后,从所述用户的可用资源量中减去所述用户使用的资源量,将更新后的所述用户的可用资源量分配为所述用户在当前时间后的N个单位时间中每个单位时间内可用资源量。Determining, according to the resource usage threshold of the user in a unit time period and the amount of resources used by the user in each node module, the amount of available resources in each unit time of the N unit time after the current time of the user includes : increasing the amount of available resources of the user by one resource usage threshold per unit time, and receiving the amount of resources used by the user reported by the node module, and subtracting the amount of available resources of the user from the amount of resources available to the user. The amount of resources used by the user is used to allocate the updated amount of available resources of the user to the amount of available resources per unit time of the N unit time of the user after the current time.
本发明实施例中控制用户使用资源的设备,包括中心设备,所述中心设备包括:The device for controlling the user to use the resource in the embodiment of the present invention includes a central device, where the central device includes:
设置模块,用于为用户设置单位时间内的资源使用量阈值;a setting module for setting a resource usage threshold per unit time for the user;
监测模块,用于监测各节点模块上报的用户使用的资源量;a monitoring module, configured to monitor a quantity of resources used by a user reported by each node module;
分配模块,用于根据所述用户的单位时间内的资源使用量阈值和所述用户在各节点模块使用的资源量确定所述用户在当前时间后的N个单位时间中每个单位时间内可用资源量,将所述可用资源量分配至节点模块;N为正整数。And an allocating module, configured to determine, according to the resource usage threshold of the user in a unit time and the amount of resources used by the user in each node module, that the user is available in each unit time of N unit time after the current time The amount of resources, the amount of available resources is allocated to the node module; N is a positive integer.
上述控制用户使用资源的设备还具有以下特点:The above devices that control user usage resources also have the following characteristics:
所述设置模块,还用于为用户设置单位时间内不同资源类型的资源使用量阈值;The setting module is further configured to set, for a user, a resource usage threshold of different resource types in a unit time;
所述监测模块,还用于监测各节点模块上报的用户使用的不同资源类型的资源量;The monitoring module is further configured to monitor a resource quantity of different resource types used by the user reported by each node module;
所述分配模块,还用于根据所述用户的单位时间内的各资源类型的资源使用量阈值和所述用户在各节点模块使用的各资源类型的资源量确定所述用户在当前时间后的N个单位时间中每个单位时间内各资源类型的可用资源量。The allocating module is further configured to determine, according to a resource usage threshold of each resource type in a unit time of the user, and a resource quantity of each resource type used by each user in each node module, the user is determined to be after the current time. The amount of resources available for each resource type per unit time in N unit time.
上述控制用户使用资源的设备还具有以下特点:The above devices that control user usage resources also have the following characteristics:
所述设备还包括统计模块,用于统计在当前时间之前的预设时段内所述用户在各节点模块上使用资源量的比例;The device further includes a statistics module, configured to calculate a proportion of the amount of resources used by the user on each node module in a preset time period before the current time;
所述分配模块,用于根据所述比例将所述可用资源量分配至不同的节点模块。The allocation module is configured to allocate the available resource amount to different node modules according to the ratio.
上述控制用户使用资源的设备还具有以下特点:The above devices that control user usage resources also have the following characteristics:
所述设备还包括节点设备,用于从所述中心设备获取所述用户在当前时间后的N个单位时间中每个单位时间内可用资源量,检测所述用户在单位时间内的资源使用量,在所述用户在单位时间内的资源使用量大于此单位时间内的可用资源量后,拒绝所述用户的访问。The device further includes a node device, configured to acquire, from the central device, an available resource amount per unit time in the N unit time after the current time, and detect the resource usage of the user in a unit time After the user's resource usage per unit time is greater than the available resource amount in the unit time, the user's access is denied.
上述控制用户使用资源的设备还具有以下特点:The above devices that control user usage resources also have the following characteristics:
所述分配模块,用于使用以下方法根据所述用户的单位时间内的资源使用量阈值和所述用户在各节点模块使用的资源量确定所述用户在当前时间后的N个单位时间中每个单位时间内可用资源量:在每个单位时间内将所述用户的可用资源量增加一所述资源使用量阈值,从节点模块接收到其上报的用户使用的资源量后,从所述用户的可用资源量中减去所述用户使用的资源量,将更新后的所述用户的可用资源量分配为所述用户在当前时间后的N个单位时间中每个 单位时间内可用资源量。The allocating module is configured to determine, according to a resource usage threshold of the user in a unit time and an amount of resources used by each user in each node module, that the user is in each of N unit time after the current time. The amount of available resources per unit time: the amount of available resources of the user is increased by one resource usage threshold per unit time, and the amount of resources used by the user reported by the node module is received from the user. The amount of resources used by the user is subtracted from the amount of available resources, and the updated amount of available resources of the user is allocated as the amount of available resources per unit time of the N unit time of the user after the current time.
本发明实施例中提供的计算机可读存储介质上存储有计算机程序,所述程序被处理器执行时实现权利要求上述方法的步骤。The computer readable storage medium provided in the embodiment of the present invention stores a computer program, and when the program is executed by the processor, the steps of the foregoing method are implemented.
本发明实施例中提供的计算机设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述程序时实现上述方法的步骤。The computer device provided in the embodiment of the present invention includes a memory, a processor, and a computer program stored on the memory and operable on the processor, and the processor implements the steps of the foregoing method when the program is executed.
本发明实施例中中心模块实时监控用户在各节点模块上的资源使用量,动态的调整为各节点模块分配的资源量,使节点模块在用户在此节点模块上的资源使用量超过中心节点设置的使用量时,禁止用户继续使用资源,可以防止用户无限制的消耗***的资源,使***一直处于有剩余资源状态,使***一直能够提供正常服务,防止***资源耗尽和崩溃。In the embodiment of the present invention, the central module monitors the resource usage of the user on each node module in real time, and dynamically adjusts the amount of resources allocated by each node module, so that the resource usage of the node module on the node module exceeds the central node setting. When the usage is used, the user is prohibited from continuing to use the resources, which prevents the user from consuming the resources of the system without restriction, so that the system is always in the state of remaining resources, so that the system can always provide normal services and prevent system resources from being exhausted and crashed.
附图说明DRAWINGS
此处所说明的附图用来提供对本发明实施例的进一步理解,构成本申请的一部分,本发明实施例的示意性实施例及其说明用于解释本发明实施例,并不构成对本发明实施例的不当限定。在附图中:The accompanying drawings are intended to provide a further understanding of the embodiments of the embodiments of the invention Improper limitations. In the drawing:
图1是实施例一中控制用户使用资源的方法的流程图;1 is a flowchart of a method for controlling a user to use a resource in Embodiment 1;
图2是实施例二中控制用户使用资源的方法的流程图。2 is a flow chart of a method for controlling a user to use resources in the second embodiment.
具体实施方式Detailed ways
现结合附图和具体实施方式对本发明实施例进一步说明。The embodiments of the present invention will be further described with reference to the drawings and specific embodiments.
实施例一Embodiment 1
图1是实施例中控制用户使用资源的方法的流程图,此方法包括:FIG. 1 is a flowchart of a method for controlling a user to use a resource in an embodiment, the method includes:
步骤101,为用户设置单位时间内的资源使用量阈值;Step 101: Set a resource usage threshold for the user in a unit time;
步骤102,监测各节点模块上报的用户使用的资源量;Step 102: Monitor the amount of resources used by the user reported by each node module.
步骤103,根据用户的单位时间内的资源使用量阈值和用户在各节点模块使用的资源量确定用户在当前时间后的N个单位时间中每个单位时间内可用资源量,将可用资源量分配至节点模块;N为正整数。Step 103: Determine, according to the resource usage threshold of the user's unit time and the amount of resources used by the user in each node module, the amount of available resources in each unit time of the N unit time after the current time, and allocate the available resources. To the node module; N is a positive integer.
方法还包括步骤104:节点模块从中心模块获取用户在当前时间后的N个单位时间中每个单位时间内可用资源量后,检测用户在单位时间内的资源使用量,在用户在单位时间内的资源使用量大于此单位时间内的可用资源量后,拒绝用户的访问。The method further includes a step 104: the node module acquires, from the central module, the amount of resources available per unit time in the N unit time after the current time, and detects the resource usage of the user in the unit time, when the user is in the unit time The user's access is denied after the resource usage is greater than the amount of available resources in this unit of time.
此方法可以防止用户无限制的消耗***的资源,使***一直处于有剩余资源状态,使***一直能够提供正常服务,防止***资源耗尽和崩溃。This method can prevent the user from consuming the resources of the system without restriction, so that the system is always in the state of remaining resources, so that the system can always provide normal services and prevent system resources from being exhausted and crashed.
步骤103中根据用户的单位时间内的资源使用量阈值和用户在各节点模块使用的资源量确定用户在当前时间后的N个单位时间中每个单位时间内可用资源量具体包括:在每个单位时间内将用户的可用资源量增加一资源使用量阈值,从节点模块接收到其上报的用户使用的资源量后,从用户的可用资源量中减去用户使用的资源量,将更新后的用户的可用资源量分配为用户在当前时间后的N个单位时间中每个单位时间内可用资源量。In step 103, according to the resource usage threshold of the user's unit time and the amount of resources used by the user in each node module, the amount of available resources in each unit time of the N unit time after the current time of the user is specifically included: The amount of resources available to the user is increased by one resource usage threshold per unit time. After receiving the amount of resources used by the user reported by the node module, the amount of resources used by the user is subtracted from the amount of available resources of the user, and the updated resource is used. The amount of available resources of the user is allocated to the amount of resources available per unit time in the N unit time of the user after the current time.
步骤103中将可用资源量分配至节点模块之前,此方法还包括:统计在当前时间之前的预设时段内用户在各节点模块上使用资源量的比例;将可用资源量分配至节点模块包括:根据上述比例将可用资源量分配至不同的节点模块。具体的,统计在当前时间之前的预设时段内用户在节点模块上使用资源量的比例较大时,为此节点模块分配可用资源量时将相应的分配较大的比例。此方法中,根据节点模块上资源访问的历史情况确定后续可用资源的分配,使资源分配更加合理。Before the allocation of the available resource amount to the node module in step 103, the method further includes: counting the proportion of the amount of resources used by the user on each node module in the preset time period before the current time; and allocating the available resource amount to the node module includes: The amount of available resources is allocated to different node modules according to the above ratio. Specifically, when the proportion of resources used by the user on the node module is large in the preset time period before the current time, when the available resource amount is allocated to the node module, a corresponding proportion is allocated. In this method, the allocation of subsequent available resources is determined according to the historical situation of resource access on the node module, so that the resource allocation is more reasonable.
实施例二Embodiment 2
实施例二相比实施例一还考虑了对不同资源类型的资源的访问控制。The second embodiment considers the access control of resources of different resource types compared to the first embodiment.
图2是实施例中控制用户使用资源的方法的流程图,此方法包括:2 is a flow chart of a method for controlling a user to use a resource in an embodiment, the method comprising:
步骤201,为用户设置单位时间内不同资源类型的资源使用量阈值;Step 201: Set a resource usage threshold of different resource types in a unit time for the user;
步骤202,监测各节点模块上报的用户使用的不同资源类型的资源量;Step 202: Monitor the amount of resources of different resource types used by the user reported by each node module.
步骤203,根据用户的单位时间内的各资源类型的资源使用量阈值和用户在各节点模块使用的各资源类型的资源量确定用户在当前时间后的N个单位时间中每个单位时间内各资源类型的可用资源量;将可用资源量分配至节点模块,N为正整数。Step 203: Determine, according to the resource usage threshold of each resource type in the unit time of the user, and the resource quantity of each resource type used by each node module, the user each time in each unit time of the N unit time after the current time. The amount of resources available for the resource type; the amount of available resources is allocated to the node module, where N is a positive integer.
此方法还包括步骤204:节点模块从中心模块获取用户在当前时间后的N个单位时间中每个单位时间内各资源类型的可用资源量后,检测用户在单位时间内对各资源类型的资源使用量,在用户在单位时间内对至少一资源类型的资源使用量大于此单位时间内的此资源类型的可用资源量后,拒绝用户的对此资源类型的资源的访问。The method further includes the step 204: the node module acquires, from the central module, the available resources of each resource type in each unit time of the N unit time after the current time, and detects the resources of the user for each resource type in a unit time. The amount of usage, after the user uses the resource amount of the at least one resource type in the unit time is greater than the available resource amount of the resource type in the unit time, the user's access to the resource of the resource type is denied.
步骤103中根据用户的单位时间内的资源使用量阈值和用户在各节点模块使用的资源量确定用户在当前时间后的N个单位时间中每个单位时间内可用资源量具体包括:在每个单位时间内将用户的各资源类型的可用资源量增加一相应资源类型的资源使用量阈值,从节点模块接收到其上报的用户使用的各资源类型的资源量后,从用户的各资源类型的可用资源量中减去用户使用的相应资源类型的资源量,将更新后的用户的各资源类型的可用资源量分配为用户在当前时间后的N个单位时间中每个单位时间内各资源类型的可用资源量。In step 103, according to the resource usage threshold of the user's unit time and the amount of resources used by the user in each node module, the amount of available resources in each unit time of the N unit time after the current time of the user is specifically included: The amount of available resources of each resource type of the user is increased by a resource usage threshold of the corresponding resource type in a unit time, and after receiving the resource amount of each resource type used by the user reported by the node module, the resource types of the user are The amount of resources of the corresponding resource type used by the user is subtracted from the amount of available resources, and the available resource amount of each resource type of the updated user is allocated as the resource type of each unit time in the N unit time after the current time. The amount of resources available.
步骤203中将可用资源量分配至节点模块之前,此方法还包括:统计在当前时间之前的预设时段内用户在各节点模块上使用资源量的比例。将可用资源量分配至节点模块包括:根据比例将可用资源量分配至不同的节点模块。此方法中,根据节点模块上资源访问的历史情况确定后续可用资源的分配,使资源分配更加合理。Before the amount of available resources is allocated to the node module in step 203, the method further includes: counting the proportion of the amount of resources used by the user on each node module within a preset time period before the current time. Assigning the amount of available resources to the node module includes allocating the amount of available resources to different node modules according to the scale. In this method, the allocation of subsequent available resources is determined according to the historical situation of resource access on the node module, so that the resource allocation is more reasonable.
实施例三Embodiment 3
对应于实施例一,实施例三中控制用户使用资源的设备,包括中心设备,中心设备包括:Corresponding to the first embodiment, the device for controlling the user to use resources in the third embodiment includes a central device, and the central device includes:
设置模块,用于为用户设置单位时间内的资源使用量阈值;a setting module for setting a resource usage threshold per unit time for the user;
监测模块,用于监测各节点模块上报的用户使用的资源量;a monitoring module, configured to monitor a quantity of resources used by a user reported by each node module;
分配模块,用于根据用户的单位时间内的资源使用量阈值和用户在各节点模块使用的资源量确定用户在当前时间后的N个单位时间中每个单位时间内可用资源量,将可用资源量分配至节点模块;N为正整数。An allocating module, configured to determine, according to a resource usage threshold of the user in a unit time period and a resource amount used by each node module, a quantity of available resources per unit time in the N unit time after the current time, and an available resource The quantity is assigned to the node module; N is a positive integer.
中心设备还包括统计模块,用于统计在当前时间之前的预设时段内用户在各节点模块上使用资源量的比例。分配模块用于根据此比例将可用资源量分配至不同的节点模块。The central device further includes a statistics module for counting the proportion of resources used by the user on each node module within a preset time period before the current time. The allocation module is used to allocate the amount of available resources to different node modules according to this ratio.
分配模块用于使用以下方法根据用户的单位时间内的资源使用量阈值和用 户在各节点模块使用的资源量确定用户在当前时间后的N个单位时间中每个单位时间内可用资源量:在每个单位时间内将用户的可用资源量增加一资源使用量阈值,从节点模块接收到其上报的用户使用的资源量后,从用户的可用资源量中减去用户使用的资源量,将更新后的用户的可用资源量分配为用户在当前时间后的N个单位时间中每个单位时间内可用资源量。The allocation module is configured to determine, according to the resource usage threshold of the user's unit time and the amount of resources used by the user in each node module, the amount of resources available per unit time in the N unit time after the current time: The amount of resources available to the user is increased by one resource usage threshold per unit time. After receiving the amount of resources used by the user reported by the node module, the amount of resources used by the user is subtracted from the amount of available resources of the user, and the resource is updated. The amount of available resources of the latter user is allocated as the amount of resources available per unit time in the N unit time of the user after the current time.
控制用户使用资源的设备还包括节点设备,用于从中心设备获取用户在当前时间后的N个单位时间中每个单位时间内可用资源量,检测用户在单位时间内的资源使用量,在用户在单位时间内的资源使用量大于此单位时间内的可用资源量后,拒绝用户的访问。The device for controlling the user to use the resource further includes a node device, configured to acquire, from the central device, the amount of available resources in each unit time of the N unit time after the current time, and detect the resource usage of the user in the unit time, in the user. After the resource usage per unit time is greater than the available resources in this unit time, the user's access is denied.
实施例四Embodiment 4
对应于实施例二,实施例四中控制用户使用资源的设备,包括中心设备,中心设备包括:Corresponding to the second embodiment, the device for controlling the user to use resources in the fourth embodiment includes a central device, and the central device includes:
设置模块,用于为用户设置单位时间内不同资源类型的资源使用量阈值;a setting module, configured to set a resource usage threshold of different resource types in a unit time for a user;
监测模块,用于监测各节点模块上报的用户使用的不同资源类型的资源量;a monitoring module, configured to monitor resources of different resource types used by users reported by each node module;
分配模块,用于根据用户的单位时间内的各资源类型的资源使用量阈值和用户在各节点模块使用的各资源类型的资源量确定用户在当前时间后的N个单位时间中每个单位时间内各资源类型的可用资源量,将可用资源量分配至节点模块;N为正整数。And an allocating module, configured to determine, according to a resource usage threshold of each resource type in a unit time of the user, and a resource quantity of each resource type used by each node module, each unit time in the N unit time after the current time The amount of available resources for each resource type, the amount of available resources is allocated to the node module; N is a positive integer.
中心设备还包括统计模块,用于统计在当前时间之前的预设时段内用户在各节点模块上使用资源量的比例。分配模块用于根据此比例将可用资源量分配至不同的节点模块。The central device further includes a statistics module for counting the proportion of resources used by the user on each node module within a preset time period before the current time. The allocation module is used to allocate the amount of available resources to different node modules according to this ratio.
分配模块用于使用以下方法根据用户的单位时间内的各资源类型的资源使用量阈值和用户在各节点模块使用的各资源类型的资源量确定用户在当前时间后的N个单位时间中每个单位时间内各资源类型的可用资源量:在每个单位时间内将用户的各资源类型的可用资源量增加一相应资源类型的资源使用量阈值,从节点模块接收到其上报的用户使用的各资源类型的资源量后,从用户的各资源类型的可用资源量中减去用户使用的相应资源类型的资源量,将更新后的用户的各资源类型的可用资源量分配为用户在当前时间后的N个单位时间中每个单位时间内各资源类型的可用资源量。The allocation module is configured to determine, according to the resource usage threshold of each resource type in the user's unit time and the resource amount of each resource type used by each node module, the user determines each of the N unit time after the current time. The amount of available resources of each resource type per unit time: the amount of available resources of each resource type of the user is increased by a resource usage threshold of the corresponding resource type in each unit time, and each user used by the reported user is received from the node module. After the resource type of the resource type, the amount of resources of the corresponding resource type used by the user is subtracted from the available resource amount of each resource type of the user, and the available resource amount of each resource type of the updated user is allocated as the user after the current time. The amount of available resources for each resource type per unit time in N unit time.
控制用户使用资源的设备还包括节点设备,用于节点模块从中心模块获取 用户在当前时间后的N个单位时间中每个单位时间内各资源类型的可用资源量后,检测用户在单位时间内对各资源类型的资源使用量,在用户在单位时间内对至少一资源类型的资源使用量大于此单位时间内的此资源类型的可用资源量后,拒绝用户的对此资源类型的资源的访问。The device for controlling the user to use the resource further includes a node device, where the node module acquires, from the central module, the available resources of each resource type in each unit time of the N unit time after the current time, and detects the user in the unit time. For the resource usage of each resource type, after the user uses the resource amount of the at least one resource type in the unit time is greater than the available resource amount of the resource type in the unit time, the user's access to the resource of the resource type is denied. .
本领域的普通技术人员应当理解,可以对本发明实施例的技术方案进行修改或者等同替换,而不脱离本发明技术方案的精神和范围,均应涵盖在权利要求范围当中。A person skilled in the art should understand that the technical solutions of the embodiments of the present invention may be modified or equivalent, without departing from the spirit and scope of the present invention, and should be included in the scope of the claims.
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、***、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些组件或所有组件可以被实施为由处理器,如数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。Those of ordinary skill in the art will appreciate that all or some of the steps, systems, and functional blocks/units of the methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be composed of several physical The components work together. Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer readable medium, which may include computer storage media (or non-transitory media) and communication media (or transitory media). As is well known to those of ordinary skill in the art, the term computer storage medium includes volatile and nonvolatile, implemented in any method or technology for storing information, such as computer readable instructions, data structures, program modules or other data. Sex, removable and non-removable media. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridge, magnetic tape, magnetic disk storage or other magnetic storage device, or may Any other medium used to store the desired information and that can be accessed by the computer. Moreover, it is well known to those skilled in the art that communication media typically includes computer readable instructions, data structures, program modules, or other data in a modulated data signal, such as a carrier wave or other transport mechanism, and can include any information delivery media. .
工业实用性Industrial applicability
本文中中心模块实时监控用户在各节点模块上的资源使用量,动态的调整为各节点模块分配的资源量,使节点模块在用户在此节点模块上的资源使用量超过中心节点设置的使用量时,禁止用户继续使用资源,可以防止用户无限制的消耗***的资源,使***一直处于有剩余资源状态,使***一直能够提供正常服务,防止***资源耗尽和崩溃。In this paper, the central module monitors the user's resource usage on each node module in real time, and dynamically adjusts the amount of resources allocated to each node module, so that the resource usage of the node module on the node module exceeds the usage of the central node. When the user is prohibited from continuing to use resources, the user can be prevented from consuming the resources of the system without restriction, and the system is always in a state of remaining resources, so that the system can always provide normal services and prevent system resources from being exhausted and crashed.