A flow control method and device

By monitoring and calculating user-level query rates, personalized traffic control is implemented for different servers in the service cluster, which solves the current limiting problem caused by server differences in the existing technology and improves the performance and user experience of the service system.

CN113765969BActive Publication Date: 2024-10-25BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 13 Cites 0 Cited by

Patent Information

Application Number
CN202011039965.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-28
Publication Date
2024-10-25
Estimated Expiration
2040-09-28

AI Technical Summary

Technical Problem

When there are differences between servers in the service system using existing traffic control methods, servers that can still carry traffic are restricted, reducing the performance of the service system.

Method used

By monitoring the display space information acquisition requests received by the server, the user level information and request number are obtained, the query rate of each user level is calculated, and according to the preset traffic control policy, the server responds to the number of display space information acquisition requests, so that Each server reaches its maximum load capacity.

Benefits of technology

It effectively improves the performance of the service system, ensures that each server in the server cluster reaches the maximum carrying capacity, meets the needs of different users, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113765969B_ABST
    Figure CN113765969B_ABST
Patent Text Reader

Abstract

The present invention discloses a flow control method and device, and relates to the field of computer technology. A specific implementation of the method includes: applying to any server in a service cluster, monitoring the display position information acquisition request received by the applied server, wherein the monitoring result includes: user level information in the display position information acquisition request and the number of display position information acquisition requests within a set period; according to the user level information in the display position information acquisition request and the number of display position information acquisition requests within a set period, calculating the query rate corresponding to each user level; according to the query rate corresponding to each user level and the preset flow control strategy, controlling the number of display position information acquisition requests responded by the server. This implementation can effectively improve the service performance of the service system running in the service cluster.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a flow control method and device. Background Art

[0002] At present, there are various display positions on many web pages, such as product recommendation positions and product display positions on shopping website related web pages. The information of these display positions generally comes from a special service system. Therefore, the stability of the service system will directly affect the display of the display position. When the instantaneous peak traffic of the web page where the display position is located is relatively large (for example, during the promotion activities held by e-commerce, the instantaneous peak traffic of the web pages related to the e-commerce website can be 10-20 times the normal traffic), it will cause an impact on the service system of the display position, and even cause the service system to crash. Traffic control of access is one of the ways to ensure the normal operation of the service system.

[0003] The existing flow limiting method mainly adopts a unified flow limiting rule to control the access flow of each server in the service system, that is, when the query rate per second (QPS) of some servers reaches the threshold, all servers in the service system will be flow limited.

[0004] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0005] When there are differences in traffic between servers in the service system, the existing flow limiting method will cause the servers that can continue to carry traffic to be limited, thereby reducing the service performance of the service system. Summary of the invention

[0006] In view of this, an embodiment of the present invention provides a flow control method and device, which can enable each server in a server cluster to reach its own maximum carrying flow, thereby effectively improving the service performance of a service system running in the service cluster.

[0007] To achieve the above object, according to one aspect of an embodiment of the present invention, a traffic control method is provided, which is applied to any server in a service cluster, and includes:

[0008] Monitoring the display position information acquisition requests received by the server, wherein the monitoring results include: user level information in the display position information acquisition requests and the number of the display position information acquisition requests within a set period;

[0009] Calculating a query rate corresponding to each user level according to the user level information in the display position information acquisition request and the number of the display position information acquisition requests within the set period;

[0010] According to the query rate corresponding to each user level and a preset flow control strategy, the number of display position information acquisition requests responded to by the server is controlled.

[0011] Optionally,

[0012] The flow control method is characterized in that

[0013] The method further comprises: calculating a query rate corresponding to the server according to the number of requests for obtaining the display position information within a set period;

[0014] Determine whether the query rate corresponding to the server is greater than a preset first control threshold; if so, control the number of display position information acquisition requests responded to by the server to be no greater than the first control threshold, wherein the first control threshold is no greater than the sum of the query rates of all user levels managed by the server.

[0015] Optionally,

[0016] The flow control strategy includes:

[0017] The query rate threshold corresponding to each user level; and

[0018] For each of the user levels, in response to a query rate corresponding to the user level being greater than a query rate threshold corresponding to the user level, a request for obtaining display position information corresponding to the user level is intercepted.

[0019] Optionally,

[0020] Controlling the number of display position information acquisition requests responded by the server to be no greater than the first control threshold includes:

[0021] Determine the query ratio of all user levels according to the query rate threshold corresponding to each user level;

[0022] According to the query ratio, a request for obtaining display position information corresponding to the user level is intercepted.

[0023] Optionally,

[0024] The flow control method also includes: in response to the intercepted multiple display position information acquisition requests corresponding to multiple user levels respectively, sorting the intercepted multiple display position information acquisition requests according to the query ratio between the various user levels.

[0025] Optionally,

[0026] The flow control method further comprises:

[0027] Calculating the utilization rate of the server according to the utilization of the central processing unit included in the server within a set period included in the monitoring result;

[0028] In response to the usage rate of the server being greater than a preset second control threshold, the request for obtaining the display position information is intercepted.

[0029] In a second aspect, an embodiment of the present invention provides a flow control device, which is applied to any server in a service cluster, and includes: a monitoring unit and an access management unit, wherein:

