CN114172910B - Method, device, equipment and medium for dynamically allocating load based on memory management - Google Patents

Method, device, equipment and medium for dynamically allocating load based on memory management Download PDF

Info

Publication number
CN114172910B
CN114172910B CN202111441935.XA CN202111441935A CN114172910B CN 114172910 B CN114172910 B CN 114172910B CN 202111441935 A CN202111441935 A CN 202111441935A CN 114172910 B CN114172910 B CN 114172910B
Authority
CN
China
Prior art keywords
information
node
instance
service
cluster server
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
CN202111441935.XA
Other languages
Chinese (zh)
Other versions
CN114172910A (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.)
Ping An E Wallet Electronic Commerce Co Ltd
Original Assignee
Ping An E Wallet Electronic Commerce 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 Ping An E Wallet Electronic Commerce Co Ltd filed Critical Ping An E Wallet Electronic Commerce Co Ltd
Priority to CN202111441935.XA priority Critical patent/CN114172910B/en
Publication of CN114172910A publication Critical patent/CN114172910A/en
Application granted granted Critical
Publication of CN114172910B publication Critical patent/CN114172910B/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/1025Dynamic adaptation of the criteria on which the server selection is based
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • 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
    • 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/1029Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers using data related to the state of servers by a load balancer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a load dynamic allocation method, a device, equipment and a medium based on memory management, wherein the method comprises the following steps: obtaining service information from an information storage database of the cluster server, detecting the health state of node service information in the node information database to obtain state detection information, splitting and comparing the state detection information and the instance configuration information according to the service information to obtain difference comparison information corresponding to each process instance, if the difference comparison information of the process instance is different, carrying out differential updating on the node configuration information of the corresponding instance process according to the difference comparison information, and obtaining target processing nodes from the cluster server according to a matching rule so as to allocate the processing nodes for processing the request to be processed. The invention belongs to the technical field of load balancing, and can realize dynamic load balancing based on memory management, avoid influencing the continuity of service data processing, and improve the efficiency of load balancing allocation in response.

Description

