CN110875942B - Method and device for balancing load of hot spot program - Google Patents

Method and device for balancing load of hot spot program Download PDF

Info

Publication number
CN110875942B
CN110875942B CN201811018615.1A CN201811018615A CN110875942B CN 110875942 B CN110875942 B CN 110875942B CN 201811018615 A CN201811018615 A CN 201811018615A CN 110875942 B CN110875942 B CN 110875942B
Authority
CN
China
Prior art keywords
program
hot
hot spot
alias
identification
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
CN201811018615.1A
Other languages
Chinese (zh)
Other versions
CN110875942A (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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology 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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201811018615.1A priority Critical patent/CN110875942B/en
Publication of CN110875942A publication Critical patent/CN110875942A/en
Application granted granted Critical
Publication of CN110875942B publication Critical patent/CN110875942B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • H04L67/1023Server selection for load balancing based on a hash applied to IP addresses or costs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • H04L67/5682Policies or rules for updating, deleting or replacing the stored data
    • 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
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a method and a device for balancing hot spot program load, and relates to the technical field of computers. One embodiment of the method comprises: identifying a hot spot program in a timing period, and acquiring a program identifier of the hot spot program; calculating the section target identification name of the hot program according to the program identification of the hot program; and performing consistent hash calculation on the program identification alias, and positioning a corresponding cache server. The implementation method can solve the problem of unbalanced system load caused by the hot spot program.

Description

Method and device for balancing load of hot spot program
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for balancing hot spot program load.
Background
Currently, a general implementation method of a load balancing technology used when storing and querying an existing p2p node (a p2p peer-to-peer network, i.e. a peer-to-peer computer network, is a distributed application architecture for distributing tasks and workloads among peers, and is a networking or network form formed by a peer-to-peer computing model) is as follows:
and determining a corresponding cache server by taking the program ID as a Key through consistent hash calculation, and then executing storage or query operation. Among them, consistent hashing has been designed with the goal of solving the Hot spot (Hot spot) problem in the internet.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
for example, if a program is being broadcast hot, the cache servers determined by the program ID will be concentrated on one server, which causes a very high pressure on the back-end cache server mapped by the broadcast hot program, while the back-end cache server mapped by the non-broadcast hot program has a relatively low pressure, which causes an unbalanced load.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for load balancing of hot spots, which can solve the problem of unbalanced system load caused by hot spots.
In order to achieve the above object, according to an aspect of the embodiments of the present invention, a method for load balancing of a hot spot program is provided, including identifying a hot spot program in a timing cycle, and obtaining a program identifier of the hot spot program; calculating the section target identification name of the hot program according to the program identification of the hot program; and performing consistent hash calculation on the program identification alias, and positioning a corresponding cache server.
Optionally, identifying the hot spot program in the timing period includes:
setting a load balancing hash table with the ID of the cache server as a key and the access times as value in a timing cycle;
monitoring that the difference value between the load of one cache server and the load of the other cache server in the load balancing hash table exceeds a preset load threshold value;
and recording the program identification accessed by the cache server in a timing period to determine the hot spot program.
Optionally, calculating a section object identification name of the hot spot program according to the program identifier of the hot spot program, including:
acquiring a program identifier determined as a hot program and storing the program identifier into a hot program map;
extracting the program identification in the hot spot program map, and calculating the alias of the program identification by adding a random prefix or suffix.
Optionally, before performing the consistent hash calculation on the program identification alias, the method includes:
positioning the address of the alias array of the hot spot program in the hot spot program map according to the program identification;
storing the program identification alias in a hotspot program alias array;
and randomly generating an index value to extract the identification name of the corresponding program target according to the sequence number in the alias array of the hot spot program corresponding to the index value.
In addition, according to an aspect of the embodiments of the present invention, a device for load balancing of hot spot programs is provided, including an identification module, configured to identify a hot spot program in a timing cycle, and obtain a program identifier of the hot spot program; the calculation module is used for calculating the section target identification name of the hot program according to the program identification of the hot program; and the positioning module is used for executing consistent Hash calculation on the program identification alias and positioning the corresponding cache server.
Optionally, the identifying, by the location module, a hot spot program in a timing period includes:
setting a load balancing hash table with the ID of the cache server as key and the access times as value in a timing period;
monitoring that the difference value between the load of one cache server and the load of the other cache server in the load balancing hash table exceeds a preset load threshold value;
and recording the program identification accessed by the cache server in a timing period to determine the hot spot program.
Optionally, the calculating module calculates the section object identification name of the hot program according to the program identifier of the hot program, including:
acquiring a program identifier determined as a hot program and storing the program identifier into a hot program map;
extracting the program identification in the hot spot program map, and calculating the alias of the program identification by adding a random prefix or suffix.
Optionally, before the locating module performs the consistent hash calculation on the program identification alias, the locating module includes:
according to the program identification, positioning the address of the alias array of the hot spot program in the hot spot program map;
storing the program identification alias in a hotspot program alias array;
and randomly generating an index value to extract the identification name of the corresponding program target according to the sequence number in the alias array of the hot spot program corresponding to the index value.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any of the embodiments of hotspot program load balancing described above.
According to another aspect of the embodiments of the present invention, there is also provided a computer readable medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method according to any of the embodiments of hotspot-based program load balancing.
One embodiment of the above invention has the following advantages or benefits: the method comprises the steps of identifying hot programs in a timing period to obtain program identifications of the hot programs; calculating the section target identification name of the hot program according to the program identification of the hot program; and performing consistent hash calculation on the program identification alias, and positioning a corresponding cache server. Therefore, the invention can greatly improve the whole load capacity of the p2p system, and particularly realize the load balance of storage and query of the hot spot programs.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
fig. 1 is a schematic diagram of a main flow of a method for load balancing hot spot programs according to an embodiment of the present invention;
fig. 2 is a schematic diagram illustrating a main flow of a method for load balancing hot spot programs according to a referential embodiment of the present invention;
fig. 3 is a schematic diagram of main modules of an apparatus for load balancing hot spots according to an embodiment of the present invention;
FIG. 4 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 5 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a main flow of a method for load balancing hot spot programs according to an embodiment of the present invention, where the method for load balancing hot spot programs may include:
step S101, identifying a hot spot program in a timing cycle, and acquiring a program identifier of the hot spot program.
Preferably, when the hot program is identified in the timing cycle, a load balancing hash table with the cache server ID as key and the access times as value in the timing cycle may be set, the difference between the load of one cache server and the load of another cache server in the load balancing hash table is monitored to exceed the preset load threshold, and the program identifier accessed by the cache server is recorded in the timing cycle, so as to determine the hot program.
Further, the access times of the program may be acquired within a preset timing period, and it is determined that the access times are greater than or equal to a set access time threshold, then the program is a hot spot program.
Step S102, calculating the section target identification name of the hot program according to the program identification of the hot program. The specific implementation process comprises the following steps:
firstly, acquiring and determining a program identifier of a hot program and storing the program identifier into a hot program map. The hot spot program maps store the related information of the hot spot programs and store the related information in a map data structure, and each map can have a plurality of hot spot program information. It should be noted that it can be assumed that each program information requires 64 bytes of description on average, and a million level hot spot (1024 × 1024) occupies less than 100M of memory.
And then extracting the program identification in the hot spot program map, and calculating the alias of the program identification by adding a random prefix or suffix.
Step S103, executing consistent hash calculation to the program identification alias, and positioning the corresponding cache server.
Preferably, before performing the consistent hash calculation on the program identification alias, the address of the hot program alias array may be located in the hot program map according to the program identification, the program identification alias is stored in the hot program alias array, and then an index value is randomly generated, so as to extract the corresponding program target identification name according to the sequence number in the hot program alias array corresponding to the index value.
Fig. 2 is a schematic diagram of a main flow of a method for load balancing hot spot programs according to a referential embodiment of the present invention, where the method for load balancing hot spot programs may include:
step S201, a load balancing hash table with the cache server ID as key and the number of access times as value in a timing cycle is set.
Step S202, it is monitored that a difference between a load of one cache server and a load of another cache server in the load balancing hash table exceeds a preset load threshold.
Step S203, start the timer, and record the program ID (identification) accessed by the cache server in the timing cycle.
Step S204, the access times corresponding to the program ID in the timing cycle are calculated.
In step S205, the program ID with the access frequency greater than or equal to the set access frequency threshold is determined as the hot program.
Step S206, acquiring the program ID determined as the hot program and storing the program ID into a hot program map.
Step S207, extracting the program ID in the hot spot program map to calculate the alias of the program ID.
In an embodiment, the alias of the program ID is calculated to change the key of the hash operation, and different keys can be mapped to different cache servers, so as to map one piece of hot program information to different cache servers.
Preferably, the program ID alias is calculated by adding a random prefix or suffix. For example: abcdefg, prefix: 123abcdefg, suffix: abcdefg567.
Preferably, the program ID alias may be generated by a hot spot program alias generator.
Step S208, according to the program ID, the address of the alias array of the hot spot program is located in the hot spot program map, and the alias of the program ID is stored in the alias array of the hot spot program.
In an embodiment, the alias array address of the hot spot program may be recorded in corresponding hot spot program information (the hot spot program information may include program ID and other related information) in the hot spot program map, where the alias array address of the hot spot program is a memory address where the array is located. Specifically, the alias array of the hot spot program may be located by a key (program ID) of the hot spot program map, that is, a program alias array address corresponding to the hot spot program may be obtained. In addition, the hot spot program map can be implemented by using a related map data structure in the c + + standard library.
Further, the alias sequence of the program ID is stored in the alias array of the hotspot program, so that the corresponding relation between the program ID and the alias of the program ID can be ensured, and a correct cache server can be found when program information is searched through the alias of the program ID.
In step S209, an index value is randomly generated to extract the alias of the corresponding program ID according to the sequence number corresponding to the index value.
In an embodiment, the index value may be calculated in a hotspot program alias array index generator. Preferably, a random number may be generated as an index value according to the number of program ID aliases already stored in the hot program alias array. For example: the hot spot program alias array may be stored in 256 elements, i.e., 256 program ID aliases, and a random number in 256 is calculated as an index value.
Further, the index value generated by the random number is necessarily corresponding to the same sequence number, and the alias of the corresponding program ID can be extracted according to the sequence number.
Step S210, performing consistent hash calculation on the extracted program ID alias, and locating a new corresponding cache server.
As another embodiment that can be referred to in the present invention, for a hot spot program map, if the hot spot program map is not empty, the access times of each hot spot program stored in the hot spot program map may also be monitored in a preset timing period. If the access times of the hot spot program are greater than or equal to the set access times threshold, the hot spot program may not be processed. And if the access times of the hot spot program are less than the set access time threshold, removing the hot spot program from the hot spot program map. Therefore, in this embodiment, the hot spot program map can be regularly sorted, so as to optimize the hot spot program information stored by the hot spot program map.
In a specific embodiment, the access rate may be calculated for each hotspot program stored in the hotspot program map within a preset timing period, and if the access rate of the hotspot program is greater than or equal to a set access rate threshold, the hotspot program may not be processed. And if the access rate of the hot spot program is less than the set access rate threshold, removing the hot spot program from the hot spot program map.
Fig. 3 is a device for load balancing hot spot programs according to an embodiment of the present invention, as shown in fig. 3, the device for load balancing hot spot programs includes an identification module 301, a calculation module 302, and a location module 303. The identification module 301 identifies a hot spot program in a timing period, and obtains a program identifier of the hot spot program. The calculating module 302 calculates the section object identification name of the hot spot program according to the program identifier of the hot spot program. The positioning module 303 performs consistent hash calculation on the program identifier alias, and positions a corresponding cache server.
For one embodiment, the locating module 301 may identify the hot spot program in a timing period by the following process:
firstly, a load balancing hash table with the ID of the cache server as key and the access times as value in a timing cycle is set. Then, the load balancing hash table may be monitored, and when it is monitored that a difference value between a load of one cache server and a load of another cache server in the load balancing hash table exceeds a preset load threshold, a program identifier accessed by the cache server is recorded in a timing cycle to determine a hot spot program.
In addition, it should be further noted that, when the calculating module 302 calculates the program target identification name of the hot program according to the program identifier of the hot program, the calculating module specifically includes:
and acquiring and storing the program identifier determined as the hot program into a hot program map, and extracting the program identifier in the hot program map to calculate the alias of the program identifier. Wherein, the program identification alias is calculated by adding a random prefix or suffix.
In another embodiment, before the locating module 303 performs the consistent hash calculation on the program identification alias, the program identification alias may be stored in the hot program alias array according to an address of the program identification in the hot program map where the hot program alias array is located. Then, an index value is randomly generated, and the corresponding section object identification name is extracted according to the sequence number corresponding to the index value.
It should be noted that, in the implementation contents of the apparatus for load balancing hot spots in the present invention, the details of the method for load balancing hot spots have been described above, and therefore, the repeated contents are not described herein.
Fig. 4 shows an exemplary system architecture 400 of a hotspot program load balancing method or a hotspot program load balancing device to which an embodiment of the present invention may be applied.
As shown in fig. 4, the system architecture 400 may include terminal devices 401, 402, 403, a network 404, and a server 405. The network 404 serves as a medium for providing communication links between the terminal devices 401, 402, 403 and the server 405. Network 404 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use terminal devices 401, 402, 403 to interact with a server 405 over a network 404 to receive or send messages or the like. The terminal devices 401, 402, 403 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 401, 402, 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 405 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 401, 402, 403. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the method for load balancing hot spot programs provided in the embodiment of the present invention is generally executed by the server 405, and accordingly, the device for load balancing hot spot programs is generally disposed in the server 405.
It should be understood that the number of terminal devices, networks, and servers in fig. 4 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 5, shown is a block diagram of a computer system 500 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the use range of the embodiment of the present invention.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU) 501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM503, various programs and data necessary for the operation of the system 500 are also stored. The CPU501, ROM 502, and RAM503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 501.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes an identification module, a calculation module, and a location module. Wherein the names of the modules do not in some cases constitute a limitation of the module itself.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: identifying a hot spot program in a timing period, and acquiring a program identifier of the hot spot program; calculating a section target identification name of the hot program according to the program identifier of the hot program; and performing consistent hash calculation on the program identification alias, and positioning a corresponding cache server.
According to the technical scheme of the embodiment of the invention, the problem of unbalanced system load caused by the hot spot program can be solved.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for load balancing hot spot programs is characterized by comprising the following steps:
monitoring a load balancing hash table with a cache server ID as key and access times as value in a timing period, determining a cache server exceeding a load threshold, identifying a hot program executed in the cache server, and acquiring a program identifier of the hot program;
calculating a section target identification name of the hot program according to the program identifier of the hot program;
and performing consistent hash calculation on the program identification alias, and positioning a corresponding new cache server.
2. The method of claim 1, wherein identifying hot spots during a timing period comprises:
setting a load balancing hash table with the ID of the cache server as key and the access times as value in a timing period;
monitoring that the difference value between the load of one cache server and the load of the other cache server in the load balancing hash table exceeds a preset load threshold value;
and recording the program identification accessed by the cache server in a timing period to determine the hot spot program.
3. The method of claim 1, wherein calculating the program target identification name of the hot program according to the program identifier of the hot program comprises:
acquiring a program identifier determined as a hot program and storing the program identifier into a hot program map;
extracting program identifiers in the hot spot program map, and calculating the alias names of the program identifiers by adding random prefixes or postfixes.
4. The method of claim 3, wherein prior to performing the consistent hash computation on the program identification alias, comprising:
positioning the address of the alias array of the hot spot program in the hot spot program map according to the program identification;
storing the program identification alias in a hotspot program alias array;
and randomly generating an index value to extract the identification name of the corresponding program target according to the sequence number in the alias array of the hot spot program corresponding to the index value.
5. An apparatus for load balancing hot spot programs, comprising:
the identification module is used for monitoring a load balancing hash table with a cache server ID as key and access times as value in a timing period, determining the cache server exceeding a load threshold, identifying the hot spot program executed in the cache server and acquiring the program identifier of the hot spot program;
the calculation module is used for calculating the section target identification name of the hot program according to the program identification of the hot program;
and the positioning module is used for executing consistent Hash calculation on the program identification alias and positioning the corresponding new cache server.
6. The apparatus of claim 5, wherein the locating module identifies a hot spot program within a timing cycle, comprising:
setting a load balancing hash table with the ID of the cache server as key and the access times as value in a timing period;
monitoring that the difference value between the load of one cache server and the load of the other cache server in the load balancing hash table exceeds a preset load threshold value;
and recording the program identification accessed by the cache server in a timing period to determine the hot spot program.
7. The apparatus of claim 5, wherein the calculating module calculates the section object identification name of the hot program according to the program identifier of the hot program, and comprises:
acquiring a program identifier determined as a hot program and storing the program identifier into a hot program map;
extracting the program identification in the hot spot program map, and calculating the alias of the program identification by adding a random prefix or suffix.
8. The apparatus of claim 5, wherein the locating module, prior to performing the consistent hash on the program identification alias, comprises:
according to the program identification, positioning the address of the alias array of the hot spot program in the hot spot program map;
storing the program identification alias in a hotspot program alias array;
and randomly generating an index value to extract the identification name of the corresponding program target according to the sequence number in the alias array of the hot spot program corresponding to the index value.
9. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-4.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-4.
CN201811018615.1A 2018-09-03 2018-09-03 Method and device for balancing load of hot spot program Active CN110875942B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811018615.1A CN110875942B (en) 2018-09-03 2018-09-03 Method and device for balancing load of hot spot program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811018615.1A CN110875942B (en) 2018-09-03 2018-09-03 Method and device for balancing load of hot spot program

