Index adjustment method and device, computer equipment and storage medium

By identifying and optimizing the target field index in the alarm information, and adjusting the index sorting and position according to the priority, the problem of low alarm information query efficiency in distributed storage is solved, and rapid query and export of alarm information is achieved.

CN118568093AActive Publication Date: 2024-08-30JINAN INSPUR DATA TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202410649895.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-23
Publication Date
2024-08-30
Estimated Expiration
2044-05-23

AI Technical Summary

Technical Problem

In distributed storage, as the number of nodes increases, during the query and export process of alarm information, the invariance of the index data structure in the existing technology causes the repeated comparison of alarm information to take more time, especially when there is a large amount of alarm information. The query and export process consumes more time.

Method used

By identifying the target fields in the alarm information, multiple target indexes are generated, sorted and adjusted according to the priority of the target index, and the position adjustment of the hash table and B+ tree is used to optimize the index query efficiency.

Benefits of technology

It improves the efficiency of alarm information query and reduces query time. Especially when there is a lot of alarm information, users can quickly search for target indexes with higher priority, saving search time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118568093A
    Figure CN118568093A
Patent Text Reader

Abstract

The invention relates to the technical field of index adjustment, in particular to an index adjustment method and device, computer equipment and a storage medium. Identifying each piece of alarm information, and determining a target field in which an index needs to be established in each piece of alarm information; establishing indexes for various field types included in the target field, and generating a plurality of target indexes; determining at least one target field type corresponding to each target index, and determining a priority corresponding to each target index according to each target field type corresponding to each target index; and according to the priority corresponding to each target index, adjusting the sorting of each target index. Therefore, it can be ensured that the sorting of the target indexes can be adjusted in time according to the priorities of the target indexes, a user can search in the target indexes with the higher priorities first when querying the alarm information, the alarm information can be found conveniently, and then the time for searching the alarm information is saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of index adjustment, and in particular to an index adjustment method, device, computer equipment and storage medium. Background Art

[0002] In distributed storage, as the number of nodes continues to increase, the hardware alarms of various components, such as CPU, memory, and fan status, and the alarms and notifications related to various services such as FTP and load balancing also increase. In the process of automatic alarm reporting and recovery, alarms need to be frequently queried and compared. And after alarm reporting and recovery, customers will also frequently query current and historical alarms. Therefore, the establishment of alarm indexes is crucial and directly affects the speed of alarm processing.

[0003] In the prior art, an index is usually created for a certain field in the alarm information, so as to facilitate querying and comparing the alarm information. However, after an index is created for a certain field, when an alarm information is inserted into the database, the relative position in the index data structure does not change.

[0004] Therefore, when duplicate alarms are compared when alarm information is reported, it will take more time to query the alarm information. If the user queries and exports the alarm information, if there is a lot of alarm information, it will also take a lot of time to query. Summary of the invention

[0005] In view of this, the present invention provides an index adjustment method, apparatus, computer equipment and storage medium to solve the problem that when users query and export alarm information, if there is a lot of alarm information, it will take a lot of time to query.

[0006] In a first aspect, the present invention provides an index adjustment method, the method comprising:

[0007] Identify each piece of alarm information and determine the target field in each piece of alarm information that needs to be indexed;

[0008] Establish indexes for various field types included in the target field and generate multiple target indexes;

[0009] Determine at least one target field type corresponding to each target index.

[0010] Determine the priority of each target index according to the target field type corresponding to each target index;

[0011] According to the priority corresponding to each target index, the sorting of each target index is adjusted.

[0012] The index adjustment method provided in the embodiment of the present application identifies each alarm message, determines the target field that needs to be indexed in each alarm message, and ensures the accuracy of the determined target field. Indexes are established for various field types included in the target field to generate multiple target indexes, and ensure the accuracy of the generated target indexes. Determine at least one target field type corresponding to each target index, and determine the priority corresponding to each target index based on the target field type corresponding to each target index, and ensure the accuracy of the priority corresponding to each target index determined. According to the priority corresponding to each target index, the sorting of each target index is adjusted, so that it can be ensured that the sorting of the target index can be adjusted in time according to the priority of each target index, so that when the user queries the alarm information, he can first search in the target index with a higher priority, and it is easy to find, thereby saving time in searching for the alarm information.

[0013] In an optional implementation, indexes are created for various field types corresponding to the target field to generate multiple target indexes, including:

[0014] Convert letters in a preset range of various field types to ASCII code values;

[0015] Add the ASCII code values ​​to obtain a first sum;

[0016] The first sum is modulo a preset prime number, and the remainder obtained is used as the target index.

[0017] The index adjustment method provided in the embodiment of the present application converts letters of various field types within a preset range into ASCII code values; adds each ASCII code value to obtain a first sum; modulo the first sum with a preset prime number, and uses the remainder obtained as the target index, thereby ensuring the accuracy of the generated target index, and further enabling the alarm information to be found quickly and accurately based on the target index.

