CN112838936B - Resource speed limiting method, device, user terminal and server - Google Patents

Resource speed limiting method, device, user terminal and server Download PDF

Info

Publication number
CN112838936B
CN112838936B CN201911163525.6A CN201911163525A CN112838936B CN 112838936 B CN112838936 B CN 112838936B CN 201911163525 A CN201911163525 A CN 201911163525A CN 112838936 B CN112838936 B CN 112838936B
Authority
CN
China
Prior art keywords
resource
speed
access request
speed limit
limiting
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911163525.6A
Other languages
Chinese (zh)
Other versions
CN112838936A (en
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.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud Technology Co 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 Beijing Kingsoft Cloud Network Technology Co Ltd, Beijing Kingsoft Cloud Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN201911163525.6A priority Critical patent/CN112838936B/en
Publication of CN112838936A publication Critical patent/CN112838936A/en
Application granted granted Critical
Publication of CN112838936B publication Critical patent/CN112838936B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Abstract

The invention provides a resource speed limiting method, a device, a user terminal and a server, wherein after speed limiting information is acquired, a resource access request is sent to a server, and the resource access request carries the speed limiting information. In the method, speed limiting information is carried to a resource access request on a user terminal, so that a server limits speed according to the speed limiting information carried in the request; when the speed limit information needs to be updated, the user terminal is informed of modifying the speed limit information, and complex speed limit configuration items do not need to be configured and maintained at the server side, so that the configuration flexibility of a resource speed limit mode is improved.

Description

Resource speed limiting method, device, user terminal and server
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and an apparatus for limiting speed of a resource, a user terminal, and a server.
Background
In the related art, the speed limit of the resource is usually realized at the server, namely, a speed limit configuration item is set at the server, and various speed limit modes are realized through the speed limit configuration item; however, if the speed limiting mode needs to be updated, the corresponding configuration item is changed, and then the server needs to reload the changed configuration item, and the reloading process may have adverse effects on the service operated by the server; if the speed limiting mode is not updated, the speed limiting mode is easy to be caused to not meet the actual speed limiting requirement of the service, so that the resource speed limiting mode has poor configuration flexibility.
Disclosure of Invention
The invention aims to provide a resource speed limiting method, a resource speed limiting device, a user terminal and a server, so as to improve the configuration flexibility of a resource speed limiting mode.
In a first aspect, the present invention provides a method for limiting speed of a resource, where the method includes: acquiring speed limiting information; wherein the speed limit information is used for: in the process of providing resources corresponding to a preset resource access request for a client, the server limits the speed of the resources according to the speed limiting information; and sending the resource access request to the server, wherein the resource access request carries the speed limit information.
Further, the step of obtaining speed limit information includes: if a preset resource access request needs to be sent to the server, determining the resource type of the resource requested by the resource access request; and obtaining prestored speed limit information matched with the resource type.
Further, the speed limit information includes: and transmitting the maximum rate of the resource corresponding to the resource access request.
Further, the speed limit information further includes: the maximum speed is adopted to limit the speed limit time of the resource corresponding to the resource access request; and/or the area where the client sending the resource access request is located.
Further, the speed limit information is carried in a request header of the resource access request; or the speed limit information is carried in the URL address of the resource access request.
In a second aspect, the present invention provides a method for limiting speed of a resource, where the method includes: receiving a resource access request from a client; the resource access request carries speed limit information; and according to the speed limiting information, in the process of providing the resources corresponding to the resource access request for the client, limiting the speed of the resources.
Further, the speed limit information is carried in a request header of the resource access request; or the speed limit information is carried in the URL address of the resource access request.
Further, the speed limit information comprises a maximum speed of a resource corresponding to the resource access request; the step of limiting the speed of the resource in the process of providing the resource corresponding to the resource access request for the client according to the speed limiting information comprises the following steps: and transmitting the resource corresponding to the resource access request to the client, and limiting the transmission rate of the resource within the maximum rate in the process of transmitting the resource.
Further, the speed limit information further includes: the maximum speed is adopted to limit the speed limit time of the resource corresponding to the resource access request; in the process of transmitting the resource, limiting the transmission rate of the resource to be within the maximum rate, including: judging whether the current time belongs to the speed limit time or not; and if the rate-limiting time is included, limiting the transmission rate of the resource to be within the maximum rate in the process of transmitting the resource.
Further, the speed limit information further includes: the region where the client of the resource access request is located is sent; in the process of transmitting the resource, limiting the transmission rate of the resource to be within the maximum rate, including: judging whether the area of the client for sending the resource access request belongs to a preset speed limiting area or not; and if the transmission rate belongs to the speed limiting area, limiting the transmission rate of the resource to be within the maximum rate in the process of transmitting the resource.
In a third aspect, the present invention provides a resource speed limiting device, where the device includes: the acquisition module is used for acquiring the speed limit information; wherein the speed limit information is used for: in the process of providing resources corresponding to a preset resource access request for a client, the server limits the speed of the resources according to the speed limiting information; and the sending module is used for sending the resource access request to the server, wherein the resource access request carries the speed limit information.
In a fourth aspect, the present invention provides a resource speed limiting device, including: the receiving module is used for receiving a resource access request from the client; the resource access request carries speed limit information; and the speed limiting module is used for limiting the speed of the resources in the process of providing the resources corresponding to the resource access requests for the clients according to the speed limiting information.
In a fifth aspect, the present invention provides a user terminal, comprising a processor and a memory, the memory storing machine executable instructions executable by the processor, the processor executing the machine executable instructions to implement the resource speed limiting method according to any one of the first aspects.
In a sixth aspect, the present invention provides a server comprising a processor and a memory, the memory storing machine executable instructions executable by the processor, the processor executing the machine executable instructions to implement the resource speed limiting method of any one of the second aspects above.
In a seventh aspect, the present invention provides a machine-readable storage medium storing machine-executable instructions which, when invoked and executed by a processor, cause the processor to implement the resource speed limiting method of any one of the first and second aspects above.
According to the resource speed limiting method, device, user terminal and server provided by the invention, after the speed limiting information is obtained, a resource access request is sent to the server, wherein the resource access request carries the speed limiting information. In the method, speed limiting information is carried to a resource access request on a user terminal, so that a server limits speed according to the speed limiting information carried in the request; when the speed limit information needs to be updated, the user terminal is informed of modifying the speed limit information, and complex speed limit configuration items do not need to be configured and maintained at the server side, so that the configuration flexibility of a resource speed limit mode is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a resource speed limiting method provided by an embodiment of the invention;
FIG. 2 is a flow chart of another method for limiting speed of resources according to an embodiment of the present invention;
FIG. 3 is a flow chart of another method for limiting speed of resources according to an embodiment of the present invention;
FIG. 4 is a flow chart of another method for limiting speed of resources according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a resource speed limiting device according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of another resource speed limiting device according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a user terminal or a server according to an embodiment of the present invention.
Detailed Description
The technical solutions of the present invention will be clearly and completely described in connection with the embodiments, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Currently, the speed limit of the resource is usually implemented at a server, for example, a speed limit configuration item such as "limit_rate xxx" is set in a proxy server or a web server, and the speed limit rate is configured in the speed limit configuration item; the speed limiting is also realized by setting corresponding configuration items at the designated time or the designated area. This way of setting the speed limit configuration item at the server has mainly the following two drawbacks: firstly, if different speed limiting modes are adopted for specific URLs (Uniform Resource Location, uniform resource locators) or catalogues, corresponding independent configuration is needed in a proxy server or a web server, if the number of the URLs is large, piece-by-piece configuration is needed, and the configuration process is complex; second, if the speed limiting mode needs to be updated, the corresponding configuration item will be changed, and the server needs to reload the changed configuration item, which may adversely affect the service running on the server. Based on the above, the embodiment of the invention provides a speed limiting method, a device, a user terminal and a server, and the technology can be applied to video resource downloading speed limit, text resource downloading speed limit or other resource downloading speed limit.
For the convenience of understanding the present embodiment, first, a method for limiting speed of a resource disclosed in the present embodiment of the present invention is described in detail, where the method may be applied to a client, or a user terminal installed with a client, such as a mobile phone, a tablet computer, a computer, and so on; as shown in fig. 1, the method comprises the steps of:
step S102, obtaining speed limiting information; wherein, this speed limit information is used for: and in the process of providing the resources corresponding to the preset resource access requests for the client, the server limits the speed of the resources according to the speed limiting information.
The server may be a proxy server or a web server, etc. for providing the user with required data resources; the resource access request may include: request method for resource, identifier of resource and protocol used information; the specific form of the resource access request may be an http request. The above speed limit information may be understood as a condition that the server side is subjected to limitation of the transmission speed when transmitting the resource that the user requests to access, such as a maximum rate of resource transmission, a time for speed limit using the maximum rate, and the like.
Sending a resource access request to a server may include two ways: one is triggered by a user, and a resource access request is sent to a server; the other is that the client actively sends a resource access request to the server. The speed limiting information corresponding to the resource access requests of different types of resources is usually different, and the corresponding speed limiting information needs to be obtained according to the resources to be accessed, so that the server limits the speed of the resources according to the speed limiting information in the process of providing the resources corresponding to the preset resource access requests for the client.
Step S104, the resource access request is sent to the server, wherein the resource access request carries the speed limit information.
If the speed limit is to be implemented on the resource in the resource access request, the corresponding speed limit information acquired in the above step needs to be added to the resource access request, for example, the speed limit information may be added to a request header, URL parameters or other positions of the resource access request.
The resource access request carrying the speed limit information is sent to a server, and the server limits the speed limit of the resource accessed by the client according to the speed limit information, for example, if the speed limit information contains the maximum speed of the resource transmission, the server limits the speed of the resource transmission within the range of the maximum speed in the process of providing the resource corresponding to the resource access request for the client; if a limited time or other limit condition is also set, the accessed resource needs to be limited in combination with the limit condition.
According to the resource speed limiting method provided by the embodiment of the invention, after the speed limiting information is acquired, a resource access request is sent to the server, wherein the resource access request carries the speed limiting information. In the method, speed limiting information is carried to a resource access request on a user terminal, so that a server limits speed according to the speed limiting information carried in the request; when the speed limit information needs to be updated, the user terminal is informed of modifying the speed limit information, and complex speed limit configuration items do not need to be configured and maintained at the server side, so that the configuration flexibility of a resource speed limit mode is improved.
The embodiment of the invention provides another resource speed limiting method, which describes a specific implementation process for acquiring speed limiting information in detail, and can be realized through the following steps S202 and S204; as shown in fig. 2, the method comprises the steps of:
step S202, if a resource access request needs to be sent to the server, determining the resource type of the resource requested by the resource access request.
The above resources may be understood as resources corresponding to a resource access request sent by a user or a client to a server, that is, resources that the user or the client wants to access or download; the above resource type may be understood as a format type of the above resource, and the resource type may include various types such as a file in a txt format, a video in an mp4 format, an audio in an mp3 format, and the like. When a resource access request needs to be sent to a server, the type of the resource to be accessed by a user or a client needs to be determined first, and the determination mode of the type of the resource can be realized by clicking a control button or other modes, for example: the user can extract the type of the resource from a link by clicking a control button corresponding to the link; and then confirming corresponding speed limit information according to the resource type, wherein the speed limit information corresponding to different resource types is generally different.
Step S204, obtaining pre-stored speed limit information matched with the resource types, wherein the speed limit information is used for: and in the process of providing the resources corresponding to the preset resource access requests for the client, the server limits the speed of the resources according to the speed limiting information.
The above speed limit information generally includes: transmitting a maximum rate of resources corresponding to the resource access request; according to the actual requirement, the speed limit information may further include a speed limit time for limiting the speed of the resource corresponding to the resource access request by using the maximum speed or an area where the client sending the resource access request is located, and the speed limit information may further include both a speed limit time for limiting the speed of the resource corresponding to the resource access request by using the maximum speed and an area where the client sending the resource access request is located.
As an example, if the speed limit information only includes that the maximum rate of the resource corresponding to the transmission resource access request is 2M bit/s, it means that when the user in any area accesses the resource at any time, the transmission rate of the resource is limited to be within 2M bit/s; if the speed limit information comprises that the maximum speed of the resource corresponding to the transmission resource access request is 2M bit/s, and the speed limit time is 19:00-21:00, the transmission speed of the resource is limited to be 2M bit/s when users in any area access the resource in the time period of 19:00-21:00; if the speed limit information comprises that the maximum speed of the resource corresponding to the transmission resource access request is 2M bit/s, and the speed limit area is Guangdong, the transmission speed of the resource is limited within 2M bit/s when the user of the Guangdong accesses the resource at any time; if the speed limit information comprises that the maximum speed of the resource corresponding to the transmission resource access request is 2M bit/s, the speed limit time is 19:00-21:00, and the speed limit area is Guangdong, the transmission speed of the resource is limited to be within 2M bit/s when the user of the Guangdong accesses the resource within the time period of 19:00-21:00.
The speed limit information matched with the resource types is usually pre-stored in the client, and the speed limit information can be pre-issued to the client by the corresponding server of the client. When a certain resource type is required to be speed-limited, speed-limiting information matched with the resource type is acquired from the client, so that the server limits the resource according to the speed-limiting information in the process of providing the resource corresponding to the preset resource access request for the client.
Step S206, the resource access request is sent to the server, wherein the resource access request carries the speed limit information.
In actual implementation, the speed limit information may be carried in the request header of the above-mentioned resource access request. The request header (header) generally contains data information supported by the client, such as supported data types, codes, data compression formats, and the like, and may also include requirements of the client on accessed resources, such as time of data buffering, and the like. And adding the speed limit information into a request header of the resource access request so that the server returns the resource which is currently requested to be accessed to the client according to the content in the request header.
In actual implementation, when using http/https protocol to access resources, adding a maximum rate value of resources corresponding to a transmission resource access request in a request header, wherein the maximum rate value can be expressed by using x_limit_rate, and whether to add speed limit time, an area where a client is located, and the like in the request header can be selected according to actual requirements; the speed limit adding time can be represented by x_duration_time, and the region where the client is located can be represented by x_region. In practical implementation, the web server or proxy server needs to perform functional implementation, that is, after receiving the resource access request with the request header, the web server or proxy server performs rate limiting on the accessed resource according to the speed limit information in the request header so as to control the downloading rate of the client access resource; after the server can implement the above functions, the client needs to be improved to add the speed limit information to the request header.
If the client request header only carries x_limit_rate, the limitation of the maximum rate value of the accessed current resource only transmission resource is indicated, and the limitation of time and the area where the client is located is avoided. The other two request headers x_pending_time and x_region will only be validated when x_limit_rate is present; as an example: if the browser accesses the resource/example/test.mp4 of the a.com domain name and adds the request header x_limit_rate:2M, x_duration_time: 19:00-21:00, x_region: guangdong, the maximum rate of downloading test.mp4 is 2 Mbit/s, i.e., 2 Mbit per second, for a period of 19 points to 21 points on behalf of the Guangdong user.
The format of the request header may be in the form of http protocol standard format, that is, header name+colon+value, for example, header1: value1, and may also be expressed in other formats, and the meaning of the values of the three request headers is described below.
The value of x_limit_rate is bits per second, namely bits/s, and represents the number of bytes without unit characters, and in addition, two units of K and M (without case distinction) are supported, wherein K and M represent universal rate units of the Internet; x_limit_rate:200, x_limit_rate:200K, x _limit_rate:200M represent download rate restrictions of 200bit/s, 200Kbit/s, 200Mbit/s, respectively.
The value of x_duration_time represents a speed limit time, which may be a time interval, expressed in the following manner: start time + bar + end time, e.g., in 24 hours a day, x_duration_time: 18:00-21:00, indicating that speed limiting is performed in the 18-21 point time period; the speed limit time may be extended to a weekly cycle, a monthly cycle, or the like, such as a weekly speed limit, a monthly speed limit, or the like, which may be defined. The client can prescribe different speed limiting time, speed limiting area and the like according to different service types; for example, MP4 formatted resources may be set to speed limit during peak hours; the manufacturer of the client can also inform the client of the information such as the speed limit time, the speed limit area and the like of the specific service.
The value of x_region may be an identifier representing a region, and a definition manner of the region may be negotiated with the server, where the definition manner includes, but is not limited to, pinyin or english.
In actual implementation, the speed limit information may also be carried in the URL address of the resource access request.
The URL address is a compact representation of the location and access method of the resource available on the internet, is the address of a standard resource on the internet, and each file on the internet has a unique URL, and a complete URL generally includes: protocol part, web address, file address part. As another implementation manner, the speed limit information may also be added to the URL address of the resource access request, for example:
http:// aaa.com/xxx.mp4rate_limit=2m & time_reducing=19:00-21:00 & region=guangdong, meaning that the rate of downloading xxx.mp4 is limited to 2 mbits/s, i.e. 2 mbits per second, for a period of 19-21 points for the Guangdong user.
Compared with the mode of adding the speed limit information to the request head of the resource access request, the speed limit information can be added to the request head of the resource access request in the two modes, so that the speed limit information can be used more flexibly at a certain time and in a certain area, the configuration of a web server or a proxy server can be simplified, and reloading of the server after the configuration update is avoided; the client can flexibly control the downloading rate of a certain area and a certain time, and bandwidth cost is reduced. In contrast, adding speed limit information to URL addresses of resource access requests in this step may cause the URL addresses to be too long, and when the length is exceeded, the server may cut off processing, resulting in incomplete request data, so adding speed limit information to request headers of resource access requests is a relatively preferable way.
According to the resource speed limiting method, when the resource access request needs to be sent to the server, firstly, the resource type of the resource requested by the resource access request is determined, and the prestored speed limiting information matched with the resource type is acquired based on the resource type, wherein the speed limiting information can be carried in the request head of the resource access request or in the URL address, and the integrity of the resource access request information can be better ensured by carrying the speed limiting information in the request head of the resource access request, so that the resource speed limiting method is a more preferable mode. In the method, speed limiting information is carried to a resource access request on a user terminal, so that a server limits speed according to the speed limiting information carried in the request; when the speed limit information needs to be updated, the user terminal is informed of modifying the speed limit information, and complex speed limit configuration items do not need to be configured and maintained at the server side, so that the configuration flexibility of a resource speed limit mode is improved.
The embodiment of the invention provides another resource speed limiting method, which can be applied to a server, as shown in fig. 3, and comprises the following steps:
step S302, a resource access request from a client is received, wherein the resource access request carries speed limit information.
In actual implementation, the resource access request may be a resource access request sent by the user triggering client, or may be a resource access request sent by the client to the server actively, where the resource access request carries speed limit information. And when the server receives the resource access request, extracting speed limit information corresponding to the accessed resource from the resource access request.
Step S304, according to the speed limit information, in the process of providing the resource corresponding to the resource access request to the client, the resource is limited.
According to the resource speed limiting method provided by the embodiment of the invention, after the resource access request carrying the speed limiting information is received from the client, the server limits the speed of the resource in the process of providing the resource corresponding to the resource access request for the client according to the speed limiting information. In the method, speed limiting information is carried to a resource access request on a user terminal, so that a server limits speed according to the speed limiting information carried in the request; when the speed limit information needs to be updated, the user terminal is informed of modifying the speed limit information, and complex speed limit configuration items do not need to be configured and maintained at the server side, so that the configuration flexibility of a resource speed limit mode is improved.
The embodiment of the invention provides another method for limiting the speed of resources, which specifically describes a specific implementation process of limiting the speed of the resources in the process of providing the resources corresponding to the resource access requests to the clients according to speed limiting information, and can be specifically realized through the following step S404; as shown in fig. 4, the method comprises the steps of:
step S402, receiving a resource access request from a client; the resource access request carries speed limit information.
In actual implementation, the following two ways can be adopted to carry speed limit information: in one mode, the speed limit information may be carried in a request header of the resource access request; or in the second mode, the speed limit information is carried in the URL address of the resource access request. Compared with the second mode, the first mode can better ensure the integrity of the resource access request information; when the server receives the resource access request, the speed limit information corresponding to the accessed resource is extracted from the request header or the URL address containing the speed limit information.
And step S404, transmitting the resource corresponding to the resource access request to the client, and limiting the transmission rate of the resource within the maximum rate in the process of transmitting the resource.
If the speed limit information does not comprise the maximum speed of the resource corresponding to the resource access request, the transmission speed of the resource is not limited in the process of transmitting the resource; if the speed limit information includes a maximum rate of transmitting the resource corresponding to the resource access request, when the server transmits the resource to the client, the transmission rate of the resource is limited within the maximum rate according to the speed limit information, and when the server is actually implemented, the steps may include three different implementation manners:
mode one: the speed limit information further includes: the speed limiting time for limiting the speed of the resource corresponding to the resource access request by adopting the maximum speed; namely, the speed limit information comprises the maximum speed of the resources corresponding to the transmission resource access request and the speed limit time; in actual implementation, this step may be implemented by the following steps 60-61:
step 60, judging whether the current time belongs to the speed limit time; that is, it is determined whether the current time is within the speed limit time interval or whether the current time is on a date specified by the speed limit time, if the current time belongs to the speed limit time, step 61 is executed, and if the current time does not belong to the speed limit time, the transmission rate of the resource is not limited.
Step 61, in the process of transmitting the resource, the transmission rate of the resource is limited to the maximum rate.
Mode two: the speed limit information further includes: the area where the client side sending the resource access request is located; namely, the speed limit information comprises the maximum speed of the resources corresponding to the transmission resource access request and a preset speed limit area; in actual implementation, this step may be implemented by the following steps 62-63:
step 62, judging whether the area where the client side sending the resource access request is located belongs to a preset speed limiting area; if so, step 63 is performed, and if not, the transmission rate of the resource is not limited. The preset speed limiting areas can be obtained through screening according to the historical transmission rates of the areas and are stored in the server side in advance.
Step 63, in the process of transmitting the resource, the transmission rate of the resource is limited to the maximum rate.
Mode three: the speed limit information simultaneously comprises: the speed limiting time for limiting the speed of the resource corresponding to the resource access request by adopting the maximum speed; and the area where the client side sending the resource access request is located; the speed limit information simultaneously comprises the maximum speed, the speed limit time and the preset speed limit area of the resources corresponding to the transmission resource access request; in actual implementation, this step may be implemented by the following steps 64-66:
Step 64, judging whether the current time belongs to the speed limit time; if the current time belongs to the speed limit time, executing step 65; if the transmission rate does not belong to the speed limit time, the transmission rate of the resource is not limited.
Step 65, judging whether the area where the client side sending the resource access request is located belongs to a preset speed limiting area; if the speed limit area is included, executing step 66; if the transmission rate does not belong to the speed limit area, the transmission rate of the resource is not limited.
Step 66, limiting the transmission rate of the resource to be within the maximum rate during transmission of the resource.
According to the resource speed limiting method, after the resource access request carrying the speed limiting information is received from the client, three different implementation modes for limiting the speed of the resource are provided according to different information categories contained in the speed limiting information. In the method, speed limiting information is carried to a resource access request on a user terminal, so that a server limits speed according to the speed limiting information carried in the request; when the speed limit information needs to be updated, the user terminal is informed of modifying the speed limit information, and complex speed limit configuration items do not need to be configured and maintained at the server side, so that the configuration flexibility of a resource speed limit mode is improved.
Corresponding to the above method embodiment, referring to a schematic structural diagram of a resource speed limiting device shown in fig. 5, the device includes: an acquisition module 50 for acquiring speed limit information; wherein, speed limit information is used for: in the process of providing resources corresponding to a preset resource access request for a client, the server limits the speed of the resources according to speed limiting information; and the sending module 51 is configured to send a resource access request to the server, where the resource access request carries speed limit information.
According to the resource speed limiting device provided by the embodiment of the invention, after the speed limiting information is acquired, a resource access request is sent to the server, wherein the resource access request carries the speed limiting information. The device carries the speed limiting information to the resource access request on the user terminal so that the server limits the speed according to the speed limiting information carried in the request; when the speed limit information needs to be updated, the user terminal is informed of modifying the speed limit information, and complex speed limit configuration items do not need to be configured and maintained at the server side, so that the configuration flexibility of a resource speed limit mode is improved.
Further, the obtaining module 50 is further configured to: if a preset resource access request needs to be sent to a server, determining the resource type of the resource requested by the resource access request; and obtaining prestored speed limit information matched with the resource type.
Further, the speed limit information includes: and transmitting the maximum rate of the resource corresponding to the resource access request.
Further, the speed limit information further includes: the speed limiting time for limiting the speed of the resource corresponding to the resource access request by adopting the maximum speed; and/or the area where the client sending the resource access request is located.
Further, the speed limit information is carried in a request header of the resource access request; alternatively, the speed limit information is carried in the URL address of the resource access request.
The implementation principle and the generated technical effects of the resource speed limiting device provided by the embodiment of the invention are the same as those of the resource speed limiting method embodiment, and for the sake of brief description, reference may be made to corresponding contents in the resource speed limiting method embodiment where the resource speed limiting device embodiment is not mentioned.
Corresponding to the above method embodiment, referring to a schematic structural diagram of another resource speed limiting device shown in fig. 6, the device includes: a receiving module 60, configured to receive a resource access request from a client; the resource access request carries speed limiting information; and the speed limiting module 61 is configured to limit the speed of the resource in the process of providing the resource corresponding to the resource access request to the client according to the speed limiting information.
According to the resource speed limiting device provided by the embodiment of the invention, after the resource access request carrying the speed limiting information is received from the client, the server limits the speed of the resource in the process of providing the resource corresponding to the resource access request for the client according to the speed limiting information. The device carries the speed limiting information to the resource access request on the user terminal so that the server limits the speed according to the speed limiting information carried in the request; when the speed limit information needs to be updated, the user terminal is informed of modifying the speed limit information, and complex speed limit configuration items do not need to be configured and maintained at the server side, so that the configuration flexibility of a resource speed limit mode is improved.
Further, the speed limit information is carried in a request header of the resource access request; alternatively, the speed limit information is carried in the URL address of the resource access request.
Further, the speed limit information comprises a maximum speed of the resource corresponding to the transmission resource access request; the speed limit module 61 is also for: and transmitting the resource corresponding to the resource access request to the client, and limiting the transmission rate of the resource within the maximum rate in the process of transmitting the resource.
Further, the speed limit information further includes: the speed limiting time for limiting the speed of the resource corresponding to the resource access request by adopting the maximum speed; the speed limit module 61 is also for: judging whether the current time belongs to the speed limit time or not; if the time is a speed limit time, the transmission rate of the resource is limited to be within the maximum rate in the process of transmitting the resource.
Further, the speed limit information further includes: the area where the client side sending the resource access request is located; the speed limit module 61 is also for: judging whether the area of the client for sending the resource access request belongs to a preset speed limiting area or not; if the transmission rate belongs to the speed limiting area, the transmission rate of the resource is limited to be within the maximum rate in the process of transmitting the resource.
The implementation principle and the generated technical effects of the resource speed limiting device provided by the embodiment of the invention are the same as those of the resource speed limiting method embodiment, and for the sake of brief description, reference may be made to corresponding contents in the resource speed limiting method embodiment where the resource speed limiting device embodiment is not mentioned.
The embodiment of the present invention further provides a user terminal or a server, referring to fig. 7, where the user terminal or the server includes a processor 70 and a memory 71, where the memory 71 stores machine executable instructions that can be executed by the processor 70, and the processor 70 executes the machine executable instructions to implement the above-mentioned resource speed limiting method.
Further, the user terminal or server shown in fig. 7 further comprises a bus 72 and a communication interface 73, and the processor 70, the communication interface 73 and the memory 71 are connected by the bus 72.
The memory 71 may include a high-speed random access memory (RAM, random Access Memory), and may further include a non-volatile memory (non-volatile memory), such as at least one magnetic disk memory. The communication connection between the system network element and the at least one other network element is achieved via at least one communication interface 73 (which may be wired or wireless), which may use the internet, a wide area network, a local network, a metropolitan area network, etc. Bus 72 may be an ISA bus, a PCI bus, an EISA bus, or the like. The buses may be classified as address buses, data buses, control buses, etc. For ease of illustration, only one bi-directional arrow is shown in FIG. 7, but not only one bus or type of bus.
The processor 70 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuitry in hardware or instructions in software in the processor 70. The processor 70 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processor, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be embodied directly in the execution of a hardware decoding processor, or in the execution of a combination of hardware and software modules in a decoding processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in the memory 71 and the processor 70 reads the information in the memory 71 and in combination with its hardware performs the steps of the method of the previous embodiment.
The embodiment of the invention also provides a machine-readable storage medium, which stores machine-executable instructions that, when being called and executed by a processor, cause the processor to implement the speed limiting method of the above resources, and the specific implementation can be referred to the method embodiment and will not be described herein.
The method, the device, the user terminal and the computer program product of the server for limiting the speed of the resource provided by the embodiment of the invention comprise a computer readable storage medium storing program codes, and the instructions included in the program codes can be used for executing the method described in the method embodiment, and specific implementation can be referred to the method embodiment and will not be repeated here.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the invention.

Claims (14)

1. A method for limiting speed of a resource, the method comprising:
acquiring speed limiting information; wherein the speed limit information is used for: in the process of providing resources corresponding to a preset resource access request for a client, the server limits the speed of the resources according to the speed limiting information;
the resource access request is sent to the server, wherein the resource access request carries the speed limit information;
the step of obtaining speed limit information comprises the following steps:
if a preset resource access request needs to be sent to the server, determining the resource type of the resource requested by the resource access request;
Obtaining prestored speed limit information matched with the resource type; wherein the speed limit information corresponding to different resource types is different.
2. The method of claim 1, wherein the speed limit information comprises: and transmitting the maximum rate of the resource corresponding to the resource access request.
3. The method of claim 2, wherein the speed limit information further comprises:
the maximum speed is adopted to limit the speed limit time of the resource corresponding to the resource access request; and/or the area where the client sending the resource access request is located.
4. The method of claim 1, wherein the speed limit information is carried in a request header of the resource access request; or the speed limit information is carried in the URL address of the resource access request.
5. A method for limiting speed of a resource, the method comprising:
receiving a resource access request from a client; the resource access request carries speed limit information; the speed limit information is acquired by the client in the following way: if a preset resource access request needs to be sent to a server, determining the resource type of a resource requested by the resource access request; obtaining prestored speed limit information matched with the resource type; the speed limiting information corresponding to different resource types is different;
And according to the speed limiting information, in the process of providing the resources corresponding to the resource access request for the client, limiting the speed of the resources.
6. The method of claim 5, wherein the speed limit information is carried in a request header of the resource access request; or the speed limit information is carried in the URL address of the resource access request.
7. The method of claim 5, wherein the speed limit information comprises a maximum rate at which resources corresponding to the resource access request are transmitted;
the step of limiting the speed of the resource in the process of providing the resource corresponding to the resource access request for the client according to the speed limiting information comprises the following steps:
and transmitting the resource corresponding to the resource access request to the client, and limiting the transmission rate of the resource within the maximum rate in the process of transmitting the resource.
8. The method of claim 7, wherein the speed limit information further comprises: the maximum speed is adopted to limit the speed limit time of the resource corresponding to the resource access request;
in the process of transmitting the resource, limiting the transmission rate of the resource to be within the maximum rate, including:
Judging whether the current time belongs to the speed limit time or not;
and if the rate-limiting time is included, limiting the transmission rate of the resource to be within the maximum rate in the process of transmitting the resource.
9. The method of claim 7, wherein the speed limit information further comprises: the region where the client of the resource access request is located is sent;
in the process of transmitting the resource, limiting the transmission rate of the resource to be within the maximum rate, including:
judging whether the area of the client for sending the resource access request belongs to a preset speed limiting area or not;
and if the transmission rate belongs to the speed limiting area, limiting the transmission rate of the resource to be within the maximum rate in the process of transmitting the resource.
10. A resource speed limiting device, the device comprising:
the acquisition module is used for acquiring the speed limit information; wherein the speed limit information is used for: in the process of providing resources corresponding to a preset resource access request for a client, the server limits the speed of the resources according to the speed limiting information;
the sending module is used for sending the resource access request to the server, wherein the resource access request carries the speed limit information;
The acquisition module is further configured to: if a preset resource access request needs to be sent to the server, determining the resource type of the resource requested by the resource access request;
obtaining prestored speed limit information matched with the resource type; wherein the speed limit information corresponding to different resource types is different.
11. A resource speed limiting device, the device comprising:
the receiving module is used for receiving a resource access request from the client; the resource access request carries speed limit information; the speed limit information is acquired by the client in the following way: if a preset resource access request needs to be sent to a server, determining the resource type of a resource requested by the resource access request; obtaining prestored speed limit information matched with the resource type; the speed limiting information corresponding to different resource types is different;
and the speed limiting module is used for limiting the speed of the resources in the process of providing the resources corresponding to the resource access requests for the clients according to the speed limiting information.
12. A user terminal comprising a processor and a memory, the memory storing machine executable instructions executable by the processor, the processor executing the machine executable instructions to implement the resource speed limiting method of any one of claims 1 to 4.
13. A server comprising a processor and a memory, the memory storing machine executable instructions executable by the processor, the processor executing the machine executable instructions to implement the resource speed limiting method of any one of claims 5 to 9.
14. A machine-readable storage medium storing machine-executable instructions which, when invoked and executed by a processor, cause the processor to implement the resource speed limiting method of any one of claims 1 to 9.
CN201911163525.6A 2019-11-22 2019-11-22 Resource speed limiting method, device, user terminal and server Active CN112838936B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911163525.6A CN112838936B (en) 2019-11-22 2019-11-22 Resource speed limiting method, device, user terminal and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911163525.6A CN112838936B (en) 2019-11-22 2019-11-22 Resource speed limiting method, device, user terminal and server

Publications (2)

Publication Number Publication Date
CN112838936A CN112838936A (en) 2021-05-25
CN112838936B true CN112838936B (en) 2023-05-26

Family

ID=75922047

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911163525.6A Active CN112838936B (en) 2019-11-22 2019-11-22 Resource speed limiting method, device, user terminal and server

Country Status (1)

Country Link
CN (1) CN112838936B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102946438A (en) * 2012-11-29 2013-02-27 乐视致新电子科技(天津)有限公司 Uniform download management and intelligent speed-limiting method
CN109120454A (en) * 2018-09-04 2019-01-01 山东浪潮云投信息科技有限公司 A kind of QoS flow speed limiting system and method
CN109787830A (en) * 2019-01-21 2019-05-21 北京京东尚科信息技术有限公司 Gray scale distribution control method, device, system, electronic equipment and storage medium
EP3562099A1 (en) * 2016-12-20 2019-10-30 ZTE Corporation Scheduling method, system, controller and computer storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10554564B2 (en) * 2017-02-27 2020-02-04 Ebay Inc. Rate limiter

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102946438A (en) * 2012-11-29 2013-02-27 乐视致新电子科技(天津)有限公司 Uniform download management and intelligent speed-limiting method
EP3562099A1 (en) * 2016-12-20 2019-10-30 ZTE Corporation Scheduling method, system, controller and computer storage medium
CN109120454A (en) * 2018-09-04 2019-01-01 山东浪潮云投信息科技有限公司 A kind of QoS flow speed limiting system and method
CN109787830A (en) * 2019-01-21 2019-05-21 北京京东尚科信息技术有限公司 Gray scale distribution control method, device, system, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN112838936A (en) 2021-05-25

Similar Documents

Publication Publication Date Title
CN102082807B (en) File transmitting method and device based on multiple protocols
US6629130B2 (en) Method and apparatus for processing electronic mail
KR100416342B1 (en) A method for receiving data using SMS and wireless Internet and system thereof
CN106534243B (en) Caching, requesting and responding method based on HTTP protocol and corresponding device
JP4643638B2 (en) Method and apparatus for changing quality of service
CN103220371B (en) Content adaptation method and system
US6941354B2 (en) Mobile terminal permitting selection of communication channel for receiving message attachments
WO2009000212A1 (en) A message processing apparatus and terminal, a system and method for transmiting messages
KR20140096063A (en) Browser core adaptation method and browser
CN112100541A (en) Website page element loading method and device, electronic device and storage medium
WO2005032101A1 (en) System and method for requesting a resource over at least one network with reduced overhead
CN109194706B (en) Network resource dial testing method and terminal
US20040267912A1 (en) Non-standard MIME type supporting system of mobile terminal and method thereof
CN112838936B (en) Resource speed limiting method, device, user terminal and server
US8799372B1 (en) Management of referenced object based on size of referenced object
JP2005510818A (en) Communication system in which communication system having client and server also has browser performance
EP1271877B1 (en) Wireless browser
EP2003852B1 (en) Method for improving output of data from a remote gateway at a mobile device and download management unit
CN106464580B (en) Method and device for acquiring bandwidth information
US20190318036A1 (en) Topic Based Publish and Parametric Subscribe Pattern
CN112887362B (en) Equipment access method, equipment access device and server
US20020035636A1 (en) Computer and process for the provision of distributed dynamic services for mobile terminal devices
CN105915639B (en) Page access method and device
CN111417031B (en) File transmission method and device and electronic equipment
CN103067980B (en) Method for reducing transmission data traffic based on GPRS (general packet radio service) communication system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant