CN113890879B - 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
CN113890879B
CN113890879B CN202111063653.0A CN202111063653A CN113890879B CN 113890879 B CN113890879 B CN 113890879B CN 202111063653 A CN202111063653 A CN 202111063653A CN 113890879 B CN113890879 B CN 113890879B
Authority
CN
China
Prior art keywords
address
network request
request
type
target
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
CN202111063653.0A
Other languages
Chinese (zh)
Other versions
CN113890879A (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 CN202111063653.0A priority Critical patent/CN113890879B/en
Publication of CN113890879A publication Critical patent/CN113890879A/en
Application granted granted Critical
Publication of CN113890879B publication Critical patent/CN113890879B/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
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9014Indexing; Data structures therefor; Storage structures hash tables
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/251Translation of Internet protocol [IP] addresses between different IP versions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding

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 improves the accuracy of data access load balancing and is beneficial to improving the efficiency of data access by receiving a first network request sent by a client through an external network, carrying out address conversion on the first network request to obtain a second network request, carrying out hash scheduling on URLs in the second network request to obtain node servers corresponding to each request in the second network request as candidate servers, carrying out availability detection on each candidate server, determining a target server based on the obtained detection result, adopting each target server, and responding to each request in the second network 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 technology, more and more people work, learn, shop, transact business and acquire information through the internet, and the like, and some large-scale internet enterprises or institutions relate to more sub-businesses, and in some peak periods, meet higher flow and how to quickly respond to data access is an industry problem of great concern.
At present, some modes are to optimize the response of data access by adding hardware configuration, adding third party machine room hosting and the like, but the cost is high, resource waste is generated in a low peak period, and other modes are to perform the data access response by a sliced polling mode, so that the normal response of data access can be ensured on the whole, but the delay of data access is too high in the 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 first network request sent by a client through an external network;
address conversion is carried out on the first network request to obtain a second network request;
carrying out hash scheduling on the URL in the second network request to obtain a node server corresponding to each request in the second network request as a candidate server;
detecting the availability of each candidate server, and determining a target server based on the obtained detection result;
and responding to each request in the second network request by adopting each target server.
Optionally, performing address translation on the first network request to obtain a second network request includes:
acquiring a source address and a target address corresponding to the first network request;
identifying an address type of the source address and the destination address;
and converting the source address of the preset type and the target address of the preset type based on a preset type conversion mode to obtain a second network request.
Optionally, the preset type is an IPv6 type, at least one of the address types of the source address and the target address is not an IPv6 type, and the converting is performed into the source address of the preset type and the target address of the preset type based on the preset type conversion mode, so as to obtain a second network request:
taking the source address and/or the target address with the address type not being the IPv6 type as an address to be converted;
hexadecimal conversion is carried out on the address to be converted to obtain a converted address, wherein the converted address comprises four groups;
combining the first group and the second group of the converted addresses to obtain an updated second group, and sequentially combining the updated first group and the updated second group to obtain an updated converted address;
zero padding is carried out on the 96 bits before the updated converted address to obtain the source address of the preset type and/or the target address of the preset type, and the second network request is generated based on the source address of the preset type and/or the target address of the preset type and the first network request.
Optionally, hash scheduling is performed on the URL in the second network request, so as to obtain a node server corresponding to each request in the second network request, where the node server serving as a candidate server includes:
carrying out hash calculation on each URL in the second network request to obtain a hash result;
and acquiring a preset hash mapping table, determining a node server corresponding to each URL based on the hash result and the preset mapping relation table, and taking the node server corresponding to each URL as the candidate server.
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.
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 request receiving module is used for receiving a first network request sent by the client through the external network;
the address conversion module is used for carrying out address conversion on the first network request to obtain a second network request;
the request scheduling module is used for carrying out hash scheduling on the URL in the second network request to obtain a node server corresponding to each request in the second network request as a candidate server;
the performance monitoring module is used for detecting the availability of each candidate server and determining a target server based on the obtained detection result;
and the request response module is used for responding to each request in the second network request by adopting each target server.
Optionally, the address translation module includes:
the address acquisition unit is used for acquiring a source address and a target address corresponding to the first network request;
a type identifying unit for identifying address types of the source address and the target address;
the address conversion unit is used for converting the source address of the preset type and the target address of the preset type based on a preset type conversion mode to obtain a second network request.
Optionally, the preset type is an IPv6 type, at least one of address types of the source address and the target address is not an IPv6 type, and the address conversion unit includes:
the address to be converted determining subunit is used for taking the source address and/or the target address with the address type not being the IPv6 type as the address to be converted;
the system comprises a binary conversion subunit, a binary conversion subunit and a binary conversion subunit, wherein the binary conversion subunit is used for performing hexadecimal conversion on the address to be converted to obtain a converted address, and the converted address comprises four groups;
a merging subunit, configured to merge the first group and the second group of the translated address, as an updated first group, merge the third group and the fourth group of the translated address to obtain an updated second group, and sequentially combine the updated first group and the updated second group to obtain an updated translated address;
and the address completion subunit is used for carrying out zero padding processing on 96 bits before the updated conversion address to obtain the source address of the preset type and/or the target address of the preset type, and generating the second network request based on the source address of the preset type and/or the target address of the preset type and the first network request.
Optionally, the request scheduling module includes:
the hash calculation unit is used for carrying out hash calculation on each URL in the second network request to obtain a hash result;
and the candidate server determining unit is used for acquiring a preset hash mapping table, determining the node server corresponding to each URL based on the hash result and the preset mapping relation table, and taking the node server corresponding to each URL as the candidate server.
Optionally, the performance monitoring module includes:
the heartbeat detection unit is used for sending heartbeat packet detection instructions to each candidate server based on cluster communication;
and the 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.
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 first network request sent by the client through the external network is received, address conversion is carried out on the first network request to obtain the second network request, hash scheduling is carried out on the URL in the second network request to obtain the node server corresponding to each request in the second network request, the node server is used as a candidate server, availability detection is carried out on each candidate server, the target server is determined based on the obtained detection result, each target server is adopted to respond to each request in the second network request, accuracy of data access load balancing is improved, and data access efficiency 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, fig. 1 is a schematic view of an application environment for processing a data access request according to the present embodiment.
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 first network request sent by the client through the external network.
Wherein the first network request comprises at least two access requests.
S202: and performing address conversion on the first network request to obtain a second network request.
Specifically, an address of an access request in the first network request is converted, and a second network request is generated according to the converted address.
In a specific optional embodiment, in step S202, performing address translation on the first network request to obtain the second network request includes:
acquiring a source address and a target address corresponding to a first network request;
identifying address types of a source address and a target address;
and converting the source address of the preset type and the target address of the preset type based on a preset type conversion mode to obtain a second network request.
Wherein the address types include, but are not limited to, IPv4 types and IPv6 types.
Preferably, the preset type is an IPv6 type.
In a specific optional embodiment, in step S202, the preset type is an IPv6 type, at least one address type of the source address and the destination address that is not the IPv6 type exists, and based on a preset type conversion mode, converting the address type into the source address of the preset type and the destination address of the preset type, and obtaining the second network request further includes:
taking a source address and/or a target address with an address type which is not the IPv6 type as an address to be converted;
hexadecimal conversion is carried out on the address to be converted to obtain a converted address, wherein the converted address comprises four groups;
combining the first group and the second group of the converted addresses to obtain an updated second group, and sequentially combining the updated first group and the updated second group to obtain an updated converted address;
zero padding is carried out on 96 bits before the updated converted address, a source address of a preset type and/or a target address of a preset type are obtained, and a second network request is generated based on the source address of the preset type and/or the target address of the preset type and the first network request.
In a specific example, the address type of a target address is IPv4 type, specifically 135.75.43.52, hexadecimal conversion is performed on the target address to obtain a converted address 87.4b.2b.34, and the obtained converted address 87.4b.2b.34 is one group or 8 bits, so two groups are needed to be combined, the first group and the second group of the converted address are combined to obtain 874B, the third group and the fourth group of the converted address are combined to obtain 2B34, and the updated converted address 874b.2b34 is sequentially combined, and then the first 96 bits zero padding processing is performed to obtain 0000:0000:0000:0000:0000:0000:874b:2b34 or: 874b:2b34.
S203: and carrying out hash scheduling on the URL in the second network request to obtain a node server corresponding to each request in the second network request as a candidate server.
In this embodiment, the corresponding server is found through the hash result, and because the hash result for a single URL is the same, theoretically, the URL will be permanently allocated to a fixed node server, and further because the hash calculation is performed, the URL allocation is very uniform, and the access amount can be balanced.
In a specific optional embodiment, in step S203, hash scheduling is performed on URLs in the second network request to obtain node servers corresponding to each request in the second network request, where the node servers as candidate servers include:
carrying out hash calculation on each URL in the second network request to obtain a hash result;
and acquiring a preset hash mapping table, determining a node server corresponding to each URL based on the hash result and the preset mapping relation table, and taking the node server corresponding to each URL as a candidate server.
The hash mapping table is a structure for storing data in a key-value (key-index), and the corresponding value can be found by inputting the value to be found, i.e. the key.
S204: and detecting the availability of each candidate server, and determining the target server based on the obtained detection result.
The availability detection is to monitor the performance state of the candidate server and judge whether the candidate server can be used normally.
In a specific optional embodiment, in step S204, 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.
In this embodiment, the state of each candidate server is rapidly determined by using a heartbeat detection method, and an effective candidate server is screened out and used as a target server, so as to ensure the availability of the target server.
S205: each of the second network requests is responded to with each of the target servers.
In this embodiment, by receiving a first network request sent by a client through an external network, performing address conversion on the first network request to obtain a second network request, performing hash scheduling on URLs in the second network request to obtain node servers corresponding to each request in the second network request, and performing availability detection on each candidate server as a candidate server, and determining a target server based on the obtained detection result, and adopting each target server to respond to each request in the second network request, thereby improving the accuracy of data access load balancing and being beneficial to improving the efficiency of data access.
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 device for data access includes a request receiving module 31, an address translating module 32, a request scheduling module 33, a performance monitoring module 34, and a request responding module 35. The functional modules are described in detail as follows:
a request receiving module 31, configured to receive a first network request sent by a client through an external network;
an address translation module 32, configured to perform address translation on the first network request to obtain a second network request;
the request scheduling module 33 is configured to perform hash scheduling on URLs in the second network request, so as to obtain node servers corresponding to each request in the second network request, as candidate servers;
a performance monitoring module 34, configured to perform availability detection on each candidate server, and determine a target server based on the obtained detection result;
a request response module 35, configured to respond to each request in the second network request with each target server.
Optionally, the address translation module 32 includes:
the address acquisition unit is used for acquiring a source address and a target address corresponding to the first network request;
a type identifying unit for identifying address types of the source address and the target address;
the address conversion unit is used for converting the source address of the preset type and the target address of the preset type based on a preset type conversion mode to obtain a second network request.
Optionally, the preset type is an IPv6 type, at least one of address types of the source address and the target address is not an IPv6 type, and the address conversion unit includes:
the address to be converted determining subunit is used for taking a source address and/or a target address with an address type which is not an IPv6 type as the address to be converted;
the system comprises a binary conversion subunit, a binary conversion subunit and a binary conversion subunit, wherein the binary conversion subunit is used for performing hexadecimal conversion on an address to be converted to obtain a converted address, and the converted address comprises four groups;
a merging subunit, configured to merge the first group and the second group of the converted addresses, as an updated first group, merge the third group and the fourth group of the converted addresses to obtain an updated second group, and sequentially combine the updated first group and the updated second group to obtain an updated converted address;
the address completion subunit is configured to perform zero padding processing on 96 bits before the updated converted address to obtain a source address of a preset type and/or a target address of a preset type, and generate a second network request based on the source address of the preset type and/or the target address of the preset type and the first network request.
Optionally, the request scheduling module 33 includes:
the hash calculation unit is used for carrying out hash calculation on each URL in the second network request to obtain a hash result;
the candidate server determining unit is used for obtaining a preset hash mapping table, determining the node server corresponding to each URL based on the hash result and the preset mapping relation table, and taking the node server corresponding to each URL as a candidate server.
Optionally, the performance monitoring module 34 includes:
the heartbeat detection unit is used for sending heartbeat packet detection instructions to each candidate server based on cluster communication;
and the 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.
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 (5)

1. The load balancing method for data access is applied to a cluster server and is characterized by comprising the following steps:
receiving a first network request sent by a client through an external network;
address conversion is carried out on the first network request to obtain a second network request, wherein a source address and a target address corresponding to the first network request are obtained; identifying an address type of the source address and the destination address; converting the source address of the preset type and the target address of the preset type based on a preset type conversion mode to obtain the second network request;
the preset type is an IPv6 type, at least one of the address types of the source address and the target address is not an IPv6 type, the converting into the source address of the preset type and the target address of the preset type based on the preset type conversion mode, and the obtaining the second network request includes:
taking the source address and/or the target address with the address type not being the IPv6 type as an address to be converted;
hexadecimal conversion is carried out on the address to be converted to obtain a converted address, wherein the converted address comprises four groups;
combining the first group and the second group of the converted addresses to obtain an updated second group, and sequentially combining the updated first group and the updated second group to obtain an updated converted address;
zero padding is carried out on the 96 bits before the updated conversion address to obtain the source address of the preset type and/or the target address of the preset type, and the second network request is generated based on the source address of the preset type and/or the target address of the preset type and the first network request;
carrying out hash scheduling on the URL in the second network request to obtain a node server corresponding to each request in the second network request as a candidate server;
carrying out hash calculation on each URL in the second network request to obtain a hash result;
acquiring a preset hash mapping table, determining a node server corresponding to each URL based on the hash result and the preset mapping relation table, and taking the node server corresponding to each URL as the candidate server;
detecting the availability of each candidate server, and determining a target server based on the obtained detection result;
and responding to each request in the second network request by adopting each target server.
2. The method of load balancing data access of claim 1, 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.
3. A load balancing device for data access, the load balancing device for data access comprising:
the request receiving module is used for receiving a first network request sent by the client through the external network;
the address conversion module is used for carrying out address conversion on the first network request to obtain a second network request;
the request scheduling module is used for carrying out hash scheduling on the URLs in the second network request to obtain a node server corresponding to each request in the second network request as a candidate server, wherein each URL in the second network request is subjected to hash calculation to obtain a hash result; acquiring a preset hash mapping table, determining a node server corresponding to each URL based on the hash result and the preset mapping relation table, and taking the node server corresponding to each URL as the candidate server;
the performance monitoring module is used for detecting the availability of each candidate server and determining a target server based on the obtained detection result;
a request response module, configured to respond to each request in the second network request by adopting each target server;
the address translation module comprises:
the address acquisition unit is used for acquiring a source address and a target address corresponding to the first network request;
a type identifying unit for identifying address types of the source address and the target address;
the address conversion unit is used for converting the source address of the preset type and the target address of the preset type based on a preset type conversion mode to obtain a second network request;
the preset type is an IPv6 type, at least one of the address types of the source address and the target address is not an IPv6 type, and the address conversion unit includes:
the address to be converted determining subunit is used for taking the source address and/or the target address with the address type not being the IPv6 type as the address to be converted;
the system comprises a binary conversion subunit, a binary conversion subunit and a binary conversion subunit, wherein the binary conversion subunit is used for performing hexadecimal conversion on the address to be converted to obtain a converted address, and the converted address comprises four groups;
a merging subunit, configured to merge the first group and the second group of the translated address, as an updated first group, merge the third group and the fourth group of the translated address to obtain an updated second group, and sequentially combine the updated first group and the updated second group to obtain an updated translated address;
and the address completion subunit is used for carrying out zero padding processing on 96 bits before the updated conversion address to obtain the source address of the preset type and/or the target address of the preset type, and generating the second network request based on the source address of the preset type and/or the target address of the preset type and the first network request.
4. 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 the load balancing method of data access according to any of claims 1 to 2 when executing the computer program.
5. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the load balancing method of data access according to any one of claims 1 to 2.
CN202111063653.0A 2021-09-10 2021-09-10 Load balancing method and device for data access, computer equipment and medium Active CN113890879B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111063653.0A CN113890879B (en) 2021-09-10 2021-09-10 Load balancing method and device for data access, computer equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111063653.0A CN113890879B (en) 2021-09-10 2021-09-10 Load balancing method and device for data access, computer equipment and medium

Publications (2)

Publication Number Publication Date
CN113890879A CN113890879A (en) 2022-01-04
CN113890879B true CN113890879B (en) 2023-12-29

Family

ID=79008800

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111063653.0A Active CN113890879B (en) 2021-09-10 2021-09-10 Load balancing method and device for data access, computer equipment and medium

Country Status (1)

Country Link
CN (1) CN113890879B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114827163A (en) * 2022-05-07 2022-07-29 金腾科技信息(深圳)有限公司 Server load balancing processing method, device, equipment and storage medium
CN116820787B (en) * 2023-08-31 2023-12-15 湖北芯擎科技有限公司 Load balancing method, load balancing device, electronic equipment and computer readable storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006301769A (en) * 2005-04-18 2006-11-02 Hitachi Information Technology Co Ltd Server device
CN103023797A (en) * 2011-09-23 2013-04-03 百度在线网络技术(北京)有限公司 Data center system and device and method for providing service
CN103428229A (en) * 2012-05-14 2013-12-04 百度在线网络技术(北京)有限公司 Data center system and device and method for providing service
CN109218219A (en) * 2018-10-15 2019-01-15 迈普通信技术股份有限公司 A kind of load-balancing method, device, the network equipment and storage medium
CN109936635A (en) * 2019-03-12 2019-06-25 北京百度网讯科技有限公司 Load-balancing method and device
CN112866433A (en) * 2021-01-22 2021-05-28 京东数字科技控股股份有限公司 Message load balancing processing method and device and computer equipment
CN113242331A (en) * 2021-05-11 2021-08-10 鸬鹚科技(深圳)有限公司 Different types of address translation methods, different types of address translation devices, different types of computer equipment and different types of storage media
CN113259428A (en) * 2021-05-11 2021-08-13 鸬鹚科技(深圳)有限公司 Data access request processing method and device, computer equipment and medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9350668B2 (en) * 2014-06-03 2016-05-24 The Viki Group, Inc. Systems and methods for IP sharing across wide area networks

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006301769A (en) * 2005-04-18 2006-11-02 Hitachi Information Technology Co Ltd Server device
CN103023797A (en) * 2011-09-23 2013-04-03 百度在线网络技术(北京)有限公司 Data center system and device and method for providing service
CN103428229A (en) * 2012-05-14 2013-12-04 百度在线网络技术(北京)有限公司 Data center system and device and method for providing service
CN109218219A (en) * 2018-10-15 2019-01-15 迈普通信技术股份有限公司 A kind of load-balancing method, device, the network equipment and storage medium
CN109936635A (en) * 2019-03-12 2019-06-25 北京百度网讯科技有限公司 Load-balancing method and device
CN112866433A (en) * 2021-01-22 2021-05-28 京东数字科技控股股份有限公司 Message load balancing processing method and device and computer equipment
CN113242331A (en) * 2021-05-11 2021-08-10 鸬鹚科技(深圳)有限公司 Different types of address translation methods, different types of address translation devices, different types of computer equipment and different types of storage media
CN113259428A (en) * 2021-05-11 2021-08-13 鸬鹚科技(深圳)有限公司 Data access request processing method and device, computer equipment and medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
IPv4和IPv6双域互通初探;王靓宇;《中国新闻技术工作者联合会2020年学术年会论文集》;全文 *
Load balancing mechanism for proxy mobile IPV6 networks: An IP multicast perspective;Tien-Thinh Nguyen et al.;《2014 International Conference on Computing, Networking and Communications(iCNC)》;全文 *
NAT-PT簇负载均衡系统的研究与实现;肖辽亮;《硕士学位论文》;全文 *

Also Published As

Publication number Publication date
CN113890879A (en) 2022-01-04

Similar Documents

Publication Publication Date Title
CN113890879B (en) Load balancing method and device for data access, computer equipment and medium
US11509505B2 (en) Method and apparatus for operating smart network interface card
CN113259428A (en) Data access request processing method and device, computer equipment and medium
CN115277566B (en) Load balancing method and device for data access, computer equipment and medium
CN114095567B (en) Data access request processing method and device, computer equipment and medium
CN109634802B (en) Process monitoring method and terminal equipment
CN111200649B (en) Scheduling method and device and scheduling model generation method and device
CN113242331A (en) Different types of address translation methods, different types of address translation devices, different types of computer equipment and different types of storage media
CN105955838A (en) System halt reason check method and device
CN102891851A (en) Access control method, equipment and system of virtual desktop
CN114827161A (en) Service calling request sending method and device, electronic equipment and readable storage medium
US10191844B2 (en) Automatic garbage collection thrashing monitoring
CN114124883B (en) Data access method and device based on cloud storage address, computer equipment and medium
CN111885184A (en) Method and device for processing hot spot access keywords in high concurrency scene
CN103095786B (en) Online service request recognition methods, system, server and line server cluster
CN115604144A (en) Test method and device, electronic equipment and storage medium
CN113239396A (en) Data access system, method, device, computer equipment and medium
CN111176782B (en) Online experiment method and device
CN113242299A (en) Disaster recovery system, method, computer device and medium for multiple data centers
CN113242302A (en) Data access request processing method and device, computer equipment and medium
CN112214497A (en) Label processing method and device and computer system
CN115242658B (en) Open system access method, device, computer equipment and storage medium
CN103916411A (en) Processing method and device for request timeout of hypertext transfer protocol
CN115277506B (en) Load balancing equipment testing method and system
CN115396376A (en) Load balancing method, device, 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