[0018] In an optional implementation, determining the priority corresponding to each target index according to each target field type corresponding to each target index includes:

[0019] Detecting the occurrence frequency of alarm information corresponding to each target field type in multiple sub-time periods corresponding to a preset historical time period;

[0020] Based on the occurrence frequency of the alarm information corresponding to each target field type in each sub-time period, determining the predicted probability of the alarm information corresponding to each target field type appearing again in a future preset time period;

[0021] Get the total number of queries corresponding to the user's query alarm information;

[0022] For each target index, obtain the number of subqueries performed by the user on the alarm information of each target field type corresponding to the target index;

[0023] Based on the number of sub-queries and the total number of queries, the sub-query ratio of the alarm information of each target field type queried by the user is calculated;

[0024] Based on the predicted probability and the subquery ratio, the priority of the target field type corresponding to the target index is determined;

[0025] The priority of the target index is determined based on the priority of each target field type corresponding to the target index.

[0026] The index adjustment method provided in the embodiment of the present application detects the frequency of occurrence of alarm information corresponding to each target field type in multiple sub-time periods corresponding to a preset historical time period; based on the frequency of occurrence of alarm information corresponding to each target field type in each sub-time period, determines the predicted probability of the alarm information corresponding to each target field type appearing again in the future preset time period, thereby ensuring the accuracy of the predicted probability of the alarm information corresponding to each target field type appearing again in the future preset time period. Obtain the total number of queries corresponding to the user's query of the alarm information; for each target index, obtain the number of sub-queries for the user to query the alarm information of each target field type corresponding to the target index; based on the number of sub-queries and the total number of queries, calculate the sub-query ratio of the user's query of the alarm information of each target field type, thereby ensuring the accuracy of the calculated sub-query ratio of the user's query of the alarm information of each target field type. Based on the predicted probability and the sub-query ratio, determine the priority of the target field type corresponding to the target index, thereby ensuring that the priority of the target field type corresponding to the determined target index takes into account both the predicted probability of the alarm information corresponding to the target field type and the possibility of the alarm information corresponding to the target field type being queried by the user, thereby ensuring the accuracy of the calculated priority. The priority of the target index is determined based on the priority of each target field type corresponding to the target index, thereby ensuring the accuracy of the determined priority of the target index.

[0027] In an optional implementation, based on the occurrence frequency of the alarm information corresponding to each target field type in each sub-time period, determining the predicted probability of the alarm information corresponding to each target field type appearing again in a future preset time period includes:

[0028] The occurrence frequency of the alarm information corresponding to each target field type in each sub-time period and the time characteristics corresponding to the sub-time period are input into the preset prediction model, and the predicted probability of the alarm information corresponding to each target field type appearing again in the future preset time period is output.

[0029] The index adjustment method provided in the embodiment of the present application inputs the frequency of occurrence of alarm information corresponding to each target field type in each sub-time period and the time characteristics corresponding to the sub-time period into a preset prediction model, and outputs the predicted probability of the alarm information corresponding to each target field type appearing again in the future preset time period, thereby ensuring the accuracy of the output predicted probability of the alarm information corresponding to each target field type appearing again in the future preset time period.

[0030] In an optional implementation, the order of each target index is adjusted according to the priority corresponding to each target index.

[0031] According to each target index, determine the position of each target index in the hash table;

[0032] According to the priority corresponding to each target index, the position order of each target index in the hash table is adjusted; wherein, the higher the priority of the target index, the higher the order of the target index;

[0033] For multiple field types in each target index, sort them according to the priority corresponding to each field type.

[0034] The index adjustment method provided in the embodiment of the present application determines the position of each target index in the hash table according to each target index; and adjusts the position order of each target index in the hash table according to the priority corresponding to each target index, thereby ensuring the accuracy of the position of each target index in the hash table. For multiple field types in each target index, they are sorted according to the priority corresponding to each field type, thereby ensuring the accuracy of the priority corresponding to each field type. As a result, when querying alarm information, the user can first search in the target index with a higher priority, and it is easy to find, thereby saving time in searching for alarm information.

[0035] In an optional implementation, indexes are created for various field types corresponding to the target field to generate multiple target indexes, including:

[0036] Convert all letters corresponding to each field type into target code values;

[0037] Adding each target code value to obtain a second sum;

[0038] Each second sum is used as the target index.

[0039] The index adjustment method provided in the embodiment of the present application converts all letters corresponding to each field type into target code values; adds each target code value to obtain a second sum; and uses each second sum as a target index, thereby ensuring the accuracy of the generated target index.

[0040] In an optional implementation, the order of each target index is adjusted according to the priority corresponding to each target index, including:

[0041] Determine the position of each target index in the B+ tree according to each target index;

