WO2021012930A1 - Voting node configuration method and system - Google Patents

Voting node configuration method and system Download PDF

Info

Publication number
WO2021012930A1
WO2021012930A1 PCT/CN2020/100099 CN2020100099W WO2021012930A1 WO 2021012930 A1 WO2021012930 A1 WO 2021012930A1 CN 2020100099 W CN2020100099 W CN 2020100099W WO 2021012930 A1 WO2021012930 A1 WO 2021012930A1
Authority
WO
WIPO (PCT)
Prior art keywords
performance index
parameter
voting
preset
master node
Prior art date
Application number
PCT/CN2020/100099
Other languages
French (fr)
Chinese (zh)
Inventor
帖军
黄坤
李子茂
宋中山
尹帆
马尧
罗均
Original Assignee
中南民族大学
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 中南民族大学 filed Critical 中南民族大学
Publication of WO2021012930A1 publication Critical patent/WO2021012930A1/en

Links

Images

Classifications

    • 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
    • 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

Definitions

  • This application relates to the field of computer technology, and in particular to a method and system for configuring voting nodes.
  • the message broadcast mode in distributed clusters basically adopts the "over-half" strategy.
  • This strategy is that ZooKeeper makes a trade-off between availability and consistency to ensure that even if less than half of the servers in the cluster are down, the cluster Can still provide external services.
  • the master node that is, the master server
  • ZooKeeper processes transactional operations in order
  • the master node will only process the next request after the current transactional operation is completed. . Therefore, once the ZooKeeper cluster is larger, the more votes that need to be more than half of the number of votes, the longer it takes for more than half of the votes, and the lower the performance of the ZooKeeper set for transactional operations.
  • the main purpose of this application is to provide a voting node configuration method and system, which aims to solve the technical problem that the prior art cannot effectively configure voting nodes in a distributed cluster.
  • this application provides a voting node configuration method, which includes the following steps:
  • the master node issues parameter collection tasks to at least 2 slave nodes in the distributed cluster where it is located every preset time period;
  • Each of the at least two slave nodes collects performance index parameters of a preset dimension according to the parameter collection task, and feeds back the collected performance index parameters to the master node;
  • the master node calculates the weight of each performance index parameter based on a preset combination algorithm to obtain the index weight corresponding to each performance index parameter;
  • the master node respectively calculates the voting ability corresponding to each slave node according to the index weight and the parameter value corresponding to each performance index parameter;
  • the master node determines the number of voting nodes corresponding to the distributed cluster according to a preset allowable number of downtimes, and selects corresponding votes from the at least two slave nodes according to the number of voting nodes and the voting capacity node.
  • the step of the slave node collecting performance index parameters of a preset dimension according to the parameter collection task, and feeding back the collected performance index parameters to the master node includes the following steps:
  • Reading the processor computing capability parameters included in the parameter collection task where the processor computing capability parameters include: a calculation time limit and a value to be calculated;
  • the disk read rate and the processor computing power are fed back to the master node as performance index parameters.
  • the step of calculating the weight of each performance index parameter by the master node based on a preset combination algorithm to obtain the index weight corresponding to each performance index parameter includes the following steps:
  • the index weight corresponding to each performance index parameter is obtained through a preset Lagrangian optimal multiplier method.
  • the step of obtaining the subjective weight value corresponding to each performance index parameter by the master node through a preset analytic hierarchy process includes the following steps:
  • the element value corresponding to each vector element in the eigenvector is read, and the subjective weight value corresponding to each performance index parameter is determined according to the read element value.
  • the master node after the master node calculates the index weight corresponding to each performance index parameter, it can calculate the voting ability corresponding to each slave node according to the index weight and the parameter value corresponding to each performance index parameter.
  • Step S301 The master node obtains the subjective weight value corresponding to each performance index parameter through the preset analytic hierarchy process.
  • the weight assignment algorithm CRITIC collects the performance index parameters in the ZooKeeper server cluster that affect the voting ability, and then performs dimensionless processing and singularity processing on the collected information, and then analyzes the variability and conflict between the data , And then further determine the weight of each performance index parameter.
  • Singularity refers to the data of a certain index of a certain body far exceeding the same index of that type of individual.
  • the master node will eliminate the detected singular points.
  • G i is the amount of information corresponding to the dimensionless performance index i
  • ⁇ i is the standard deviation corresponding to the dimensionless performance index i
  • r ij is the correlation coefficient between the dimensionless performance index i and j.
  • the correlation coefficient is a statistical indicator used to reflect the closeness of the evaluation indicators to each other, and is usually calculated by the product difference method.
  • W i is the index weight corresponding to the i-th performance index parameter
  • n is the number of performance index parameters
  • W i A is the subjective weight value
  • W i C is the objective weight value
  • the Lagrangian optimal multiplier method is used to calculate the index weight according to the subjective weight value and the objective weight value corresponding to the performance index parameters of the server's voting ability, which can minimize the loss of information and make the final calculated weight value Close to the actual value as much as possible to improve the accuracy of the weight value determination.
  • the step S40 may specifically include:
  • Step S401 The master node separately calculates the voting ability of each slave node according to the index weight and the parameter value corresponding to each performance index parameter through a third preset formula
  • B is the ability to vote
  • a n is the n performance metrics parameters
  • W n is the n performance indicators corresponding to the heavy weight parameter index.
  • FIG. 4 is a schematic diagram of the voting ability evaluation hierarchical relationship model of the third embodiment of the voting node configuration method of this application.
  • the final judgment matrix obtained by the master node is as follows:
  • the master node checks the value of the random consistency index RI in the preset random consistency index table to be 0.58, the CR value of the consistency check result can be calculated:
  • the master node obtains the objective weight value corresponding to each performance index parameter through the preset weight assignment algorithm, including:
  • the master node according to the above first preset formula
  • the fourth preset formula calculates the weight value of each performance index parameter in the voting ability as follows:
  • the fourth preset formula is:
  • the master node Based on the subjective weight value and the objective weight value, the master node obtains the index weight corresponding to each performance index parameter through the preset Lagrangian optimal multiplier method, including:
  • the master node Based on the subjective weight value and the objective weight value, the master node calculates the index weight corresponding to each performance index parameter through the second preset formula:
  • the master node obtains the subjective weight value corresponding to the performance index parameter of the server's voting capability through the AHP method, and obtains the objective weight value corresponding to the performance index parameter of the server's voting capability through the CRITIC method, and then through the Lagrangian multiplier method.
  • the second preset formula calculates the index weight corresponding to each performance index parameter. Because the two weight calculation algorithms are combined, it overcomes the weight value calculation defects of each algorithm and improves the accuracy of the performance index parameter weight value calculation .
  • Figure 5 is a structural block diagram of the first embodiment of the voting node configuration system of this application.
  • the voting node configuration system proposed in the embodiment of the present application includes: a master node 50 and at least two slave nodes (501, 502, 503, etc.), the master node 50 and the at least two slave nodes ( 501, 502, 503) are in a distributed cluster, and the slave node 501 is taken as an example for description below.
  • the master node 50 is configured to deliver parameter collection tasks to at least two slave nodes in the distributed cluster every preset time period;
  • the slave node 501 is configured to collect performance index parameters of a preset dimension according to the parameter collection task, and feed back the collected performance index parameters to the master node 50;
  • the master node 50 is also used to calculate the weight of each performance index parameter based on a preset combination algorithm to obtain the index weight corresponding to each performance index parameter;
  • the master node 50 is further configured to calculate the voting ability corresponding to each slave node according to the index weight and the parameter value corresponding to each performance index parameter;
  • the master node 50 is further configured to determine the number of voting nodes corresponding to the distributed cluster according to a preset allowable number of downtimes, and to obtain the number of voting nodes from the at least two slave nodes according to the number of voting nodes and the voting capacity. Select the corresponding voting node.
  • the master node delivers parameter collection tasks to at least two slave nodes in the distributed cluster where it is located every preset time period; each of the at least two slave nodes collects the performance of the preset dimensions according to the parameter collection task Index parameters, and feed back the collected performance index parameters to the main node; the main node calculates the weight of each performance index parameter based on the preset combination algorithm to obtain the index weight corresponding to each performance index parameter; according to the index weight and each performance index parameter Corresponding parameter values are calculated for the corresponding voting ability of each slave node; then the number of voting nodes corresponding to the distributed cluster is determined according to the preset allowable downtime number, and the corresponding voting node is selected according to the number of voting nodes and voting ability.
  • voting capacity of each slave node is calculated according to the performance index parameters of each slave node and the performance index parameter index weight determined by the combination algorithm, and then voting nodes are screened according to the voting ability, it can ensure that the selected slave nodes have Better working performance, also realized the automatic configuration of voting nodes.
  • the slave node 501 is also used to locally create a target file according to the parameter collection task, perform read and write operations on the target file within a preset time period, and perform read and write operations on the target file according to the statistical total read and write operations.
  • the corresponding disk reading rate is calculated by the number of times; the processor computing capability parameters included in the parameter collection task are read, and the processor computing capability parameters include: a calculation time limit and a value to be calculated; The value to be calculated performs a number of prime number calculation operations, and the corresponding processor computing power is obtained according to the execution result; the disk read rate and the processor computing power are fed back to the master node 50 as performance index parameters.
  • the master node 50 is also used to obtain the subjective weight value corresponding to each performance index parameter through the preset analytic hierarchy process; obtain the objective weight value corresponding to each performance index parameter through the preset weight assignment algorithm; For the subjective weight value and the objective weight value, the index weight corresponding to each performance index parameter is obtained through a preset Lagrangian optimal multiplier method.
  • the master node 50 is also used to construct a corresponding judgment matrix according to various performance index parameters, and calculate the maximum characteristic root and characteristic vector of the judgment matrix; obtain the order corresponding to the judgment matrix, Search for the random consistency evaluation index value corresponding to the order in the preset random consistency index table; calculate the target consistency index value corresponding to the judgment matrix according to the maximum characteristic root and the order; The random consistency evaluation index value and the target consistency index value determine whether the judgment matrix is valid; when the judgment matrix is valid, the element value corresponding to each vector element in the eigenvector is read, and according to the read The element value determines the subjective weight value corresponding to each performance index parameter.
  • the master node 50 is also used to dimensionlessly transform each performance index parameter to obtain a dimensionless performance index, and obtain the correlation coefficient between every two dimensionless performance indicators; According to the standard deviation corresponding to the performance index, the information amount corresponding to each dimensionless performance index is calculated by the first preset formula according to the standard deviation and the correlation coefficient, and the information amount is added to obtain the total amount of information; The amount of information corresponding to the performance index and the total amount of information determine the objective weight value corresponding to each performance index parameter; wherein, the first preset formula is:
  • G i is the amount of information corresponding to the dimensionless performance index i
  • ⁇ i is the standard deviation corresponding to the dimensionless performance index i
  • r ij is the correlation coefficient between the dimensionless performance index i and j.
  • the master node 50 is further configured to calculate the index weight corresponding to each performance index parameter based on the subjective weight value and the objective weight value through a second preset formula; wherein, the second The preset formula is:
  • W i is the index weight corresponding to the i-th performance index parameter
  • n is the number of performance index parameters
  • W i A is the subjective weight value
  • W i C is the objective weight value
  • the master node 50 is further configured to calculate the voting power corresponding to each slave node through a third preset formula according to the index weight and the parameter value corresponding to each performance index parameter; where The third preset formula is:
  • B is the ability to vote
  • a n is the n performance metrics parameters
  • W n is the n performance indicators corresponding to the heavy weight parameter index.
  • the master node 50 is further configured to determine the number of voting nodes corresponding to the distributed cluster according to a preset allowable number of downtimes; and sort the voting capabilities in descending order , And select the slave nodes of the number of voting nodes as voting nodes according to the sorting result.
  • the method of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better. ⁇
  • the technical solution of this application essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as read-only memory/random access
  • the memory, magnetic disk, and optical disk includes several instructions to make a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in the various embodiments of the present application.

