WO2017041652A1 - 一种网络资源的使用限额的控制方法、装置及系统 - Google Patents

一种网络资源的使用限额的控制方法、装置及系统 Download PDF

Info

Publication number
WO2017041652A1
WO2017041652A1 PCT/CN2016/097496 CN2016097496W WO2017041652A1 WO 2017041652 A1 WO2017041652 A1 WO 2017041652A1 CN 2016097496 W CN2016097496 W CN 2016097496W WO 2017041652 A1 WO2017041652 A1 WO 2017041652A1
Authority
WO
WIPO (PCT)
Prior art keywords
client
network resource
server
quota
usage quota
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.)
Ceased
Application number
PCT/CN2016/097496
Other languages
English (en)
French (fr)
Inventor
周洲
孙廷韬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Publication of WO2017041652A1 publication Critical patent/WO2017041652A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • H04L47/82Miscellaneous aspects
    • H04L47/826Involving periods of time

Definitions

  • the present application belongs to the field of Internet technologies, and in particular, to a method, device, and system for controlling a usage limit of a network resource.
  • a local or global control method is generally used for the quota of network system resources.
  • the quota command can be used to check the current resource usage of each user equipment.
  • the present application provides a method, a device, and a system for controlling a usage limit of a network resource, which can solve the problem that the control method of the existing network resource quota has inaccurate control.
  • the first aspect of the present application provides a method for controlling a usage limit of a network resource, including:
  • the client counts the amount of use of network resources in the current interval t;
  • a dynamic usage quota if it is determined that the client uses the network resource usage quota within the current interval time t If the first dynamic usage quota is greater than the first dynamic usage quota, the time length of the network resource is disabled to the client;
  • the client collects the usage quota of the network resource in the current interval t
  • the client further includes:
  • the client uses a dynamic usage quota of the network resource to enable the server to send the first dynamic usage to the client when determining that the second dynamic usage quota is inconsistent with the first dynamic usage quota Limit
  • the client updates the second dynamic usage quota of the network resource by the client to the first dynamic usage quota according to the first dynamic usage quota sent by the server.
  • the client collects the usage quota of the network resource in the current interval t
  • the client further includes:
  • the client sets the usage quota for using network resources to zero.
  • the method further includes:
  • the method further includes:
  • the client uses the network resource in the next interval t, if it is determined that the current time is after the forbidden end time of the network resource, the network resource is used, and the usage quota of the network resource is used. If it is determined that the current time is before the prohibition end time of the network resource, the use of the network resource is prohibited.
  • the embodiment of the invention further provides a method for controlling a usage limit of a network resource, including:
  • the client If it is determined that the usage quota of the network resource used by the client in the current interval t is greater than the first dynamic usage quota, sending a disable duration of the network resource to the client, so that the client is configured according to the Determining the length of time of the network resource sent by the server, starting from the moment of receiving the disabled duration, prohibiting the use of the network resource within the disabled duration.
  • the server determines a first dynamic usage quota of the network resource used by the client at a current time, include:
  • the server determines, according to the default quota of the network resource that is used by the client, and the number of clients that currently use the network resource, to determine a first dynamic usage quota of the network resource used by the client at a current time.
  • the server determines, according to the default quota of the network resource that is used by the client, and the number of clients that currently use the network resource, to determine a first dynamic of the network resource used by the client at a current time.
  • Use limits including:
  • the DefaultQuota indicates that the client presets a default quota for using the network resource
  • the aliveAgentCount indicates the number of clients currently using the network resource
  • ImpactFactor is a preset constant.
  • the method further includes:
  • the server determines that the second dynamic usage quota is inconsistent with the first dynamic usage quota
  • the server sends the first dynamic usage quota to the client, so that the client sends the server according to the server.
  • the first dynamic usage quota is used to update the second dynamic usage quota of the network resource by the client to the first dynamic usage quota.
  • the embodiment of the invention further provides a device for controlling the usage limit of the network resource, which is located at the client, and includes:
  • the statistics module is configured to collect the usage quota of the network resource in the current interval t;
  • a sending module configured to send, to the server, information about the usage quota of the network resource used by the client during the current interval time t at the end of the current interval time t; so that the server determines that the client uses the network resource at the current time a first dynamic usage quota, if it is determined that the usage quota of the network resource used by the client in the current interval time t is greater than the first dynamic usage quota, sending a disable duration of the network resource to the client;
  • a receiving module configured to receive a disabled duration of the network resource sent by the server
  • the sending module is further configured to send, to the server, a second dynamic usage quota of the network usage resource of the client, when the current interval time t ends, where the second dynamic usage quota is The client uses a dynamic usage quota of network resources calculated at the end of the last interval t; such that the server, when determining that the second dynamic usage quota is inconsistent with the first dynamic usage quota, to the client Sending the first dynamic usage quota;
  • the receiving module is further configured to receive the first dynamic usage quota sent by the server;
  • the device also includes:
  • an update module configured to update, according to the first dynamic usage quota received by the receiving module, the second dynamic usage quota of the network resource by the client to the first dynamic usage quota.
  • the device further includes:
  • a setting module is used to set the usage quota of the network resource to be zero at the end of the current interval time t.
  • the disabling module is configured to set, according to the disabled duration of the network resource sent by the server, a time for receiving the disabled duration as a forbidden start time for prohibiting use of the network resource, where The time when the prohibition start time starts at the end of the disable duration is set to prohibit the use of the network resource's prohibition end time.
  • the device further includes:
  • a determining module configured to use the network resource when the network resource is used in the next interval t, and if the current time is determined to be after the forbidden end time of the network resource, use the network resource, and use the network resource usage quota If the current time is determined to be before the prohibition end time of the network resource, the use of the network resource is prohibited.
  • the embodiment of the invention further provides a device for controlling the usage limit of the network resource, which is located at the server, and includes:
  • a receiving module configured to receive, by the client, information about a usage quota of the network resource used by the client during a current interval t;
  • a determining module configured to determine a first dynamic usage limit of the network resource used by the client at a current time
  • a determining module configured to determine whether the usage quota of the network resource used by the client in the current interval time t is greater than the first dynamic usage quota
  • a sending module configured to determine, by the determining module, that the client uses network resources within a current interval t The usage duration of the network resource is sent to the client when the usage quota is greater than the first dynamic usage quota; so that the client is in accordance with the disabled duration of the network resource sent by the server, from the receiving station The time of the disabled duration begins, and the use of the network resource is prohibited during the disabled duration.
  • the determining module is specifically configured to:
  • the information about the usage quota of the network resource that is sent by the client and the other client that is received by the current time where the information carries the identifier information of the client and the other client, and determines that the current usage is The number of clients of network resources;
  • the determining module is specifically configured to:
  • the DefaultQuota indicates that the client presets a default quota for using the network resource
  • the aliveAgentCount indicates the number of clients currently using the network resource
  • ImpactFactor is a preset constant.
  • the receiving module is further configured to receive, by the client, a second dynamic usage quota of the network usage resource used by the client to the server at the end of the current interval t, the second dynamic use The quota is a dynamic usage limit of the client using network resources calculated by the server at the end of the last interval t;
  • the determining module is further configured to determine whether the second dynamic usage quota is consistent with the first dynamic usage quota
  • the sending module is further configured to: when the determining module determines that the second dynamic usage quota is inconsistent with the first dynamic usage quota, send the first dynamic usage quota to the client;
  • the client updates the second dynamic usage quota of the network resource by the client to the first dynamic usage quota according to the first dynamic usage quota sent by the server.
  • An embodiment of the present invention further provides a control system for a network resource usage quota, including: a client and a server;
  • the client includes the above-mentioned control device for the usage quota of the network resource
  • the server includes the above-described control device for the usage quota of the network resource.
  • the time window size of the server for controlling the network resource quota in the embodiment of the present invention is far greater than the interval of the use of the network resource by the client.
  • the time that the client reports the default data falls on the server.
  • the time window of the control of the network resource quota, and the embodiment of the present invention adopts that the use of the network resource is prohibited within the disabled time period from the moment when the client receives the disabled duration, instead of issuing a resource disable command according to the server. Time is used as a reference to prohibit the use of the network resources, so that even when the client and server time are not synchronized, the network resource quota can be effectively controlled; thus, the client and server time can be prevented from being out of synchronization. The resulting limit control of network resources is inaccurate.
  • the server when receiving the information about the network resource usage quota reported by the client, determines the first dynamic usage quota of the network resource used by the client at the current time, and then uses the network resource by the client.
  • the usage quota is compared with the currently determined first dynamic usage quota, and is sent to the client when it is determined that the usage quota of the network resource used by the client in the current interval time t is greater than the first dynamic usage quota.
  • the length of time the network resource is disabled. Since the first dynamic usage limit is the number of clients and other clients that the server uses according to all current network resources (which may also be referred to as the number of active clients currently using network resources), and the client presets to use the network.
  • the default quota of the resource, the calculated first dynamic usage quota of the network resource used by the client, the first dynamic usage quota can effectively and reasonably allocate the network resources used by each client, and does not cause network resource allocation to be inaccurately caused by network resources. Waste problem.
  • FIG. 1 is a schematic flowchart of a method for controlling a usage limit of a network resource according to an embodiment of the present application
  • FIG. 2 is a schematic flowchart of a method for controlling a usage limit of a network resource according to an embodiment of the present application
  • FIG. 3 is a schematic flowchart of a method for controlling a usage limit of a network resource according to an embodiment of the present application
  • FIG. 4 is a schematic flowchart of a method for controlling a usage limit of a network resource according to an embodiment of the present application
  • FIG. 5 is a schematic flowchart of a method for controlling a usage limit of a network resource according to an embodiment of the present application
  • FIG. 6 is a schematic structural diagram of a device for controlling a usage limit of a network resource according to an embodiment of the present application
  • FIG. 7 is a schematic structural diagram of a device for controlling a usage limit of a network resource according to an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a control system for using a network resource quota according to an embodiment of the present application.
  • FIG. 9 is a schematic diagram of an electronic device according to an embodiment of the present invention.
  • a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory.
  • RAM random access memory
  • ROM read only memory
  • Memory is an example of a computer readable medium.
  • Computer readable media includes both permanent and non-persistent, removable and non-removable media.
  • Information storage can be implemented by any method or technology.
  • the information can be computer readable instructions, data structures, modules of programs, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device.
  • computer readable media does not include non-transitory computer readable media, such as modulated data signals and carrier waves.
  • first device if a first device is coupled to a second device, the first device can be directly electrically coupled to the second device, or electrically coupled indirectly through other devices or coupling means. Connected to the second device.
  • the description of the specification is intended to be illustrative of the preferred embodiments of the invention. The scope of protection of the application is subject to the definition of the appended claims.
  • the inventors found that most systems (such as distributed systems or multi-user systems) generally adopt local or global control methods for network resource quotas, wherein the local control method is to use network resources.
  • the quota is divided into users according to certain rules, and each user has its own resource limit.
  • the local control method will bring inconvenience to the user, because the user consumes different resources, and some users will allocate the resources allocated to them. Some users are likely to have a large amount of resources left without consumption, which leads to inaccurate resource allocation. The cost of resources.
  • the global control method generally uses the upper limit of the resource usage per minute configured by the server.
  • the global control method relies heavily on the time synchronization between the server and the client. That is, the resource usage reported by the client to the server is strictly required to fall on the server. Within the time window of resource statistics, otherwise the reported data will be cut or discarded.
  • the server-issued resource disable command is based on the server's time. If the client and server time are not synchronized, the network resource quota control may be inaccurate.
  • the embodiment of the present invention provides a method for controlling the usage quota of the network resource.
  • the method provided by the embodiment of the present invention can be applied to a distributed system or a multi-user system, wherein each client packages the usage of various resources to the server at intervals t, and the server summarizes the reports of the clients.
  • Resource usage calculate the dynamic limit of each resource used by each client, and verify whether the resource usage reported by the client exceeds the calculated dynamic usage limit of the resource, and if it exceeds, return
  • the response will include a disable command for the overrun resource.
  • the disable command contains the length of time the client is disabled for the resource. After the client receives the disable command, the current time is added to the resource that exceeds the limit. Disable the duration as the time to disable.
  • the embodiment of the present invention adopts that the use of the network resource is prohibited within the disabled time period from the moment when the client receives the disable duration, instead of using the time when the server issues the resource disable command as a reference for prohibiting the use of the network resource. Therefore, even when the client and the server time are not synchronized, the quota of the network resources can be effectively controlled accurately; therefore, the inaccuracy of the limit control of the network resources caused by the unsynchronized client and server time can be prevented.
  • the dynamic usage limit is the number of clients that the server uses according to all current network resources (also referred to as the number of active clients currently using network resources), and each client presets. Using a default quota of a certain network resource, each client calculated uses a dynamic usage quota of the network resource, and the dynamic usage quota can effectively and uniformly allocate network resources used by each client, and does not cause inaccurate network resource allocation. Causes waste of network resources.
  • the time window size of the server for controlling the network resource quota is w
  • the interval for the client to use the network resource usage is t, where w is much larger than t, so that the client
  • the data reported by the terminal defaults to the time window in which the server currently controls the network resource quota.
  • FIG. 1 is a schematic flowchart of a method for controlling a usage limit of a network resource according to an embodiment of the present application. The method is performed on a client, as shown in FIG.
  • the client collects the usage quota of the network resource in the current interval t.
  • the client needs to use the usage information (such as the usage quota) of the network resource in every interval time t.
  • the client sets the usage quota of the network resource to zero.
  • the client has a statistical time window, and the network resources consumed by the client request arriving in the window time interval are accumulated into the time window, assuming that the time window is W, W time
  • the client reports the network resource usage to the server multiple times, and the reporting interval t is much smaller than W.
  • the client sends, to the server, the information about the usage quota of the network resource used by the client during the current interval time t at the end of the current interval time t, so that the server determines the current time that the client uses the network resource.
  • a dynamic usage quota if it is determined that the usage quota of the network resource used by the client in the current interval t is greater than the first dynamic usage quota, sending the network resource to the client for a disabled duration;
  • a packet timer is set in the client, and at the end of each interval time t, the packet timer signal is triggered, so that the client uses the network resource usage quota in the interval time t counted in step 101.
  • the information is packaged, wherein the packaged information carries the identifier of the network resource, the identifier of the client, and the usage quota of the network resource used by the client.
  • the server receives the information about the usage quota of the network resource sent by the client.
  • the client uses the network resource
  • other clients may also use the network resource, so
  • the server determines, according to the default quota of the network resource that is used by the client, and the number of clients that currently use the network resource, to determine the first dynamic of the client to use the network resource at the current time.
  • the quota is used; wherein the default quota of the network resource preset by the client can be saved in the database, for example, the client and the server can share the database, and the server and the client can obtain the client preset from the database. Use the default quota for the network resource.
  • the server sends a disable duration of the network resource to the client after determining that the usage quota of the network resource used by the client in the current interval t is greater than the first dynamic usage quota.
  • the server has a statistical window of the first dynamic usage quota, which is generally one minute. If the network resource usage exceeds the first dynamic usage quota at a certain moment in the statistical window interval, the request for the network resource after the arrival request is disabled.
  • the disabled duration is the time at the end of the statistics window minus the current time.
  • the client receives the disabled duration of the network resource sent by the server, and according to the disabled duration, prohibits the use of the network resource within the disabled duration from the moment of receiving the disabled duration.
  • the client sets the time for receiving the disabled duration to the forbidden start time of using the network resource according to the duration of the network resource sent by the server, and The time when the prohibition start time starts at the end of the disable duration is set to prohibit the use of the network resource's prohibition end time.
  • the client uses the network resource in the next interval t, if it is determined that the current time is after the forbidden end time of the network resource, the network resource is used, and the usage is counted.
  • the usage quota of the network resource if it is determined that the current time is before the prohibition end time of the network resource, the use of the network resource is prohibited.
  • the time window size of the server for controlling the network resource quota in the embodiment of the present invention is far greater than the interval of the use of the network resource by the client.
  • the time that the client reports the default data falls on the server.
  • the time window of the control of the network resource quota, and the embodiment of the present invention adopts that the use of the network resource is prohibited within the disabled time period from the moment when the client receives the disabled duration, instead of issuing a resource disable command according to the server. Time is used as a reference to prohibit the use of the network resources, so that even when the client and server time are not synchronized, the network resource quota can be effectively controlled; thus, the client and server time can be prevented from being out of synchronization. The resulting limit control of network resources is inaccurate.
  • the server when receiving the information about the network resource usage quota reported by the client, determines the first dynamic usage quota of the network resource used by the client at the current time, and then uses the network resource by the client.
  • the usage quota is compared with the currently determined first dynamic usage quota, and is sent to the client when it is determined that the usage quota of the network resource used by the client in the current interval time t is greater than the first dynamic usage quota. The length of time the network resource is disabled.
  • the first dynamic usage limit is the server based on all current usage
  • the number of clients and other clients of the network resource (which may also be referred to as the number of active clients currently using the network resource), and the default quota used by the client to use the network resource, and the calculated client usage
  • the first dynamic usage quota of the network resource, the first dynamic usage quota can effectively and reasonably allocate the network resources used by each client, and does not cause the network resource to be wasted due to inaccurate network resource allocation.
  • FIG. 2 is a schematic flowchart of a method for controlling a usage limit of a network resource according to an embodiment of the present application. The method is performed on a client, as shown in FIG. 2, and includes:
  • the client collects the usage quota of the network resource in the current interval t.
  • step 101 in the embodiment shown in FIG. 1 are specifically implemented.
  • the client sends a second dynamic usage quota of the network usage resource of the client to the server at the end of the current interval time t, where the second dynamic usage quota is calculated by the server at the end of the last interval time t.
  • the client uses a dynamic usage quota of the network resource, so that the server sends the first dynamic usage quota to the client when determining that the second dynamic usage quota is inconsistent with the first dynamic usage quota.
  • the client sends information about the usage quota of the network resource used by the client during the last interval t at the end of the last interval t (such as time T1), and the server is in the server.
  • the client receives the information about the usage quota of the network resource in the last interval t, and counts the number of the client and other clients using the network resource at time T1 (ie, the T1 time is used.
  • the number of active clients of the network resource in combination with the default quota of the network resource preset by the client, calculates a dynamic usage limit of the network resource used by the client at time T1 (ie, a second dynamic) Using the quota, the client uses the dynamic usage limit of the network resource at the end of the last interval t);
  • the client sends information about the usage quota of the network resource in the current interval time t to the server at the end of the current interval time t (ie, the current time is T2), and the server is at the current time T2.
  • Calculating the dynamic usage limit of the network resource by the client at the current time T2 (in time, using the number of active clients of the network resource), in combination with the default quota of the network resource preset by the client ( The first dynamic usage limit;
  • the server determines that the second dynamic usage quota is inconsistent with the first dynamic usage quota
  • the first dynamic usage quota is sent to the client, that is, the current time of the client is T2 (the current interval)
  • the dynamic usage limit received from the server using the network resource
  • the client uses the network according to the first dynamic usage quota sent by the server.
  • the second dynamic usage quota of the resource is updated to the first dynamic usage quota.
  • the first dynamic usage quota is a dynamic usage quota of the network resource received by the client from the server at the current time of the client; in contrast, the second dynamic usage quota is the last time the client is from the server.
  • the client uses a dynamic usage quota of the network resource; when the client compares the first dynamic usage quota and the second dynamic usage quota, if it is determined that the two are inconsistent, the second dynamic usage quota is updated to the The first dynamic usage limit.
  • the dynamic usage limit of the network resource used by the client is dynamically changed because the number of clients using the network resource changes every time, and the server recalculates the client at intervals.
  • the use of the network resource's dynamic usage limit is also to effectively and reasonably allocate the network resources used by each client, and does not cause the network resource to be wasted due to inaccurate network resource allocation.
  • the server when the server receives the information about the usage quota of the network resource sent by the client, the server recalculates the dynamic usage limit of the network resource used by the client at the time (ie, the current time) when the usage information is received, where
  • the role of the dynamic usage limit is that when the system crashes, the client will receive the latest dynamic usage limit sent by the server as the temporary resource usage limit of the network resources used by the client, which can prevent users from abusing network resources when the system crashes. Guarantee the user's network resource usage experience.
  • FIG. 3 is a schematic flowchart of a method for controlling a usage limit of a network resource according to an embodiment of the present application. The method is performed by a server, as shown in FIG. 3, and includes:
  • the server receives, by the client, information about the usage quota of the network resource used by the client in the current interval time t;
  • the client needs to count usage information (such as usage quota) of using network resources at every interval t.
  • usage information such as usage quota
  • a packet timer is set in the client, and at the end of each interval t, the packet timer signal is triggered, so that the client packs the statistical information of the usage quota of the network resource in the interval t.
  • the packaged information carries the identifier of the network resource, the identifier of the client, and the usage quota of the network resource used by the client.
  • the information about the usage quota of the network resource sent by the client and other clients received by the server according to the current time the information carrying the identification information of the client and the other client Determine the number of clients currently using the network resource.
  • the server determines a first dynamic usage quota of the network resource used by the client at a current time
  • the server receives the information about the usage quota of the network resource sent by the client. Afterwards, the server may, for example, receive information about the usage quota of the network resource sent by the client and other clients that are received by the current time, where the information carries the identification information of the client and the other client. Determining the number of clients currently using the network resource;
  • the server determines, according to the default quota of the network resource that is used by the client, and the number of clients that currently use the network resource, to determine a first dynamic usage quota of the network resource used by the client at the current time. For example, it can be based on a calculation formula:
  • DefaultQuota indicates that the client presets a default quota for using the network resource
  • aliveAgentCount indicates the number of clients currently using the network resource
  • ImpactFactor is a preset constant. This constant is an empirical value, generally greater than 1, and the effect is to amplify the calculation result. For example, in the case of server downtime, DefaultQuota will be evenly distributed to the active client (aliveAgent), but which client may be uneven, in order to ensure the quality of service, each aliveAgent is allocated. Resources will be enlarged a bit.
  • the client sets the time for receiving the disabled duration to the forbidden start time for prohibiting the use of the network resource according to the disabled duration of the network resource sent by the server, and the forbidden start time is The time at which the end of the disable duration begins is set to prohibit the use of the network resource's forbidden end time.
  • the client uses the network resource in the next interval t, if it is determined that the current time is after the forbidden end time of the network resource, the network resource is used, and the usage is counted.
  • the usage quota of the network resource if it is determined that the current time is before the prohibition end time of the network resource, the use of the network resource is prohibited.
  • the embodiment of the present invention is to prohibit the use of the network resource within the disabled time period from the moment when the client receives the disabled duration, instead of using the network resource according to the time when the server issues the resource disable command. Therefore, even when the client and server time are not synchronized, the network resource quota can be effectively controlled; therefore, the network resources caused by the client and server time synchronization can be prevented.
  • the limit control is not accurate.
  • the server when receiving the information about the network resource usage quota reported by the client, determines the first dynamic usage quota of the network resource used by the client at the current time, and then uses the network resource by the client.
  • the usage quota is compared with the currently determined first dynamic usage quota, and is sent to the client when it is determined that the usage quota of the network resource used by the client in the current interval time t is greater than the first dynamic usage quota.
  • the length of time the network resource is disabled. Since the first dynamic usage limit is the number of clients and other clients that the server uses according to all current network resources (which may also be referred to as the number of active clients currently using network resources), and the client presets to use the network.
  • the default quota of the resource, the calculated first dynamic usage quota of the network resource used by the client, the first dynamic usage quota can effectively and reasonably allocate the network resources used by each client, and does not cause network resource allocation to be inaccurately caused by network resources. Waste problem.
  • FIG. 4 is a schematic flowchart of a method for controlling a usage limit of a network resource according to an embodiment of the present application. The method is performed by a server, as shown in FIG. 4, and includes:
  • the server receives a second dynamic usage quota of the client that uses the network resource that is sent by the client at the end of the current interval time t, where the second dynamic usage quota is calculated by the server at the end of the last interval time t.
  • the client uses a dynamic usage limit of network resources;
  • the calculation method of the second dynamic usage quota may refer to the calculation method of the first dynamic usage quota in step 402.
  • the server determines a first dynamic usage quota of the network resource used by the client at a current time
  • the client sends information about the usage quota of the network resource used by the client during the last interval t at the end of the last interval t (such as time T1), and the server is in the server.
  • the client receives the information about the usage quota of the network resource in the last interval t, and counts the number of the client and other clients using the network resource at time T1 (ie, the T1 time is used.
  • the number of active clients of the network resource in combination with the default quota of the network resource preset by the client, calculates a dynamic usage limit of the network resource used by the client at time T1 (ie, a second dynamic) Using the quota, the client uses the dynamic usage limit of the network resource at the end of the last interval t);
  • the client sends information about the usage quota of the network resource in the current interval time t to the server at the end of the current interval time t (ie, the current time is T2), and the server is at the current time T2.
  • the default quota of the resource, and the dynamic usage limit of the network resource used by the client at the current time T2 is calculated (ie, the first dynamic usage quota;
  • the server may be based on, for example, a calculation formula:
  • the DefaultQuota indicates that the client presets a default quota for using the network resource
  • the aliveAgentCount indicates the number of clients currently using the network resource
  • ImpactFactor is a preset constant.
  • the server sends the first dynamic usage quota to the client when determining that the second dynamic usage quota is inconsistent with the first dynamic usage quota, so that the client sends the server according to the server.
  • the first dynamic usage quota is used to update the second dynamic usage quota of the network resource by the client to the first dynamic usage quota.
  • the server when the server receives the information about the usage quota of the network resource sent by the client, the server recalculates the dynamic usage limit of the network resource used by the client at the time (ie, the current time) when the usage information is received, where
  • the role of the dynamic usage limit is that when the system crashes, the client will receive the latest dynamic usage limit sent by the server as the temporary resource usage limit of the network resources used by the client, which can prevent users from abusing network resources when the system crashes. Guarantee the user's network resource usage experience.
  • the present invention is divided into two parts: a client and a server. It is assumed that there are four resources a, b, c, and d. In a distributed system, multiple clients simultaneously perform four resources of a, b, c, and d. Consumption, the client packs the usage of the four resources a, b, c, and d to the server at intervals t, and the server summarizes the resource usage reported by the client, and verifies whether the client uses a certain resource.
  • FIG. 5 is a schematic flowchart of a method for controlling a usage limit of a network resource according to an embodiment of the present disclosure. The method is performed on a client and a server, as shown in FIG. 5, and includes:
  • the client refers to one of a plurality of clients in the distributed system.
  • the network resource usage information includes information such as identification information of the client, identification information of the network resource, and usage quota of the network resource.
  • the data structure of the data packet reported by the client to the server regarding network resource usage information is as follows:
  • Int32_t resourceID indicates the network resource number
  • Uint64_t resourceUsage indicates the usage of the resource within the reporting interval t;
  • Uint64_t dynamicQuota indicates dynamic usage limit
  • ResourceUsage is used to indicate the usage information of a single network resource. It does not include the start and end time of the reporting interval. The data reported to the server by default falls in the current statistics window of the server.
  • ResourceUsage reports the dynamicQuota of the server calculation received by the server's dynamicQuota client last time.
  • RequestPackage is used to represent the summary of multiple network resource usage information
  • agentIP and agentProcessID in the RequestPackage are used to identify the information of the reported client.
  • the network resources will be divided according to certain rules, and the resources falling in the same interval will be marked in the same data packet, all clients and servers.
  • the same division rule is shared, for example, the resource identifier is divided according to the resource identifier (resourceID), for example, the resourceID is [0, 99] and is marked as one data packet, and the resourceID is [100, 199] into another data packet. If the resources in the same data packet in the client are not used during the packaging time interval, the client will package the first network resource usage information that falls in the data packet, and the resource usage quota is 0. .
  • the server calculates, according to the network resource usage information reported by the client, that the client can currently use the network.
  • the dynamic usage limit of the resource is the dynamic usage limit of the resource.
  • the server counts the active use of a certain network resource (for example, any one of the resources a, b, c, and d) within a certain period according to the identifier information (agentProcessID) of the client in the data packet reported by the client.
  • agentProcessID the identifier information of the client in the data packet reported by the client.
  • DefaultQuota indicates the default usage limit of the network resources preset by the client.
  • aliveAgentCount indicates the number of active clients in a period of time.
  • ImpactFactor is a preset constant, which is usually used to amplify the calculation result.
  • the server returns a response message for using the network resource to the client.
  • the server when it is found that the dynamicQuota reported by the client is inconsistent with the dynamicQuot calculated by the server, the dynamicQuota calculated by the server is sent back to the client.
  • the client is sent the client to disable the use of the network resource.
  • the data structure of the server's response message is as follows:
  • Int32_t resourceID indicates the network resource number
  • Uint64_t disableDuration indicates the length of time that the network resource will be disabled, that is, the length of time that the client prohibits the use of the network resource.
  • Uint64_t dynamicQuota indicates the server's latest calculated dynamic usage limit
  • steps 503 and/or 504 are included:
  • the client according to the disabled duration included in the response message sent by the server, adds the current time plus the disabled duration as the time when the resource is disabled.
  • the client updates the local dynamic usage quota according to the dynamic usage limit included in the response message sent by the server.
  • dynamicQuota when the server crashes, the client will use the dynamicQuota sent by the server as the temporary resource usage limit of the client.
  • the advantage of using dynamicQuota is to prevent users from abusing resources when the server crashes, and to greatly guarantee the user experience.
  • the client is often the front-end machine, and the server is in the same cluster, and the resource quota is controlled at the minute level, so the network delay can be ignored.
  • the purpose of using disableDuration is to prevent inaccurate control caused by unsynchronized client and server time.
  • the server first updates the number of active clients according to the received data reported by the client, and the statistics of the active clients are based on different client identification information (such as agentIP, agentProcessID) in a certain period of time. Then the server updates the usage of the network resources, and calculates the dynamic usage quota (dynamicQuota) of each network resource used by each client. If the client uses the network resource to exceed the dynamic usage quota, the client is prohibited from using the network resource. The duration, in addition, if the calculated dynamic usage limit of one of the clients is inconsistent with the dynamic usage quota reported by the client, the calculated dynamic usage quota (dynamicQuota) and the disabled duration information are returned to the client together.
  • client identification information such as agentIP, agentProcessID
  • the embodiment of the present invention solves the problem that the use of the limit control is inaccurate due to the asynchronous and non-synchronized time of the server and the client by returning the disabled duration and the data reported by the default report on the current statistical window of the server.
  • FIG. 6 is a schematic structural diagram of a device for controlling a usage limit of a network resource according to an embodiment of the present application, where the client is located, as shown in FIG. 6, and includes:
  • the statistics module 61 is configured to collect the usage quota of the network resource in the current interval time t;
  • the sending module 62 is configured to send, to the server, information about the usage quota of the network resource used by the statistics module during the current interval time t at the end of the current interval time t, so that the server determines the current time of the client.
  • the first dynamic usage quota of the network resource is used, and if it is determined that the usage quota of the network resource used by the client in the current interval time t is greater than the first dynamic usage quota, sending the network resource to the client Disabled time;
  • the receiving module 63 is configured to receive a disabled duration of the network resource sent by the server;
  • the disabling module 64 is configured to prohibit use of the network resource within the disabled duration from the moment of receiving the disabled duration according to the disabled duration.
  • the sending module 61 is further configured to send, to the server, a second dynamic usage quota of the network usage resource of the client, when the current interval time t ends, where the second dynamic usage quota is the server Calculating, by the end of an interval t, the dynamic usage quota of the network resource by the client, so that the server, when determining that the second dynamic usage quota is inconsistent with the first dynamic usage quota, to the client Sending the first dynamic usage limit;
  • the receiving module 63 is further configured to receive the first dynamic usage quota sent by the server;
  • the device also includes:
  • the update module 65 is configured to update, according to the first dynamic usage quota received by the receiving module 63, the second dynamic usage quota of the network resource by the client to the first dynamic usage quota.
  • the device further includes:
  • the setting module 66 is configured to: when the current interval time t ends, the statistics module 61 collects the usage quota of the used network resource after the current interval time t is used, and sets the usage quota of the used network resource to zero.
  • the disabling module 64 is configured to set, according to the disabled duration of the network resource sent by the server, a time for receiving the disabled duration as a forbidden start time for prohibiting use of the network resource, where The time when the prohibition start time starts at the end of the disable duration is set to prohibit the use of the network resource's prohibition end time.
  • the device further includes:
  • the determining module 67 is configured to use the network resource and determine the use of the network resource if the current time is after the forbidden end time of the network resource, when the network resource is used in the next interval time t The quota; if it is determined that the current time is before the prohibition end time of the network resource, the use of the network resource is prohibited.
  • the apparatus described in the embodiment shown in FIG. 6 can be used to perform the method described in the embodiment shown in FIG. 1 and FIG. 2, and the implementation principle and technical effects are not described again.
  • FIG. 7 is a schematic structural diagram of a device for controlling a usage limit of a network resource according to an embodiment of the present application.
  • the server is located on the server, as shown in FIG. 7, and includes:
  • the receiving module 71 is configured to receive, by the client, information about the usage quota of the network resource used by the client during the current interval time t;
  • a determining module 72 configured to determine a first dynamic usage limit of the network resource used by the client at a current time
  • the determining module 73 is configured to determine whether the usage quota of the network resource used by the client in the current interval time t is greater than the first dynamic usage quota;
  • the sending module 74 is configured to: when the determining module 73 determines that the usage quota of the network resource used by the client in the current interval time t is greater than the first dynamic usage quota, send the network resource to the client Disabling the duration; in order for the client to disable the use of the network resource within the disabled duration from the moment of receiving the disabled duration according to the disabled duration of the network resource sent by the server.
  • the determining module 72 is specifically configured to:
  • the information about the usage quota of the network resource that is sent by the client and the other client that is received by the current time where the information carries the identifier information of the client and the other client, and determines that the current usage is The number of clients of network resources;
  • the determining module 72 is specifically configured to:
  • the DefaultQuota indicates that the client presets a default quota for using the network resource
  • the aliveAgentCount indicates the number of clients currently using the network resource
  • ImpactFactor is a preset constant.
  • the receiving module 71 is further configured to receive, by the client, a second dynamic usage quota of the network usage resource of the client that is sent to the server by the end of the current interval t, the second dynamic The usage limit is a dynamic usage limit of the client using network resources calculated by the server at the end of the last interval t;
  • the determining module 73 is further configured to determine whether the second dynamic usage quota is consistent with the first dynamic usage quota
  • the sending module 74 is further configured to: when the determining module determines that the second dynamic usage quota is inconsistent with the first dynamic usage quota, send the first dynamic usage quota to the client;
  • the client updates the second dynamic usage quota of the network resource by the client to the first dynamic usage quota according to the first dynamic usage quota sent by the server.
  • the apparatus described in the embodiment shown in FIG. 7 can be used to perform the method described in the embodiments shown in FIG. 3 and FIG. 4, and the implementation principle and technical effects are not described again.
  • FIG. 8 is a schematic structural diagram of a control system for a network resource usage quota according to an embodiment of the present application, as shown in FIG. 8, including: a client 81 and a server 82;
  • the client 81 includes a control device for using a network resource as described in the embodiment shown in FIG. 6;
  • the server 82 includes control means for the usage quota of the network resources as described in the embodiment shown in FIG. 6.
  • the system described in the embodiment shown in FIG. 8 can be used to perform the method described in any of the embodiments of FIG. 1 to FIG. 5, and the implementation principle and technical effects are not described again.
  • a method for controlling a usage limit of a network resource, and a control device for using a network resource corresponding to the network resource are provided, and the application further provides a network resource for implementing the foregoing network resource.
  • FIG. 9 is a schematic diagram of an electronic device according to an embodiment of the present invention.
  • the description of the electronic device embodiment is relatively simple. For related parts, refer to the corresponding description of the foregoing method embodiment.
  • the described electronic device embodiments described below are merely illustrative.
  • the electronic device according to the embodiment of the present invention includes: a memory 91 and a processor 92;
  • the memory 91 stores an instruction for implementing a control method of the usage quota of the network resource
  • the processor 92 invokes an execution command in the memory 91 to perform the following steps:
  • the client uses the first dynamic usage quota of the network resource, and if it is determined that the usage quota of the network resource used by the client in the current interval time t is greater than the first dynamic usage quota, sending the network resource to the client Disabled duration;
  • processor 92 can also perform the following steps:
  • the terminal uses a dynamic usage quota of the network resource, so that the server sends the first dynamic usage quota to the client when determining that the second dynamic usage quota is inconsistent with the first dynamic usage quota;
  • the processor 92 invokes an execution command in the memory 91 to perform the following steps:
  • the client If it is determined that the usage quota of the network resource used by the client in the current interval t is greater than the first dynamic usage quota, sending a disable duration of the network resource to the client, so that the client is configured according to the Determining the length of time of the network resource sent by the server, starting from the moment of receiving the disabled duration, prohibiting the use of the network resource within the disabled duration.
  • processor 92 can also perform the following steps:
  • the system described in the embodiment shown in FIG. 9 can be used to perform the method described in any one of FIG. 1 to FIG. 5, and the implementation principle and technical effects are not described again.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)

Abstract

本申请公开了一种网络资源的使用限额的控制方法、装置和系统,其中,客户端统计当前间隔时间t内使用网络资源的使用额度;在当前间隔时间t结束时向服务器发送所述客户端在当前间隔时间t内使用网络资源的使用额度的信息;以使所述服务器确定当前时间所述客户端使用网络资源的第一动态使用限额,若确定所述客户端在当前间隔时间t内使用网络资源的使用额度大于所述第一动态使用限额,则向所述客户端发送所述网络资源的禁用时长;所述客户端接收所述服务器发送的所述网络资源的禁用时长,根据所述禁用时长,从接收所述禁用时长的时刻开始,在所述禁用时长内禁止使用所述网络资源。可以防止客户端和服务器时间不同步导致的网络资源的限额控制的不准确。

Description

一种网络资源的使用限额的控制方法、装置及系统
本申请要求2015年09月09日递交的申请号为201510571666.7发明名称为“一种网络资源的使用限额的控制方法、装置及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请属于互联网技术领域,具体地说,涉及一种网络资源的使用限额的控制方法、装置及系统。
背景技术
在分布式系统或多用户系统中,允许多个客户端共同使用网络系统资源,包括系统的内存,CPU和硬盘。在默认情况下,系统并不会限制每个客户端可以使用的系统资源的大小,所以如果客户端恶意使用系统资源,或客户端由于疏忽,将系统资源全部占用,将导致其他客户端无法使用系统资源,从而使系统性能下降,甚至有系统崩溃的危险。
为了限制网络系统资源的使用,从而有效的实现资源预留以及计量计费,通常可以启动限额服务进行网络系统资源限额的控制。现有技术中,通常对网络系统资源的限额采用局部或全局的控制方法,例如可以使用quota命令查看各个用户设备的当前资源使用情况。
发明人在实现本发明的过程中发现,现有技术中对网络系统资源的限额采用局部或全局的控制方法存在控制不精确的问题。
发明内容
有鉴于此,本申请提供一种网络资源的使用限额的控制方法、装置及系统,可以解决现有的网络资源限额的控制方法存在控制不精确的问题。
为了解决上述技术问题,本申请第一方面提供一种网络资源的使用限额的控制方法,包括:
客户端统计当前间隔时间t内使用网络资源的使用额度;
所述客户端在当前间隔时间t结束时向服务器发送所述客户端在当前间隔时间t内使用网络资源的使用额度的信息;以使所述服务器确定当前时间所述客户端使用网络资源的第一动态使用限额,若确定所述客户端在当前间隔时间t内使用网络资源的使用额度 大于所述第一动态使用限额,则向所述客户端发送所述网络资源的禁用时长;
所述客户端接收所述服务器发送的所述网络资源的禁用时长,根据所述禁用时长,从接收所述禁用时长的时刻开始,在所述禁用时长内禁止使用所述网络资源。
可选地,所述客户端统计当前间隔时间t内使用网络资源的使用额度之后,还包括:
所述客户端在当前间隔时间t结束时向所述服务器发送所述客户端使用网络资源的第二动态使用限额,所述第二动态使用限额为所述服务器在上一次间隔时间t结束时计算的所述客户端使用网络资源的动态使用限额;以使所述服务器在确定所述第二动态使用限额与所述第一动态使用限额不一致时,向所述客户端发送所述第一动态使用限额;
所述客户端根据所述服务器发送的所述第一动态使用限额,将所述客户端使用网络资源的第二动态使用限额更新为所述第一动态使用限额。
可选地,所述客户端统计当前间隔时间t内使用网络资源的使用额度之后,还包括:
在当前间隔时间t结束时,所述客户端将使用网络资源的使用额度设置为零。
可选地,所述客户端接收到所述服务器发送的所述网络资源的禁用时长之后,还包括:
所述客户端根据所述服务器发送的所述网络资源的禁用时长,将接收到所述禁用时长的时间设置为禁止使用所述网络资源的禁止起始时间,将所述禁止起始时间开始在所述禁用时长结束时的时间设置为禁止使用所述网络资源的禁止结束时间。
可选地,所述的方法还包括:
所述客户端在下一次间隔时间t内使用所述网络资源时,若确定当前时间在所述网络资源的禁止结束时间之后,则使用所述网络资源,并统计使用所述网络资源的使用额度;若确定当前时间在所述网络资源的禁止结束时间之前,则禁止使用所述网络资源。
本发明实施例还提供一种网络资源的使用限额的控制方法,包括:
服务器接收客户端发送的所述客户端在当前间隔时间t内使用网络资源的使用额度的信息;
所述服务器确定当前时间所述客户端使用网络资源的第一动态使用限额;
若确定所述客户端在当前间隔时间t内使用网络资源的使用额度大于所述第一动态使用限额,则向所述客户端发送所述网络资源的禁用时长;以使所述客户端根据所述服务器发送的所述网络资源的禁用时长,从接收所述禁用时长的时刻开始,在所述禁用时长内禁止使用所述网络资源。
可选地,所述服务器确定当前时间所述客户端使用网络资源的第一动态使用限额, 包括:
所述服务器根据当前时间接收的所述客户端和其他客户端发送的使用所述网络资源的使用额度的信息,所述信息中携带有所述客户端和所述其他客户端的标识信息,确定当前使用所述网络资源的客户端数量;
所述服务器根据所述客户端预设的使用所述网络资源的默认限额,以及当前使用所述网络资源的客户端数量,确定当前时间所述客户端使用网络资源的第一动态使用限额。
可选地,所述服务器根据所述客户端预设的使用所述网络资源的默认限额,以及当前使用所述网络资源的客户端数量,确定当前时间所述客户端使用网络资源的第一动态使用限额,包括:
根据计算公式:
Figure PCTCN2016097496-appb-000001
确定当前时间所述客户端使用网络资源的第一动态使用限额;
其中,DefaultQuota表示所述客户端预设的使用所述网络资源的默认限额,aliveAgentCount表示当前使用所述网络资源的客户端数量,ImpactFactor是预设的常量。
可选地,服务器接收客户端发送的所述客户端在当前间隔时间t内使用网络资源的使用额度的信息之后,则所述方法还包括:
所述服务器接收所述客户端在当前间隔时间t结束时向所述服务器发送的所述客户端使用网络资源的第二动态使用限额,所述第二动态使用限额为所述服务器在上一次间隔时间t结束时计算的所述客户端使用网络资源的动态使用限额;
所述服务器在确定所述第二动态使用限额与所述第一动态使用限额不一致时,向所述客户端发送所述第一动态使用限额;以使所述客户端根据所述服务器发送的所述第一动态使用限额,将所述客户端使用网络资源的第二动态使用限额更新为所述第一动态使用限额。
本发明实施例还提供一种网络资源的使用限额的控制装置,位于客户端,包括:
统计模块,用于统计当前间隔时间t内使用网络资源的使用额度;
发送模块,用于在当前间隔时间t结束时向服务器发送所述客户端在当前间隔时间t内使用网络资源的使用额度的信息;以使所述服务器确定当前时间所述客户端使用网络资源的第一动态使用限额,若确定所述客户端在当前间隔时间t内使用网络资源的使用额度大于所述第一动态使用限额,则向所述客户端发送所述网络资源的禁用时长;
接收模块,用于接收所述服务器发送的所述网络资源的禁用时长;
禁用模块,用于根据所述禁用时长,从接收所述禁用时长的时刻开始,在所述禁用时长内禁止使用所述网络资源。
可选地,所述发送模块,还用于在当前间隔时间t结束时向所述服务器发送所述客户端使用网络资源的第二动态使用限额,所述第二动态使用限额为所述服务器在上一次间隔时间t结束时计算的所述客户端使用网络资源的动态使用限额;以使所述服务器在确定所述第二动态使用限额与所述第一动态使用限额不一致时,向所述客户端发送所述第一动态使用限额;
所述接收模块,还用于接收服务器发送的所述第一动态使用限额;
所述装置还包括:
更新模块,用于根据所述接收模块接收的所述第一动态使用限额,将所述客户端使用网络资源的第二动态使用限额更新为所述第一动态使用限额。
可选地,所述的装置还包括:
设置模块,用于在当前间隔时间t结束时,将使用网络资源的使用额度设置为零。
可选地,所述禁用模块,具体用于根据所述服务器发送的所述网络资源的禁用时长,将接收到所述禁用时长的时间设置为禁止使用所述网络资源的禁止起始时间,将所述禁止起始时间开始在所述禁用时长结束时的时间设置为禁止使用所述网络资源的禁止结束时间。
可选地,所述的装置还包括:
判断模块,用于在下一次间隔时间t内使用所述网络资源时,若确定当前时间在所述网络资源的禁止结束时间之后,则使用所述网络资源,并统计使用所述网络资源的使用额度;若确定当前时间在所述网络资源的禁止结束时间之前,则禁止使用所述网络资源。
本发明实施例还提供一种网络资源的使用限额的控制装置,位于服务器,包括:
接收模块,用于接收客户端发送的所述客户端在当前间隔时间t内使用网络资源的使用额度的信息;
确定模块,用于确定当前时间所述客户端使用网络资源的第一动态使用限额;
判断模块,用于确定所述客户端在当前间隔时间t内使用网络资源的使用额度是否大于所述第一动态使用限额;
发送模块,用于在所述判断模块确定所述客户端在当前间隔时间t内使用网络资源 的使用额度大于所述第一动态使用限额时,向所述客户端发送所述网络资源的禁用时长;以使所述客户端根据所述服务器发送的所述网络资源的禁用时长,从接收所述禁用时长的时刻开始,在所述禁用时长内禁止使用所述网络资源。
可选地,所述确定模块具体用于:
根据当前时间接收的所述客户端和其他客户端发送的使用所述网络资源的使用额度的信息,所述信息中携带有所述客户端和所述其他客户端的标识信息,确定当前使用所述网络资源的客户端数量;
根据所述客户端预设的使用所述网络资源的默认限额,以及当前使用所述网络资源的客户端数量,确定当前时间所述客户端使用网络资源的第一动态使用限额。
可选地,所述确定模块具体用于:
根据计算公式:
Figure PCTCN2016097496-appb-000002
确定当前时间所述客户端使用网络资源的第一动态使用限额;
其中,DefaultQuota表示所述客户端预设的使用所述网络资源的默认限额,aliveAgentCount表示当前使用所述网络资源的客户端数量,ImpactFactor是预设的常量。
可选地,所述接收模块,还用于接收所述客户端在当前间隔时间t结束时向所述服务器发送的所述客户端使用网络资源的第二动态使用限额,所述第二动态使用限额为所述服务器在上一次间隔时间t结束时计算的所述客户端使用网络资源的动态使用限额;
所述判断模块,还用于确定所述第二动态使用限额与所述第一动态使用限额是否一致;
所述发送模块,还用于在所述判断模块确定所述第二动态使用限额与所述第一动态使用限额不一致时,向所述客户端发送所述第一动态使用限额;以使所述客户端根据所述服务器发送的所述第一动态使用限额,将所述客户端使用网络资源的第二动态使用限额更新为所述第一动态使用限额。
本发明实施例还提供一种网络资源的使用限额的控制系统,包括:客户端和服务器;
所述客户端包括上述的网络资源的使用限额的控制装置;
所述服务器包括上述的网络资源的使用限额的控制装置。
由于本发明实施例服务器的对网络资源限额的控制的时间窗口大小w远远大于客户端统计使用网络资源的使用情况的间隔时间为t,使得客户端默认汇报上来的数据都落在服务器当前对网络资源限额的控制的时间窗口,且本发明实施例采用的是从客户端接收所述禁用时长的时刻开始在所述禁用时长内禁止使用所述网络资源,而不是根据服务器下发资源禁用命令的时间作为禁止使用所述网络资源的参考,因此,即使在客户端和服务器时间不同步的时候,也可以有效地对网络资源的限额进行精确地控制;因此可以防止客户端和服务器时间不同步导致的网络资源的限额控制的不准确。
进一步地,本发明实施例中,服务器在接收到客户端汇报的网络资源使用额度的信息时,确定当前时间所述客户端使用网络资源的第一动态使用限额,然后,将客户端使用网络资源的使用额度与当前确定的第一动态使用限额进行比较,在确定所述客户端在当前间隔时间t内使用网络资源的使用额度大于所述第一动态使用限额时,才向所述客户端发送所述网络资源的禁用时长。由于第一动态使用限额是服务器根据当前所有使用网络资源的客户端和其他客户端的数量(也可以称为当前使用网络资源的活跃的客户端数量),以及该客户端预设的使用所述网络资源的默认限额,计算的所述客户端使用网络资源的第一动态使用限额,该第一动态使用限额可以有效合理地分配各客户端使用网络资源,不会导致网络资源分配不精确造成网络资源的浪费问题。
附图说明
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:
图1是本申请实施例的一种网络资源的使用限额的控制方法的流程示意图;
图2是本申请实施例的一种网络资源的使用限额的控制方法的流程示意图;
图3是本申请实施例的一种网络资源的使用限额的控制方法的流程示意图;
图4是本申请实施例的一种网络资源的使用限额的控制方法的流程示意图;
图5是本申请实施例的一种网络资源的使用限额的控制方法的流程示意图;
图6是本申请实施例的一种网络资源的使用限额的控制装置的结构示意图;
图7是本申请实施例的一种网络资源的使用限额的控制装置的结构示意图;
图8是本申请实施例的一种网络资源的使用限额的控制系统的结构示意图;
图9为本发明实施例提供的一种电子设备示意图。
具体实施方式
以下将配合附图及实施例来详细说明本申请的实施方式,藉此对本申请如何应用技术手段来解决技术问题并达成技术功效的实现过程能充分理解并据以实施。
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括非暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
如在说明书及权利要求当中使用了某些词汇来指称特定组件。本领域技术人员应可理解,硬件制造商可能会用不同名词来称呼同一个组件。本说明书及权利要求并不以名称的差异来作为区分组件的方式,而是以组件在功能上的差异来作为区分的准则。如在通篇说明书及权利要求当中所提及的“包含”为一开放式用语,故应解释成“包含但不限定于”。“大致”是指在可接收的误差范围内,本领域技术人员能够在一定误差范围内解决所述技术问题,基本达到所述技术效果。此外,“耦接”一词在此包含任何直接及间接的电性耦接手段。因此,若文中描述一第一装置耦接于一第二装置,则代表所述第一装置可直接电性耦接于所述第二装置,或通过其他装置或耦接手段间接地电性耦接至所述第二装置。说明书后续描述为实施本申请的较佳实施方式,然所述描述乃以说明本申请的一般原则为目的,并非用以限定本申请的范围。本申请的保护范围当视所附权利要求所界定者为准。
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的商品或者系统不仅包括那些要素,而且还包括没有 明确列出的其他要素,或者是还包括为这种商品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的商品或者系统中还存在另外的相同要素。
发明人在实现本发明的过程中发现现有技术中,大部分系统(如分布式系统或多用户系统)通常对网络资源限额采用局部或全局的控制方法,其中,局部控制方法就是将网络资源限额按照一定规则划分给用户,每个用户有自己的资源限额。局部控制方法会给用户带来不便,因为用户对资源消费速度不一样,有些用户将分配给自己的资源消费完了,有些用户很可能还剩余大量资源没有消费,这就导致资源分配不精确会造成资源的费问题。
全局控制方法一般是服务器维护用户配置的每分钟资源使用上限,但是,全局控制方法会重度依赖服务器和客户端之间的时间同步,即客户端汇报到服务器的资源使用情况会严格要求落在服务器资源统计的时间窗口内,否则汇报上来的数据会被裁减或者丢弃。此外,服务器下发资源禁用命令是以服务器的时间作为参考的,如果客户端和服务器时间不同步也会带来网络资源限额控制不精确的问题。
为了解决现有技术中存在的网络资源限额控制不精确的问题,以及如何在系统时间不同步的应用场景中对网络资源限额进行控制,本发明实施例提供一种网络资源的使用限额的控制方法,本发明实施例所提供的方法可以应用于分布式系统或多用户系统中,其中,每个客户端以间隔时间t将各种资源的使用情况打包向服务器汇报,服务器汇总各客户端汇报上来的资源使用情况,计算每个客户端使用每一种资源的动态限额,并校验该客户端汇报的该种资源使用情况是否超过计算的该种资源的动态使用限额,如果超过,则返回的响应中会带上对该种超限资源的禁用命令,禁用命令中包含该客户端对该种资源禁用的时长,该客户端收到禁用命令后,对于超限的资源,将当前时间加上禁用时长作为禁用到的时刻。
由此可知,本发明实施例采用的是从客户端接收禁用时长的时刻开始在禁用时长内禁止使用所述网络资源,而不是根据服务器下发资源禁用命令的时间作为禁止使用网络资源的参考,因此,即使在客户端和服务器时间不同步的时候,也可以有效地对网络资源的限额进行精确地控制;因此可以防止客户端和服务器时间不同步导致的网络资源的限额控制的不准确。
进一步地,由于动态使用限额是服务器根据当前所有使用某一种网络资源的客户端的数量(也可以称为当前使用网络资源的活跃的客户端数量),以及每个客户端预设的 使用某一种网络资源的默认限额,计算的每个客户端使用该种网络资源的动态使用限额,该动态使用限额可以有效合理地分配各客户端使用网络资源,不会导致网络资源分配不精确造成网络资源的浪费问题。
需要说明的是,本发明实施例中服务器的对网络资源限额的控制的时间窗口大小为w,客户端统计使用网络资源的使用情况的间隔时间为t,其中,w远远大于t,使得客户端默认汇报上来的数据都落在服务器当前对网络资源限额的控制的时间窗口。
图1是本申请实施例的一种网络资源的使用限额的控制方法的流程示意图,所述方法位于客户端执行,如图1所示,包括:
101、客户端统计当前间隔时间t内使用网络资源的使用额度;
具体地,本发明实施例中,例如,客户端在每一个间隔时间t内需要统计使用网络资源的使用情况信息(如使用额度)。又如,在当前间隔时间t结束时,所述客户端将使用网络资源的使用额度设置为零。
具体地,针对每种资源,客户端都有一个统计的时间窗口,该窗口时间区间内到达的客户端请求所消耗的网络资源会被累计到时间窗口中,假设时间窗口是W,W时间内,客户端会多次向服务端汇报网络资源使用情况,汇报间隔t远小于W。
102、客户端在当前间隔时间t结束时向服务器发送所述客户端在当前间隔时间t内使用网络资源的使用额度的信息;以使所述服务器确定当前时间所述客户端使用网络资源的第一动态使用限额,若确定所述客户端在当前间隔时间t内使用网络资源的使用额度大于所述第一动态使用限额,则向所述客户端发送所述网络资源的禁用时长;
具体地,例如,客户端中设置有打包计时器,在每一个间隔时间t结束时,触发打包计时器信号,这样,客户端将步骤101中统计的在间隔时间t内使用网络资源的使用额度的信息进行打包,其中,打包的信息中携带有该网络资源的标识、客户端的标识,该客户端使用网络资源的使用额度等情况。
对应地,服务器接收到客户端发送的使用所述网络资源的使用额度的信息,通常,在实际应用场景中,在客户端使用该网络资源的同时,其他客户端也可以使用该网络资源,因此,服务器根据当前时间接收的所述客户端和其他客户端发送的使用所述网络资源的使用额度的信息,所述信息中携带有所述客户端和所述其他客户端的标识信息,确定当前使用所述网络资源的客户端数量;
进一步地,服务器根据所述客户端预设的使用所述网络资源的默认限额,以及当前使用所述网络资源的客户端数量,确定当前时间所述客户端使用网络资源的第一动态使 用限额;其中,客户端预设的使用所述网络资源的默认限额例如可以保存在数据库中,客户端和服务端可以共享该数据库,服务器和客户端都可以从数据库中获取客户端预设的使用所述网络资源的默认限额。
进一步地,服务器在确定所述客户端在当前间隔时间t内使用网络资源的使用额度大于所述第一动态使用限额,则向所述客户端发送所述网络资源的禁用时长。其中,服务器会有一个第一动态使用限额的统计窗口,一般是一分钟,如果统计窗口区间内某一时刻,网络资源使用超过第一动态使用限额,之后到达的请求申请该网络资源会被禁用,禁用时长为统计窗口末端时刻减去当前时刻。
103、客户端接收所述服务器发送的所述网络资源的禁用时长,根据所述禁用时长,从接收所述禁用时长的时刻开始,在所述禁用时长内禁止使用所述网络资源。
具体实现时,举例来说,所述客户端根据所述服务器发送的所述网络资源的禁用时长,将接收到所述禁用时长的时间设置为禁止使用所述网络资源的禁止起始时间,将所述禁止起始时间开始在所述禁用时长结束时的时间设置为禁止使用所述网络资源的禁止结束时间。
进一步地举例来说,当所述客户端在下一次间隔时间t内使用所述网络资源时,若确定当前时间在所述网络资源的禁止结束时间之后,则使用所述网络资源,并统计使用所述网络资源的使用额度;若确定当前时间在所述网络资源的禁止结束时间之前,则禁止使用所述网络资源。
由于本发明实施例服务器的对网络资源限额的控制的时间窗口大小w远远大于客户端统计使用网络资源的使用情况的间隔时间为t,使得客户端默认汇报上来的数据都落在服务器当前对网络资源限额的控制的时间窗口,且本发明实施例采用的是从客户端接收所述禁用时长的时刻开始在所述禁用时长内禁止使用所述网络资源,而不是根据服务器下发资源禁用命令的时间作为禁止使用所述网络资源的参考,因此,即使在客户端和服务器时间不同步的时候,也可以有效地对网络资源的限额进行精确地控制;因此可以防止客户端和服务器时间不同步导致的网络资源的限额控制的不准确。
进一步地,本发明实施例中,服务器在接收到客户端汇报的网络资源使用额度的信息时,确定当前时间所述客户端使用网络资源的第一动态使用限额,然后,将客户端使用网络资源的使用额度与当前确定的第一动态使用限额进行比较,在确定所述客户端在当前间隔时间t内使用网络资源的使用额度大于所述第一动态使用限额时,才向所述客户端发送所述网络资源的禁用时长。由于第一动态使用限额是服务器根据当前所有使用 网络资源的客户端和其他客户端的数量(也可以称为当前使用网络资源的活跃的客户端数量),以及该客户端预设的使用所述网络资源的默认限额,计算的所述客户端使用网络资源的第一动态使用限额,该第一动态使用限额可以有效合理地分配各客户端使用网络资源,不会导致网络资源分配不精确造成网络资源的浪费问题。
图2是本申请实施例的一种网络资源的使用限额的控制方法的流程示意图,所述方法位于客户端执行,如图2所示,包括:
201、客户端统计当前间隔时间t内使用网络资源的使用额度;
具体实现参考图1所示实施例中的步骤101的详细内容。
202、客户端在当前间隔时间t结束时向服务器发送所述客户端使用网络资源的第二动态使用限额,所述第二动态使用限额为所述服务器在上一次间隔时间t结束时计算的所述客户端使用网络资源的动态使用限额;以使服务器在确定所述第二动态使用限额与所述第一动态使用限额不一致时,向所述客户端发送所述第一动态使用限额。
举例来说,所述客户端在上一次间隔时间t结束时(如T1时刻),向服务器发送了所述客户端在上一次间隔时间t内使用所述网络资源的使用额度的信息,服务器在T1时刻接收到所述客户端在上一次间隔时间t内使用所述网络资源的使用额度的信息,在T1时刻统计使用所述网络资源的所述客户端和其他客户端的数量(即T1时刻使用所述网络资源的活跃的客户端数量),结合所述客户端预设的使用所述网络资源的默认限额,计算T1时刻所述客户端使用所述网络资源的动态使用限额(即第二动态使用限额,在上一次间隔时间t结束时所述客户端使用网络资源的动态使用限额);
所述客户端在当前间隔时间t结束时(即当前时间为T2时刻),向服务器发送了所述客户端在当前间隔时间t内使用所述网络资源的使用额度的信息,服务器在当前时间T2时刻接收到所述客户端在当前间隔时间t内使用所述网络资源的使用额度的信息,在当前时间T2时刻统计使用所述网络资源的所述客户端和其他客户端的数量(即当前时间T2时刻使用所述网络资源的活跃的客户端数量),结合所述客户端预设的使用所述网络资源的默认限额,计算当前时间T2时刻所述客户端使用所述网络资源的动态使用限额(即第一动态使用限额;
之后,当服务器在确定所述第二动态使用限额与所述第一动态使用限额不一致时,向所述客户端发送所述第一动态使用限额,即客户端当前时间为T2时刻(当前间隔时间t结束时)从服务器中接收到的使用所述网络资源的动态使用限额;
203、客户端根据所述服务器发送的所述第一动态使用限额,将所述客户端使用网络 资源的第二动态使用限额更新为所述第一动态使用限额。
也就是说,第一动态使用限额是客户端当前时间从服务器处接收到的所述客户端使用所述网络资源的动态使用限额;相对地,第二动态使用限额为客户端上一次从服务器处接收到的所述客户端使用所述网络资源的动态使用限额;当客户端比较第一动态使用限额和第二动态使用限额,若确定二者不一致,则将第二动态使用限额更新为所述第一动态使用限额。
需要说明的是,客户端使用所述网络资源的动态使用限额是动态变化的原因,是因为在每段时间使用所述网络资源的客户端数量是变化的,服务器每隔一段时间重新计算客户端使用网络资源的动态使用限额也是为了可以有效合理地分配各客户端使用网络资源,不会导致网络资源分配不精确造成网络资源的浪费问题。
由于本发明实施例中,服务器在接收到客户端发送的使用网络资源的使用额度的信息时,都会重新计算接收到使用信息的时刻(即当前时间)客户端使用网络资源的动态使用限额,其中,动态使用限额的作用是当系统崩溃时,客户端会将最新一次收到服务器发送的动态使用限额将作为客户端使用网络资源的临时资源使用限额,可以防止用户在系统崩溃时滥用网络资源,保证用户的网络资源使用体验。
图3是本申请实施例的一种网络资源的使用限额的控制方法的流程示意图,所述方法位于服务器执行,如图3所示,包括:
301、服务器接收客户端发送的所述客户端在当前间隔时间t内使用网络资源的使用额度的信息;
例如,客户端在每一个间隔时间t内需要统计使用网络资源的使用情况信息(如使用额度)。又如,客户端中设置有打包计时器,在每一个间隔时间t结束时,触发打包计时器信号,这样,客户端将统计的在间隔时间t内使用网络资源的使用额度的信息进行打包,其中,打包的信息中携带有该网络资源的标识、客户端的标识,该客户端使用网络资源的使用额度等情况。
对应地,因此,服务器根据当前时间接收的所述客户端和其他客户端发送的使用所述网络资源的使用额度的信息,所述信息中携带有所述客户端和所述其他客户端的标识信息,确定当前使用所述网络资源的客户端数量。
302、服务器确定当前时间所述客户端使用网络资源的第一动态使用限额;
通常,在实际应用场景中,在客户端使用该网络资源的同时,其他客户端也可以使用该网络资源,因此,服务器接收到客户端发送的使用所述网络资源的使用额度的信息 之后,服务器例如可以根据当前时间接收的所述客户端和其他客户端发送的使用所述网络资源的使用额度的信息,所述信息中携带有所述客户端和所述其他客户端的标识信息,确定当前使用所述网络资源的客户端数量;
进一步地,服务器根据所述客户端预设的使用所述网络资源的默认限额,以及当前使用所述网络资源的客户端数量,确定当前时间所述客户端使用网络资源的第一动态使用限额。具体例如可以根据计算公式:
Figure PCTCN2016097496-appb-000003
确定当前时间所述客户端使用网络资源的第一动态使用限额;
其中,DefaultQuota表示所述客户端预设的使用所述网络资源的默认限额;
aliveAgentCount表示当前使用所述网络资源的客户端数量;
ImpactFactor是预设的常量,这个常量是经验值,一般大于1,作用是放大计算结果。例如,在服务器宕机的情况下,会将DefaultQuota均分到活跃的客户端(aliveAgent)上,但是落在哪一个客户端上可能是不均匀的,为了保证服务质量,每个aliveAgent上分配的资源会放大一点。
303、若确定所述客户端在当前间隔时间t内使用网络资源的使用额度大于所述第一动态使用限额,则向所述客户端发送所述网络资源的禁用时长;以使所述客户端根据所述服务器发送的所述网络资源的禁用时长,从接收所述禁用时长的时刻开始,在所述禁用时长内禁止使用所述网络资源。
举例来说,客户端根据所述服务器发送的所述网络资源的禁用时长,将接收到所述禁用时长的时间设置为禁止使用所述网络资源的禁止起始时间,将所述禁止起始时间开始在所述禁用时长结束时的时间设置为禁止使用所述网络资源的禁止结束时间。
进一步地举例来说,当所述客户端在下一次间隔时间t内使用所述网络资源时,若确定当前时间在所述网络资源的禁止结束时间之后,则使用所述网络资源,并统计使用所述网络资源的使用额度;若确定当前时间在所述网络资源的禁止结束时间之前,则禁止使用所述网络资源。
本发明实施例采用的是从客户端接收所述禁用时长的时刻开始在所述禁用时长内禁止使用所述网络资源,而不是根据服务器下发资源禁用命令的时间作为禁止使用所述网络资源的参考,因此,即使在客户端和服务器时间不同步的时候,也可以有效地对网络资源的限额进行精确地控制;因此可以防止客户端和服务器时间不同步导致的网络资源 的限额控制的不准确。
进一步地,本发明实施例中,服务器在接收到客户端汇报的网络资源使用额度的信息时,确定当前时间所述客户端使用网络资源的第一动态使用限额,然后,将客户端使用网络资源的使用额度与当前确定的第一动态使用限额进行比较,在确定所述客户端在当前间隔时间t内使用网络资源的使用额度大于所述第一动态使用限额时,才向所述客户端发送所述网络资源的禁用时长。由于第一动态使用限额是服务器根据当前所有使用网络资源的客户端和其他客户端的数量(也可以称为当前使用网络资源的活跃的客户端数量),以及该客户端预设的使用所述网络资源的默认限额,计算的所述客户端使用网络资源的第一动态使用限额,该第一动态使用限额可以有效合理地分配各客户端使用网络资源,不会导致网络资源分配不精确造成网络资源的浪费问题。
图4是本申请实施例的一种网络资源的使用限额的控制方法的流程示意图,所述方法位于服务器执行,如图4所示,包括:
401、服务器接收客户端在当前间隔时间t结束时发送的所述客户端使用网络资源的第二动态使用限额,所述第二动态使用限额为所述服务器在上一次间隔时间t结束时计算的所述客户端使用网络资源的动态使用限额;
其中,第二动态使用限额的计算方法可以参考步骤402中第一动态使用限额的计算方法。
402、服务器确定当前时间所述客户端使用网络资源的第一动态使用限额;
举例来说,所述客户端在上一次间隔时间t结束时(如T1时刻),向服务器发送了所述客户端在上一次间隔时间t内使用所述网络资源的使用额度的信息,服务器在T1时刻接收到所述客户端在上一次间隔时间t内使用所述网络资源的使用额度的信息,在T1时刻统计使用所述网络资源的所述客户端和其他客户端的数量(即T1时刻使用所述网络资源的活跃的客户端数量),结合所述客户端预设的使用所述网络资源的默认限额,计算T1时刻所述客户端使用所述网络资源的动态使用限额(即第二动态使用限额,在上一次间隔时间t结束时所述客户端使用网络资源的动态使用限额);
所述客户端在当前间隔时间t结束时(即当前时间为T2时刻),向服务器发送了所述客户端在当前间隔时间t内使用所述网络资源的使用额度的信息,服务器在当前时间T2时刻接收到所述客户端在当前间隔时间t内使用所述网络资源的使用额度的信息,在当前时间T2时刻统计使用所述网络资源的所述客户端和其他客户端的数量(即当前时间T2时刻使用所述网络资源的活跃的客户端数量),结合所述客户端预设的使用所述网络 资源的默认限额,计算当前时间T2时刻所述客户端使用所述网络资源的动态使用限额(即第一动态使用限额;
进一步地,本实施例中,服务器例如可以根据计算公式:
Figure PCTCN2016097496-appb-000004
确定客户端使用网络资源的动态使用限额;
其中,DefaultQuota表示所述客户端预设的使用所述网络资源的默认限额,aliveAgentCount表示当前使用所述网络资源的客户端数量,ImpactFactor是预设的常量。
403、服务器在确定所述第二动态使用限额与所述第一动态使用限额不一致时,向所述客户端发送所述第一动态使用限额;以使所述客户端根据所述服务器发送的所述第一动态使用限额,将所述客户端使用网络资源的第二动态使用限额更新为所述第一动态使用限额。
由于本发明实施例中,服务器在接收到客户端发送的使用网络资源的使用额度的信息时,都会重新计算接收到使用信息的时刻(即当前时间)客户端使用网络资源的动态使用限额,其中,动态使用限额的作用是当系统崩溃时,客户端会将最新一次收到服务器发送的动态使用限额将作为客户端使用网络资源的临时资源使用限额,可以防止用户在系统崩溃时滥用网络资源,保证用户的网络资源使用体验。
下面通过具体的实施方式对本发明实施例所述的方法进行详细的描述。具体地,本发明分为客户端和服务器两部分,假设有a、b、c、d四种资源,分布式系统中会有多个客户端同时对a、b、c、d四种资源进行消费,客户端以间隔时间t将a、b、c、d四种资源的使用情况打包向服务器汇报,服务器汇总客户端汇报上来的资源使用情况,并校验客户端使用某种资源的情况是否超过服务器当前计算的该客户端使用该资源的动态使用限额,如果超过动态使用限额,则向该客户端返回的响应中会带上对该超限使用资源的禁用命令,禁用命令中包含该客户端对超限使用资源的禁用时长,客户端收到禁用命令后,对于超限使用的资源,将当前时间加上禁用时长作为禁用到的时刻。
图5是本申请实施例的一种网络资源的使用限额的控制方法的流程示意图,所述方法位于客户端和服务器执行,如图5所示,包括:
501、客户端向服务器汇报网络资源使用信息的消息。
其中,本实施例中,客户端是指分布式系统中的多个客户端中的其中一个客户端。网络资源使用信息中包括客户端的标识信息,网络资源的标识信息以及网络资源的使用额度等信息。
客户端汇报到服务器的有关网络资源使用信息的数据包的数据结构如下:
struct ResourceUsage
{
int32_t resourceID;表示网络资源编号;
uint64_t resourceUsage;表示资源在汇报时间间隔t内的使用情况;
uint64_t dynamicQuota;表示动态使用限额;
};
struct RequestPackage
{
List<ResourceUsage>resourceUsages;表示网络资源使用情况列表;
string agentIP;表示客户端IP地址;
int64_t agentProcessID;表示客户端进程;
};
其中,ResourceUsage用于表示单个网络资源的使用情况信息,不包含汇报间隔的起始和终止时刻,默认汇报到服务器的数据落在服务器的当前统计窗口中。
其中,ResourceUsage中汇报给服务器的dynamicQuota客户端上一次收到的服务器计算的dynamicQuota。
RequestPackage用于表示多个网络资源使用情况信息的汇总;
例如当同一台机器上可能会有多个客户端进程,因此,RequestPackage中agentIP和agentProcessID用于标识汇报的客户端的信息。
需要说明的是,客户端向服务器上报网络资源使用信息时,网络资源会被按照一定的规则划分,落在同一个区间内的资源会被打在同一个数据包中,所有的客户端、服务器共用同一个划分规则,比如按照资源标识(resourceID)进行数据包的划分,例如resourceID为[0,99]打成一个数据包,resourceID为[100,199]的打成另一个数据包。如果客户端内被打在同一个数据包中的资源在打包时间间隔内都没有被使用,客户端会将落在数据包中的第一个网络资源使用信息打包,这时资源使用额度为0。
502、服务器根据客户端汇报的网络资源使用信息,计算该客户端当前可以使用网络 资源的的动态使用限额。
具体地,服务器根据上述客户端汇报的数据包中的客户端的标识信息(agentProcessID),统计一定时间内使用某一网络资源(例如资源a、b、c、d中的任一资源)的活跃的客户端数量,并据此计算客户端当前可以使用的网络资源的动态使用限额(dynamicQuota)。
服务器计算dynamicQuota的计算公式如下:
Figure PCTCN2016097496-appb-000005
DefaultQuota表示客户端预设的网络资源默认的使用限额,aliveAgentCount表示一段时间内活跃的客户端数量,ImpactFactor是预设的常量,通常用于放大计算结果。
503、服务器向客户端返回网络资源使用的响应消息。
具体地,例如,服务器响应RequestPackage的消息中,当发现客户端汇报上来的dynamicQuota和服务器计算出的dynamicQuot不一致时,就会将服务器计算出的dynamicQuota发回给客户端。
又例如,服务器响应RequestPackage的消息中,当发现客户端在间隔时间t内使用网络资源的使用额度大于计算出的dynamicQuot,则向客户端发送该客户端禁止使用该网络资源的禁用时长;
举例来说,服务器的响应消息的数据结构如下:
struct ResourceResponse
{
int32_t resourceID;表示网络资源编号;
uint64_t disableDuration;表示网络资源将被禁用的时间长度,即表示客户端禁止使用该网络资源的禁用时长;
uint64_t dynamicQuota;表示服务器最新计算的动态使用限额;
};
struct ResponsePackage
{
List<ResourceResponse>responseList;表示响应列表
};
对应地,步骤503之后,包括步骤503和/或504:
504、客户端根据服务器发送的响应消息中包括的禁用时长,将当前时间加上禁用时长作为资源禁用到的时刻。
505、客户端根据服务器发送的响应消息中包括的动态使用限额,更新本地的动态使用限额。
需要说明的是,dynamicQuota的作用是当服务器崩溃,客户端会将服务器发送的dynamicQuota作为客户端临时的资源使用限额。使用dynamicQuota的好处是一方面防止用户在服务器崩溃时滥用资源,另一方面极大程度上保证用户的使用体验。
实际的应用场景中,客户端往往是前端机,和服务器在同一个集群,而资源限额的控制都是分钟级别的,因此网络延迟可以忽略。使用禁用时长(disableDuration)的目的是为了防止客户端和服务器时间不同步导致的控制不准确。
本发明实施例中,服务器根据收到的客户端汇报上来的数据,会首先更新活跃的客户端数量,活跃客户端的数量统计是基于一定时间内不同的客户端标识信息(如agentIP,agentProcessID),接着服务器更新网络资源的使用情况,计算每个客户端使用各个网络资源的动态使用限额(dynamicQuota),如果有客户端使用网络资源超过动态使用限额,则计算该客户端禁止使用该网络资源的禁用时长,除此以外,如果发现计算的某一个客户端的动态使用限额和该客户端汇报上来的动态使用限额不一致,会将计算的动态使用限额(dynamicQuota)和禁用时长信息一起返回给该客户端。
综上所述,本发明实施例通过返回禁用时长以及默认汇报上来的数据落在服务器当前统计窗口的方法,解决了服务器和客户端时间不同步导致使用限额控制不精确的问题,同事实时动态地计算动态使用限额(dynamicQuota)并将该计算的动态使用限额返回给客户端,解决了服务器崩溃会导致的资源滥用的问题。
图6是本申请实施例的一种网络资源的使用限额的控制装置的结构示意图,位于客户端,如图6所示,包括:
统计模块61,用于统计当前间隔时间t内使用网络资源的使用额度;
发送模块62,用于在当前间隔时间t结束时向服务器发送所述统计模块统计的客户端在当前间隔时间t内使用网络资源的使用额度的信息;以使所述服务器确定当前时间所述客户端使用网络资源的第一动态使用限额,若确定所述客户端在当前间隔时间t内使用网络资源的使用额度大于所述第一动态使用限额,则向所述客户端发送所述网络资源的禁用时长;
接收模块63,用于接收所述服务器发送的所述网络资源的禁用时长;
禁用模块64,用于根据所述禁用时长,从接收所述禁用时长的时刻开始,在所述禁用时长内禁止使用所述网络资源。
可选地,发送模块61,还用于在当前间隔时间t结束时向所述服务器发送所述客户端使用网络资源的第二动态使用限额,所述第二动态使用限额为所述服务器在上一次间隔时间t结束时计算的所述客户端使用网络资源的动态使用限额;以使所述服务器在确定所述第二动态使用限额与所述第一动态使用限额不一致时,向所述客户端发送所述第一动态使用限额;
接收模块63,还用于接收服务器发送的所述第一动态使用限额;
所述装置还包括:
更新模块65,用于根据所述接收模块63接收的所述第一动态使用限额,将所述客户端使用网络资源的第二动态使用限额更新为所述第一动态使用限额。
可选地,所述的装置还包括:
设置模块66,用于在当前间隔时间t结束时,统计模块61统计当前间隔时间t内使用网络资源的使用额度之后,将使用网络资源的使用额度设置为零。
可选地,禁用模块64,具体用于根据所述服务器发送的所述网络资源的禁用时长,将接收到所述禁用时长的时间设置为禁止使用所述网络资源的禁止起始时间,将所述禁止起始时间开始在所述禁用时长结束时的时间设置为禁止使用所述网络资源的禁止结束时间。
可选地,所述的装置还包括:
判断模块67,用于在下一次间隔时间t内使用所述网络资源时,若确定当前时间在所述网络资源的禁止结束时间之后,则使用所述网络资源,并统计使用所述网络资源的使用额度;若确定当前时间在所述网络资源的禁止结束时间之前,则禁止使用所述网络资源。
图6所示实施例所述的装置可以用于执行图1和图2所示实施例所述的方法,其实现原理和技术效果不再赘述。
图7是本申请实施例的一种网络资源的使用限额的控制装置的结构示意图,位于服务器,如图7所示,包括:
接收模块71,用于接收客户端发送的所述客户端在当前间隔时间t内使用网络资源的使用额度的信息;
确定模块72,用于确定当前时间所述客户端使用网络资源的第一动态使用限额;
判断模块73,用于确定所述客户端在当前间隔时间t内使用网络资源的使用额度是否大于所述第一动态使用限额;
发送模块74,用于在所述判断模块73确定所述客户端在当前间隔时间t内使用网络资源的使用额度大于所述第一动态使用限额时,向所述客户端发送所述网络资源的禁用时长;以使所述客户端根据所述服务器发送的所述网络资源的禁用时长,从接收所述禁用时长的时刻开始,在所述禁用时长内禁止使用所述网络资源。
可选地,所述确定模块72具体用于:
根据当前时间接收的所述客户端和其他客户端发送的使用所述网络资源的使用额度的信息,所述信息中携带有所述客户端和所述其他客户端的标识信息,确定当前使用所述网络资源的客户端数量;
根据所述客户端预设的使用所述网络资源的默认限额,以及当前使用所述网络资源的客户端数量,确定当前时间所述客户端使用网络资源的第一动态使用限额。
可选地,所述确定模块72具体用于:
根据计算公式:
Figure PCTCN2016097496-appb-000006
确定当前时间所述客户端使用网络资源的第一动态使用限额;
其中,DefaultQuota表示所述客户端预设的使用所述网络资源的默认限额,aliveAgentCount表示当前使用所述网络资源的客户端数量,ImpactFactor是预设的常量。
可选地,所述接收模块71,还用于接收所述客户端在当前间隔时间t结束时向所述服务器发送的所述客户端使用网络资源的第二动态使用限额,所述第二动态使用限额为所述服务器在上一次间隔时间t结束时计算的所述客户端使用网络资源的动态使用限额;
所述判断模块73,还用于确定所述第二动态使用限额与所述第一动态使用限额是否一致;
所述发送模块74,还用于在所述判断模块确定所述第二动态使用限额与所述第一动态使用限额不一致时,向所述客户端发送所述第一动态使用限额;以使所述客户端根据所述服务器发送的所述第一动态使用限额,将所述客户端使用网络资源的第二动态使用限额更新为所述第一动态使用限额。
图7所示实施例所述的装置可以用于执行图3和图4所示实施例所述的方法,其实现原理和技术效果不再赘述。
图8是本申请实施例的一种网络资源的使用限额的控制系统的结构示意图,如图8所示,包括:客户端81和服务器82;
所述客户端81包括如图6所示实施例所述的网络资源的使用限额的控制装置;
所述服务器82包括如图6所示实施例所述的网络资源的使用限额的控制装置。
图8所示实施例所述的系统可以用于执行图1至图5任一个实施例所述的方法,其实现原理和技术效果不再赘述。
在上述的实施例中,提供了一种网络资源的使用限额的控制方法,以及与之相对应的一种网络资源的使用限额的控制装置,本申请还提供一种用于实现上述网络资源的使用限额的控制方法的电子设备,所述电子设备例如可以作为客户端或服务器实现上述方法实施例中的网络资源的使用限额的控制方法。
图9为本发明实施例提供的一种电子设备示意图。所述电子设备实施例描述得比较简单,相关的部分请参见上述方法实施例的对应说明即可。下述描述的所述电子设备实施例仅仅是示意性的。如图9所示,本发明实施例所述的电子设备包括:存储器91和处理器92;
其中,存储器91中存储有实现上述网络资源的使用限额的控制方法的指令;
可选地,当所述电子设备作为客户端时,所述处理器92调用存储器91中的执行令可以执行如下步骤:
统计当前间隔时间t内使用网络资源的使用额度;在当前间隔时间t结束时向服务器发送客户端在当前间隔时间t内使用网络资源的使用额度的信息;以使所述服务器确定当前时间所述客户端使用网络资源的第一动态使用限额,若确定所述客户端在当前间隔时间t内使用网络资源的使用额度大于所述第一动态使用限额,则向所述客户端发送所述网络资源的禁用时长;
接收所述服务器发送的所述网络资源的禁用时长,根据所述禁用时长,从接收所述禁用时长的时刻开始,在所述禁用时长内禁止使用所述网络资源;
进一步地,所述处理器92还可以执行如下步骤:
在当前间隔时间t结束时向所述服务器发送所述客户端使用网络资源的第二动态使用限额,所述第二动态使用限额为所述服务器在上一次间隔时间t结束时计算的所述客户端使用网络资源的动态使用限额;以使所述服务器在确定所述第二动态使用限额与所述第一动态使用限额不一致时,向所述客户端发送所述第一动态使用限额;
根据所述服务器发送的所述第一动态使用限额,将所述客户端使用网络资源的第二动态使用限额更新为所述第一动态使用限额。
可选地,当所述电子设备作为服务器时,所述处理器92调用存储器91中的执行令可以执行如下步骤:
接收客户端发送的所述客户端在当前间隔时间t内使用网络资源的使用额度的信息;
确定当前时间所述客户端使用网络资源的第一动态使用限额;
若确定所述客户端在当前间隔时间t内使用网络资源的使用额度大于所述第一动态使用限额,则向所述客户端发送所述网络资源的禁用时长;以使所述客户端根据所述服务器发送的所述网络资源的禁用时长,从接收所述禁用时长的时刻开始,在所述禁用时长内禁止使用所述网络资源。
进一步地,所述处理器92还可以执行如下步骤:
接收所述客户端在当前间隔时间t结束时向所述服务器发送的所述客户端使用网络资源的第二动态使用限额,所述第二动态使用限额为所述服务器在上一次间隔时间t结束时计算的所述客户端使用网络资源的动态使用限额;
在确定所述第二动态使用限额与所述第一动态使用限额不一致时,向所述客户端发送所述第一动态使用限额;以使所述客户端根据所述服务器发送的所述第一动态使用限额,将所述客户端使用网络资源的第二动态使用限额更新为所述第一动态使用限额。
图9所示实施例所述的系统可以用于执行图1至图5任一个实施例所述的方法,其实现原理和技术效果不再赘述。
上述说明示出并描述了本发明的若干优选实施例,但如前所述,应当理解本发明并 非局限于本文所披露的形式,不应看作是对其他实施例的排除,而可用于各种其他组合、修改和环境,并能够在本文所述发明构想范围内,通过上述教导或相关领域的技术或知识进行改动。而本领域人员所进行的改动和变化不脱离本发明的精神和范围,则都应在本发明所附权利要求的保护范围内。

Claims (19)

  1. 一种网络资源的使用限额的控制方法,其特征在于,包括:
    客户端统计当前间隔时间t内使用网络资源的使用额度;
    所述客户端在当前间隔时间t结束时向服务器发送所述客户端在当前间隔时间t内使用网络资源的使用额度的信息;以使所述服务器确定当前时间所述客户端使用网络资源的第一动态使用限额,若确定所述客户端在当前间隔时间t内使用网络资源的使用额度大于所述第一动态使用限额,则向所述客户端发送所述网络资源的禁用时长;
    所述客户端接收所述服务器发送的所述网络资源的禁用时长,根据所述禁用时长,从接收所述禁用时长的时刻开始,在所述禁用时长内禁止使用所述网络资源。
  2. 根据权利要求1所述的方法,其特征在于,所述客户端统计当前间隔时间t内使用网络资源的使用额度之后,还包括:
    所述客户端在当前间隔时间t结束时向所述服务器发送所述客户端使用网络资源的第二动态使用限额,所述第二动态使用限额为所述服务器在上一次间隔时间t结束时计算的所述客户端使用网络资源的动态使用限额;以使所述服务器在确定所述第二动态使用限额与所述第一动态使用限额不一致时,向所述客户端发送所述第一动态使用限额;
    所述客户端根据所述服务器发送的所述第一动态使用限额,将所述客户端使用网络资源的第二动态使用限额更新为所述第一动态使用限额。
  3. 根据权利要求1所述的方法,其特征在于,所述客户端统计当前间隔时间t内使用网络资源的使用额度之后,还包括:
    在当前间隔时间t结束时,所述客户端将使用网络资源的使用额度设置为零。
  4. 根据权利要求1所述的方法,其特征在于,所述客户端接收到所述服务器发送的所述网络资源的禁用时长之后,还包括:
    所述客户端根据所述服务器发送的所述网络资源的禁用时长,将接收到所述禁用时长的时间设置为禁止使用所述网络资源的禁止起始时间,将所述禁止起始时间开始在所述禁用时长结束时的时间设置为禁止使用所述网络资源的禁止结束时间。
  5. 根据权利要求4所述的方法,其特征在于,还包括:
    所述客户端在下一次间隔时间t内使用所述网络资源时,若确定当前时间在所述网络资源的禁止结束时间之后,则使用所述网络资源,并统计使用所述网络资源的使用额度;若确定当前时间在所述网络资源的禁止结束时间之前,则禁止使用所述网络资源。
  6. 一种网络资源的使用限额的控制方法,其特征在于,包括:
    服务器接收客户端发送的所述客户端在当前间隔时间t内使用网络资源的使用额度的信息;
    所述服务器确定当前时间所述客户端使用网络资源的第一动态使用限额;
    若确定所述客户端在当前间隔时间t内使用网络资源的使用额度大于所述第一动态使用限额,则向所述客户端发送所述网络资源的禁用时长;以使所述客户端根据所述服务器发送的所述网络资源的禁用时长,从接收所述禁用时长的时刻开始,在所述禁用时长内禁止使用所述网络资源。
  7. 根据权利要求6所述的方法,其特征在于,所述服务器确定当前时间所述客户端使用网络资源的第一动态使用限额,包括:
    所述服务器根据当前时间接收的所述客户端和其他客户端发送的使用所述网络资源的使用额度的信息,所述信息中携带有所述客户端和所述其他客户端的标识信息,确定当前使用所述网络资源的客户端数量;
    所述服务器根据所述客户端预设的使用所述网络资源的默认限额,以及当前使用所述网络资源的客户端数量,确定当前时间所述客户端使用网络资源的第一动态使用限额。
  8. 根据权利要求6所述的方法,其特征在于,所述服务器根据所述客户端预设的使用所述网络资源的默认限额,以及当前使用所述网络资源的客户端数量,确定当前时间所述客户端使用网络资源的第一动态使用限额,包括:
    根据计算公式:
    Figure PCTCN2016097496-appb-100001
    确定当前时间所述客户端使用网络资源的第一动态使用限额;
    其中,DefaultQuota表示所述客户端预设的使用所述网络资源的默认限额,aliveAgentCount表示当前使用所述网络资源的客户端数量,ImpactFactor是预设的常量。
  9. 根据权利要求6-8中任一项所述的方法,其特征在于,服务器接收客户端发送的所述客户端在当前间隔时间t内使用网络资源的使用额度的信息之后,则所述方法还包括:
    所述服务器接收所述客户端在当前间隔时间t结束时向所述服务器发送的所述客户端使用网络资源的第二动态使用限额,所述第二动态使用限额为所述服务器在上一次间隔时间t结束时计算的所述客户端使用网络资源的动态使用限额;
    所述服务器在确定所述第二动态使用限额与所述第一动态使用限额不一致时,向所 述客户端发送所述第一动态使用限额;以使所述客户端根据所述服务器发送的所述第一动态使用限额,将所述客户端使用网络资源的第二动态使用限额更新为所述第一动态使用限额。
  10. 一种网络资源的使用限额的控制装置,位于客户端,其特征在于,包括:
    统计模块,用于统计当前间隔时间t内使用网络资源的使用额度;
    发送模块,用于在当前间隔时间t结束时向服务器发送所述客户端在当前间隔时间t内使用网络资源的使用额度的信息;以使所述服务器确定当前时间所述客户端使用网络资源的第一动态使用限额,若确定所述客户端在当前间隔时间t内使用网络资源的使用额度大于所述第一动态使用限额,则向所述客户端发送所述网络资源的禁用时长;
    接收模块,用于接收所述服务器发送的所述网络资源的禁用时长;
    禁用模块,用于根据所述禁用时长,从接收所述禁用时长的时刻开始,在所述禁用时长内禁止使用所述网络资源。
  11. 根据权利要求10所述的装置,其特征在于:
    所述发送模块,还用于在当前间隔时间t结束时向所述服务器发送所述客户端使用网络资源的第二动态使用限额,所述第二动态使用限额为所述服务器在上一次间隔时间t结束时计算的所述客户端使用网络资源的动态使用限额;以使所述服务器在确定所述第二动态使用限额与所述第一动态使用限额不一致时,向所述客户端发送所述第一动态使用限额;
    所述接收模块,还用于接收服务器发送的所述第一动态使用限额;
    所述装置还包括:
    更新模块,用于根据所述接收模块接收的所述第一动态使用限额,将所述客户端使用网络资源的第二动态使用限额更新为所述第一动态使用限额。
  12. 根据权利要求10所述的装置,其特征在于,还包括:
    设置模块,用于在当前间隔时间t结束时,将使用网络资源的使用额度设置为零。
  13. 根据权利要求10所述的装置,其特征在于:
    所述禁用模块,具体用于根据所述服务器发送的所述网络资源的禁用时长,将接收到所述禁用时长的时间设置为禁止使用所述网络资源的禁止起始时间,将所述禁止起始时间开始在所述禁用时长结束时的时间设置为禁止使用所述网络资源的禁止结束时间。
  14. 根据权利要求13所述的装置,其特征在于,还包括:
    判断模块,用于在下一次间隔时间t内使用所述网络资源时,若确定当前时间在所 述网络资源的禁止结束时间之后,则使用所述网络资源,并统计使用所述网络资源的使用额度;若确定当前时间在所述网络资源的禁止结束时间之前,则禁止使用所述网络资源。
  15. 一种网络资源的使用限额的控制装置,位于服务器,其特征在于,包括:
    接收模块,用于接收客户端发送的所述客户端在当前间隔时间t内使用网络资源的使用额度的信息;
    确定模块,用于确定当前时间所述客户端使用网络资源的第一动态使用限额;
    判断模块,用于确定所述客户端在当前间隔时间t内使用网络资源的使用额度是否大于所述第一动态使用限额;
    发送模块,用于在所述判断模块确定所述客户端在当前间隔时间t内使用网络资源的使用额度大于所述第一动态使用限额时,向所述客户端发送所述网络资源的禁用时长;以使所述客户端根据所述服务器发送的所述网络资源的禁用时长,从接收所述禁用时长的时刻开始,在所述禁用时长内禁止使用所述网络资源。
  16. 根据权利要求15所述的装置,其特征在于,所述确定模块具体用于:
    根据当前时间接收的所述客户端和其他客户端发送的使用所述网络资源的使用额度的信息,所述信息中携带有所述客户端和所述其他客户端的标识信息,确定当前使用所述网络资源的客户端数量;
    根据所述客户端预设的使用所述网络资源的默认限额,以及当前使用所述网络资源的客户端数量,确定当前时间所述客户端使用网络资源的第一动态使用限额。
  17. 根据权利要求16所述的装置,其特征在于,所述确定模块具体用于:
    根据计算公式:
    Figure PCTCN2016097496-appb-100002
    确定当前时间所述客户端使用网络资源的第一动态使用限额;
    其中,DefaultQuota表示所述客户端预设的使用所述网络资源的默认限额,aliveAgentCount表示当前使用所述网络资源的客户端数量,ImpactFactor是预设的常量。
  18. 根据权利要求15-17中任一项所述的装置,其特征在于:
    所述接收模块,还用于接收所述客户端在当前间隔时间t结束时向所述服务器发送的所述客户端使用网络资源的第二动态使用限额,所述第二动态使用限额为所述服务器在上一次间隔时间t结束时计算的所述客户端使用网络资源的动态使用限额;
    所述判断模块,还用于确定所述第二动态使用限额与所述第一动态使用限额是否一 致;
    所述发送模块,还用于在所述判断模块确定所述第二动态使用限额与所述第一动态使用限额不一致时,向所述客户端发送所述第一动态使用限额;以使所述客户端根据所述服务器发送的所述第一动态使用限额,将所述客户端使用网络资源的第二动态使用限额更新为所述第一动态使用限额。
  19. 一种网络资源的使用限额的控制系统,其特征在于,包括:客户端和服务器;
    所述客户端包括如权利要求10-14中任一项所述的网络资源的使用限额的控制装置;
    所述服务器包括如权利要求15-18中任一项所述的网络资源的使用限额的控制装置。
PCT/CN2016/097496 2015-09-09 2016-08-31 一种网络资源的使用限额的控制方法、装置及系统 Ceased WO2017041652A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510571666.7 2015-09-09
CN201510571666.7A CN106534231B (zh) 2015-09-09 2015-09-09 一种网络资源的使用限额的控制方法、装置及系统

Publications (1)

Publication Number Publication Date
WO2017041652A1 true WO2017041652A1 (zh) 2017-03-16

Family

ID=58240547

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/097496 Ceased WO2017041652A1 (zh) 2015-09-09 2016-08-31 一种网络资源的使用限额的控制方法、装置及系统

Country Status (2)

Country Link
CN (1) CN106534231B (zh)
WO (1) WO2017041652A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111611123A (zh) * 2019-02-25 2020-09-01 阿里巴巴集团控股有限公司 数据处理方法、数据处理系统及设备

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108768744B (zh) * 2018-06-13 2021-07-27 郑州云海信息技术有限公司 一种对云平台创建网络的管理方法和装置
CN112019445B (zh) * 2020-07-31 2024-02-02 青岛海尔科技有限公司 用于智能设备流量控制的方法及装置、智能设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012037902A1 (zh) * 2010-09-26 2012-03-29 华为终端有限公司 一种机器终端接入网络的控制方法和装置
CN102624634A (zh) * 2012-04-11 2012-08-01 深圳证券通信有限公司 一种在客户端控制网络带宽的方法及装置
CN103369041A (zh) * 2013-07-09 2013-10-23 北京奇虎科技有限公司 基于云计算的资源分配方法及装置
CN103841129A (zh) * 2012-11-21 2014-06-04 华为技术有限公司 云计算的资源信息采集服务器和客户端、信息处理方法

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101599908B (zh) * 2009-07-15 2011-11-16 杭州华三通信技术有限公司 一种带宽的自动分配方法和设备
CN103731453B (zh) * 2012-10-12 2017-02-08 百度在线网络技术(北京)有限公司 云环境中的服务资源的配额管理方法和装置
CN102916959B (zh) * 2012-10-16 2015-05-06 百度在线网络技术(北京)有限公司 云环境中的黑名单同步方法和装置
US9621439B2 (en) * 2014-02-28 2017-04-11 International Business Machines Corporation Dynamic and adaptive quota shares

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012037902A1 (zh) * 2010-09-26 2012-03-29 华为终端有限公司 一种机器终端接入网络的控制方法和装置
CN102624634A (zh) * 2012-04-11 2012-08-01 深圳证券通信有限公司 一种在客户端控制网络带宽的方法及装置
CN103841129A (zh) * 2012-11-21 2014-06-04 华为技术有限公司 云计算的资源信息采集服务器和客户端、信息处理方法
CN103369041A (zh) * 2013-07-09 2013-10-23 北京奇虎科技有限公司 基于云计算的资源分配方法及装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111611123A (zh) * 2019-02-25 2020-09-01 阿里巴巴集团控股有限公司 数据处理方法、数据处理系统及设备
CN111611123B (zh) * 2019-02-25 2023-06-20 阿里巴巴集团控股有限公司 数据处理方法、数据处理系统及设备

Also Published As

Publication number Publication date
CN106534231B (zh) 2019-12-31
CN106534231A (zh) 2017-03-22

Similar Documents

Publication Publication Date Title
US11546644B2 (en) Bandwidth control method and apparatus, and device
US10230644B2 (en) Distributed API proxy system and apparatus and method for managing traffic in such system
US20050083973A1 (en) Adaptive bandwidth throttling for network services
US10305974B2 (en) Ranking system
CN105103495B (zh) 用于允许或拒绝第一和第二设备之间的测量请求的接纳控制
US8984055B2 (en) Relay device, information processing system, and computer-readable recording medium
US20160072723A1 (en) Method and system for determining bandwidth demand
US20140143777A1 (en) Resource Scheduling Method and Device
CN110224943B (zh) 基于url的流量服务限流方法、电子设备及计算机存储介质
EP4044525A1 (en) Data transmission method and apparatus
CN110912949A (zh) 位点提交方法和装置
WO2017041652A1 (zh) 一种网络资源的使用限额的控制方法、装置及系统
CN109560976B (zh) 一种消息延迟的监控方法及装置
CN110677684B (zh) 视频处理、视频访问方法及分布式存储、视频访问系统
CN116708315A (zh) 流量限速方法、装置、电子设备及存储介质
CN106933671B (zh) 一种进行伸缩处理的方法、装置和系统
HK1204728A1 (zh) 对来自网络的访问请求产生黑名单的系统和方法
CN109726151B (zh) 用于管理输入输出栈的方法、设备和介质
EP3346671B1 (en) Service processing method and equipment
CN103916463B (zh) 一种网络访问统计分析方法及系统
CN108804152B (zh) 配置参数的调节方法及装置
US7639628B2 (en) Response time detection in a network having shared interfaces
WO2019179387A1 (zh) 数据处理方法及系统
CN106341474B (zh) 一种基于icn与sdn网络的资料管控中心及其内容管理方法
CN110831056B (zh) 一种监控事件上报方法及装置

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: 16843590

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16843590

Country of ref document: EP

Kind code of ref document: A1