Method, device, equipment and medium for dynamically allocating load based on memory management
Technical Field
The invention relates to the technical field of load allocation, belongs to an application scene of dynamically allocating loads in cluster servers in smart cities, and particularly relates to a load dynamic allocation method, device, equipment and medium based on memory management.
Background
In order to improve the processing efficiency of the cluster server, the enterprise can allocate the system resources of the cluster server by adopting load balancing, and the load balancing is a basic strategy for realizing high availability and transverse expansion and contraction of service capacity, however, in the traditional technical method, the load balancing implementation process needs to manually modify load service configuration by a user and restart an instance in the cluster server, so that the instance allocates the system resources and performs data processing based on the modified load service configuration, and in the process, the instance must be restarted and performed in a state that service data is suspended because the configuration information of memory load service cannot be dynamically changed, so that the continuity of service data processing is greatly influenced, and the efficiency of performing load balancing allocation is lower. Therefore, the problem of low allocation efficiency exists when load balancing allocation is carried out in the prior art method.
Disclosure of Invention
The embodiment of the invention provides a load dynamic allocation method, device, equipment and medium based on memory management, which aim to solve the problem of low allocation efficiency in load balancing allocation in the prior art.
In a first aspect, an embodiment of the present invention provides a method for dynamically allocating loads based on memory management, where the method is applied to an allocation terminal, and a network connection is established between the allocation terminal and a cluster server to implement transmission of data information, and the method includes:
Acquiring service information from an information storage database configured in the cluster server;
detecting the health state of node service information stored in a preset node information database to obtain corresponding state detection information;
splitting and comparing the state detection information and the instance configuration information of the cluster server according to the service information to obtain difference comparison information corresponding to each instance process configured in the cluster server;
if the difference comparison information of any instance process is different, carrying out differential updating on the node configuration information of the instance process according to the difference comparison information of the instance process to obtain an instance process with configuration updating completed;
if an input request to be processed is received, a target processing node matched with the request to be processed is obtained from the cluster server according to a preset matching rule;
and allocating the target processing node to process the request to be processed.
In a second aspect, an embodiment of the present invention provides a load dynamic allocation device based on memory management, which includes:
a service information obtaining unit, configured to obtain service information from an information storage database configured in the cluster server;
The state detection information acquisition unit is used for detecting the health state of the node service information stored in the preset node information database so as to obtain corresponding state detection information;
the difference comparison information acquisition unit is used for carrying out split comparison on the state detection information and the instance configuration information of the cluster server according to the service information so as to acquire difference comparison information corresponding to each instance process configured in the cluster server;
an instance process configuration updating unit, configured to, if the difference comparison information of any one of the instance processes is a difference, perform differential updating on node configuration information of the instance process according to the difference comparison information of the instance process, so as to obtain an instance process for completing configuration updating;
the target processing node acquisition unit is used for acquiring a target processing node matched with the to-be-processed request from the cluster server according to a preset matching rule if the input to-be-processed request is received;
and the allocation processing unit is used for allocating the target processing node to process the request to be processed.
In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor implements the load dynamic allocation method based on memory management according to the first aspect when executing the computer program.
In a fourth aspect, an embodiment of the present invention further provides a computer readable storage medium, where the computer readable storage medium stores a computer program, where the computer program when executed by a processor causes the processor to perform the load dynamic allocation method based on memory management according to the first aspect.
The embodiment of the invention provides a load dynamic allocation method, device, equipment and medium based on memory management. Obtaining service information from an information storage database of the cluster server, detecting the health state of node service information in the node information database to obtain state detection information, splitting and comparing the state detection information and the instance configuration information according to the service information to obtain difference comparison information corresponding to each process instance, if the difference comparison information of the process instance is different, carrying out differential updating on the node configuration information of the corresponding instance process according to the difference comparison information, and obtaining target processing nodes from the cluster server according to a matching rule so as to allocate the processing nodes for processing the request to be processed. By the method, the service information can be acquired from the information storage database, the node configuration information of each instance process is differentially updated after the service information is analyzed and processed, so that dynamic load balancing can be realized based on memory management, the influence on continuity of service data processing is avoided, and the efficiency of load balancing allocation is improved in reply.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a load dynamic allocation method based on memory management according to an embodiment of the present invention;
fig. 2 is a schematic application scenario diagram of a load dynamic allocation method based on memory management according to an embodiment of the present invention;
fig. 3 is a schematic sub-flowchart of a load dynamic allocation method based on memory management according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of another sub-flow of a dynamic load allocation method based on memory management according to an embodiment of the present invention;
FIG. 5 is another flow chart of a dynamic load allocation method based on memory management according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of another sub-flow of a dynamic load allocation method based on memory management according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of another sub-flow of a load dynamic allocation method based on memory management according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of another sub-flow of a dynamic load allocation method based on memory management according to an embodiment of the present invention;
FIG. 9 is a schematic block diagram of a load dynamic allocation device based on memory management according to an embodiment of the present invention;
fig. 10 is a schematic block diagram of a computer device according to an embodiment of the present invention.
Detailed Description
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.
It should be understood that the terms "comprises" and "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
Referring to fig. 1 and fig. 2, fig. 1 is a flow chart of a load dynamic allocation method based on memory management according to an embodiment of the invention; fig. 2 is a schematic application scenario diagram of a load dynamic allocation method based on memory management according to an embodiment of the present invention; the load dynamic allocation method based on the memory management is applied to the allocation terminal 10, and is executed through application software installed in the allocation terminal 10, and network connection is established between the allocation terminal 10 and the cluster server 20 to realize data information transmission; the deployment terminal 10 is a terminal device for executing a load dynamic deployment method based on memory management to dynamically deploy load to an instance process configured in the cluster server 20, where the cluster server 20 is a server configured in an enterprise or a government department and used for clustering service data. As shown in fig. 1, the method includes steps S110 to S160.
S110, obtaining service information from an information storage database configured in the cluster server.
And acquiring service information from an information storage database configured in the cluster server. The cluster server is preconfigured with an information storage database, the information storage database can be used for storing service information of the cluster server, namely, the service information comprises information recording service architecture information of a service group in the cluster server, and the service information stored in the information storage database can be periodically acquired from the information storage database according to the acquisition period. One or more service groups can be configured in the cluster server, each service group is composed of at least one instance process, each instance process comprises at least one node, and the service information comprises the information of each service group.
In one embodiment, as shown in FIG. 3, step S110 includes sub-steps S111 and S112.
S111, establishing transmission connection corresponding to the information storage database configured in the cluster server according to the pre-stored connection configuration information.
Specifically, the transmission connection can be established between the pre-stored connection configuration information and the information storage database, and the information storage database can be the configured Redis database, so that the transmission connection can be established between the pre-configured Redis connection information and the information storage database. In addition, if redis connection information is not configured, a transmission connection may be established using the content of a configuration file (e.g., a nginx. Conf file) configured in nginx as connection configuration information.
S112, periodically acquiring the service information stored in the information storage database from the transmission connection according to a preset acquisition period.
And periodically acquiring service information stored in the information storage database from the established transmission connection according to the acquisition period, wherein if the acquisition period can be 5 seconds, the service information stored in the storage data is acquired once every 5 seconds, and the service information comprises service group information and member instance information corresponding to each service group.
In addition, or in the process of periodically acquiring service information from the information storage database, if the established transmission connection is abnormal, the transmission connection can be retried every 10s, and the retrying process is written into the error reporting log for recording.
S120, detecting the health state of the node service information stored in a preset node information database to obtain corresponding state detection information.
And detecting the health state of the node service information stored in the preset node information database to obtain corresponding state detection information. The deployment terminal is also preconfigured with a node information database, wherein the node information database is a database for storing the related information of the nodes, and specifically, the node information database can be a mongolidb database. The node service information stored in the node information database can be obtained and the monitoring state detection can be carried out, so that the state detection information corresponding to each node in the node service information can be obtained, and the state detection information of the node can be healthy or unhealthy.
In one embodiment, as shown in FIG. 4, step S120 includes sub-steps S121, S122, S123, and S124.
S121, screening nodes contained in the service node information according to the state information in the service node information, and taking the node with normal state information as an initial screening node.
The service node information contains the state information of each node, and the nodes can be screened according to the state information, so that the nodes with normal state information are obtained as initial screening nodes. If the status information of the node in the service node information can be "up" or "down", the node with the status information of "up" is obtained as an initial screening node.
S122, establishing session links with each initial screening node, and judging whether the session links corresponding to each initial screening node are successfully established.
According to the information such as the IP address and the port number of the initial screening node and the initial screening node, attempting to establish a session link, wherein the established session link can be a TCP link or an HTTP link, judging whether the session link is established successfully or not based on the establishment process of the session link, if the session information fed back by the initial screening node is received in the session link establishment process, judging that the session link is established successfully, and if the session information fed back by the initial screening node is not received, judging that the session link is not established successfully.
S123, if the session link corresponding to the initial screening node is successfully established, determining that the state detection information of the initial screening node is healthy; s124, determining that the state detection information of other nodes in the service node information is unhealthy.
If the session link of the initial screening node is established successfully, the state detection information of the initial screening node is obtained to be healthy; if the session link of the initial screening node is not established successfully, the state detection information of the initial screening node is unhealthy, and the state detection information of the node with the state information not normal is unhealthy.
In an embodiment, as shown in fig. 5, step S120 further includes step S1201.
And S1201, updating the service information according to the state detection information to obtain updated service information.
The service information comprises information such as IP address, port number, health state, weight and the like of the nodes contained in each service group, the service information stored in the information storage database can be updated in real time through the acquired state detection information, namely, the health state of each node in the service information is updated in real time through the state detection information, and if the technical method for updating the health state of the nodes in real time is adopted, the service information containing the accurate health state can be directly acquired from the information storage database for subsequent use.
S130, splitting and comparing the state detection information and the instance configuration information of the cluster server according to the service information to obtain difference comparison information corresponding to each instance process configured in the cluster server.
And splitting and comparing the state detection information and the instance configuration information of the cluster server according to the service information to obtain difference comparison information corresponding to each instance process configured in the cluster server. The shared memory of the cluster server also stores instance configuration information, the instance configuration information can be obtained from the shared memory, the service information comprises information recording service architecture information of the cluster server, the instance configuration information and the state detection information can be split based on the service information, and difference comparison is carried out after basic comparison information corresponding to each instance process is obtained, so that difference comparison information is obtained.
In one embodiment, as shown in FIG. 6, step S130 includes sub-steps S131 and S132.
S131, splitting the service information, the instance configuration information and the state detection information according to the instance process contained in each service group in the service information, and obtaining basic comparison information corresponding to each instance process.
Specifically, each service group in the service information includes an instance process to split the service information, the instance configuration information and the state detection information, and specifically, partial information corresponding to the node corresponding to each instance process in the service information, the instance configuration information and the state detection information can be obtained respectively and used as basic comparison information of each instance process, that is, the basic comparison information of each instance process includes partial information in the service information, partial information in the instance configuration information and partial information in the state detection information. For example, according to the IP address and port number of the node included in the instance process as the identification information uniquely corresponding to the node, the information matched with the identification information of the node can be obtained from the service information, the instance configuration information and the state detection information.
And S132, performing differential comparison on the basic comparison information of each instance process to obtain differential comparison information of each instance process.
The basic comparison information of the instance process comprises two groups of information corresponding to the instance process, wherein one group of information is part of information corresponding to the instance process in the instance configuration information, the other group of information is part of information corresponding to the instance process in the service information and the state detection information, the two groups of information corresponding to each instance process are subjected to difference comparison respectively, so that difference comparison information of each instance process can be obtained, and one piece of difference comparison information comprises a plurality of difference information such as node quantity difference, node health state difference, node operation parameter difference and the like in the two groups of information corresponding to one instance process.
And S140, if the difference comparison information of any instance process is different, carrying out differential updating on the node configuration information of the instance process according to the difference comparison information of the instance process to obtain the instance process with the configuration updated.
And respectively judging whether the difference comparison information of each instance process has a difference or not so as to obtain a corresponding difference judgment result. Whether the difference comparison information of each instance process has the difference or not can be respectively judged, the difference comparison information only comprises information of front-back change, if the front-back change does not exist, namely, the node number difference, the node health state difference and the node operation parameter difference are all empty, the difference is indicated to be not in the difference comparison information, and a difference judgment result without the difference is obtained; if one of the node quantity difference, the node health state difference or the node operation parameter difference is not null, indicating that the difference comparison information is different, and obtaining a difference judgment result with the difference.
If the difference comparison information of any instance process is the difference, carrying out differential updating on the node configuration information of the instance process according to the difference comparison information of the instance process to obtain the instance process with the configuration updated. If the difference judgment result of the instance process is that the difference exists, the node configuration information of the nodes contained in the instance process can be differentially updated based on the difference comparison information of the instance process, so that the instance process with the configuration updated is obtained. Specifically, the node configuration information includes the number of nodes, state parameters and operation parameters, and the node configuration information is stored in the independent memory of each instance process, so that the differential update only updates the instance process with the difference in the difference judgment result, and does not update the independent memory information of all instance processes in a full amount, thereby improving the update efficiency of updating the node configuration information in the instance process.
In one embodiment, as shown in FIG. 7, step S140 includes sub-steps S141, S142, and S143.
S141, adjusting the number of the nodes configured in the example process according to the node adding and deleting information contained in the difference comparison information of the example process.
If the node adding and deleting information contained in the difference comparison information of the instance process is not null, the number of the nodes configured in the instance process is required to be adjusted according to the node adding and deleting information, if the node adding and deleting information is "+2", 2 spare nodes are additionally configured in the instance process.
S142, updating the state parameters of the nodes configured in the example process according to the node state updating information contained in the difference comparison information.
If the node state update information contained in the difference comparison information of the instance process is not null, the state parameters of the node configured by the instance process need to be updated, that is, the state parameters of the corresponding node are modified according to the change condition of the health state of the node in the node state update information, so that the modified state parameters are matched with the change condition of the health state of the node in the node state update information.
S143, updating the operation parameters of the nodes configured in the example process according to the operation parameter updating information contained in the difference comparison information.
If the difference comparison information of the instance process contains operation parameter updating information which is not null, the operation parameters of the node configured by the instance process need to be updated, the operation parameters comprise parameter information such as weight, and if the change condition of the weight parameter of a certain node in the operation parameter updating information is "-1", the-1 is used as a new operation parameter on the basis of the original operation parameter of the node, so that the operation parameters of the node are updated.
And S150, if the input request to be processed is received, acquiring a target processing node matched with the request to be processed from the cluster server according to a preset matching rule.
And if the input request to be processed is received, acquiring a target processing node matched with the request to be processed from the cluster server according to a preset matching rule, and allocating the target processing node to process the request to be processed. The service data to be processed may be a request to be processed and sent to the deployment terminal, for example, the client sends the request to be processed to the deployment terminal configured in the enterprise to transact the service, and the deployment terminal obtains the corresponding target processing node from the cluster server based on the matching rule, and processes the received request to be processed through the matched target processing node in the cluster server. The matching rules comprise address matching rules and node allocation rules.
In one embodiment, as shown in FIG. 8, step S150 includes sub-steps S151 and S152.
S151, acquiring an instance process matched with the request address in the pending request from the instance processes running in the cluster server according to the address matching rule as a target instance process.
The request to be processed contains a request address, the request address can be address information corresponding to a client sending the request to be processed, and address matching can be performed on the request address and an address segment of an instance process in the cluster server according to an address matching rule so as to obtain an instance process matched with the request address. Specifically, a Hash value corresponding to the request address can be obtained by calculation based on a Hash algorithm in the address matching rule, each instance process in the cluster server comprises a corresponding address segment, the address segments of the instance processes are not overlapped with each other, the instance process corresponding to the address segment in which the Hash value falls can be obtained, and the instance process corresponding to the Hash value is taken as a target instance process.
S152, acquiring a corresponding node from the target instance process according to the node allocation rule and the node configuration information in the target instance process as a target processing node.
The node configuration information of the target instance process contains corresponding state parameters and operation parameters, and the candidate nodes with the state parameters of 'health' can be obtained based on the state parameters in the node configuration information, and the weight of each candidate node can be further obtained. The node allocation rule may be rule information for performing random allocation based on weights, and then random allocation may be performed according to the node allocation rule and the weights of each candidate node, and one of the candidate nodes is obtained as a target processing node according to a random allocation result, where the weight ratio of the candidate node is a ratio value of the candidate node allocated, that is, the larger the weight is, the higher the probability of being allocated randomly.
S160, allocating the target processing node to process the to-be-processed request.
After the target processing node is obtained, the target processing node can be allocated to process the request to be processed, so that the efficient processing of the request to be processed based on load allocation is realized.
The technical method can be applied to application scenes of dynamic allocation of loads in the cluster server, such as intelligent government affairs, intelligent urban management, intelligent communities, intelligent security, intelligent logistics, intelligent medical treatment, intelligent education, intelligent environmental protection, intelligent traffic and the like, so that construction of intelligent cities is promoted.
In the load dynamic allocation method based on memory management provided by the embodiment of the invention, service information is acquired from the information storage database of the cluster server, the health state of node service information in the node information database is detected to obtain state detection information, the state detection information and the instance configuration information are split and compared according to the service information to obtain difference comparison information corresponding to each process instance, if the difference comparison information of the process instance is different, the node configuration information of the corresponding instance process is differentially updated according to the difference comparison information, and a target processing node is acquired from the cluster server according to a matching rule to allocate the request to be processed. By the method, the service information can be acquired from the information storage database, the node configuration information of each instance process is differentially updated after the service information is analyzed and processed, so that dynamic load balancing can be realized based on memory management, the influence on continuity of service data processing is avoided, and the efficiency of load balancing allocation is improved in reply.
The embodiment of the present invention further provides a load dynamic allocation device based on memory management, where the load dynamic allocation device based on memory management may be configured in the allocation terminal 10, and the load dynamic allocation device based on memory management is used to execute any embodiment of the load dynamic allocation method based on memory management. Specifically, referring to fig. 9, fig. 9 is a schematic block diagram of a load dynamic allocation apparatus based on memory management according to an embodiment of the present invention.
As shown in fig. 9, the load dynamic allocation apparatus 100 based on memory management includes a service information acquisition unit 110, a state detection information acquisition unit 120, a difference contrast information acquisition unit 130, an instance process configuration update unit 140, a target processing node acquisition unit 150, and an allocation processing unit 160.
And a service information obtaining unit 110, configured to obtain service information from an information storage database configured in the cluster server.
In a specific embodiment, the service information obtaining unit 110 includes a subunit: a transmission connection establishment unit, configured to establish a transmission connection corresponding to an information storage database configured in the cluster server according to pre-stored connection configuration information; and the information acquisition unit is used for periodically acquiring the service information stored in the information storage database from the transmission connection according to a preset acquisition period.
The state detection information obtaining unit 120 is configured to perform health state detection on node service information stored in a preset node information database, so as to obtain corresponding state detection information.
In a specific embodiment, the status detection information obtaining unit 120 includes a subunit: an initial screening node obtaining unit, configured to screen nodes included in the service node information according to the state information in the service node information, so as to obtain a node with normal state information as an initial screening node; a session link judging unit, configured to establish a session link with each of the initial screening nodes, and judge whether the session link corresponding to each of the initial screening nodes is successfully established; the first state detection information determining unit is used for determining that the state detection information of the initial screening node is healthy if the session link corresponding to the initial screening node is successfully established; and the second state detection information determining unit is used for determining that the state detection information of other nodes in the service node information is unhealthy.
In an embodiment, the load dynamic allocation apparatus 100 based on memory management further includes a subunit: and the service information updating unit is used for updating the service information according to the state detection information so as to obtain updated service information.
The difference comparison information obtaining unit 130 is configured to split and compare the state detection information and the instance configuration information of the cluster server according to the service information, so as to obtain difference comparison information corresponding to each instance process configured in the cluster server.
In a specific embodiment, the differential contrast information obtaining unit 130 includes a subunit: the basic comparison information acquisition unit is used for respectively splitting the service information, the instance configuration information and the state detection information according to the instance process contained in each service group in the service information to obtain basic comparison information corresponding to each instance process; and the difference comparison unit is used for performing difference comparison on the basic comparison information of each instance process so as to obtain the difference comparison information of each instance process.
And the instance process configuration updating unit 140 is configured to perform differential updating on node configuration information of the instance process according to the difference comparison information of the instance process if the difference comparison information of any one of the instance processes is a difference, so as to obtain an instance process with configuration updated.
In a specific embodiment, the instance process configuration update unit 140 includes subunits: the node quantity adjusting unit is used for adjusting the node quantity configured in the instance process according to node adding and deleting information contained in the difference comparison information of the instance process; a state parameter updating unit, configured to update a state parameter of a node configured in the instance process according to node state update information included in the difference comparison information; and the operation parameter updating unit is used for updating the operation parameters of the nodes configured in the example process according to the operation parameter updating information contained in the difference comparison information.
And the processing node allocating unit 150 is configured to, if an input request to be processed is received, obtain, from the cluster server, a target processing node that is matched with the request to be processed according to a preset matching rule.
In one embodiment, the processing node deployment unit 150 includes a subunit: the target instance process obtaining unit is used for obtaining an instance process matched with the request address in the request to be processed from the instance processes running in the cluster server according to the address matching rule as a target instance process; and the target processing node acquisition unit is used for acquiring a corresponding node from the target instance process as a target processing node according to the node allocation rule and the node configuration information in the target instance process.
And the allocating processing unit 160 is configured to allocate the target processing node to process the request to be processed.
The load dynamic allocation device based on memory management provided by the embodiment of the invention is applied to the load dynamic allocation method based on memory management, service information is obtained from the information storage database of the cluster server, the health state of the node service information in the node information database is detected to obtain state detection information, the state detection information and the instance configuration information are split and compared according to the service information to obtain difference comparison information corresponding to each process instance, if the difference comparison information of the process instance is different, the node configuration information of the corresponding instance process is differentially updated according to the difference comparison information, and a target processing node is obtained from the cluster server according to a matching rule to allocate the request to be processed. By the method, the service information can be acquired from the information storage database, the node configuration information of each instance process is differentially updated after the service information is analyzed and processed, so that dynamic load balancing can be realized based on memory management, the influence on continuity of service data processing is avoided, and the efficiency of load balancing allocation is improved in reply.
The load dynamic allocation apparatus based on memory management described above may be implemented in the form of a computer program that can be run on a computer device as shown in fig. 10.
Referring to fig. 10, fig. 10 is a schematic block diagram of a computer device according to an embodiment of the present invention. The computer device may be a provisioning terminal 10 for performing a memory management based load dynamic provisioning method to dynamically provision loads in a cluster server.
With reference to fig. 10, the computer device 500 includes a processor 502, a memory, and a network interface 505, which are connected by a system bus 501, wherein the memory may include a storage medium 503 and an internal memory 504.
The storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032, when executed, may cause the processor 502 to perform a memory management based load dynamic provisioning method, wherein the storage medium 503 may be a volatile storage medium or a non-volatile storage medium.
The processor 502 is used to provide computing and control capabilities to support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the execution of a computer program 5032 in the storage medium 503, which computer program 5032, when executed by the processor 502, causes the processor 502 to perform a memory management based load dynamic provisioning method.
The network interface 505 is used for network communication, such as providing for transmission of data information, etc. It will be appreciated by those skilled in the art that the structure shown in FIG. 10 is merely a block diagram of some of the structures associated with the present inventive arrangements and does not constitute a limitation of the computer device 500 to which the present inventive arrangements may be applied, and that a particular computer device 500 may include more or fewer components than shown, or may combine certain components, or may have a different arrangement of components.
The processor 502 is configured to execute a computer program 5032 stored in a memory, so as to implement the corresponding functions in the load dynamic allocation method based on memory management.
Those skilled in the art will appreciate that the embodiment of the computer device shown in fig. 10 is not limiting of the specific construction of the computer device, and in other embodiments, the computer device may include more or less components than those shown, or certain components may be combined, or a different arrangement of components. For example, in some embodiments, the computer device may include only a memory and a processor, and in such embodiments, the structure and function of the memory and the processor are consistent with the embodiment shown in fig. 10, and will not be described again.
It should be appreciated that in an embodiment of the invention, the processor 502 may be a central processing unit (Central Processing Unit, CPU), the processor 502 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSPs), application specific integrated circuits (Application Specific Integrated Circuit, ASICs), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In another embodiment of the invention, a computer-readable storage medium is provided. The computer readable storage medium may be a volatile or nonvolatile computer readable storage medium. The computer readable storage medium stores a computer program, wherein the computer program when executed by a processor implements the steps included in the memory management-based load dynamic allocation method described above.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working procedures of the apparatus, device and unit described above may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein. Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of function in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, and for example, the division of the units is merely a logical function division, there may be another division manner in actual implementation, or units having the same function may be integrated into one unit, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. In addition, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices, or elements, or may be an electrical, mechanical, or other form of connection.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment of the present invention.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention is essentially or part of what contributes to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a computer-readable storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned computer-readable storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, an optical disk, or other various media capable of storing program codes.
While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.

