Access request distribution method and device, electronic equipment and storage medium
By calculating the predicted time coefficients of user access requests in a distributed storage system and allocating allocation strategies, the problem of uneven load of storage nodes is solved, single point of failure is avoided, and system stability and security are improved.
Patent Information
- Application Number
- CN202411507564.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-10-28
AI Technical Summary
In a distributed storage system, since each storage node stores the same content, the equalization of user access requests may lead to uneven load on the storage node, resulting in excessive load on some storage nodes, which in turn causes a single point of failure.
By obtaining user access information of multiple storage nodes in the network disk system, the predicted time coefficient of each user access request is calculated, and the user access request is allocated to multiple storage nodes according to the preset allocation strategy to achieve uniform distribution of load.
It effectively avoids single point of failure caused by excessive load of storage nodes, improves system stability and security, and ensures high data availability.
Smart Images

Figure CN119544713A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of cloud computing service management, and in particular to a method, device, electronic device and storage medium for allocating access requests. Background Art
[0002] Currently, data is usually backed up in a distributed storage manner to avoid data loss. Each storage node in the distributed storage stores the same data for backup, so that if data is lost in any storage node, it can be promptly compensated through backup, greatly improving data security.
[0003] In the related art, since each storage node stores the same content, user access requests within a region will be evenly distributed to each storage node in the region. If the distribution is performed without analysis, the final load state of each storage node will be different, resulting in the problem of overload of the storage node leading to a single point failure. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a method, device, electronic device and storage medium for allocating access requests, so as to solve the problem of single point failure caused by excessive load on storage nodes.
[0005] To solve the above technical problems, the embodiments of the present application are implemented as follows: In a first aspect, an embodiment of the present application provides a method for allocating access requests, comprising: obtaining user access information corresponding to multiple storage nodes in a network disk system, and multiple user access requests to be allocated to the multiple storage nodes, the user access information including the user's historical access to the storage nodes; determining a predicted time coefficient for each of the user access requests based on the user access information, the predicted time coefficient being used to predict the time length for the network disk system to process the user access request; and allocating each of the user access requests to the multiple storage nodes according to a preset allocation strategy based on the predicted time coefficient for each of the user access requests.
[0006] In a second aspect, an embodiment of the present application provides an access request allocation device, comprising: a data collection module, used to obtain user access information corresponding to multiple storage nodes in a network disk system, and multiple user access requests to be allocated to the multiple storage nodes, the user access information including the user's historical access to the storage nodes; a prediction analysis module, used to determine a predicted time coefficient for each of the user access requests based on the user access information, the predicted time coefficient being used to predict the time length for the network disk system to process the user access request; an access management module, used to allocate each of the user access requests to the multiple storage nodes according to a preset allocation strategy based on the predicted time coefficient for each of the user access requests.
[0007] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory electrically connected to the processor, the memory storing a computer program, and the processor being used to call and execute the computer program from the memory to implement the above-mentioned method of allocating access requests.
[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program can be executed by a processor to implement the above-mentioned method for allocating access requests.
[0009] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the above-mentioned method for allocating access requests.
[0010] In a sixth aspect, an embodiment of the present application provides a computer program product, wherein the computer program product includes a computer program, and when the computer program is executed by a processor, the computer program implements the above-mentioned method for allocating access requests.
[0011] Adopting the technical solution of the embodiment of the present application, by obtaining the user access information corresponding to multiple storage nodes in the network disk system, and multiple user access requests to be allocated to multiple storage nodes, the user access information includes the user's historical access to the storage node; according to the user access information, the predicted time coefficient of each user access request is determined, and the predicted time coefficient is used to predict the time length of the network disk system processing the user access request; based on the predicted time coefficient of each user access request, according to the preset allocation strategy, each user access request is allocated to multiple storage nodes. It can be seen that according to the user access information corresponding to multiple storage nodes in the network disk system, the predicted time coefficient of each user access request to be allocated to multiple storage nodes is calculated, and the time length of the user access request can be predicted in advance. According to the predicted time coefficient of the user access request and the preset allocation strategy, each user access request can be more evenly allocated to each storage node, preventing individual storage nodes from receiving too many user access requests and causing overload, and can solve the problem of single point failure caused by overload of storage nodes. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate one or more embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in one or more embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0013] Figure 1 is a schematic diagram of a system for allocating access requests according to an embodiment of the present application; Figure 2 is a schematic flow chart of a method for allocating access requests according to an embodiment of the present application; Figure 3 is a schematic flow chart of a method for allocating access requests according to another embodiment of the present application; Figure 4 is a schematic block diagram of a device for allocating access requests according to an embodiment of the present application; Figure 5 It is a hardware structure diagram of an access request allocation device according to an embodiment of the present application. DETAILED DESCRIPTION
[0014] The embodiments of the present application provide a method, device, electronic device and storage medium for allocating access requests, so as to solve the problem of single point failure caused by overload of storage nodes.
[0015] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0016] The access request allocation method provided in the embodiment of the present application can be executed by an electronic device, or by software installed in the electronic device. Specifically, the electronic device can be a terminal device or a server device. Among them, the terminal device can include a smart phone, a laptop computer, a smart wearable device, a vehicle terminal, etc., and the server device can include an independent physical server, a server cluster composed of multiple servers, or a cloud server capable of cloud computing.
[0017] Figure 1 FIG. 1 is a schematic diagram of a system for allocating access requests according to an embodiment of the present application. Figure 1 As shown, the system includes: a distributed storage module, a data collection module, a prediction analysis module, and an access management module, wherein the access management module includes a queue unit and an allocation unit. Specifically, the distributed storage module includes multiple accessible storage nodes; the data collection module is used to collect user access information of each user in the cloud disk system; the prediction analysis module is used to calculate the predicted time coefficient of each user access request to be allocated based on the user access information of the user; the access management module is used to manage the user access requests and storage nodes of the system, wherein the queue unit is used to add the received user access request to the queue corresponding to the storage node and generate queue information, and the allocation unit is used to allocate the user access request in the queue unit to multiple storage nodes of the distributed storage module, and can control the access number of the storage node according to the queue information, and allocate the user access request according to the predicted time coefficient and the access number of the storage node. Through the supervision of the security of the storage node, the user access request can be reasonably allocated to improve the stability and security of the operation of the storage node.
[0018] In the following, in conjunction with the accompanying drawings, a method for allocating access requests provided by an embodiment of the present application is described in detail through specific embodiments and application scenarios.
[0019] Figure 2 A schematic flow chart of a method for allocating access requests provided by an embodiment of the present invention is shown, the method comprising the following steps: S202, obtaining user access information corresponding to multiple storage nodes in the network disk system, and multiple user access requests to be allocated to the multiple storage nodes.
[0020] The user access information includes the user's historical access to the storage node.
[0021] A network disk system consists of multiple servers. Through distributed computing such as cloud computing, computing resources, storage resources, and applications are virtualized and provided to users on demand.
[0022] Storage nodes are components used to actually store business data. The network disk system includes multiple storage nodes.
[0023] User access information includes storage node information accessed by users in the network disk system, user information, user access request information, and the duration of user access to storage nodes, etc. It can record detailed data of each user's access to storage nodes, including the current user who has made a user access request and historical users.
[0024] A user access request includes a user's request to access content stored in a storage node. For example, a user access request is a request to a server to send a resource (such as a web page, etc.).
[0025] Multiple user access requests to be allocated to multiple storage nodes include other unallocated user access requests corresponding to when the number of user access requests in all storage nodes slightly exceeds the safety load number of all storage nodes in the current area, and may also include other unallocated user access requests corresponding to when the number of user access requests in all storage nodes does not exceed the safety load number of all storage nodes in the current area, without specific limitation.
[0026] S204: Determine a predicted time coefficient of each user access request according to the user access information.
[0027] Among them, the predicted time coefficient is used to predict the time it takes for the network disk system to process user access requests.
[0028] Specifically, the duration of a user access request is the duration of the user accessing the content in the storage node. The longer the duration, the greater the load of the user access request, and therefore, the greater the load of the accessed storage node. It can be seen that the duration of a user access request can represent the load of the user access request, and can affect the number of user access requests accessing the target storage node. The more user access requests accessing the target storage node, the greater the load of the target storage node. It can be seen that the prediction time coefficient is specifically used to predict the load size corresponding to the user access request.
[0029] S206: Allocate each user access request to a plurality of storage nodes based on the predicted time coefficient of each user access request and in accordance with a preset allocation strategy.
[0030] The preset allocation strategy includes adjusting the number of storage nodes that carry user access requests.
[0031] Based on the load prediction of each user access request, the predicted time coefficient is obtained, combined with the preset allocation strategy, and based on the load size of the received user access requests predicted in advance, each user access request is more evenly distributed to multiple storage nodes.
[0032] Adopting the technical solution of the embodiment of the present application, by obtaining user access information corresponding to multiple storage nodes in the network disk system, and multiple user access requests to be allocated to multiple storage nodes, the user access information includes the user's historical access to the storage node; according to the user access information, determine the predicted time coefficient of each user access request, the predicted time coefficient is used to predict the time length of the network disk system processing the user access request; based on the predicted time coefficient of each user access request, according to the preset allocation strategy, allocate each user access request to multiple storage nodes. It can be seen that according to the user access information corresponding to multiple storage nodes in the network disk system, the predicted time coefficient of each user access request to be allocated to multiple storage nodes is calculated, and the duration of the user access request can be predicted in advance. According to the predicted time coefficient of the user access request and the preset allocation strategy, each user access request can be more evenly allocated to each storage node, preventing individual storage nodes from receiving too many user access requests and causing overload, and solving the problem of single point failure caused by overload of storage nodes.
[0033] In one embodiment, the predicted time coefficient of each user access request is determined according to the user access information (ie, S204), and the following steps A1-A2 may be performed: Step A1: partitioning the contents in multiple storage nodes to obtain a preset number of partitions.
[0034] Specifically, the content in the storage node includes resource data stored in the storage node. The content in the storage node is partitioned to obtain a preset number of partitions, which is the number of partitions set according to the storage content, that is, without omission or duplication, the number and method of partitioning are not specifically limited. As an example, the content stored in the storage node is divided according to the web pages contained in the content, and each web page is recorded as a part.
[0035] Step A2: Based on the user access information, determine the preset weight coefficient corresponding to the user access request, the expected value of the user browsing the preset number of partitions corresponding to the user access request, the expected value of the access time of the preset number of partitions with the highest user browsing frequency corresponding to the user access request, the historical access time of all users in the network disk system and the preset standard time, and calculate the predicted time coefficient of each user access request.
[0036] The user access information includes the user's historical access to the storage node, such as the historical access data of all users to each storage node.
[0037] Based on user access information, the formula for calculating the predicted time coefficient of each user access request is as follows:
[0038] in, The content stored in the storage node is divided into N partitions based on the predicted time coefficient of the user access request.
[0039] and , are preset weight coefficients corresponding to user access requests, which respectively represent the weights of the duration of user access requests corresponding to the user (ie, the current user) and historical users.
[0040] N is the expected value of the user's access request corresponding to the user browsing the preset number of partitions, including, according to the number of the preset number of partitions in step A1, the optimal number of visits to the preset number of partitions corresponding to the user's access request within the first preset time, that is, the expected value of the digital set of several partitions in the preset number of partitions visited by the current user.
[0041] , They respectively represent the expected values of the access durations of the preset number of partitions with the highest user browsing frequency corresponding to the user access request, including, among the preset number of partitions browsed by the user corresponding to the user access request, the expected values of the digital set of the access durations of the partitions with the highest access frequency within the first preset time.
[0042] It is the historical access duration of all users in the network disk system, including, within the first preset time, the expected value of the digital set of the historical access duration of all users within a preset time period.
[0043] The preset standard duration includes the standard duration for all users to access the storage node within the first preset time.
[0044] Specifically, according to the historical access data of the current user in the user access information, the historical access time of the user corresponding to the user access request is obtained; according to the historical access data of all users in the user access information, the historical access time of all users is obtained; the historical access time of the user corresponding to the user access request and the historical access time of all users are weightedly summed up to obtain the predicted time coefficient of the user access request.
[0045] In this embodiment, by partitioning the contents in multiple storage nodes, a preset number of partitions are obtained, and based on the user access information, the preset weight coefficient corresponding to the user access request, the expected value of the user browsing the preset number of partitions corresponding to the user access request, the expected value of the access time of the preset number of partitions with the highest user browsing frequency corresponding to the user access request, the historical access time of all users in the network disk system and the preset standard time are determined, and then the predicted time coefficient of each user access request is calculated. The access time of the user access request can be predicted more accurately, so that the user access request can be more reasonably distributed to multiple storage nodes for processing, and the balance of allocating user access requests to storage nodes is improved.
[0046] In one embodiment, the preset weight coefficient (ie, step A2) includes: a preset first weight coefficient and a preset second weight coefficient, and the following steps A21-A22 may be performed: Step A21: within a first preset time period, when the number of historical accesses of the user access request corresponding to the user accessing the storage node is greater than the preset number of accesses, determining that the preset first weight coefficient is greater than the preset second weight coefficient.
[0047] The first preset time length is consistent with the preset time length for collecting data when calculating the predicted time coefficient in step A2.
[0048] Step A22: subtract 1 from the quotient of the historical number of visits and the preset number of visits, and multiply the obtained result by a monotonically increasing conversion function within a first preset range to obtain a preset first weight coefficient.
[0049] The sum of the preset first weight coefficient and the preset second weight coefficient is equal to a preset constant determined based on empirical data.
[0050] Specifically, the calculation formula of the preset first weight coefficient is:
[0051] Among them, m is the number of historical accesses, which includes the number of historical accesses to each storage node by the user corresponding to the user access request obtained from the access information, i.e., the current user, within the first preset time period, based on the current time point at which the user access request is obtained.
[0052] It is a preset number of times, specifically including empirical constants set based on experience.
[0053] The independent variable is And the monotonically increasing conversion function within the first preset range, the first preset range includes the value interval defined in .
[0054] According to step A21, if the historical access times of the user access request corresponding to the user accessing the storage node is greater than the preset access times, then , the preset first weight coefficient can be obtained through the above formula The value of .
[0055] Furthermore, since the sum of the preset first weight coefficient and the preset second weight coefficient is equal to the preset constant c determined based on empirical data, then the second weight coefficient Can be Calculate and obtain.
[0056] In this embodiment, by obtaining the historical access times and the preset access times of the user accessing the storage node corresponding to the user access request, and comparing them, when the historical access times are greater than the preset access times, a preset first weight coefficient and a preset second weight coefficient are determined by a calculation formula. Based on the determined preset first weight coefficient and the preset second weight coefficient, the weights of the user access request corresponding to the user and the historical user access information are more accurately determined, so as to improve the accuracy of calculating the predicted time coefficient of the user access request.
[0057] In one embodiment, the preset first weight coefficient (i.e., step A2) may further perform the following step A23: Step A23: When the historical access times of the user access request corresponding to the user accessing the storage node are less than the preset access times, determine that the preset first weight coefficient is less than the preset second weight coefficient, and determine the preset first weight coefficient as a constant within the second preset range.
[0058] Specifically, when the historical access times of the user access request corresponding to the user accessing the storage node is less than or equal to the preset access times, the preset first weight coefficient is less than the preset second weight coefficient, that is, .
[0059] The second preset range includes That is, The value range is The constant on pass Calculate and obtain.
[0060] In this embodiment, by obtaining the historical access times and the preset access times of the user accessing the storage node corresponding to the user access request, and comparing them, when the historical access times are less than or equal to the preset access times, the value of the preset first weight coefficient is taken as a constant within the second preset range, so as to more accurately determine the weight of the user corresponding to the user access request and the historical user access information, so as to improve the accuracy of calculating the predicted time coefficient of the user access request.
[0061] In one embodiment, after obtaining user access information corresponding to multiple storage nodes in the network disk system and multiple user access requests to be allocated to multiple storage nodes (ie, S202), the following step B may be specifically performed: Step B: Add the user access request to the queue corresponding to the storage node, and generate queue information, wherein the queue information includes: the number of load user access requests allowed by the storage node in the network disk system.
[0062] The characteristic of the queue is its first-in-first-out nature. The user access request that enters the queue earliest will be processed first, and the user access requests that enter later will be processed in sequence. It can be used to process user access requests and ensure the fairness and orderliness of the system.
[0063] The queue corresponding to the storage node includes: information about user access requests to be allocated and storage nodes. Queue information corresponding to each storage node is generated based on the storage node information and user access requests. The queue information is mainly used to characterize the number of load user access requests allowed by the storage node. That is, the received user access requests to be allocated are added to the queue and queue information is generated. The number of load user access requests allowed by the storage node can also be controlled based on the queue information, and multiple user access requests to be allocated can be dispersed to multiple corresponding storage nodes. Among them, all storage nodes and user access requests to be allocated can also share a queue to allocate the user access requests to be allocated to the target storage node based on the calculated predicted real coefficients of the user access requests to be allocated and the queue information of the queue corresponding to each storage node.
[0064] In this embodiment, by adding user access requests to the queue corresponding to the storage node, the user access requests to be allocated can be allocated in order of priority, and the number of load user access requests allowed by the storage node can be determined based on the queue information corresponding to the storage node generated in the queue. The number of load user access requests allowed by the storage node after the load including the user access requests to be allocated can be accurately obtained, so as to achieve a more accurate effect of allocating user access requests.
[0065] In one embodiment, each user access request is allocated to multiple storage nodes according to a preset allocation strategy (ie, S206), and the following step C1 may be performed: Step C1: Distribute the user access requests in the queue to the storage nodes according to the adjustment coefficient of each storage node among the multiple storage nodes. The adjustment coefficient is used to characterize the load degree of the user access requests that the storage node can bear; wherein the adjustment coefficient of the storage node is used to dynamically adjust the load of the storage node when distributing the user access requests.
[0066] Specifically, the adjustment coefficient of the storage node can adjust the load of the operation queue of the storage node, that is, according to the adjustment coefficient of the storage node, the load of the storage node is dynamically adjusted when allocating user access requests. The calculation of the adjustment coefficient of the storage node can be expressed as:
[0067] The adjustment coefficient of the storage node is Wh, where L is the queue length corresponding to the storage node, k is the slope of the regression line, t is the interval span of the first preset time length, F and G are both preset monotonically increasing functions, and r is the conversion function of the first preset time length interval span t; the number of accesses allowed to carry user access requests of the storage node is adjusted according to the adjustment coefficient.
[0068] In this embodiment, the number of user accesses allowed to be carried in the storage node can be adjusted according to the adjustment coefficient of the storage node. When allocating user access requests, the adjustment coefficient can be used to dynamically adjust the load of each storage node, so that the load quantity of the storage node can be effectively controlled.
[0069] In one embodiment, based on the predicted time coefficient of each user access request and according to a preset allocation strategy, each user access request is allocated to multiple storage nodes (ie, S206), and the following steps D1-D2 may be performed: Step D1: Determine the load of each user access request based on the predicted time coefficient of each user access request.
[0070] According to the predicted time coefficient of the user access request, the duration of the user access request to access the storage node can be predicted, and the load of the user access request can be predicted based on the duration.
[0071] Step D2: According to the load of user access requests and the adjustment coefficient of each storage node, the user access requests in the queue are distributed to each storage node according to a preset load balancing rule.
[0072] According to the load of user access requests predicted in step D1 and the adjustment coefficient of the storage node, the load of the storage node is dynamically adjusted, and according to the preset load balancing rules, user access requests can be distributed to the storage node without exceeding the allowed access quantity of the storage node.
[0073] Among them, the specific implementation method of the preset load balancing rule includes: according to the load of the user access request to be allocated, the user access request is preferentially allocated to the storage node with a small number of user access requests on the load, and the number of user access requests for the allowed load has not reached the allowed load after receiving the user access request; when the storage nodes have reached the number of user access requests for the allowed load but have not reached the rated load, the user access request is preferentially allocated to the storage node with a small number of user access requests on the load; wherein the number of user access requests for the allowed load in the storage node is dynamically adjusted according to the corresponding adjustment coefficient to ensure that the load of the storage node after the user access request is allocated does not exceed the rated load of the storage node; if when the user access request is received, the number of user access requests for the allowed load of the storage node has reached the rated load, then the access request is allocated to other storage nodes.
[0074] It should be noted that, according to the number of user access requests of the storage node allowed load and the predicted time coefficient of the user access request to be allocated, the user access requests exceeding the number of the left endpoint of the total security threshold are controlled for allocation, wherein the left endpoint of the total security threshold is the sum of the left endpoint values of the security threshold interval of each storage node. For example, when the sum of the loads of each storage node exceeds the sum of the values of the left endpoints in the security threshold area, the sum of the left endpoint values of the security threshold interval is the sum of the minimum values in the security threshold interval. At this time, the number of user access requests of the storage node allowed load can be controlled by adjusting the coefficient, and the user access requests to be allocated can be allocated. It can be seen that when adding the user access request to be allocated, when the number of user access requests in the storage node has slightly exceeded the number of current security loads of all storage nodes, the storage node can be reasonably analyzed and allocated and adjusted, so that the user access request to be allocated can be allocated to the storage node, so that each storage node is as evenly loaded as possible, and the security of the storage node is guaranteed.
[0075] In this embodiment, based on the predicted time coefficient of each user access request, the load of each user access request is predicted, and according to the load of the user access request and the adjustment coefficient of the storage node, the number of user access requests allowed by the storage node is adjusted according to the preset load balancing rule, so that each user access request is evenly distributed to multiple storage nodes. After adjusting the number of user access requests of the storage node load, the storage node makes the load of each storage node close on the basis of the predicted load of the user access request, which can improve the operation safety of each storage node.
[0076] In one embodiment, the load of the storage node is dynamically adjusted (ie, step C1), and specifically, the following steps E1-E2 may be performed: Step E1: Determine a preset adjustment interval of the storage node according to user access information.
[0077] The preset adjustment interval includes: a first adjustment interval number and a second adjustment interval number, wherein the first adjustment interval number is smaller than the second adjustment interval number.
[0078] According to the user access information, the historical information data corresponding to each storage node is obtained, and the historical user access volume and stored information of the storage node are determined according to the historical information data, and then the preset adjustment interval of each storage node is determined. The adjustment interval is used to characterize the minimum and maximum values of the number of user access requests allowed in the storage node.
[0079] Step E2: When the adjustment coefficient of the storage node is less than the first adjustment interval number, the number of user access requests of the corresponding storage node in the queue information is not adjusted.
[0080] When the adjustment coefficient of a storage node is less than the first adjustment interval number, the number of user access requests for the allowed load in the storage node is less than the first adjustment interval number, and the number of user access requests for the allowed load for the corresponding storage node in the queue information is not adjusted. When the storage node receives a user access request, it can provide access information, wherein the number of user access requests for the allowed load corresponding to the adjustment coefficient of the storage node includes the user access requests to be allocated after the predicted timing coefficient.
[0081] For example, the preset adjustment interval is , the first adjustment interval number is , the second adjustment interval number is , the adjustment coefficient of the storage node is ,when , the number of user access requests for the allowed load of the storage node is not adjusted.
[0082] In this embodiment, the preset adjustment interval of the storage node is determined based on the historical access situation in the user access information, and the adjustment coefficient of the storage node is compared with the preset adjustment interval. When the adjustment coefficient of the storage node is less than the first adjustment interval number, it means that the load in the storage node allows the user access request of the load to be less than the minimum value in the preset adjustment interval, and the adjustment coefficient of the storage node is not adjusted.
[0083] In one embodiment, the load of the storage node is dynamically adjusted (ie, step C1), and specifically the following step F may be performed: Step F: When the adjustment coefficient of the storage node is greater than or equal to the first adjustment interval number and less than or equal to the second adjustment interval number, the number of user access requests of the corresponding storage node in the queue information is adjusted within the allowed access amount.
[0084] The adjustment coefficient of the storage node is proportional to the allowed access volume of the storage node.
[0085] When the adjustment coefficient of the storage node is greater than or equal to the first adjustment interval number and less than or equal to the second adjustment interval number, the number of user access requests allowed to the load in the storage node is greater than or equal to the first adjustment interval number and less than or equal to the second adjustment interval number, and the number of user access requests allowed to the load by the corresponding storage node in the queue information can be adjusted within the preset adjustment interval, and when the storage node receives a user access request, it can provide access information. Among them, within the preset adjustment interval, the larger the adjustment coefficient corresponding to the storage node, the greater the amount of access allowed to the storage node, and the greater the number of user accesses allowed to the load.
[0086] For example, the preset adjustment interval is , the first adjustment interval number is , the second adjustment interval number is , the adjustment coefficient of the storage node is ,when When the access number of the user access request allowed in the storage node can be adjusted within the security threshold range, and the adjustment coefficient is directly proportional to the allowed access number, that is, the larger the adjustment coefficient, the larger the adjusted allowed access number within the security threshold range.
[0087] In this embodiment, the adjustment coefficient of the storage node is adjusted within a preset adjustment interval. When the adjustment coefficient of the storage node is within the preset adjustment interval, the number of user access requests allowed by the load in the storage node is proportional to the adjustment coefficient. The larger the adjustment coefficient, the larger the number of user access requests allowed by the load in the adjusted storage node. The flexibility of the number of user access requests allowed by the storage node can be improved to be suitable for receiving more user access requests.
[0088] In one embodiment, the load of the storage node is dynamically adjusted (ie, step C1), and specifically, the following step G may be performed: Step G: When the adjustment coefficient of the storage node is greater than the second adjustment interval number, the adjustment coefficient is adjusted to a maximum value, so as to adjust the number of user access requests of the corresponding storage node in the queue information to a maximum value of the allowed access amount.
[0089] When the adjustment coefficient of the storage node is greater than the second adjustment interval number, that is, the storage content in the storage node is large, then the number of user access requests allowed by the storage node needs to be adjusted to the maximum value of the allowed access amount.
[0090] For example, the preset adjustment interval is , the first adjustment interval number is , the second adjustment interval number is , the adjustment coefficient of the storage node is ,when When the access quantity of the user access request allowed in the storage node can be adjusted to the maximum value of the allowed access quantity.
[0091] In this embodiment, when the adjustment coefficient of the storage node is greater than the second adjustment interval number, it means that the load in the storage node allows the user access request of the load to be greater than the maximum value in the preset adjustment interval, then the number of user access requests allowed by the storage node to the load is adjusted to the maximum value of the allowed access amount.
[0092] Figure 3 is a schematic flow chart of a method for allocating access requests according to another embodiment of the present application, such as Figure 3 As shown, the method comprises the following steps: S301, obtaining a plurality of storage nodes to be accessed in the network disk system, user access information in the network disk system, and a plurality of user access requests to be allocated.
[0093] S302: Calculate the predicted time coefficient of each user access request according to the user access information and the historical access situation of the user corresponding to the user access request.
[0094] S303, adding the user access requests to be allocated to the queue in order, and generating queue information corresponding to each storage node.
[0095] S304: According to the adjustment coefficient of each storage node in the queue information, the access quantity of the load user access request allowed by the storage node is adjusted.
[0096] S305 , allocating each user access request to multiple storage nodes according to the predicted time coefficient of the user access request and the adjustment coefficient of each storage node and in accordance with a preset allocation strategy.
[0097] The specific process from S301 to S305 has been described in detail in the above embodiment and will not be repeated here.
[0098] Adopting the technical solution of the embodiment of the present application, by obtaining user access information corresponding to multiple storage nodes in the network disk system, and multiple user access requests to be allocated to multiple storage nodes, the user access information includes the user's historical access to the storage node; according to the user access information, determine the predicted time coefficient of each user access request, the predicted time coefficient is used to predict the time length of the network disk system processing the user access request; based on the predicted time coefficient of each user access request, according to the preset allocation strategy, allocate each user access request to multiple storage nodes. It can be seen that according to the user access information corresponding to multiple storage nodes in the network disk system, the predicted time coefficient of each user access request to be allocated to multiple storage nodes is calculated, and the duration of the user access request can be predicted in advance. According to the predicted time coefficient of the user access request and the preset allocation strategy, each user access request can be more evenly allocated to each storage node, preventing individual storage nodes from receiving too many user access requests and causing overload, and solving the problem of single point failure caused by overload of storage nodes.
[0099] In summary, specific embodiments of the present subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recorded in the claims can be performed in a different order and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing can be advantageous.
[0100] The above is a method for allocating access requests provided in an embodiment of the present application. Based on the same idea, an embodiment of the present application also provides a device for allocating access requests.
[0101] Figure 4 FIG. 1 is a schematic diagram of the structure of an access request allocation device according to an embodiment of the present invention. Figure 4 As shown, the access request allocation device includes: a data collection module 41, a prediction analysis module 42, and an access management module 43: The data collection module 41 is used to obtain user access information corresponding to multiple storage nodes in the network disk system, and multiple user access requests to be allocated to multiple storage nodes, wherein the user access information includes historical access status of users to storage nodes; The prediction analysis module 42 is used to determine the predicted time coefficient of each user access request based on the user access information, and the predicted time coefficient is used to predict the time length of the network disk system processing the user access request; The access management module 43 is used to allocate each user access request to multiple storage nodes according to a preset allocation strategy based on the predicted time coefficient of each user access request.
[0102] In one embodiment, the prediction analysis module 42 further includes: A processing unit, configured to partition the contents in the plurality of storage nodes to obtain a preset number of partitions; The prediction unit is used to determine, based on user access information, a preset weight coefficient corresponding to a user access request, an expected value of a user browsing a preset number of partitions corresponding to a user access request, an expected value of an access time of a preset number of partitions with the highest user browsing frequency corresponding to a user access request, the historical access time of all users in the network disk system and a preset standard time, and calculate the predicted time coefficient of each user access request.
[0103] In one embodiment, the weight coefficient preset in the prediction unit includes: a preset first weight coefficient and a preset second weight coefficient, and the calculation unit is specifically used to, within a first preset time period, when the number of historical accesses of the user access request corresponding to the user accessing the storage node is greater than the preset number of accesses, determine that the preset first weight coefficient is greater than the preset second weight coefficient; Subtract 1 from the quotient of the historical number of visits and the preset number of visits, and multiply the result by a monotonically increasing conversion function within a first preset range to obtain a preset first weight coefficient; wherein the sum of the preset first weight coefficient and the preset second weight coefficient is equal to a preset constant determined based on empirical data.
[0104] In one embodiment, the preset first weight coefficient in the prediction unit is also used to determine that the preset first weight coefficient is less than the preset second weight coefficient when the historical number of accesses to the storage node corresponding to the user access request is less than the preset number of accesses, and to determine the preset first weight coefficient as a constant within the second preset range.
[0105] In one embodiment, the access management module further includes a queue unit, which is specifically used to add user access requests to the queue corresponding to the storage node and generate queue information, wherein the queue information includes: the number of load user access requests allowed by the storage node in the network disk system.
[0106] In one embodiment, the access management module 43 is further specifically used to allocate user access requests in the queue to storage nodes according to the adjustment coefficient of each storage node among multiple storage nodes; the adjustment coefficient is used to characterize the load level of user access requests that the storage node can bear; wherein, the adjustment coefficient of the storage node is used to dynamically adjust the load of the storage node when allocating user access requests.
[0107] In one embodiment, the access management module 43 is further used to determine the load of each user access request based on the predicted time coefficient of each user access request; according to the load of the user access request and the adjustment coefficient of each storage node, the user access requests in the queue are distributed to each storage node according to a preset load balancing rule.
[0108] In one embodiment, the queue unit is also used to determine a preset adjustment interval of the storage node based on user access information, and the preset adjustment interval includes: a first adjustment interval number and a second adjustment interval number, wherein the first adjustment interval number is smaller than the second adjustment interval number; when the adjustment coefficient of the storage node is smaller than the first adjustment interval number, the number of user access requests allowed for the load of the corresponding storage node in the queue information is not adjusted.
[0109] In one embodiment, the queue unit is also used to adjust the number of user access requests for the allowed load of the corresponding storage node in the queue information within the allowed access amount when the adjustment coefficient of the storage node is greater than or equal to the first adjustment interval number and less than or equal to the second adjustment interval number; wherein the adjustment coefficient of the storage node is proportional to the allowed access amount of the storage node.
[0110] In one embodiment, the queue unit is also used to adjust the adjustment coefficient to a maximum value when the adjustment coefficient of the storage node is greater than the second adjustment interval number, so as to adjust the number of user access requests allowed by the corresponding storage node in the queue information to the maximum value of the allowed access amount.
[0111] Adopting the technical solution of the embodiment of the present application, by obtaining user access information corresponding to multiple storage nodes in the network disk system, and multiple user access requests to be allocated to multiple storage nodes, the user access information includes the user's historical access to the storage node; according to the user access information, determine the predicted time coefficient of each user access request, the predicted time coefficient is used to predict the time length of the network disk system processing the user access request; based on the predicted time coefficient of each user access request, according to the preset allocation strategy, allocate each user access request to multiple storage nodes. It can be seen that according to the user access information corresponding to multiple storage nodes in the network disk system, the predicted time coefficient of each user access request to be allocated to multiple storage nodes is calculated, and the duration of the user access request can be predicted in advance. According to the predicted time coefficient of the user access request and the preset allocation strategy, each user access request can be more evenly allocated to each storage node, preventing individual storage nodes from receiving too many user access requests and causing overload, and solving the problem of single point failure caused by overload of storage nodes.
[0112] Those skilled in the art should understand that Figure 4The access request allocation device in the present invention can be used to implement the access request allocation method described above, and the detailed description thereof should be similar to the description of the method part above, and will not be further described here to avoid redundancy.
[0113] Based on the same technical concept, an embodiment of the present application further provides an electronic device, which is used to execute the above-mentioned method for allocating access requests. Figure 5 A schematic diagram of the structure of an electronic device for implementing various embodiments of the present application. The electronic device may have relatively large differences due to different configurations or performances, and may include a processor (processor) 510, a communication interface (Communications Interface) 520, a memory (memory) 530 and a communication bus 540, wherein the processor 510, the communication interface 520, and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call a computer program stored in the memory 530 and executable on the processor 510 to perform the following steps: Obtain user access information corresponding to multiple storage nodes in the network disk system, and multiple user access requests to be allocated to multiple storage nodes, wherein the user access information includes historical access status of users to storage nodes; According to the user access information, the predicted time coefficient of each user access request is determined. The predicted time coefficient is used to predict the time length for the network disk system to process the user access request. Based on the predicted time coefficient of each user access request, each user access request is allocated to multiple storage nodes according to a preset allocation strategy.
[0114] Adopting the technical solution of the embodiment of the present application, by obtaining user access information corresponding to multiple storage nodes in the network disk system, and multiple user access requests to be allocated to multiple storage nodes, the user access information includes the user's historical access to the storage node; according to the user access information, determine the predicted time coefficient of each user access request, the predicted time coefficient is used to predict the time length of the network disk system processing the user access request; based on the predicted time coefficient of each user access request, according to the preset allocation strategy, allocate each user access request to multiple storage nodes. It can be seen that according to the user access information corresponding to multiple storage nodes in the network disk system, the predicted time coefficient of each user access request to be allocated to multiple storage nodes is calculated, and the duration of the user access request can be predicted in advance. According to the predicted time coefficient of the user access request and the preset allocation strategy, each user access request can be more evenly allocated to each storage node, preventing individual storage nodes from receiving too many user access requests and causing overload, and solving the problem of single point failure caused by overload of storage nodes.
[0115] The specific execution steps can refer to the various steps of the above-mentioned access request allocation method embodiment, and can achieve the same technical effect. To avoid repetition, they will not be repeated here.
[0116] It should be noted that the electronic devices in the embodiments of the present application include: servers, terminals, or other devices except terminals.
[0117] The above electronic device structure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. For example, the input unit may include a graphics processing unit (GPU) and a microphone, and the display unit may be configured with a display panel in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit includes a touch panel and at least one of other input devices. The touch panel is also called a touch screen. Other input devices may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0118] The memory can be used to store software programs and various data. The memory may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory may include a volatile memory or a non-volatile memory, or the memory may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DRRAM).
[0119] The processor may include one or more processing units; optionally, the processor integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to the operating system, user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor.
[0120] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned access request allocation method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0121] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0122] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned access request allocation method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0123] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0124] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the processor is used to run the program or instructions to implement the various processes of the above-mentioned product recommendation method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0125] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0126] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0127] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A method for allocating access requests, characterized in that: The method comprises: Obtaining user access information corresponding to a plurality of storage nodes in a network disk system and a plurality of user access requests to be allocated to the plurality of storage nodes, wherein the user access information includes historical access status of the user to the storage nodes; Determine, according to the user access information, a predicted time coefficient of each of the user access requests, wherein the predicted time coefficient is used to predict the time length for the network disk system to process the user access request; Based on the predicted time coefficient of each of the user access requests, each of the user access requests is allocated to the multiple storage nodes according to a preset allocation strategy.
2. The method according to claim 1, characterized in that The step of determining the predicted time coefficient of each of the user access requests according to the user access information includes: Partitioning the contents in the plurality of storage nodes to obtain a preset number of partitions; Based on the user access information, determine the preset weight coefficient corresponding to the user access request, the expected value of the user browsing the preset number of partitions corresponding to the user access request, the expected value of the access time of the preset number of partitions with the highest browsing frequency corresponding to the user access request, the historical access time and the preset standard time of all users in the network disk system, and calculate the predicted time coefficient of each user access request.
3. The method according to claim 2, characterized in that The preset weight coefficient includes: a preset first weight coefficient and a preset second weight coefficient, Within a first preset time period, when the number of historical accesses of the user corresponding to the user access request to the storage node is greater than the preset number of accesses, determining that the preset first weight coefficient is greater than the preset second weight coefficient; Subtract 1 from the quotient of the historical number of visits and the preset number of visits, and multiply the result by a monotonically increasing conversion function within a first preset range to obtain the preset first weight coefficient; wherein the sum of the preset first weight coefficient and the preset second weight coefficient is equal to a preset constant determined based on empirical data.
4. The method according to claim 3, characterized in that The preset first weight coefficient also includes: When the historical number of accesses to the storage node by the user corresponding to the user access request is less than the preset number of accesses, it is determined that the preset first weight coefficient is less than the preset second weight coefficient, and the preset first weight coefficient is determined as a constant within a second preset range.
5. The method according to claim 1, characterized in that The obtaining of user access information corresponding to a plurality of storage nodes in the network disk system and a plurality of user access requests to be allocated to the plurality of storage nodes includes: The user access request is added to the queue corresponding to the storage node to generate queue information, wherein the queue information includes: the number of user access requests that the storage node in the network disk system is allowed to load.
6. The method according to claim 5, characterized in that The allocating each of the user access requests to the plurality of storage nodes according to a preset allocation strategy includes: Allocating the user access requests in the queue to the storage node according to the adjustment coefficient of each storage node in the plurality of storage nodes; the adjustment coefficient is used to characterize the load degree of the user access requests that the storage node can bear; The adjustment coefficient of the storage node is used to dynamically adjust the load of the storage node when allocating the user access request.
7. The method according to claim 6, characterized in that The allocating each of the user access requests to the plurality of storage nodes based on the predicted time coefficient of each of the user access requests and according to a preset allocation strategy includes: Determining the load of each of the user access requests based on the predicted time coefficient of each of the user access requests; According to the load of the user access requests and the adjustment coefficient of each of the storage nodes, the user access requests in the queue are distributed to each of the storage nodes according to a preset load balancing rule.
8. The method according to claim 7, characterized in that The dynamically adjusting the load of the storage node includes: Determine, according to the user access information, a preset adjustment interval of the storage node, wherein the preset adjustment interval includes: a first adjustment interval number and a second adjustment interval number, wherein the first adjustment interval number is smaller than the second adjustment interval number; When the adjustment coefficient of the storage node is less than the first adjustment interval number, the number of the user access requests allowed by the corresponding storage node in the queue information is not adjusted.
9. The method according to claim 8, characterized in that The dynamically adjusting the load of the storage node further includes: When the adjustment coefficient of the storage node is greater than or equal to the first adjustment interval number and less than or equal to the second adjustment interval number, the number of the user access requests of the storage node allowed load corresponding to the queue information is adjusted within the allowed access amount; The adjustment coefficient of the storage node is proportional to the allowed access amount of the storage node.
10. The method according to claim 9, characterized in that The dynamically adjusting the load of the storage node further includes: When the adjustment coefficient of the storage node is greater than the second adjustment interval number, the adjustment coefficient is adjusted to a maximum value to adjust the number of user access requests allowed to be loaded by the storage node corresponding to the queue information to a maximum value of the allowed access amount.
Citation Information
Patent Citations
Access request shunting method, system and device and storage medium
CN113783919A
Data processing method and device, equipment and storage medium
CN115442373A
Scheduling method and device of content delivery network and electronic equipment
CN117201612A
Method, device, and computer program product for managing access workload of storage system
US20220197559A1