Abstract

The present application discloses a voting node configuration method and system, the method comprising: a master node regularly issuing parameter acquisition tasks to at least two slave nodes in a distributed cluster; each of the at least two slave nodes acquiring a performance index parameter and feeding back same to the master node; the master node performing weight calculation on respective performance index parameters on the basis of a preset combined algorithm, so as to obtain index weights corresponding to the respective performance index parameters; calculating voting powers of the respective slave nodes according to the index weights and parameter values corresponding to the respective performance index parameters; and determining, according to a preset allowable number of crashes, the number of voting nodes corresponding to the distributed cluster, and selecting, according to the number of voting nodes and the voting powers, corresponding voting nodes from the at least two slave nodes.

Description

投票节点配置方法及系统Voting node configuration method and system
相关申请的交叉引用Cross references to related applications
本申请要求于2019年7月23日提交中国专利局、申请号为201910670424.1、申请名称为“投票节点配置方法及系统”的中国专利申请的优先权,其全部内容通过引用结合在申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office, application number 201910670424.1, and application name "Voting Node Configuration Method and System" on July 23, 2019, the entire content of which is incorporated into the application by reference.
技术领域Technical field
本申请涉及计算机技术领域,尤其涉及一种投票节点配置方法及系统。This application relates to the field of computer technology, and in particular to a method and system for configuring voting nodes.
背景技术Background technique
目前,分布式集群(例如ZooKeeper集群)中消息广播模式基本采用“过半”策略,这种策略是ZooKeeper在可用性和一致性间做了取舍,保证了即使集群中半数以下的服务器宕机了,集群仍能对外提供服务。在分布式集群中,当主节点(即,主服务器)频繁的发起事务性请求时,由于ZooKeeper对事务性操作是按序处理的,只有当前事务性操作完成后,主节点才会处理下一个请求。因此,一旦ZooKeeper集群规模比较大,那么需要达到过半的投票数就越多,过半投票数多需要的时间就越长,ZooKeeper集对事务性操作的性能就越低。At present, the message broadcast mode in distributed clusters (such as ZooKeeper clusters) basically adopts the "over-half" strategy. This strategy is that ZooKeeper makes a trade-off between availability and consistency to ensure that even if less than half of the servers in the cluster are down, the cluster Can still provide external services. In a distributed cluster, when the master node (that is, the master server) frequently initiates transactional requests, since ZooKeeper processes transactional operations in order, the master node will only process the next request after the current transactional operation is completed. . Therefore, once the ZooKeeper cluster is larger, the more votes that need to be more than half of the number of votes, the longer it takes for more than half of the votes, and the lower the performance of the ZooKeeper set for transactional operations.
而当对于分布式集群中存在多个节点(即,服务器)时,如何配置投票节点和非投票节点并没有一个统一的配置标准。如果采用主观意识的配置方案,可能使集群同步达不到最佳性能,为了寻找最佳配置方案,运维人员必须经过反复的实验,通过数据进行定量分析来得出结果。这种方案虽然可行,但是由于网络波动是频繁的,频繁性地手动配置并不是最佳的手段。When there are multiple nodes (ie, servers) in a distributed cluster, there is no uniform configuration standard for how to configure voting nodes and non-voting nodes. If a subjective configuration scheme is adopted, the cluster synchronization may not achieve the best performance. In order to find the best configuration scheme, the operation and maintenance personnel must go through repeated experiments and quantitatively analyze the data to obtain the results. Although this solution is feasible, since network fluctuations are frequent, frequent manual configuration is not the best method.
上述内容仅用于辅助理解本申请的技术方案,并不代表承认上述内容是现有技术。The above content is only used to assist the understanding of the technical solution of this application, and does not mean that the above content is recognized as prior art.
申请内容Application content
本申请的主要目的在于提供了一种投票节点配置方法及系统,旨在解决现有技术无法有效对分布式集群中的投票节点进行配置的技术问题。The main purpose of this application is to provide a voting node configuration method and system, which aims to solve the technical problem that the prior art cannot effectively configure voting nodes in a distributed cluster.
为实现上述目的,本申请提供了一种投票节点配置方法,所述方法包括以下步骤:In order to achieve the above objective, this application provides a voting node configuration method, which includes the following steps:
主节点每隔预设时间周期向所在分布式集群中的至少2个从节点下发参数采集任务;The master node issues parameter collection tasks to at least 2 slave nodes in the distributed cluster where it is located every preset time period;
所述至少2个从节点中的每个从节点根据所述参数采集任务采集预设维度的性能指标参数,并将采集的性能指标参数反馈至所述主节点;Each of the at least two slave nodes collects performance index parameters of a preset dimension according to the parameter collection task, and feeds back the collected performance index parameters to the master node;
所述主节点基于预设组合算法对各性能指标参数进行权重计算,以获得各性能指标参数对应的指标权重;The master node calculates the weight of each performance index parameter based on a preset combination algorithm to obtain the index weight corresponding to each performance index parameter;
所述主节点根据所述指标权重以及各性能指标参数对应的参数值分别计算每个从节点对应的投票能力;以及The master node respectively calculates the voting ability corresponding to each slave node according to the index weight and the parameter value corresponding to each performance index parameter; and
所述主节点根据预先设定的允许宕机数量确定所述分布式集群对应的投票节点数量,并根据所述投票节点数量以及所述投票能力从所述至少2个从节点中选取对应的投票节点。The master node determines the number of voting nodes corresponding to the distributed cluster according to a preset allowable number of downtimes, and selects corresponding votes from the at least two slave nodes according to the number of voting nodes and the voting capacity node.
在一实施例中,所述从节点根据所述参数采集任务采集预设维度的性能指标参数,并将采集的性能指标参数反馈至所述主节点的步骤包括以下步骤:In an embodiment, the step of the slave node collecting performance index parameters of a preset dimension according to the parameter collection task, and feeding back the collected performance index parameters to the master node includes the following steps:
根据所述参数采集任务在本地创建一目标文件,在预设时段内对所述目标文件执行读写操作,并根据统计的读写总次数计算对应的磁盘读取速率;Create a target file locally according to the parameter collection task, perform read and write operations on the target file within a preset time period, and calculate the corresponding disk read rate according to the total number of reads and writes counted;
读取所述参数采集任务中包含的处理器计算能力参数,所述处理器计算能力参数包括:计算时限以及待计算数值;Reading the processor computing capability parameters included in the parameter collection task, where the processor computing capability parameters include: a calculation time limit and a value to be calculated;
在所述计算时限内对所述待计算数值执行若干次素数求取操作,并根据执行结果获得对应的处理器计算能力;以及Perform a number of prime number calculation operations on the value to be calculated within the calculation time limit, and obtain the corresponding processor computing power according to the execution result; and
将所述磁盘读取速率以及所述处理器计算能力作为性能指标参数反馈至所述主节点。The disk read rate and the processor computing power are fed back to the master node as performance index parameters.
在一实施例中,所述主节点基于预设组合算法对各性能指标参数进行权重计算,以获得各性能指标参数对应的指标权重的步骤包括以下步骤:In one embodiment, the step of calculating the weight of each performance index parameter by the master node based on a preset combination algorithm to obtain the index weight corresponding to each performance index parameter includes the following steps:
通过预设层次分析法获取各性能指标参数对应的主观权重值;Obtain the subjective weight value corresponding to each performance index parameter through the preset analytic hierarchy process;
通过预设权重赋值算法获取各性能指标参数对应的客观权重值;以及Obtain the objective weight value corresponding to each performance index parameter through the preset weight assignment algorithm; and
基于所述主观权重值以及所述客观权重值,通过预设拉格朗日最优乘子法获取各性能指标参数对应的指标权重。Based on the subjective weight value and the objective weight value, the index weight corresponding to each performance index parameter is obtained through a preset Lagrangian optimal multiplier method.
在一实施例中,所述主节点通过预设层次分析法获取各性能指标参数对应的主观权重值的步骤包括以下步骤:In an embodiment, the step of obtaining the subjective weight value corresponding to each performance index parameter by the master node through a preset analytic hierarchy process includes the following steps:
根据各性能指标参数构建对应的判断矩阵,并计算所述判断矩阵的最大特征根以及特征向量;Construct a corresponding judgment matrix according to each performance index parameter, and calculate the maximum eigenvalue and eigenvector of the judgment matrix;
获取所述判断矩阵对应的阶数,在预设随机一致性指标表中查找所述阶数对应的随机一致性评价指标值;Acquiring the order corresponding to the judgment matrix, and searching for the random consistency evaluation index value corresponding to the order in a preset random consistency index table;
根据所述最大特征根以及所述阶数计算所述判断矩阵对应的目标一致性指标值;Calculating the target consistency index value corresponding to the judgment matrix according to the maximum characteristic root and the order;
根据所述随机一致性评价指标值以及所述目标一致性指标值判断所述判断矩阵是否有效;以及Judging whether the judgment matrix is valid according to the random consistency evaluation index value and the target consistency index value; and
在所述判断矩阵有效时,读取所述特征向量中各向量元素对应的元素值,并根据读取的元素值确定各性能指标参数对应的主观权重值。When the judgment matrix is valid, the element value corresponding to each vector element in the eigenvector is read, and the subjective weight value corresponding to each performance index parameter is determined according to the read element value.
在一实施例中,所述主节点通过预设权重赋值算法获取各性能指标参数对应的客观权 重值的步骤包括以下步骤:In an embodiment, the step of obtaining the objective weight value corresponding to each performance index parameter by the master node through a preset weight assignment algorithm includes the following steps:
对各性能指标参数进行无量纲化以获得无量纲性能指标,并获取每两个无量纲性能指标之间的相关系数;Dimensionlessly transform each performance index parameter to obtain a dimensionless performance index, and obtain the correlation coefficient between every two dimensionless performance indexes;
获取各无量纲性能指标对应的标准差,根据所述标准差以及所述相关系数通过第一预设公式计算各无量纲性能指标对应的信息量,并将所述信息量相加获得信息总量;以及Obtain the standard deviation corresponding to each non-dimensional performance index, calculate the information amount corresponding to each non-dimensional performance index through the first preset formula according to the standard deviation and the correlation coefficient, and add the information amount to obtain the total information ;as well as
根据各无量纲性能指标对应的信息量以及所述信息总量确定各性能指标参数对应的客观权重值;其中,所述第一预设公式为:The objective weight value corresponding to each performance index parameter is determined according to the amount of information corresponding to each dimensionless performance index and the total amount of information; wherein, the first preset formula is:
Figure PCTCN2020100099-appb-000001
Figure PCTCN2020100099-appb-000001
式中,G i为无量纲性能指标i对应的信息量,σ i为无量纲性能指标i对应的标准差,r ij为无量纲性能指标i和j之间的相关系数。 In the formula, G i is the amount of information corresponding to the dimensionless performance index i, σ i is the standard deviation corresponding to the dimensionless performance index i, and r ij is the correlation coefficient between the dimensionless performance index i and j.
在一实施例中,所述主节点基于所述主观权重值以及所述客观权重值,通过预设拉格朗日最优乘子法获取各性能指标参数对应的指标权重的步骤包括以下步骤:In an embodiment, the step of obtaining the index weight corresponding to each performance index parameter by the master node based on the subjective weight value and the objective weight value through a preset Lagrangian optimal multiplier method includes the following steps:
基于所述主观权重值以及所述客观权重值,通过第二预设公式计算各性能指标参数对应的指标权重;其中,所述第二预设公式为:Based on the subjective weight value and the objective weight value, the index weight corresponding to each performance index parameter is calculated by a second preset formula; wherein, the second preset formula is:
Figure PCTCN2020100099-appb-000002
Figure PCTCN2020100099-appb-000002
式中,W i为第i个性能指标参数对应的指标权重,n为性能指标参数的个数,W i A为主观权重值,W i C为客观权重值。 In the formula, W i is the index weight corresponding to the i-th performance index parameter, n is the number of performance index parameters, W i A is the subjective weight value, and W i C is the objective weight value.
在一实施例中,所述主节点根据所述指标权重以及各性能指标参数对应的参数值分别计算每个从节点对应的投票能力的步骤包括以下步骤:In an embodiment, the step of the master node separately calculating the voting ability corresponding to each slave node according to the index weight and the parameter value corresponding to each performance index parameter includes the following steps:
根据所述指标权重以及各性能指标参数对应的参数值,通过第三预设公式分别计算每个从节点对应的投票能力;其中,所述第三预设公式为:According to the index weight and the parameter value corresponding to each performance index parameter, the voting ability corresponding to each slave node is calculated through a third preset formula; wherein, the third preset formula is:
B=(a 1,a 2…a n)×[W 1,W 2…W n] B=(a 1 , a 2 …a n )×[W 1 ,W 2 …W n ]
式中,B为投票能力,a n为第n个性能指标参数,W n为第n个性能指标参数对应的指标权重。 Wherein, B is the ability to vote, a n is the n performance metrics parameters, W n is the n performance indicators corresponding to the heavy weight parameter index.
在一实施例中,所述主节点根据预先设定的允许宕机数量确定所述分布式集群对应的投票节点数量,并根据所述投票节点数量以及所述投票能力从所述至少2个从节点中选取对应的投票节点的步骤包括以下步骤:In an embodiment, the master node determines the number of voting nodes corresponding to the distributed cluster according to a preset allowable number of downtimes, and according to the number of voting nodes and the voting capability, the at least two slaves The steps of selecting the corresponding voting node from the nodes include the following steps:
根据预先设定的允许宕机数量确定所述分布式集群对应的投票节点数量;以及Determine the number of voting nodes corresponding to the distributed cluster according to the preset allowable number of downtimes; and
将所述投票能力按从大到小的顺序进行排序,并根据排序结果选取所述投票节点数量的从节点作为投票节点。Sort the voting capabilities in descending order, and select slave nodes of the number of voting nodes as voting nodes according to the sorting result.
此外,为实现上述目的,本申请还提出一种投票节点配置系统,所述系统包括:主节点和至少2个从节点,所述主节点和所述至少2个从节点处于分布式集群中;In addition, in order to achieve the above object, this application also proposes a voting node configuration system, the system includes: a master node and at least two slave nodes, the master node and the at least two slave nodes are in a distributed cluster;
所述主节点,用于每隔预设时间周期向所述分布式集群中的至少2个从节点下发参数采集任务;The master node is configured to deliver parameter collection tasks to at least two slave nodes in the distributed cluster every preset time period;
所述至少2个从节点中的每个从节点,用于根据所述参数采集任务采集预设维度的性能指标参数,并将采集的性能指标参数反馈至所述主节点;Each of the at least two slave nodes is configured to collect performance index parameters of a preset dimension according to the parameter collection task, and feed back the collected performance index parameters to the master node;
所述主节点,还用于基于预设组合算法对各性能指标参数进行权重计算,以获得各性能指标参数对应的指标权重;The master node is also used to calculate the weight of each performance index parameter based on a preset combination algorithm to obtain the index weight corresponding to each performance index parameter;
所述主节点,还用于根据所述指标权重以及各性能指标参数对应的参数值分别计算每个从节点对应的投票能力;以及The master node is also used to calculate the voting power corresponding to each slave node according to the index weight and the parameter value corresponding to each performance index parameter; and
所述主节点,还用于根据预先设定的允许宕机数量确定所述分布式集群对应的投票节点数量,并根据所述投票节点数量以及所述投票能力从所述至少2个从节点中选取对应的投票节点。The master node is also used to determine the number of voting nodes corresponding to the distributed cluster according to a preset allowable number of downtimes, and to select from the at least two slave nodes according to the number of voting nodes and the voting capacity Select the corresponding voting node.
在一实施例中,所述主节点还用于基于预设组合算法对各性能指标参数进行权重计算,以获得各性能指标参数对应的指标权重,包括:In an embodiment, the master node is further configured to calculate the weight of each performance index parameter based on a preset combination algorithm to obtain the index weight corresponding to each performance index parameter, including:
通过预设层次分析法获取各性能指标参数对应的主观权重值;Obtain the subjective weight value corresponding to each performance index parameter through the preset analytic hierarchy process;
通过预设权重赋值算法获取各性能指标参数对应的客观权重值;以及Obtain the objective weight value corresponding to each performance index parameter through the preset weight assignment algorithm; and
基于所述主观权重值以及所述客观权重值,通过预设拉格朗日最优乘子法获取各性能指标参数对应的指标权重。Based on the subjective weight value and the objective weight value, the index weight corresponding to each performance index parameter is obtained through a preset Lagrangian optimal multiplier method.
本申请通过主节点每隔预设时间周期向所在分布式集群中的至少2个从节点下发参数采集任务;从节点根据参数采集任务采集预设维度的性能指标参数,并将采集的性能指标参数反馈至主节点;主节点基于预设组合算法对各性能指标参数进行权重计算,以获得各性能指标参数对应的指标权重;根据指标权重以及各性能指标参数对应的参数值分别计算每个从节点对应的投票能力;再根据预先设定的允许宕机数量确定分布式集群对应的投票节点数量,并根据投票节点数量以及投票能力选取对应的投票节点。由于是根据从节点的性能指标参数以及组合算法确定出的性能指标参数指标权重来计算至少2个从节点的投票能力,然后根据投票能力进行投票节点筛选,从而能够保证筛选出的从节点具有较好的工作性能,也实现了投票节点的自动化配置。In this application, the master node sends parameter collection tasks to at least two slave nodes in the distributed cluster at a preset time period; the slave nodes collect the performance index parameters of the preset dimensions according to the parameter collection task, and the collected performance indicators The parameters are fed back to the master node; the master node calculates the weight of each performance index parameter based on the preset combination algorithm to obtain the index weight corresponding to each performance index parameter; calculates each slave separately according to the index weight and the parameter value corresponding to each performance index parameter The voting capacity corresponding to the node; then the number of voting nodes corresponding to the distributed cluster is determined according to the preset allowable number of downtimes, and the corresponding voting node is selected according to the number of voting nodes and voting capacity. Since the voting capabilities of at least 2 slave nodes are calculated according to the performance index parameters of the slave nodes and the performance index parameter index weights determined by the combination algorithm, and then the voting nodes are screened according to the voting ability, it can ensure that the selected slave nodes have higher Good work performance also realizes the automatic configuration of voting nodes.
附图说明Description of the drawings
图1为本申请投票节点配置方法第一实施例的流程示意图;FIG. 1 is a schematic flowchart of a first embodiment of a method for configuring a voting node of the application;
图2为本申请投票节点配置方法第二实施例的流程示意图;FIG. 2 is a schematic flowchart of a second embodiment of a method for configuring a voting node of the application;
图3为本申请投票节点配置方法第三实施例的流程示意图;FIG. 3 is a schematic flowchart of a third embodiment of a voting node configuration method of the application;
图4为本申请投票节点配置方法第三实施例投票能力评价递阶层次关系模型示意图;FIG. 4 is a schematic diagram of the voting ability evaluation hierarchical relationship model of the third embodiment of the application voting node configuration method;
图5为本申请投票节点系统装置第一实施例的结构框图。Fig. 5 is a structural block diagram of the first embodiment of the voting node system device of this application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics, and advantages of the purpose of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings.
具体实施方式Detailed ways
应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described herein are only used to explain the application, and not used to limit the application.
本申请实施例提供了一种投票节点配置方法,参照图1,图1为本申请投票节点配置方法第一实施例的流程示意图。An embodiment of the present application provides a method for configuring a voting node. Referring to FIG. 1, FIG. 1 is a schematic flowchart of a first embodiment of a method for configuring a voting node in this application.
本实施例中,所述投票节点配置方法包括以下步骤:In this embodiment, the voting node configuration method includes the following steps:
步骤S10:主节点每隔预设时间周期向所在分布式集群中的至少2个从节点下发参数采集任务。Step S10: The master node delivers parameter collection tasks to at least two slave nodes in the distributed cluster where it is located every preset time period.
需要说明的是,本实施例的执行主体可以是分布式应用程序协调服务(Zookeeper)集群中的Leader服务器(即,主节点),在分布式集群中主节点是整个ZooKeeper集群工作机制中的核心。从节点即同一个分布式集群中除主节点外的其它节点。所述参数采集任务可以是主节点发起的参数采集请求或指令。It should be noted that the execution subject of this embodiment may be the Leader server (ie, the master node) in a distributed application coordination service (Zookeeper) cluster. In a distributed cluster, the master node is the core of the entire ZooKeeper cluster working mechanism. . The slave node is the other nodes in the same distributed cluster except the master node. The parameter collection task may be a parameter collection request or instruction initiated by the master node.
本实施例中,预设时间周期可以是预先设定的下发参数采集任务的时间间隔。考虑到实际情况下,每个从节点的计算能力和磁盘读取速度变化不大,网络延时受网络波动相对变化较大。因此,若预设时间周期设置太小,而采集网络延时、计算能力及磁盘读取速度的频率过高会导致不必要的性能消耗,会加重服务器负载。故本实施例可将预设时间周期设置为2小时。当然,对于预设时间周期的具体数值本实施例并不限制。In this embodiment, the preset time period may be a preset time interval for issuing parameter collection tasks. Taking into account the actual situation, the computing power and disk read speed of each slave node does not change much, and the network delay is relatively changed by network fluctuations. Therefore, if the preset time period is set too small, and the frequency of collecting network delay, computing power, and disk reading speed is too high, it will cause unnecessary performance consumption and increase the server load. Therefore, in this embodiment, the preset time period can be set to 2 hours. Of course, the specific value of the preset time period is not limited in this embodiment.
在具体实现中,主节点每隔预设时间周期向所在分布式集群中的至少2个从节点下发参数采集任务,以使每个从节点在接收到该参数采集任务时对其进行响应。In a specific implementation, the master node delivers a parameter collection task to at least two slave nodes in the distributed cluster every preset time period, so that each slave node responds to the parameter collection task when it receives the parameter collection task.
步骤S20:所述至少2个从节点中的每个从节点根据所述参数采集任务采集预设维度的性能指标参数,并将采集的性能指标参数反馈至所述主节点。Step S20: Each of the at least two slave nodes collects performance index parameters of a preset dimension according to the parameter collection task, and feeds back the collected performance index parameters to the master node.
需要说明的是,本实施例中所述预设维度的性能指标参数包括网络延时、CPU计算能力以及磁盘读取速度。由于网络延时需要由主节点计算获得。因此,本步骤中从节点在接收到参数采集任务时,主要是采集CPU计算能力以及磁盘读取速度这两个维度的性能指标参数。It should be noted that the performance index parameters of the preset dimensions in this embodiment include network latency, CPU computing power, and disk read speed. Because the network delay needs to be calculated by the master node. Therefore, when the slave node receives the parameter collection task in this step, it mainly collects the performance index parameters of the two dimensions of CPU computing power and disk reading speed.
在一实施例中,考虑到SysBench是一款开源、跨平台的可用于CPU、磁盘I/0、内存、数据库的多线程性能测试工具,本实施例中从节点可通过Java语言调用SysBench命令获取CPU计算能力和磁盘读取速度。In one embodiment, considering that SysBench is an open source, cross-platform multi-threaded performance testing tool that can be used for CPU, disk I/0, memory, and database, in this embodiment, the slave node can call the SysBench command through Java language to obtain CPU computing power and disk read speed.
具体的,本实施例中从节点可根据所述参数采集任务在本地创建一目标文件,在预设时段内对所述目标文件执行读写操作,并根据统计的读写总次数计算对应的磁盘读取速 率;其中,所述读写操作可包括:顺序写入、顺序重写顺序读取以及随机读取等。Specifically, in this embodiment, the slave node may locally create a target file according to the parameter collection task, perform read and write operations on the target file within a preset time period, and calculate the corresponding disk based on the total number of reads and writes. Reading rate; where the read and write operations may include: sequential writing, sequential rewriting, sequential reading, and random reading.
在采集CPU计算能力时,本实施例从节点还可读取所述参数采集任务中包含的处理器计算能力参数,所述处理器计算能力参数包括:计算时限以及待计算数值;在所述计算时限内对所述待计算数值执行若干次素数求取操作,并根据执行结果获得对应的处理器计算能力;然后将所述磁盘读取速率以及所述处理器计算能力作为性能指标参数反馈至所述主节点。When collecting CPU computing power, the slave node in this embodiment can also read the processor computing power parameters included in the parameter collection task. The processor computing power parameters include: calculation time limit and values to be calculated; Perform several prime number calculation operations on the to-be-calculated value within the time limit, and obtain the corresponding processor computing power according to the execution result; then, the disk read rate and the processor computing power are fed back as performance index parameters to all The main node.
应理解的是,所述素数求取操作即计算某一个数的素数。计算时限即进行素数计算的时间范围。例如待计算数值为100的素数,其计算时限为30秒等。It should be understood that the prime number obtaining operation is to calculate the prime number of a certain number. The calculation time limit is the time range for the prime number calculation. For example, if the value to be calculated is a prime number of 100, the calculation time limit is 30 seconds.
考虑到网络延时需要主节点进行计算获得,因此本实施例中主节点可在下发的参数采集任务中集成同样的ping命令,然后记录该ping命令的发送时间t 1(即,参数采集任务的发送时间)和接收到该ping命令反馈结果的接收时间t 4,再获取每个从节点记录并反馈给主节点的接收到该ping命令的接收时间t 2以及对该ping命令响应结束时将反馈结果返回给客户端时的返回时间t 3,最后主节点根据公式“网络延时=(t 2-t 1)+(t 4-t 3)”即可计算出每个从节点当前的网络延时。 Considering that the network delay needs to be calculated by the master node, the master node in this embodiment can integrate the same ping command in the issued parameter collection task, and then record the sending time t 1 of the ping command (that is, the parameter collection task Sending time) and the receiving time t 4 of receiving the feedback result of the ping command, and then acquiring the record of each slave node and feeding it back to the master node, the receiving time t 2 of receiving the ping command, and the feedback when the response to the ping command ends The return time t 3 when the result is returned to the client. Finally, the master node can calculate the current network delay of each slave node according to the formula "network delay=(t 2 -t 1 )+(t 4 -t 3 )" Time.
在具体实现中,每个从节点根据所述参数采集任务采集预设维度的性能指标参数,并将采集的性能指标参数反馈至所述主节点,由主节点根据这些性能指标参数进行后续的投票能力计算。In specific implementation, each slave node collects performance index parameters of a preset dimension according to the parameter collection task, and feeds back the collected performance index parameters to the master node, and the master node performs subsequent voting according to these performance index parameters Capacity calculation.
步骤S30:所述主节点基于预设组合算法对各性能指标参数进行权重计算,以获得各性能指标参数对应的指标权重。Step S30: The master node calculates the weight of each performance index parameter based on the preset combination algorithm to obtain the index weight corresponding to each performance index parameter.
需要说明的是,本实施例中预设组合算法可以是将层次分析法(Analytic Hierarchy Process,AHP)和权重赋值算法(CRITIC赋值法)进行结合后得到的权重计算策略。It should be noted that the preset combination algorithm in this embodiment may be a weight calculation strategy obtained by combining the Analytic Hierarchy Process (AHP) and the weight assignment algorithm (CRITIC assignment method).
考虑到,层次分析法等主观赋权法的优点是计算过程简单,缺点是主观性比较大。而CRITIC赋值法等客观赋权法的优点是有较强的客观性,缺点在于过分依赖对样本的统计或数学的定量方法,忽略了评价指标的定性分析。因此本实施例将两种算法进行结合,即将主观赋权法和客观赋权法结合起来进行指标权重的计算。具体可以是通过预设层次分析法获取各性能指标参数对应的主观权重值;然后通过预设权重赋值算法获取各性能指标参数对应的客观权重值;再基于所述主观权重值以及所述客观权重值获取各性能指标参数对应的指标权重。Taking into account, the advantage of subjective weighting methods such as AHP is that the calculation process is simple, but the disadvantage is that the subjectivity is relatively large. The advantage of objective weighting methods such as CRITIC assignment method is that it has strong objectivity, but the disadvantage is that it relies too much on the statistical or mathematical quantitative methods of the sample, and ignores the qualitative analysis of evaluation indicators. Therefore, this embodiment combines the two algorithms, that is, the subjective weighting method and the objective weighting method are combined to calculate the index weight. Specifically, the subjective weight value corresponding to each performance indicator parameter can be obtained through the preset analytic hierarchy process; then the objective weight value corresponding to each performance indicator parameter is obtained through the preset weight assignment algorithm; and then based on the subjective weight value and the objective weight Value to obtain the index weight corresponding to each performance index parameter.
在具体实现中,主节点在获取到性能指标参数后,即可基于预先设置的组合算法对各性能指标参数进行权重计算,从而获得各性能指标参数(网络延时、CPU计算能力以及磁盘读取速度等)对应的指标权重。In the specific implementation, after the master node obtains the performance index parameters, it can calculate the weight of each performance index parameter based on the preset combination algorithm, so as to obtain the performance index parameters (network delay, CPU computing power and disk read Speed, etc.) corresponding to the index weight.
步骤S40:所述主节点根据所述指标权重以及各性能指标参数对应的参数值分别计算 每个从节点对应的投票能力。Step S40: The master node calculates the voting ability corresponding to each slave node according to the index weight and the parameter value corresponding to each performance index parameter.
应理解的是,所谓投票能力主要用于表征节点的数据同步效率,投票能力强的节点其对应的数据同步以及处理效率相对较高。It should be understood that the so-called voting ability is mainly used to characterize the data synchronization efficiency of nodes, and nodes with strong voting ability have relatively high corresponding data synchronization and processing efficiency.
在具体实现中,主节点在计算出各性能指标参数对应的指标权重后,即可根据所述指标权重以及各性能指标参数对应的参数值分别计算每个从节点对应的投票能力。In specific implementation, after the master node calculates the index weight corresponding to each performance index parameter, it can calculate the voting ability corresponding to each slave node according to the index weight and the parameter value corresponding to each performance index parameter.
步骤S50:所述主节点根据预先设定的允许宕机数量确定所述分布式集群对应的投票节点数量,并根据所述投票节点数量以及所述投票能力从所述从节点中选取对应的投票节点。Step S50: The master node determines the number of voting nodes corresponding to the distributed cluster according to the preset allowable number of downtimes, and selects corresponding votes from the slave nodes according to the number of voting nodes and the voting capacity node.
应理解的是,所述允许宕机数量,即分布式集群中允许出现故障的节点数量。通常情况下,分布式集群中能够正常工作的节点数量需要占集群节点总数的一半加一个,即(n/2)+1个,n为节点总数。因此本实施例中所述允许宕机数量不能超过(n/2)-1个,所述投票节点数量至少为(n/2)+1个,其具体数值不做限制。It should be understood that the allowable number of downtimes refers to the number of nodes that are allowed to fail in a distributed cluster. Normally, the number of nodes that can work normally in a distributed cluster needs to account for half of the total number of cluster nodes plus one, that is, (n/2)+1, where n is the total number of nodes. Therefore, the number of allowed downtimes in this embodiment cannot exceed (n/2)-1, the number of voting nodes is at least (n/2)+1, and the specific value is not limited.
在具体实现中,主节点根据预先设定的允许宕机数量确定所述分布式集群对应的投票节点数量;然后将所述投票能力按从大到小的顺序进行排序,并根据排序结果选取所述投票节点数量的从节点作为投票节点。In specific implementation, the master node determines the number of voting nodes corresponding to the distributed cluster according to the preset allowable number of downtimes; then, the voting capacity is sorted in descending order, and selected according to the sorting result. The slave nodes with the stated number of voting nodes are regarded as voting nodes.
本实施例通过主节点每隔预设时间周期向所在分布式集群中的至少2个从节点下发参数采集任务;至少2个从节点中的每个从节点根据参数采集任务采集预设维度的性能指标参数,并将采集的性能指标参数反馈至主节点;主节点基于预设组合算法对各性能指标参数进行权重计算,以获得各性能指标参数对应的指标权重;根据指标权重以及各性能指标参数对应的参数值分别计算每个从节点对应的投票能力;再根据预先设定的允许宕机数量确定分布式集群对应的投票节点数量,并根据投票节点数量以及投票能力选取对应的投票节点。由于是根据每个从节点的性能指标参数以及组合算法确定出的性能指标参数指标权重来计算每个从节点的投票能力,然后根据投票能力进行投票节点筛选,从而能够保证筛选出的从节点具有较好的工作性能,也实现了投票节点的自动化配置。In this embodiment, the master node delivers parameter collection tasks to at least two slave nodes in the distributed cluster every preset time period; each slave node of the at least two slave nodes collects parameters of preset dimensions according to the parameter collection task. Performance index parameters, and feedback the collected performance index parameters to the master node; the master node calculates the weight of each performance index parameter based on the preset combination algorithm to obtain the index weight corresponding to each performance index parameter; according to the index weight and each performance index The parameter value corresponding to the parameter calculates the voting capacity corresponding to each slave node; then the number of voting nodes corresponding to the distributed cluster is determined according to the preset allowable downtime number, and the corresponding voting node is selected according to the number of voting nodes and voting capacity. Since the voting capacity of each slave node is calculated according to the performance index parameters of each slave node and the performance index parameter index weight determined by the combination algorithm, and then voting nodes are screened according to the voting ability, it can ensure that the selected slave nodes have Better working performance, also realized the automatic configuration of voting nodes.
参考图2,图2为本申请投票节点配置方法第二实施例的流程示意图。Referring to FIG. 2, FIG. 2 is a schematic flowchart of a second embodiment of a voting node configuration method of this application.
基于上述第一实施例,在本实施例中,所述步骤S30包括:Based on the foregoing first embodiment, in this embodiment, the step S30 includes:
步骤S301:所述主节点通过预设层次分析法获取各性能指标参数对应的主观权重值。Step S301: The master node obtains the subjective weight value corresponding to each performance index parameter through the preset analytic hierarchy process.
应理解的是,层次分析法通常将决策问题分为目标层、准则层和方案层,根据各因素的性质不同进行分类并建立层次关系模型。在层次关系结构中,目标层是最高层,表示解决问题的目的,即层次分析需要达到的最终目标。本实施例中的目标层为各ZooKeeper服务器(即,从节点)的投票能力。准则层是中间层,表示采取某种措施、方案来实现最终目标所需要的中间环节。本实施例中的准则层主要有系统性能指标和网络性能指标。方案 层是最下层,表示评价、排序、选择的对象。在建立上述层次关系模型后,主节点还将构造判断矩阵,然后根据构造的判断矩阵进行权重计算。It should be understood that the analytic hierarchy process usually divides the decision-making problem into the target layer, the criterion layer and the scheme layer, and classifies and establishes a hierarchical relationship model according to the nature of each factor. In the hierarchical relationship structure, the target level is the highest level, which represents the purpose of solving the problem, that is, the ultimate goal that the level analysis needs to achieve. The target layer in this embodiment is the voting capability of each ZooKeeper server (ie, slave node). The criterion layer is the middle layer, which represents the intermediate links needed to take certain measures and programs to achieve the ultimate goal. The criterion layer in this embodiment mainly includes system performance indicators and network performance indicators. The plan layer is the lowest layer, representing the objects of evaluation, ranking, and selection. After establishing the above-mentioned hierarchical relationship model, the master node will also construct a judgment matrix, and then perform weight calculations based on the constructed judgment matrix.
具体的,主节点可根据各性能指标参数构建对应的判断矩阵,并计算所述判断矩阵的最大特征根以及特征向量;然后获取所述判断矩阵对应的阶数,在预设随机一致性指标表中查找所述阶数对应的随机一致性评价指标值;再根据所述最大特征根以及所述阶数计算所述判断矩阵对应的目标一致性指标值;然后根据所述随机一致性评价指标值以及所述目标一致性指标值判断所述判断矩阵是否有效;最后在所述判断矩阵有效时,读取所述特征向量中各向量元素对应的元素值,并根据读取的元素值确定各性能指标参数对应的主观权重值。Specifically, the master node can construct a corresponding judgment matrix according to each performance index parameter, and calculate the maximum eigenvalue and eigenvector of the judgment matrix; then obtain the order corresponding to the judgment matrix, and preset the random consistency index table Find the random consistency evaluation index value corresponding to the order; then calculate the target consistency index value corresponding to the judgment matrix according to the maximum characteristic root and the order; then according to the random consistency evaluation index value And the target consistency index value judges whether the judgment matrix is valid; finally, when the judgment matrix is valid, the element value corresponding to each vector element in the feature vector is read, and each performance is determined according to the read element value The subjective weight value corresponding to the indicator parameter.
例如,主节点可采用9度标度法对网络延时、计算能力以及磁盘读取速度这三个性能指标参数建立判断矩阵。判断矩阵表示的是各准则或各方案之间的相对重要程度,这与层次分析法相同。首先不考虑集群服务器(方案)对评价过程的影响,依次评价上述三个单项指标之间的两两关系,从而可以得到一个3×3的判断矩阵,然后计算该判断矩阵的最大特征根以及特征向量,再通过一致性验证来检测判断矩阵是否有效。若有效则读取特征向量中各向量元素对应的元素值,并根据读取的元素值确定各性能指标参数对应的主观权重值。For example, the master node can use the 9-degree scale method to establish a judgment matrix for the three performance index parameters of network delay, computing power, and disk read speed. The judgement matrix expresses the relative importance of each criterion or scheme, which is the same as the analytic hierarchy process. First, regardless of the impact of the cluster server (scheme) on the evaluation process, evaluate the pairwise relationship between the above three individual indicators in turn, so that a 3×3 judgment matrix can be obtained, and then the maximum characteristic root and feature of the judgment matrix are calculated Vector, and then verify whether the judgment matrix is valid through consistency verification. If it is valid, read the element value corresponding to each vector element in the feature vector, and determine the subjective weight value corresponding to each performance index parameter according to the read element value.
步骤S302:所述主节点通过预设权重赋值算法获取各性能指标参数对应的客观权重值。Step S302: The master node obtains the objective weight value corresponding to each performance index parameter through a preset weight assignment algorithm.
应理解的是,权重赋值算法CRITIC是对ZooKeeper服务器集群中影响投票能力的性能指标参数进行收集,然后对收集的信息进行无量纲化处理以及奇异点处理,进而分析数据间的变异性和冲突性,再进一步确定各性能指标参数的权重。奇异点是指某个体的某一指标远超该类个体的同项指标的数据。本实施例中主节点将对检测出的奇异点进行剔除。It should be understood that the weight assignment algorithm CRITIC collects the performance index parameters in the ZooKeeper server cluster that affect the voting ability, and then performs dimensionless processing and singularity processing on the collected information, and then analyzes the variability and conflict between the data , And then further determine the weight of each performance index parameter. Singularity refers to the data of a certain index of a certain body far exceeding the same index of that type of individual. In this embodiment, the master node will eliminate the detected singular points.
具体的,主节点可先对性能指标参数进行奇异点检测,根据检测结果将性能指标参数对应数据中的奇异点剔除,然后对各性能指标参数进行无量纲化以获得无量纲性能指标,并获取每两个无量纲性能指标之间的相关系数;再获取各无量纲性能指标对应的标准差,根据所述标准差以及所述相关系数通过第一预设公式计算各无量纲性能指标对应的信息量,并将所述信息量相加获得信息总量,最后根据各无量纲性能指标对应的信息量以及所述信息总量确定各性能指标参数对应的客观权重值;其中,所述第一预设公式为:Specifically, the master node can first perform singular point detection on the performance index parameters, remove the singular points in the data corresponding to the performance index parameters according to the detection results, and then non-dimensionalize each performance index parameter to obtain the dimensionless performance index, and obtain The correlation coefficient between every two dimensionless performance indicators; then obtain the standard deviation corresponding to each dimensionless performance indicator, and calculate the information corresponding to each dimensionless performance indicator through the first preset formula according to the standard deviation and the correlation coefficient The amount of information is added up to obtain the total amount of information, and finally the objective weight value corresponding to each performance index parameter is determined according to the amount of information corresponding to each dimensionless performance index and the total amount of information; wherein, the first prediction Let the formula be:
Figure PCTCN2020100099-appb-000003
Figure PCTCN2020100099-appb-000003
式中,G i为无量纲性能指标i对应的信息量,σ i为无量纲性能指标i对应的标准差,r ij为无量纲性能指标i和j之间的相关系数。 In the formula, G i is the amount of information corresponding to the dimensionless performance index i, σ i is the standard deviation corresponding to the dimensionless performance index i, and r ij is the correlation coefficient between the dimensionless performance index i and j.
应理解的是,相关系数是用来反映评价指标相互之间密切程度的统计指标,通常用积差方法计算。It should be understood that the correlation coefficient is a statistical indicator used to reflect the closeness of the evaluation indicators to each other, and is usually calculated by the product difference method.
步骤S303:所述主节点基于所述主观权重值以及所述客观权重值,通过预设拉格朗日最优乘子法获取各性能指标参数对应的指标权重。Step S303: Based on the subjective weight value and the objective weight value, the master node obtains the index weight corresponding to each performance index parameter through a preset Lagrangian optimal multiplier method.
在具体实现中,主节点在通过AHP法得到服务器投票能力的性能指标参数对应的主观权重值,以及通过CRITIC法得到服务器投票能力的性能指标参数对应的客观权重值后,即可通过拉格朗日乘子法即第二预设公式计算各性能指标参数对应的指标权重;In specific implementation, after the master node obtains the subjective weight value corresponding to the performance index parameter of the server's voting ability through the AHP method, and the objective weight value corresponding to the performance indicator parameter of the server's voting capability through the CRITIC method, it can pass Lagrang The daily multiplier method is the second preset formula to calculate the index weight corresponding to each performance index parameter;
其中,所述第二预设公式为:Wherein, the second preset formula is:
Figure PCTCN2020100099-appb-000004
Figure PCTCN2020100099-appb-000004
式中,W i为第i个性能指标参数对应的指标权重,n为性能指标参数的个数,W i A为主观权重值,W i C为客观权重值。 In the formula, W i is the index weight corresponding to the i-th performance index parameter, n is the number of performance index parameters, W i A is the subjective weight value, and W i C is the objective weight value.
本实施例通过拉格朗日最优乘子法根据服务器投票能力的性能指标参数分别对应的主观权重值和客观权重值计算指标权重,可以最大限度减少信息的损失,使最终计算出的权重值尽可能地接近实际的值,提高权重值确定的准确性。In this embodiment, the Lagrangian optimal multiplier method is used to calculate the index weight according to the subjective weight value and the objective weight value corresponding to the performance index parameters of the server's voting ability, which can minimize the loss of information and make the final calculated weight value Close to the actual value as much as possible to improve the accuracy of the weight value determination.
参考图3,图3为本申请投票节点配置方法第三实施例的流程示意图。Referring to FIG. 3, FIG. 3 is a schematic flowchart of a third embodiment of a voting node configuration method of this application.
基于上述各实施例,在本实施例中,所述步骤S40可具体包括:Based on the foregoing embodiments, in this embodiment, the step S40 may specifically include:
步骤S401:所述主节点根据所述指标权重以及各性能指标参数对应的参数值,通过第三预设公式分别计算每个从节点对应的投票能力;Step S401: The master node separately calculates the voting ability of each slave node according to the index weight and the parameter value corresponding to each performance index parameter through a third preset formula;
其中,所述第三预设公式为:Wherein, the third preset formula is:
B=(a 1,a 2…a n)×[W 1,W 2…W n] B=(a 1 , a 2 …a n )×[W 1 ,W 2 …W n ]
式中,B为投票能力,a n为第n个性能指标参数,W n为第n个性能指标参数对应的指标权重。 Wherein, B is the ability to vote, a n is the n performance metrics parameters, W n is the n performance indicators corresponding to the heavy weight parameter index.
在具体实现中,主节点在获取到各性能参数对应的参数值和指标权重后,即可按照上述公式计算从节点对应的投票能力。In specific implementation, after the master node obtains the parameter value and index weight corresponding to each performance parameter, it can calculate the voting ability corresponding to the slave node according to the above formula.
下面结合具体例子对本实施例及上述各实施例进行说明。The present embodiment and the foregoing embodiments will be described below in conjunction with specific examples.
参考图4,图4为本申请投票节点配置方法第三实施例投票能力评价递阶层次关系模型示意图。Referring to FIG. 4, FIG. 4 is a schematic diagram of the voting ability evaluation hierarchical relationship model of the third embodiment of the voting node configuration method of this application.
(1)主节点通过预设层次分析法获取各性能指标参数对应的主观权重值的步骤如下:(1) The steps for the master node to obtain the subjective weight value corresponding to each performance index parameter through the preset analytic hierarchy process are as follows:
如图4所示,本实施例先针对ZooKeeper服务器节点的投票能力建立层次关系模型。 对于图4准则层中的性能指标参数(网络延时、处理器计算能力以及磁盘读取速率),本实施例应用多个相关领域知识的多专家分别独立构造出判断矩阵,然后采用几何平均法构造出的最终判断矩阵如表1所示,表1为性能指标参数判断矩阵。As shown in FIG. 4, this embodiment first establishes a hierarchical relationship model for the voting capabilities of ZooKeeper server nodes. For the performance index parameters (network latency, processor computing power, and disk read rate) in the criterion layer in Figure 4, this embodiment uses multiple experts with knowledge in related fields to independently construct a judgment matrix, and then uses the geometric average method The final judgment matrix constructed is shown in Table 1, which is the judgment matrix of performance index parameters.
表1性能指标参数判断矩阵Table 1 Performance index parameter judgment matrix
Figure PCTCN2020100099-appb-000005
Figure PCTCN2020100099-appb-000005
即主节点最终获得的判断矩阵如下:That is, the final judgment matrix obtained by the master node is as follows:
Figure PCTCN2020100099-appb-000006
Figure PCTCN2020100099-appb-000006
主节点根据构造出的判断矩阵A计算出A的最大特征根为:λ max=3.013,特征向量W A和目标一致性指标CI分别为: The master node calculates the maximum characteristic root of A according to the constructed judgment matrix A as: λ max =3.013, and the characteristic vector W A and the target consistency index CI are respectively:
W A=[W 1,W 2,W 3]=[0.8158,0.1027,0.0815] W A =[W 1 ,W 2 ,W 3 ]=[0.8158,0.1027,0.0815]
Figure PCTCN2020100099-appb-000007
Figure PCTCN2020100099-appb-000007
假设主节点在预设随机一致性指标表查得随机一致性指标RI的值为0.58,则可计算出一致性校验结果CR值为:Assuming that the master node checks the value of the random consistency index RI in the preset random consistency index table to be 0.58, the CR value of the consistency check result can be calculated:
Figure PCTCN2020100099-appb-000008
Figure PCTCN2020100099-appb-000008
由于CR值小于0.1则可判定判断矩阵A满足一致性,即判断矩阵A有效。Since the CR value is less than 0.1, it can be determined that the judgment matrix A meets the consistency, that is, the judgment matrix A is valid.
(2)主节点通过预设权重赋值算法获取各性能指标参数对应的客观权重值的步骤,包括:(2) The master node obtains the objective weight value corresponding to each performance index parameter through the preset weight assignment algorithm, including:
主节点在分布式集群中轮流调整主节点,并收集100组衡量投票能力的性能参数指标信息。如表2所示,表2为性能指标参数数据。The master node adjusts the master node in turn in the distributed cluster, and collects 100 sets of performance parameter index information for measuring voting ability. As shown in Table 2, Table 2 is the performance index parameter data.
表2性能指标参数数据Table 2 Performance index parameter data
Figure PCTCN2020100099-appb-000009
Figure PCTCN2020100099-appb-000009
Figure PCTCN2020100099-appb-000010
Figure PCTCN2020100099-appb-000010
对上述100组数据,进行奇异点检测和无量纲化处理后得到的数据如表3所示,表3为无量纲化处理后的性能指标参数数据。For the above-mentioned 100 sets of data, the data obtained after singular point detection and dimensionless processing are shown in Table 3. Table 3 is the performance index parameter data after dimensionless processing.
表3无量纲化处理后的性能指标参数数据Table 3 Performance index parameter data after dimensionless treatment
Figure PCTCN2020100099-appb-000011
Figure PCTCN2020100099-appb-000011
主节点以两个指标与各自平均值的离差为基础,通过两个乘积相乘来计算两个指标的相关系数,得到相关系数矩阵M如下:The main node is based on the deviation of the two indicators from the respective averages, and the correlation coefficients of the two indicators are calculated by multiplying the two products, and the correlation coefficient matrix M is obtained as follows:
Figure PCTCN2020100099-appb-000012
Figure PCTCN2020100099-appb-000012
然后主节点根据上述第一预设公式
Figure PCTCN2020100099-appb-000013
和第四预设公式计算出投票能力中各性能指标参数的权重值如下:
Then the master node according to the above first preset formula
Figure PCTCN2020100099-appb-000013
And the fourth preset formula calculates the weight value of each performance index parameter in the voting ability as follows:
W C=[W 1,W 2,W 3]=[0.8253,0.0388,0.0359] W C =[W 1 ,W 2 ,W 3 ]=[0.8253,0.0388,0.0359]
其中,所述第四预设公式为:
Figure PCTCN2020100099-appb-000014
Wherein, the fourth preset formula is:
Figure PCTCN2020100099-appb-000014
(3)主节点基于所述主观权重值以及所述客观权重值,通过预设拉格朗日最优乘子 法获取各性能指标参数对应的指标权重的步骤,包括:(3) Based on the subjective weight value and the objective weight value, the master node obtains the index weight corresponding to each performance index parameter through the preset Lagrangian optimal multiplier method, including:
主节点基于所述主观权重值以及所述客观权重值,通过上述第二预设公式分别计算各性能指标参数对应的指标权重:Based on the subjective weight value and the objective weight value, the master node calculates the index weight corresponding to each performance index parameter through the second preset formula:
W=[0.7638,0.1858,0.0504]W=[0.7638,0.1858,0.0504]
本实施例主节点通过AHP法得到服务器投票能力的性能指标参数对应的主观权重值,通过CRITIC法得到服务器投票能力的性能指标参数对应的客观权重值后,再通过拉格朗日乘子法即第二预设公式计算各性能指标参数对应的指标权重,由于是将两种权重计算算法进行组合从而克服了每一种算法存在的权重值计算缺陷,提高了性能指标参数权重值计算的准确性。In this embodiment, the master node obtains the subjective weight value corresponding to the performance index parameter of the server's voting capability through the AHP method, and obtains the objective weight value corresponding to the performance index parameter of the server's voting capability through the CRITIC method, and then through the Lagrangian multiplier method. The second preset formula calculates the index weight corresponding to each performance index parameter. Because the two weight calculation algorithms are combined, it overcomes the weight value calculation defects of each algorithm and improves the accuracy of the performance index parameter weight value calculation .
参照图5,图5为本申请投票节点配置系统第一实施例的结构框图。Referring to Figure 5, Figure 5 is a structural block diagram of the first embodiment of the voting node configuration system of this application.
如图5所示,本申请实施例提出的投票节点配置系统包括:主节点50和至少2个从节点(501、502、503等),所述主节点50和所述至少2个从节点(501、502、503)处于分布式集群中,下面以从节点501为例进行说明。As shown in Figure 5, the voting node configuration system proposed in the embodiment of the present application includes: a master node 50 and at least two slave nodes (501, 502, 503, etc.), the master node 50 and the at least two slave nodes ( 501, 502, 503) are in a distributed cluster, and the slave node 501 is taken as an example for description below.
所述主节点50,用于每隔预设时间周期向所述分布式集群中的至少2个从节点下发参数采集任务;The master node 50 is configured to deliver parameter collection tasks to at least two slave nodes in the distributed cluster every preset time period;
所述从节点501,用于根据所述参数采集任务采集预设维度的性能指标参数,并将采集的性能指标参数反馈至所述主节点50;The slave node 501 is configured to collect performance index parameters of a preset dimension according to the parameter collection task, and feed back the collected performance index parameters to the master node 50;
所述主节点50,还用于基于预设组合算法对各性能指标参数进行权重计算,以获得各性能指标参数对应的指标权重;The master node 50 is also used to calculate the weight of each performance index parameter based on a preset combination algorithm to obtain the index weight corresponding to each performance index parameter;
所述主节点50,还用于根据所述指标权重以及各性能指标参数对应的参数值分别计算每个从节点对应的投票能力;以及The master node 50 is further configured to calculate the voting ability corresponding to each slave node according to the index weight and the parameter value corresponding to each performance index parameter; and
所述主节点50,还用于根据预先设定的允许宕机数量确定所述分布式集群对应的投票节点数量,并根据所述投票节点数量以及所述投票能力从所述至少2个从节点中选取对应的投票节点。The master node 50 is further configured to determine the number of voting nodes corresponding to the distributed cluster according to a preset allowable number of downtimes, and to obtain the number of voting nodes from the at least two slave nodes according to the number of voting nodes and the voting capacity. Select the corresponding voting node.
本实施例主节点每隔预设时间周期向所在分布式集群中的至少2个从节点下发参数采集任务;至少2个从节点中的每个从节点根据参数采集任务采集预设维度的性能指标参数,并将采集的性能指标参数反馈至主节点;主节点基于预设组合算法对各性能指标参数进行权重计算,以获得各性能指标参数对应的指标权重;根据指标权重以及各性能指标参数对应的参数值分别计算每个从节点对应的投票能力;再根据预先设定的允许宕机数量确定分布式集群对应的投票节点数量,并根据投票节点数量以及投票能力选取对应的投票节点。由于是根据每个从节点的性能指标参数以及组合算法确定出的性能指标参数指标权重来计算每个从节点的投票能力,然后根据投票能力进行投票节点筛选,从而能够保证筛选出 的从节点具有较好的工作性能,也实现了投票节点的自动化配置。In this embodiment, the master node delivers parameter collection tasks to at least two slave nodes in the distributed cluster where it is located every preset time period; each of the at least two slave nodes collects the performance of the preset dimensions according to the parameter collection task Index parameters, and feed back the collected performance index parameters to the main node; the main node calculates the weight of each performance index parameter based on the preset combination algorithm to obtain the index weight corresponding to each performance index parameter; according to the index weight and each performance index parameter Corresponding parameter values are calculated for the corresponding voting ability of each slave node; then the number of voting nodes corresponding to the distributed cluster is determined according to the preset allowable downtime number, and the corresponding voting node is selected according to the number of voting nodes and voting ability. Since the voting capacity of each slave node is calculated according to the performance index parameters of each slave node and the performance index parameter index weight determined by the combination algorithm, and then voting nodes are screened according to the voting ability, it can ensure that the selected slave nodes have Better working performance, also realized the automatic configuration of voting nodes.
基于本申请上述投票节点配置系统第一实施例,提出本申请投票节点配置系统的第二实施例。Based on the first embodiment of the voting node configuration system of the present application, a second embodiment of the voting node configuration system of the present application is proposed.
在本实施例中,所述从节点501,还用于根据所述参数采集任务在本地创建一目标文件,在预设时段内对所述目标文件执行读写操作,并根据统计的读写总次数计算对应的磁盘读取速率;读取所述参数采集任务中包含的处理器计算能力参数,所述处理器计算能力参数包括:计算时限以及待计算数值;在所述计算时限内对所述待计算数值执行若干次素数求取操作,并根据执行结果获得对应的处理器计算能力;将所述磁盘读取速率以及所述处理器计算能力作为性能指标参数反馈至所述主节点50。In this embodiment, the slave node 501 is also used to locally create a target file according to the parameter collection task, perform read and write operations on the target file within a preset time period, and perform read and write operations on the target file according to the statistical total read and write operations. The corresponding disk reading rate is calculated by the number of times; the processor computing capability parameters included in the parameter collection task are read, and the processor computing capability parameters include: a calculation time limit and a value to be calculated; The value to be calculated performs a number of prime number calculation operations, and the corresponding processor computing power is obtained according to the execution result; the disk read rate and the processor computing power are fed back to the master node 50 as performance index parameters.
在一实施例中,所述主节点50,还用于通过预设层次分析法获取各性能指标参数对应的主观权重值;通过预设权重赋值算法获取各性能指标参数对应的客观权重值;基于所述主观权重值以及所述客观权重值,通过预设拉格朗日最优乘子法获取各性能指标参数对应的指标权重。In one embodiment, the master node 50 is also used to obtain the subjective weight value corresponding to each performance index parameter through the preset analytic hierarchy process; obtain the objective weight value corresponding to each performance index parameter through the preset weight assignment algorithm; For the subjective weight value and the objective weight value, the index weight corresponding to each performance index parameter is obtained through a preset Lagrangian optimal multiplier method.
在一实施例中,所述主节点50,还用于根据各性能指标参数构建对应的判断矩阵,并计算所述判断矩阵的最大特征根以及特征向量;获取所述判断矩阵对应的阶数,在预设随机一致性指标表中查找所述阶数对应的随机一致性评价指标值;根据所述最大特征根以及所述阶数计算所述判断矩阵对应的目标一致性指标值;根据所述随机一致性评价指标值以及所述目标一致性指标值判断所述判断矩阵是否有效;在所述判断矩阵有效时,读取所述特征向量中各向量元素对应的元素值,并根据读取的元素值确定各性能指标参数对应的主观权重值。In an embodiment, the master node 50 is also used to construct a corresponding judgment matrix according to various performance index parameters, and calculate the maximum characteristic root and characteristic vector of the judgment matrix; obtain the order corresponding to the judgment matrix, Search for the random consistency evaluation index value corresponding to the order in the preset random consistency index table; calculate the target consistency index value corresponding to the judgment matrix according to the maximum characteristic root and the order; The random consistency evaluation index value and the target consistency index value determine whether the judgment matrix is valid; when the judgment matrix is valid, the element value corresponding to each vector element in the eigenvector is read, and according to the read The element value determines the subjective weight value corresponding to each performance index parameter.
在一实施例中,所述主节点50,还用于对各性能指标参数进行无量纲化以获得无量纲性能指标,并获取每两个无量纲性能指标之间的相关系数;获取各无量纲性能指标对应的标准差,根据所述标准差以及所述相关系数通过第一预设公式计算各无量纲性能指标对应的信息量,并将所述信息量相加获得信息总量;根据各无量纲性能指标对应的信息量以及所述信息总量确定各性能指标参数对应的客观权重值;其中,所述第一预设公式为:In an embodiment, the master node 50 is also used to dimensionlessly transform each performance index parameter to obtain a dimensionless performance index, and obtain the correlation coefficient between every two dimensionless performance indicators; According to the standard deviation corresponding to the performance index, the information amount corresponding to each dimensionless performance index is calculated by the first preset formula according to the standard deviation and the correlation coefficient, and the information amount is added to obtain the total amount of information; The amount of information corresponding to the performance index and the total amount of information determine the objective weight value corresponding to each performance index parameter; wherein, the first preset formula is:
Figure PCTCN2020100099-appb-000015
Figure PCTCN2020100099-appb-000015
式中,G i为无量纲性能指标i对应的信息量,σ i为无量纲性能指标i对应的标准差,r ij为无量纲性能指标i和j之间的相关系数。 In the formula, G i is the amount of information corresponding to the dimensionless performance index i, σ i is the standard deviation corresponding to the dimensionless performance index i, and r ij is the correlation coefficient between the dimensionless performance index i and j.
在一实施例中,所述主节点50,还用于基于所述主观权重值以及所述客观权重值,通过第二预设公式计算各性能指标参数对应的指标权重;其中,所述第二预设公式为:In an embodiment, the master node 50 is further configured to calculate the index weight corresponding to each performance index parameter based on the subjective weight value and the objective weight value through a second preset formula; wherein, the second The preset formula is:
Figure PCTCN2020100099-appb-000016
Figure PCTCN2020100099-appb-000016
式中,W i为第i个性能指标参数对应的指标权重,n为性能指标参数的个数,W i A为主观权重值,W i C为客观权重值。 In the formula, W i is the index weight corresponding to the i-th performance index parameter, n is the number of performance index parameters, W i A is the subjective weight value, and W i C is the objective weight value.
在一实施例中,所述主节点50,还用于根据所述指标权重以及各性能指标参数对应的参数值,通过第三预设公式分别计算每个从节点对应的投票能力;其中,所述第三预设公式为:In one embodiment, the master node 50 is further configured to calculate the voting power corresponding to each slave node through a third preset formula according to the index weight and the parameter value corresponding to each performance index parameter; where The third preset formula is:
B=(a 1,a 2…a n)×[W 1,W 2…W n] B=(a 1 , a 2 …a n )×[W 1 ,W 2 …W n ]
式中,B为投票能力,a n为第n个性能指标参数,W n为第n个性能指标参数对应的指标权重。 Wherein, B is the ability to vote, a n is the n performance metrics parameters, W n is the n performance indicators corresponding to the heavy weight parameter index.
在一实施例中,所述主节点50,还用于根据预先设定的允许宕机数量确定所述分布式集群对应的投票节点数量;将所述投票能力按从大到小的顺序进行排序,并根据排序结果选取所述投票节点数量的从节点作为投票节点。In an embodiment, the master node 50 is further configured to determine the number of voting nodes corresponding to the distributed cluster according to a preset allowable number of downtimes; and sort the voting capabilities in descending order , And select the slave nodes of the number of voting nodes as voting nodes according to the sorting result.
本申请投票节点配置系统的其他实施例或具体实现方式可参照上述各方法实施例,此处不再赘述。For other embodiments or specific implementations of the voting node configuration system of the present application, reference may be made to the foregoing method embodiments, which will not be repeated here.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。It should be noted that in this article, the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, It also includes other elements not explicitly listed, or elements inherent to the process, method, article, or system. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, article or system that includes the element.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the foregoing embodiments of the present application are for description only, and do not represent the superiority of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如只读存储器/随机存取存储器、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the method of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better.的实施方式。 Based on this understanding, the technical solution of this application essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as read-only memory/random access The memory, magnetic disk, and optical disk) includes several instructions to make a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in the various embodiments of the present application.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above are only preferred embodiments of this application, and do not limit the scope of this application. Any equivalent structure or equivalent process transformation made using the content of the description and drawings of this application, or directly or indirectly used in other related technical fields , The same reason is included in the scope of patent protection of this application.

