Index adjustment method and device, computer device, and storage medium

By identifying and adjusting the target field index of alarm information, generating multiple target indexes, and sorting them according to priority, the problem of low query efficiency of alarm information in distributed storage is solved, and fast and accurate alarm information query is achieved.

CN118568093BActive Publication Date: 2026-11-24JINAN INSPUR DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In distributed storage, existing technologies for indexing alarm information result in excessively long query times, especially when there are many alarms, leading to low query efficiency.

Method used

By identifying the target fields in the alarm information, multiple target indexes are generated, and the priority is determined based on factors such as the target field type and query frequency. The index sorting is then adjusted to improve query efficiency.

Benefits of technology

By using highly accurate index tuning methods, users can quickly find alert information in high-priority target indexes, significantly reducing query time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118568093B_ABST
    Figure CN118568093B_ABST
Patent Text Reader

Abstract

This invention relates to the field of index adjustment technology, specifically to index adjustment methods, apparatus, computer equipment, and storage media. The method involves identifying each alarm message and determining the target fields for indexing within each alarm message; creating indexes for various field types included in the target fields, generating multiple target indexes; determining at least one target field type corresponding to each target index; determining the priority of each target index based on its corresponding target field types; and adjusting the sorting of the target indexes according to their priorities. This ensures that the sorting of the target indexes can be adjusted promptly based on their priorities, allowing users to prioritize higher-priority target indexes when querying alarm messages, thus saving time in finding alarm information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of index adjustment technology, and specifically to index adjustment methods, apparatus, computer equipment, and storage media. Background Technology

[0002] In distributed storage, as the number of nodes increases, so do the hardware alarms for various components, such as CPU, memory, and fan status, as well as alarms and notifications related to various services, such as FTP and load balancing. During the automatic alarm reporting and recovery process, frequent queries and comparisons of alarms are required. Furthermore, after alarm reporting and recovery, customers also frequently query current and historical alarms. Therefore, alarm indexing is crucial and directly impacts the speed of alarm processing.

[0003] In existing technologies, indexes are typically created for a specific field in alarm information to facilitate querying and comparison of alarm information. However, once an alarm is inserted into the database, its relative position in the index data structure no longer changes.

[0004] Therefore, when comparing duplicate alarms during alarm reporting, querying alarm information will take more time. Similarly, if users query and export a large number of alarms, the query process will also be time-consuming. Summary of the Invention

[0005] In view of this, the present invention provides an index adjustment method, apparatus, computer device and storage medium to solve the problem that users will spend a lot of time querying and exporting alarm information if there are many alarm messages.

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

[0007] Identify each alarm message and determine the target fields in each alarm message that need to be indexed;

[0008] Create indexes for all field types included in the target field, generating multiple target indexes;

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

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

[0011] The sorting of each target index is adjusted according to its priority.

[0012] The index adjustment method provided in this application identifies each alarm message and determines the target fields for indexing in each alarm message, ensuring the accuracy of the determined target fields. It creates indexes for various field types included in the target fields, generating multiple target indexes, ensuring the accuracy of the generated target indexes. It determines at least one target field type corresponding to each target index, and determines the priority of each target index based on the target field types, ensuring the accuracy of the determined priorities. Based on the priorities of each target index, it adjusts the sorting of each target index, ensuring that the sorting of the target indexes can be adjusted in a timely manner according to their priorities. This allows users to first search in higher-priority target indexes when querying alarm information, making it easier to find and saving time in searching for alarm information.

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

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

[0015] Add the ASCII values ​​together to get the first sum;

[0016] Take the first sum modulo a preset prime number, and use the remainder as the target index.

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

[0018] In one optional implementation, the priority of each target index is determined based on the target field type corresponding to each target index, including:

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

[0020] Based on the frequency of alarm information corresponding to each target field type within each sub-time period, the predicted probability of alarm information corresponding to each target field type reappearing within a future preset time period is determined.

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

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

[0023] Calculate the subquery ratio for users querying alarm information for each target field type based on the number of subqueries and the total number of queries.

