CN115840679A - Redis state information acquisition method and device, storage medium and electronic device - Google Patents

Redis state information acquisition method and device, storage medium and electronic device Download PDF

Info

Publication number
CN115840679A
CN115840679A CN202211625514.7A CN202211625514A CN115840679A CN 115840679 A CN115840679 A CN 115840679A CN 202211625514 A CN202211625514 A CN 202211625514A CN 115840679 A CN115840679 A CN 115840679A
Authority
CN
China
Prior art keywords
redis
node
evaluation reference
reference information
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211625514.7A
Other languages
Chinese (zh)
Inventor
武建宇
贾雷
韩世尚
张华超
杨亚男
赵阳
陈华媛
李璠
史晨阳
丁永建
黄时光
向小佳
彭晓
吴海洋
王志刚
周明媛
赵振海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Everbright Technology Co ltd
Original Assignee
Everbright Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Everbright Technology Co ltd filed Critical Everbright Technology Co ltd
Priority to CN202211625514.7A priority Critical patent/CN115840679A/en
Publication of CN115840679A publication Critical patent/CN115840679A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Medical Treatment And Welfare Office Work (AREA)

Abstract

The application discloses a method for acquiring Redis state information, a storage medium and an electronic device, which are used for acquiring evaluation reference information corresponding to each Redis node in a Redis set, wherein the Redis set comprises at least two Redis nodes, the node types of the Redis nodes comprise at least two types, and the evaluation reference information is used for providing evaluation reference for each index of the Redis nodes; integrating and calculating the evaluation reference information corresponding to each Redis node by using the preset weight corresponding to the node type to which each Redis node belongs to obtain target evaluation reference information; and acquiring target state information corresponding to the Redis set based on the target evaluation reference information, wherein the target state information is used for evaluating the overall health degree of the Redis set. The method and the device solve the technical problem that the obtaining accuracy of Redis state information is low in the related technology.

Description