Claims (10)

  1. 一种投票节点配置方法,其中,所述方法包括:A voting node configuration method, wherein the method includes:
    主节点每隔预设时间周期向所在分布式集群中的至少2个从节点下发参数采集任务;The master node issues parameter collection tasks to at least 2 slave nodes in the distributed cluster where it is located every preset time period;
    所述至少2个从节点中的每个从节点根据所述参数采集任务采集预设维度的性能指标参数,并将采集的性能指标参数反馈至所述主节点;Each of the at least two slave nodes collects performance index parameters of a preset dimension according to the parameter collection task, and feeds back the collected performance index parameters to the master node;
    所述主节点基于预设组合算法对各性能指标参数进行权重计算,以获得各性能指标参数对应的指标权重;The master node calculates the weight of each performance index parameter based on a preset combination algorithm to obtain the index weight corresponding to each performance index parameter;
    所述主节点根据所述指标权重以及各性能指标参数对应的参数值分别计算每个从节点对应的投票能力;以及The master node respectively calculates the voting ability corresponding to each slave node according to the index weight and the parameter value corresponding to each performance index parameter; and
    所述主节点根据预先设定的允许宕机数量确定所述分布式集群对应的投票节点数量,并根据所述投票节点数量以及所述投票能力从所述至少2个从节点中选取对应的投票节点。The master node determines the number of voting nodes corresponding to the distributed cluster according to a preset allowable number of downtimes, and selects corresponding votes from the at least two slave nodes according to the number of voting nodes and the voting capacity node.
  2. 如权利要求1所述的方法,其中,所述至少2个从节点中的每个从节点根据所述参数采集任务采集预设维度的性能指标参数,并将采集的性能指标参数反馈至所述主节点的步骤包括以下步骤:The method according to claim 1, wherein each of the at least two slave nodes collects performance index parameters of a preset dimension according to the parameter collection task, and feeds back the collected performance index parameters to the The steps of the master node include the following steps:
    根据所述参数采集任务在本地创建一目标文件,在预设时段内对所述目标文件执行读写操作,并根据统计的读写总次数计算对应的磁盘读取速率;Create a target file locally according to the parameter collection task, perform read and write operations on the target file within a preset time period, and calculate the corresponding disk read rate according to the total number of reads and writes counted;
    读取所述参数采集任务中包含的处理器计算能力参数,所述处理器计算能力参数包括:计算时限以及待计算数值;Reading the processor computing capability parameters included in the parameter collection task, where the processor computing capability parameters include: a calculation time limit and a value to be calculated;
    在所述计算时限内对所述待计算数值执行若干次素数求取操作,并根据执行结果获得对应的处理器计算能力;以及Perform a number of prime number calculation operations on the value to be calculated within the calculation time limit, and obtain the corresponding processor computing power according to the execution result; and
    将所述磁盘读取速率以及所述处理器计算能力作为性能指标参数反馈至所述主节点。The disk read rate and the processor computing power are fed back to the master node as performance index parameters.
  3. 如权利要求1所述的方法,其中,所述主节点基于预设组合算法对各性能指标参数进行权重计算,以获得各性能指标参数对应的指标权重的步骤包括以下步骤:The method of claim 1, wherein the step of calculating the weight of each performance index parameter by the master node based on a preset combination algorithm to obtain the index weight corresponding to each performance index parameter comprises the following steps:
    通过预设层次分析法获取各性能指标参数对应的主观权重值;Obtain the subjective weight value corresponding to each performance index parameter through the preset analytic hierarchy process;
    通过预设权重赋值算法获取各性能指标参数对应的客观权重值;以及Obtain the objective weight value corresponding to each performance index parameter through the preset weight assignment algorithm; and
    基于所述主观权重值以及所述客观权重值,通过预设拉格朗日最优乘子法获取各性能指标参数对应的指标权重。Based on the subjective weight value and the objective weight value, the index weight corresponding to each performance index parameter is obtained through a preset Lagrangian optimal multiplier method.
  4. 如权利要求3所述的方法,其中,所述主节点通过预设层次分析法获取各性能指标参数对应的主观权重值的步骤包括以下步骤:The method according to claim 3, wherein the step of obtaining the subjective weight value corresponding to each performance index parameter by the master node through a preset analytic hierarchy process comprises the following steps:
    根据各性能指标参数构建对应的判断矩阵,并计算所述判断矩阵的最大特征根以及特 征向量;Construct a corresponding judgment matrix according to each performance index parameter, and calculate the maximum characteristic root and characteristic vector of the judgment matrix;
    获取所述判断矩阵对应的阶数,在预设随机一致性指标表中查找所述阶数对应的随机一致性评价指标值;Acquiring the order corresponding to the judgment matrix, and searching for the random consistency evaluation index value corresponding to the order in a preset random consistency index table;
    根据所述最大特征根以及所述阶数计算所述判断矩阵对应的目标一致性指标值;Calculating the target consistency index value corresponding to the judgment matrix according to the maximum characteristic root and the order;
    根据所述随机一致性评价指标值以及所述目标一致性指标值判断所述判断矩阵是否有效;以及Judging whether the judgment matrix is valid according to the random consistency evaluation index value and the target consistency index value; and
    在所述判断矩阵有效时,读取所述特征向量中各向量元素对应的元素值,并根据读取的元素值确定各性能指标参数对应的主观权重值。When the judgment matrix is valid, the element value corresponding to each vector element in the eigenvector is read, and the subjective weight value corresponding to each performance index parameter is determined according to the read element value.
  5. 如权利要求3所述的方法,其中,所述主节点通过预设权重赋值算法获取各性能指标参数对应的客观权重值的步骤包括以下步骤:The method according to claim 3, wherein the step of obtaining the objective weight value corresponding to each performance index parameter by the master node through a preset weight assignment algorithm comprises the following steps:
    对各性能指标参数进行无量纲化以获得无量纲性能指标,并获取每两个无量纲性能指标之间的相关系数;Dimensionlessly transform each performance index parameter to obtain a dimensionless performance index, and obtain the correlation coefficient between every two dimensionless performance indexes;
    获取各无量纲性能指标对应的标准差,根据所述标准差以及所述相关系数通过第一预设公式计算各无量纲性能指标对应的信息量,并将所述信息量相加获得信息总量;以及Obtain the standard deviation corresponding to each non-dimensional performance index, calculate the information amount corresponding to each non-dimensional performance index through the first preset formula according to the standard deviation and the correlation coefficient, and add the information amount to obtain the total information ;as well as
    根据各无量纲性能指标对应的信息量以及所述信息总量确定各性能指标参数对应的客观权重值;其中,所述第一预设公式为:The objective weight value corresponding to each performance index parameter is determined according to the amount of information corresponding to each dimensionless performance index and the total amount of information; wherein, the first preset formula is:
    Figure PCTCN2020100099-appb-100001
    Figure PCTCN2020100099-appb-100001
    式中,G i为无量纲性能指标i对应的信息量,σ i为无量纲性能指标i对应的标准差,r ij为无量纲性能指标i和j之间的相关系数。 In the formula, G i is the amount of information corresponding to the dimensionless performance index i, σ i is the standard deviation corresponding to the dimensionless performance index i, and r ij is the correlation coefficient between the dimensionless performance index i and j.
  6. 如权利要求3所述的方法,其中,所述主节点基于所述主观权重值以及所述客观权重值,通过预设拉格朗日最优乘子法获取各性能指标参数对应的指标权重的步骤包括以下步骤:The method of claim 3, wherein the master node obtains the index weight corresponding to each performance index parameter through a preset Lagrangian optimal multiplier method based on the subjective weight value and the objective weight value The steps include the following steps:
    基于所述主观权重值以及所述客观权重值,通过第二预设公式计算各性能指标参数对应的指标权重;其中,所述第二预设公式为:Based on the subjective weight value and the objective weight value, the index weight corresponding to each performance index parameter is calculated by a second preset formula; wherein, the second preset formula is:
    Figure PCTCN2020100099-appb-100002
    Figure PCTCN2020100099-appb-100002
    式中,W i为第i个性能指标参数对应的指标权重,n为性能指标参数的个数,W i A为主观权重值,W i C为客观权重值。 In the formula, W i is the index weight corresponding to the i-th performance index parameter, n is the number of performance index parameters, W i A is the subjective weight value, and W i C is the objective weight value.
  7. 如权利要求1所述的方法,其中,所述主节点根据所述指标权重以及各性能指标参数对应的参数值分别计算每个从节点对应的投票能力的步骤包括以下步骤:The method according to claim 1, wherein the step of the master node separately calculating the voting ability corresponding to each slave node according to the index weight and the parameter value corresponding to each performance index parameter comprises the following steps:
    根据所述指标权重以及各性能指标参数对应的参数值,通过第三预设公式分别计算每 个从节点对应的投票能力;其中,所述第三预设公式为:According to the index weight and the parameter value corresponding to each performance index parameter, the voting ability corresponding to each slave node is calculated through a third preset formula; wherein, the third preset formula is:
    B=(a 1,a 2…a n)×[W 1,W 2…W n] B=(a 1 , a 2 …a n )×[W 1 ,W 2 …W n ]
    式中,B为投票能力,a n为第n个性能指标参数,W n为第n个性能指标参数对应的指标权重。 Wherein, B is the ability to vote, a n is the n performance metrics parameters, W n is the n performance indicators corresponding to the heavy weight parameter index.
  8. 如权利要求1所述的方法,其中,所述主节点根据预先设定的允许宕机数量确定所述分布式集群对应的投票节点数量,并根据所述投票节点数量以及所述投票能力从所述至少2个从节点中选取对应的投票节点的步骤包括以下步骤:The method of claim 1, wherein the master node determines the number of voting nodes corresponding to the distributed cluster according to a preset allowable number of downtimes, and according to the number of voting nodes and the voting capacity The at least two steps of selecting corresponding voting nodes from nodes include the following steps:
    根据预先设定的允许宕机数量确定所述分布式集群对应的投票节点数量;以及Determine the number of voting nodes corresponding to the distributed cluster according to the preset allowable number of downtimes; and
    将所述投票能力按从大到小的顺序进行排序,并根据排序结果选取所述投票节点数量的从节点作为投票节点。Sort the voting capabilities in descending order, and select slave nodes of the number of voting nodes as voting nodes according to the sorting result.
  9. 一种投票节点配置系统,其中,所述系统包括:主节点和至少2个从节点,所述主节点和所述至少2个从节点处于分布式集群中;A voting node configuration system, wherein the system includes: a master node and at least two slave nodes, and the master node and the at least two slave nodes are in a distributed cluster;
    所述主节点,用于每隔预设时间周期向所述分布式集群中的所述至少2个从节点下发参数采集任务;The master node is configured to deliver parameter collection tasks to the at least two slave nodes in the distributed cluster every preset time period;
    所述至少2个中的每个从节点,用于根据所述参数采集任务采集预设维度的性能指标参数,并将采集的性能指标参数反馈至所述主节点;Each of the at least two slave nodes is configured to collect performance index parameters of a preset dimension according to the parameter collection task, and feed back the collected performance index parameters to the master node;
    所述主节点,还用于基于预设组合算法对各性能指标参数进行权重计算,以获得各性能指标参数对应的指标权重;The master node is also used to calculate the weight of each performance index parameter based on a preset combination algorithm to obtain the index weight corresponding to each performance index parameter;
    所述主节点,还用于根据所述指标权重以及各性能指标参数对应的参数值分别计算每个从节点对应的投票能力;以及The master node is also used to calculate the voting power corresponding to each slave node according to the index weight and the parameter value corresponding to each performance index parameter; and
    所述主节点,还用于根据预先设定的允许宕机数量确定所述分布式集群对应的投票节点数量,并根据所述投票节点数量以及所述投票能力从所述至少2个从节点中选取对应的投票节点。The master node is also used to determine the number of voting nodes corresponding to the distributed cluster according to a preset allowable number of downtimes, and to select from the at least two slave nodes according to the number of voting nodes and the voting capacity Select the corresponding voting node.
  10. 如权利要求9所述的系统,其中,所述主节点还用于基于预设组合算法对各性能指标参数进行权重计算,以获得各性能指标参数对应的指标权重,包括:The system according to claim 9, wherein the master node is further configured to calculate the weight of each performance index parameter based on a preset combination algorithm to obtain the index weight corresponding to each performance index parameter, comprising:
    通过预设层次分析法获取各性能指标参数对应的主观权重值;Obtain the subjective weight value corresponding to each performance index parameter through the preset analytic hierarchy process;
    通过预设权重赋值算法获取各性能指标参数对应的客观权重值;以及Obtain the objective weight value corresponding to each performance index parameter through the preset weight assignment algorithm; and
    基于所述主观权重值以及所述客观权重值,通过预设拉格朗日最优乘子法获取各性能指标参数对应的指标权重。Based on the subjective weight value and the objective weight value, the index weight corresponding to each performance index parameter is obtained through a preset Lagrangian optimal multiplier method.