[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 this application detects the frequency of alarm information corresponding to each target field type within multiple sub-time periods corresponding to a preset historical time period. Based on the frequency of alarm information corresponding to each target field type within each sub-time period, it determines the predicted probability of alarm information corresponding to each target field type reappearing within a future preset time period, ensuring the accuracy of the predicted probability of alarm information corresponding to each target field type reappearing within the future preset time period. It obtains the total number of queries corresponding to alarm information queried by users; for each target index, it obtains the number of subqueries performed by users on alarm information of each target field type corresponding to the target index; based on the number of subqueries and the total number of queries, it calculates the subquery ratio of users querying alarm information of each target field type, ensuring the accuracy of the calculated subquery ratio. Based on the predicted probability and the subquery ratio, it determines the priority of the target field type corresponding to the target index, ensuring that the determined priority of the target field type corresponding to the target index considers both the predicted probability of alarm information appearing and the possibility of users querying alarm information of the target field type, 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, thus ensuring the accuracy of the determined priority of the target index.

[0027] In one optional implementation, based on the frequency of occurrence of alarm information corresponding to each target field type within each sub-time period, the predicted probability of the recurrence of alarm information corresponding to each target field type within a future preset time period is determined, including:

[0028] The frequency of alarm information corresponding to each target field type within 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 reappearing within the preset time period in the future is output.

[0029] The index adjustment method provided in this application inputs the frequency 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 alarm information corresponding to each target field type reappearing in a future preset time period, thus ensuring the accuracy of the output predicted probability of alarm information corresponding to each target field type reappearing in a future preset time period.

[0030] In one optional implementation, the sorting of the target indexes is adjusted according to their respective priorities.

[0031] Based on each target index, determine the position of each target index in the hash table;

[0032] The order of each target index in the hash table is adjusted according to its priority; the higher the priority of the target index, the earlier it appears in the order.

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

[0034] The index adjustment method provided in this application determines the position of each target index in a hash table based on each target index; it then adjusts the order of the target indexes in the hash table according to their respective priorities, thereby ensuring the accuracy of their positions. For multiple field types in each target index, the indexes are sorted according to their respective priorities, ensuring the accuracy of the priorities corresponding to each field type. This allows users to first search for alarm information in higher-priority target indexes, making it easier to find the information and saving time in searching for alarm information.

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

[0036] Convert all letters corresponding to each field type to the target code value;

[0037] Add the values ​​of each target code to obtain the second sum;

[0038] Use the second sum as the target index.

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

[0040] In one optional implementation, the sorting of the target indexes is adjusted according to their respective priorities, including:

[0041] Determine the position of each target index in the B+ tree based on each target index;

[0042] Based on the priority of each target index, the position of each target index in the B+ tree is adjusted; the higher the priority of the target index, the higher its position.

[0043] The index adjustment method provided in this application determines the position of each target index in the B+ tree based on each target index; and adjusts the position of each target index in the B+ tree according to the priority of each target index, ensuring the accuracy of the position of each target index in the B+ tree. This allows users to first search in the target index with higher priority when querying alarm information, making it easier to find and saving time in searching for 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 alarm message and determine the target fields in each alarm message that need to be indexed;

[0046] The generation module is used to create indexes on various field types included in the target field, generating multiple target indexes.

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

[0048] The third determination module is used to determine the priority of each target index based on the target field type corresponding to each target index.

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

[0050] The index adjustment device provided in this application identifies each alarm message and determines the target fields for indexing in each alarm message, ensuring the accuracy of the determined target fields. It creates indexes for various field types included in the target fields, generating multiple target indexes, ensuring the accuracy of the generated target indexes. It determines at least one target field type corresponding to each target index, and determines the priority of each target index based on the target field types, ensuring the accuracy of the determined priorities. Based on the priorities of each target index, it adjusts the sorting of each target index, thereby ensuring that the sorting of the target indexes can be adjusted in a timely manner according to the priorities of each target index, facilitating the query and comparison of alarm messages.

[0051] Thirdly, the present invention provides a computer device, comprising: 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 computer instructions to perform the index adjustment method of the first aspect or any corresponding embodiment described above.

[0052] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to perform the index adjustment method of the first aspect or any corresponding embodiment thereof.

[0053] Fifthly, the present invention provides a computer program product, including computer instructions for causing a computer to execute the index adjustment method of the first aspect or any corresponding embodiment thereof. Attached Figure Description

[0054] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

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

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

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

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

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

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

[0061] Figure 7 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation

[0062] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0063] It should be noted that the index adjustment method provided in this application embodiment can be executed by an index adjustment device. This device can be implemented as part or all of a computer device through software, hardware, or a combination of both. The computer device can be a server or a terminal. In this application embodiment, the server can be a single server or a server cluster composed of multiple servers. The terminal in this application embodiment can be a smartphone, personal computer, tablet computer, wearable device, or other intelligent hardware device such as an intelligent robot. In the following method embodiments, the execution subject is always described using an electronic device as an example.

