CN115277566A - Load balancing method and device for data access, computer equipment and medium - Google Patents
Load balancing method and device for data access, computer equipment and medium Download PDFInfo
- Publication number
- CN115277566A CN115277566A CN202210555778.3A CN202210555778A CN115277566A CN 115277566 A CN115277566 A CN 115277566A CN 202210555778 A CN202210555778 A CN 202210555778A CN 115277566 A CN115277566 A CN 115277566A
- Authority
- CN
- China
- Prior art keywords
- server
- target
- data access
- node
- physical address
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 40
- 238000001514 detection method Methods 0.000 claims abstract description 78
- 238000003860 storage Methods 0.000 claims abstract description 32
- 230000004044 response Effects 0.000 claims abstract description 12
- 238000005516 engineering process Methods 0.000 claims abstract description 10
- 238000004364 calculation method Methods 0.000 claims description 13
- 238000013507 mapping Methods 0.000 claims description 13
- 238000004891 communication Methods 0.000 claims description 11
- 238000012545 processing Methods 0.000 claims description 11
- 238000004590 computer program Methods 0.000 claims description 7
- 238000004422 calculation algorithm Methods 0.000 claims description 5
- 238000010586 diagram Methods 0.000 description 6
- 230000003287 optical effect Effects 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 230000002159 abnormal effect Effects 0.000 description 3
- 230000004913 activation Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 2
- 238000009826 distribution Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000002452 interceptive effect Effects 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000036541 health Effects 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 238000004904 shortening Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/12—Avoiding congestion; Recovering from congestion
- H04L47/125—Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/10—Active monitoring, e.g. heartbeat, ping or trace-route
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
- H04L67/1004—Server selection for load balancing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
- H04L67/1044—Group management mechanisms
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Theoretical Computer Science (AREA)
- Environmental & Geological Engineering (AREA)
- Health & Medical Sciences (AREA)
- Cardiology (AREA)
- General Health & Medical Sciences (AREA)
- Computer And Data Communications (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses a load balancing method and device for data access, computer equipment and a storage medium, wherein the method comprises the following steps: the data access response speed can be improved by receiving a data access request sent by a client, acquiring a target access address contained in the data access request, acquiring a physical address corresponding to the target access address as a target physical address, acquiring a node server with a distance not exceeding a preset distance threshold value with the target physical address from a cluster server as a candidate server, performing flow detection on each candidate server by adopting a Qos technology, determining a target node according to a detection result, and responding to the data access request by adopting the target node.
Description
Technical Field
The present invention relates to the field of data processing, and in particular, to a load balancing method and apparatus for data access, a computer device, and a medium.
Background
With the rapid development of computer network technology, information acquisition is often required through a network in daily work, study, shopping, business handling and the like, and some large-scale internet enterprises or organizations relate to more sub-businesses, and in some peak periods, high traffic is met, so how to rapidly respond to data access is an industry problem of great concern.
At present, the existing method mainly performs load balancing by means of average distribution so as to reduce server pressure and improve data access response speed, and this can ensure normal response of data access as a whole, but in a peak period, the delay of data access is too high.
Disclosure of Invention
The embodiment of the invention provides a load balancing method and device for data access, computer equipment and a storage medium, and aims to improve the efficiency of data access.
In order to solve the foregoing technical problem, an embodiment of the present application provides a load balancing method for data access, including:
receiving a data access request sent by a client, and acquiring a target access address contained in the data access request;
acquiring a physical address corresponding to the target access address as a target physical address, and acquiring a node server with a distance not exceeding a preset distance threshold value from the cluster server as a candidate server;
adopting a Qos technology to perform flow detection on each candidate server, and determining a target node according to a detection result;
and responding the data access request by adopting the target node.
Optionally, the obtaining, from the cluster servers, a node server whose distance from the target physical address does not exceed a preset distance threshold includes, as a candidate server:
acquiring a region corresponding to the target physical address as a target region;
acquiring a node server with the region same as the target region from the cluster server as an initial node server;
respectively calculating the distance between the physical address of each initial node server and the target physical address as a reference distance;
and taking the node server of which the reference distance with the target physical address does not exceed a preset distance threshold value as the candidate server.
Optionally, after the obtaining, from the cluster servers, node servers belonging to a region identical to the target region as initial node servers, and before the calculating a distance between a physical address of each initial node server and the target physical address respectively as a reference distance, the load balancing method for data access further includes:
carrying out availability detection on each initial node server to obtain a detection result;
and updating the initial node server based on the obtained detection result.
Optionally, the performing availability detection on each candidate server includes:
sending a heartbeat packet detection instruction to each candidate server based on cluster communication;
and determining the node state corresponding to each candidate server according to the feedback result of each candidate server for the heartbeat packet detection instruction, wherein the node state is used as the detection result of the availability detection.
Optionally, the responding, with the target node, to the data access request includes:
performing hash calculation on the target access address by adopting a hash scheduling algorithm to obtain a hash result;
acquiring a preset hash mapping table, and determining a storage address corresponding to a target access address based on the hash result and the preset mapping relation table;
and performing access processing on the storage content in the storage address based on the data access request.
In order to solve the foregoing technical problem, an embodiment of the present application further provides a load balancing apparatus for data access, including:
the access address acquisition module is used for receiving a data access request sent by a client and acquiring a target access address contained in the data access request;
a candidate server determining module, configured to obtain a physical address corresponding to the target access address as a target physical address, and obtain, from the cluster servers, a node server whose distance from the target physical address does not exceed a preset distance threshold as a candidate server;
a target node determining module, configured to perform traffic detection on each candidate server by using a Qos technique, and determine a target node according to a detection result;
and the access request response module is used for responding the data access request by adopting the target node.
Optionally, the candidate server determination module includes:
the target region determining submodule is used for acquiring a region corresponding to the target physical address as a target region;
an initial node server determining submodule, configured to obtain, from the cluster server, a node server in which the region to which the node server belongs is the same as the target region, and use the node server as an initial node server;
a reference distance calculation submodule, configured to calculate a distance between a physical address of each initial node server and the target physical address, as a reference distance;
and the candidate server determining submodule is used for taking the node server of which the reference distance with the target physical address does not exceed a preset distance threshold value as the candidate server.
Optionally, the load balancing apparatus for data access further includes:
the availability detection submodule is used for carrying out availability detection on each initial node server to obtain a detection result;
and the initial node server updating submodule is used for updating the initial node server based on the obtained detection result.
Optionally, the availability detection sub-module includes:
the heartbeat detection unit is used for sending a heartbeat packet detection instruction to each candidate server based on cluster communication;
and the detection result determining unit is used for determining the node state corresponding to each candidate server according to the feedback result of each candidate server aiming at the heartbeat packet detection instruction, and the node state is used as the detection result of the availability detection.
Optionally, the access request response module includes:
the Hash calculation unit is used for carrying out Hash calculation on the target access address by adopting a Hash scheduling algorithm to obtain a Hash result;
the storage address determining unit is used for acquiring a preset hash mapping table and determining a storage address corresponding to a target access address based on the hash result and the preset mapping relation table;
and the access processing unit is used for performing access processing on the storage content in the storage address based on the data access request.
In order to solve the above technical problem, an embodiment of the present application further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the load balancing method for data access when executing the computer program.
In order to solve the foregoing technical problem, an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the steps of the load balancing method for data access are implemented.
According to the load balancing method, device, computer equipment and storage medium for data access, provided by the embodiment of the invention, the data access request sent by the client is received, the target access address contained in the data access request is obtained, the physical address corresponding to the target access address is obtained and used as the target physical address, the node server with the distance not exceeding the preset distance threshold value from the cluster server is obtained and used as the candidate server, the Qos technology is adopted to detect the flow of each candidate server, the target node is determined according to the detection result, and the target node is adopted to respond to the data access request, so that the optimal node server is intelligently obtained to respond to the access request, and the data access response speed is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
FIG. 1 is a schematic diagram of an application environment of the present application;
FIG. 2 is a flow diagram of one embodiment of a method for load balancing of data access of the present application;
FIG. 3 is a schematic block diagram illustrating one embodiment of a load balancing apparatus for data access according to the present application;
FIG. 4 is a schematic block diagram of one embodiment of a computer device according to the present application.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "including" and "having," and any variations thereof, in the description and claims of this application and the description of the above figures are intended to cover non-exclusive inclusions. The terms "first," "second," and the like in the description and claims of this application or in the foregoing drawings are used for distinguishing between different objects and not for describing a particular sequential order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein may be combined with other embodiments.
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments of the present invention, are within the scope of protection of the present invention.
Referring to fig. 1, as shown in fig. 1, a system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. Network 104 is the medium used to provide communication links between terminal devices 101, 102, 103 and server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like.
The terminal devices 101, 102, 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, E-book readers, MP3 players (Moving Picture E interface displays a characters Group Audio Layer III, motion Picture experts compress standard Audio Layer 3), MP4 players (Moving Picture E interface displays a characters Group Audio Layer IV, motion Picture experts compress standard Audio Layer 4), laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background server providing support for pages displayed on the terminal devices 101, 102, 103.
The load balancing method for data access provided by the embodiment of the present application is executed by a server, and accordingly, a load balancing device for data access is provided in the server.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. Any number of terminal devices, networks and servers may be provided according to implementation needs, and the terminal devices 101, 102 and 103 in this embodiment may specifically correspond to an application system in actual production.
Referring to fig. 2, fig. 2 shows a load balancing method for data access according to an embodiment of the present invention, which is detailed as follows:
s201: and receiving a data access request sent by the client, and acquiring a target access address contained in the data access request.
Specifically, the embodiment is applied to a server of a large internet enterprise or organization involving more sub-services, and higher traffic may be encountered during some peak hours, so that data traffic is distributed by using a manner of multiple distributed servers, a user at a client clicks a certain resource link or service of a site, a data access request is generated and sent to the server, and the server receives and analyzes the data access request to obtain a target access address contained in the data access request.
The target access address is a network address corresponding to a network resource or service which the client user needs to access.
S202: and acquiring a physical address corresponding to the target access address as a target physical address, and acquiring a node server with a distance not exceeding a preset distance threshold value from the cluster server as a candidate server.
Specifically, a mapping table of each access address and a physical address of a real server is pre-stored in the server, after a target access address is obtained, a physical address corresponding to the target access address is obtained according to the mapping table pre-stored in the server to serve as the target physical address, and then a node server, the distance between which and the target physical address does not exceed a preset distance threshold, is obtained to serve as a candidate server.
It should be noted that the preset distance threshold may be set according to actual needs, for example, set to 100 kilometers, in this embodiment, because a part of the distributed servers is far from the target physical address, and selecting the servers for data access may result in too high delay, so that filtering the part of servers first is also beneficial to reducing the calculation amount of subsequently selecting servers, shortening the time cost, and improving the efficiency of server selection.
Specifically, the obtaining of the node server whose distance and target physical address do not exceed a preset distance threshold from the cluster server as the candidate server includes:
acquiring a region corresponding to the target physical address as a target region;
acquiring a node server with the same region as the target region from the cluster server as an initial node server;
respectively calculating the distance between the physical address of each initial node server and the target physical address as a reference distance;
and taking the node server with the reference distance from the target physical address not exceeding a preset distance threshold value as a candidate server.
The region refers to a region corresponding to the target physical address, for example, the target physical address is wuhan, and the corresponding region is north and Hu province. The region of this embodiment can be set according to actual needs and stored in the server, and the specific level (province level, district level, etc.) and division can be set according to actual needs, which is not specifically limited herein.
The preset distance threshold is set in combination with actual needs of factors such as network speed transmission rate and response time efficiency, and is not specifically limited here.
Further, after acquiring the node servers belonging to the same region as the target region from the cluster servers as initial node servers, and before calculating a distance between a physical address of each initial node server and a target physical address as a reference distance, the load balancing method for data access further includes:
carrying out availability detection on each initial node server to obtain a detection result;
and updating the initial node server based on the obtained detection result.
The usability detection may specifically be health state detection of the initial node server, so as to ensure normal communication of the candidate servers, and eliminate node servers (downtime, offline, or abnormal node servers) which cannot normally communicate.
In this embodiment, the initial node server is updated based on the availability detection manner, so that the robustness and the availability of the initial node server are ensured, and it is ensured that the subsequent screening is selected from available servers.
Further, the availability detection of each candidate server comprises:
sending a heartbeat packet detection instruction to each candidate server based on cluster communication;
and determining the node state corresponding to each candidate server according to the feedback result of each candidate server for the heartbeat packet detection instruction, wherein the node state is used as the detection result of the availability detection.
In a specific optional implementation, performing availability detection on each candidate server, and based on an obtained detection result, determining a target server includes:
sending a heartbeat packet detection instruction to each candidate server based on cluster communication;
and determining the node state corresponding to each candidate server according to the feedback result of each candidate server for the heartbeat packet detection instruction, wherein the node state is used as the detection result of the availability detection.
After the candidate servers are determined, activity probing is performed on each candidate server to determine node states of the candidate servers.
It should be noted that there are multiple nodes (node servers) in the cluster, and due to some control policies and performance factors of the nodes themselves, the nodes may be dynamically brought online and offline, so that to ensure the effectiveness of subsequent data access request distribution and processing, the state of the nodes needs to be determined first.
The detection result comprises activation, downtime and non-activation.
Specifically, whether the link state of the network connection port of the candidate server corresponding to the heartbeat packet is normal is judged by sending a heartbeat packet detection instruction to each candidate server, and when the link state is normal, the node of the candidate server performs interactive response with the server according to the heartbeat packet detection instruction.
It should be understood that an anomaly can be timely discovered through heartbeat monitoring, for example, if no feedback of the node server to the heartbeat packet is received within a period of time, it is determined that the link state of the node is abnormal, at this time, the node is removed from the list of the valid nodes, the subsequent data access request is prevented from being distributed to the node, and meanwhile, the abnormal condition is timely displayed on an interactive interface of the server, so that a maintainer can timely analyze and process the related anomaly problem appearing on the corresponding cluster node.
The heartbeat packet is a self-defined command word which regularly informs the self state of the other side between the target host and the server, is sent at a certain time interval, is similar to the heartbeat, and is called as the heartbeat packet. The heartbeat package is used for monitoring the availability of SOCKET and ensuring the stability of interaction between the server and the target host.
And the state of each candidate server is quickly judged in a heartbeat detection mode, effective candidate servers are screened out, and the usability of the finally screened server is ensured.
S203: and adopting a Qos technology to detect the flow of each candidate server, and determining a target node according to a detection result.
Among them, qoS (Quality of Service) refers to a network that can provide better Service capability for specified network communication by using various basic technologies, and is a security mechanism of the network, and is a technology for solving the problems of network delay and congestion. QoS guarantees are important for capacity-limited networks, especially for streaming multimedia applications such as VoIP and IPTV, which often require fixed transmission rates and are sensitive to delay.
S204: and responding the data access request by adopting the target node.
Specifically, the responding the data access request by the target node includes:
performing hash calculation on the target access address by adopting a hash scheduling algorithm to obtain a hash result;
acquiring a preset hash mapping table, and determining a storage address corresponding to a target access address based on a hash result and the preset mapping relation table;
and performing access processing on the storage content in the storage address based on the data access request.
In this embodiment, the corresponding storage address is found through the hash result, because the hash result for a single access address is the same, theoretically, the URL is permanently allocated to a fixed node server, and because the hash calculation is performed, the allocation of the access addresses is uniform, and meanwhile, the access amount can be balanced.
In this embodiment, the hash mapping table corresponding to each node server is preset in advance, and after a hash result is obtained, a corresponding storage location can be determined according to the value of the hash result.
In the embodiment, by receiving a data access request sent by a client, obtaining a target access address contained in the data access request, obtaining a physical address corresponding to the target access address as a target physical address, obtaining a node server with a distance not exceeding a preset distance threshold from a cluster server as a candidate server, performing traffic detection on each candidate server by adopting a Qos technology, determining a target node according to a detection result, and responding to the data access request by adopting the target node, the purpose that an optimal node server is intelligently obtained responds to the access request is achieved, and the data access response speed is improved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
Fig. 3 is a schematic block diagram of a load balancing apparatus for data access, which corresponds to the load balancing method for data access according to the above embodiment one by one. As shown in fig. 3, the load balancing apparatus for data access includes an access address obtaining module 31, a candidate server determining module 32, a target node determining module 33, and an access request responding module 34. The detailed description of each functional module is as follows:
an access address obtaining module 31, configured to receive a data access request sent by a client, and obtain a target access address included in the data access request;
a candidate server determination module 32, configured to obtain a physical address corresponding to the target access address as a target physical address, and obtain, from the cluster servers, a node server whose distance to the target physical address does not exceed a preset distance threshold as a candidate server;
a target node determining module 33, configured to perform traffic detection on each candidate server by using a Qos technique, and determine a target node according to a detection result;
and an access request response module 34, configured to respond to the data access request with the target node.
Optionally, the candidate server determination module 32 includes:
the target region determining submodule is used for acquiring a region corresponding to the target physical address as a target region;
the initial node server determining submodule is used for acquiring a node server of which the region is the same as the target region from the cluster server and taking the node server as the initial node server;
a reference distance calculation submodule for calculating a distance between a physical address of each initial node server and a target physical address as a reference distance, respectively;
and the candidate server determining submodule is used for taking the node server of which the reference distance with the target physical address does not exceed the preset distance threshold as the candidate server.
Optionally, the load balancing apparatus for data access further includes:
the availability detection submodule is used for carrying out availability detection on each initial node server to obtain a detection result;
and the initial node server updating submodule is used for updating the initial node server based on the obtained detection result.
Optionally, the availability detection sub-module includes:
the heartbeat detection unit is used for sending a heartbeat packet detection instruction to each candidate server based on cluster communication;
and the detection result determining unit is used for determining the node state corresponding to each candidate server according to the feedback result of each candidate server for the heartbeat packet detection instruction, and the node state is used as the detection result of the availability detection.
Optionally, the access request response module 34 includes:
the Hash calculation unit is used for carrying out Hash calculation on the target access address by adopting a Hash scheduling algorithm to obtain a Hash result;
the storage address determining unit is used for acquiring a preset hash mapping table and determining a storage address corresponding to the target access address based on a hash result and the preset mapping relation table;
and the access processing unit is used for performing access processing on the storage content in the storage address based on the data access request.
The specific limitations of the load balancing apparatus for data access may refer to the limitations of the load balancing method for data access, which are not described herein again. The modules in the load balancing device for data access can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent of a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In order to solve the technical problem, an embodiment of the present application further provides a computer device. Referring to fig. 4 in particular, fig. 4 is a block diagram of a basic structure of a computer device according to the embodiment.
The computer device 4 comprises a memory 41, a processor 42, and a network interface 43, which are communicatively connected to each other via a system bus. It is noted that only the computer device 4 having the components connection memory 41, processor 42, network interface 43 is shown, but it is understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead. As will be understood by those skilled in the art, the computer device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The computer device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The computer equipment can carry out man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch panel or voice control equipment and the like.
The memory 41 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or D interface display memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the memory 41 may be an internal storage unit of the computer device 4, such as a hard disk or a memory of the computer device 4. In other embodiments, the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the computer device 4. Of course, the memory 41 may also include both internal and external storage devices of the computer device 4. In this embodiment, the memory 41 is generally used for storing an operating system installed in the computer device 4 and various types of application software, such as program codes for controlling electronic files. Further, the memory 41 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 42 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 42 is typically used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is configured to execute the program code stored in the memory 41 or process data, for example, execute the program code for data access.
The network interface 43 may comprise a wireless network interface or a wired network interface, and the network interface 43 is generally used for establishing a communication connection between the computer device 4 and other electronic devices.
The present application provides yet another embodiment, which is a computer-readable storage medium storing a data access program, the data access program being executable by at least one processor to cause the at least one processor to perform the steps of the load balancing method for data access as described above.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method of the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but in many cases, the former is a better implementation. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
It should be understood that the above-described embodiments are merely exemplary of some, and not all, embodiments of the present application, and that the drawings illustrate preferred embodiments of the present application without limiting the scope of the claims appended hereto. This application is capable of embodiments in many different forms and is provided for the purpose of enabling a thorough understanding of the disclosure of the application. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to one skilled in the art that the present application may be practiced without modification or with equivalents of some of the features described in the foregoing embodiments. All equivalent structures made by using the contents of the specification and the drawings of the present application are directly or indirectly applied to other related technical fields and are within the protection scope of the present application.
Claims (10)
1. A load balancing method for data access is applied to a cluster server, and is characterized in that the load balancing method for data access comprises the following steps:
receiving a data access request sent by a client, and acquiring a target access address contained in the data access request;
acquiring a physical address corresponding to the target access address as a target physical address, and acquiring a node server with a distance not exceeding a preset distance threshold value from the cluster server as a candidate server;
adopting a Qos technology to perform flow detection on each candidate server, and determining a target node according to a detection result;
and responding the data access request by adopting the target node.
2. The method for load balancing of data access according to claim 1, wherein the obtaining, from the cluster servers, the node server whose distance from the target physical address does not exceed a preset distance threshold as the candidate server comprises:
acquiring a region corresponding to the target physical address as a target region;
acquiring a node server of which the region is the same as the target region from the cluster server as an initial node server;
respectively calculating the distance between the physical address of each initial node server and the target physical address to be used as a reference distance;
and taking the node server of which the reference distance with the target physical address does not exceed a preset distance threshold value as the candidate server.
3. The method for load balancing data access according to claim 2, wherein after the node servers belonging to the same domain as the target domain are obtained from the cluster servers as initial node servers, and before the distance between the physical address of each initial node server and the target physical address is calculated as a reference distance, the method for load balancing data access further comprises:
carrying out availability detection on each initial node server to obtain a detection result;
and updating the initial node server based on the obtained detection result.
4. The method for load balancing data access according to claim 3, wherein said detecting availability of each of said candidate servers comprises:
sending a heartbeat packet detection instruction to each candidate server based on cluster communication;
and determining the node state corresponding to each candidate server according to the feedback result of each candidate server for the heartbeat packet detection instruction, wherein the node state is used as the detection result of the availability detection.
5. The method of load balancing of data access according to any of the claims 1 to 4, wherein said responding to said data access request with said target node comprises:
performing hash calculation on the target access address by adopting a hash scheduling algorithm to obtain a hash result;
acquiring a preset hash mapping table, and determining a storage address corresponding to a target access address based on the hash result and the preset mapping relation table;
and performing access processing on the storage content in the storage address based on the data access request.
6. A load balancing apparatus for data access, the load balancing apparatus for data access comprising:
the access address acquisition module is used for receiving a data access request sent by a client and acquiring a target access address contained in the data access request;
a candidate server determining module, configured to obtain a physical address corresponding to the target access address as a target physical address, and obtain, from the cluster servers, a node server whose distance from the target physical address does not exceed a preset distance threshold as a candidate server;
a target node determining module, configured to perform traffic detection on each candidate server by using a Qos technology, and determine a target node according to a detection result;
and the access request response module is used for responding the data access request by adopting the target node.
7. The apparatus for load balancing of data access of claim 6, wherein the candidate server determination module comprises:
the target region determining submodule is used for acquiring a region corresponding to the target physical address as a target region;
an initial node server determining submodule, configured to obtain, from the cluster server, a node server in which the region to which the node server belongs is the same as the target region, and use the node server as an initial node server;
a reference distance calculation submodule, configured to calculate a distance between a physical address of each initial node server and the target physical address, as a reference distance;
and the candidate server determining submodule is used for taking the node server of which the reference distance with the target physical address does not exceed a preset distance threshold value as the candidate server.
8. The apparatus for load balancing of data accesses according to claim 7, wherein said apparatus for load balancing of data accesses further comprises:
the availability detection submodule is used for carrying out availability detection on each initial node server to obtain a detection result;
and the initial node server updating submodule is used for updating the initial node server based on the obtained detection result.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements a method of load balancing of data access according to any one of claims 1 to 5 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out a method of load balancing of data accesses according to any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210555778.3A CN115277566B (en) | 2022-05-20 | 2022-05-20 | Load balancing method and device for data access, computer equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210555778.3A CN115277566B (en) | 2022-05-20 | 2022-05-20 | Load balancing method and device for data access, computer equipment and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115277566A true CN115277566A (en) | 2022-11-01 |
CN115277566B CN115277566B (en) | 2024-03-22 |
Family
ID=83759712
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210555778.3A Active CN115277566B (en) | 2022-05-20 | 2022-05-20 | Load balancing method and device for data access, computer equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115277566B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116055496A (en) * | 2022-12-30 | 2023-05-02 | 广州趣研网络科技有限公司 | Monitoring data acquisition method and device, electronic equipment and storage medium |
CN116308066A (en) * | 2023-05-10 | 2023-06-23 | 青岛创新奇智科技集团股份有限公司 | Storage management method and device based on Internet of things |
CN116820787A (en) * | 2023-08-31 | 2023-09-29 | 湖北芯擎科技有限公司 | Load balancing method, load balancing device, electronic equipment and computer readable storage medium |
Citations (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070288639A1 (en) * | 2001-04-30 | 2007-12-13 | Aol Llc | Load balancing with direct terminal response |
US20110078230A1 (en) * | 2009-09-25 | 2011-03-31 | Emilio Sepulveda | Method and system for providing a cdn with granular quality of service |
CN102404378A (en) * | 2010-09-07 | 2012-04-04 | 成都索贝数码科技股份有限公司 | Streaming media distribution and transmission network system |
CN103166985A (en) * | 2011-12-09 | 2013-06-19 | 上海盛霄云计算技术有限公司 | Global load balancing scheduling method and data transmission method and device and system |
US20140094194A1 (en) * | 2012-10-01 | 2014-04-03 | Mastercard International Incorporated | Method and system for providing location services |
CN103873562A (en) * | 2014-02-27 | 2014-06-18 | 车智互联(北京)科技有限公司 | Cache method and cache system |
CN103973728A (en) * | 2013-01-25 | 2014-08-06 | 杭州华三通信技术有限公司 | Load balancing method and device under multi-data-center environment |
CN104618497A (en) * | 2015-02-13 | 2015-05-13 | 小米科技有限责任公司 | Webpage access method and device |
CN105610930A (en) * | 2015-12-25 | 2016-05-25 | 互联网域名系统北京市工程研究中心有限公司 | Data optimization method based on DNS (Domain Name Server) |
CN109586969A (en) * | 2018-12-13 | 2019-04-05 | 平安科技(深圳)有限公司 | Content distributing network disaster recovery method, device, computer equipment and storage medium |
CN110336790A (en) * | 2019-05-29 | 2019-10-15 | 网宿科技股份有限公司 | A kind of method and system of website detection |
CN110365747A (en) * | 2019-06-24 | 2019-10-22 | 北京奇艺世纪科技有限公司 | Processing method, device, server and the computer readable storage medium of network request |
CN110401731A (en) * | 2019-07-25 | 2019-11-01 | 北京百度网讯科技有限公司 | Method and apparatus for distributing content distribution nodes |
CN111314472A (en) * | 2020-02-21 | 2020-06-19 | 聚好看科技股份有限公司 | Domain name resolution method, domain name resolution server and terminal equipment |
CN113037878A (en) * | 2021-05-26 | 2021-06-25 | 北京拓课网络科技有限公司 | CDN data access method, system and electronic equipment |
CN113259428A (en) * | 2021-05-11 | 2021-08-13 | 鸬鹚科技(深圳)有限公司 | Data access request processing method and device, computer equipment and medium |
CN113747204A (en) * | 2021-07-29 | 2021-12-03 | 深圳市九洲电器有限公司 | Program acquisition method, device, server and storage medium |
CN114095567A (en) * | 2021-10-12 | 2022-02-25 | 鸬鹚科技(深圳)有限公司 | Data access request processing method and device, computer equipment and medium |
-
2022
- 2022-05-20 CN CN202210555778.3A patent/CN115277566B/en active Active
Patent Citations (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070288639A1 (en) * | 2001-04-30 | 2007-12-13 | Aol Llc | Load balancing with direct terminal response |
US20110078230A1 (en) * | 2009-09-25 | 2011-03-31 | Emilio Sepulveda | Method and system for providing a cdn with granular quality of service |
CN102404378A (en) * | 2010-09-07 | 2012-04-04 | 成都索贝数码科技股份有限公司 | Streaming media distribution and transmission network system |
CN103166985A (en) * | 2011-12-09 | 2013-06-19 | 上海盛霄云计算技术有限公司 | Global load balancing scheduling method and data transmission method and device and system |
US20140094194A1 (en) * | 2012-10-01 | 2014-04-03 | Mastercard International Incorporated | Method and system for providing location services |
CN103973728A (en) * | 2013-01-25 | 2014-08-06 | 杭州华三通信技术有限公司 | Load balancing method and device under multi-data-center environment |
CN103873562A (en) * | 2014-02-27 | 2014-06-18 | 车智互联(北京)科技有限公司 | Cache method and cache system |
CN104618497A (en) * | 2015-02-13 | 2015-05-13 | 小米科技有限责任公司 | Webpage access method and device |
CN105610930A (en) * | 2015-12-25 | 2016-05-25 | 互联网域名系统北京市工程研究中心有限公司 | Data optimization method based on DNS (Domain Name Server) |
CN109586969A (en) * | 2018-12-13 | 2019-04-05 | 平安科技(深圳)有限公司 | Content distributing network disaster recovery method, device, computer equipment and storage medium |
CN110336790A (en) * | 2019-05-29 | 2019-10-15 | 网宿科技股份有限公司 | A kind of method and system of website detection |
CN110365747A (en) * | 2019-06-24 | 2019-10-22 | 北京奇艺世纪科技有限公司 | Processing method, device, server and the computer readable storage medium of network request |
CN110401731A (en) * | 2019-07-25 | 2019-11-01 | 北京百度网讯科技有限公司 | Method and apparatus for distributing content distribution nodes |
CN111314472A (en) * | 2020-02-21 | 2020-06-19 | 聚好看科技股份有限公司 | Domain name resolution method, domain name resolution server and terminal equipment |
CN113259428A (en) * | 2021-05-11 | 2021-08-13 | 鸬鹚科技(深圳)有限公司 | Data access request processing method and device, computer equipment and medium |
CN113037878A (en) * | 2021-05-26 | 2021-06-25 | 北京拓课网络科技有限公司 | CDN data access method, system and electronic equipment |
CN113747204A (en) * | 2021-07-29 | 2021-12-03 | 深圳市九洲电器有限公司 | Program acquisition method, device, server and storage medium |
CN114095567A (en) * | 2021-10-12 | 2022-02-25 | 鸬鹚科技(深圳)有限公司 | Data access request processing method and device, computer equipment and medium |
Non-Patent Citations (2)
Title |
---|
MAO QILIN等: "A Load Balancing Method Based on SDN", 《2015 SEVENTH INTERNATIONAL CONFERENCE ON MEASURING TECHNOLOGY AND MECHATRONICS AUTOMATION》 * |
甄岩;武穆清;吴大鹏;孙兵;李筱叶;徐春秀;: "MANET多路径负载均衡方法", 北京邮电大学学报, no. 02 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116055496A (en) * | 2022-12-30 | 2023-05-02 | 广州趣研网络科技有限公司 | Monitoring data acquisition method and device, electronic equipment and storage medium |
CN116055496B (en) * | 2022-12-30 | 2024-04-05 | 广州趣研网络科技有限公司 | Monitoring data acquisition method and device, electronic equipment and storage medium |
CN116308066A (en) * | 2023-05-10 | 2023-06-23 | 青岛创新奇智科技集团股份有限公司 | Storage management method and device based on Internet of things |
CN116308066B (en) * | 2023-05-10 | 2023-08-18 | 青岛创新奇智科技集团股份有限公司 | Storage management method and device based on Internet of things |
CN116820787A (en) * | 2023-08-31 | 2023-09-29 | 湖北芯擎科技有限公司 | Load balancing method, load balancing device, electronic equipment and computer readable storage medium |
CN116820787B (en) * | 2023-08-31 | 2023-12-15 | 湖北芯擎科技有限公司 | Load balancing method, load balancing device, electronic equipment and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN115277566B (en) | 2024-03-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN115277566A (en) | Load balancing method and device for data access, computer equipment and medium | |
US10216601B2 (en) | Agent dynamic service | |
CN108462760A (en) | Electronic device, cluster access domain name automatic generation method and storage medium | |
US10084637B2 (en) | Automatic task tracking | |
CN114095567A (en) | Data access request processing method and device, computer equipment and medium | |
CN112653618A (en) | Gateway registration method and device of micro-service application API endpoint | |
CN113890879B (en) | Load balancing method and device for data access, computer equipment and medium | |
CN113452579B (en) | H5 page loading method and device, computer equipment and storage medium | |
CN113259428A (en) | Data access request processing method and device, computer equipment and medium | |
CN110336888B (en) | Server distribution method, device, system and medium | |
US10191844B2 (en) | Automatic garbage collection thrashing monitoring | |
CN114143191A (en) | Distributed gateway-based micro-service arranging method and device and related equipment | |
CN114185734A (en) | Cluster monitoring method and device and electronic equipment | |
CN110442059B (en) | Controlled equipment expanding method and device and control equipment | |
CN114449040B (en) | Configuration issuing method and device based on cloud platform | |
WO2020000724A1 (en) | Method, electronic device and medium for processing communication load between hosts of cloud platform | |
CN112994934B (en) | Data interaction method, device and system | |
CN114995914A (en) | Picture data processing method and device, computer equipment and storage medium | |
CN110188006B (en) | Data maintenance method, device and equipment | |
CN113239396A (en) | Data access system, method, device, computer equipment and medium | |
CN114124883A (en) | Data access method and device based on cloud storage address, computer equipment and medium | |
CN112632192A (en) | Node maintenance method and device, computer equipment and medium | |
CN109547290B (en) | Cloud platform garbage data detection processing method, device, equipment and storage medium | |
CN114785691B (en) | Network security control method and device, computer equipment and storage medium | |
CN111327513B (en) | Message data pushing method and device, computer equipment and storage medium |
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 |