PCT/CN2020/100099 2019-07-23 2020-07-03 Voting node configuration method and system WO2021012930A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910670424.1A CN110417591B (en) 2019-07-23 2019-07-23 Voting node configuration method and system
CN201910670424.1 2019-07-23

Publications (1)

Publication Number Publication Date
WO2021012930A1 true WO2021012930A1 (en) 2021-01-28

Family

ID=68362832

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/100099 WO2021012930A1 (en) 2019-07-23 2020-07-03 Voting node configuration method and system

Country Status (2)

Country Link
CN (1) CN110417591B (en)
WO (1) WO2021012930A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022256723A2 (en) 2021-06-03 2022-12-08 Scholar Rock, Inc. Tgf-beta inhibitors and therapeutic use thereof

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110417591B (en) * 2019-07-23 2021-07-02 中南民族大学 Voting node configuration method and system
CN111709623A (en) * 2020-06-04 2020-09-25 中国科学院计算机网络信息中心 High-performance computing environment evaluation method and device, electronic equipment and storage medium
CN111696245B (en) * 2020-06-30 2022-01-18 郭平波 Voting method based on P2P network
CN113743564B (en) * 2021-01-19 2023-12-05 北京沃东天骏信息技术有限公司 Counting method, counting device, electronic equipment and storage medium
CN115514816A (en) * 2021-06-03 2022-12-23 中移雄安信息通信科技有限公司 Distributed edge cloud resource scheduling method, device, equipment and medium
CN113708968B (en) * 2021-08-27 2023-08-11 中国互联网络信息中心 Node election control method and device for block chain
CN114065220B (en) * 2021-11-25 2022-11-22 国网四川省电力公司成都供电公司 Dual-level analysis situation assessment method based on distributed system
CN114978983B (en) * 2022-06-17 2023-10-20 兰州大学 Impact node identification method and system based on second-order H index and voting mechanism
CN117714056A (en) * 2024-02-05 2024-03-15 中国船舶集团有限公司第七〇七研究所 Service-oriented special password service system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018192533A1 (en) * 2017-04-20 2018-10-25 腾讯科技(深圳)有限公司 Node device running method, working state switching device, node device, and medium
CN108810100A (en) * 2018-05-22 2018-11-13 郑州云海信息技术有限公司 A kind of electoral machinery of host node, device and equipment
CN108810046A (en) * 2017-04-28 2018-11-13 华为技术有限公司 A kind of method, apparatus and equipment of election leadership person Leader
CN109587218A (en) * 2018-11-07 2019-04-05 新华三技术有限公司 A kind of method and apparatus of cluster election
CN110417591A (en) * 2019-07-23 2019-11-05 中南民族大学 Ballot node configuration method and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10235623B2 (en) * 2016-02-12 2019-03-19 Adobe Inc. Accurate tag relevance prediction for image search
CN109412838A (en) * 2018-09-29 2019-03-01 吴志培 Server cluster host node selection method based on hash calculating and Performance Evaluation

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018192533A1 (en) * 2017-04-20 2018-10-25 腾讯科技(深圳)有限公司 Node device running method, working state switching device, node device, and medium
CN108810046A (en) * 2017-04-28 2018-11-13 华为技术有限公司 A kind of method, apparatus and equipment of election leadership person Leader
CN108810100A (en) * 2018-05-22 2018-11-13 郑州云海信息技术有限公司 A kind of electoral machinery of host node, device and equipment
CN109587218A (en) * 2018-11-07 2019-04-05 新华三技术有限公司 A kind of method and apparatus of cluster election
CN110417591A (en) * 2019-07-23 2019-11-05 中南民族大学 Ballot node configuration method and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022256723A2 (en) 2021-06-03 2022-12-08 Scholar Rock, Inc. Tgf-beta inhibitors and therapeutic use thereof