[0042] According to the priority corresponding to each target index, the position of each target index in the B+ tree is adjusted; wherein, the higher the priority of the target index, the higher the position of the target index.

[0043] The index adjustment method provided in the embodiment of the present application determines the position of each target index in the B+ tree according to each target index; adjusts the position of each target index in the B+ tree according to the priority corresponding to each target index, thereby ensuring the accuracy of the position of each target index in the B+ tree, so that when the user queries the alarm information, he can first search in the target index with a higher priority, and it is easy to find, thereby saving the time of searching for the alarm information.

[0044] In a second aspect, the present invention provides an index adjustment device, the device comprising:

[0045] The first determination module is used to identify each piece of alarm information and determine the target field in each piece of alarm information that needs to be indexed;

[0046] A generation module, used for indexing various field types included in the target field, and generating multiple target indexes;

[0047] The second determination module is used to determine at least one target field type corresponding to each target index.

[0048] A third determination module is used to determine the priority corresponding to each target index according to each target field type corresponding to each target index;

[0049] The adjustment module is used to adjust the order of each target index according to the priority corresponding to each target index.

[0050] The index adjustment device provided in the embodiment of the present application identifies each piece of alarm information, determines the target field in each alarm information that needs to be indexed, and ensures the accuracy of the determined target field. Indexes are established for the various field types included in the target field, and multiple target indexes are generated, ensuring the accuracy of the generated target indexes. At least one target field type corresponding to each target index is determined, and the priority corresponding to each target index is determined based on the target field types corresponding to each target index, ensuring the accuracy of the priority corresponding to each target index. According to the priority corresponding to each target index, the order of each target index is adjusted, thereby ensuring that the order of the target index can be adjusted in time according to the priority of each target index, so as to facilitate query and comparison of the alarm information.

[0051] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, computer instructions being stored in the memory, and the processor executing the index adjustment method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0052] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the index adjustment method of the first aspect or any corresponding embodiment thereof.

[0053] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the index adjustment method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0055] Figure 1 is a flowchart of an index adjustment method according to an embodiment of the present invention;

[0056] Figure 2 is a flow chart of another index adjustment method according to an embodiment of the present invention;

[0057] Figure 3 is a schematic diagram of adjusting the position order of each target index in the hash table according to an embodiment of the present invention;

[0058] Figure 4is a flow chart of another index adjustment method according to an embodiment of the present invention;

[0059] Figure 5 is a schematic diagram of adjusting the position of each target index in the B+ tree according to an embodiment of the present invention;

[0060] Figure 6 is a structural block diagram of an index adjustment device according to an embodiment of the present invention;

[0061] Figure 7 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0062] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0063] It should be noted that the index adjustment method provided in the embodiment of the present application may be executed by an index adjustment device, which may be implemented as part or all of a computer device through software, hardware, or a combination of software and hardware, wherein the computer device may be a server or a terminal, wherein the server in the embodiment of the present application may be a single server or a server cluster composed of multiple servers, and the terminal in the embodiment of the present application may be a smart phone, a personal computer, a tablet computer, a wearable device, an intelligent robot, or other intelligent hardware devices. In the following method embodiments, the execution subject is an electronic device as an example for explanation.

[0064] According to an embodiment of the present invention, an index adjustment method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0065] In this embodiment, an index adjustment method is provided, which can be used in the above electronic device. Figure 1 is a flow chart of an index adjustment method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0066] Step S101: Identify each piece of alarm information and determine the target field in each piece of alarm information that needs to be indexed.

[0067] Specifically, the electronic device may identify each piece of warning information, summarize each piece of warning information according to the identification result, and determine the number of field types corresponding to each field in each piece of warning information.

[0068] Exemplarily, the alarm level field usually contains only three levels: minor, major, and urgent, that is, the number of field types corresponding to the alarm level field is 3. The alarm type field includes two field types: cluster and node.

[0069] The electronic device may compare the number of field types corresponding to each field with a preset number threshold, and if the number of field types corresponding to each field is greater than the preset number threshold, the field is determined as a candidate field.

[0070] The electronic device analyzes each candidate field to determine whether the field types included in each candidate field are completely different, that is, whether the field types in each candidate field are unique identifiers. If the field types in the candidate field are unique identifiers, the candidate field is deleted, and the remaining candidate fields are determined as target fields that need to be indexed.

[0071] For example, the alarm serial number is a unique identifier of the alarm reporting order. This field is of int type and is usually used as a unique identifier to determine the alarm. Therefore, this field is usually queried using exact matching. Therefore, this field does not need to be indexed again, so the alarm serial number can be deleted from the candidate field. A hash table can be used for index query for the alarm serial number. Since the size of the address set = the size of the keyword set, the direct addressing method H(key) = key is used, which can directly correspond one to one without conflict.