Claims (10)

1. The method is characterized in that the method is applied to an allocation terminal, and network connection is established between the allocation terminal and a cluster server to realize data information transmission, and the method comprises the following steps:
acquiring service information from an information storage database configured in the cluster server;
detecting the health state of node service information stored in a preset node information database to obtain corresponding state detection information;
splitting and comparing the state detection information and the instance configuration information of the cluster server according to the service information to obtain difference comparison information corresponding to each instance process configured in the cluster server;
If the difference comparison information of any instance process is different, carrying out differential updating on the node configuration information of the instance process according to the difference comparison information of the instance process to obtain an instance process with configuration updating completed;
if an input request to be processed is received, a target processing node matched with the request to be processed is obtained from the cluster server according to a preset matching rule;
and allocating the target processing node to process the request to be processed.
2. The method for dynamically allocating loads based on memory management according to claim 1, wherein the step of obtaining service information from an information storage database configured in the cluster server comprises:
establishing transmission connection corresponding to an information storage database configured in the cluster server according to pre-stored connection configuration information;
and periodically acquiring the service information stored in the information storage database from the transmission connection according to a preset acquisition period.
3. The method for dynamically allocating load based on memory management according to claim 1, wherein the detecting the health status of the node service information stored in the preset node information database to obtain the corresponding status detection information comprises:
Screening nodes contained in the service node information according to the state information in the service node information to obtain nodes with normal state information as initial screening nodes;
establishing session links with each initial screening node, and judging whether the session links corresponding to each initial screening node are successfully established;
if the session link corresponding to the initial screening node is successfully established, determining that the state detection information of the initial screening node is healthy;
and determining the state detection information of other nodes in the service node information to be unhealthy.
4. The method for dynamically allocating load based on memory management according to claim 1, wherein after performing health status detection on node service information stored in a preset node information database to obtain corresponding status detection information, further comprising:
and updating the service information according to the state detection information to obtain updated service information.
5. The method for dynamically allocating load based on memory management according to claim 1, wherein splitting and comparing the state detection information and the instance configuration information of the cluster server according to the service information to obtain difference comparison information corresponding to each instance process configured in the cluster server, respectively, includes:
Splitting the service information, the instance configuration information and the state detection information according to an instance process contained in each service group in the service information to obtain basic comparison information corresponding to each instance process;
and carrying out differential comparison on the basic comparison information of each instance process to obtain the differential comparison information of each instance process.
6. The method for dynamically allocating load based on memory management according to claim 1, wherein the performing differential update on node configuration information of the instance process according to the differential comparison information of the instance process to obtain an instance process completing configuration update comprises:
according to node adding and deleting information contained in the difference comparison information of the instance process, adjusting the number of nodes configured in the instance process;
updating the state parameters of the nodes configured in the example process according to the node state updating information contained in the difference comparison information;
and updating the operation parameters of the nodes configured in the example process according to the operation parameter updating information contained in the difference comparison information.
7. The method for dynamically allocating load based on memory management according to claim 1, wherein the matching rules include an address matching rule and a node allocation rule, and the obtaining, from the cluster server, the target processing node that matches the pending request according to a preset matching rule includes:
acquiring an instance process matched with a request address in the request to be processed from the instance processes running in the cluster server according to the address matching rule as a target instance process;
and acquiring a corresponding node from the target instance process as a target processing node according to the node allocation rule and the node configuration information in the target instance process.
8. The utility model provides a load dynamic allocation device based on memory management, its characterized in that, the device disposes in allocating the terminal, establish network connection in order to realize the transmission of data information between allocating the terminal and the cluster server, the device includes:
a service information obtaining unit, configured to obtain service information from an information storage database configured in the cluster server;
the state detection information acquisition unit is used for detecting the health state of the node service information stored in the preset node information database so as to obtain corresponding state detection information;
The difference comparison information acquisition unit is used for carrying out split comparison on the state detection information and the instance configuration information of the cluster server according to the service information so as to acquire difference comparison information corresponding to each instance process configured in the cluster server;
an instance process configuration updating unit, configured to, if the difference comparison information of any one of the instance processes is a difference, perform differential updating on node configuration information of the instance process according to the difference comparison information of the instance process, so as to obtain an instance process for completing configuration updating;
the target processing node acquisition unit is used for acquiring a target processing node matched with the to-be-processed request from the cluster server according to a preset matching rule if the input to-be-processed request is received;
and the allocation processing unit is used for allocating the target processing node to process the request to be processed.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the memory management based load dynamic provisioning method of any of claims 1 to 7 when the computer program is executed by the processor.
10. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program, which when executed by a processor implements the memory management based load dynamic provisioning method according to any of claims 1 to 7.
CN202111441935.XA 2021-11-30 2021-11-30 Method, device, equipment and medium for dynamically allocating load based on memory management Active CN114172910B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111441935.XA CN114172910B (en) 2021-11-30 2021-11-30 Method, device, equipment and medium for dynamically allocating load based on memory management

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111441935.XA CN114172910B (en) 2021-11-30 2021-11-30 Method, device, equipment and medium for dynamically allocating load based on memory management