Also Published As

Publication number Publication date
CN110417591B (en) 2021-07-02
CN110417591A (en) 2019-11-05

Similar Documents

Publication Publication Date Title
WO2021012930A1 (en) Voting node configuration method and system
CN108520357B (en) Method and device for judging line loss abnormality reason and server
WO2019153487A1 (en) System performance measurement method and device, storage medium and server
US8725741B2 (en) Assessing application performance with an operational index
WO2023236472A1 (en) Built-environment quality measurement method, and device and storage medium
CN111882198A (en) Project performance evaluation method and system
CN112398700A (en) Service degradation method and device, storage medium and computer equipment
CN108415775A (en) A kind of quality-of-service based resource determining method and system
CN111598457A (en) Method and device for determining quality of power wireless network
CN115378928B (en) Monitoring method and system based on cloud service
CN114610234B (en) Storage system parameter recommendation method and related device
CN113537759B (en) Weight self-adaption-based user experience measurement model
CN115509877A (en) Method for evaluating performance efficiency of information system
CN112016971A (en) Mobile crowd sensing data reliability guarantee method based on Etheng GAS principle
CN111709623A (en) High-performance computing environment evaluation method and device, electronic equipment and storage medium
Bi et al. Adaptive prediction of resources and workloads for cloud computing systems with attention-based and hybrid LSTM
CN117172721B (en) Data flow supervision early warning method and system for financing service
CN117336296B (en) Intelligent selection method for cluster consensus
CN112035533B (en) System resource scheduling method and device based on multi-parameter quantization strategy feedback
CN116957306B (en) User side response potential evaluation method and system based on resource collaborative interaction
CN115757076B (en) Cluster management fitness computing method based on equipment operation characteristics and performance indexes
CN114663219B (en) Main body credit assessment method and system based on energy interconnection power market
CN113642834B (en) Task importance evaluation method and system based on task attribute priority mapping
CN115981778A (en) Method and system for determining early warning model for monitoring container cluster
CN117234871A (en) Evaluation method for importance of application programming interface and related equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20845062

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20845062

Country of ref document: EP

Kind code of ref document: A1