[0072] For example, the alarm body may include field types such as Node1, file1, file23, cpu01, memory02, buckettest, etc. Therefore, the electronic device can determine that the alarm body in the alarm information is the target field that needs to be indexed. Since the target field has a large cardinality but a small field length, the index can be placed in the memory (if placed in the disk, the disk will be accessed too much).

[0073] For example, each alarm situation is described in the alarm description. Since the alarm description includes many types of fields, the electronic device can determine that the alarm description in the alarm information is the target field that needs to be indexed. Since the target field has a large cardinality and a long field, part of the index can be put into the memory and part can be stored in the disk.

[0074] Step S102: index various field types included in the target field to generate multiple target indexes.

[0075] Specifically, the electronic device may use a preset method to index various field types included in the target field and generate multiple target indexes.

[0076] Among them, the preset method can be a hash algorithm, wherein the hash algorithm can be md5, SHA and other methods, but these algorithms are complex to calculate and the resulting hash is longer. The embodiments of the present application do not specifically limit the preset method.

[0077] This step will be described in detail below.

[0078] Step S103: determine at least one target field type corresponding to each target index.

[0079] Specifically, since there are two or more field types with the same target index after indexing, the electronic device needs to determine at least one target field type corresponding to each target index according to the correspondence between the target index and each field type.

[0080] Step S104: determining the priority corresponding to each target index according to each target field type corresponding to each target index.

[0081] Specifically, the electronic device may first determine the priority corresponding to each target field type according to each target field type corresponding to each target index, and then determine the priority corresponding to each target index according to the priority corresponding to each target field type.

[0082] This step will be described in detail below.

[0083] Step S105: adjusting the order of each target index according to the priority corresponding to each target index.

[0084] Specifically, the electronic device may sort the target indexes according to the priorities corresponding to the target indexes.

[0085] This step is described in detail below.

[0086] The index adjustment method provided in this embodiment identifies each piece of alarm information, determines the target field in each piece of alarm information that needs to be indexed, and ensures the accuracy of the determined target field. Indexes are established for various field types included in the target field to generate multiple target indexes, and ensures the accuracy of the generated target indexes. Determine at least one target field type corresponding to each target index,

[0087] According to the target field types corresponding to each target index, the priority corresponding to each target index is determined, ensuring the accuracy of the determined priority corresponding to each target index. According to the priority corresponding to each target index, the sorting of each target index is adjusted, thereby ensuring that the sorting of the target index can be adjusted in time according to the priority of each target index, so that when the user queries the alarm information, he can first search in the target index with a higher priority, and it is easy to find, thereby saving the time of searching the alarm information.

[0088] In this embodiment, an index adjustment method is provided, which can be used in the above electronic device. Figure 2 is a flow chart of an index adjustment method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0089] Step S201: Identify each piece of alarm information and determine the target field in each piece of alarm information that needs to be indexed.

[0090] Step S202: index various field types included in the target field to generate multiple target indexes.

[0091] Specifically, the above step S202 includes:

[0092] Step S2021, converting letters in a preset range of various field types into ASCII code values.

[0093] Specifically, the electronic device may convert letters in a preset range of various field types into ASCII code values.

[0094] Among them, the preset range can be the 1st to 5th letters in various field types, or the 2nd to 8th letters, or other ranges. The embodiment of the present application does not specifically limit the preset range.

[0095] Step S2022, adding up the ASCII code values ​​to obtain a first sum.

[0096] Specifically, the electronic device may add up the ASCII code values ​​to obtain a first sum.

[0097] Step S2023, taking the first sum modulo a preset prime number, and using the remainder obtained as the target index.

[0098] Specifically, the electronic device may take the first sum modulo a preset prime number, and use the remainder obtained as the target index.

[0099] Among them, the preset prime number can be 2, 3, 5 or other prime numbers. The embodiment of the present application does not specifically limit the preset prime number.

[0100] Step S203: determine at least one target field type corresponding to each target index.

[0101] For more information about this step, see Figure 1 The introduction of step S103 is not repeated here.

[0102] Step S204: determining the priority corresponding to each target index according to each target field type corresponding to each target index.

[0103] Specifically, the above step S204 may include the following steps:

[0104] Step S2041 , detecting the occurrence frequency of alarm information corresponding to each target field type in a plurality of sub-time periods corresponding to a preset historical time period.

[0105] Specifically, the electronic device may detect the occurrence frequency of the alarm information corresponding to each target field type in a plurality of sub-time periods corresponding to a preset historical time period.

[0106] The preset historical time period may be a period of one month before the current moment, or a period of two months before the current moment, and the present embodiment of the application does not specifically limit the preset historical time period. The multiple sub-time periods corresponding to the preset historical time period may be obtained by dividing the preset historical time period in units of one day, three days, or other durations, and the present embodiment of the application does not specifically limit the specific durations corresponding to the multiple sub-time periods.