[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 in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0065] This embodiment provides an index adjustment method that can be used in the aforementioned electronic device. Figure 1 This is a flowchart of an index adjustment method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps:

[0066] Step S101: Identify each alarm message and determine the target fields in each alarm message that need to be indexed.

[0067] Specifically, the electronic device can identify each alarm message, summarize each alarm message based on the identification results, and determine the number of field types corresponding to each field in each alarm message.

[0068] For example, the alarm level field typically contains only three levels: minor, important, and urgent, meaning 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] Electronic devices can compare the number of field types corresponding to each field with a preset number threshold. If the number of field types corresponding to each field is greater than the preset number threshold, then the field is identified as a candidate field.

[0070] The electronic device analyzes each candidate field to determine whether the data types of each candidate field are completely different, i.e., whether each data type in each candidate field is a unique identifier. If each data type in a candidate field is a unique identifier, the candidate field is deleted, and the remaining candidate fields are identified as the target fields for indexing.

[0071] For example, the alarm serial number, serving as a unique identifier for the alarm reporting order, is an integer field typically used to uniquely identify an alarm. Therefore, this field is usually queried using exact matching. Thus, this field does not need to be indexed again, and the alarm serial number can be removed from the candidate fields. A hash table can be used to index the alarm serial number. Since the size of the address set equals the size of the key set, direct addressing H(key) = key is used, ensuring a direct one-to-one correspondence without conflicts.

[0072] For example, the alarm body may include field types such as Node1, file1, file23, cpu01, memory02, and buckettest. Therefore, the electronic device can determine that the alarm body in the alarm message 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 entirely in memory (placing it on disk would result in excessive disk access).

[0073] For example, the alarm description will describe each alarm condition. Because the alarm description includes many field types, the electronic device can determine the target field for which an index needs to be built based on the alarm description in the alarm information. Since the target field has a large cardinality and is long, part of the index can be placed in memory and part can be stored on disk.

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

[0075] Specifically, electronic devices can use preset methods to create indexes on various field types included in the target field, generating multiple target indexes.

[0076] The preset method can be a hash algorithm, such as MD5 or SHA. However, these algorithms are computationally complex and produce longer hashes. Therefore, this application does not specifically limit the preset method.

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

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

[0079] Specifically, since two or more field types may have the same target index after being indexed, electronic devices need to determine at least one target field type corresponding to each target index based on the correspondence between the target index and each field type.

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

[0081] Specifically, the electronic device can first determine the priority of each target field type based on the target field type corresponding to each target index, and then determine the priority of each target index based on the priority of each target field type.

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

[0083] Step S105: Adjust the sorting of each target index according to its priority.

[0084] Specifically, the electronic device can sort the target indexes according to their priority.

[0085] This step will be explained in detail below.

[0086] The index adjustment method provided in this embodiment identifies each alarm message and determines the target field for indexing in each alarm message, ensuring the accuracy of the determined target field. It creates indexes for various field types included in the target field, generating multiple target indexes, thus ensuring the accuracy of the generated target indexes. It also determines at least one target field type corresponding to each target index.

[0087] Based on the target field types corresponding to each target index, the priority of each target index is determined, ensuring the accuracy of the determined priority. The sorting of each target index is adjusted according to its priority, ensuring that the sorting can be adjusted promptly based on the priority of each target index. This allows users to first search for alarm information in higher-priority target indexes, making it easier to find the information and saving time in alarm search.

[0088] This embodiment provides an index adjustment method that can be used in the aforementioned electronic device. Figure 2 This is a flowchart of an index adjustment method according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps:

[0089] Step S201: Identify each alarm message and determine the target fields in each alarm message that need to be indexed.

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

[0091] Specifically, step S202 includes:

[0092] Step S2021: Convert the letters of various field types within the preset range into ASCII code values.

[0093] Specifically, electronic devices can convert letters of various field types within a preset range into ASCII code values.

[0094] The preset range can be the first to fifth letters of various field types, the second to eighth letters, or other ranges. This application embodiment does not specifically limit the preset range.

[0095] Step S2022: Add the ASCII code values ​​together to obtain the first sum.

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

[0097] Step S2023: Take the first sum modulo a preset prime number, and use the remainder as the target index.

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

[0099] The preset prime number can be 2, 3, 5 or other prime numbers. This 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 details on this step, please refer to [link / reference]. Figure 1 The details of step S103 will not be elaborated here.

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

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

[0104] Step S2041: Detect the frequency of alarm information corresponding to each target field type within multiple sub-time periods corresponding to the preset historical time period.

[0105] Specifically, electronic devices can detect the frequency of alarm information corresponding to each target field type within multiple sub-time periods corresponding to a preset historical time period.

[0106] The preset historical time period can be the period within one month prior to the current time, or the period within two months prior to the current time. This application embodiment does not specifically limit the preset historical time period. The multiple sub-time periods corresponding to the preset historical time period can be divided into units of one day, three days, or other durations. This application embodiment does not specifically limit the specific duration of the multiple sub-time periods.

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

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

[0109] Step S2042: Based on the frequency of alarm information corresponding to each target field type in each sub-time period, determine the predicted probability of alarm information corresponding to each target field type reappearing in the future preset time period.

[0110] In one optional embodiment of this application, the electronic device can fit a prediction formula based on the frequency of alarm information corresponding to each target field type within each sub-time period and the sub-time period itself. The prediction formula can 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), to obtain the slope b of the sloping line. The independent variable x is , and the dependent variable y is . Calculate the predicted probability Q of the recurrence of alarm information corresponding to each target field type within the future preset time period.

[0113] Specifically, step S2042 above includes:

[0114] The frequency of alarm information corresponding to each target field type within 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 reappearing within the preset time period in the future is output.

[0115] Specifically, the electronic device can input the frequency of alarm information corresponding to each target field type within 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 reappearing within a preset time period in the future.

[0116] The preset prediction model can be any one of the following: Radial Basis Function (RBF) network, Feedforward Neural Network (FFNN), Convolutional Neural Network (CNN), Deconvolutional Networks (DN), Deep Convolutional Inverse Graphics Networks (DCIGN), Generative Adversarial Networks (GAN), Recurrent Neural Networks (RNN), Long / Short Term Memory (LSTM), Deep Residual Networks (DRN), and Extreme Learning Machines (ELM). This application does not limit the preset prediction model.

[0117] It should be noted that the preset prediction model can be trained based on alarm information from historical periods prior to the preset historical time period.

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

[0119] Specifically, electronic devices can locate the total number of queries corresponding to user query alarm information in the storage space.

[0120] Step S2044: For each target index, obtain the number of subqueries performed by the user to query the alarm information of each target field type corresponding to the target index.

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

[0122] For example, assuming that the target field types corresponding to the target index 003 include memory02, file1 and file23, the electronic device will obtain the number of subqueries performed by the user for the alarm information of memory02, the number of subqueries performed for the alarm information of file1, and the number of subqueries performed for the alarm information of file23, respectively.

[0123] Step S2045: Calculate the subquery ratio of the user querying alarm information for each target field type based on the number of subqueries and the total number of queries.

[0124] Specifically, electronic devices calculate the subquery ratio of user queries for alarm information of each target field type based on the number of subqueries and the total number of queries.

[0125] For example, the electronic device calculates the subquery ratios for querying alarm information for memory02, alarm information for file1, and alarm information for file23, respectively.

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

[0127] Optionally, the electronic device can add the subquery ratio and the predicted probability of alarm information for each target field type to calculate the priority of the target field type corresponding to the target index.

[0128] Optionally, the electronic device can also perform a weighted sum of the subquery ratio and the prediction probability of the alarm information for each target field type to calculate the priority of the target field type corresponding to the target index.

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

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

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

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