Redis state information acquisition method and device, storage medium and electronic device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for acquiring Redis status information, a storage medium, and an electronic apparatus.
Background
In the prior art, a threshold judgment mode is often adopted according to a specified scattered index (for example, a memory use condition) to determine whether Redis is in a normal operation state in a dimension corresponding to the scattered index. However, the method only acquires the operating state corresponding to the Redis scattered index, and the acquired Redis state information is not comprehensive and complete enough, so that the accuracy of acquiring the Redis state information is low.
Therefore, the related art has a problem that the accuracy of acquiring the Redis state information is low.
Disclosure of Invention
The embodiment of the application provides a method and a device for acquiring Redis state information, a storage medium and an electronic device, so as to at least solve the technical problem that the acquisition accuracy of the Redis state information is low in the related technology.
According to an aspect of an embodiment of the present application, a method for acquiring Redis status information is provided, including: acquiring evaluation reference information corresponding to each Redis node in a Redis set, wherein the Redis set comprises at least two Redis nodes, the node types of the Redis nodes comprise at least two types, and the evaluation reference information is used for providing evaluation reference for each index of the Redis nodes; integrating and calculating the evaluation reference information corresponding to each Redis node by using the preset weight corresponding to the node type to which each Redis node belongs to obtain target evaluation reference information; and acquiring target state information corresponding to the Redis set based on the target evaluation reference information, wherein the target state information is used for evaluating the overall health degree of the Redis set.
According to another aspect of the embodiments of the present application, there is also provided an apparatus for acquiring Redis status information, including: the device comprises a first obtaining unit, a second obtaining unit and a judging unit, wherein the first obtaining unit is used for obtaining evaluation reference information corresponding to each Redis node in a Redis set, the Redis set comprises at least two Redis nodes, the node types of the Redis nodes comprise at least two types, and the evaluation reference information is used for providing evaluation reference for each index of the Redis nodes; the integration unit is used for integrating and calculating the evaluation reference information corresponding to each Redis node by using the preset weight corresponding to the node type to which each Redis node belongs to obtain target evaluation reference information; and a second obtaining unit, configured to obtain target state information corresponding to the Redis set based on the target evaluation reference information, where the target state information is used to evaluate an overall health degree of the Redis set.
As an alternative, the integration unit includes: and the weighted summation module is used for carrying out weighted summation calculation on the evaluation reference information corresponding to each Redis node to obtain the target evaluation reference information, wherein the weight used in the weighted summation calculation is a preset weight corresponding to the node type to which each Redis node belongs.
As an optional solution, the weighted summation module includes: a first obtaining sub-module, configured to determine a current Redis first node from the at least two Redis nodes, and obtain current evaluation reference information corresponding to the current Redis and a current weight corresponding to a node type of the current Redis first node until the target evaluation reference information is obtained; the weighting submodule is used for carrying out weighting calculation on the current evaluation reference information by using the current weight to obtain a current weighting numerical value until the target evaluation reference information is obtained; the summation submodule is used for summing the current weighted data and the obtained weighted numerical value to obtain a current target evaluation reference numerical value until the target evaluation reference information is obtained; a determining submodule, configured to determine the current target evaluation reference value as the target evaluation reference information until the target evaluation reference information is obtained under a condition that each Redis node has obtained a corresponding weighted value; and the second obtaining submodule is used for selecting a next Redis node from the at least two Redis nodes under the condition that the corresponding weighted numerical value is not obtained in the at least two Redis nodes, and determining the next Redis node as the current Redis first node until the target evaluation reference information is obtained.
As an optional solution, the apparatus further includes: the first determining module is configured to determine abnormal state information corresponding to the Redis set when, after the evaluation reference information corresponding to each Redis node in the Redis set is obtained, the evaluation reference information corresponding to each Redis node satisfies an abnormal state condition, where the abnormal state information is used to prompt that an overall health degree of the Redis set is less than or equal to a health degree threshold.
As an optional solution, the first obtaining unit includes: a first obtaining module, configured to determine a current Redis second node from the at least two Redis nodes, and obtain an initial index value of the current Redis second node and a to-be-deducted value of the current Redis second node, where the to-be-deducted value is used to indicate a value to be deducted when the current Redis second node does not satisfy a preset index until evaluation reference information corresponding to each Redis node satisfies the abnormal state condition, or the evaluation reference information corresponding to each Redis node satisfies an initial state condition; a second determining module, configured to calculate a difference between the initial index value and the value to be subtracted to obtain a current index value, and determine the current index value as the evaluation reference information corresponding to the current Redis second node until the evaluation reference information corresponding to each Redis node satisfies the abnormal state condition or the evaluation reference information corresponding to each Redis node satisfies the initial state condition; a counting module, configured to count a target number of index values corresponding to the evaluation reference information that are less than or equal to a first abnormal threshold value, until the evaluation reference information corresponding to each Redis node satisfies the abnormal state condition, or the evaluation reference information corresponding to each Redis node satisfies an initial state condition, when each Redis node has obtained the corresponding evaluation reference information; a third determining module, configured to determine that the evaluation reference information corresponding to each Redis node satisfies the abnormal state condition when the target number is greater than or equal to a second abnormal threshold; or, when the target number is smaller than the second abnormal threshold, determining that the evaluation reference information corresponding to each Redis node satisfies the initial state condition until the evaluation reference information corresponding to each Redis node satisfies the abnormal state condition or the evaluation reference information corresponding to each Redis node satisfies the initial state condition; the above-mentioned device still includes: a second obtaining module, configured to obtain the target evaluation reference information after determining that the evaluation reference information corresponding to each Redis node satisfies the initial state condition, until the evaluation reference information corresponding to each Redis node satisfies the abnormal state condition, or until the evaluation reference information corresponding to each Redis node satisfies the initial state condition.
As an alternative, the integration unit includes: a fourth determining module, configured to determine, from the evaluation reference information corresponding to each Redis node, a plurality of evaluation reference information that satisfy a first confidence condition; and the calculation module is used for performing integrated calculation on the plurality of evaluation reference information by using the preset weight corresponding to the node type to which the Redis node corresponding to each evaluation reference information in the plurality of evaluation reference information belongs to obtain the target evaluation reference information.
As an optional solution, the second obtaining unit includes: a fifth determining module, configured to determine the target evaluation reference information as the target state information when the target evaluation reference information satisfies the second confidence condition; or, a third obtaining module, configured to obtain, when the target evaluation reference information does not satisfy the second confidence condition, the integral reference information associated with the Redis set; and the integration module is used for integrating the overall reference information and the target state information to obtain the target state information.
According to yet another aspect of embodiments herein, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform the acquisition method of the Redis state information as above.
According to another aspect of the embodiments of the present application, there is provided an electronic apparatus, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the method for acquiring Redis status information by using the computer program.
In the embodiment of the application, evaluation reference information corresponding to each Redis node in a Redis set is obtained, wherein the Redis set comprises at least two Redis nodes, the node types of the Redis nodes comprise at least two types, and the evaluation reference information is used for providing evaluation references for each index of the Redis nodes; integrating and calculating the evaluation reference information corresponding to each Redis node by using the preset weight corresponding to the node type to which each Redis node belongs to obtain target evaluation reference information; acquiring target state information corresponding to the Redis set based on the target evaluation reference information, wherein the target state information is used for evaluating the overall health degree of the Redis set;
by using the method for acquiring Redis state information, the weighted integration calculation is carried out based on the evaluation reference information corresponding to each Redis node in the Redis set to obtain the target state information reflecting the overall health degree of the Redis set, so that the purposes of quantifying each index corresponding to each Redis node in the Redis set and determining the overall health state of the Redis set truly, comprehensively and completely by combining the node weight are achieved, the technical effect of improving the accuracy of acquiring the Redis state information is achieved, and the technical problem that the accuracy of acquiring the Redis state information is low in the related technology is solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
Fig. 1 is a schematic diagram of a hardware environment of a method for acquiring Redis status information according to an embodiment of the present application;
fig. 2 is a schematic diagram of a flow of an optional method for acquiring Redis status information according to an embodiment of the present application;
fig. 3 is a schematic diagram of an optional method for acquiring Redis status information according to an embodiment of the present application;
fig. 4 is a schematic diagram of another optional method for acquiring Redis status information according to an embodiment of the present application;
fig. 5 is a schematic diagram of a flow of an optional method for acquiring Redis status information according to an embodiment of the present application;
fig. 6 is a schematic diagram of an optional method for acquiring Redis status information according to an embodiment of the present application;
fig. 7 is a schematic diagram of another optional method for acquiring Redis status information according to an embodiment of the present application;
FIG. 8 is a schematic diagram of an alternative information processing apparatus according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of an alternative electronic device according to an embodiment of the invention.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be implemented in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an aspect of the embodiments of the present application, a method for acquiring Redis status information is provided, and optionally, as an optional implementation manner, the method for acquiring Redis status information may be, but is not limited to be, applied to an environment as shown in fig. 1. The system may include, but is not limited to, a user device 102 and a server 112, the user device 102 may include, but is not limited to, a display 104, a processor 106 and a memory 108, and the server 112 includes a database 114 and a processing engine 116.
The specific process comprises the following steps:
step S102, the user equipment 102 acquires evaluation reference information corresponding to each Redis node in the Redis set and preset weight corresponding to the node type of each Redis node;
S104-S106, sending the evaluation reference information and the preset weight to a server 112 through a network 110;
step S108, the server 112 integrates and calculates the evaluation reference information corresponding to each Redis node by using the preset weight corresponding to the node type to which each Redis node belongs through the processing engine to obtain target evaluation reference information;
step S110, the server 112 obtains, by a processing engine, target state information corresponding to the Redis set based on the target evaluation reference information, where the target state information is used to evaluate the overall health degree of the Redis set;
steps S112-S114 send the target status information to the user equipment 102 via the network 110.
In addition to the example shown in fig. 1, the above steps may be performed by the client or the server independently, or by cooperation of the client and the server, such as the user equipment 102 performing the above steps S108-S110, so as to relieve the processing pressure of the server 112. The user equipment 102 includes, but is not limited to, a handheld device (e.g., a mobile phone), a notebook computer, a desktop computer, a vehicle-mounted device, and the like, and the application does not limit the specific implementation manner of the user equipment 102.
Optionally, as an optional implementation manner, as shown in fig. 2, the method for acquiring the Redis status information includes:
s202, obtaining evaluation reference information corresponding to each Redis node in a Redis set, wherein the Redis set comprises at least two Redis nodes, the node types of the Redis nodes comprise at least two types, and the evaluation reference information is used for providing evaluation reference for each index of the Redis nodes;
s204, integrating and calculating the evaluation reference information corresponding to each Redis node by using the preset weight corresponding to the node type to which each Redis node belongs to obtain target evaluation reference information;
s204, acquiring target state information corresponding to the Redis set based on the target evaluation reference information, wherein the target state information is used for evaluating the overall health degree of the Redis set.
Optionally, in this embodiment, the method for acquiring the Redis status information may be, but is not limited to, applied in a scenario of calculating a health degree of a Redis cluster, where the health degree of the Redis cluster may be, but is not limited to, used for reflecting an overall health degree of the Redis cluster, and the Redis cluster may include, but is not limited to, a plurality of Redis servers.
It should be noted that, in the prior art, the evaluation of the Redis health status is often completed by establishing a health monitoring system. The monitoring system usually configures the threshold state of indexes such as memory use condition and persistence. When the monitoring system judges that the value of each index exceeds the corresponding threshold value, recording the abnormal condition, initiating an alarm, and directly judging whether the health state of Redis is normal or not through the alarm.
However, the monitoring system only performs threshold judgment on the designated scattered indexes of a single Redis server, and the acquired Redis state information is not comprehensive enough and complete enough, so that the accuracy of the acquired Redis state information is low; and the overall health state of the whole Redis cluster is not evaluated quantitatively, and for different Redis projects, redis servers in different projects cannot be compared quantitatively, so that memory evaluation, performance improvement and the like for the Redis projects are inconvenient to follow-up.
Optionally, in this embodiment, one Redis item may correspond to one Redis cluster, and one Redis cluster may include, but is not limited to, a plurality of Redis servers.
Aiming at the problem that the acquired Redis state information is not comprehensive enough and complete enough to cause low accuracy of the acquired Redis state information, the method for acquiring the Redis state information is utilized to perform weighted integration calculation based on the evaluation reference information corresponding to each Redis node in the Redis set so as to obtain the target state information reflecting the overall health degree of the Redis set, and further, the purposes of quantizing each index corresponding to each Redis node in the Redis set and determining the overall health state of the Redis set truly, comprehensively and completely by combining the node weight are achieved, so that the technical effect of improving the accuracy of the acquired Redis state information is achieved, and the problem that the accuracy of the acquired Redis state information is low is solved.
Optionally, in this embodiment, the Redis set may include, but is not limited to, at least two Redis nodes, where a Redis node may correspond to a Redis server, and a Redis set may correspond to a Redis cluster including at least two Redis servers.
Optionally, in this embodiment, the node types of the Redis nodes include at least two types, where the node type of each Redis node corresponds to an associated preset weight, and the preset weight may be, but is not limited to, used for weighting and calculating evaluation reference information corresponding to the Redis node.
Optionally, in this embodiment, the node types of the Redis node may include, but are not limited to, a master node type, a slave node type, and a sentinel node type, where the preset weight corresponding to the master node type may be, but is not limited to, 1.0, the preset weight corresponding to the slave node type may be, but is not limited to, 0.5, and the preset weight corresponding to the sentinel node type may be, but is not limited to, 0.5.
It should be noted that the node type of the Redis node may be, but is not limited to, used to indicate how important the Redis node is currently in the Redis set, for example, the master node type may be, but is not limited to, used to indicate that the Redis node is currently a core data server in the Redis set, and the slave node type may be, but is not limited to, used to indicate that the Redis node is currently a backup data server in the Redis set.
Optionally, in this embodiment, the target reference information may be, but is not limited to, a value obtained by indicating that the evaluation reference information corresponding to each Redis node in the Redis set is subjected to the integration calculation, and the target state information may be, but is not limited to, information for evaluating the overall health degree of the Redis set, which is determined and obtained based on the health value of the Redis set indicated by the target reference information.
It should be noted that the target evaluation reference information may be, but is not limited to be, understood as a health score of the Redis set calculated, and the target status information may be, but is not limited to be, understood as including a health score reflected by the target evaluation reference information and Redis set status information.
For example, in a case that the health score of the Redis set indicated by the target evaluation reference information is lower than a preset health score threshold, target state information is determined based on the target evaluation reference information, where the target state information may include, but is not limited to, the health score of the Redis set, set information corresponding to the Redis set, warning information, and the like.
For further example, as shown in fig. 3, the Redis set 302 at least includes a first Redis node 304 and a second Redis node 306, where the first Redis node 304 corresponds to the first evaluation reference information 308, and the second Redis node corresponds to the second evaluation reference information 310;
optionally, after acquiring first evaluation reference information 308 corresponding to a first Redis node 304 and second evaluation reference information 310 corresponding to a second Redis node 306, acquiring a corresponding preset weight based on a node type to which the Redis node belongs, where the node type to which the first Redis node 304 belongs is a master node type, the corresponding first preset weight 312 is 1.0, the node type to which the second Redis node 306 belongs is a slave node type, and the corresponding second preset weight 314 is 0.5;
it should be noted that, this embodiment does not limit the obtaining sequence of the preset weights corresponding to the evaluation reference information and the node type corresponding to the Redis node;
performing integration calculation based on the first evaluation reference information 308, the first preset weight 312, the second evaluation reference information 310 and the second preset weight 314 to obtain target evaluation reference information 316;
and acquiring target state information 318 corresponding to the Redis set 302 based on the target evaluation reference information 316, wherein the target state information 318 is used for evaluating the overall health degree of the Redis set 302.
According to the embodiment provided by the application, evaluation reference information corresponding to each Redis node in a Redis set is obtained, wherein the Redis set comprises at least two Redis nodes, the node types of the Redis nodes comprise at least two types, and the evaluation reference information is used for providing evaluation reference for each index of the Redis nodes; integrating and calculating the evaluation reference information corresponding to each Redis node by using the preset weight corresponding to the node type to which each Redis node belongs to obtain target evaluation reference information; acquiring target state information corresponding to the Redis set based on the target evaluation reference information, wherein the target state information is used for evaluating the overall health degree of the Redis set;
by using the method for acquiring Redis state information, the weighted integration calculation is carried out based on the evaluation reference information corresponding to each Redis node in the Redis set to obtain the target state information reflecting the overall health degree of the Redis set, so that the purposes of quantifying each index corresponding to each Redis node in the Redis set and determining the overall health state of the Redis set truly, comprehensively and completely by combining the node weight are achieved, and the technical effect of improving the accuracy of acquiring the Redis state information is realized.
As an optional scheme, performing integrated calculation on the evaluation reference information corresponding to each Redis node by using a preset weight corresponding to the node type to which each Redis node belongs to obtain target evaluation reference information, including:
s1, carrying out weighted summation calculation on the evaluation reference information corresponding to each Redis node to obtain target evaluation reference information, wherein the weight used in the weighted summation calculation is a preset weight corresponding to the node type of each Redis node.
It should be noted that, by using the preset weight corresponding to the node type to which each Redis node belongs, the evaluation reference information corresponding to each Redis node is integrated and calculated to obtain the target evaluation reference information, which may be, but is not limited to, performing weighted summation calculation on the evaluation reference information corresponding to each Redis node to obtain the target evaluation reference information, where the weight used in the weighted summation calculation is the preset weight corresponding to the node type to which each Redis node belongs.
For further example, as shown in fig. 3, the target evaluation reference information 316 obtained by performing the integrated calculation based on the first evaluation reference information 308, the first preset weight 312, the second evaluation reference information 310, and the second preset weight 314 may include, but is not limited to: a first weighted product result of the first evaluation reference information 308 and the first preset weight 312, and a second weighted product result of the second evaluation reference information 310 and the second preset weight 314 are obtained, and the first weighted product result and the second weighted product result are used for summation calculation to obtain target evaluation reference information 316.
According to the embodiment provided by the application, weighted summation calculation is carried out on the evaluation reference information corresponding to each Redis node to obtain target evaluation reference information, wherein the weight used in the weighted summation calculation is a preset weight corresponding to the node type to which each Redis node belongs. The target evaluation reference information is obtained by performing weighted summation calculation based on the evaluation reference information corresponding to each Redis node in the Redis set, so that the authenticity, comprehensiveness and integrity of the target state information determined based on the target evaluation reference information are ensured, the purpose of truly, comprehensively and completely determining the overall health state of the Redis set is further achieved, and the technical effect of improving the accuracy of obtaining the Redis state information is achieved.
As an optional scheme, performing weighted summation calculation on the evaluation reference information corresponding to each Redis node to obtain target evaluation reference information, including:
executing the following steps until target evaluation reference information is obtained:
s1, determining a current Redis first node from at least two Redis nodes, and acquiring current evaluation reference information corresponding to the first node of the current Redis first node and current weight corresponding to the node type of the current Redis first node;
s2, performing weighted calculation on the current evaluation reference information by using the current weight to obtain a current weighted value;
s3, summing the current weighted data and the obtained weighted numerical value to obtain a current target evaluation reference numerical value;
s4, under the condition that each Redis node obtains a corresponding weighted numerical value, determining the current target evaluation reference value as target evaluation reference information;
s5, under the condition that corresponding weighting numerical values are not obtained in the at least two Redis nodes, selecting a next Redis node from the at least two Redis nodes, and determining the next Redis node as a current Redis first node.
For example, as shown in fig. 4, the determination method of the target evaluation reference information specifically includes the following steps:
step S402, determining a current Redis first node from at least two Redis nodes, and acquiring current evaluation reference information corresponding to the current Redis first node and current weight corresponding to the node type of the current Redis first node;
step S404, performing weighting calculation on the current evaluation reference information by using the current weight to obtain a current weighting numerical value;
step S406, summing the current weighting data and the obtained weighting numerical value to obtain a current target evaluation reference numerical value;
step S408, judging whether each Redis node obtains a corresponding weighted numerical value at present;
step S410, under the condition that each Redis node obtains a corresponding weighted value at present, determining a present target evaluation reference value as target evaluation reference information;
step S412, under the condition that the corresponding weighting numerical value is not obtained in the at least two Redis nodes, selecting a next Redis node from the at least two Redis nodes, determining the next Redis node as a current Redis first node, and jumping to step S402, and executing the steps in a circulating manner until target evaluation reference information is obtained.
By the embodiment provided by the application, the following steps are executed until the target evaluation reference information is obtained: determining a current Redis first node from at least two Redis nodes, and acquiring current evaluation reference information corresponding to the first node of the current Redis first node and current weight corresponding to the node type of the current Redis first node; performing weighting calculation on the current evaluation reference information by using the current weight to obtain a current weighting numerical value; summing the current weighted data and the obtained weighted numerical value to obtain a current target evaluation reference numerical value; under the condition that each Redis node obtains a corresponding weighted numerical value, determining a current target evaluation reference value as target evaluation reference information; under the condition that corresponding weighting numerical values are not obtained in at least two Redis nodes, selecting a next Redis node from the at least two Redis nodes, and determining the next Redis node as a current Redis first node;
the method for performing weighted summation calculation on the evaluation reference information corresponding to each Redis node is utilized to determine target evaluation reference information, wherein the target evaluation reference information is used for determining target state information reflecting the overall health degree of the Redis set, and further, the purposes of quantifying each index corresponding to each Redis node in the Redis set and determining the overall health state of the Redis set truly, comprehensively and completely by combining node weights are achieved, so that the technical effect of improving the accuracy of acquiring the Redis state information is achieved.
As an optional scheme, after obtaining evaluation reference information corresponding to each Redis node in the Redis set, the method further includes:
s1, determining abnormal state information corresponding to a Redis set under the condition that evaluation reference information corresponding to each Redis node meets an abnormal state condition, wherein the abnormal state information is used for prompting that the overall health degree of the Redis set is smaller than or equal to a health degree threshold value.
Optionally, in this embodiment, the abnormal state information may be, but is not limited to, used to prompt that the overall health degree of the Redis set is less than or equal to a health degree threshold, and may be, but is not limited to, used to indicate that the number of abnormal Redis nodes in the Redis set is greater than or equal to an abnormal node number threshold.
For further example, each Redis node in the Redis set corresponds to respective evaluation reference information, where each evaluation reference information corresponds to an associated index value. The initial value of the index value is 100, and when an abnormal event is triggered in the Redis node, the index value deducts a value corresponding to the abnormal event, wherein the abnormal event may be, but is not limited to, an availability abnormality, an association abnormality, a performance abnormality, and the like for indicating the Redis node. And when the number of Redis nodes with index values not greater than 0 in the Redis set is greater than or equal to the abnormal node number threshold value, determining that the overall health degree of the Redis set is less than or equal to the health degree threshold value.
It should be noted that, when the number of Redis nodes with index values not greater than 0 in the Redis set is greater than or equal to half of the number of Redis nodes in the Redis set, it is determined that at least half of the Redis nodes in the Redis set are unavailable, and the overall health of the Redis set is determined to be 0.
Through the embodiment provided by the application, the abnormal state information corresponding to the Redis set is determined under the condition that the evaluation reference information corresponding to each Redis node meets the abnormal state condition, wherein the abnormal state information is used for prompting that the overall health degree of the Redis set is smaller than or equal to the health degree threshold value.
As an optional scheme, acquiring evaluation reference information corresponding to each Redis node in a Redis set includes:
executing the following steps until the evaluation reference information corresponding to each Redis node meets the abnormal state condition, or the evaluation reference information corresponding to each Redis node meets the initial state condition:
s1, determining a current Redis second node from at least two Redis nodes, and obtaining an initial index value of the current Redis second node and a value to be deducted of the current Redis second node, wherein the value to be deducted is used for representing a value required to be deducted when the current Redis second node does not meet a preset index;
s2, calculating the difference between the initial index value and the value to be deducted to obtain a current index value, and determining the current index value as evaluation reference information corresponding to a current Redis second node;
s3, under the condition that each Redis node obtains corresponding evaluation reference information, counting the target number of index values corresponding to the evaluation reference information, wherein the index values are smaller than or equal to a first abnormal threshold value;
s4, determining that the evaluation reference information corresponding to each Redis node meets the abnormal state condition under the condition that the target number is larger than or equal to a second abnormal threshold; or determining that the evaluation reference information corresponding to each Redis node meets the initial state condition under the condition that the target number is smaller than the second abnormal threshold;
s5, after determining that the evaluation reference information corresponding to each Redis node meets the initial state condition, the method further comprises the following steps: and acquiring target evaluation reference information.
Optionally, in this embodiment, the current Redis second node corresponds to an initial index value and a value to be deducted, where the value to be deducted may be but is not limited to a value used for representing deduction required when the current Redis second node does not satisfy a preset index, and the preset index may include but is not limited to an availability index, an association index, and a performance index.
For further example, as shown in table 1, the preset indexes include an availability index, a correlation index, and a performance index, where the availability index includes a survival condition index and a counter-affinity index; the associated indexes comprise cluster state indexes, slot position condition indexes and master-slave link state indexes; the performance indexes comprise a use memory condition index, a memory fragment rate index, a connection number index, a rejected connection number index, a persistence time index, a cache hit rate index and a slow log index.
It should be noted that, as shown in table 1, each preset index corresponds to a corresponding rule, a deduction score, and a condition for triggering score deduction, for example, when a reverse affinity rule is triggered, that is, when a master node and a slave node ip are uniformly configured and the master node ip is the same, a plurality of master nodes exist in the same host, and a plurality of sentinels exist in the same machine, a deduction score operation of 15 values is performed on the index value of the current Redis node.
TABLE 1
Figure BDA0004004318440000151
It should be noted that, it is assumed that the first exception threshold is set to be 0, and the second exception threshold is half of the number of Redis nodes in the Redis set; counting the target number of index values corresponding to the evaluation reference information, which is less than or equal to 0, under the condition that each Redis node obtains the corresponding evaluation reference information; in a case where the target number is greater than or equal to half of the number of Redis nodes in the Redis set, determining that at least half of the Redis nodes in the Redis set are unavailable, and determining that the overall health of the Redis set is 0.
It should be noted that, when the target number is smaller than the second abnormal threshold, it is determined that the evaluation reference information corresponding to each Redis node satisfies the initial state condition; and after determining that the evaluation reference information corresponding to each Redis node satisfies the initial state condition, the method further comprises: and acquiring target evaluation reference information.
For example, as shown in fig. 5, the method for acquiring evaluation reference information corresponding to each Redis node in the Redis set specifically includes the following steps:
step S502, determining a current Redis second node from at least two Redis nodes, and obtaining an initial index value of the current Redis second node and a value to be deducted of the current Redis second node, wherein the value to be deducted is used for representing a value required to be deducted when the current Redis second node does not meet a preset index;
step S504, calculating the difference between the initial index value and the value to be deducted to obtain the current index value, and determining the current index value as the evaluation reference information corresponding to the current Redis second node;
step S506, judging whether each Redis node obtains corresponding evaluation reference information at present;
step S508, under the condition that corresponding assessment reference information is not obtained in at least two Redis nodes, selecting a next Redis node from the at least two Redis nodes, determining the next Redis node as a current Redis second node, and jumping to step S502, and executing the steps in a circulating manner until each Redis node obtains the corresponding assessment reference information;
step S510, under the condition that each Redis node obtains corresponding evaluation reference information at present, counting the target number of index values corresponding to the evaluation reference information, wherein the index values are smaller than or equal to a first abnormal threshold value;
step S512, judging whether the target number is greater than or equal to a second abnormal threshold value;
step S514, determining that the evaluation reference information corresponding to each Redis node meets the abnormal state condition under the condition that the target number is greater than or equal to the second abnormal threshold;
step S516, determining that the evaluation reference information corresponding to each Redis node meets the initial state condition under the condition that the target number is smaller than a second abnormal threshold;
step S518, after determining that the evaluation reference information corresponding to each Redis node satisfies the initial state condition, acquiring target evaluation reference information.
According to the embodiment provided by the application, the following steps are executed until the evaluation reference information corresponding to each Redis node meets the abnormal state condition, or the evaluation reference information corresponding to each Redis node meets the initial state condition: determining a current Redis second node from at least two Redis nodes, and acquiring an initial index value of the current Redis second node and a value to be deducted of the current Redis second node, wherein the value to be deducted is used for representing a value required to be deducted when the current Redis second node does not meet a preset index; calculating the difference between the initial index value and the value to be deducted to obtain a current index value, and determining the current index value as the evaluation reference information corresponding to the current Redis second node; under the condition that each Redis node obtains corresponding evaluation reference information, counting the target number of index values corresponding to the evaluation reference information, wherein the index values are smaller than or equal to a first abnormal threshold value; determining that the evaluation reference information corresponding to each Redis node meets an abnormal state condition under the condition that the target number is greater than or equal to a second abnormal threshold; or determining that the evaluation reference information corresponding to each Redis node meets the initial state condition under the condition that the target number is smaller than the second abnormal threshold; after determining that the evaluation reference information corresponding to each Redis node satisfies the initial state condition, the method further includes: acquiring target evaluation reference information;
the target evaluation reference information is determined by using the method for acquiring the evaluation reference information corresponding to each Redis node, wherein the target evaluation reference information is used for determining the target state information reflecting the overall health degree of the Redis set, so that the aims of quantifying each index corresponding to each Redis node in the Redis set and determining the overall health state of the Redis set truly, comprehensively and completely by combining the node weight are fulfilled, and the technical effect of improving the accuracy of acquiring the Redis state information is realized.
As an optional scheme, performing integrated calculation on the evaluation reference information corresponding to each Redis node by using a preset weight corresponding to the node type to which each Redis node belongs to obtain target evaluation reference information, including:
s1, determining a plurality of pieces of evaluation reference information meeting a first confidence condition from the evaluation reference information corresponding to each Redis node;
and S2, integrating and calculating the plurality of pieces of evaluation reference information by using preset weights corresponding to node types to which Redis nodes corresponding to the evaluation reference information in the plurality of pieces of evaluation reference information belong to obtain target evaluation reference information.
It should be noted that the index values corresponding to the evaluation reference information corresponding to the acquired Redis nodes are all greater than the first anomaly threshold.
Optionally, in this embodiment, the first confidence condition may be, but is not limited to, configured to indicate that, from the evaluation reference information corresponding to the Redis node whose index value is greater than the first anomaly threshold value, a plurality of evaluation reference information used for obtaining the target evaluation reference information through the integration calculation are determined.
According to the embodiment provided by the application, a plurality of evaluation reference information meeting a first confidence condition are determined from the evaluation reference information corresponding to each Redis node; and performing integrated calculation on the plurality of evaluation reference information by using the preset weight corresponding to the node type to which the Redis node corresponding to each evaluation reference information in the plurality of evaluation reference information belongs to obtain the target evaluation reference information.
As an optional scheme, obtaining target state information corresponding to a Redis set based on the target evaluation reference information includes:
s1, determining the target evaluation reference information as target state information under the condition that the target evaluation reference information meets a second confidence condition; or the like, or, alternatively,
s2, under the condition that the target evaluation reference information does not meet a second confidence condition, acquiring integral reference information associated with the Redis set;
and S3, integrating the whole reference information and the target evaluation reference information to obtain target state information.
Optionally, in this embodiment, the second confidence condition may be, but is not limited to, used to indicate whether an index value corresponding to the target evaluation parameter information is greater than or equal to a preset health threshold.
It should be noted that, when the index value corresponding to the target evaluation parameter is greater than or equal to the preset health threshold, it is determined that the Redis set is in the overall health state, and the target evaluation reference information is directly determined as the target state information.
It should be noted that, when the index value corresponding to the target evaluation parameter is smaller than the preset health threshold, it is determined that the Redis set is in an overall abnormal state, and the target evaluation reference information and the overall reference information associated with the Redis set are determined as target state information, where the overall reference information associated with the Redis set may include, but is not limited to, information related to the Redis set and corresponding warning information, and the information related to the Redis set may include, but is not limited to, architecture type information of the Redis set, project information related to the Redis set, and a plurality of Redis node information (ip information, port information, role information, and the like) included in the Redis set.
According to the embodiment provided by the application, the target evaluation reference information is determined as the target state information under the condition that the target evaluation reference information meets the second confidence condition; or, under the condition that the target evaluation reference information does not meet the second confidence condition, acquiring the integral reference information associated with the Redis set; and integrating the overall reference information and the target evaluation reference information to obtain target state information. By judging whether the target evaluation reference information reaches the preset health threshold value or not and determining the target state information by combining the integral reference information associated with the Redis set under the condition that the preset health threshold value is not met, the more detailed and complete information of the Redis set health degree under the abnormal condition can be acquired by a user, and therefore the technical effects of improving the accuracy of acquiring the Redis state information and the monitoring efficiency of the Redis set by the user are achieved.
As an optional scheme, the method for acquiring the Redis status information is applied to an application scenario in which the Redis health degree is calculated based on the evaluation index deduction rule, as shown in fig. 6, and the specific steps are as follows:
step S602, acquiring an evaluation index: acquiring evaluation indexes corresponding to each Redis node in the Redis set through Prometheus;
step S604, determining whether the evaluation index satisfies the deduction rule: comparing evaluation indexes corresponding to the Redis nodes based on the score deduction rules and the triggering conditions shown in the table 1;
step S606, calculating each deduction item: under the condition that a certain evaluation index corresponding to the current Redis node meets a deduction rule, correspondingly deducting the index value corresponding to the current Redis node to obtain a target index value corresponding to each Redis node, wherein the initial value of the index value is 100;
it should be noted that, when a certain evaluation index corresponding to the current Redis node does not satisfy the deduction rule, the process returns to step S602, and continues to obtain the next evaluation index until all evaluation indexes corresponding to all Redis nodes are obtained;
step S608, the final health degree is integrated and calculated according to the node weight: and under the condition that the target index values corresponding to the Redis nodes meet the confidence conditions of the integration calculation, combining the preset weight integration calculation corresponding to the Redis nodes to obtain the health degrees corresponding to the Redis sets.
As an optional scheme, the method for acquiring the Redis state information is applied to an application scenario of saving and displaying the overall health degree of the Redis architecture, as shown in fig. 7, and the specific steps are as follows:
step S702, reading information such as Redis architecture and the like stored in a database, wherein the partial information comprises the type (standby, sentinel, cluster) of the Redis architecture, a Redis password and information (ip, port and role) of each node of the Redis;
step S704, obtaining each index of each node through Prometheus, where the specific index is shown in table 1, and is not described again in this embodiment;
step S706, sequentially carrying out rule judgment on each index of each node to obtain the health degree of each node, and weighting to obtain the integral health degree of the Redis architecture;
and step S708, storing the Redis architecture overall health degree result to a database, and completing display back in a page to obtain the health degree of the corresponding Redis project.
It is understood that in the specific implementation of the present application, related data such as user information, when the above embodiments of the present application are applied to specific products or technologies, user permission or consent needs to be obtained, and the collection, use and processing of related data need to comply with related laws and regulations and standards of related countries and regions.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
According to another aspect of the embodiment of the present application, there is also provided an apparatus for acquiring Redis status information, which is used for implementing the method for acquiring Redis status information. As shown in fig. 8, the apparatus includes:
a first obtaining unit 802, configured to obtain evaluation reference information corresponding to each Redis node in a Redis set, where the Redis set includes at least two Redis nodes, node types of the Redis nodes include at least two types, and the evaluation reference information is used to provide evaluation references for each index of the Redis nodes;
the integration unit 804 is configured to perform integration calculation on the evaluation reference information corresponding to each Redis node by using a preset weight corresponding to a node type to which each Redis node belongs, so as to obtain target evaluation reference information;
a second obtaining unit 806, configured to obtain target state information corresponding to the Redis set based on the target evaluation reference information, where the target state information is used to evaluate an overall health degree of the Redis set.
As an alternative, the integration unit 804 includes: and the weighted summation module is used for carrying out weighted summation calculation on the evaluation reference information corresponding to each Redis node to obtain target evaluation reference information, wherein the weight used in the weighted summation calculation is a preset weight corresponding to the node type to which each Redis node belongs.
As an optional solution, the weighted summation module includes: the first obtaining submodule is used for determining a current Redis first node from at least two Redis nodes, and obtaining current evaluation reference information corresponding to the current Redis first node and current weight corresponding to the node type of the current Redis first node until target evaluation reference information is obtained; the weighting submodule is used for carrying out weighting calculation on the current evaluation reference information by using the current weight to obtain a current weighting numerical value until target evaluation reference information is obtained; the summation submodule is used for summing the current weighted data and the obtained weighted numerical value to obtain a current target evaluation reference numerical value until target evaluation reference information is obtained; the determining submodule is used for determining the current target evaluation reference value as target evaluation reference information under the condition that each Redis node obtains the corresponding weighted value until the target evaluation reference information is obtained; and the second obtaining submodule is used for selecting a next Redis node from the at least two Redis nodes under the condition that corresponding weighting numerical values are not obtained in the at least two Redis nodes, and determining the next Redis node as a current Redis first node until target evaluation reference information is obtained.
As an optional solution, the apparatus further includes: the first determining module is used for determining abnormal state information corresponding to the Redis set under the condition that the evaluation reference information corresponding to each Redis node meets abnormal state conditions after the evaluation reference information corresponding to each Redis node in the Redis set is obtained, wherein the abnormal state information is used for prompting that the overall health degree of the Redis set is smaller than or equal to a health degree threshold value.
As an optional solution, the first obtaining unit 802 includes: the first obtaining module is used for determining a current Redis second node from at least two Redis nodes, and obtaining an initial index value of the current Redis second node and a value to be deducted of the current Redis second node, wherein the value to be deducted is used for representing a numerical value required to be deducted when the current Redis second node does not meet a preset index until evaluation reference information corresponding to each Redis node meets an abnormal state condition or the evaluation reference information corresponding to each Redis node meets the initial state condition; the second determination module is used for calculating the difference between the initial index value and the value to be deducted to obtain a current index value, and determining the current index value as the evaluation reference information corresponding to the current Redis second node until the evaluation reference information corresponding to each Redis node meets the abnormal state condition or the evaluation reference information corresponding to each Redis node meets the initial state condition; the counting module is used for counting the target number of index values corresponding to the evaluation reference information which are less than or equal to a first abnormal threshold value under the condition that each Redis node obtains the corresponding evaluation reference information until the evaluation reference information corresponding to each Redis node meets the abnormal state condition or the evaluation reference information corresponding to each Redis node meets the initial state condition; the third determining module is used for determining that the evaluation reference information corresponding to each Redis node meets the abnormal state condition under the condition that the target number is greater than or equal to the second abnormal threshold; or under the condition that the target number is smaller than the second abnormal threshold, determining that the evaluation reference information corresponding to each Redis node meets the initial state condition until the evaluation reference information corresponding to each Redis node meets the abnormal state condition or the evaluation reference information corresponding to each Redis node meets the initial state condition; the above-mentioned device still includes: and the second acquisition module is used for acquiring the target evaluation reference information after determining that the evaluation reference information corresponding to each Redis node meets the initial state condition until the evaluation reference information corresponding to each Redis node meets the abnormal state condition or the evaluation reference information corresponding to each Redis node meets the initial state condition.
As an alternative, the integration unit 804 includes: the fourth determining module is used for determining a plurality of pieces of evaluation reference information meeting the first confidence condition from the evaluation reference information corresponding to each Redis node; and the calculation module is used for integrating and calculating the plurality of evaluation reference information by using the preset weight corresponding to the node type to which the Redis node corresponding to each evaluation reference information in the plurality of evaluation reference information belongs to obtain the target evaluation reference information.
As an optional solution, the second obtaining unit 806 includes: the fifth determining module is used for determining the target evaluation reference information as the target state information under the condition that the target evaluation reference information meets the second confidence condition; or, the third obtaining module is configured to obtain the overall reference information associated with the Redis set when the target evaluation reference information does not satisfy the second confidence condition; and the integration module is used for integrating the overall reference information and the target evaluation reference information to obtain target state information.
For a specific embodiment, reference may be made to an example shown in the foregoing method for acquiring Redis state information, and details in this example are not described here again.
According to yet another aspect of the embodiments of the present application, there is further provided an electronic apparatus for implementing the method for acquiring Redis status information, as shown in fig. 9, the electronic apparatus includes a memory 902 and a processor 904, the memory 902 stores a computer program, and the processor 904 is configured to execute the steps in any one of the method embodiments by the computer program.
Optionally, in this embodiment, the electronic apparatus may be located in at least one network device of a plurality of network devices of a computer network.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
the method comprises the steps of S1, obtaining evaluation reference information corresponding to each Redis node in a Redis set, wherein the Redis set comprises at least two Redis nodes, the node types of the Redis nodes comprise at least two types, and the evaluation reference information is used for providing evaluation reference for each index of the Redis nodes;
s2, integrating and calculating the evaluation reference information corresponding to each Redis node by using the preset weight corresponding to the node type to which each Redis node belongs to obtain target evaluation reference information;
and S3, acquiring target state information corresponding to the Redis set based on the target evaluation reference information, wherein the target state information is used for evaluating the overall health degree of the Redis set.
Alternatively, it can be understood by those skilled in the art that the structure shown in fig. 9 is only an illustration, and the electronic device may also be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 9 is a diagram illustrating the structure of the electronic device. For example, the electronic device may also include more or fewer components than shown in fig. 9, such as network interfaces, etc.), or have a different configuration than shown in fig. 9.
The memory 902 may be configured to store software programs and modules, such as program instructions/modules corresponding to the method and apparatus for acquiring Redis state information in the embodiment of the present application, and the processor 904 executes various functional applications and data processing by running the software programs and modules stored in the memory 902, that is, implements the method for acquiring Redis state information. The memory 902 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 902 can further include memory located remotely from the processor 904, which can be connected to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. The memory 902 may be, but not limited to, specifically configured to store evaluation reference information, target status information, and other information. As an example, as shown in fig. 9, the memory 902 may include, but is not limited to, a first obtaining unit 902, an integrating unit 804, and a second obtaining unit 806 in the obtaining apparatus for the Redis status information. In addition, the device may further include, but is not limited to, other module units in the above apparatus for acquiring the Redis status information, which is not described in detail in this example.
Optionally, the transmitting device 906 is used for receiving or sending data via a network. Examples of the network may include a wired network and a wireless network. In one example, the transmitting device 906 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices to communicate with the internet or a local area Network. In one example, the transmission device 809 is a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In addition, the electronic device further includes: a display 908 for displaying the above evaluation reference information, target status information, and the like; and a connection bus 910 for connecting the respective module parts in the above-described electronic apparatus.
In other embodiments, the terminal device or the server may be a node in a distributed system, where the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting a plurality of nodes through a network communication. The nodes may form a Peer-To-Peer (P2P) network, and any type of computing device, such as a server, a terminal, and other electronic devices, may become a node in the blockchain system by joining the Peer-To-Peer network.
According to an aspect of the application, there is provided a computer program product comprising a computer program/instructions containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication section, and/or installed from a removable medium. When executed by the central processing unit, the computer program performs various functions provided by the embodiments of the present application.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
It should be noted that the computer system of the electronic device is only an example, and should not bring any limitation to the functions and the scope of the application of the embodiments.
The computer system includes a Central Processing Unit (CPU) that can perform various appropriate actions and processes according to a program stored in a Read-Only Memory (ROM) or a program loaded from a storage section into a Random Access Memory (RAM). In the random access memory, various programs and data necessary for the operation of the system are also stored. The central processor, the read-only memory and the random access memory are connected with each other through a bus. An Input/Output interface (i.e., I/O interface) is also connected to the bus.
The following components are connected to the input/output interface: an input section including a keyboard, a mouse, and the like; an output section including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section including a hard disk and the like; and a communication section including a network interface card such as a local area network card, a modem, or the like. The communication section performs communication processing via a network such as the internet. The driver is also connected to the input/output interface as needed. A removable medium such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive as necessary, so that a computer program read out therefrom is mounted into the storage section as necessary.
In particular, according to embodiments of the present application, the processes described in the various method flowcharts may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication section, and/or installed from a removable medium. The computer program, when executed by the central processor, performs various functions defined in the system of the present application.
According to an aspect of the present application, there is provided a computer-readable storage medium from which a processor of a computer device reads computer instructions, the processor executing the computer instructions to cause the computer device to perform the method provided in the above-mentioned various alternative implementations.
Alternatively, in the present embodiment, the above-mentioned computer-readable storage medium may be configured to store a computer program for executing the steps of:
s1, obtaining evaluation reference information corresponding to each Redis node in a Redis set, wherein the Redis set comprises at least two Redis nodes, the node types of the Redis nodes comprise at least two types, and the evaluation reference information is used for providing evaluation reference for each index of the Redis nodes;
s2, integrating and calculating the evaluation reference information corresponding to each Redis node by using the preset weight corresponding to the node type to which each Redis node belongs to obtain target evaluation reference information;
and S3, acquiring target state information corresponding to the Redis set based on the target evaluation reference information, wherein the target state information is used for evaluating the overall health degree of the Redis set.
Alternatively, in this embodiment, a person skilled in the art may understand that all or part of the steps in the methods of the foregoing embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, read-Only memories (ROMs), random Access Memories (RAMs), magnetic or optical disks, and the like.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solutions of the present application, which are essential or part of the technical solutions contributing to the prior art, or all or part of the technical solutions, may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, or the like) to execute all or part of the steps of the methods described in the embodiments of the present application.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (10)