[0107] For example, the electronic device can detect the alarm information of the last month, and then calculate the alarm information of each day in the last month to determine the frequency of occurrence of the alarm information corresponding to each target field type. For example, if the alarm information reported by file1 on a certain day accounts for 20% of the alarm entities of all alarm information on that day, it is recorded as 0.2, and all the occurrence frequencies for 30 days are recorded.

[0108] 1 0.2 2 0.13 3 0.14 4 0.32 5 0.22 … …

[0109] Step S2042, based on the occurrence frequency of the alarm information corresponding to each target field type in each sub-time period, determine the predicted probability of the alarm information corresponding to each target field type appearing again in a future preset time period.

[0110] In an optional implementation of the present application, the electronic device may fit a prediction formula based on the occurrence frequency of the alarm information corresponding to each target field type in each sub-time period and each sub-time period, wherein the prediction formula may be a linear regression formula or other formulas.

[0111] For example, when the prediction formula is a linear regression formula, it can be as follows:

[0112] b=(x1y1+x2y2+...xnyn-nXY) / (x1+x2+...xn-nX), get the slope b of the diagonal line, the independent variable x is, the dependent variable y is, calculate the predicted probability Q of the alarm information corresponding to each target field type appearing again in the future preset time period.

[0113] Specifically, the above step S2042 includes:

[0114] The occurrence frequency of the alarm information corresponding to each target field type in each sub-time period and the time characteristics corresponding to the sub-time period are input into the preset prediction model, and the predicted probability of the alarm information corresponding to each target field type appearing again in the future preset time period is output.

[0115] Specifically, the electronic device can input the frequency of occurrence of alarm information corresponding to each target field type in each sub-time period and the time characteristics corresponding to the sub-time period into a preset prediction model, and output the predicted probability of the alarm information corresponding to each target field type appearing again in the future preset time period.

[0116] Among them, the preset prediction model can be any one of radial basis function (RBF) network, feedforward neural network (FFNN), convolutional neural network (CNN), deconvolutional neural network (DN), deep convolutional inverse graphics network (DCIGN), generative adversarial network (GAN), recurrent neural network (RNN), long / short term memory network (LSTM), deep residual network (DRN) and extreme learning machine (ELM). The embodiment of the present application does not limit the preset prediction model.

[0117] It should be noted that the preset prediction model can be trained based on the alarm information in the historical time period before the preset historical time period.

[0118] Step S2043, obtaining the total number of queries corresponding to the user's query alarm information.

[0119] Specifically, the electronic device may search the storage space for the total number of queries corresponding to the user's query alarm information.

[0120] Step S2044: for each target index, obtain the number of sub-queries performed by the user on the alarm information of each target field type corresponding to the target index.

[0121] Specifically, for each target index, the number of sub-queries performed by the user on the alarm information of each target field type corresponding to the target index is obtained.

[0122] Exemplarily, assuming that the target field types corresponding to the target index 003 include memory02, file1 and file23, the electronic device respectively obtains the number of sub-queries the user performs on the alarm information of memory02, the number of sub-queries the user performs on the alarm information of file1, and the number of sub-queries the user performs on the alarm information of file23.

[0123] Step S2045 , based on the number of sub-queries and the total number of queries, the sub-query ratio of the user querying the warning information of each target field type is calculated.

[0124] Specifically, the electronic device calculates the sub-query ratio of the user's query for the warning information of each target field type based on the sub-query number and the total query number.

[0125] Exemplarily, the electronic device calculates sub-query ratios for querying the alarm information of memory02, the alarm information of file1, and the alarm information of file23 respectively.

[0126] Step S2046: Determine the priority of the target field type corresponding to the target index based on the predicted probability and the subquery ratio.

[0127] Optionally, the electronic device may add the sub-query ratio of the warning information of each target field type to the predicted probability, and calculate the priority of the target field type corresponding to the target index.

[0128] Optionally, the electronic device may also perform weighted addition of the sub-query ratio of the warning information of each target field type and the predicted probability to calculate the priority of the target field type corresponding to the target index.

[0129] Optionally, the electronic device may also detect, for each target alarm information in each target field type, whether the target alarm information is resolved alarm information or unresolved alarm information.

[0130] If the target alarm information is resolved alarm information, the electronic device determines the first query number corresponding to the resolved alarm information, and then divides the first query number by the total query number to obtain the first query ratio corresponding to the resolved alarm information. Then, the first query ratio is multiplied by the sub-query ratio of the alarm information corresponding to the target field type, and then the predicted probability corresponding to the alarm information of each target field type is added to calculate the priority corresponding to the target alarm information.

[0131] If the target alarm information is unresolved alarm information, the electronic device determines the second query number corresponding to the unresolved alarm information, and then divides the second query number by the total query number to obtain the second query ratio corresponding to the unresolved alarm information. Then, the second query ratio is multiplied by the sub-query ratio of the alarm information corresponding to the target field type, and then the predicted probability corresponding to the alarm information of each target field type is added to calculate the priority corresponding to the target alarm information.

