CN115379014B - Data request distribution method and device and electronic equipment - Google Patents

Data request distribution method and device and electronic equipment Download PDF

Info

Publication number
CN115379014B
CN115379014B CN202210847966.3A CN202210847966A CN115379014B CN 115379014 B CN115379014 B CN 115379014B CN 202210847966 A CN202210847966 A CN 202210847966A CN 115379014 B CN115379014 B CN 115379014B
Authority
CN
China
Prior art keywords
server
wave function
data
distribution
data request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210847966.3A
Other languages
Chinese (zh)
Other versions
CN115379014A (en
Inventor
蒋艳军
赵轶新
孙科
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Telecom Corp Ltd
Original Assignee
China Telecom Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Telecom Corp Ltd filed Critical China Telecom Corp Ltd
Priority to CN202210847966.3A priority Critical patent/CN115379014B/en
Publication of CN115379014A publication Critical patent/CN115379014A/en
Application granted granted Critical
Publication of CN115379014B publication Critical patent/CN115379014B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/15Correlation function computation including computation of convolution operations
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Computational Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Algebra (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a data request distribution method and device, and belongs to the technical field of communication. The method comprises the following steps: responding to the received data request, and obtaining a particle index corresponding to each server; mapping each server into a space point, and acquiring a specified field energy value corresponding to each server based on a particle index corresponding to each server; bringing the appointed field energy value corresponding to each server into a wave equation deduced in advance, and solving a wave function to obtain a wave function value; and distributing the data request to the server matched with the preset wave function distribution threshold and the wave function value according to the matching relation between the preset wave function distribution threshold and the wave function value of each server. Under the condition that the high-performance server is matched with a wider wave function distribution threshold value, the method has the advantage that the data request is distributed to the high-performance server with higher probability, so that the server pressure is balanced, and the high availability of the servers in the system is achieved.

Description

Data request distribution method and device and electronic equipment
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a data request distribution method, apparatus, electronic device, and computer readable storage medium.
Background
With the rapid development of the internet, the user audience group is more and more wide, and high availability is one of factors which must be considered in the design of the internet distributed system architecture, and the industry basically adopts vertical expansion (improving stand-alone processing capability) and horizontal expansion (deploying server clusters) to cope with high-concurrency data request scenes. The routing technology of the data request is derived from the routing technology, and the algorithm deployed for the server cluster at present generally adopts the following steps: polling, random, weighted, etc. methods distribute data requests to nodes in the server cluster. The traditional data request distribution mode faces to massive data requests, and the server pressure cannot be relieved dynamically according to server resources.
There is a need in the art for an improved method of distributing data requests.
Disclosure of Invention
The embodiment of the application provides a data request distribution method and device, which are beneficial to balancing server pressure, improving server use efficiency and achieving high availability of servers in a system.
In a first aspect, an embodiment of the present application provides a data request distribution method, including:
responding to the received data request, and obtaining a particle index corresponding to each server;
Acquiring a specified field energy value corresponding to each server based on the particle index corresponding to each server;
bringing the specified field energy value corresponding to each server into a pre-deduced wave equation, and solving a wave function in the wave equation to obtain a wave function value;
and distributing the data request to the servers with the preset wave function distribution threshold matched with the wave function values according to the matching relation between the preset wave function distribution threshold of each server and the wave function values.
In a second aspect, an embodiment of the present application provides a data request distribution apparatus, including:
the particle index acquisition module is used for responding to the received data request and acquiring particle indexes corresponding to the servers;
the specified field energy value acquisition module is used for acquiring specified field energy values corresponding to the servers based on the particle indexes corresponding to the servers;
the wave function value acquisition module is used for bringing the specified field energy value corresponding to each server into a pre-deduced wave equation, and solving a wave function in the wave equation to obtain a wave function value;
and the data request distribution module is used for distributing the data request to the servers with the preset wave function distribution threshold matched with the wave function values according to the matching relation between the preset wave function distribution threshold of each server and the wave function values.
In a third aspect, the embodiment of the application further discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor implements the data request distribution method described in the embodiment of the application when executing the computer program.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the data request distribution method disclosed in embodiments of the present application.
According to the data request distribution method disclosed by the embodiment of the application, particle indexes corresponding to all servers are obtained by responding to the received data request; acquiring a specified field energy value corresponding to each server based on the particle index corresponding to each server; bringing the specified field energy value corresponding to each server into a pre-deduced wave equation, and solving a wave function in the wave equation to obtain a wave function value; according to the matching relation between the preset wave function distribution threshold value and the wave function value of each server, the data request is distributed to the servers with the preset wave function distribution threshold value matched with the wave function value, and under the condition that the high-performance servers are matched with the wider wave function distribution threshold value, the data request is distributed to the high-performance servers with higher probability, so that the pressure of the servers is balanced, the service efficiency of the servers is improved, and the high availability of the servers in the system is achieved.
The foregoing description is only an overview of the technical solutions of the present application, and may be implemented according to the content of the specification in order to make the technical means of the present application more clearly understood, and in order to make the above-mentioned and other objects, features and advantages of the present application more clearly understood, the following detailed description of the present application will be given.
Drawings
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
FIG. 1 is a flow chart of a data request distribution method in one embodiment of the present application;
FIG. 2 is a flow chart of a data request distribution method in another embodiment of the present application;
FIG. 3 is a flow chart of a data request distribution method in yet another embodiment of the present application;
FIG. 4 is a schematic diagram of a data request distributing apparatus according to an embodiment of the present application;
FIG. 5 is a second schematic diagram of a data request distributing apparatus according to an embodiment of the present application;
FIG. 6 schematically shows a block diagram of an electronic device for performing a method according to the present application; and
fig. 7 schematically shows a memory unit for holding or carrying program code implementing the method according to the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
As shown in fig. 1, a data request distributing method disclosed in an embodiment of the present application includes: steps 110 to 140.
Step 110, in response to receiving the data request, the particle index corresponding to each server is obtained.
The data request distribution method is applied to a scene of determining a routing server of a current data request in a server cluster comprising a plurality of servers.
According to the data request distribution method disclosed by the embodiment of the application, each server is mapped into a space point based on a particle motion theory in physics, particle distribution based on the space point influences the theory of field energy around the space point, and a preset strategy is adopted to obtain particle indexes corresponding to each server, so that the specified field energy value corresponding to the corresponding server is obtained based on the particle indexes corresponding to each server.
In some embodiments of the present application, the particle index is a value that affects a server-specified field energy value. It can be understood that the particle index is a factor that affects the energy of the microparticles, such as the number and quality of the particles in the space points mapped by the server. The greater the particle index, the greater the probability that a data request will be distributed to the corresponding server.
In some embodiments of the present application, the obtaining the particle index corresponding to each server includes any one of the following methods: randomly distributing particle indexes corresponding to all servers; determining the particle index of the corresponding server according to the performance index of each server; and dynamically adjusting the particle indexes of the corresponding servers according to the access request pressure distribution data of the servers after the particle indexes corresponding to the servers are randomly allocated. For example, the particle index may be randomly assigned to each server within a certain threshold range. For example, the particle index may be allocated to each server according to performance indexes such as the number of CPU cores, memory space, processing speed, and network bandwidth of each server. For another example, the initial value of the particle index may be randomly allocated to each server, and then the particle index of the corresponding server may be dynamically adjusted according to the routing situation of the data request received by each server in the actual operation process (for example, when a specific particle index is allocated to a certain high-performance server, the probability of distributing the data request to the high-performance server is greater, then the specific particle index may be dynamically adjusted to the particle index of the high-performance server). The specific embodiment of dynamically adjusting the particle index of the corresponding server according to the routing condition of the data request received by each server in the actual operation process is described below, and will not be repeated here.
Step 120, obtaining a specified field energy value corresponding to each server based on the particle index corresponding to each server.
And then, further acquiring the appointed field energy value corresponding to each server in the server cluster based on the particle index corresponding to each server. Wherein the specified field energy value comprises at least two of: kinetic energy, potential energy, total energy.
In some embodiments of the present application, a method for calculating the energy of microparticles of a spatial point in the prior art may be used to calculate the specified field energy value corresponding to each server according to the particle index corresponding to each server. For example, a server is abstracted into a space point, a particle index corresponding to the server is converted into space particles, and kinetic energy of the converted space particles and total energy of the particles are further calculated. Since the location of the server is not considered at the time of data request distribution, the potential energy can be set to 0.
In other embodiments of the present application, obtaining the specified field energy value corresponding to each server based on the particle index corresponding to each server includes: mapping each server into a space point, and calculating a designated field energy value corresponding to each server through a preset potential function based on the particle index corresponding to each server. For example, a relationship model, that is, a potential function model, between a particle index and the specific field energy value may be pre-constructed by a method of constructing a field energy model, and then, in a request distribution process, the specific field energy value corresponding to each server is obtained through the potential function based on the particle index corresponding to each server.
And 130, bringing the specified field energy value corresponding to each server into a pre-deduced wave equation, and solving a wave function in the wave equation to obtain a wave function value.
In an embodiment of the present application, the wave equation may be: and (5) a fixed schrodinger equation.
The schrodinger equation can correctly describe the quantum behavior of the wave function. In quantum mechanics, in order to quantitatively describe the state of microscopic particles, a wave function is introduced in quantum mechanics and denoted by ρ. The wave function is a function of space and time and is used to express the probability that a particle will appear at a certain point in space at a certain moment. At the set time t, the particle state is set to be a stationary state without considering relativity of the particle spin, and a wave function can be obtained by solving a stationary-state Schrodinger equation.
In the embodiment of the application, deduction is performed in advance according to a one-dimensional Schrodinger equation, so that a fixed-state Schrodinger equation is obtained. Wherein, the fixed schrodinger equation can be expressed as:
wherein v, U and E respectively represent kinetic energy, potential energy and total energy, ρ is a wave function to be solved,is constant. In the data request distribution scene of the application, potential energy can be ignored, and the stationary schrodinger equation is simplified into the following form:
In the simplified fixed-state schrodinger equation, v and E respectively represent kinetic energy and total energy, ρ is a wave function to be solved,is constant. The wave function ρ can be obtained by solving the simplified stationary schrodinger equation. The solving method of the wave function refers to the prior art, and is not described in detail in the embodiment of the present application.
The wave function obtained by solving the fixed-state schrodinger equation is a function shaped like a sine wave, and the wave function value is a set of discrete values.
In the application process, the kinetic energy and the total energy corresponding to each server obtained in the steps are brought into the simplified fixed-state Schrodinger equation, and the wave function of the simplified fixed-state Schrodinger equation is solved, so that the corresponding wave function value of the wave function can be obtained.
The specific method for solving the fixed schrodinger equation refers to the prior art, and is not repeated in the embodiment of the present application.
When the values of v and E are brought into the simplified fixed-state Schrodinger equation, a unique wave function value can be determined.
And 140, distributing the data request to the servers with the preset wave function distribution threshold matched with the wave function values according to the matching relation between the preset wave function distribution threshold of each server and the wave function values.
In physics, the wave function obtained by solving the fixed-state schrodinger equation is a function for describing the probability that electrons move around the nucleus and are distributed in different spaces. In the present application, the wave function obtained by solving the foregoing fixed-state schrodinger equation is used to represent the probability density of data requests distributed to each server.
In some embodiments of the present application, a plurality of slots corresponding to the data request may be predefined, where each server corresponds to a segment of slots, and at the same time, a corresponding relationship between the slots and the wave function values is established, so as to obtain a distribution interval of the wave function values corresponding to the slot interval corresponding to each server, which is used as a wave function distribution threshold corresponding to the corresponding server. The number of slots corresponding to each server can be set according to specific requirements, for example, a server with higher performance can be set to correspond to more slots, and meanwhile, a wave function distribution threshold corresponding to the slot interval is set according to the wave function characteristics obtained through pre-testing.
In the data request distribution stage, after the wave function value matched with a certain server is obtained according to the steps, further judging which server is matched with the wave function value distribution threshold value preset by the certain server, and distributing the data request to the server corresponding to the wave function value matched with the wave function value distribution threshold value.
For example, M slots may be set according to the data request processing capability of the server cluster, where each slot corresponds to one data request, and then the M slots are numbered and divided into different servers according to the performance of each server, so as to establish a corresponding relationship between the server and the slot. In some embodiments of the present application, a correspondence between the wave function value and the slot position may be further established, so that a correspondence between the server and the distribution interval of the wave function value is further established.
In some embodiments of the present application, as shown in fig. 2, after distributing the data request to the servers with the preset wave function distribution threshold and the wave function value matched according to the matching relationship between the preset wave function distribution threshold and the wave function value of each server, the method further includes: steps 150 to 170.
And step 150, recording access data of the server corresponding to the data request.
After the data request is sent to the determined server, recording a distribution log of the data request so as to record access data of the server corresponding to the data request.
In some embodiments of the present application, the distribution log includes route server information of the data request, and may further include a wave function value corresponding to the route server, where the wave function value is used for analyzing a distribution condition of the request for later big data, and is used for calculating and drilling for distribution treatment of the server request.
And step 160, analyzing the access data of each server to obtain access request pressure distribution data of each server.
In some embodiments of the present application, the access data of each server may be analyzed at regular time (e.g., daily), to obtain the number of data requests routed by each server every day, and according to the data request bearing capacity of each server, obtain the number distribution, time interval distribution, pressure size and distribution data of the access requests of each server.
And step 170, outputting a pressure view corresponding to the access request pressure distribution data.
Wherein the pressure view is used to indicate one or more of the following information for the corresponding server corresponding to the data request: pressure magnitude, trend of change, and time distribution.
The first preset condition includes, for example: the access quantity reaches an access upper limit threshold value of a corresponding server, and the access quantity increasing rate reaches a first rate threshold value; the second preset condition includes, for example: the access amount reaches the access lower threshold of the corresponding server, and the access amount reduction rate reaches the second rate threshold.
In some embodiments of the present application, the access request pressure distribution data may be embodied by a pressure view. The pressure view may be a trend graph of the number of data requests received by the server every day during a period of time, a color pie graph of the number of data requests received by the server during different periods of time, and so on.
Thus, the access request pressure distribution data can intuitively reflect the resource use condition of each server, the size of the data request pressure, the time distribution and other information. When the pressure view of a certain server shows that the access quantity of a plurality of servers in each time period of each day reaches the access upper limit of the server, maintenance personnel of the data request distribution system can relieve the access request pressure of the server in the current system by adding the server; when the pressure view of a certain server shows that the access amount of the server in each period of each day is lower than or equal to the access lower limit of the server, maintenance personnel of the data request distribution system can relieve the saving of system resources by deleting the server.
In some embodiments of the present application, after outputting the pressure view corresponding to the access request pressure distribution data, the method further includes: updating the preset wave function distribution threshold value of each server. For example, the preset wave function distribution threshold value of each of the servers is updated based on a user operation. For example, when the pressure view of each server reflects a sharp decrease in data requests received by one or more servers, a system maintainer may delete the server or servers in the data distribution system, in which case, the slot information, i.e., the wave function distribution threshold, corresponding to the remaining servers in the distribution system needs to be updated synchronously. For another example, when the pressure view of each server reflects that the data request received by one or more servers is suddenly increased, a system maintainer may increase the servers in the data distribution system, and in this case, it is necessary to redistribute the slot information corresponding to each server in the distribution system, that is, set the wave function distribution threshold value corresponding to each server. By outputting the pressure view, maintenance personnel of the data request distribution system can balance the load of the server in time, the failure rate of the system is reduced, and resource waste can be avoided.
In some embodiments of the present application, after analyzing the access data of each of the servers and obtaining access request pressure distribution data of each of the servers, the method further includes: step 180.
And 180, setting the particle index corresponding to the routing server matching the preset performance condition as the particle index corresponding to the corresponding server according to the corresponding relation between the particle index and the routing server in the access request pressure distribution data.
The preset performance condition is a performance index of the high-performance server, for example, may be: the CPU core number condition, the memory condition, the processing speed condition and the like of the server. The preset performance conditions are determined according to experience of those skilled in the art.
The wave function obtained by solving the fixed-state Schrodinger equation is directly determined by the appointed field energy corresponding to the server, namely, the current access request is directly determined to which server, so that the distribution trend of the data request can be adjusted by dynamically adjusting the particle index corresponding to the server. Taking the example that the server cluster comprises an A server and a B server, the A server has higher performance, the B server has lower performance, if access request pressure distribution data of the two servers can be obtained according to A, B, when the particle index is a certain value, the access request can be distributed to the A server with higher probability, the particle index of the A server can be modified to be the value, so that a data request distribution system can distribute the data request to the server with high performance as much as possible, the service efficiency of server resources is improved, and the cluster high availability is achieved.
To facilitate the reader's further understanding of the data request distribution method of the present application, specific embodiments of the acquisition server's specified field energy values are further illustrated below by a predetermined model of the relationship between the build particle index and the specified field energy values.
The relationship model described in the embodiments at this time is a potential function model. The potential function is a function describing the interaction of atoms (molecules) and if each server in a cluster of servers is mapped to a spatial point and assigned a different number and/or attribute of particles, each server will produce a different field energy value.
Different methods can be adopted to determine potential functions in different forms aiming at the scene of data request distribution in the server cluster. The method for obtaining the specified field energy value of the server is specifically described below in connection with different forms of potential functions.
In some embodiments of the present application, the preset potential function is constructed based on an artificial potential field method of tiling analysis, the potential function is a monotonically increasing function of a particle index of a server, and a monotonically decreasing function of a resource usage rate, where the resource usage rate is positively related to the particle index and negatively related to a timestamp of a data request, the mapping each server to a spatial point, and calculating, based on the particle index corresponding to each server, a specified field energy value corresponding to each server through the preset potential function, including: for each server, calculating a specified field energy value of a space point mapped by the corresponding server through the potential function based on the particle index of the server, wherein the specified field energy value comprises at least two of the following: kinetic energy, potential energy, total energy.
In some embodiments of the present application, the particle index may be assigned according to a preset performance index of the server, where the preset performance index includes, but is not limited to, one or more of the following: CPU processing speed, network bandwidth and cache size of the server. For example, for a server with a four-core CPU, the allocated particle index is greater than that of a server with a dual-core CPU, and a server with a large network bandwidth allocates a larger particle index than that of a server with a small network bandwidth.
In the artificial potential field method based on tiling analysis, the method of constructing a potential function can be expressed as: p (θ) =fr { d (θ, θ) 0 ),[dR(θ),O]dT }; wherein θ and θ 0 Respectively representing the current pose and the target pose vector of the robot; dy (θ, θ) 0 ) Representing theta and theta 0 A certain generalized distance function between them; dR (θ), O represents the current bitMinimum distance between robot and obstacle under pose; dT is a given threshold; p (θ) is the variable d (θ, θ) 0 ) And dR (θ), a monotonically increasing function and a monotonically decreasing function of O.
By means of the potential energy method of the spreading analysis, the potential function is constructed to solve the weight of distributing the data request to the current server. The potential function can be expressed as: f (x) =fr { f1 (x), f2 (x), dT }, where f1 (x) may be a function of the relationship of the particle index and the request distribution weight matched by the current server, the larger the particle index, the larger the request distribution weight matched by the current server; f2 (x) may distribute the relationship function of the weights for the target server matching the largest particle exponent among the other servers. For example, f2 (x) may be a function of the ratio of the particle index of the target server to the particle index of the current server, the greater the ratio, the less the request distribution weight the current server matches; dT is a given threshold. In this example, when the particle index of the current server is at a maximum in the server cluster, the potential function is at a highest point and the weight to distribute the data request to the current server is the greatest.
The weight of the access request distributed to the server is abstracted into the gravitation of the server to the access request, and the particle index of each server obtained in the previous step is brought into a constructed potential function, so that the appointed field energy corresponding to each server can be obtained. In the implementation process, each server declares a slot interval during initialization, a potential function result matches a calculation parameter of a slot value (for example, a weight index falling into a designated slot number), the slot value is calculated by the obtained slot value calculation parameter, and then the slot value is matched with the corresponding slot interval to carry out request distribution.
In the embodiment of the application, the specific expression of the potential function is not limited, and the specific expression of the relation function is not limited. Other relation functions can be constructed based on the particle indexes corresponding to the server, and the example is not shown.
According to the data request distribution method disclosed by the embodiment of the application, particle indexes corresponding to all servers are obtained by responding to the received data request; acquiring a specified field energy value corresponding to each server based on the particle index corresponding to each server; bringing the specified field energy value corresponding to each server into a pre-deduced wave equation, and solving a wave function in the wave equation to obtain a wave function value; according to the matching relation between the preset wave function distribution threshold value and the wave function value of each server, the data request is distributed to the servers with the preset wave function distribution threshold value matched with the wave function value, and under the condition that the high-performance servers are matched with the wider wave function distribution threshold value, the data request is distributed to the high-performance servers with higher probability, so that the pressure of the servers is balanced, the service efficiency of the servers is improved, and the high availability of the servers in the system is achieved.
Further, according to the data request distribution method disclosed by the embodiment of the application, the distribution log of the data request is recorded, the access data of each server is analyzed based on the distribution log, the access request pressure distribution data of each server is obtained, and the access request pressure distribution data is output in a pressure view mode, so that the server can be intuitively perceived and balanced, if the condition of request sharp increase/decrease occurs, the server can be manually added or subtracted, the maximization of resource use is ensured, and useless performance loss is furthest reduced. And after the server is added or subtracted, the pressure of each server is rebalanced by adjusting the preset wave function distribution threshold value of the existing servers in the server cluster, so that the service efficiency data request of the server is improved.
In addition, according to the data request distribution method disclosed by the embodiment of the application, the proportion of the request route distributed to each server can be dynamically adjusted by allocating the particle indexes matched with each server. For example, for a server with high performance, by allocating a larger particle index, more data requests can be imported to the server with high performance, so as to achieve high availability of inter-system communication and minimize useless performance loss.
On the other hand, through the access request pressure distribution data of each server, when a certain server with high performance is judged to be distributing the particle index XX, the data request is distributed with higher probability, the particle index of the server with high performance can be adjusted to XX, so that the proportion of request routing distributed to the server is improved, the cluster is high in availability, and the adjusting result is more accurate.
The embodiment of the application discloses a data request distributing device, as shown in fig. 4, the device includes:
the particle index obtaining module 410 is configured to obtain a particle index corresponding to each server in response to receiving the data request;
a specified field energy value obtaining module 420, configured to obtain a specified field energy value corresponding to each server based on the particle index corresponding to each server;
a wave function value obtaining module 430, configured to bring the specified field energy value corresponding to each server into a wave equation that is derived in advance, and solve a wave function in the wave equation to obtain a wave function value;
and a data request distribution module 440, configured to distribute the data request to the servers with the preset wave function distribution threshold and the wave function value matched according to the matching relationship between the preset wave function distribution threshold and the wave function value of each server.
In an embodiment of the present application, the wave equation may be: and (5) a fixed schrodinger equation.
In some embodiments of the present application, as shown in fig. 5, the apparatus further includes:
a recording module 450, configured to record access data corresponding to the data request by the server;
a data analysis module 460, configured to analyze the access data of each server, and obtain access request pressure distribution data of each server;
a pressure view output module 470, configured to output a pressure view corresponding to the access request pressure distribution data, where the pressure view is used to indicate one or more of the following information corresponding to the data request by the corresponding server: pressure magnitude, trend of change, and time distribution.
In some embodiments of the present application, as shown in fig. 5, the apparatus further includes:
a server threshold updating module 480, configured to update the preset wave function distribution threshold of each server.
In some embodiments of the present application, as shown in fig. 5, the apparatus further includes:
and a particle index updating module 490, configured to set, according to the correspondence between the particle index and the routing server in the access request pressure distribution data, the particle index corresponding to the routing server matching a preset performance condition as the particle index corresponding to the corresponding server.
In some embodiments of the present application, the obtaining, based on the particle index corresponding to each server, a specified field energy value corresponding to each server includes: mapping each server into a space point, and calculating a designated field energy value corresponding to each server through a preset potential function based on the particle index corresponding to each server.
In some embodiments of the present application, the obtaining the particle index corresponding to each server includes any one of the following methods: randomly distributing particle indexes corresponding to all servers; determining the particle index of the corresponding server according to the performance index of each server; and dynamically adjusting the particle indexes of the corresponding servers according to the access request pressure distribution data of the servers after the particle indexes corresponding to the servers are randomly allocated.
The embodiment of the application discloses a data request distribution device, which is used for implementing the data request distribution method described in the embodiment of the application method, and specific implementation manners of each module of the device are not repeated, and reference may be made to specific implementation manners of corresponding steps of the embodiment of the method.
The data request distribution device disclosed by the embodiment of the application acquires particle indexes corresponding to all servers by responding to the received data request; acquiring a specified field energy value corresponding to each server based on the particle index corresponding to each server; bringing the specified field energy value corresponding to each server into a pre-deduced wave equation, and solving a wave function in the wave equation to obtain a wave function value; according to the matching relation between the preset wave function distribution threshold value and the wave function value of each server, the data request is distributed to the servers with the preset wave function distribution threshold value matched with the wave function value, and under the condition that the high-performance servers are matched with the wider wave function distribution threshold value, the data request is distributed to the high-performance servers with higher probability, so that the pressure of the servers is balanced, the service efficiency of the servers is improved, and the high availability of the servers in the system is achieved.
Further, the data request distribution device disclosed by the embodiment of the application acquires the access request pressure distribution data of each server by recording the distribution log of the data request and analyzing the access data of each server based on the distribution log, and outputs the access request pressure distribution data in a pressure view form, so that the device is favorable for intuitively perceiving the balance server, and if the condition of request sharp increase/decrease occurs, the device can be manually intervened to increase or decrease the servers, thereby ensuring the maximization of resource use and furthest reducing useless performance loss. And after the server is added or subtracted, the pressure of each server is rebalanced by adjusting the preset wave function distribution threshold value of the existing servers in the server cluster, so that the service efficiency data request of the server is improved.
In addition, the data request distribution device disclosed by the embodiment of the application can dynamically adjust the proportion of the request route distributed to each server by allocating the particle indexes matched with each server. For example, for a server with high performance, by allocating a larger particle index, more data requests can be imported to the server with high performance, so as to achieve high availability of inter-system communication and minimize useless performance loss.
On the other hand, through the access request pressure distribution data of each server, when a certain server with high performance is judged to be distributing the particle index XX, the data request is distributed with higher probability, the particle index of the server with high performance can be adjusted to XX, so that the proportion of request routing distributed to the server is improved, the cluster is high in availability, and the adjusting result is more accurate.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described by differences from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other. For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
The foregoing has described in detail a method and apparatus for distributing data requests provided by the present application, and specific examples have been applied herein to illustrate the principles and embodiments of the present application, where the foregoing examples are provided to assist in understanding the method and core idea of the present application; meanwhile, as those skilled in the art will have modifications in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
Various component embodiments of the present application may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that some or all of the functions of some or all of the components in an electronic device according to embodiments of the present application may be implemented in practice using a microprocessor or Digital Signal Processor (DSP). The present application may also be embodied as an apparatus or device program (e.g., computer program and computer program product) for performing a portion or all of the methods described herein. Such a program embodying the present application may be stored on a computer readable medium, or may have the form of one or more signals. Such signals may be downloaded from an internet website, provided on a carrier signal, or provided in any other form.
For example, fig. 6 shows an electronic device in which a method according to the present application may be implemented. The electronic device may be a PC, a mobile terminal, a personal digital assistant, a tablet computer, etc. The electronic device conventionally comprises a processor 610 and a memory 620 and a program code 630 stored on said memory 620 and executable on the processor 610, said processor 610 implementing the method described in the above embodiments when said program code 630 is executed. The memory 620 may be a computer program product or a computer readable medium. The memory 620 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. The memory 620 has a storage space 6201 for program code 630 of a computer program for performing any of the method steps described above. For example, the memory space 6201 for the program code 630 may include individual computer programs for implementing the various steps in the above methods, respectively. The program code 630 is computer readable code. These computer programs may be read from or written to one or more computer program products. These computer program products comprise a program code carrier such as a hard disk, a Compact Disc (CD), a memory card or a floppy disk. The computer program comprises computer readable code which, when run on an electronic device, causes the electronic device to perform a method according to the above-described embodiments.
The embodiments also disclose a computer readable storage medium having stored thereon a computer program which when executed by a processor implements the steps of the data request distribution method as described in the method embodiments of the present application.
Such a computer program product may be a computer readable storage medium, which may have memory segments, memory spaces, etc. arranged similarly to the memory 620 in the electronic device shown in fig. 6. The program code may be stored in the computer readable storage medium, for example, in a suitable form. The computer readable storage medium is typically a portable or fixed storage unit as described with reference to fig. 7. In general, the memory unit comprises computer readable code 630', which computer readable code 630' is code that is read by a processor, which code, when executed by the processor, implements the steps of the method described above.
Reference herein to "one embodiment," "an embodiment," or "one or more embodiments" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Furthermore, it is noted that the word examples "in one embodiment" herein do not necessarily all refer to the same embodiment.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the present application may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The application may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, third, etc. do not denote any order. These words may be interpreted as names.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the corresponding technical solutions.

