CN115277566B - 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 PDF

Info

Publication number
CN115277566B
CN115277566B CN202210555778.3A CN202210555778A CN115277566B CN 115277566 B CN115277566 B CN 115277566B CN 202210555778 A CN202210555778 A CN 202210555778A CN 115277566 B CN115277566 B CN 115277566B
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.)
Active
Application number
CN202210555778.3A
Other languages
Chinese (zh)
Other versions
CN115277566A (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.)
Cormorant Technology Shenzhen Co ltd
Original Assignee
Cormorant Technology Shenzhen Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Cormorant Technology Shenzhen Co ltd filed Critical Cormorant Technology Shenzhen Co ltd
Priority to CN202210555778.3A priority Critical patent/CN115277566B/en
Publication of CN115277566A publication Critical patent/CN115277566A/en
Application granted granted Critical
Publication of CN115277566B publication Critical patent/CN115277566B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mathematical Physics (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Environmental & Geological Engineering (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a load balancing method, a device, computer equipment and a storage medium for data access, wherein the method comprises the following steps: the invention can improve the data access response speed by receiving the data access request sent by the client, acquiring the target access address contained in the data access request, acquiring the physical address corresponding to the target access address as the target physical address, acquiring the node server with the distance not exceeding the preset distance threshold from the cluster server as the candidate server, adopting Qos technology to detect the flow of each candidate server, determining the target node according to the detection result, and adopting the target node to respond to the data access request.

Description

Load balancing method and device for data access, computer equipment and medium
Technical Field
The present invention relates to the field of data processing, and in particular, to a method, an apparatus, a computer device, and a medium for load balancing of data access.
Background
With the rapid development of computer network technology, information acquisition is often required through a network during daily work, study, shopping, business handling and the like, and some large-scale internet enterprises or institutions relate to more sub-businesses, and in some peak periods, relatively high flow is faced, so that how to quickly respond to data access is an industry problem of relatively great concern.
At present, the existing mode mainly performs load balancing in an average distribution mode so as to reduce the pressure of a server and improve the response speed of data access, and the normal response of the data access can be ensured on the whole, but the data access delay is too high in a peak period.
Disclosure of Invention
The embodiment of the invention provides a load balancing method, a device, computer equipment and a storage medium for data access, which are used for improving the efficiency of data access.
In order to solve the above technical problems, 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;
the physical address corresponding to the target access address is obtained to be used as a target physical address, and a node server with the distance not exceeding a preset distance threshold value with the target physical address is obtained from the cluster server to be used as a candidate server;
detecting the flow of each candidate server by adopting a Qos technology, and determining a target node according to a detection result;
and responding to 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, as a 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 with the target physical address not exceeding a preset distance threshold as the candidate server.
Optionally, after the node servers with the same affiliated territory as the target territory are obtained from the cluster servers as the initial node servers and before the distances between the physical address of each initial node server and the target physical address are calculated as the reference distances, 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 heartbeat packet detection instructions 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 aiming at the heartbeat packet detection instruction, and taking the node state as the detection result of the availability detection.
Optionally, the responding to the data access request with the target node includes:
carrying out 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 based on the data access request, performing access processing on the storage content in the storage address.
In order to solve the above technical problem, an embodiment of the present application further provides a load balancing device 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;
the candidate server determining module is used for acquiring a physical address corresponding to the target access address as a target physical address, and acquiring a node server with the distance not exceeding a preset distance threshold value from the cluster server as a candidate server;
the target node determining module is used for detecting the flow of each candidate server by adopting a Qos technology, and determining a target node according to the detection result;
and the access request response module is used for responding to the data access request by adopting the target node.
Optionally, the candidate server determining module includes:
the target region determining sub-module 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 having a region identical to the target region, as an initial node server;
the reference distance calculation sub-module is used for respectively calculating the distance between the 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 with the reference distance with the target physical address not exceeding a preset distance threshold as the candidate server.
Optionally, the load balancing device 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 sub-module is used for updating the initial node server based on the obtained detection result.
Optionally, the availability detection submodule includes:
the heartbeat detection unit is used for sending heartbeat packet detection instructions 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 on 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, 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 steps of the load balancing method for data access when executing the computer program.
To solve the above technical problem, embodiments of the present application further provide a computer readable storage medium storing a computer program, where the computer program implements the steps of the load balancing method for data access described above when executed by a processor.
According to the load balancing method, the device, the computer equipment and the storage medium for data access, the data access request sent by the client is received, the target access address contained in the data access request is acquired, the physical address corresponding to the target access address is acquired and used as the target physical address, the node servers with the distance not exceeding the preset distance threshold value are acquired from the cluster servers and used as candidate servers, the Qos technology is adopted for detecting the flow of each candidate server, the target node is determined according to the detection result, the target node is adopted for responding to the data access request, and the intelligent acquisition of the optimal node servers to respond to the access request is realized, so that 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 that are needed in the description of the embodiments of the present invention will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic illustration of an application environment of the present application;
FIG. 2 is a flow chart of one embodiment of a load balancing method of data access of the present application;
FIG. 3 is a schematic structural view of one embodiment of a load balancing apparatus for data access according to the present application;
FIG. 4 is a schematic structural 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 applications herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having" and any variations thereof in the description and claims of the present application and in the description of the figures above are intended to cover non-exclusive inclusions. The terms first, second and the like in the description and in the claims or in the above-described figures, are used for distinguishing between different objects and not necessarily for describing a sequential or chronological order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application. The appearances of such phrases 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. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
The following description of the embodiments of the present invention 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 embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
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. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or send messages or the like.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablet computers, electronic book readers, MP3 players (Moving Picture E interface display perts Group Audio Layer III, moving Picture expert compression standard audio layer 3), MP4 players (Moving Picture E interface display perts Group Audio Layer IV, moving Picture expert compression standard audio layer 4), laptop and desktop computers, and so on.
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.
It should be noted that, the load balancing method for data access provided by the embodiment of the present application is executed by a server, and accordingly, the load balancing device for data access is set 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 requirements, and the terminal devices 101, 102 and 103 in the embodiments of the present application may specifically correspond to application systems 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 described in detail below:
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 in some peak periods, higher traffic is faced, so that data traffic is split by adopting a plurality of distributed servers, after a user of 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 the data access request 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 to be accessed by the client user.
S202: and acquiring a physical address corresponding to the target access address as a target physical address, and acquiring a node server with the distance not exceeding a preset distance threshold 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 prestored in a server, after a target access address is obtained, the physical address corresponding to the target access address is obtained according to the prestored mapping table of the server and is used as a target physical address, and then a node server with the distance to the target physical address not exceeding a preset distance threshold is obtained and is used 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 km, in this embodiment, since the distributed server is far away from the target physical address, selecting these servers to access data may cause too high delay, so filtering this part of servers first is also beneficial to reducing the calculation amount of the subsequent selected servers, shortening the time expenditure, and improving the efficiency of server selection.
Specifically, the node server, from the cluster servers, for which the distance from the target physical address does not exceed the preset distance threshold, is obtained, and the node server, as a candidate server, includes:
acquiring a region corresponding to a 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 with the target physical address not exceeding a preset distance threshold as a candidate server.
The region refers to a region corresponding to a target physical address, for example, the target physical address is Wuhan, and the corresponding region is Hubei province. The region of the present embodiment may be set according to actual needs, and stored in the server, and specific levels (provincial level, regional level, etc.) and divisions may be set according to actual needs, which are not particularly limited herein.
The preset distance threshold is set by combining the actual requirements of factors such as the network speed transmission rate, response aging and the like, and is not particularly limited herein.
Further, after obtaining the node servers with the same affiliated territory as the target territory from the cluster servers as the initial node servers and before respectively calculating the distance between the physical address of each initial node server and the target physical address as the reference distance, the load balancing method for 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.
The availability detection may specifically be detecting the health status of the initial node server, so as to ensure that the candidate servers can communicate normally, and reject node servers (down, offline or abnormal node servers) that cannot communicate normally.
In this embodiment, based on the manner of availability detection, the initial node server is updated, so as to ensure the robustness and availability of the initial node server, and ensure that the subsequent screening is all selected from the available servers.
Further, the availability detection for each candidate server includes:
sending heartbeat packet detection instructions 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 aiming at the heartbeat packet detection instruction, and taking the node state as a detection result of the availability detection.
In a specific alternative embodiment, performing availability detection on each candidate server, and determining the target server based on the obtained detection result includes:
sending heartbeat packet detection instructions 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 aiming at the heartbeat packet detection instruction, and taking the node state as a detection result of the availability detection.
After the candidate servers are determined, activity probing is performed on each candidate server to determine the node status of the candidate server.
It should be noted that, there are multiple nodes (node servers) in the cluster, and because of factors such as some management policies and performance of the nodes, dynamic online and offline can be performed, in order to ensure the effectiveness of the 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, by sending a heartbeat packet detection instruction to each candidate server, whether the link state of the network connection port of the candidate server corresponding to the heartbeat packet is normal is judged, 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, by means of heartbeat monitoring, an abnormality can be timely found, for example, if no feedback of the node server to the heartbeat packet is received within a period of time, it is confirmed that the link state of the node is abnormal, at this time, the node is removed from the list of valid nodes, so that a subsequent data access request is prevented from being distributed to the node, and meanwhile, the abnormality is timely displayed on an interactive interface of the server side, so that maintenance personnel can timely analyze and process related abnormal problems occurring on the corresponding cluster nodes.
The heartbeat packet is a self-defined command word which informs the opposite side of the state at regular time between the target host and the server, and is transmitted at certain time intervals, and is similar to the heartbeat, so the heartbeat packet is called. The heartbeat packet is used for monitoring the availability of SOCKET and ensuring the interaction stability between the server and the target host.
And the state of each candidate server is rapidly judged in a heartbeat detection mode, effective candidate servers are screened out, and the availability of the last screened server is ensured.
S203: and detecting the flow of each candidate server by adopting a Qos technology, and determining a target node according to the detection result.
QoS (Quality of Service ) refers to a technology that a network can utilize various basic technologies to provide better service capability for specified network communication, and is a security mechanism of the network, which is used to solve problems such as network delay and congestion. The guarantee of QoS is important for networks with limited capacity, in particular for streaming multimedia applications, such as VoIP and IPTV, since these applications often require a fixed transmission rate and are also relatively delay sensitive.
S204: the target node is employed to respond to the data access request.
Specifically, responding to the data access request with the target node includes:
carrying out 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, and because the hash result for a single access address is the same, theoretically, the URL will be permanently allocated to a fixed node server, and further because the hash calculation is performed, the allocation of the access address is very uniform, and the access amount can be balanced.
The hash mapping table is a structure for storing data by key-value (key-index), and the corresponding value can be found by inputting the value to be found, i.e. the key.
In this embodiment, by receiving a data access request sent by a client, acquiring a target access address included in the data access request, acquiring a physical address corresponding to the target access address, and taking the physical address as a target physical address, and acquiring a node server with a distance not exceeding a preset distance threshold from the target physical address from a cluster server, taking the node server as a candidate server, performing flow detection on each candidate server by using a Qos technology, determining a target node according to a detection result, and adopting the target node to respond to the data access request, thereby realizing that the node server which is intelligent in acquiring the optimal responds to the access request, and improving the data access response speed.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present invention.
Fig. 3 shows a schematic block diagram of a load balancing apparatus for data access, which corresponds to the load balancing method for data access of the above embodiment one by one. As shown in fig. 3, the load balancing apparatus for data access includes an access address acquisition module 31, a candidate server determination module 32, a target node determination module 33, and an access request response module 34. The functional modules are described in detail 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;
the candidate server determining module 32 is configured to obtain a physical address corresponding to the target access address as a target physical address, and obtain, from the cluster server, 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 33, configured to detect a flow rate of each candidate server by using a Qos technology, and determine a target node according to a detection result;
an access request response module 34 is configured to respond to the data access request with the target node.
Optionally, the candidate server determination module 32 includes:
the target region determining sub-module 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 with the same region as the target region from the cluster server as an initial node server;
the reference distance calculation sub-module is used for calculating the distance between the physical address of each initial node server and the target physical address respectively and taking the distance as a reference distance;
and the candidate server determining submodule is used for taking the node server with the reference distance with the target physical address not exceeding a preset distance threshold as a candidate server.
Optionally, the load balancing device for data access 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 sub-module is used for updating the initial node server based on the obtained detection result.
Optionally, the availability detection submodule includes:
the heartbeat detection unit is used for sending heartbeat packet detection instructions 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 as a detection result of the availability detection according to the feedback result of each candidate server on the heartbeat packet detection instruction.
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.
For specific limitations of the load balancing device for data access, reference may be made to the above limitation of the load balancing method for data access, and no further description is given here. The modules in the load balancing device for data access may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In order to solve the technical problems, the embodiment of the application also provides computer equipment. Referring specifically to fig. 4, fig. 4 is a basic structural block diagram of a computer device according to the present embodiment.
The computer device 4 comprises a memory 41, a processor 42, a network interface 43 communicatively connected to each other via a system bus. It is noted that only a computer device 4 having a component connection memory 41, a processor 42, a network interface 43 is shown in the figures, but it is understood that not all of the illustrated components are required to be implemented and that more or fewer components may be implemented instead. It will be appreciated by those skilled in the art that the computer device herein is a device capable of automatically performing numerical calculations and/or information processing in accordance with predetermined or stored instructions, the hardware of which includes, but is not limited to, microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASICs), programmable gate arrays (fields-Programmable Gate Array, FPGAs), digital processors (Digital Signal Processor, DSPs), embedded devices, etc.
The computer equipment can be a desktop computer, a notebook computer, a palm computer, a cloud server and other computing equipment. The computer equipment can perform man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch pad or voice control equipment and the like.
The memory 41 includes at least one type of readable storage medium including 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, etc. In some embodiments, the storage 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 Card (Flash Card) or the like, which are provided on the computer device 4. Of course, the memory 41 may also comprise both an internal memory unit of the computer device 4 and an external memory device. In this embodiment, the memory 41 is typically used for storing an operating system and various application software installed on the computer device 4, such as program codes for controlling electronic files, etc. Further, the memory 41 may 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 (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, such as program code for executing data access.
The network interface 43 may comprise a wireless network interface or a wired network interface, which network interface 43 is typically used for establishing a communication connection between the computer device 4 and other electronic devices.
The present application also provides another embodiment, namely, a computer-readable storage medium storing a data access program 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.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method described in the embodiments of the present application.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method described in the embodiments of the present application.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method described in the embodiments of the present application.
It is apparent that the embodiments described above are only some embodiments of the present application, but not all embodiments, the preferred embodiments of the present application are given in the drawings, but not limiting the patent scope of the present application. This application may be embodied in many different forms, but rather, embodiments are provided in order to provide a more thorough understanding of the present disclosure. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that modifications may be made to the embodiments described in the foregoing, or equivalents may be substituted for elements thereof. All equivalent structures made by the specification and the drawings of the application are directly or indirectly applied to other related technical fields, and are also within the protection scope of the application.

Claims (8)

1. The load balancing method for data access is applied to a cluster server and is characterized by comprising the following steps:
receiving a data access request sent by a client, and acquiring a target access address contained in the data access request;
the physical address corresponding to the target access address is obtained to be used as a target physical address, and a node server with the distance not exceeding a preset distance threshold value with the target physical address is obtained from the cluster server to be used as a candidate server;
detecting the flow of each candidate server by adopting a Qos technology, and determining a target node according to a detection result;
responding to the data access request by adopting the target node;
the step of obtaining, from the cluster server, a node server whose distance from the target physical address does not exceed a preset distance threshold, as a 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 with the target physical address not exceeding a preset distance threshold as the candidate server.
2. The load balancing method for data access according to claim 1, wherein after the node servers belonging to the same territory as the target territory are acquired from the cluster servers as the initial node servers and before the distances between the physical address of each initial node server and the target physical address are calculated respectively as the reference distances, the load balancing method for 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.
3. The method for load balancing of data access of claim 2, wherein said detecting availability of each of said candidate servers comprises:
sending heartbeat packet detection instructions 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 aiming at the heartbeat packet detection instruction, and taking the node state as the detection result of the availability detection.
4. A method of load balancing data access as claimed in any one of claims 1 to 3, wherein said responding to said data access request with said target node comprises:
carrying out 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 based on the data access request, performing access processing on the storage content in the storage address.
5. A load balancing device for data access, the load balancing device 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;
the candidate server determining module is used for acquiring a physical address corresponding to the target access address as a target physical address, and acquiring a node server with the distance not exceeding a preset distance threshold value from the cluster server as a candidate server;
the target node determining module is used for detecting the flow of each candidate server by adopting a Qos technology, and determining a target node according to the detection result;
an access request response module, configured to respond to the data access request with the target node;
the candidate server determination module includes:
the target region determining sub-module 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 having a region identical to the target region, as an initial node server;
the reference distance calculation sub-module is used for respectively calculating the distance between the 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 with the reference distance with the target physical address not exceeding a preset distance threshold as the candidate server.
6. The load balancing apparatus for data access of claim 5, wherein the load balancing apparatus for data access 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 sub-module is used for updating the initial node server based on the obtained detection result.
7. 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 load balancing method of data access according to any of claims 1 to 4 when executing the computer program.
8. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the load balancing method of data access according to any one of claims 1 to 4.
CN202210555778.3A 2022-05-20 2022-05-20 Load balancing method and device for data access, computer equipment and medium Active CN115277566B (en)

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 CN115277566A (en) 2022-11-01
CN115277566B true 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)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116055496B (en) * 2022-12-30 2024-04-05 广州趣研网络科技有限公司 Monitoring data acquisition method and device, electronic equipment and storage medium
CN116308066B (en) * 2023-05-10 2023-08-18 青岛创新奇智科技集团股份有限公司 Storage management method and device based on Internet of things
CN116820787B (en) * 2023-08-31 2023-12-15 湖北芯擎科技有限公司 Load balancing method, load balancing device, electronic equipment and computer readable storage medium
CN118210631A (en) * 2024-03-29 2024-06-18 北京火山引擎科技有限公司 Cluster load balancing method for edge computing, server and electronic equipment
CN118502679B (en) * 2024-07-17 2024-10-01 济南浪潮数据技术有限公司 Data access scheduling method and device for memory

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
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

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2003105006A1 (en) * 2001-04-30 2003-12-18 America Online, Inc. 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
US9031579B2 (en) * 2012-10-01 2015-05-12 Mastercard International Incorporated Method and system for providing location services

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
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)