[0133] For example, suppose the target field type is file1 in the target index, and target field type file1 includes target alarm information 1-10. The electronic device detects whether target alarm information 1 corresponding to target field type file1 is a resolved alarm or an unresolved alarm. Then, it calculates the priority of target alarm information 1 based on the detection result. Similarly, it calculates the priorities of target alarm information 2-10. Finally, based on the priorities of target alarm information 1-10, it determines the priority of target field type file1 in the target index.

[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, electronic devices can calculate the priority of the target index by weighted averaging of the priorities of each target field type corresponding to the target index.

[0136] Step S205: Adjust the sorting of each target index according to its priority.

[0137] Specifically, step S205 above includes:

[0138] Step S2051: Determine the position of each target index in the hash table based on each target index.

[0139] Specifically, electronic devices can determine the position of each target index in the hash table based on each target index.

[0140] Step S2052: Adjust the order of each target index in the hash table according to the priority of each target index.

[0141] The higher the priority of the target index, the earlier it appears in the order of the target index.

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

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

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

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

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

[0147] Next, the frequency of alarm information corresponding to each target field type is detected within multiple sub-time periods corresponding to a preset historical time period. The frequency of alarm information corresponding to each target field type within each sub-time period and the corresponding time characteristics are input into a preset prediction model to output the predicted probability of the recurrence of alarm information corresponding to each target field type within a future preset time period, ensuring the accuracy of the output predicted probability. The total number of queries corresponding to alarm information queries by users is obtained. For each target index, the number of subqueries performed by users on alarm information for each target field type corresponding to the target index is obtained. Based on the number of subqueries and the total number of queries, the subquery ratio of user queries on alarm information for each target field type is calculated, ensuring the accuracy of the calculated subquery ratio. Based on the predicted probability and the subquery ratio, the priority of the target field type corresponding to the target index is determined, ensuring that the determined priority of the target field type corresponding to the target index considers both the predicted probability of the alarm information appearing and the possibility of the alarm information being queried by users, thus 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, thus ensuring the accuracy of the determined priority of the target index.

[0148] Then, based on each target index, its position in the hash table is determined. The order of these target indexes in the hash table is adjusted according to their priority, ensuring the accuracy of their positions. For multiple field types within each target index, they are sorted according to their respective priorities, guaranteeing the accuracy of these priorities. This allows users to first search for alert information in higher-priority target indexes, making it easier to find the information and saving time in the alert retrieval process.

[0149] This embodiment provides an index adjustment method that can be used in the aforementioned electronic device. Figure 4 This is a flowchart of an index adjustment method according to an embodiment of the present invention, such as... Figure 4 As shown, the process includes the following steps:

[0150] Step S301: Identify each alarm message and determine the target fields in each alarm message that need to be indexed.

[0151] Please refer to the instructions for this step. Figure 2 The details of step S201 will not be elaborated here.

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

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

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

[0155] Specifically, electronic devices can convert all the letters corresponding to each field type into target code values.

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

[0157] Step S3022: Add the target code values ​​together to obtain the second sum.

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

[0159] Step S3023: Use each second sum as the target index.

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

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

[0162] For details on this step, please refer to [link / reference]. Figure 2 The details of step S203 will not be elaborated here.

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

[0164] For details on this step, please refer to [link / reference]. Figure 2 The details of step S204 will not be elaborated here.

[0165] Step S305: Adjust the sorting of each target index according to its priority.

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

[0167] Step S3051: Determine the position of each target index in the B+ tree based on each target index.

[0168] Specifically, electronic devices can determine the position of each target index in the B+ tree based on each target index.

[0169] 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 of each target index.

[0171] The higher the priority of the target index, the higher its position.

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

[0173] In a tree-structured index, the tree depth varies. Shallower depths require fewer disk accesses, resulting in higher query efficiency. Different tree depths have different priorities. For example, the first level has a priority of 1 to 0.8, while the second level has a priority of 0.8 to 0.6. Therefore, if the priority of the target index value 28 is greater than 0.8, the index will be moved to the next higher level of the tree structure. In a tree-structured index, the tree depth affects query efficiency: if a piece of data is at the third level of the tree, it requires three disk reads. Therefore, the shallower the data being queried, the faster the query speed.

[0174] For example, such as Figure 5 The diagram shown is a schematic of the adjusted positions of each target index in the B+ tree.

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

[0176] The position of each target index in the B+ tree is determined based on the target index; the position of each target index in the B+ tree is adjusted according to the priority of each target index, ensuring the accuracy of the position of each target index in the B+ tree. This allows users to first search in the target index with higher priority when querying alarm information, making it easier to find and saving time in searching for alarm information.

[0177] This embodiment also provides an index adjustment device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

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

[0179] The first determining module 401 is used to identify each alarm message and determine the target fields in each alarm message that need to be indexed.

[0180] The generation module 402 is used to create indexes on various field types included in the target field and generate multiple target indexes.

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

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

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

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

[0185] In some optional implementations, the third determining module 404 is specifically used to detect the frequency of occurrence of alarm information corresponding to each target field type within 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 within each sub-time period, determine the predicted probability of alarm information corresponding to each target field type reappearing within a future preset time period; obtain the total number of queries corresponding to user queries for alarm information; for each target index, obtain the number of subqueries performed by the user for alarm information of each target field type corresponding to the target index; calculate the subquery ratio of user queries for alarm information of each target field type based on the number of subqueries and the total number of queries; determine the priority of the target field type corresponding to the target index based on the predicted probability and the subquery ratio; and determine the priority of the target index based on the priority of each target field type corresponding to the target index.

[0186] In some optional implementations, the third determining 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 occurrence of alarm information corresponding to each target field type again in a 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 order of each target index in the hash table according to the priority of each target index; wherein, the higher the priority of the target index, the earlier the target index is in the order; and sort the multiple field types in each target index according to the priority of 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 target code values; add the target code values ​​together 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 based on each target index; and to adjust the position of each target index in the B+ tree according to the priority of each target index; wherein, the higher the priority of the target index, the higher the position of the target index.

[0190] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.

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

[0192] This invention also provides a computer device having the above-described features. Figure 6 The index adjustment device shown.

[0193] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 7As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 7 Take a processor 10 as an example.

[0194] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.

[0195] The memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to perform the method shown in the above embodiments.

[0196] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0197] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or 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, memory 20, input device 30, and output device 20 can be connected via a bus or other means. Figure 7 Taking the example of a connection between China and Israel via a bus.