[0132] Then, the electronic device averages the priorities corresponding to the target alarm information in the target field type, and calculates the priority of the target field type corresponding to the target index.

[0133] Exemplarily, it is assumed that for the target field type file1 in the target index, the target field type file1 includes target alarm information 1-10. The electronic device detects whether the target alarm information 1 is resolved alarm information or unresolved alarm information for the target alarm information 1 corresponding to the target field type file1. Then, the priority corresponding to the target alarm information 1 is calculated according to the detection result. Similarly, the priority corresponding to the target alarm information 2-10 is calculated. Then, according to the priority corresponding to the target alarm information 1-10, the priority corresponding to the target field type file1 in the target index is determined.

[0134] Step S2047: Determine the priority of the target index based on the priority of each target field type corresponding to the target index.

[0135] Specifically, the electronic device may perform weighted averaging on the priorities of each target field type corresponding to the target index to determine the priority of the target index.

[0136] Step S205: adjusting the order of each target index according to the priority corresponding to each target index.

[0137] Specifically, the above step S205 includes:

[0138] Step S2051, determining the position of each target index in the hash table according to each target index.

[0139] Specifically, the electronic device may determine the position of each target index in the hash table according to each target index.

[0140] Step S2052: adjusting the position sequence of each target index in the hash table according to the priority corresponding to each target index.

[0141] Among them, the higher the priority of the target index, the higher the order of the target index.

[0142] Specifically, the electronic device adjusts the position sequence of each target index in the hash table according to the priority corresponding to each target index.

[0143] Step S2053: sorting the multiple field types in each target index according to the priority corresponding to each field type.

[0144] Specifically, multiple field types in each target index are sorted according to the priority corresponding to each field type.

[0145] For example, Figure 3 This is a schematic diagram after adjusting the position order of each target index in the hash table. Figure 3 As shown, the target field types corresponding to the target index 003 include memory02, file1 and file23. After determining the position of the target index 003, the electronic device sorts the multiple field types in each target index according to the priority corresponding to each field type.

[0146] The index adjustment method provided in the embodiment of the present application converts letters of various field types within a preset range into ASCII code values; adds each ASCII code value to obtain a first sum; modulo the first sum with a preset prime number, and uses the remainder obtained as the target index, thereby ensuring the accuracy of the generated target index, and further enabling the alarm information to be found quickly and accurately based on the target index.

[0147] Next, the occurrence frequency of the alarm information corresponding to each target field type in multiple sub-time periods corresponding to the preset historical time period is detected; the occurrence frequency of the alarm information corresponding to each target field type in each sub-time period and the time characteristics corresponding to the sub-time period are input into the preset prediction model, and the predicted probability of the alarm information corresponding to each target field type appearing again in the future preset time period is output, thereby ensuring the accuracy of the predicted probability of the alarm information corresponding to each target field type appearing again in the future preset time period output. The total number of queries corresponding to the user querying the alarm information is obtained; for each target index, the number of sub-queries for the user to query the alarm information of each target field type corresponding to the target index is obtained; based on the number of sub-queries and the total number of queries, the sub-query ratio of the user querying the alarm information of each target field type is calculated, thereby ensuring the accuracy of the calculated sub-query ratio of the user querying the alarm information of each target field type. Based on the predicted probability and the sub-query ratio, the priority of the target field type corresponding to the target index is determined, thereby ensuring that the priority of the target field type corresponding to the determined target index takes into account both the predicted probability of the alarm information corresponding to the target field type and the possibility of the alarm information corresponding to the target field type being queried by the user, thereby ensuring the accuracy of the calculated priority. The priority of the target index is determined based on the priority of each target field type corresponding to the target index, thereby ensuring the accuracy of the determined priority of the target index.

[0148] Then, according to each target index, the position of each target index in the hash table is determined; according to the priority corresponding to each target index, the position order of each target index in the hash table is adjusted, thereby ensuring the accuracy of the position of each target index in the hash table. For multiple field types in each target index, they are sorted according to the priority corresponding to each field type, ensuring the accuracy of the priority corresponding to each field type. Therefore, when querying alarm information, users can first search in the target index with a higher priority, and it is easy to find, thereby saving time in searching for alarm information.

[0149] In this embodiment, an index adjustment method is provided, which can be used in the above electronic device. Figure 4 is a flow chart of an index adjustment method according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:

[0150] Step S301: Identify each piece of alarm information and determine the target field in each piece of alarm information that needs to be indexed.

[0151] For this step please see Figure 2 The introduction of step S201 is not repeated here.

[0152] Step S302: index various field types included in the target field to generate multiple target indexes.

[0153] Specifically, the above step S302 may include the following steps:

[0154] Step S3021, convert all letters corresponding to each field type into target code values.

[0155] Specifically, the electronic device may convert all letters corresponding to each field type into a target code value.