* Cited by examiner, † Cited by third party
Title
A Load Balancing Method Based on SDN;Mao Qilin等;《2015 Seventh International Conference on Measuring Technology and Mechatronics Automation》;全文 *
MANET多路径负载均衡方法;甄岩;武穆清;吴大鹏;孙兵;李筱叶;徐春秀;;北京邮电大学学报(02);全文 *

Also Published As

Publication number Publication date
CN115277566A (en) 2022-11-01

Similar Documents

Publication Publication Date Title
CN115277566B (en) Load balancing method and device for data access, computer equipment and medium
US10048996B1 (en) Predicting infrastructure failures in a data center for hosted service mitigation actions
CN108462760B (en) Electronic device, automatic cluster access domain name generation method and storage medium
CN111475373A (en) Service control method and device under micro service, computer equipment and storage medium
CN109543891B (en) Method and apparatus for establishing capacity prediction model, and computer-readable storage medium
CN114095567B (en) Data access request processing method and device, computer equipment and medium
CN109960575B (en) Computing capacity sharing method, system and related equipment
CN113890879B (en) Load balancing method and device for data access, computer equipment and medium
CN113254445B (en) Real-time data storage method, device, computer equipment and storage medium
CN109634802B (en) Process monitoring method and terminal equipment
CN110708197B (en) Monitoring device, method for setting monitoring policy of monitoring device, and storage medium
CN110807050B (en) Performance analysis method, device, computer equipment and storage medium
CN115357450A (en) Node maintenance method and device based on artificial intelligence, computer equipment and medium
CN110347546B (en) Dynamic adjustment method, device, medium and electronic equipment for monitoring task
CN110336888B (en) Server distribution method, device, system and medium
CN115033551A (en) Database migration method and device, electronic equipment and storage medium
CN112685157B (en) Task processing method, device, computer equipment and storage medium
CN113242302A (en) Data access request processing method and device, computer equipment and medium
CN117319400A (en) Service processing node adjustment method, device, equipment and storage medium thereof
WO2023138923A1 (en) Failure prediction using informational logs and golden signals
CN114138401A (en) Container configuration method, device, equipment and medium based on artificial intelligence
CN111431764B (en) Node determining method, device, system and medium
CN110188006B (en) Data maintenance method, device and equipment
CN113590372A (en) Log-based link tracking method and device, computer equipment and storage medium
CN112433891A (en) Data processing method and device 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