[0030] The monitoring unit is used to monitor the display position information acquisition request received by the applied server, wherein the monitoring result includes: user level information in the display position information acquisition request and the number of the display position information acquisition requests within a set period;

[0031] The access management unit is used to calculate the query rate corresponding to each user level according to the user level information in the display position information acquisition request and the number of the display position information acquisition requests within the set period; and control the number of display position information acquisition requests responded to by the server according to the query rate corresponding to each user level and a preset traffic control strategy.

[0032] Optionally,

[0033] The access management unit is further used to calculate the query rate corresponding to the server according to the number of display position information acquisition requests within a set period; determine whether the query rate corresponding to the server is greater than a preset first control threshold, and if so, control the number of display position information acquisition requests responded by the server to be no greater than the first control threshold, wherein the first control threshold is no greater than the sum of the query rates of all user levels managed by the server.

[0034] Optionally,

[0035] The flow control strategy includes:

[0036] The query rate threshold corresponding to each user level; and

[0037] For each of the user levels, in response to a query rate corresponding to the user level being greater than a query rate threshold corresponding to the user level, a request for obtaining display position information corresponding to the user level is intercepted.

[0038] One embodiment of the above invention has the following advantages or beneficial effects: because the solution provided by the embodiment of the present invention is applied to any server in the service cluster, that is, flow control is performed for different servers in the service cluster respectively, based on the actual situation of each server in the service cluster (that is, by monitoring the display position information acquisition request received by the server, the monitoring result includes: the user level information in the display position information acquisition request and the number of the display position information acquisition request within a set period), according to the user level information in the display position information acquisition request and the number of the display position information acquisition request within a set period, the query rate corresponding to each user level is calculated, and then according to the query rate corresponding to each user level and the preset flow control strategy, the number of display position information acquisition requests responded by the server is controlled, so that each server in the server cluster can reach its own maximum carrying flow, thereby effectively improving the service performance of the service system running in the service cluster. In addition, according to the query rate corresponding to each user level and the preset flow control strategy, the flow is controlled for the server, and the flow is controlled differently according to the user level information to meet the needs of different users and improve the user experience.

[0039] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0041] Figure 1 is a schematic diagram of a service cluster of a recommendation service system according to an embodiment of the present invention;

[0042] Figure 2 is a schematic diagram of the main process of the flow control method according to an embodiment of the present invention;

[0043] Figure 3 is a schematic diagram of main units of a flow control device according to an embodiment of the present invention;

[0044] Figure 4 is a schematic diagram of a server in a service cluster according to an embodiment of the present invention;

[0045] Figure 5 is a schematic diagram of the main process of the flow control method according to an embodiment of the present invention;

[0046] Figure 6 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0047] Figure 7 It is a schematic diagram of the structure of a computer system suitable for implementing a server of an embodiment of the present invention. DETAILED DESCRIPTION

[0048] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0049] The architecture of the service cluster where the service system that provides services for various display positions on web pages, such as product recommendation positions and product display positions on relevant web pages of shopping websites, can be as follows: Figure 1 As shown. Figure 1 As shown, service clusters corresponding to the recommendation service system are set up in computer rooms in different regions. For example, the service cluster corresponding to the recommendation service system set up in the computer room in region A includes servers A1, A2, ..., and An, the service cluster corresponding to the recommendation service system set up in the computer room in region B includes servers B1, B2, ..., and Am, ..., and the service cluster corresponding to the recommendation service system set up in the computer room in region X includes servers X1, X2, ..., and Xk, etc., wherein the values ​​of n, m, and k are not less than 2. The corresponding display position information acquisition requests are allocated to computer rooms in different regions through the load balancing layer. The load balancing layer can allocate the display position information acquisition requests to the service cluster corresponding to the recommendation service system set up in the computer room in region A, the service cluster corresponding to the recommendation service system set up in the computer room in region B, ..., and the recommendation service system set up in the computer room in region X, etc., according to the pre-configured allocation ratio of each computer room (for example, computer room in region A: computer room in region B: ...: computer room in region X = 5:2: ...:3). Within the service cluster corresponding to the recommendation service system, corresponding display position information acquisition requests can be allocated to the servers included in the service cluster corresponding to the recommendation service system in a certain proportion, so that the servers included in the service cluster corresponding to the recommendation service system provide display position information corresponding to the display position information acquisition request, such as product information on the display position.

[0050] In the above process, although the corresponding display position information acquisition request is allocated to the service cluster corresponding to each recommendation service system according to the balanced load, it cannot be guaranteed that each server in the service cluster corresponding to the recommendation service system can reach the maximum load capacity. In addition, the above cluster cannot provide differentiated query services according to user differences.

[0051] Therefore, the flow control solution provided by the embodiment of the present invention is a flow control solution for each server in the service cluster, that is, flow control is performed from the server itself to ensure that each server in the service cluster can reach the maximum flow carrying capacity, thereby effectively improving service performance.

[0052] Figure 2 is a flow control method according to an embodiment of the present invention, such as Figure 2 As shown, the flow control method, applied to any server in the service cluster, may include the following steps:

[0053] S201: monitoring the display position information acquisition requests received by the applied server, wherein the monitoring results include: user level information in the display position information acquisition requests and the number of display position information acquisition requests within a set period;

[0054] S202: Calculate the query rate corresponding to each user level according to the user level information in the display position information acquisition request and the number of display position information acquisition requests within a set period;

[0055] S203: According to the query rate corresponding to each user level and the preset flow control strategy, the number of display position information acquisition requests responded to by the server is controlled.

[0056] Among them, the display position information acquisition request refers to a request sent by the client and carrying display position characteristic information such as display position position, display position number, etc. The server can search for text information, pictures, etc. corresponding to the display position position, display position number, etc. from the server based on the display position information acquisition request, and the server sends the found text information, pictures, etc. to the corresponding client, so that the client displays the text information, pictures, etc. on the display position.

[0057] The flow control index may be preset by the user, such as the CPU usage of the server, the number of display position information acquisition requests currently being processed by the server, and the like.

[0058] Figure 2The solution provided by the embodiment shown is applied to any server in the service cluster, that is, flow control is performed for different servers in the service cluster respectively, based on the actual situation of each server in the service cluster (that is, the display position information acquisition request received by the monitoring server, the monitoring result includes: the user level information in the display position information acquisition request and the number of the display position information acquisition request within a set period), according to the user level information in the display position information acquisition request and the number of the display position information acquisition request within a set period, the query rate corresponding to each user level is calculated, and then according to the query rate corresponding to each user level and the preset flow control strategy, the number of display position information acquisition requests responded by the server is controlled, so that each server in the server cluster can reach its own maximum carrying flow, thereby effectively improving the service performance of the service system running in the service cluster. In addition, according to the query rate corresponding to each user level and the preset flow control strategy, the flow is controlled for the server, and the flow is controlled differently according to the user level information to meet the needs of different users and improve the user experience.

[0059] The specific implementation of step S202 may be implemented by adjusting the calculation process accordingly according to the different information included in the monitoring result.

[0060] Among them, user level information refers to the corresponding level set for the user by the service provider based on the user's shopping situation, such as gold user, silver user, bronze user, first-level user, second-level user, etc., and also such as member user, etc.

[0061] The set period may be a preset time period or the number of collection times of the number of display position information acquisition requests, etc. For example, the set period may be 1 second (s), 10s, 100 milliseconds (ms), 300ms, etc. The set period may be modified accordingly according to specific circumstances.

[0062] The number of collection times of the number of display position information acquisition requests refers to the number of display position information acquisition requests received by the server collected once at a certain time interval (for example, 1ms, 10ms, etc.). For example, the set period can be 5 times, 10 times, etc. as a collection time. Since the time interval for collecting the number of display position information acquisition requests received by the server is relatively fixed, the setting period as the time period and the setting period as the collection times can be converted to each other. For example, if the setting period is 5 times, and the collection is performed once every 2ms, the setting period can be converted to an event period of 10ms.

[0063] According to the monitoring results including the user level information in the display position information acquisition request and the number of display position information acquisition requests within a set period, there are two implementation methods for calculating the query rate corresponding to each user level.

[0064] In one embodiment, according to the following calculation formula (1), a first implementation method of calculating the query rate corresponding to each user level is:

[0065]

[0066] Among them, Q i,1 Characterizes the query rate corresponding to the user level i calculated by the first implementation method; i represents the user level; Indicates the number of requests for obtaining display position information corresponding to user level i collected for the first time within a set period; Indicates the number of requests for obtaining display position information corresponding to user level i collected for the second time within a set period; represents the number of display position information acquisition requests corresponding to user level i collected for the nth time within a set period; n represents the total number of collections within a set period; t represents the time interval between collecting the number of adjacent display position information acquisition requests, for example, and get The interval time, etc. This t is generally set according to user needs.

[0067] In one embodiment, a second implementation method of calculating the query rate corresponding to each user level is performed according to the following calculation formula (2):

[0068]

[0069] Among them, Q i,2 Characterizes the query rate corresponding to user level i calculated by implementation method 2; Indicates the number of requests for obtaining display position information corresponding to user level i collected for the first time within a set period; Indicates the number of requests for obtaining display position information corresponding to user level i collected for the second time within a set period; It represents the number of display position information acquisition requests corresponding to user level i collected for the nth time within a set period; n represents the total number of collections within a set period; T represents the duration of a set period. For the set period as the number of collections, T is equal to (the number of collections-1) multiplied by the time interval between two adjacent collections, and the time interval between two adjacent collections is relatively fixed. For the set period as the number of collections, T is equal to (the number of collections-1) multiplied by the time interval between two adjacent collections, which can avoid server overload as much as possible.

[0070] In an embodiment of the present invention, the above-mentioned traffic control method may further include: calculating the query rate corresponding to the server according to the number of display position information acquisition requests within a set period, and judging whether the query rate corresponding to the server is greater than a preset first control threshold; if so, controlling the number of display position information acquisition requests responded by the server to be no greater than the first control threshold, wherein the first control threshold is no greater than the sum of the query rate thresholds of all user levels managed by the server.

[0071] The query rate threshold of the user level may be set in advance by the administrator according to the server performance.