Publications (2)

Publication Number Publication Date
CN114172910A CN114172910A (en) 2022-03-11
CN114172910B true CN114172910B (en) 2023-06-13

Family

ID=80481661

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111441935.XA Active CN114172910B (en) 2021-11-30 2021-11-30 Method, device, equipment and medium for dynamically allocating load based on memory management

Country Status (1)

Country Link
CN (1) CN114172910B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115794769B (en) * 2022-10-09 2024-03-19 云和恩墨(北京)信息技术有限公司 Method for managing high-availability database, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1434393A (en) * 2003-02-24 2003-08-06 武汉大学 Dynamic loading balance method for cluster server
CN108833131A (en) * 2018-04-25 2018-11-16 北京百度网讯科技有限公司 System, method, equipment and the computer storage medium of distributed data base cloud service
CN111131375A (en) * 2019-10-12 2020-05-08 平安普惠企业管理有限公司 Interface service acquisition method and device, computer equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103905500B (en) * 2012-12-27 2018-01-09 腾讯数码(天津)有限公司 A kind of method and apparatus for accessing application server
US10038640B2 (en) * 2015-04-30 2018-07-31 Amazon Technologies, Inc. Managing state for updates to load balancers of an auto scaling group

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1434393A (en) * 2003-02-24 2003-08-06 武汉大学 Dynamic loading balance method for cluster server
CN108833131A (en) * 2018-04-25 2018-11-16 北京百度网讯科技有限公司 System, method, equipment and the computer storage medium of distributed data base cloud service
CN111131375A (en) * 2019-10-12 2020-05-08 平安普惠企业管理有限公司 Interface service acquisition method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN114172910A (en) 2022-03-11

Similar Documents

Publication Publication Date Title
CN109729131B (en) Application request processing method and device and router
CN109104483B (en) Micro-service dynamic load balancing method and device based on event notification
US11165690B2 (en) Request routing based on server software versions
CN111178760B (en) Risk monitoring method, risk monitoring device, terminal equipment and computer readable storage medium
CN109951537B (en) Load balancing distribution method facing block chain
US9355005B2 (en) Detection apparatus and detection method
CN109739527B (en) Method, device, server and storage medium for client gray scale release
CN111163173B (en) Cluster configuration method and device, server and readable storage medium
CN113726783B (en) Abnormal IP address identification method and device, electronic equipment and readable storage medium
CN112035260A (en) Service request processing method and device, computer equipment and storage medium
US9558348B1 (en) Ranking software applications by combining reputation and code similarity
WO2021188196A1 (en) Causality determination of upgrade regressions via comparisons of telemetry data
CN114172910B (en) Method, device, equipment and medium for dynamically allocating load based on memory management
US20200053183A1 (en) Comparison of behavioral populations for security and compliance monitoring
CN112187575A (en) Method and device for monitoring health state of server
US20240106853A1 (en) Real time application protection system configuration drift categorization and response
CN112751785B (en) Method and device for sending pending request, computer equipment and storage medium
CN106790610A (en) A kind of cloud system message distributing method, device and system
EP3278536A1 (en) Network operation
CN111905362A (en) Game guild loading method and server
CN116909695A (en) Computing power task processing method and system of computing power network based on block chain
CN107368355B (en) Dynamic scheduling method and device of virtual machine
CN114221807B (en) Access request processing method, device, monitoring equipment and storage medium
CN115686368A (en) Method, system, apparatus and medium for storage capacity expansion of nodes of block chain network
CN103713982B (en) Remote service is returned the method and apparatus that result is monitored

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