[0199] Input device 30 can receive input numerical or character information, and generate key signal inputs related to user settings and function control of the computer device, such as a touchscreen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc. Output device 40 may include display devices, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibration motors). The aforementioned display devices include, but are not limited to, liquid crystal displays, light-emitting diodes, displays, and plasma displays. In some alternative embodiments, the display device may be a touchscreen.

[0200] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.

[0201] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

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

Claims

1. An index adjustment method, characterized in that, The method includes: Identify each alarm message and determine the target fields in each alarm message that need to be indexed; Create indexes for the various field types included in the target field to generate multiple target indexes; Determine at least one target field type corresponding to each of the target indexes. The priority of each target index is determined based on the target field type corresponding to each target index. The sorting of each target index is adjusted according to the priority corresponding to each target index; The step of determining the priority of each target index according to the target field type corresponding to each target index includes: Detect the frequency of occurrence of the alarm information corresponding to each target field type within multiple sub-time periods corresponding to a preset historical time period; Based on the frequency of occurrence of the alarm information corresponding to each target field type within each sub-time period, the predicted probability of the alarm information corresponding to each target field type reappearing within a future preset time period is determined. Obtain the total number of queries corresponding to the alarm information queried by the user; For each target index, obtain the number of subqueries performed by the user for the alarm information of each target field type corresponding to the target index; Based on the number of subqueries and the total number of queries, calculate the subquery ratio of the user's queries for alarm information of each of the target field types; Based on the predicted probability and the subquery ratio, the priority of the target field type corresponding to the target index is determined; The priority of the target index is determined based on the priority of each target field type corresponding to the target index; The step of determining the priority of the target field type corresponding to the target index based on the predicted probability and the subquery ratio includes: For each target alarm message in each target field type, detect whether the target alarm message is a resolved alarm message or an unresolved alarm message; If the target alarm information is a resolved alarm information, then query the first query count corresponding to the resolved alarm information; Divide the first query count by the total query count to obtain the first query ratio corresponding to the resolved alarm information; multiply the first query ratio by the subquery ratio of the alarm information corresponding to the target field type, and add the predicted probability corresponding to the alarm information of each target field type to calculate the priority of the target alarm information. If the target alarm information is an unresolved alarm information, then query the second query number corresponding to the unresolved alarm information; Divide the number of second queries by the total number of queries to obtain the second query ratio corresponding to unresolved alarm information; The priority of the target alarm information is calculated by multiplying the second query ratio by the subquery ratio of the alarm information corresponding to the target field type, and adding the prediction probability of the alarm information corresponding to each target field type. The priority of the target field type corresponding to the target index is calculated by averaging the priorities of each target alarm information in the target field type.