[0072] Accordingly, the sum of the query rate thresholds of all user levels managed by the server may be, for example, the server manages 5 user levels, level 1, level 2, level 3, level 4 and level 5, and the sum of the query rate thresholds of the 5 user levels is the sum of the query rate thresholds of all user levels managed by the server. These user levels may be corresponding user levels generated for user information based on the user's purchase behavior or consumption; the user level may also be corresponding user levels generated for user information based on the user's browsing behavior.

[0073] In the embodiment of the present invention, after determining that the query rate corresponding to the server is less than the preset first control threshold, the number of display position information acquisition requests responded to by the server is controlled directly according to the query rate corresponding to each user level and the preset flow control strategy.

[0074] By judging whether the query rate corresponding to the server is greater than the preset first control threshold, it is possible to combine the query rate corresponding to the server and the query rate corresponding to each user level to perform stricter flow control on the number of display position information acquisition requests responded by the server, so as to ensure that the server can run smoothly under the premise of maximum carrying capacity and avoid downtime and service impact.

[0075] The monitoring result includes the number of display position information acquisition requests within a set period, and a specific implementation method of step S202 is as follows:

[0076] The query rate of the server is calculated based on the number of requests for obtaining display position information within a set period.

[0077] The set period may be a preset time period or the number of collection times of the number of display position information acquisition requests, etc. For example, the set period may be 1 second (s), 10s, 100 milliseconds (ms), 300ms, etc. The set period may be modified accordingly according to specific circumstances.

[0078] The number of collection times of the number of display position information acquisition requests refers to the number of display position information acquisition requests received by the server collected once at a certain time interval (for example, 1ms, 10ms, etc.). For example, the set period can be 5 times, 10 times, etc. as a collection time. Since the time interval for collecting the number of display position information acquisition requests received by the server is relatively fixed, the setting period as the time period and the setting period as the collection times can be converted to each other. For example, if the setting period is 5 times, and the collection is performed once every 2ms, the setting period can be converted to an event period of 10ms.

[0079] There are two ways to calculate the query rate corresponding to the server.

[0080] In one embodiment, according to the following calculation formula (3), the query rate corresponding to the server is calculated in a first implementation method:

[0081]

[0082] Wherein, Q1 represents the query rate corresponding to the server calculated by implementation method 1; Indicates the number of placement information acquisition requests collected for the first time within a set period; Indicates the number of display position information acquisition requests collected for the second time within a set period; Indicates the number of display position information acquisition requests collected for the nth time within a set period; n represents the total number of collections within a set period; t represents the time interval between collecting the number of adjacent display position information acquisition requests, for example, and get The interval time, etc. This t is generally set according to user needs.

[0083] In one embodiment, according to the following calculation formula (4), a second implementation method of calculating the query rate corresponding to the server is:

[0084]

[0085] Among them, Q2 represents the query rate corresponding to the server calculated by implementation method 2; Indicates the number of placement information acquisition requests collected for the first time within a set period; Indicates the number of display position information acquisition requests collected for the second time within a set period; It represents the number of display position information acquisition requests collected for the nth time within a set period; n represents the total number of collections within a set period; T represents the duration of a set period. For the set period as the number of collections, T is equal to (the number of collections-1) multiplied by the time interval between two adjacent collections. The time interval between two adjacent collections is relatively fixed. For the set period as the number of collections, T is equal to (the number of collections-1) multiplied by the time interval between two adjacent collections to avoid server overload as much as possible.

[0086] In an embodiment of the present invention, the above-mentioned traffic control strategy may include: a first query rate threshold corresponding to each user level; and for each user level, in response to the query rate corresponding to the user level being greater than the first query rate threshold corresponding to the user level, intercepting the display position information acquisition request corresponding to the user level. Among them, the first query rate threshold corresponding to each user level can be set according to actual needs. For example, a relatively high first query rate threshold can be assigned to high-level users with higher consumption willingness, and a relatively low first query rate threshold can be assigned to low-level users with relatively low consumption willingness. By intercepting different display position acquisition requests for each user level, the user experience of high-level users can be effectively improved. In addition, the corresponding query rate threshold can also be allocated according to the proportion of users of each level, for example, a relatively high query rate threshold is allocated to the level with a high proportion, and a relatively low query rate threshold is allocated to the level with a low proportion, so as to evenly distribute among users of different levels and meet the needs of users of various levels as much as possible. Accordingly, intercepting the display position information acquisition request corresponding to the user level specifically intercepts part of the display position information acquisition requests corresponding to each user level, so that the number of display position information acquisition requests corresponding to each user level issued to the server is not greater than the first query rate threshold, and at the same time, the number of all corresponding display position information acquisition requests issued to the server is not greater than the first control threshold, so as to ensure that the server can run safely and avoid server overload.

[0087] In an embodiment of the present invention, the number of display position information acquisition requests responded to by the above-mentioned control server is no greater than the first control threshold. The specific implementation method may include: determining the query ratio of all user levels according to the query rate threshold corresponding to each user level; and intercepting the display position information acquisition request corresponding to the user level according to the query ratio.

[0088] Among them, according to the query rate threshold corresponding to each user level, the query ratio of all user levels is determined, which can ensure that the query ratio of all user levels is relatively reasonable, so that users have a better experience.