[0156] Among them, the target code value can be an ASCII or Unicode code value, or other code values. The embodiment of the present application does not specifically limit the target code value.

[0157] Step S3022, adding the target code values ​​to obtain a second sum.

[0158] Specifically, the electronic device may add up the target code values ​​to obtain the second sum.

[0159] Step S3023: taking each second sum as a target index.

[0160] Specifically, the electronic device uses each second sum as a target index.

[0161] Step S303: determine at least one target field type corresponding to each target index.

[0162] For more information about this step, see Figure 2 The introduction of step S203 is not repeated here.

[0163] Step S304: determining the priority corresponding to each target index according to each target field type corresponding to each target index.

[0164] For more information about this step, see Figure 2 The introduction of step S204 is not repeated here.

[0165] Step S305: adjusting the order of each target index according to the priority corresponding to each target index.

[0166] Specifically, the above step S305 may include the following steps:

[0167] Step S3051, determining the position of each target index in the B+ tree according to each target index.

[0168] Specifically, the electronic device may determine the position of each target index in the B+ tree according to each target index.

[0169] Among them, the larger the target index, the lower its position in the B+ tree.

[0170] Step S3052: Adjust the position of each target index in the B+ tree according to the priority corresponding to each target index.

[0171] Among them, the higher the priority of the target index, the higher the position of the target index.

[0172] Specifically, the electronic device adjusts the position of each target index in the B+ tree according to the priority corresponding to each target index.

[0173] The tree has different depths. The shallower the depth, the fewer times the disk is accessed, and the higher the query efficiency. Different tree depths have different priorities. For example, the priority of the first layer is 1 to 0.8 and the second layer is 0.8-0.6. Therefore, when the priority of the target index value of 28 is greater than 0.8, the index is adjusted to the tree structure of the previous layer. In a tree index, the depth of the tree affects the efficiency of index query: if a piece of data is in the third layer of the tree, it requires three disk reads. Therefore, the shallower the depth of the queried data, the faster the query speed.

[0174] For example, Figure 5 , which is a schematic diagram after adjusting the position of each target index in the B+ tree.

[0175] The index adjustment method provided in the embodiment of the present application converts all letters corresponding to each field type into target code values; adds each target code value to obtain a second sum; and uses each second sum as a target index, thereby ensuring the accuracy of the generated target index.

[0176] The position of each target index in the B+ tree is determined according to each target index; the position of each target index in the B+ tree is adjusted according to the priority corresponding to each target index, thereby ensuring the accuracy of the position of each target index in the B+ tree, so that when the user queries the alarm information, he can first search in the target index with a higher priority, and it is easy to find, thereby saving the time of searching for the alarm information.

[0177] In this embodiment, an index adjustment device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0178] This embodiment provides an index adjustment device, such as Figure 6 As shown, including:

[0179] The first determination module 401 is used to identify each piece of alarm information and determine a target field in each piece of alarm information that needs to be indexed;

[0180] A generating module 402 is used to create indexes for various field types included in the target field, and generate multiple target indexes;

[0181] The second determination module 403 is used to determine at least one target field type corresponding to each target index.

[0182] The third determination module 404 is used to determine the priority corresponding to each target index according to each target field type corresponding to each target index;

[0183] The adjustment module 405 is used to adjust the order of each target index according to the priority corresponding to each target index.

[0184] In some optional implementations, the generation module 402 is specifically used to convert letters in various field types within a preset range into ASCII code values; add each ASCII code value to obtain a first sum; take the first sum modulo a preset prime number, and use the remainder obtained as the target index.

[0185] In some optional embodiments, the third determination module 404 is specifically used to detect the frequency of occurrence of alarm information corresponding to each target field type in multiple sub-time periods corresponding to a preset historical time period; based on the frequency of occurrence of alarm information corresponding to each target field type in each sub-time period, determine the predicted probability of the alarm information corresponding to each target field type appearing again in the future preset time period; obtain the total number of queries corresponding to the user's query for the alarm information; for each target index, obtain the number of sub-queries in which the user queries the alarm information of each target field type corresponding to the target index; based on the number of sub-queries and the total number of queries, calculate the sub-query ratio of the user's query for the alarm information of each target field type; based on the predicted probability and the sub-query ratio, determine the priority of the target field type corresponding to the target index; based on the priority of each target field type corresponding to the target index, determine the priority of the target index.

[0186] In some optional embodiments, the third determination module 404 is specifically used to input the frequency of occurrence of alarm information corresponding to each target field type in each sub-time period and the time characteristics corresponding to the sub-time period into a preset prediction model, and output the predicted probability of the alarm information corresponding to each target field type appearing again in the future preset time period.

[0187] In some optional implementations, the adjustment module 405 is specifically used to determine the position of each target index in the hash table according to each target index; adjust the position order of each target index in the hash table according to the priority corresponding to each target index; wherein, the higher the priority of the target index, the higher the order of the target index; for multiple field types in each target index, sort them according to the priority corresponding to each field type.