Publications (2)

Publication Number Publication Date
CN110875942A CN110875942A (en) 2020-03-10
CN110875942B true CN110875942B (en) 2023-03-07

Family

ID=69716527

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811018615.1A Active CN110875942B (en) 2018-09-03 2018-09-03 Method and device for balancing load of hot spot program

Country Status (1)

Country Link
CN (1) CN110875942B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101094244A (en) * 2007-07-06 2007-12-26 中国人民解放军国防科学技术大学 Method of high performance distributed Hash table in P2P system
CN101753610A (en) * 2008-12-19 2010-06-23 华为技术有限公司 Distributed network structure method, device, system and task processing method
CN102164309A (en) * 2011-03-21 2011-08-24 华为技术有限公司 Program processing method, system and device
CN104580393A (en) * 2014-12-18 2015-04-29 北京蓝汛通信技术有限责任公司 Method and device for expanding server cluster system and server cluster system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8255644B2 (en) * 2009-05-18 2012-08-28 Lsi Corporation Network communications processor architecture with memory load balancing

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101094244A (en) * 2007-07-06 2007-12-26 中国人民解放军国防科学技术大学 Method of high performance distributed Hash table in P2P system
CN101753610A (en) * 2008-12-19 2010-06-23 华为技术有限公司 Distributed network structure method, device, system and task processing method
CN102164309A (en) * 2011-03-21 2011-08-24 华为技术有限公司 Program processing method, system and device
CN104580393A (en) * 2014-12-18 2015-04-29 北京蓝汛通信技术有限责任公司 Method and device for expanding server cluster system and server cluster system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
RS系统中媒体内容调度策略研究;刘桂云等;《通信技术》;20080810(第08期);第181-183页 *