[0089] Among them, according to the query ratio, the display position information acquisition request corresponding to the user level is intercepted. For example, there are three user levels, and the query ratio between them is user level 1: user level 2: user level 3 = 5:2:2. Then, when the sum of the query rates of all user levels is greater than the first control threshold, the display position information acquisition requests corresponding to user level 1, user level 2 and user level 3 are issued to the server according to 5:2:2, and it is ensured that the number of display position information acquisition requests issued to the server is not greater than the first control threshold.

[0090] It is worth noting that in the process of flow control based on the query ratio between user levels, if the number of display position information acquisition requests corresponding to a certain user level does not meet the query ratio, the query ratio can be filled with display position information acquisition requests corresponding to other user levels to meet the user's display position information acquisition requests as much as possible and ensure the stability of the display position display information.

[0091] In an embodiment of the present invention, the flow control method may further include: calculating the usage rate of the server according to the usage of the central processing unit included in the server within a set period included in the monitoring result; in response to the usage rate of the server being greater than a preset second control threshold, intercepting the display position information acquisition request. The second control threshold can be set by an expert based on experience according to specific circumstances. The number of display position information acquisition requests responded to by the server can be further controlled through the server usage rate, so as to further improve the stability of server operation.

[0092] With respect to the monitoring result including the usage of the central processing unit included in the server within a set period, the above method may further include:

[0093] The utilization rate of the server is calculated based on the usage of the central processing unit (CPU) contained in the server within a set period.

[0094] The set period may be a preset time period or the number of times the CPU usage is collected, etc. For example, the set period may be 1 second (s), 10s, 100 milliseconds (ms), 300ms, etc. The set period may be modified accordingly according to the specific situation.

[0095] The number of times the CPU usage is collected refers to collecting the CPU usage (i.e., CPU occupancy) of the server once at a certain interval (e.g., 1ms, 10ms, etc.). For example, the set period can be 5, 10, etc. collection times as a period. Since the time interval for collecting the CPU usage (i.e., CPU occupancy) of the server once is relatively fixed, the setting period as the time period and the setting period as the number of collections can be converted to each other. For example, if the setting period is 5 collection times, and the collection is performed every 2ms, the set period can be converted to an event period of 10ms.

[0096] There are two ways to calculate the usage rate of the server.

[0097] In one embodiment, according to the following calculation formula (5), the first implementation method of calculating the usage rate corresponding to the server is:

[0098] S1=max{ω 1,CPU ,ω 2,CPU ,…,ω m,CPU} (5)

[0099] Wherein, S1 represents the usage rate of the server calculated by implementation method 1; ω 1,CPU Indicates the CPU usage of the server collected for the first time within a set period; Indicates the CPU usage of the server collected for the second time within a set period; It represents the occupancy rate of the central processing unit (CPU) of the server collected for the mth time within a set period; m represents the total number of collection times within a set period.

[0100] In one embodiment, according to the following calculation formula (6), a second implementation method of calculating the query rate corresponding to the server is:

[0101]

[0102] Wherein, S2 represents the usage rate of the server calculated by the second implementation method; ω 1,CPU Indicates the CPU usage of the server collected for the first time within a set period; Indicates the CPU usage of the server collected for the second time within a set period; It represents the occupancy rate of the central processing unit (CPU) of the server collected for the mth time within a set period; m represents the total number of collection times within a set period.

[0103] In an embodiment of the present invention, the flow control method may further include: in response to the intercepted multiple display position information acquisition requests corresponding to multiple user levels, respectively, sorting the intercepted multiple display position information acquisition requests according to the query ratio between the various user levels, so as to continue to issue the intercepted multiple display position information acquisition requests to the server according to the sorting in the future.

[0104] There are two specific implementation methods for sorting the intercepted multiple display position information acquisition requests according to the query ratios between various user levels.

[0105] The first method is to sort the intercepted multiple placement information acquisition requests:

[0106] All display position information acquisition requests from the highest-level users (users with greater purchasing intention) are ranked in front, and corresponding ranking positions are assigned to other display position information acquisition requests based on the number of display position information acquisition requests from the highest-level users, the query ratio between other user levels and the highest-level users, and the query ratio between other user levels. For example, the query ratio corresponding to level user 1: level user 2: level user 3 is 5:2:2, and level user 1 is the highest level user and the number of display position information acquisition requests corresponding to level user 1 is 1 million, the number of display position information acquisition requests corresponding to level user 2 is 2 million, and the number of display position information acquisition requests corresponding to level user 3 is 1 million. Then, the 1 million display position information acquisition requests corresponding to level user 1 are arranged in front first, and then according to level user 1: level user 2 = 5:2, level user 1: level user 3 = 5:2, the 400,000 display position information acquisition requests corresponding to level user 2 can be arranged after the 1 million display position information acquisition requests corresponding to level user 1, and then, the 400,000 display position information acquisition requests corresponding to level user 3 are arranged after the 400,000 display position information acquisition requests corresponding to level user 2. Then, for the remaining 1.6 million display position information acquisition requests corresponding to level user 2 and 600,000 display position information acquisition requests corresponding to level user 3, the 1.6 million display position information acquisition requests corresponding to level user 2 can be arranged first in the queue with the 400,000 display position information acquisition requests corresponding to level user 3 that are already in the queue, according to level user 2: level user 3 = 1:1, and then the 600,000 display position information acquisition requests corresponding to level user 3 are added to the queue. It is worth noting that for multiple display position information acquisition requests for users of the same level, the multiple display position information acquisition requests can be sorted according to the time sequence of the requests. Through this process, different settings can be made for different users, so that when the server is overloaded, the consumption experience of users with a high willingness to consume can still be guaranteed, reducing the negative impact of display position information display problems on sales.