1. A method for acquiring Redis state information is characterized by comprising the following steps:
obtaining evaluation reference information corresponding to each Redis node in a Redis set, wherein the Redis set comprises at least two Redis nodes, the node types of the Redis nodes comprise at least two types, and the evaluation reference information is used for providing evaluation reference for each index of the Redis nodes;
integrating and calculating the evaluation reference information corresponding to each Redis node by using the preset weight corresponding to the node type to which each Redis node belongs to obtain target evaluation reference information;
and acquiring target state information corresponding to the Redis set based on the target evaluation reference information, wherein the target state information is used for evaluating the overall health degree of the Redis set.
2. The method according to claim 1, wherein the integrating and calculating the evaluation reference information corresponding to each Redis node by using the preset weight corresponding to the node type to which each Redis node belongs to obtain target evaluation reference information comprises:
and performing weighted summation calculation on the evaluation reference information corresponding to each Redis node to obtain the target evaluation reference information, wherein the weight used in the weighted summation calculation is a preset weight corresponding to the node type to which each Redis node belongs.
3. The method according to claim 2, wherein the performing a weighted summation calculation on the evaluation reference information corresponding to each Redis node to obtain the target evaluation reference information comprises:
executing the following steps until the target evaluation reference information is obtained:
determining a current Redis first node from the at least two Redis nodes, and acquiring current evaluation reference information corresponding to the current Redis and current weight corresponding to the node type of the current Redis first node;
performing weighting calculation on the current evaluation reference information by using the current weight to obtain a current weighting numerical value;
summing the current weighted data and the obtained weighted numerical value to obtain a current target evaluation reference numerical value;
determining the current target evaluation reference value as the target evaluation reference information under the condition that each Redis node obtains the corresponding weighted value;
and under the condition that corresponding weighting numerical values are not obtained in the at least two Redis nodes, selecting a next Redis node from the at least two Redis nodes, and determining the next Redis node as the current Redis first node.
4. The method according to claim 1, wherein after the obtaining of the evaluation reference information corresponding to each Redis node in the Redis set, the method further comprises:
and under the condition that the evaluation reference information corresponding to each Redis node meets an abnormal state condition, determining abnormal state information corresponding to the Redis set, wherein the abnormal state information is used for prompting that the overall health degree of the Redis set is less than or equal to a health degree threshold value.
5. The method according to claim 4, wherein the obtaining of evaluation reference information corresponding to each Redis node in the Redis set comprises:
executing the following steps until the evaluation reference information corresponding to each Redis node meets the abnormal state condition, or the evaluation reference information corresponding to each Redis node meets the initial state condition:
determining a current Redis second node from the at least two Redis nodes, and acquiring an initial index value of the current Redis second node and a value to be deducted of the current Redis second node, wherein the value to be deducted is used for representing a value required to be deducted when the current Redis second node does not meet a preset index;
calculating the difference between the initial index value and the value to be deducted to obtain a current index value, and determining the current index value as evaluation reference information corresponding to the current Redis second node;
under the condition that each Redis node obtains corresponding evaluation reference information, counting the target number of index values corresponding to the evaluation reference information, wherein the index values are smaller than or equal to a first abnormal threshold value;
determining that the evaluation reference information corresponding to each Redis node meets the abnormal state condition when the target number is greater than or equal to a second abnormal threshold; or, under the condition that the target number is smaller than the second abnormal threshold, determining that the evaluation reference information corresponding to each Redis node meets the initial state condition;
after the determining that the evaluation reference information corresponding to the respective Redis nodes satisfies the initial state condition, the method further includes: and acquiring the target evaluation reference information.
6. The method according to any one of claims 1 to 5, wherein the obtaining target evaluation reference information by performing integrated calculation on the evaluation reference information corresponding to each Redis node by using a preset weight corresponding to a node type to which each Redis node belongs comprises:
determining a plurality of pieces of evaluation reference information meeting a first confidence condition from the evaluation reference information corresponding to each Redis node;
and performing integrated calculation on the plurality of pieces of evaluation reference information by using a preset weight corresponding to the node type to which the Redis node corresponding to each piece of evaluation reference information belongs to obtain the target evaluation reference information.
7. The method according to any one of claims 1 to 5, wherein the obtaining target state information corresponding to the Redis set based on the target evaluation reference information includes:
determining the target evaluation reference information as the target state information under the condition that the target evaluation reference information meets the second confidence condition; or the like, or, alternatively,
under the condition that the target evaluation reference information does not meet the second confidence condition, acquiring integral reference information associated with the Redis set;
and integrating the integral reference information and the target state information to obtain the target state information.
8. An apparatus for acquiring Redis state information, comprising:
the device comprises a first obtaining unit, a second obtaining unit and a third obtaining unit, wherein the first obtaining unit is used for obtaining evaluation reference information corresponding to each Redis node in a Redis set, the Redis set comprises at least two Redis nodes, the node types of the Redis nodes comprise at least two types, and the evaluation reference information is used for providing evaluation reference for each index of the Redis nodes;
the integration unit is used for integrating and calculating the evaluation reference information corresponding to each Redis node by using the preset weight corresponding to the node type of each Redis node to obtain target evaluation reference information;
and a second obtaining unit, configured to obtain target state information corresponding to the Redis set based on the target evaluation reference information, where the target state information is used to evaluate an overall health degree of the Redis set.
9. A computer-readable storage medium, comprising a stored program, wherein the program when executed performs the method of any of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 7 by means of the computer program.
CN202211625514.7A 2022-12-16 2022-12-16 Redis state information acquisition method and device, storage medium and electronic device Pending CN115840679A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211625514.7A CN115840679A (en) 2022-12-16 2022-12-16 Redis state information acquisition method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211625514.7A CN115840679A (en) 2022-12-16 2022-12-16 Redis state information acquisition method and device, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN115840679A true CN115840679A (en) 2023-03-24