Also Published As

Publication number Publication date
CN110875942A (en) 2020-03-10

Similar Documents

Publication Publication Date Title
CN110019125B (en) Database management method and device
CN107704202B (en) Method and device for quickly reading and writing data
CN107480205B (en) Method and device for partitioning data
CN107729570B (en) Data migration method and device for server
EP3803625A1 (en) Frequent pattern analysis for distributed systems
CN109753424B (en) AB test method and device
CN110049358B (en) Television-based article pushing method and system
CN113312355A (en) Data management method and device
CN113312553A (en) Method and device for determining user label
CN113760982A (en) Data processing method and device
CN109144991B (en) Method and device for dynamic sub-metering, electronic equipment and computer-storable medium
CN110875942B (en) Method and device for balancing load of hot spot program
CN113761565A (en) Data desensitization method and apparatus
CN115423030A (en) Equipment identification method and device
CN110795419A (en) Method and device for dynamic database-based routing
JP6233846B2 (en) Variable-length nonce generation
CN111190858B (en) Method, device, equipment and storage medium for storing software information
CN109308299B (en) Method and apparatus for searching information
CN110019671B (en) Method and system for processing real-time message
CN113722193A (en) Method and device for detecting page abnormity
CN112783914A (en) Statement optimization method and device
CN112131287A (en) Method and device for reading data
CN113360939B (en) Security access control method and device
CN110866002A (en) Method and device for processing sub-table data
CN110717826A (en) Asset filtering method and device

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