[0188] In some optional implementations, the generation module 402 is specifically used to convert all letters corresponding to each field type into a target code value; add each target code value to obtain a second sum; and use each second sum as a target index.

[0189] In some optional implementations, the adjustment module 405 is specifically used to determine the position of each target index in the B+ tree according to each target index; and adjust the position of each target index in the B+ tree according to the priority corresponding to each target index; wherein, the higher the priority of the target index, the higher the position of the target index.

[0190] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0191] The index adjustment device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0192] The embodiment of the present invention also provides a computer device having the above Figure 6 The index adjustment device shown.

[0193] See also Figure 7 , Figure 7 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 7As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 10 is taken as an example.

[0194] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0195] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.

[0196] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0197] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0198] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 7 The example of connecting through bus is taken in the following.

[0199] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0200] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0201] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0202] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. An index adjustment method, characterized in that: The method comprises: Identify each piece of alarm information and determine the target field in each piece of alarm information that needs to be indexed; Establishing indexes for various field types included in the target field to generate multiple target indexes; determining at least one target field type corresponding to each of the target indexes, Determine the priority corresponding to each target index according to each target field type corresponding to each target index; According to the priority level corresponding to each target index, the order of each target index is adjusted.

2. The method according to claim 1, characterized in that The indexing of various field types corresponding to the target field to generate multiple target indexes includes: Convert the letters in the preset range of various field types into ASCII code values; Adding the ASCII code values ​​to obtain a first sum; The first sum is modulo a preset prime number, and the remainder obtained is used as the target index.

3. The method according to claim 1, characterized in that The determining, according to each target field type corresponding to each target index, a priority corresponding to each target index includes: Detecting the occurrence frequency of the alarm information corresponding to each of the target field types in a plurality of sub-time periods corresponding to a preset historical time period; Based on the occurrence frequency of the alarm information corresponding to each target field type in each sub-time period, determining a predicted probability that the alarm information corresponding to each target field type will appear again in a future preset time period; Obtain the total number of queries corresponding to the alarm information by the user; For each of the target indexes, obtaining the number of sub-queries performed by the user on the alarm information of each of the target field types corresponding to the target index; Based on the number of sub-queries and the total number of queries, calculating a sub-query ratio of the user querying the warning information of each target field type; Determining the priority of the target field type corresponding to the target index based on the predicted probability and the subquery ratio; The priority of the target index is determined based on the priority of each target field type corresponding to the target index.

4. The method according to claim 3, characterized in that The determining, based on the occurrence frequency of the alarm information corresponding to each target field type in each sub-time period, a predicted probability of the alarm information corresponding to each target field type appearing again in a future preset time period includes: The occurrence frequency of the alarm information corresponding to each target field type in each sub-time period and the time characteristics corresponding to the sub-time period are input into the preset prediction model, and the predicted probability of the alarm information corresponding to each target field type appearing again in the future preset time period is output.

5. The method according to claim 1, characterized in that The adjusting the order of each target index according to the priority corresponding to each target index includes: According to each of the target indexes, determining the position of each of the target indexes in the hash table; According to the priority corresponding to each of the target indexes, the position order of each of the target indexes in the hash table is adjusted; wherein, the higher the priority of the target index is, the higher the order of the target index is; The multiple field types in each of the target indexes are sorted according to the priorities corresponding to the field types.

6. The method according to claim 1, characterized in that The indexing of various field types corresponding to the target field to generate multiple target indexes includes: Convert all letters corresponding to each field type into target code values; Adding the target code values ​​to obtain a second sum; Each of the second sums is used as the target index.

7. The method according to claim 1, characterized in that The adjusting the order of each target index according to the priority corresponding to each target index includes: Determine the position of each target index in the B+ tree according to each target index; According to the priority corresponding to each of the target indexes, the position of each of the target indexes in the B+ tree is adjusted; wherein, the higher the priority of the target index is, the higher the position of the target index is.

8. An index adjustment device, characterized in that: The device comprises: A first determination module is used to identify each piece of alarm information and determine a target field in each piece of alarm information that needs to be indexed; A generating module, used for indexing various field types included in the target field to generate multiple target indexes; The second determination module is used to determine at least one target field type corresponding to each of the target indexes. A third determination module, used to determine the priority corresponding to each target index according to each target field type corresponding to each target index; The adjustment module is used to adjust the order of each target index according to the priority corresponding to each target index.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the index adjustment method according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the index adjustment method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method of managing alarm inquiry

    CN101163032A

  • Alarm data storage method and device based on HBase

    CN107273482A

  • Monitoring alarm method and device

    CN113419928A

  • Index optimization method, device and equipment and computer readable storage medium

    CN114968972A

  • Distributed database recommendation index generation method

    CN116483831A