CN117707830B - Redis connection abnormality processing method, electronic equipment and storage medium - Google Patents

Redis connection abnormality processing method, electronic equipment and storage medium Download PDF

Info

Publication number
CN117707830B
CN117707830B CN202410157030.7A CN202410157030A CN117707830B CN 117707830 B CN117707830 B CN 117707830B CN 202410157030 A CN202410157030 A CN 202410157030A CN 117707830 B CN117707830 B CN 117707830B
Authority
CN
China
Prior art keywords
abnormal
client
feature vector
target
list
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410157030.7A
Other languages
Chinese (zh)
Other versions
CN117707830A (en
Inventor
周明涛
张军涛
佟业新
鲍昕宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Travelsky Mobile Technology Co Ltd
Original Assignee
China Travelsky Mobile 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 China Travelsky Mobile Technology Co Ltd filed Critical China Travelsky Mobile Technology Co Ltd
Priority to CN202410157030.7A priority Critical patent/CN117707830B/en
Publication of CN117707830A publication Critical patent/CN117707830A/en
Application granted granted Critical
Publication of CN117707830B publication Critical patent/CN117707830B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention provides a method for processing Redis connection abnormality, electronic equipment and a storage medium, and relates to the field of processing Redis connection abnormality, wherein the method comprises the following steps: acquiring each initial client to obtain an initial client list A; traversing A, and if A i meets a preset abnormality judgment condition, determining A i as an abnormality client; acquiring each abnormal problem corresponding to each abnormal client; generating an abnormal problem feature vector corresponding to each abnormal client to obtain an abnormal problem feature vector list W; determining a target processing strategy corresponding to each abnormal client according to the W and the processing strategies corresponding to the historical abnormal problems to obtain a target processing strategy list set T; send T j to B j, causing B j to execute at least one target processing policy in T j; the invention can realize the purpose of rapidly processing the abnormal connection when the application program is abnormally connected with the corresponding Redis.

Description

Redis connection abnormality processing method, electronic equipment and storage medium
Technical Field
The present invention relates to the field of processing Redis connection exceptions, and in particular, to a method for processing Redis connection exceptions, an electronic device, and a storage medium.
Background
Remote dictionary service (Remote Dictionary Server, redis) is an open-source log-type, key-Value database written in ANSI C language, supporting network, and capable of being based on memory and persistent; redis is widely used in various fields, for example, in the civil aviation field, a plurality of different civil aviation related applications are deployed on a plurality of clients, and the applications are usually civil aviation management related applications, and the applications are connected with a plurality of servers in a preset server cluster which is associated with civil aviation data and is deployed with Redis; in practical application, there are some improper instructions used by the application programs, which causes the situation that the corresponding application program has higher delay in accessing the connected server or has connection errors, and when the application program is abnormally connected with the corresponding Redis, how to quickly process the connection abnormality becomes a problem to be solved.
Disclosure of Invention
Aiming at the technical problems, the invention adopts the following technical scheme:
according to a first aspect of the present application, there is provided a method for handling Redis connection abnormality, the method comprising the steps of:
S100, obtaining each initial client to obtain an initial client list a= (a 1,A2,…,Ai,…,An), i=1, 2, …, n; wherein A i is the obtained i-th initial client, and n is the obtained number of initial clients; the initial client is a client which is deployed with a target abnormal application program and is in communication connection with a preset Redis; the target abnormal application is any one of a number of abnormal applications.
S200, traversing a, if a i meets a preset abnormality judgment condition, determining a i as an abnormal client to obtain an abnormal client list b= (B 1,B2,…,Bj,…,Bm), j=1, 2, …, m; wherein, B j is the determined j-th abnormal client, and m is the determined number of abnormal clients; the abnormal client is a client with abnormal connection.
S300, obtaining each abnormal problem corresponding to each abnormal client to obtain an abnormal problem list set Q= (Q 1,Q2,…,Qj,…,Qm); wherein, Q j is an abnormal problem list corresponding to B j.
S400, generating an abnormal problem feature vector corresponding to each abnormal client according to Q to obtain an abnormal problem feature vector list W= (W 1,W2,…,Wj,…,Wm); wherein W j is the anomaly issue feature vector corresponding to B j.
S500, determining a target processing strategy corresponding to each abnormal client according to W and processing strategies corresponding to a plurality of historical abnormal problems to obtain a target processing strategy list set T= (T 1,T2,…,Tj,…,Tm); wherein, T j is a target processing strategy list corresponding to B j; t j includes several target processing strategies.
S600, traversing T, sending T j to B j, causing B j to execute at least one target processing policy in T j to eliminate the connection exception present in B j.
According to another aspect of the present application, there is also provided a non-transitory computer readable storage medium storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by a processor to implement the method for handling the dis connection exception described above.
According to another aspect of the present application, there is also provided an electronic device comprising a processor and the above-described non-transitory computer-readable storage medium.
The invention has at least the following beneficial effects:
According to the Redis connection abnormality processing method, each initial client side deployed with the target application is obtained, and a plurality of abnormal client sides are determined from all the initial client sides according to preset abnormality judgment conditions; acquiring each abnormal problem corresponding to each abnormal client, and generating an abnormal problem feature vector corresponding to each abnormal client according to each abnormal problem corresponding to each abnormal client; according to the abnormal problem feature vector corresponding to each abnormal client and the processing strategy corresponding to the historical abnormal problem, determining a target processing strategy corresponding to each abnormal client, and sending the target processing strategy to the corresponding abnormal client, so that the abnormal client executes the target processing strategy to eliminate the abnormal problem, and the aim of rapidly processing the connection abnormality when the application program is connected with the corresponding Redis is achieved.
Further, when determining the target processing strategy of the abnormal client, according to the processing strategy corresponding to the historical abnormal problem, the processing strategy corresponding to the historical abnormal problem can solve the corresponding abnormal problem; therefore, the determined target processing strategy is more in line with the corresponding abnormal problem, so that the efficiency of solving the corresponding abnormal connection is higher.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a method for handling Redis connection abnormality according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to fall within the scope of the invention.
It is noted that various aspects of the embodiments are described below within the scope of the following claims. It should be apparent that the aspects described herein may be embodied in a wide variety of forms and that any specific structure and/or function described herein is merely illustrative. Based on the present disclosure, one skilled in the art will appreciate that one aspect described herein may be implemented independently of any other aspect, and that two or more of these aspects may be combined in various ways. For example, an apparatus may be implemented and/or a method practiced using any number of the aspects set forth herein. In addition, such apparatus may be implemented and/or such methods practiced using other structure and/or functionality in addition to one or more of the aspects set forth herein.
A method for handling the Redis connection exception will be described with reference to a flowchart of the method for handling the Redis connection exception shown in fig. 1.
The processing method of Redis connection exception may include the following steps:
S100, obtaining each initial client to obtain an initial client list a= (a 1,A2,…,Ai,…,An), i=1, 2, …, n; wherein A i is the obtained i-th initial client, and n is the obtained number of initial clients; the initial client is a client which is deployed with a target application program and is in communication connection with a preset Redis; the target application is any one of a number of abnormal applications.
In this embodiment, the application scenario may be an airport in civil aviation, where multiple clients are usually set when the airport manages each service of the airport, for example, the clients may be a computer, a PAD, etc.; an application program with different functions is installed on each client; it will be appreciated that an application may be installed on multiple clients, and that each client may also install multiple different applications; each client is connected with a preset Redis, and the preset Redis is deployed on a preset server cluster.
When the method is applied specifically, a real-time application monitoring platform (Central Application Tracking, CAT) can be used for monitoring the running condition of each application program in real time, and abnormal application programs can be obtained through the CAT, for example, the abnormal application programs can have connection errors or have higher delay for accessing Redis and the like for the application programs; when an abnormality of an application program is monitored, each client terminal installed with the application program can be obtained through CAT to obtain an initial client terminal list A.
S200, traversing a, if a i meets a preset abnormality judgment condition, determining a i as an abnormal client to obtain an abnormal client list b= (B 1,B2,…,Bj,…,Bm), j=1, 2, …, m; wherein, B j is the determined j-th abnormal client, and m is the determined number of abnormal clients; the abnormal client is a client with abnormal connection.
In this embodiment, a certain application program may be installed on a plurality of clients, and when the application program is abnormal, it cannot be indicated that all clients installed with the application program are abnormal, and it is possible that only a part of clients installed with the application program are abnormal, so that it is necessary to determine the abnormal clients.
Further, step S200 includes the steps of:
S210, obtaining the error quantity of each initial client in the A connected with the preset Redis and the average access delay of accessing the preset Redis to obtain an abnormality judgment parameter set list CS= (CS 1,CS2,…,CSi,…,CSn); wherein CS i is an abnormality judgment parameter group corresponding to A i; CS i=(CSi,1,CSi,2);CSi,1 is the number of errors in A i to connect with the preset Redis, and CS i,2 is the average access delay of A i to access the preset Redis.
The CAT can acquire the error quantity of each client provided with the target application program and connected with the preset Redis and the average access delay of accessing the preset Redis, so that an abnormality judgment parameter set corresponding to each initial client can be obtained; for example, if CAT monitors that a 1 is connected to a preset Redis for 3 errors and the average access delay for accessing the preset Redis is 50ms, CS 1 = (3, 50).
S220, traversing CS, and if CS i,1 is not equal to 0 or CS i,2 is more than TE, determining A i as an abnormal client; the TE is a preset average access delay threshold.
In this embodiment, if CS i,1 is not equal to 0, it indicates that there is a connection error in the corresponding initial client, and a i may be directly determined as an abnormal client; if CS i,2 > TE, it means that the average access delay of A i to access the preset Redis is higher, and A i can be determined as an abnormal client; TE may be empirical or analyzed from several historic data.
Further, CS i,2 may be determined by the following steps:
S211, obtaining an access delay corresponding to each preset time point in a preset time period to obtain an access delay list gh= (GH 1,GH2,…,GHp,…,GHq), p=1, 2, …, q corresponding to CS i; wherein GH p is access delay corresponding to the p-th preset time point in the preset time period, and q is the number of the preset time points in the preset time period; the ending time of the preset time period is the current time.
S212, determining CS i,2=1/q×∑q p=1GHp according to GH.
In this embodiment, the preset time period may be 1min, and a plurality of preset time points are set in the preset time period, for example, a preset time point is set every 1s, 60 access delays can be obtained in 1min, and then the average access delay corresponding to the 60 access delays is obtained to obtain GH; meanwhile, setting the ending time of the preset time period as the current time can ensure that all the acquired access delays are the latest access delays, and can ensure the timeliness of judgment.
Optionally, after step S211, it may also be determined whether a i is an anomalous client or not by:
S213, determining the access delay fluctuation rate corresponding to A i according to GH ωi=1/q×[∑q p=1(GHp-1/q×∑q p= 1GHp2].
S214, if omega i is larger than BD, determining A i as an abnormal client; otherwise, determining that a i is not an anomalous client; BD is a preset access delay fluctuation rate threshold.
By the method, whether the A i is an abnormal client can be directly judged only by judging the access delay fluctuation rate corresponding to the A i, when the access delay fluctuation is large and the average access delay is small, the A i can be determined to be the abnormal client, and the accuracy of judging whether the A i is the abnormal client is further improved.
S300, obtaining each abnormal problem corresponding to each abnormal client to obtain an abnormal problem list set Q= (Q 1,Q2,…,Qj,…,Qm); wherein, Q j is an abnormal problem list corresponding to B j.
In this embodiment, the abnormal client may correspond to one abnormal problem or may correspond to a plurality of abnormal problems, and each abnormal problem corresponding to each abnormal client may be obtained through CAT, so as to obtain Q; the abnormal problem may be a preset abnormal problem, and the abnormal phenomenon of the abnormal client accords with which preset abnormal problem, and the abnormal problem is associated with the abnormal client.
It should be noted that, according to actual needs, a person skilled in the art can monitor each client by adopting the existing CAT technology, and meanwhile, can obtain the abnormal problem corresponding to the abnormal client, which is not described herein.
S400, generating an abnormal problem feature vector corresponding to each abnormal client according to Q to obtain an abnormal problem feature vector list W= (W 1,W2,…,Wj,…,Wm); wherein W j is the anomaly issue feature vector corresponding to B j.
In this embodiment, Q j=(Qj,1,Qj,2,…,Qj,r,…,Qj,f(j)), r=1, 2, …, f (j); wherein Q j,r is the r-th anomaly issue corresponding to B j, and f (j) is the number of anomaly issues corresponding to B j; it can be understood that, since the number of anomaly problems corresponding to each anomaly client is different in the present embodiment, f (j) does not refer to a specific function or a function result value, but refers to a value that may be possible according to the specific value of j, for example, when j=1, f (j) =3; when j=2, f (j) =4; when j=3, f (j) =3.
Further, step S400 includes the steps of:
S410, acquiring a preset initial problem feature vector hy= (HY 1,HY2,…,HYa,…,HYb), a=1, 2, …, b; wherein HY a is the element value corresponding to the a-th known abnormal problem, and b is the number of the known abnormal problems; each element value in HY is 0.
In this embodiment, each known abnormal problem can be obtained, for example, the number of known abnormal problems is 4, and the corresponding initial problem feature vector is hy= (0, 0); the elements of each location within the HY correspond to fixed known anomaly issues, e.g., a first 0 corresponds to a first known anomaly issue and a second 0 corresponds to a second known anomaly issue.
S420, traversing Q j, and setting the element value corresponding to Q j,r in HY to be 1 to obtain an abnormal problem feature vector W j corresponding to B j, thereby obtaining an abnormal problem feature vector list W.
Acquiring Q j, traversing Q j, determining the corresponding position of each abnormal problem in Q j in HY, and setting the element value of the position to be 1; for example, Q j includes two anomaly problems corresponding to the first element and the third element in HY respectively, and then the anomaly problem feature vector W j = (1, 0,1, 0) corresponding to Q j.
By the method, the abnormal problems corresponding to the abnormal clients can be converted into the feature vectors which can be recognized by the machine, so that analysis of the abnormal problems corresponding to the abnormal clients is realized.
S500, determining a target processing strategy corresponding to each abnormal client according to W and processing strategies corresponding to a plurality of historical abnormal problems to obtain a target processing strategy list set T= (T 1,T2,…,Tj,…,Tm); wherein, T j is a target processing strategy list corresponding to B j; t j includes several target processing strategies.
Further, step S500 may include the steps of:
S510, obtaining each historical abnormal problem feature vector to obtain a historical abnormal problem feature vector list lg= (LG 1,LG2,…,LGc,…,LGd), c=1, 2, …, d; wherein LG c is the obtained c-th historical abnormal problem feature vector, and d is the number of the obtained historical abnormal problem feature vectors.
In this embodiment, the history record of the database can obtain the abnormal problem corresponding to the abnormal client in history, and the method in step S400 is used to convert the abnormal problem into the corresponding characteristic vector of the abnormal problem in history, so as to obtain LG.
S520, according to LG, acquiring a history processing strategy corresponding to each history abnormal problem feature vector to obtain a history processing strategy list FU= (FU 1,FU2,…,FUc,…,FUd); wherein FU c is a processing policy corresponding to LG c.
It can be understood that a plurality of historical abnormal problems of each historical abnormal client correspond to a historical processing strategy, and the processing strategy can be understood as a method or measure for processing the corresponding abnormal problems; the history processing strategies of the history abnormal problems corresponding to any two history abnormal clients may be the same or different.
S530, clustering LG by using a preset clustering algorithm to obtain a historical anomaly problem feature vector group list JA= (JA 1,JA2,…,JAe,…,JAg), and e=1, 2, … and g; wherein JA e is the e-th historical abnormal problem feature vector group obtained by clustering LGs, and g is the number of the historical abnormal problem feature vector groups obtained by clustering LGs.
In this embodiment, the preset clustering algorithm may be a DBSCAN clustering algorithm, and the clustering algorithm is used without setting the number of clusters, so that clustering can be automatically completed according to the similarity of the feature vectors of the historical abnormal problems in the LG, so that the clustering is more reasonable.
S540, according to the FU, acquiring a history processing strategy group corresponding to each history abnormal problem feature vector group in the JA to obtain a history processing strategy group list KA= (KA 1,KA2,…,KAe,…,KAg); wherein KA e is a history processing policy group corresponding to JA e; KA e=(KAe,1,KAe,2,…,KAe,x,…,KAe,y(e)), x=1, 2, …, y (e); wherein KA e,x is the history processing policy corresponding to the xth history abnormal problem feature vector in JA e, and y (e) is the number of history abnormal problem feature vectors in JA e.
It can be understood that each historical abnormal problem feature vector corresponds to one historical processing policy, so that according to FU, a historical processing policy group corresponding to each historical abnormal problem feature vector group in JA can be obtained to obtain a historical processing policy group list KA.
S550, obtaining initial similarity of each historical abnormal problem feature vector group in W j and JA to obtain an initial similarity list eta j=(ηj,1j,2,…,ηj,e,…,ηj,g corresponding to W j; where η j,e is the initial similarity of W j to JA e.
In this embodiment, an average vector corresponding to each historical abnormal problem feature vector group may be first determined, and then an initial similarity of W j and an average vector corresponding to each historical abnormal problem feature vector group in JA may be determined; the initial similarity may be expressed in terms of euclidean distance; it should be noted that, a person skilled in the art can determine, according to actual needs, the initial similarity of the average vectors corresponding to each historical anomaly problem feature vector group in the JA and W j by using an existing euclidean distance calculation method, which is not described herein.
S560, determining a target similarity mh=max (η j) of W j and JA according to η j; MAX () is a preset maximum function.
In this embodiment, the similarity between the feature vector of the historical anomaly issue corresponding to MH and W j is the highest, i.e., the historical anomaly issue corresponding to MH is the most similar to the anomaly issue corresponding to W j.
S570, determining T j according to MH and KA.
Further, step S570 may include the steps of:
And S571, determining the historical abnormal problem feature vector group corresponding to the MH as a target historical abnormal problem feature vector group.
S572, obtaining a target history processing strategy group corresponding to the target history abnormal problem feature vector group according to the KA.
S573, classifying the same history processing policies in the target history processing policy group into one type to obtain a history processing policy class list ru= (RU 1,RU2,…,RUβ,…,RUγ), β=1, 2, …, γ corresponding to the target history processing policy group; RU β is a β -th historical processing policy class obtained by classifying the historical processing policies in the target historical processing policy group, and γ is the number of the historical processing policy classes obtained by classifying the historical processing policies in the target historical processing policy group; any two history handling policies within RU β are the same; the history processing strategies corresponding to any two history processing strategy classes are different.
It can be appreciated that the target historical processing policy group includes a plurality of historical processing policies, and the same historical processing policies exist, and the same historical processing policies are classified into one category, so as to obtain RU.
S574, obtaining the number of the history processing strategies in each history processing strategy class in the RU to obtain an initial number list NUM= (NUM 1,NUM2,…,NUMβ,…,NUMγ) corresponding to the RU; wherein NUM β is the number of history handling policies in RU β.
And S575, determining the largest v initial numbers in NUM as target numbers to obtain a target number list NUM ' = (NUM ' 1,NUM'2,…,NUM'h,…,NUM'v),h=1,2,…,v;NUM'h is the h largest initial number in NUM; NUM ' k>NUM'k+1, k=1, 2, … and v-1.
S576, determining the history processing strategy corresponding to the NUM' h as a target processing strategy.
In this embodiment, the number of times of the history processing strategies with larger target number is the largest when processing the target history abnormal problems, and the history processing strategies are the most effective in solving the corresponding history abnormal problems; thus, these history processing policies are determined as target processing policies.
S600, traversing T, sending T j to B j, causing B j to execute at least one target processing policy in T j to eliminate the connection exception present in B j.
Further, T j=(Tj,1,Tj,2,…,Tj,h,…,Tj,v); wherein, T j,h is the history processing strategy corresponding to NUM' h; step S600 includes the steps of:
s610, a target value n=1 is acquired.
S620, control B j executes T j,N and judges whether the abnormal problem corresponding to B j is eliminated.
S630, if the abnormal problem corresponding to B j is not eliminated, acquiring n=n+1, and entering step S620; otherwise, the current process is jumped out.
It can be appreciated that there are a plurality of target processing strategies, each having a different priority, the priorities of the target processing strategies within T j decreasing in order of arrangement; when B j executes the target processing policy in T j, firstly executing the first target processing policy with the highest priority, wherein the processing policy may be capable of solving the exception problem corresponding to B j or may not be capable of solving the exception problem corresponding to B j; if the exception problem corresponding to B j cannot be resolved, a second target processing policy is executed.
Optionally, if B j completes execution of each target processing policy in T j and the exception problem corresponding to B j is not completely eliminated, determining a candidate processing policy corresponding to each unresolved exception problem according to a preset problem processing policy mapping table, and executing each candidate processing policy to eliminate all exception problems corresponding to B j.
According to the Redis connection abnormality processing method, initial clients with target applications deployed are obtained, and a plurality of abnormal clients are determined from all the initial clients according to preset abnormality judgment conditions; acquiring each abnormal problem corresponding to each abnormal client, and generating an abnormal problem feature vector corresponding to each abnormal client according to each abnormal problem corresponding to each abnormal client; according to the abnormal problem feature vector corresponding to each abnormal client and the processing strategy corresponding to the historical abnormal problem, determining a target processing strategy corresponding to each abnormal client, and sending the target processing strategy to the corresponding abnormal client, so that the abnormal client executes the target processing strategy to eliminate the abnormal problem, and the aim of rapidly processing the connection abnormality when the application program is connected with the corresponding Redis is achieved.
Further, when determining the target processing strategy of the abnormal client, according to the processing strategy corresponding to the historical abnormal problem, the processing strategy corresponding to the historical abnormal problem can solve the corresponding abnormal problem; therefore, the determined target processing strategy is more in line with the corresponding abnormal problem, so that the efficiency of solving the corresponding abnormal connection is higher.
Furthermore, although the steps of the methods in the present disclosure are depicted in a particular order in the drawings, this does not require or imply that the steps must be performed in that particular order, or that all illustrated steps be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform, etc.
Embodiments of the present invention also provide a non-transitory computer readable storage medium that may be disposed in an electronic device to store at least one instruction or at least one program for implementing one of the methods embodiments, the at least one instruction or the at least one program being loaded and executed by the processor to implement the methods provided by the embodiments described above.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable signal medium may include a data signal propagated in baseband or as part of a carrier wave with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
Embodiments of the present invention also provide an electronic device comprising a processor and the aforementioned non-transitory computer-readable storage medium.
An electronic device according to this embodiment of the application. The electronic device is merely an example, and should not impose any limitations on the functionality and scope of use of embodiments of the present application.
The electronic device is in the form of a general purpose computing device. Components of an electronic device may include, but are not limited to: the at least one processor, the at least one memory, and a bus connecting the various system components, including the memory and the processor.
Wherein the memory stores program code that is executable by the processor to cause the processor to perform steps in various embodiments described herein.
The storage may include readable media in the form of volatile storage, such as Random Access Memory (RAM) and/or cache memory, and may further include Read Only Memory (ROM).
The storage may also include a program/utility having a set (at least one) of program modules including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
The bus may be one or more of several types of bus structures including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures.
The electronic device may also communicate with one or more external devices (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device, and/or with any device (e.g., router, modem, etc.) that enables the electronic device to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface. And, the electronic device may also communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet, through a network adapter. The network adapter communicates with other modules of the electronic device via a bus. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with an electronic device, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, including several instructions to cause a computing device (may be a personal computer, a server, a terminal device, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
Embodiments of the present invention also provide a computer program product comprising program code for causing an electronic device to carry out the steps of the method according to the various exemplary embodiments of the invention as described in the specification, when said program product is run on the electronic device.
While certain specific embodiments of the invention have been described in detail by way of example, it will be appreciated by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the invention. Those skilled in the art will also appreciate that many modifications may be made to the embodiments without departing from the scope and spirit of the invention. The scope of the invention is defined by the appended claims.

Claims (7)

1. A method for handling a Redis connection exception, the method comprising the steps of:
S100, obtaining each initial client to obtain an initial client list a= (a 1,A2,…,Ai,…,An), i=1, 2, …, n; wherein A i is the obtained i-th initial client, and n is the obtained number of initial clients; the initial client is a client which is deployed with a target application program and is in communication connection with a preset Redis; the target application program is any one of a plurality of abnormal application programs;
S200, traversing a, if a i meets a preset abnormality judgment condition, determining a i as an abnormal client to obtain an abnormal client list b= (B 1,B2,…,Bj,…,Bm), j=1, 2, …, m; wherein, B j is the determined j-th abnormal client, and m is the determined number of abnormal clients; the abnormal client is a client with abnormal connection;
S300, obtaining each abnormal problem corresponding to each abnormal client to obtain an abnormal problem list set Q= (Q 1,Q2,…,Qj,…,Qm); q j is an abnormal problem list corresponding to B j; q j=(Qj,1,Qj,2,…,Qj,r,…,Qj,f(j)), r=1, 2, …, f (j); wherein Q j,r is the r-th anomaly issue corresponding to B j, and f (j) is the number of anomaly issues corresponding to B j;
s400, generating an abnormal problem feature vector corresponding to each abnormal client according to Q to obtain an abnormal problem feature vector list W= (W 1,W2,…,Wj,…,Wm); wherein W j is an abnormal problem feature vector corresponding to B j;
step S400 includes the steps of:
S410, acquiring a preset initial problem feature vector hy= (HY 1,HY2,…,HYa,…,HYb), a=1, 2, …, b; wherein HY a is the element value corresponding to the a-th known abnormal problem, and b is the number of the known abnormal problems; each element value in HY is 0;
S420, traversing Q j, and setting the element value corresponding to Q j,r in HY to be 1 so as to obtain an abnormal problem feature vector W j corresponding to B j, and further obtaining an abnormal problem feature vector list W;
S500, determining a target processing strategy corresponding to each abnormal client according to W and processing strategies corresponding to a plurality of historical abnormal problems to obtain a target processing strategy list set T= (T 1,T2,…,Tj,…,Tm); wherein, T j is a target processing strategy list corresponding to B j; t j includes several target processing strategies;
Step S500 includes the steps of:
S510, obtaining each historical abnormal problem feature vector to obtain a historical abnormal problem feature vector list lg= (LG 1,LG2,…,LGc,…,LGd), c=1, 2, …, d; LG c is the obtained c-th historical abnormal problem feature vector, and d is the number of the obtained historical abnormal problem feature vectors;
S520, according to LG, acquiring a history processing strategy corresponding to each history abnormal problem feature vector to obtain a history processing strategy list FU= (FU 1,FU2,…,FUc,…,FUd); wherein FU c is a processing policy corresponding to LG c;
S530, clustering LG by using a preset clustering algorithm to obtain a historical anomaly problem feature vector group list JA= (JA 1,JA2,…,JAe,…,JAg), and e=1, 2, … and g; wherein JA e is the e-th historical abnormal problem feature vector group obtained by clustering LGs, and g is the number of the historical abnormal problem feature vector groups obtained by clustering LGs;
S540, according to the FU, acquiring a history processing strategy group corresponding to each history abnormal problem feature vector group in the JA to obtain a history processing strategy group list KA= (KA 1,KA2,…,KAe,…,KAg); wherein KA e is a history processing policy group corresponding to JA e; KA e=(KAe,1,KAe,2,…,KAe,x,…,KAe,y(e)), x=1, 2, …, y (e); wherein KA e,x is a history processing policy corresponding to the xth history abnormal problem feature vector in JA e, and y (e) is the number of history abnormal problem feature vectors in JA e;
S550, obtaining initial similarity of each historical abnormal problem feature vector group in W j and JA to obtain an initial similarity list eta j=(ηj,1j,2,…,ηj,e,…,ηj,g corresponding to W j; wherein η j,e is the initial similarity of W j and JA e;
S560, determining a target similarity mh=max (η j) of W j and JA according to η j; wherein MAX () is a preset maximum function;
S570, determining T j according to MH and KA;
Step S570 includes the steps of:
S571, determining the historical abnormal problem feature vector group corresponding to the MH as a target historical abnormal problem feature vector group;
s572, acquiring a target history processing strategy group corresponding to the target history abnormal problem feature vector group according to the KA;
S573, classifying the same history processing policies in the target history processing policy group into one type to obtain a history processing policy class list ru= (RU 1,RU2,…,RUβ,…,RUγ), β=1, 2, …, γ corresponding to the target history processing policy group; RU β is a β -th historical processing policy class obtained by classifying the historical processing policies in the target historical processing policy group, and γ is the number of the historical processing policy classes obtained by classifying the historical processing policies in the target historical processing policy group; any two history handling policies within RU β are the same; the history processing strategies corresponding to any two history processing strategy classes are different;
S574, obtaining the number of the history processing strategies in each history processing strategy class in the RU to obtain an initial number list NUM= (NUM 1,NUM2,…,NUMβ,…,NUMγ) corresponding to the RU; wherein NUM β is the number of history handling policies in RU β;
S575, determining the largest v initial numbers in NUM as target numbers to obtain a target number list NUM ' = (NUM ' 1,NUM'2,…,NUM'h,…,NUM'v),h=1,2,…,v;NUM'h is the h largest initial number in NUM; NUM ' k>NUM'k+1, k=1, 2, …, v-1;
S576, determining a history processing strategy corresponding to the NUM' h as a target processing strategy;
S600, traversing T, sending T j to B j, causing B j to execute at least one target processing policy in T j to eliminate the connection exception present in B j.
2. The method for handling Redis connection anomaly according to claim 1, wherein the step S200 comprises the steps of:
S210, obtaining the error quantity of each initial client in the A connected with the preset Redis and the average access delay of accessing the preset Redis to obtain an abnormality judgment parameter set list CS= (CS 1,CS2,…,CSi,…,CSn); wherein CS i is an abnormality judgment parameter group corresponding to A i; CS i=(CSi,1,CSi,2);CSi,1 is the number of errors of A i for connecting with a preset Redis, and CS i,2 is the average access delay of A i for accessing the preset Redis;
S220, traversing CS, and if CS i,1 is not equal to 0 or CS i,2 is more than TE, determining A i as an abnormal client; the TE is a preset average access delay threshold.
3. The method for handling Redis connection anomalies according to claim 2, wherein the CS i,2 determines by:
S211, obtaining an access delay corresponding to each preset time point in a preset time period to obtain an access delay list gh= (GH 1,GH2,…,GHp,…,GHq), p=1, 2, …, q corresponding to CS i; wherein GH p is access delay corresponding to the p-th preset time point in the preset time period, and q is the number of the preset time points in the preset time period; the ending time of the preset time period is the current time;
s212, determining CS i,2=1/q×∑q p=1GHp according to GH.
4. The method for handling a Redis connection exception according to claim 1, wherein T j=(Tj,1,Tj,2,…,Tj,h,…,Tj,v; wherein, T j,h is the history processing strategy corresponding to NUM' h; step S600 includes the steps of:
S610, acquiring a target value n=1;
S620, controlling B j to execute T j,N, and judging whether the abnormal problem corresponding to B j is eliminated;
S630, if the abnormal problem corresponding to B j is not eliminated, acquiring n=n+1, and entering step S620; otherwise, the current process is jumped out.
5. The method for processing the dis connection anomaly according to claim 1, wherein the preset clustering algorithm comprises a DBSCAN clustering algorithm.
6. A non-transitory computer readable storage medium having stored therein at least one instruction or at least one program, wherein the at least one instruction or the at least one program is loaded and executed by a processor to implement the method of handling a Redis connection exception according to any one of claims 1-5.
7. An electronic device comprising a processor and the non-transitory computer-readable storage medium of claim 6.
CN202410157030.7A 2024-02-04 2024-02-04 Redis connection abnormality processing method, electronic equipment and storage medium Active CN117707830B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410157030.7A CN117707830B (en) 2024-02-04 2024-02-04 Redis connection abnormality processing method, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410157030.7A CN117707830B (en) 2024-02-04 2024-02-04 Redis connection abnormality processing method, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN117707830A CN117707830A (en) 2024-03-15
CN117707830B true CN117707830B (en) 2024-04-26

Family

ID=90162769

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410157030.7A Active CN117707830B (en) 2024-02-04 2024-02-04 Redis connection abnormality processing method, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117707830B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109783325A (en) * 2018-12-14 2019-05-21 平安证券股份有限公司 Business monitoring method, device, equipment and storage medium
CN114584391A (en) * 2022-03-22 2022-06-03 恒安嘉新(北京)科技股份公司 Method, device, equipment and storage medium for generating abnormal flow processing strategy
JP2022142456A (en) * 2021-03-16 2022-09-30 富士通株式会社 Abnormality handling program, abnormality handling system, and abnormality handling method
CN115827290A (en) * 2022-07-19 2023-03-21 中国工商银行股份有限公司 Processing strategy determination method and device, storage medium and electronic equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210158193A1 (en) * 2019-11-27 2021-05-27 Rsa Security Llc Interpretable Supervised Anomaly Detection for Determining Reasons for Unsupervised Anomaly Decision

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109783325A (en) * 2018-12-14 2019-05-21 平安证券股份有限公司 Business monitoring method, device, equipment and storage medium
JP2022142456A (en) * 2021-03-16 2022-09-30 富士通株式会社 Abnormality handling program, abnormality handling system, and abnormality handling method
CN114584391A (en) * 2022-03-22 2022-06-03 恒安嘉新(北京)科技股份公司 Method, device, equipment and storage medium for generating abnormal flow processing strategy
CN115827290A (en) * 2022-07-19 2023-03-21 中国工商银行股份有限公司 Processing strategy determination method and device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN117707830A (en) 2024-03-15

Similar Documents

Publication Publication Date Title
US6993514B2 (en) Mechanism and method for continuous operation of a rule server
US10289468B1 (en) Identification of virtual computing instance issues
US20150373028A1 (en) Entitlement Predictions
US20130347003A1 (en) Intelligent Service Management and Process Control Using Policy-Based Automation
US10884843B2 (en) Traffic and geography based cognitive disaster recovery
US11531581B2 (en) Event root cause identification for computing environments
US20210124663A1 (en) Device Temperature Impact Management Using Machine Learning Techniques
CN114424222A (en) Service ticket upgrade based on interactive mode
CN110875838B (en) Resource deployment method, device and storage medium
CN111954240A (en) Network fault processing method and device and electronic equipment
US10943201B2 (en) Digital fingerprint analysis
CN117688342B (en) Model-based equipment state prediction method, electronic equipment and storage medium
US11676114B2 (en) Automated control of distributed computing devices
CN111858704A (en) Data monitoring method and device, electronic equipment and storage medium
CN113162888A (en) Security threat event processing method and device and computer storage medium
CN112765101A (en) Method, electronic device and computer program product for managing a file system
CN117707830B (en) Redis connection abnormality processing method, electronic equipment and storage medium
CN113191889A (en) Wind control configuration method, configuration system, electronic device and readable storage medium
KR102089450B1 (en) Data migration apparatus, and control method thereof
CN110336884B (en) Server cluster updating method and device
CN112333016A (en) Failure reporting processing method, system, equipment and storage medium
CA3080582A1 (en) Scalable predictive analytic system
US20220004528A1 (en) Dynamic Transformation Code Prediction and Generation for Unavailable Data Element
CN116595529B (en) Information security detection method, electronic equipment and storage medium
CN116962086B (en) File security detection method and system

Legal Events

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