Claims (12)

1. A method of distributing data requests, comprising:
responding to the received data request, and obtaining a particle index corresponding to each server;
acquiring a specified field energy value corresponding to each server based on the particle index corresponding to each server;
bringing the specified field energy value corresponding to each server into a pre-deduced wave equation, and solving a wave function in the wave equation to obtain a wave function value;
and distributing the data request to the servers with the preset wave function distribution threshold matched with the wave function values according to the matching relation between the preset wave function distribution threshold of each server and the wave function values.
2. The method according to claim 1, wherein said distributing the data request to the server whose preset wave function distribution threshold matches the wave function value according to the matching relation between the preset wave function distribution threshold and the wave function value of each server further comprises:
recording access data of the server corresponding to the data request;
analyzing the access data of each server to obtain access request pressure distribution data of each server;
Outputting a pressure view corresponding to the access request pressure distribution data, wherein the pressure view is used for indicating one or more of the following information of a corresponding server corresponding data request: pressure magnitude, trend of change, and time distribution.
3. The method of claim 2, wherein after outputting the pressure view corresponding to the access request pressure distribution data, further comprising:
updating the preset wave function distribution threshold value of each server.
4. The method according to claim 2, wherein after analyzing the access data of each of the servers and acquiring the access request pressure distribution data of each of the servers, further comprising:
and setting the particle index corresponding to the routing server matching the preset performance condition as the particle index corresponding to the corresponding server according to the corresponding relation between the particle index and the routing server in the access request pressure distribution data.
5. The method according to any one of claims 1 to 4, wherein the obtaining a specified field energy value corresponding to each of the servers based on the particle index corresponding to each of the servers includes:
Mapping each server into a space point, and calculating a designated field energy value corresponding to each server through a preset potential function based on the particle index corresponding to each server.
6. The method according to any one of claims 1 to 4, wherein the obtaining the particle index corresponding to each server includes any one of the following methods:
randomly distributing particle indexes corresponding to all servers;
determining the particle index of the corresponding server according to the performance index of each server;
and dynamically adjusting the particle indexes of the corresponding servers according to the access request pressure distribution data of the servers after the particle indexes corresponding to the servers are randomly allocated.
7. A data request distribution apparatus, comprising:
the particle index acquisition module is used for responding to the received data request and acquiring particle indexes corresponding to the servers;
the specified field energy value acquisition module is used for acquiring specified field energy values corresponding to the servers based on the particle indexes corresponding to the servers;
the wave function value acquisition module is used for bringing the specified field energy value corresponding to each server into a pre-deduced wave equation, and solving a wave function in the wave equation to obtain a wave function value;
And the data request distribution module is used for distributing the data request to the servers with the preset wave function distribution threshold matched with the wave function values according to the matching relation between the preset wave function distribution threshold of each server and the wave function values.
8. The apparatus as recited in claim 7, further comprising:
the recording module is used for recording the access data of the server corresponding to the data request;
the data analysis module is used for analyzing the access data of each server and acquiring access request pressure distribution data of each server;
a pressure view output module, configured to output a pressure view corresponding to the access request pressure distribution data, where the pressure view is used to indicate one or more of the following information corresponding to the data request by the corresponding server: pressure magnitude, trend of change, and time distribution.
9. The apparatus as recited in claim 8, further comprising:
and the server threshold updating module is used for updating the preset wave function distribution threshold of each server.
10. The apparatus as recited in claim 8, further comprising:
And the particle index updating module is used for setting the particle index corresponding to the routing server matching with the preset performance condition as the particle index corresponding to the corresponding server according to the corresponding relation between the particle index and the routing server in the access request pressure distribution data.
11. An electronic device comprising a memory, a processor and program code stored on the memory and executable on the processor, wherein the processor implements the data request distribution method of any of claims 1 to 6 when the program code is executed by the processor.
12. A computer readable storage medium having stored thereon program code, which when executed by a processor realizes the steps of the data request distribution method of any of claims 1 to 6.
CN202210847966.3A 2022-07-19 2022-07-19 Data request distribution method and device and electronic equipment Active CN115379014B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210847966.3A CN115379014B (en) 2022-07-19 2022-07-19 Data request distribution method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210847966.3A CN115379014B (en) 2022-07-19 2022-07-19 Data request distribution method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN115379014A CN115379014A (en) 2022-11-22
CN115379014B true CN115379014B (en) 2024-03-19

