A service data load balancing method and device
By combining hardware parameters and software resource parameters for load matching and dynamically adjusting server weights, the problem that traditional static algorithms cannot dynamically adjust load balancing is solved, and the response speed and customer experience are improved.
Patent Information
- Application Number
- CN202110856015.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-28
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2041-07-28
AI Technical Summary
When traditional static algorithms are configured for load balancing, the parameters are set in advance and cannot be adjusted dynamically, resulting in server load imbalance, extended response time, and affecting customer transaction experience.
By combining hardware parameters and software resource parameters for load matching, the server weight is dynamically adjusted, and a server weight is reduced when a server processes a large amount of data, and transactions are routed to other servers; when there are fewer transactions, the weight is increased to improve the processing efficiency of the entire service cluster.
It realizes dynamic adjustment of cluster load during service operation, improves response speed, improves customer transaction experience, and reduces the risk of server load imbalance.
Smart Images

Figure CN113504974B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet finance, and in particular to a service data load balancing method and device. Background Art
[0002] With the gradual development of my country's banking and financial industry, the improvement of information technology of various transactions has brought about centralized access, high concurrency and other problems, which have brought considerable challenges to the server. When configuring load balancing in traditional static algorithms, various parameters are set in advance, and fixed weight values are used for task allocation, which will not change. Even if the server has a load imbalance, it will continue to run with the set parameters. It is impossible to dynamically adjust the load of the cluster during the service operation. The resulting long response time has affected the customer transaction and teller service experience. Summary of the invention
[0003] In view of the traditional static algorithm in the prior art, when configuring load balancing, various parameters are set in advance, and fixed weight values are used for task allocation, which will not change. Even if the server has a load imbalance, it will continue to run with the set parameters, and the cluster load cannot be dynamically adjusted during the service operation. The present invention provides a service data load balancing method and device, which matches the load by combining corresponding hardware parameters and software resource parameters. When a server processes a large amount of data within a period of time and reaches an average warning value, the weight of the current server is reduced, so that the transaction is routed to other servers with higher weights; if the current server processes fewer transactions, the weight is increased to improve the processing efficiency of the entire service cluster.
[0004] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0005] In a first aspect, the present invention provides a service data load balancing method, comprising:
[0006] Acquire multiple service data to be processed; each service data corresponds to a business service;
[0007] Determining load information of each server in the server cluster according to hardware parameters corresponding to processing the service data;
[0008] The service data is distributed to each server according to the software resource parameters corresponding to the service data and the load information of each server, so that each server processes the service data.
[0009] In a preferred embodiment, the resource parameters include hardware parameters; and determining the load information of each server in the server cluster according to the hardware parameters corresponding to the processing of the service data includes:
[0010] Determine the current load value and weight value corresponding to each server according to the hardware parameters;
[0011] The load information of each server is determined according to the current load value and the weight value of each server.
[0012] In a preferred embodiment, the hardware parameters include hardware configuration indicators, and determining the weight value corresponding to each server according to the hardware parameters includes:
[0013] Establish a judgment matrix based on the hardware configuration indicators of each hardware;
[0014] Calculate the eigenvector of the matrix according to the judgment matrix;
[0015] The feature vector is normalized to obtain a weight value of each server.
[0016] In a preferred embodiment, the hardware parameters include: hardware usage rate, and determining the current load value corresponding to each server according to the hardware parameters includes:
[0017] Collect the hardware usage of each hardware in each server;
[0018] A current load value of the server is generated according to the hardware usage.
[0019] In a preferred embodiment, the hardware usage includes CPU usage, memory usage, disk usage and network bandwidth usage.
[0020] In a preferred embodiment, determining the load information of each server according to the current load value and the weight value of each server includes:
[0021] The current load value and the weight value are multiplied to obtain the load information of each server.
[0022] In a preferred embodiment, the allocating the service data to each server according to the software resource parameters corresponding to the service data and the load information of each server includes:
[0023] Numerically processing the software resource parameters to obtain software parameter values;
[0024] According to the software resource value and the load information of the server, each service data is matched with the server, and then each service data is distributed to each server.
[0025] In a preferred embodiment, the software resource parameters include: transaction channel parameters, business complexity, and business attribution program complexity;
[0026] The performing numerical processing on the software resource parameters to obtain software parameter values includes:
[0027] The transaction channel parameters, business complexity and business attribution program complexity are multiplied to obtain the software parameter value.
[0028] In a preferred embodiment, the determining the load information of each server according to the current load value and the weight value of each server further includes:
[0029] Get the current load imbalance value;
[0030] The load information of each server is determined according to the current load imbalance value, the current load value and the weight value.
[0031] In a preferred embodiment, it also includes:
[0032] Generates the current load imbalance value.
[0033] In a second aspect, the present invention provides a service data load balancing device, comprising:
[0034] An acquisition module acquires multiple service data to be processed; each service data corresponds to a business service;
[0035] A load information determination module, which determines the load information of each server in the server cluster according to the hardware parameters corresponding to the processing of the service data;
[0036] The distribution module distributes the service data to each server according to the software resource parameters corresponding to the service data and the load information of each server, so that each server processes the service data.
[0037] In a preferred embodiment, the resource parameters include hardware parameters; the load information determination module includes:
[0038] A load weight determination unit, which determines the current load value and weight value corresponding to each server according to the hardware parameters;
[0039] The load information determining unit determines the load information of each server according to the current load value and the weight value of each server.
[0040] In a preferred embodiment, the hardware parameters include hardware configuration indicators, and the load weight determination unit includes:
[0041] A judgment matrix establishing unit, establishing a judgment matrix according to hardware configuration indicators of each hardware;
[0042] A characteristic vector calculation unit, which calculates the characteristic vector of the matrix according to the judgment matrix;
[0043] The weight value generating unit normalizes the feature vector to obtain the weight value of each server.
[0044] In a preferred embodiment, the hardware parameters include: hardware usage rate, and the load weight determination unit further includes:
[0045] A hardware usage rate collection unit collects the hardware usage rate of each hardware in each server;
[0046] A current load value generating unit generates a current load value of the server according to the hardware usage rate.
[0047] In a preferred embodiment, the hardware usage includes CPU usage, memory usage, disk usage and network bandwidth usage.
[0048] In a preferred embodiment, the load information determination unit is specifically configured to perform product processing on the current load value and the weight value to obtain the load information of each server.
[0049] In a preferred embodiment, the allocation module comprises:
[0050] A numerical processing unit performs numerical processing on the software resource parameters to obtain software parameter values;
[0051] The matching unit matches each service data with a server according to the software resource value and the load information of the server, and then distributes each service data to each server.
[0052] In a preferred embodiment, the software resource parameters include: transaction channel parameters, business complexity, and business attribution program complexity;
[0053] The numerical processing unit is specifically used to perform product processing on the transaction channel parameters, business complexity and business attribution program complexity to obtain the software parameter value.
[0054] In a preferred embodiment, the imbalance value obtaining unit obtains the current load imbalance value;
[0055] The load information determination unit is specifically configured to determine the load information of each server according to the current load imbalance value, the current load value and the weight value.
[0056] In a preferred embodiment, it also includes:
[0057] Generates the current load imbalance value.
[0058] In a third aspect, the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the service data load balancing method when executing the program.
[0059] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which implements the service data load balancing method when executed by a processor.
[0060] It can be seen from the above technical solution that the present invention provides a service data load balancing method and device, which performs load matching by combining corresponding hardware parameters and software resource parameters. When a server processes a large amount of data within a period of time and reaches the average warning value, the weight of the current server is reduced, so that the transaction is routed to other servers with higher weights; if the current server processes fewer transactions, the weight is increased to improve the processing efficiency of the entire service cluster. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0062] Figure 1 It is one of the flowcharts of the method steps executed in the embodiment of the present invention.
[0063] Figure 2 This is the second schematic flow chart of the method steps executed in the embodiment of the present invention.
[0064] Figure 3 This is the third schematic flow chart of the method steps executed in the embodiment of the present invention.
[0065] Figure 4 This is the fourth schematic flow chart of the method steps executed in the embodiment of the present invention.
[0066] Figure 5 This is the fifth schematic flow chart of the method steps executed in the embodiment of the present invention.
[0067] Figure 6 It is a structural diagram of a service data load balancing device in an embodiment of the present invention.
[0068] Figure 7 It is a schematic diagram of the structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0069] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0070] It should be noted that the service data load balancing method and device disclosed in the present invention can be used in the financial field, and can also be used in any field other than the financial field. The application field of the service data load balancing method and device disclosed in the present invention is not limited.
[0071] When configuring load balancing in traditional static algorithms, various parameters are set in advance, and fixed weight values are used for task allocation, which will not change. Even if the server is unbalanced in load, it will continue to run with the set parameters. The cluster load cannot be adjusted dynamically during service operation. The resulting long response time affects the customer transaction and teller service experience, so there are many shortcomings.
[0072] Based on the above content, in response to the above problems, the present invention performs load matching by combining corresponding hardware parameters and software resource parameters to solve the problem of slow transaction processing on the server caused by centralized access, high concurrency, how to digitize the differences between hardware of different brands, and the timing and value of weight adjustment in the current system, and makes the load conditions of each server in the cluster similar, thereby reducing the risk of server "avalanche".
[0073] The present invention provides a method and device for load balancing service data provided in one or more embodiments of the present invention, specifically, including: obtaining multiple service data to be processed; each service data corresponds to a business service; determining the load information of each server in the server cluster according to the hardware parameters corresponding to the processing of the service data; distributing the service data to each server according to the software resource parameters corresponding to the service data and the load information of each server, so that each server processes the service data. The present invention performs load matching by combining the corresponding hardware parameters and software resource parameters. When the amount of data processed by a server within a period of time is large and reaches the average warning value, the weight of the current server is reduced, so that the transaction is routed to other servers with higher weights; if the current server processes fewer transactions, the weight is increased, thereby improving the processing efficiency of the entire service cluster.
[0074] It is understandable that the service data load balancing device of the present invention may be a server or a mobile terminal, for example, a smart phone, a tablet electronic device, a portable computer, a desktop computer, a personal digital assistant (PDA), a smart wearable device, etc. The smart wearable device may include smart glasses, a smart watch, a smart bracelet, etc.
[0075] The above-mentioned service data load balancing device has a communication module, which can be connected to the service cluster for communication and realize data transmission with the service cluster.
[0076] The service data load balancing device and the service cluster may communicate using any suitable network protocol, including network protocols that have not been developed on the date of submission of the present invention. The network protocol may include, for example, TCP / IP protocol, UDP / IP protocol, HTTP protocol, HTTPS protocol, etc. Of course, the network protocol may also include, for example, RPC protocol (Remote Procedure Call Protocol) and REST protocol (Representational State Transfer) used on top of the above protocols.
[0077] The present invention provides a service data load balancing method and device, which performs load matching by combining corresponding hardware parameters and software resource parameters. When a server processes a large amount of data within a period of time and reaches an average warning value, the weight of the current server is reduced so that transactions are routed to other servers with higher weights; if the current server processes fewer transactions, the weight is increased to improve the processing efficiency of the entire service cluster.
[0078] The details are described through the following multiple embodiments and application examples.
[0079] In order to solve the problem that in the conventional static algorithm in the prior art, various parameters are set in advance when configuring load balancing, and fixed weight values are used for task allocation, which will not change. Even if the server has load imbalance, it will continue to run with the set parameters, and the load of the cluster cannot be dynamically adjusted during the service operation, the present invention provides an embodiment of a service data load balancing method, see Figure 1 , specifically including the following contents:
[0080] Step S100: Acquire multiple service data to be processed; each service data corresponds to a business service.
[0081] Step S200: Determine the load information of each server in the server cluster according to the hardware parameters corresponding to the service data.
[0082] Step S300: Distribute the service data to each server according to the software resource parameters corresponding to the service data and the load information of each server, so that each server processes the service data.
[0083] It can be seen from the above technical solution that a service data load balancing method provided by the present invention performs load matching by combining corresponding hardware parameters and software resource parameters. When a server processes a large amount of data within a period of time and reaches the average warning value, the weight of the current server is reduced so that the transaction is routed to other servers with higher weights; if the current server processes fewer transactions, the weight is increased to improve the processing efficiency of the entire service cluster.
[0084] In order to provide a specific operation flow of determining the load information of each server in the server cluster according to the hardware parameters corresponding to the service data, in one or more embodiments of the present invention, the resource parameters include hardware parameters; the load information of each server in the server cluster is determined according to the hardware parameters corresponding to the service data, such as Figure 2 As shown, including:
[0085] S201: Determine the current load value and weight value corresponding to each server according to the hardware parameters;
[0086] S202: Determine the load information of each server according to the current load value and the weight value of each server.
[0087] Hardware parameters can be understood as index parameters generated during the use of the hardware itself, such as hardware utilization, such as CPU utilization, memory utilization, disk utilization, network bandwidth utilization, etc. The present invention calculates the current load value of the server as the basic value of the server load; then the weight value of each server is calculated based on the hardware parameters of the server. During the operation of the program, the load status of the current service cluster is collected and judged using system-level online small batches. When the amount of data processed by a server in a period of time is large and reaches the average warning value, the weight of the current server is reduced so that the transaction is routed to other servers with higher weights; if the current server processes fewer transactions, the weight is increased to improve the processing efficiency of the entire service cluster. The method also solves the problem of reducing the intrusiveness to the server when collecting the current load value of the server; how to digitize the differences between hardware of different brands and the timing and value of weight adjustment.
[0088] In order to provide a specific operation step of determining the weight value corresponding to each server according to the hardware parameters, in one or more embodiments of the present invention, the hardware parameters include hardware configuration indicators, and the weight value corresponding to each server is determined according to the hardware parameters, such as Figure 3 As shown, including:
[0089] S211: Establishing a judgment matrix according to hardware configuration indicators of each hardware;
[0090] S212: Calculate the eigenvector of the matrix according to the judgment matrix;
[0091] S213: Normalize the feature vector to obtain a weight value of each server.
[0092] In order to provide a specific operation step of determining the current load value corresponding to each server according to the hardware parameters, in one or more embodiments of the present invention, the hardware parameters include: hardware usage rate, and the current load value corresponding to each server is determined according to the hardware parameters, such as Figure 4 As shown, including:
[0093] S221: Collecting the hardware usage of each hardware in each server;
[0094] S222: Generate a current load value of the server according to the hardware usage rate.
[0095] In some specific embodiments, the hardware usage includes CPU usage, memory usage, disk usage, and network bandwidth usage.
[0096] For example, the indicators that need to be collected include but are not limited to: CPU usage, memory usage, hard disk usage, bandwidth usage, etc. For example, using the Alibaba Cloud Development Toolkit, RPC remotely calls the cloud monitoring interface directly to collect data. This method can reduce server intrusions and the data does not need to be processed again. The hardware usage of each item changes in real time during server operation. The higher the hardware usage, the higher the server load in the current state. The sum of the weight value of each hardware parameter multiplied by the current load value is used as the server load indicator function Load.
[0097] The current load value calculation formula is as follows:
[0098]
[0099] In formula (1), W i Represents the weight of each hardware indicator, W 1 +W 2 +W 3 +W 4=1; L(CPU) represents CPU usage, L(MEMORY) represents memory usage, L(HD) represents hard disk usage, and L(BANDWIDTH) represents bandwidth usage. Generally speaking, the CPU is responsible for a large number of calculations and should have the highest weight in server hardware. Therefore, a relative value table of indicators can be established (for example, for reference only).
[0100]
[0101]
[0102] According to the values in the table, a judgment matrix can be established, and then the eigenvector of the matrix can be calculated according to the judgment matrix, and then normalized to obtain each W i The value of W is the weight of each hardware indicator. i Will be passed to other modules for use.
[0103] Since different machines in the server group may have inconsistent configurations, it is necessary to quantify these hardware configuration information. Let the current server performance index be C (TOTAL):
[0104] C(TOTAL) = C(CPU) + C(MEMORY) + C(HD) + C(BANDWIDTH) Formula (2)
[0105] Among them, C (CPU), C (MEMORY), C (HD), and C (BANDWIDTH) represent the performance ratios of CPU, memory, hard disk, and bandwidth in the entire service group. The performance ratio is calculated based on the data provided by the supplier. For example, if the CPU computing power provided by different manufacturers A and B is twice that of B, then the performance ratio is considered to be A:B = 2:1. For the memory value, 2GB is twice that of 1GB, and for the hard disk, 7200 rpm is 1.3 times that of 5400 rpm. The hardware weight calculation formula is introduced as follows:
[0106] W(S i ) = CS(S i ) × R(S i ) Formula (3)
[0107] Among them, CS(S i ) represents the performance ratio of the current server in the service group, R(S i ) represents the current remaining performance value of the server.
[0108] in:
[0109]
[0110] In one or more embodiments of the present invention, determining the load information of each server according to the current load value and the weight value of each server includes:
[0111] The current load value and the weight value are multiplied to obtain the load information of each server.
[0112] In one or more embodiments of the present invention, the service data is distributed to each server according to the software resource parameters corresponding to the service data and the load information of each server, such as Figure 5 As shown, including:
[0113] S301: numerically process the software resource parameters to obtain software parameter values;
[0114] S302: Match each service data with a server according to the software resource value and the load information of the server, and then distribute each service data to each server.
[0115] In one or more embodiments of the present invention, in order to specifically illustrate the numerical process of software resource parameters, the software resource parameters include: transaction channel parameters, business complexity, and business attribution program complexity;
[0116] The performing numerical processing on the software resource parameters to obtain software parameter values includes:
[0117] The transaction channel parameters, business complexity and business attribution program complexity are multiplied to obtain the software parameter value.
[0118] In one or more embodiments of the present invention, the determining the load information of each server according to the current load value and the weight value of each server further includes:
[0119] Get the current load imbalance value;
[0120] The load information of each server is determined according to the current load imbalance value, the current load value and the weight value.
[0121] In one or more embodiments of the present invention, it further includes:
[0122] Generates the current load imbalance value.
[0123] In the above embodiment, the software resource parameters are mainly the transaction channels CT (C i ), the complexity of the business itself CC (C i ) and the complexity of the business attribution process CF(C i) three factors. The higher the software resource value, the more it should be allocated to a more idle server for processing. The numerical value formula of software resources is introduced:
[0124] S(Ci) = CT(C i )× CC(C i )× CF(C i ) Formula (4)
[0125] The weight distribution module 31 mainly involves the execution of a recommendation algorithm, and feeds back the execution result to the server for transaction execution distribution. The calculation formula of the load value is introduced here, where p is the load imbalance value, which is a configurable parameter:
[0126]
[0127] In a specific scenario, the present invention may perform the following steps:
[0128] Step 1: Use RPC remote service call to register the service with Zookeeper.
[0129] Step 2: Initialize various services and assign an initial weight W to each server using formula (3).
[0130] Step 3: Start processing requests and set the value to i. The value of i increases with the number of service processing. When the set threshold is reached, the current server load is determined by formula (5).
[0131] Step 4: If the load value is greater than 0, it means that the current server load is uneven. Call the formula to reallocate the server weight W. If the load value is less than or equal to 0, it means that the server is in good condition. Assign the current business to the server for processing and proceed to the next step.
[0132] Step 5: Set the counter i to 0 and return to step 3 until all service requests are completed.
[0133] It can be seen that the present invention solves the problem of slow transaction processing caused by centralized access, high concurrency, how to digitize the differences between hardware brands of different brands, and the timing and value of weight adjustment in the current system. The present invention will also dynamically adjust parameter information according to factors such as the current hardware conditions and program complexity of the server, so as to make the load conditions of each server in the cluster similar and reduce the risk of server "avalanche".
[0134] At the same time, the hardware utilization rate, program complexity, teller familiarity with the business, etc. are used as the current load value. The hardware utilization rate includes CPU utilization rate, memory utilization rate, disk utilization rate, network bandwidth utilization rate, etc., so as to calculate the current load value of the server, which is used as the basic value of the server load; then the weight value of each server is calculated based on the server hardware parameters. During the operation of the program, the system-level online small batch is used to collect and judge the load status of the current service cluster. When the amount of data processed by a server in a period of time is large and reaches the average warning value, the weight of the current server is reduced so that the transaction is routed to other servers with higher weights; if the current server processes fewer transactions, the weight is increased to improve the processing efficiency of the entire service cluster. This method also solves the problems of reducing the intrusion to the server when collecting the current load value of the server; how to digitize the differences between hardware of different brands and the timing and value of weight adjustment.
[0135] It can be understood that the present invention designs a model that can allocate the best processing server for various types of bank transactions, mainly to solve the problem of slow transaction processing on the server caused by centralized access, high concurrency, how to digitize the differences between hardware of different brands, and the timing and value of weight adjustment in some current bank systems.
[0136] The specific advantages are as follows:
[0137] 1. This method uses the utilization rate of various hardware, the complexity of the program, the teller's familiarity with the business, etc. as load factors. The hardware utilization rate includes CPU utilization rate, memory utilization rate, disk utilization rate, network bandwidth utilization rate, etc., so as to calculate the current load value of the server, which is used as the basic value of the server load;
[0138] 2. Calculate the weight of each server based on the server's hardware parameters. During the program's operation, use system-level online small batch collection to determine the load status of the current service cluster. When a server processes a large amount of data over a period of time and reaches the average warning value, reduce the weight of the current server so that transactions are routed to other servers with higher weights; if the current server processes fewer transactions, increase the weight to improve the processing efficiency of the entire service cluster.
[0139] 3. When collecting the server load factor, use a counter to reduce the intrusion into the server; it can also solve problems such as different brands of hardware, digitize their differences, and the timing and value of weight adjustment.
[0140] In order to solve the problem that in the conventional static algorithm in the prior art, various parameters are set in advance when configuring load balancing, and fixed weight values are used for task allocation, which will not change. Even if the server has load imbalance, it will continue to run with the set parameters, and the load of the cluster cannot be dynamically adjusted during the service operation process, in one or more embodiments of the present invention, the present invention provides a service data load balancing method and device, such as Figure 6 As shown, including:
[0141] The acquisition module 11 acquires a plurality of service data to be processed; each service data corresponds to a business service;
[0142] A load information determination module 12, which determines the load information of each server in the server cluster according to the hardware parameters corresponding to the processing of the service data;
[0143] The allocation module 13 allocates the service data to each server according to the software resource parameters corresponding to the service data and the load information of each server, so that each server processes the service data.
[0144] It can be seen from the above technical solution that the present invention provides a service data load balancing method device, which performs load matching by combining corresponding hardware parameters and software resource parameters. When the amount of data processed by a server within a period of time is large and reaches the average warning value, the weight of the current server is reduced, so that the transaction is routed to other servers with higher weights; if the current server processes fewer transactions, the weight is increased to improve the processing efficiency of the entire service cluster.
[0145] Based on the same inventive concept, in a preferred embodiment, the resource parameters include hardware parameters; the load information determination module includes:
[0146] A load weight determination unit, which determines the current load value and weight value corresponding to each server according to the hardware parameters;
[0147] The load information determining unit determines the load information of each server according to the current load value and the weight value of each server.
[0148] Based on the same inventive concept, in a preferred embodiment, the hardware parameter includes a hardware configuration indicator, and the load weight determination unit includes:
[0149] A judgment matrix establishing unit, establishing a judgment matrix according to hardware configuration indicators of each hardware;
[0150] A characteristic vector calculation unit, which calculates the characteristic vector of the matrix according to the judgment matrix;
[0151] The weight value generating unit normalizes the feature vector to obtain the weight value of each server.
[0152] Based on the same inventive concept, in a preferred embodiment, the hardware parameter includes: hardware usage rate, and the load weight determination unit further includes:
[0153] A hardware usage rate collection unit collects the hardware usage rate of each hardware in each server;
[0154] A current load value generating unit generates a current load value of the server according to the hardware usage rate.
[0155] Based on the same inventive concept, in a preferred embodiment, the hardware usage includes CPU usage, memory usage, disk usage and network bandwidth usage.
[0156] Based on the same inventive concept, in a preferred embodiment, the load information determination unit is specifically used to perform product processing on the current load value and the weight value to obtain the load information of each server.
[0157] Based on the same inventive concept, in a preferred embodiment, the allocation module includes:
[0158] A numerical processing unit performs numerical processing on the software resource parameters to obtain software parameter values;
[0159] The matching unit matches each service data with a server according to the software resource value and the load information of the server, and then distributes each service data to each server.
[0160] Based on the same inventive concept, in a preferred embodiment, the software resource parameters include: transaction channel parameters, business complexity, and business attribution program complexity;
[0161] The numerical processing unit is specifically used to perform product processing on the transaction channel parameters, business complexity and business attribution program complexity to obtain the software parameter value.
[0162] Based on the same inventive concept, in a preferred embodiment, the imbalance value obtaining unit obtains the current load imbalance value;
[0163] The load information determination unit is specifically configured to determine the load information of each server according to the current load imbalance value, the current load value and the weight value.
[0164] Based on the same inventive concept, in a preferred embodiment, it also includes:
[0165] The utilization rate of various types of hardware, the complexity of the program, the teller's familiarity with the business, etc. are used as load factors. The hardware utilization rate includes CPU utilization rate, memory utilization rate, disk utilization rate, network bandwidth utilization rate, etc., so as to calculate the current load value of the server, which is used as the basic value of the server load condition.
[0166] From the hardware level, in order to solve the problem that in the configuration of load balancing in the traditional static algorithm in the prior art, various parameters are set in advance, and fixed weight values are used for task allocation, which will not change. Even if the server has a load imbalance, it will continue to run with the set parameters, and the load of the cluster cannot be dynamically adjusted during the service operation process, the present invention provides an embodiment of an electronic device for implementing all or part of the content of the service data load balancing method, and the electronic device specifically includes the following content:
[0167] Figure 7 FIG. 9 is a schematic block diagram of the device structure of the electronic device 9600 according to an embodiment of the present invention. Figure 7 As shown, the electronic device 9600 may include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. It is worth noting that Figure 7 is exemplary; other types of structures may also be used to supplement or replace this structure to implement telecommunication functions or other functions.
[0168] In one embodiment, the service data load balancing method function may be integrated into a central processing unit. The central processing unit may be configured to perform the following control:
[0169] Step S100: Acquire multiple service data to be processed; each service data corresponds to a business service.
[0170] Step S200: Determine the load information of each server in the server cluster according to the hardware parameters corresponding to the service data.
[0171] Step S300: Distribute the service data to each server according to the software resource parameters corresponding to the service data and the load information of each server, so that each server processes the service data.
[0172] It can be seen from the above technical solution that an electronic device provided by the present invention performs load matching by combining corresponding hardware parameters and software resource parameters. When a server processes a large amount of data within a period of time and reaches the average warning value, the weight of the current server is reduced so that transactions are routed to other servers with higher weights; if the current server processes fewer transactions, the weight is increased to improve the processing efficiency of the entire service cluster.
[0173] In another embodiment, the server may be configured separately from the central processor 9100. For example, the server may be a chip connected to the central processor 9100, and the service data load balancing method function may be implemented under the control of the central processor.
[0174] like Figure 7 As shown, the electronic device 9600 may also include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is worth noting that the electronic device 9600 does not necessarily have to include Figure 7 In addition, the electronic device 9600 may also include Figure 7 For components not shown, reference may be made to the prior art.
[0175] like Figure 7 As shown, the central processing unit 9100 is sometimes also referred to as a controller or an operation control, and may include a microprocessor or other processor device and / or logic device. The central processing unit 9100 receives input and controls the operation of various components of the electronic device 9600.
[0176] The memory 9140 may be, for example, one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory or other suitable devices. The above-mentioned information related to the failure may be stored, and a program for executing the relevant information may also be stored. The CPU 9100 may execute the program stored in the memory 9140 to implement information storage or processing, etc.
[0177] The input unit 9120 provides input to the central processing unit 9100. The input unit 9120 is, for example, a key or a touch input device. The power supply 9170 is used to provide power to the electronic device 9600. The display 9160 is used to display display objects such as images and texts. The display may be, for example, an LCD display, but is not limited thereto.
[0178] The memory 9140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be a memory that saves information even when the power is off, can be selectively erased, and is provided with more data, examples of which are sometimes referred to as EPROMs, etc. The memory 9140 may also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application / function storage unit 9142, which is used to store application programs and function programs or processes for executing the operation of the electronic device 9600 through the central processor 9100.
[0179] The memory 9140 may also include a data storage unit 9143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 9144 of the memory 9140 may include various drivers for communication functions of the electronic device and / or for executing other functions of the electronic device (such as messaging applications, address book applications, etc.).
[0180] The communication module 9110 is a transmitter / receiver 9110 that sends and receives signals via an antenna 9111. The communication module (transmitter / receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.
[0181] Based on different communication technologies, multiple communication modules 9110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless LAN module, etc. The communication module (transmitter / receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide an audio output via the speaker 9131 and receive an audio input from the microphone 9132, thereby realizing a common telecommunication function. The audio processor 9130 may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor 9130 is also coupled to the central processor 9100, so that recording can be performed on the local machine through the microphone 9132, and the sound stored on the local machine can be played through the speaker 9131.
[0182] An embodiment of the present invention also provides a computer-readable storage medium capable of implementing all the steps of the service data load balancing method in the above embodiment. A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, it implements all the steps of the service data load balancing method in the above embodiment with the execution subject being a server or a client.
[0183] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0184] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (apparatus), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0185] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0186] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0187] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A service data load balancing method, It is characterized in that include: Acquire multiple service data to be processed; each service data corresponds to a business service; Determining load information of each server in the server cluster according to hardware parameters corresponding to processing the service data; Allocating the service data to each server according to software resource parameters corresponding to the service data and load information of each server, so that each server processes the service data; The allocating the service data to each server according to the software resource parameters corresponding to the service data and the load information of each server includes: Numerically processing the software resource parameters to obtain software parameter values; Matching each service data with a server according to the software parameter value and the load information of the server, and then allocating each service data to each server; The software resource parameters include: transaction channel parameters, business complexity and business attribution program complexity; The performing numerical processing on the software resource parameters to obtain software parameter values includes: Perform product processing on the transaction channel parameter, the business complexity and the business attribution program complexity to obtain the software parameter value; The matching of each service data and the server according to the software parameter value and the load information of the server includes: The current server load is determined by the load determination formula; the sum of the product of the weight value of each hardware parameter and the current load value is used as the server load index function Load, and the load determination formula is expressed as: Among them, Load(S i ) is the load index function of the current server, represents the average value of Load, p is the load imbalance value, is the performance ratio of the current server in the service group, S(C i )=CT(C i )×CC(C i )×CF(C i ) is the software parameter value, CT(C i ) represents the transaction channel, CC(C i ) represents the complexity of the business itself, CF(C i ) represents the complexity of the business attribution procedure.
2. The service data load balancing method according to claim 1, It is characterized in that The determining the load information of each server in the server cluster according to the hardware parameters corresponding to the processing of the service data includes: Determine the current load value and weight value corresponding to each server according to the hardware parameters; The load information of each server is determined according to the current load value and the weight value of each server.
3. The service data load balancing method according to claim 2, It is characterized in that The hardware parameters include hardware configuration indicators, and determining the weight value corresponding to each server according to the hardware parameters includes: Establish a judgment matrix based on the hardware configuration indicators of each hardware; Calculate the eigenvector of the matrix according to the judgment matrix; The feature vector is normalized to obtain a weight value of each server.
4. The service data load balancing method according to claim 3, It is characterized in that The hardware parameters include: hardware utilization rate, and determining the current load value corresponding to each server according to the hardware parameters includes: Collect the hardware usage of each hardware in each server; A current load value of the server is generated according to the hardware usage.
5. The service data load balancing method according to claim 4, It is characterized in that The hardware usage includes CPU usage, memory usage, disk usage and network bandwidth usage.
6. The service data load balancing method according to claim 2, It is characterized in that Determining the load information of each server according to the current load value and the weight value of each server includes: The current load value and the weight value are multiplied to obtain the load information of each server.
7. The service data load balancing method according to claim 3, It is characterized in that The determining the load information of each server according to the current load value and the weight value of each server further includes: Get the current load imbalance value; The load information of each server is determined according to the current load imbalance value, the current load value and the weight value.
8. The service data load balancing method according to claim 7, It is characterized in that Also includes: Generates the current load imbalance value.
9. A service data load balancing device, It is characterized in that include: An acquisition module acquires multiple service data to be processed; each service data corresponds to a business service; A load information determination module, which determines the load information of each server in the server cluster according to the hardware parameters corresponding to the processing of the service data; an allocation module, which allocates the service data to each server according to software resource parameters corresponding to the service data and load information of each server, so that each server processes the service data; The allocation module comprises: A numerical processing unit performs numerical processing on the software resource parameters to obtain software parameter values; A matching unit, matching each service data with a server according to the software parameter value and the load information of the server, and then allocating each service data to each server; The software resource parameters include: transaction channel parameters, business complexity and business attribution program complexity; The numerical processing unit is specifically used to perform product processing on the transaction channel parameter, the business complexity and the business attribution program complexity to obtain the software parameter value; The matching unit is specifically used for: The current server load is determined by the load determination formula; the sum of the product of the weight value of each hardware parameter and the current load value is used as the server load index function Load, and the load determination formula is expressed as: Among them, Load(S i ) is the load index function of the current server, represents the average value of Load, p is the load imbalance value, is the performance ratio of the current server in the service group, S(C i )=CT(C i )×CC(C i )×CF(C i ) is the software parameter value, CT(C i ) represents the transaction channel, CC(C i ) represents the complexity of the business itself, CF(C i ) represents the complexity of the business attribution procedure.
10. The service data load balancing device according to claim 9, It is characterized in that The load information determination module includes: A load weight determination unit, which determines the current load value and weight value corresponding to each server according to the hardware parameters; The load information determining unit determines the load information of each server according to the current load value and the weight value of each server.
11. The service data load balancing device according to claim 10, It is characterized in that The hardware parameters include hardware configuration indicators, and the load weight determination unit includes: A judgment matrix establishing unit, establishing a judgment matrix according to hardware configuration indicators of each hardware; A characteristic vector calculation unit, which calculates the characteristic vector of the matrix according to the judgment matrix; The weight value generating unit normalizes the feature vector to obtain the weight value of each server.
12. The service data load balancing device according to claim 11, It is characterized in that The hardware parameters include: hardware usage rate, and the load weight determination unit also includes: A hardware usage rate collection unit collects the hardware usage rate of each hardware in each server; A current load value generating unit generates a current load value of the server according to the hardware usage rate.
13. The service data load balancing device according to claim 12, It is characterized in that The hardware usage includes CPU usage, memory usage, disk usage and network bandwidth usage.
14. The service data load balancing device according to claim 10, It is characterized in that The load information determination unit is specifically used to perform product processing on the current load value and the weight value to obtain the load information of each server.
15. The service data load balancing device according to claim 11, It is characterized in that An imbalance value obtaining unit, for obtaining a current load imbalance value; The load information determination unit is specifically configured to determine the load information of each server according to the current load imbalance value, the current load value and the weight value.
16. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the method according to any one of claims 1 to 8 is implemented.
17. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.