[0107] The second method is to sort the intercepted multiple display position information acquisition requests:

[0108] Directly sort the intercepted multiple display position information acquisition requests according to the query ratio of users at each level. For example, if the query ratio corresponding to level user 1: level user 2: level user 3 is 5:2:2, then first sort the 5 display position information acquisition requests corresponding to level user 1, then sort the 2 display position information acquisition requests corresponding to level user 2, then sort the 2 display position information acquisition requests corresponding to level user 3, and then sort the 5 display position information acquisition requests corresponding to level user 1, and so on, until all the intercepted multiple display position information acquisition requests are sorted. It is worth noting that when the display position information acquisition requests corresponding to a level of user have been sorted, the display position information acquisition requests corresponding to the level of user can be skipped in the above cycle. Through this process, the access of users of different levels can be balanced.

[0109] In an embodiment of the present invention, the above-mentioned flow control method may further include adding the intercepted display position information acquisition request to a waiting queue. The position of the display position information acquisition request in the waiting queue may be determined by the request time of the display position information acquisition request, that is, the one with an earlier request time is placed in front of the waiting queue, and the one with a later request time is placed in the back of the waiting queue.

[0110] like Figure 3 As shown, an embodiment of the present invention provides a flow control device 300, which is applied to any server 400 in a service cluster, and includes: a monitoring unit 301 and an access management unit 302, wherein:

[0111] The monitoring unit 301 is used to monitor the display position information acquisition request received by the applied server 400, wherein the monitoring result includes: user level information in the display position information acquisition request and the number of display position information acquisition requests within a set period;

[0112] The access management unit 302 is used to calculate the query rate corresponding to each user level according to the user level information in the display position information acquisition request and the number of display position information acquisition requests within a set period; and control the number of display position information acquisition requests responded to by the server according to the query rate corresponding to each user level and a preset flow control strategy.

[0113] In the embodiment of the present invention, the access management unit 302 is further used to calculate the query rate corresponding to the server according to the number of display position information acquisition requests within a set period; determine whether the query rate corresponding to the server is greater than a preset first control threshold, and if so, control the number of display position information acquisition requests responded by the server to be no greater than the first control threshold, wherein the first control threshold is no greater than the sum of the query rates of all user levels managed by the server.

[0114] In an embodiment of the present invention, the traffic control strategy includes: a query rate threshold corresponding to each user level; and for each user level, in response to a query rate corresponding to the user level being greater than the query rate threshold corresponding to the user level, intercepting a request to obtain display position information corresponding to the user level.

[0115] In the embodiment of the present invention, the access management unit 302 is further used to determine the query ratio of all user levels according to the query rate threshold corresponding to each user level; and intercept the display position information acquisition request corresponding to the user level according to the query ratio.

[0116] In the embodiment of the present invention, the access management unit 302 is further configured to, in response to the intercepted multiple display position information acquisition requests corresponding to multiple user levels respectively, sort the intercepted multiple display position information acquisition requests according to the query ratios between the various user levels.

[0117] In the embodiment of the present invention, the access management unit 302 is further used to calculate the usage rate of the server according to the usage of the central processing unit included in the server within a set period included in the monitoring result; in response to the usage rate of the server being greater than a preset second control threshold, intercept the display position information acquisition request.

[0118] In order to clearly explain the flow control method, the following Figure 4 A plurality of servers 400 in a service cluster in any region and a flow control device 300 in each server are shown, Figure 5 The flow control method executed by the flow control device 300 in each server is taken as an example for explanation.

[0119] like Figure 5 As shown, the flow control method executed by the flow control device 300 in each server may include the following steps:

[0120] S501: Configure the corresponding flow control mode for the server, execute step S502 for the flow control device configured with flow control mode 1, execute step S507 for the flow control device configured with flow control mode 2, execute step S510 for the flow control device configured with flow control mode 3; execute step S513 for the flow control device configured with flow control mode 4;

[0121] It is understandable that different servers in the same cluster can be configured with different flow control methods, and servers in different clusters can also be configured with different flow control methods, that is, personalized configuration can be performed for each server to better fit the characteristics of the server itself. For example, Figure 4 Some servers shown use flow control method 1 for flow control, and others use flow control method 2 for flow control. Figure 4 All servers shown use the same flow control method. For example, Figure 4 Among the servers shown, some servers use flow control mode 1 for flow control, some servers use flow control mode 2 for flow control, some servers use flow control mode 3 for flow control, some servers use flow control mode 4 for flow control, and some servers use flow control mode 5 for flow control. Only one flow control mode can be used for flow control at the same time in a server. Different flow control modes can be configured at different stages of the same server to better meet server requirements and provide better services to users.

[0122] S502: monitoring the display position information acquisition requests received by the server used by the flow control device, and obtaining the number of display position information acquisition requests within a set period and user level information in the display position information acquisition requests;

[0123] S503: Calculate the query rate corresponding to the server;

[0124] S504: In response to the query rate being greater than the first control threshold, calculating the query rate corresponding to each user level;

[0125] The calculation process can be implemented according to the above calculation formula (1) or (2).

[0126] S505: intercepting the display position information acquisition request according to the query rate corresponding to each user level and the preset flow control strategy;

[0127] S506: adding the intercepted display position information acquisition request to the waiting queue, and ending the current process;

[0128] S507: monitoring the operation of the server used by the flow control device and the display position information acquisition request received by the server, and obtaining the usage of the central processing unit included in the server within a set period, the user level information in the display position information acquisition request, and the number of the display position information acquisition request within the set period;

[0129] S508: Calculate the usage rate of the server;

[0130] S509: In response to the usage rate being greater than the second control threshold, calculating the query rate corresponding to each user level, and executing step S505;

[0131] S510: monitoring the display position information acquisition requests received by the server used by the flow control device and the operation status of the server, and obtaining the number of display position information acquisition requests within a set period and the usage status of the central processor included in the server;

[0132] S511: Calculate the query rate corresponding to the server and the usage rate of the server;

[0133] S512: In response to the query rate being greater than the first control threshold or the server usage being greater than the second control threshold, calculating the query rate corresponding to each user level, and executing step S506;

[0134] S513: monitoring the display position information acquisition request received by the server used by the flow control device, and obtaining the user level information in the display position information acquisition request and the number of display position information acquisition requests within a set period;

[0135] S514: Calculate the query rate corresponding to each user level;

[0136] S515: For each user level, in response to a query rate corresponding to the user level being greater than a query rate threshold corresponding to the user level, intercepting a request for obtaining display position information corresponding to the user level;

[0137] S516: In response to the intercepted multiple display position information acquisition requests corresponding to multiple user levels respectively, the intercepted multiple display position information acquisition requests are sorted according to query ratios between the various user levels.

[0138] It is worth noting that for the intercepted display position information acquisition request, blank data is returned to the client corresponding to the display position information acquisition request. After the display position information corresponding to the display position information acquisition request is subsequently acquired, the display position information is provided to the client.

[0139] Figure 6 An exemplary system architecture 600 is shown to which the flow control method or flow control device according to the embodiment of the present invention can be applied.

[0140] like Figure 6 As shown, the system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 6051 in a service cluster 605. The network 604 is used to provide a medium for communication links between the terminal devices 601, 602, 603, and the server 6051 in the service cluster 605. The network 604 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0141] The user can use the terminal devices 601, 602, 603 to interact with the server 6051 in the service cluster 605 through the network 604 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 601, 602, 603, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).

[0142] The terminal devices 601 , 602 , and 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.

[0143] The server 6051 in the service cluster 605 may be a server that provides various services, such as a backend management server that provides support for shopping websites browsed by users using terminal devices 601, 602, and 603, such as providing display position information, pictures, etc. (only for example). The backend management server may analyze and process the received display position information acquisition request and other data, and feed back the processing results (such as display position push information, product information - only for example) to the terminal device.

[0144] It should be noted that the flow control method provided in the embodiment of the present invention is generally executed by the server 6051, and accordingly, the flow control device is generally set in the server 6051.

[0145] It should be understood that Figure 6 The number of terminal devices, networks, service clusters, and servers in the service clusters is only for illustration purposes. Any number of terminal devices, networks, and servers may be provided as required.

[0146] Reference below Figure 7 , which shows a schematic diagram of the structure of a server computer system 700 suitable for implementing an embodiment of the present invention. Figure 7 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0147] like Figure 7As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0148] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.

[0149] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the system of the present invention are executed.

[0150] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0151] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0152] The units involved in the embodiments of the present invention may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes a monitoring unit and an access management unit. The names of these units do not constitute a limitation on the units themselves in some cases, for example, the monitoring unit may also be described as "a unit for monitoring the display position information acquisition request received by the server".

[0153] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: monitoring the display position information acquisition request received by the applied server, wherein the monitoring result includes: user level information in the display position information acquisition request and the number of display position information acquisition requests within a set period; according to the user level information in the display position information acquisition request and the number of display position information acquisition requests within a set period, calculating the query rate corresponding to each user level; according to the query rate corresponding to each user level and the preset traffic control strategy, controlling the number of display position information acquisition requests responded to by the server.

[0154] According to the technical solution of the embodiment of the present invention, it is applied to the server in the service cluster, that is, flow control is performed for different servers in the service cluster respectively, based on the actual situation of each server in the service cluster (that is, the display position information acquisition request received by the monitoring server, the monitoring result includes: the user level information in the display position information acquisition request and the number of the display position information acquisition request within a set period), according to the user level information in the display position information acquisition request and the number of the display position information acquisition request within a set period, the query rate corresponding to each user level is calculated, and then according to the query rate corresponding to each user level and the preset flow control strategy, the number of display position information acquisition requests responded by the server is controlled, so that each server in the server cluster can reach its own maximum carrying flow, thereby effectively improving the service performance of the service system running in the service cluster. In addition, according to the query rate corresponding to each user level and the preset flow control strategy, the flow is controlled for the server, and the flow is controlled differently according to the user level information to meet the needs of different users and improve the user experience.