2. The method according to claim 1, characterized in that, The step involves creating indexes for various field types corresponding to the target field, generating multiple target indexes, including: Convert all letters of the various field types within a preset range to ASCII code values; Add the ASCII code values ​​together to obtain the first sum; The first sum is modulo a preset prime number, and the remainder is used as the target index.

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

4. The method according to claim 1, characterized in that, The step of adjusting the sorting of the target indexes according to their respective priorities includes: Based on each of the target indices, determine the position of each target index in the hash table; The order of each target index in the hash table is adjusted according to its priority; wherein, the higher the priority of the target index, the earlier the target index is in the order. For each of the target indexes, the multiple field types are sorted according to the priority of each field type.

5. The method according to claim 1, characterized in that, The step involves creating indexes for various field types corresponding to the target field, generating multiple target indexes, including: Convert all letters corresponding to each of the field types into target code values; The target code values ​​are added together to obtain the second sum; Use each of the second sums as the target index.

6. The method according to claim 1, characterized in that, The step of adjusting the sorting of the target indexes according to their respective priorities includes: The position of each target index in the B+ tree is determined based on each target index; The position of each target index in the B+ tree is adjusted 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.

7. An index adjustment device, characterized in that, The device includes: The first determining module is used to identify each alarm message and determine the target fields that need to be indexed in each alarm message; The generation module is used to create indexes on various field types included in the target field and generate multiple target indexes. The second determining module is used to determine at least one target field type corresponding to each of the target indexes. The third determining module is used to determine the priority of each target index according to the target field type corresponding to each target index; wherein, determining the priority of each target index according to the target field type includes: detecting the occurrence frequency of alarm information corresponding to each target field type within multiple sub-time periods corresponding to a preset historical time period; determining the predicted probability of the alarm information corresponding to each target field type reappearing within a future preset time period based on the occurrence frequency of the alarm information corresponding to each target field type within each sub-time period; obtaining the total number of queries corresponding to the alarm information by the user; for each target index, obtaining the number of sub-queries performed by the user on the alarm information of each target field type corresponding to the target index; and calculating the priority of the alarm information of each target field type by the user based on the number of sub-queries and the total number of queries. The process involves: determining the priority of the target field type corresponding to the target index based on the predicted probability and the subquery ratio; determining the priority of the target index based on the priority of each target field type corresponding to the target index; wherein, determining the priority of the target field type corresponding to the target index based on the predicted probability and the subquery ratio includes: for each target alarm information in each target field type, detecting whether the target alarm information is a resolved alarm information or an unresolved alarm information; if the target alarm information is a resolved alarm information, querying the first query count corresponding to the resolved alarm information; dividing the first query count by the total query count to obtain the first query ratio corresponding to the resolved alarm information; multiplying the first query ratio by the subquery ratio of the alarm information corresponding to the target field type, and adding the predicted probability corresponding to the alarm information of each target field type, to calculate the priority corresponding to the target alarm information; If the target alarm information is an unresolved alarm information, then query the second query count corresponding to the unresolved alarm information; divide the second query count by the total query count to obtain the second query ratio corresponding to the unresolved alarm information; multiply the second query ratio by the subquery ratio of the alarm information corresponding to the target field type, and add the predicted probability corresponding to the alarm information of each target field type to calculate the priority of the target alarm information; average the priorities of each target alarm information in the target field type to calculate the priority of the target field type corresponding to the target index. The adjustment module is used to adjust the sorting of each target index according to the priority corresponding to each target index.

8. A computer device, characterized in that, include: A memory and a processor are communicatively connected, the memory storing computer instructions, and the processor executing the computer instructions to perform the index adjustment method of any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the index adjustment method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method of managing alarm inquiry

    CN101163032A

  • Monitoring alarm method and device

    CN113419928A