Family

ID=84062584

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210847966.3A Active CN115379014B (en) 2022-07-19 2022-07-19 Data request distribution method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN115379014B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115914668A (en) * 2022-12-22 2023-04-04 湖南快乐阳光互动娱乐传媒有限公司 Live broadcast stream processing method and live broadcast source station cluster

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7231445B1 (en) * 2000-11-16 2007-06-12 Nortel Networks Limited Technique for adaptively distributing web server requests
EP3313048A1 (en) * 2016-10-20 2018-04-25 Alcatel Lucent Method and device for routing a request
WO2019169724A1 (en) * 2018-03-09 2019-09-12 平安科技(深圳)有限公司 Server concurrency control method and device, computer device, and storage medium
CN113873001A (en) * 2021-02-20 2021-12-31 天翼智慧家庭科技有限公司 Load balancing optimization method based on HTTP request classification

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050193113A1 (en) * 2003-04-14 2005-09-01 Fujitsu Limited Server allocation control method
US8458500B2 (en) * 2009-11-30 2013-06-04 International Business Machines Corporation Server allocation to workload based on energy profiles

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7231445B1 (en) * 2000-11-16 2007-06-12 Nortel Networks Limited Technique for adaptively distributing web server requests
EP3313048A1 (en) * 2016-10-20 2018-04-25 Alcatel Lucent Method and device for routing a request
WO2019169724A1 (en) * 2018-03-09 2019-09-12 平安科技(深圳)有限公司 Server concurrency control method and device, computer device, and storage medium
CN113873001A (en) * 2021-02-20 2021-12-31 天翼智慧家庭科技有限公司 Load balancing optimization method based on HTTP request classification

Also Published As

Publication number Publication date
CN115379014A (en) 2022-11-22

Similar Documents

Publication Publication Date Title
CN107295090B (en) Resource scheduling method and device
CN111722806B (en) Cloud disk allocation method and device, electronic equipment and storage medium
CN113377540A (en) Cluster resource scheduling method and device, electronic equipment and storage medium
CN110719320B (en) Method and equipment for generating public cloud configuration adjustment information
CN112422977A (en) Distribution method and distribution device for audio and video transcoding tasks
CN115379014B (en) Data request distribution method and device and electronic equipment
CN116700920A (en) Cloud primary hybrid deployment cluster resource scheduling method and device
CN118093326B (en) Cloud rendering resource monitoring method and system based on computing power scheduling
CN117573373B (en) CPU virtualization scheduling method and system based on cloud computing
CN107203256B (en) Energy-saving distribution method and device under network function virtualization scene
CN117675566A (en) Resource quota allocation method and device, storage medium and electronic equipment
CN107483634B (en) Load balancing method and system
CN115840649A (en) Method and device for allocating partitioned capacity block type virtual resources, storage medium and terminal
CN115309520A (en) Task migration method and device, electronic equipment and storage medium
CN108933834A (en) A kind of dispatching method and dispatching device
CN116932156A (en) Task processing method, device and system
CN110995863A (en) Data center load distribution method and system based on load demand characteristics
CN111539863A (en) Intelligent city operation method and system based on multi-source task line
CN116048821B (en) High-utilization AI server and resource allocation method thereof
CN115495246B (en) Hybrid remote memory scheduling method under separated memory architecture
Jian et al. A HDFS dynamic load balancing strategy using improved niche PSO algorithm in cloud storage
CN116405500B (en) System resource management method based on data analysis and cloud computing data analysis
CN118394534B (en) Method, system, product, device and medium for expanding and shrinking volume of cluster application service
CN115114005A (en) Service scheduling control method, device, equipment and computer readable storage medium
CN112905345A (en) Task allocation method, distributed storage system and server

Legal Events

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