[0155] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A flow control method, characterized in that: Applies to any server in the service cluster, including: Monitoring the display position information acquisition requests received by the server, wherein the monitoring results include: user level information in the display position information acquisition requests and the number of the display position information acquisition requests within a set period, wherein the user level information refers to the corresponding level set for the user by the service provider according to the user's shopping situation; Calculating a query rate corresponding to each user level according to the user level information in the display position information acquisition request and the number of the display position information acquisition requests within the set period; According to the query rate corresponding to each user level and the preset flow control strategy, the number of display position information acquisition requests responded to by the server is controlled; The calculating of the query rate corresponding to each user level comprises: For each of the user levels, perform the following operations: Calculate the ratio between the number of display position information acquisition requests corresponding to the user level collected each time and the collection time interval within a set period, wherein the time intervals of every two adjacent collections are consistent; Selecting a maximum ratio from the multiple ratios as the query rate corresponding to the user level; or, Calculate the total number of display position information acquisition requests corresponding to the user level collected within a set period; The ratio of the calculated sum to the duration of the set period is used as the query rate corresponding to the user level.

2. The flow control method according to claim 1, characterized in that: The method further comprises: calculating a query rate corresponding to the server according to the number of requests for obtaining the display position information within a set period; Determine whether the query rate corresponding to the server is greater than a preset first control threshold; if so, control the number of display position information acquisition requests responded to by the server to be no greater than the first control threshold, wherein the first control threshold is no greater than the sum of query rate thresholds of all user levels managed by the server.

3. The flow control method according to claim 2, characterized in that: The flow control strategy includes: The query rate threshold corresponding to each user level; and For each of the user levels, in response to a query rate corresponding to the user level being greater than a query rate threshold corresponding to the user level, a request for obtaining display position information corresponding to the user level is intercepted.

4. The flow control method according to claim 3, characterized in that: Controlling the number of display position information acquisition requests responded by the server to be no greater than the first control threshold includes: Determine the query ratio of all user levels according to the query rate threshold corresponding to each user level; According to the query ratio, a request for obtaining display position information corresponding to the user level is intercepted.

5. The flow control method according to claim 4, characterized in that: Also includes: In response to the intercepted plurality of display position information acquisition requests corresponding to a plurality of user levels respectively, the intercepted plurality of display position information acquisition requests are sorted according to query ratios between the various user levels.

6. The flow control method according to any one of claims 1 to 5, characterized in that: Further including: Calculating the utilization rate of the server according to the utilization of the central processing unit included in the server within a set period included in the monitoring result; In response to the usage rate of the server being greater than a preset second control threshold, the request for obtaining the display position information is intercepted.

7. A flow control device, characterized in that: Applied to any server in the service cluster, including: a monitoring unit and an access management unit, wherein: The monitoring unit is used to monitor the display position information acquisition request received by the applied server, wherein the monitoring result includes: user level information in the display position information acquisition request and the number of the display position information acquisition requests within a set period, wherein the user level information refers to the corresponding level set for the user by the service provider according to the user's shopping situation; The access management unit is used to calculate the query rate corresponding to each user level according to the user level information in the display position information acquisition request and the number of the display position information acquisition requests within the set period; and control the number of display position information acquisition requests responded to by the server according to the query rate corresponding to each user level and a preset flow control strategy; The access management unit is further configured to: for each of the user levels, perform the following operations: Calculate the ratio between the number of display position information acquisition requests corresponding to the user level collected each time and the collection time interval within a set period, wherein the time intervals of every two adjacent collections are consistent; Selecting a maximum ratio from the multiple ratios as the query rate corresponding to the user level; or, Calculate the total number of display position information acquisition requests corresponding to the user level collected within a set period; The ratio of the calculated sum to the duration of the set period is used as the query rate corresponding to the user level.

8. The flow control device according to claim 7, characterized in that: The access management unit is further used to calculate the query rate corresponding to the server according to the number of display position information acquisition requests within a set period; determine whether the query rate corresponding to the server is greater than a preset first control threshold, and if so, control the number of display position information acquisition requests responded by the server to be no greater than the first control threshold, wherein the first control threshold is no greater than the sum of the query rates of all user levels managed by the server.

9. The flow control device according to claim 7, characterized in that: The flow control strategy includes: The query rate threshold corresponding to each user level; and For each of the user levels, in response to a query rate corresponding to the user level being greater than a query rate threshold corresponding to the user level, a request for obtaining display position information corresponding to the user level is intercepted.

10. A flow control electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

11. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Flow control method and device

    CN104518981A

  • Information access control method and server

    CN106357789A

  • Dynamic current limiting method, apparatus, and system

    CN109005125A

  • Business rule-based message push request flow control method, device and medium

    CN109474542A

  • User flow control device

    CN109756426A