Family

ID=85578787

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211625514.7A Pending CN115840679A (en) 2022-12-16 2022-12-16 Redis state information acquisition method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN115840679A (en)

Similar Documents

Publication Publication Date Title
CN111178760B (en) Risk monitoring method, risk monitoring device, terminal equipment and computer readable storage medium
CN109213857A (en) A kind of fraud recognition methods and device
CN114329312A (en) Network asset data evaluation method and device, electronic equipment and storage medium
CN112085588B (en) Method and device for determining safety of rule model and data processing method
CN111756745A (en) Alarm method, alarm device and terminal equipment
CN112948224A (en) Data processing method, device, terminal and storage medium
CN115840679A (en) Redis state information acquisition method and device, storage medium and electronic device
CN110020166B (en) Data analysis method and related equipment
CN108429636B (en) Method and device for positioning abnormal system and electronic equipment
CN113672574A (en) Log processing method, electronic device and computer-readable storage medium
CN113821316A (en) Abnormal process detection method and device, storage medium and electronic equipment
CN111294411A (en) Monitoring system
CN115396280B (en) Alarm data processing method, device, equipment and storage medium
CN113535885B (en) Age prediction method and device based on user nickname and electronic equipment
CN116109034A (en) Data quality evaluation method and device and electronic equipment
CN109726075B (en) Abnormal data index analysis method and device
CN110032488B (en) Monitoring system, method and device for specific nodes in cluster and service server
CN117909213A (en) Method, device, equipment and storage medium for evaluating software reliability
CN114648323A (en) Service scene oriented call chain processing method, device and medium
CN116668138A (en) Abnormality detection method, abnormality detection device and storage medium
CN117829592A (en) Configurable model-based risk assessment method and device
CN117294630A (en) Communication protocol testing method, device, computer equipment and storage medium
CN117372053A (en) Data asset value evaluation method, device and storage medium
CN117035450A (en) Method and device for determining management policy and storage medium
CN114663200A (en) Product recommendation method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination