A method, device, equipment and medium for processing alarm data

By calculating the hash value of the alarm data and positioning it to the target storage node, the problem of excessive repeated alarm data in the data center is solved, efficient alarm data processing and storage is achieved, and operation and maintenance efficiency is improved.

CN119739721APending Publication Date: 2025-04-01INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202412000328.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

In data centers, a large number of repeated alarm data may quickly emerge in the short term, increasing the burden on managers and may cover up emergency alarm information, thereby affecting operation and maintenance efficiency and stability.

Method used

By calculating the hash value of the alarm data, accurately locate the target storage node that stores the target alarm information from multiple storage nodes, and write the alarm information and data at the target location to ensure that the data is stored only once.

Benefits of technology

It realizes rapid and efficient filtering and storing non-repetitive alarm data, reduces the lengthy search process, improves the efficiency of alarm data processing, and ensures the uniqueness of the data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739721A_ABST
    Figure CN119739721A_ABST
Patent Text Reader

Abstract

The present invention relates to the field of data processing, and in particular to an alarm data processing method, device, equipment and medium, the method comprising: after receiving storage requests for multiple alarm data, according to the hash value corresponding to the target alarm data, determining the target storage node storing the target alarm information of the target alarm data from multiple storage nodes; the memory of each storage node stores a corresponding alarm hash table, and each alarm hash table records the alarm information corresponding to the alarm data; according to the hash value corresponding to the target alarm data, determining the target position corresponding to the target alarm information from the target alarm hash table of the target storage node; if the target position of the target alarm hash table meets the preset conditions, writing the target alarm information to the target position, and storing the target alarm data in a database. The present invention can quickly and efficiently overwrite non-repetitive alarm data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing, and in particular to an alarm data processing method, device, equipment and medium. Background Art

[0002] In recent years, with the rapid development and widespread application of cloud computing and big data technologies, the infrastructure of data centers has not only increased dramatically in quantity, but also large and medium-sized data centers can generate tens of thousands of alarms every day in daily operations, or even more.

[0003] After the device generates alarm data, it is uniformly gathered in the data center for unified management. The data center is equipped with management software that can calculate and store alarm data of resources such as switches, and store a large amount of alarm data in databases corresponding to multiple node devices. However, a large amount of duplicate alarm data may emerge rapidly in the short term. These duplicate alarms not only increase the burden on management personnel, but may also cover up the emergency alarm information that really needs attention, thereby affecting the overall operation and maintenance efficiency and stability of the data center.

[0004] When storing data, the related technology determines whether the data to be stored is consistent with the previously stored data. If they are consistent, it means that the data to be stored is duplicate data and the data will not be written to the database. If they are inconsistent, the data to be stored will be written to the database to avoid duplicate alarm data storage. However, this method makes the writing efficiency relatively low.

[0005] Therefore, how to quickly and efficiently overwrite non-duplicate alarm data has become one of the core technical issues that need to be urgently solved in this field. Summary of the invention

[0006] The object of the present invention is to provide an alarm data processing method, device, equipment and medium, which can quickly and efficiently overwrite non-repetitive alarm data.

[0007] In a first aspect, a method for processing alarm data is provided, comprising:

[0008] After receiving storage requests for multiple alarm data, determine a target storage node for storing target alarm information of the target alarm data from multiple storage nodes according to a hash value corresponding to the target alarm data; wherein the target alarm data is any data among the multiple alarm data, a corresponding alarm hash table is stored in the memory of each storage node, and each alarm hash table records the alarm information corresponding to the alarm data; the hash value corresponding to the target alarm data is obtained by performing a hash value calculation based on a key field of the target alarm data;

[0009] Determining a target location corresponding to the target alarm information from a target alarm hash table of the target storage node according to a hash value corresponding to the target alarm data;

[0010] If the target position of the target alarm hash table meets the preset conditions, the target alarm information is written into the target position, and the target alarm data is stored in a database.

[0011] In a preferred example, the present invention can be further configured as follows:

[0012] Perform hash calculation based on the key fields of the target alarm data to determine the initial hash value corresponding to the target alarm data;

[0013] Perform an XOR operation on the high half and the low half of the initial hash value to obtain the hash value corresponding to the target alarm data.

[0014] In a preferred example, the present invention can be further configured as follows: determining a target storage node storing target alarm information of the target alarm data from a plurality of storage nodes according to a hash value corresponding to the target alarm data includes:

[0015] Performing a bitwise AND operation on the hash value corresponding to the target alarm data and a first preset value to obtain a first value;

[0016] According to the first value and the total number of the plurality of storage nodes, a target storage node for storing the target alarm information of the target alarm data is determined from the plurality of storage nodes.

[0017] In a preferred example, the present invention can be further configured as follows: determining the target location corresponding to the target alarm information from the target alarm hash table of the target storage node according to the hash value corresponding to the target alarm data, including:

[0018] A bitwise AND operation is performed on the hash value corresponding to the target alarm data and a second preset value to obtain a second value as the target position corresponding to the target alarm information.

[0019] In a preferred example, the present invention can be further configured as follows: the alarm information includes: a hash value and a primary key identifier corresponding to the alarm data, wherein each alarm data corresponds to a unique primary key identifier;

[0020] If the target position of the target alarm hash table meets the preset condition, the target alarm information is written into the target position, and the target alarm data is stored in a database, including:

[0021] If the target location of the target alarm hash table does not contain information, the target alarm information is written into the target location, and the target alarm data is stored in a database;

[0022] If there is information at the target location of the target alarm hash table, obtaining the plaintiff alarm data corresponding to the primary key identifier of the alarm information at the target location from the database;

[0023] If the plaintiff alarm data is different from the target alarm data, the target alarm information is added to the end of the linked list corresponding to the target position, and the target alarm data is stored in the database; if the plaintiff alarm data is the same as the target alarm data, the target alarm data is determined to be duplicate data.

[0024] In a preferred example, the present invention may be further configured as follows: the database includes a plurality of sub-databases corresponding to respective storage nodes;

[0025] The storing the target alarm data in a database comprises:

[0026] According to the hash values ​​corresponding to the plurality of alarm data, a modulo operation is performed based on the number of nodes to determine the storage node corresponding to each alarm data;

[0027] According to the storage node corresponding to the target alarm data, the target alarm data is stored in the sub-database of the corresponding storage node.

[0028] In a preferred example, the present invention can be further configured to include at least one of the following:

[0029] In response to the storage node expansion operation, according to the total number of the multiple storage nodes and the total number of storage nodes after the expansion, determine the alarm data that needs to be migrated for the sub-databases of the multiple storage nodes; migrate the alarm data that needs to be migrated for the sub-databases of the multiple storage nodes to the newly added sub-database after the expansion;

[0030] In response to the storage node shrinking operation, the alarm data of the sub-database of the shrunken storage node is migrated to the remaining storage nodes according to the total number of the multiple storage nodes and the total number of storage nodes after shrinking.

[0031] In a preferred example, the present invention can be further configured as follows: according to the hash values ​​corresponding to the plurality of alarm data, a modulo operation is performed based on the number of nodes to determine the storage node corresponding to each alarm data, including:

[0032] Obtain the remaining space of each sub-database corresponding to multiple alarm data;

[0033] Determine whether the difference between the remaining spaces of the sub-databases corresponding to the multiple alarm data is within the preset difference range:

[0034] If they are in compliance, a modulo operation is performed according to the hash values ​​and the number of nodes corresponding to each of the plurality of alarm data, so as to determine the storage node corresponding to each alarm data;

[0035] If it does not match, the target total value is determined according to the ratio of the remaining space of the sub-databases corresponding to the multiple alarm data, and a modulo operation is performed based on the target total value according to the hash values ​​corresponding to the multiple alarm data, so as to determine the storage node corresponding to each alarm data.

[0036] In a second aspect, an alarm data processing device is provided, comprising:

[0037] A determination module is used to determine, after receiving storage requests for multiple alarm data, a target storage node for storing target alarm information of the target alarm data from multiple storage nodes according to a hash value corresponding to the target alarm data; wherein the target alarm data is any data among the multiple alarm data, a corresponding alarm hash table is stored in the memory of each storage node, and each alarm hash table records the alarm information corresponding to the alarm data; the hash value corresponding to the target alarm data is obtained by performing a hash value calculation based on a key field of the target alarm data;

[0038] A target position determination module, configured to determine a target position corresponding to the target alarm information from a target alarm hash table of the target storage node according to a hash value corresponding to the target alarm data;

[0039] A writing module is used to write the target alarm information into the target position if the target position of the target alarm hash table meets the preset conditions, and store the target alarm data in a database.

[0040] In a third aspect, an electronic device is provided, including:

[0041] one or more processors;

[0042] Memory;

[0043] One or more applications, wherein one or more applications are stored in a memory and configured to be executed by one or more processors, and one or more programs are configured to: perform operations corresponding to the method shown in any possible implementation of the first aspect.

[0044] In a fourth aspect, a computer-readable storage medium is provided, wherein the storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, at least one program, a code set or an instruction set is loaded by a processor and executes the steps of the method shown in any possible implementation of the first aspect.

[0045] In a fifth aspect, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, operations corresponding to the method shown in any possible implementation manner in the first aspect are implemented.

[0046] In summary, the alarm data processing method provided by the present invention includes the following beneficial technical effects:

[0047] After receiving multiple storage requests for alarm data, a hash value is calculated based on the key fields of the target alarm data, and the hash value is used to accurately locate the target storage node storing the target alarm information from multiple storage nodes. Since the corresponding alarm hash table is stored in the memory of each storage node, and the alarm hash table records the alarm information corresponding to the alarm data, the storage location of the target alarm information can be found quickly and accurately, avoiding the lengthy search process that may exist in traditional methods and improving the processing efficiency of alarm data; according to the hash value corresponding to the target alarm data, the target location corresponding to the target alarm information is determined in the target alarm hash table of the target storage node; if the target location of the target alarm hash table meets the preset conditions, indicating that the target alarm data is not stored, the target alarm information is written to the target location, and the target alarm data is stored in the database, ensuring that the alarm data is stored only once, so that non-repetitive alarm data can be written quickly and efficiently.

[0048] In addition, the present invention also provides an alarm data processing device, equipment and medium, all of which have the above-mentioned beneficial technical effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0050] Figure 1 It is a schematic diagram of an application scenario of an alarm data processing method provided by an embodiment of the present invention;

[0051] Figure 2 It is a flowchart of an alarm data processing method provided by an embodiment of the present invention;

[0052] Figure 3 It is a hash representation scheme within a node provided by an embodiment of the present invention;

[0053] Figure 4 It is a schematic diagram of a hash node sharding mechanism provided by an embodiment of the present invention;

[0054] Figure 5It is a schematic diagram of a hash sharding expansion mechanism provided by an embodiment of the present invention;

[0055] Figure 6 It is a schematic diagram of a hash sharding shrinking mechanism provided by an embodiment of the present invention;

[0056] Figure 7 It is a schematic diagram of the system structure of an alarm data processing provided by an embodiment of the present invention;

[0057] Figure 8 It is a structural schematic diagram of an alarm data processing device provided by an embodiment of the present invention;

[0058] Fig. 9 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0059] This specific embodiment is merely an explanation of the present invention and is not a limitation of the present invention. After reading this specification, those skilled in the art may make non-creative modifications to the present embodiment as needed, but such modifications are protected by patent law as long as they are within the scope of the present invention.

[0060] It should be noted that in the optional embodiments of the present invention, the object information and other related data involved, when the embodiments of the present invention are applied to specific products or technologies, need to obtain the permission or consent of the object, and the collection, use and processing of the relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions. In other words, if the embodiments of the present invention involve data related to the object, it needs to be obtained with the authorization and consent of the object, the authorization and consent of the relevant department, and in compliance with the relevant laws, regulations and standards of the country and region. If personal information is involved in the embodiments, the acquisition of all personal information needs to obtain the consent of the individual. If sensitive information is involved, the separate consent of the information subject needs to be obtained. The embodiments also need to be implemented with the authorization and consent of the object.

[0061] 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0062] In addition, the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article, unless otherwise specified, generally means that the associated objects before and after are in an "or" relationship.

[0063] For ease of understanding, some terms involved in the embodiments of the present invention are now explained:

[0064] KV cache: KV is the abbreviation of Key-Value, and KV storage is also called key-value pair storage. Simply put, it uses Key as an index to implement data storage, modification, query and deletion functions. Commonly used high-performance KV storages include Redis, Memcached, etc.

[0065] Hash: Hash, generally translated as hash, hash, or transliterated as hash, is to transform an input of any length (also called pre-image) into an output of fixed length through a hash algorithm, and the output is the hash value. This conversion is a compression mapping, that is, the space of hash values ​​is usually much smaller than the space of inputs, and different inputs may hash to the same output, so it is impossible to determine the unique input value from the hash value. Simply put, it is a function that compresses a message of any length to a message digest of a fixed length.

[0066] Hash Sharding: A data distribution method that scatters data to multiple different nodes according to the sharding algorithm to achieve uniform distribution of data on multiple nodes and load balancing of nodes.

[0067] Odd prime number: A positive integer that is not divisible by 2 and whose only factors are 1 and itself.

[0068] In recent years, with the rapid development of cloud computing and big data, the number and complexity of infrastructure have led to a rapid increase in the number of alarms, and large and medium-sized data centers generate tens of thousands of alarms every day. How to quickly and efficiently filter duplicate alarms in the face of massive alarm data is a test for the management software of the data center. Usually, the data center will collect the alarm data of computing, storage, switches and other resources in the data center through a unified management software, save it in the management software database, and then use certain strategies to determine how to handle these alarms, such as aggregating and shielding the alarms. When an alarm is reported on the device in the data center, in order to quickly retrieve which alarms have been processed, the management software usually uses the database query function to query the existing alarm data, or uses the memory KV cache alarm data to reduce the burden on the database. This solution has the following problems: 1. The data center management software generally uses multi-node deployment to form one master and multiple backups, and the existing solution cannot make full use of the memory inside multiple nodes; 2. Putting all fields of the alarm data into the memory KV cache will occupy a large memory space, resulting in a waste of memory space. In order to solve the above problems, this invention proposes a method and system for deduplication and storage of massive alarms.

[0069] In order to solve the above problems, the embodiments of the present invention provide a method, device, equipment and medium for processing alarm data.

[0070] In order to better understand the solution provided by the embodiment of the present invention, the solution is described below in conjunction with a specific application scenario.

[0071] In one embodiment, please refer to Figure 1 , Figure 1 A schematic diagram of an application scenario of an alarm data processing method provided by an embodiment of the present invention. The alarm data processing method can be applied to an alarm data processing system.

[0072] In some embodiments, the alarm data processing includes multiple monitored devices, electronic devices, and multiple storage nodes. The multiple monitored devices are used to collect alarm data for the electronic device to execute the alarm data processing method. The electronic device is deployed with management software to implement the alarm data processing method. The electronic device can also perform digital display of the results. Among them, the electronic device can be a server or a terminal device, wherein the terminal device includes but is not limited to: mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), mobile terminals such as vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and fixed terminals such as digital TVs, desktop computers, etc. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.

[0073] It is understandable that the above is only an example and this embodiment is not limited here.

[0074] The embodiment of the present invention provides a method for processing alarm data, such as Figure 2 As shown, the embodiment of the present invention is not limited here, and the method includes:

[0075] S101, after receiving storage requests for multiple alarm data, determining a target storage node for storing target alarm information of the target alarm data from multiple storage nodes according to a hash value corresponding to the target alarm data;

[0076] Among them, the target alarm data is any data among multiple alarm data, and a corresponding alarm hash table is stored in the memory of each storage node, and each alarm hash table records the alarm information corresponding to the alarm data; the hash value corresponding to the target alarm data is obtained by hash value calculation based on the key fields of the target alarm data; the key fields represent important fields in the target alarm data used to calculate the hash value, such as alarm type, alarm node, alarm object, high entry time, node IP, alarm level, alarm reason, etc.

[0077] In an embodiment of the present invention, a storage request for multiple alarm data represents a triggered request to save the alarm data. Each alarm data corresponds to a hash value, and the hash value corresponding to the target alarm data refers to the hash value obtained by calculating the key field of the target alarm data through a hash function. The target alarm information refers to the detailed information associated with the target alarm data stored in the alarm hash table, such as the hash value corresponding to the target alarm data, the hash value corresponding to the target alarm data, the key field corresponding to the target alarm data, and the primary key identifier corresponding to the target alarm data. The alarm hash table refers to a data structure stored in the memory of each storage node, which is used to record alarm information for fast retrieval and access.

[0078] In an embodiment of the present invention, each storage node maintains an alarm hash table, which records all alarm information stored on the node. When multiple alarm data need to be stored, the electronic device receives the corresponding storage request and calculates the hash value of each alarm data according to the key field; and determines on which storage node the alarm information corresponding to the data should be stored based on the hash value, so as to determine a target storage node.

[0079] This embodiment does not limit the method of calculating the hash value, and the user can set it according to actual conditions.

[0080] In some achievable embodiments, a hash calculation may be performed directly based on the key fields of the target alarm data to obtain a hash value corresponding to the target alarm data. After string concatenation of the key fields of the alarm data reported by the device (alarm type, alarm node, alarm object), a hash value is calculated using a hash algorithm. Exemplarily, the hash value calculation formula for the alarm key field is as follows, where s[i] is the i-th character of the string, n is the length of the string, and P is an odd prime number (prime numbers are generally used to calculate hashes. If even numbers are used, multiplication overflow may occur, resulting in information loss) .

[0081] In some other achievable embodiments, it is also possible to: perform hash calculation based on the key fields of the target alarm data to determine the initial hash value corresponding to the target alarm data; perform an XOR operation on the high half area and the low half area of ​​the initial hash value to obtain the hash value corresponding to the target alarm data. Among them, using the hash function to calculate the initial hash values ​​of these key fields, the initial hash value can be converted into a binary string (the number of bits of the hash value can be much larger than 16, 32 or 64 bits), and then separate the high half area and the low half area (the division of the high half area and the low half area can be customized by the user); by In this way, the high half area and the low half area of ​​the hashcode are XORed, some features of the low and high bits are mixed, the randomness of the hash result is increased, and the final alarm key field hash value hashcode is obtained;

[0082] The present embodiment does not limit the method of determining the target storage node. In some achievable methods, according to the hash value corresponding to the target alarm data, the target storage node for storing the target alarm information of the target alarm data is determined from multiple storage nodes, including: performing a bitwise AND operation on the hash value corresponding to the target alarm data and a first preset value to obtain a first value; according to the first value and the total number of nodes of the multiple storage nodes, determining the target storage node for storing the target alarm information of the target alarm data from the multiple storage nodes. The calculated hash value is added to the first preset value (2 n -1, the value of n is not limited, it can be 10) to perform a bitwise AND operation, , obtain a first value; determine the target storage node for storing the target alarm information according to the first value and the total number of nodes of the multiple storage nodes, wherein the first value is modulo the total number of nodes to achieve this, and the result of the modulo operation will be an integer between 0 and the total number of nodes minus 1, corresponding to the index of the storage node.

[0083] S102, determining a target location corresponding to the target alarm information from a target alarm hash table of a target storage node according to a hash value corresponding to the target alarm data;

[0084] The target location is in the target alarm hash table, indicating a specific location or index where the target alarm information is stored.

[0085] In an embodiment of the present invention, each storage node stores an alarm hash table, which saves some data information, wherein the data information may be the data information of the alarm data stored on this storage node, and may also be not limited to the data information of the alarm data stored on this node. The data information may include: the hash value and primary key ID of the data (each alarm data corresponds to a unique primary key ID) and key fields.

[0086] Search the target alarm hash table of the target storage node for the position corresponding to the hash value. If the position already exists and is empty (i.e., it has not been occupied by other data before), the target alarm information is directly stored in the position. If the position is already occupied, some conflict resolution strategies can be adopted, such as a linked list structure to supplement the target position information.

[0087] In some embodiments, based on the hash value corresponding to the target alarm data, the target position corresponding to the target alarm information is determined from the target alarm hash table of the target storage node, including: performing a bitwise AND operation on the hash value corresponding to the target alarm data and a second preset value to obtain the second value as the target position corresponding to the target alarm information.

[0088] Among them, after the alarm data is reported to the destination node, The location of the hash table in this node is calculated by ), where m and n can be equal or different, which is not limited in the present embodiment. For example, see Figure 3 , Figure 3 A hash table diagram in a node provided by an embodiment of the present invention, the length of the table is 2 m , wherein the corresponding row is selected according to the calculated second value as the index number, and then each row stores the corresponding alarm information, and then the alarm information is stored in the storage element list of the table.

[0089] In an embodiment of the present invention, for certain alarm data, the storage node where the alarm information is stored and the node corresponding to the database where the alarm data is actually stored may be the same storage node, or may be different. This embodiment does not limit this. Preferably, the alarm data and the alarm information corresponding to the alarm data are stored in the same storage node.

[0090] In an embodiment of the present invention, the key fields of the alarm data are stored in the memory in the form of a hash table. Although the memory usage is increased by exchanging space for time, overall, the hash table stored in the memory is scattered and distributed on multiple nodes, which increases the available memory space of each device; and greatly improves the efficiency of alarm deduplication, while avoiding the situation of excessive memory usage caused by caching all data.

[0091] S103: If the target position of the target alarm hash table meets the preset conditions, the target alarm information is written into the target position, and the target alarm data is stored in the database.

[0092] The preset conditions include: there is no information at the target position of the target alarm hash table, or there is information at the target position of the target alarm hash table, and the alarm data corresponding to the alarm information at the target position is different from the target alarm data.

[0093] A possible implementation method of an embodiment of the present invention, the alarm information includes: a hash value corresponding to the alarm data and a primary key identifier, wherein each alarm data corresponds to a unique primary key identifier; if the target position of the target alarm hash table meets the preset conditions, the target alarm information is written to the target position, and the target alarm data is stored in the database, including: if there is no information at the target position of the target alarm hash table, the target alarm information is written to the target position, and the target alarm data is stored in the database; if there is information at the target position of the target alarm hash table, the original alarm data corresponding to the primary key identifier of the alarm information at the target position is obtained from the database; if the original alarm data is different from the target alarm data, the target alarm information is added to the end of the linked list corresponding to the target position, and the target alarm data is stored in the database; if the original alarm data is the same as the target alarm data, it is determined that the target alarm data is duplicate data.

[0094] In an embodiment of the present invention, a target alarm hash table exists in the target storage node, which stores the hash values ​​of several key fields of alarm data and the primary key identifier (primary key ID) of the alarm record in the database. After the target storage node receives the hash value of the alarm key field and the target alarm data reported by the device, it calculates the position in the alarm hash table through the hash value. If the alarm data already exists at this position, it indicates that a hash conflict has occurred, and it is necessary to query the alarm data recorded in the database through the primary key ID of the alarm record at this position, and compare it with the reported alarm data in full. If the final result is the same, it is considered that the alarm data is repeated, and the alarm data is no longer saved repeatedly; if the final result is not the same, it is considered that there is a hash conflict, and a linked list is formed at the same position of the hash table in a chain method to save the new alarm data.

[0095] For example, see Figure 3, if alarm data 1, alarm data 2, and alarm data 3 are calculated, the target positions are indexed as 1, 2, and 10. At this time, A1 already exists in position 1, there is no information in position 2, and there is no information in 10. At this time, alarm data 2 is directly written to position 2, i.e., B2, and alarm data 3 is directly written to position 2, i.e., L10; however, A1 already exists in position 1, and it is necessary to extract the complete field corresponding to A1 from the database based on the primary key ID in A1, and compare the field with alarm data 1 in full. If they are consistent, it means that it is duplicate data. If they are inconsistent, it indicates that a hash conflict has occurred, and a chain method will be used to form a linked list at the same position in the hash table and write it into A2. For another example, if A1 and A2 exist in position 1 corresponding to alarm data 1, at this time, the complete fields corresponding to A1 and A2 are extracted at once and compared with alarm data 1 in full to determine whether there is duplicate data.

[0096] Furthermore, if there is information at the target position of the target alarm hash table, the original alarm data corresponding to the primary key identifier of the alarm information at the target position is obtained from the database, including: if there is information at the target position of the target alarm hash table, then if the key field of the alarm information at the target position is different from the key field of the target alarm information, the target alarm information is added to the tail of the linked list corresponding to the target position, and the target alarm data is stored in the database; if the key field of the alarm information at the target position is the same as the key field of the target alarm information, the original alarm data corresponding to the primary key identifier of the alarm information at the target position is obtained from the database. The alarm key fields are compared first. If the key fields are the same, all the fields of the alarm are compared completely. This hierarchical deduplication method can also improve the efficiency of alarm deduplication and reduce the query pressure on the database.

[0097] Furthermore, in order to improve efficiency, when there are multiple stored alarm information at a certain location, they can be compared in order of time from recent to far, so as to quickly determine the duplication. At the same time, during the comparison process, a field other than the key field can be used for matching first, and only after the match is successful, the next field can be matched to avoid the low efficiency caused by matching two alarm data in full.

[0098] It can be seen that in the embodiment of the present invention, after receiving storage requests for multiple alarm data, a hash value is calculated based on the key fields of the target alarm data, and the hash value is used to accurately locate the target storage node storing the target alarm information from multiple storage nodes. Since the corresponding alarm hash table is stored in the memory of each storage node, and the alarm information corresponding to the alarm data is recorded in the alarm hash table, the storage location of the target alarm information can be found quickly and accurately, avoiding the lengthy search process that may exist in the traditional method, and improving the processing efficiency of the alarm data; according to the hash value corresponding to the target alarm data, the target location corresponding to the target alarm information is determined in the target alarm hash table of the target storage node; if the target location of the target alarm hash table meets the preset conditions, indicating that the target alarm data is not stored, the target alarm information is written to the target location, and the target alarm data is stored in the database, ensuring that the alarm data is stored only once, so that non-repetitive alarm data can be written quickly and efficiently.

[0099] In a possible implementation of the embodiment of the present invention, the database includes sub-databases corresponding to each of the multiple storage nodes;

[0100] Store target alarm data in the database, including:

[0101] According to the hash values ​​corresponding to the multiple alarm data, a modulo operation is performed based on the number of nodes to determine the storage node corresponding to each alarm data;

[0102] According to the storage node corresponding to the target alarm data, the target alarm data is stored in the sub-database of the corresponding storage node.

[0103] In the embodiment of the present invention, after string concatenation of the key fields (alarm type, alarm node, alarm object) of the alarm data reported by the device, a hash value is calculated by a hash algorithm, and the modulus is taken by the number of hash slices of a given size to determine the hash slice to which the alarm data belongs (determine which slice is 1-the number of hash slices of a given size), and based on the corresponding relationship between the storage node and the hash slice, determine the target node to be reported. For example, see Figure 4 , assuming that the number of hash shards is set to 1024 (needed to be , so that the remainder operation can be converted into an AND operation to improve the computing speed). The management software has a total of 3 nodes, each of which corresponds to approximately 1024 / 3≈341 shards; through (For example, p is 10) A shard numbered between 0 and 1023 is obtained, which is mapped to a certain node.

[0104] Exemplarily, alarm data 1-alarm data 6 need to be stored in nodes 1-node 3. According to the hash values ​​of alarm data 1-alarm data 6, each hash value is converted into an integer index between 0 and 1023; then the modulus is taken by 1024 based on the hash value. At the same time, the three storage nodes correspond to basically three equal indexes respectively; then, according to the modulus result, the data is allocated to the corresponding storage nodes. Specifically, according to the result of the modulus of 1024, the modulus of 3 is taken again to determine the corresponding nodes 1, node 2, and node 3 according to the final results 0, 1, and 2.

[0105] It can be seen that in the embodiment of the present invention, the structure of the database is refined and divided into sub-databases corresponding to multiple storage nodes. By performing modulo operations based on the hash values ​​and node numbers corresponding to the multiple alarm data, each alarm data is assigned to its corresponding storage node, thereby realizing distributed storage of the alarm data; according to the storage node corresponding to the target alarm data, it is stored in the corresponding sub-database, which not only improves the flexibility of data storage, but also enhances the scalability and load balancing capabilities of the system, so that the entire alarm data processing system can maintain efficient and stable operation when facing a large amount of data.

[0106] In an embodiment of the present invention, the number of hash shards mapped to each node is determined. At the same time, when the node is expanded or reduced in capacity, the mapping relationship between the shards and the nodes is updated according to the change in the number of nodes; when the device is running on the data center, when the alarm data is generated on the device, the reporting target node is determined according to the shard mapping relationship. If the shard mapping relationship changes, the reporting operation will return an error message, which carries the latest mapping relationship. After the client updates the saved mapping relationship, it will re-report the alarm data.

[0107] Specifically, a possible implementation of the embodiment of the present invention further includes: in response to the storage node expansion operation, determining the alarm data that needs to be migrated for the sub-databases of the multiple storage nodes according to the total number of nodes of the multiple storage nodes and the total number of storage nodes after the expansion; migrating the alarm data that needs to be migrated for the sub-databases of the multiple storage nodes to the newly added sub-database after the expansion;

[0108] When the management software node is expanded, data migration is performed in shards. For example, if the number of nodes increases from 3 to 4, and the alarm hash slice is 1024, each node needs to migrate 1024 / 3-1024 / 4≈85 shards to the new node, and the corresponding data of these shards also needs to be migrated to the new node, such as Figure 5 shown.

[0109] A possible implementation of the embodiment of the present invention further includes: in response to the storage node scaling operation, migrating the alarm data of the sub-database of the reduced storage node to the remaining storage nodes according to the total number of multiple storage nodes and the total number of storage nodes after scaling. When the node is scaled down, the hash shards on the scaled-down node need to be transferred to other nodes. For example, if the number of nodes is reduced from 4 to 3, the hash shards on the scaled-down node need to be evenly distributed to the other 3 nodes. Figure 6 shown.

[0110] A possible implementation of the embodiment of the present invention is to perform a modulo operation based on the number of nodes according to the hash values ​​corresponding to each of the multiple alarm data, so as to determine the storage node corresponding to each alarm data, including:

[0111] Obtain the remaining space of each sub-database corresponding to multiple alarm data;

[0112] Determine whether the difference between the remaining spaces of the sub-databases corresponding to the multiple alarm data is within the preset difference range:

[0113] If they match, a modulo operation is performed based on the hash values ​​and node numbers corresponding to the multiple alarm data to determine the storage node corresponding to each alarm data;

[0114] If it does not meet the requirements, the target total value is determined according to the ratio of the remaining space of the sub-databases corresponding to the multiple alarm data, and a modulus operation is performed based on the target total value according to the hash values ​​corresponding to the multiple alarm data, so as to determine the storage node corresponding to each alarm data.

[0115] In an embodiment of the present invention, a certain data storage space is set for the sub-database corresponding to each storage node. For each alarm data, the remaining space of the corresponding sub-database is determined. The difference between the remaining spaces of the sub-databases corresponding to all alarm data is calculated, and it is confirmed whether the difference is within a preset difference range. The difference can be used directly for calculation, or the standard deviation can be used to determine whether the storage space is uniform, which is not limited in the embodiment of the present invention. If it is determined that the storage space is uniform, a modulo operation is performed based on the hash values ​​and the number of nodes corresponding to each of the multiple alarm data to determine the storage node corresponding to each alarm data.

[0116] If it is determined that the storage space is uneven, a target total value is calculated based on the ratio of the remaining space of the sub-database corresponding to the alarm data; the hash value of the alarm data is used to perform a modulo operation on the target total value to determine the storage node to which each alarm data should be allocated.

[0117] For example, when the space ratio is 1:2:3, the target total value is determined to be 6. After the hash value is obtained, it is modulo 1024 and then modulo 6. Value 0 corresponds to node 1, values ​​1 and 2 correspond to node 2, and values ​​3, 4, and 5 correspond to node 3. This is to achieve uniform distribution of storage.

[0118] Based on any of the above embodiments, in the embodiments of the present invention, see Figure 7 The present invention is mainly composed of a node mapping module, a local hash module, a shard management module, and a client module. 1. Node mapping module: After string concatenation of the key fields (alarm type, alarm node, alarm object) of the alarm data reported by the device, the hash value is calculated by the hash algorithm, and the modulus is taken with the number of hash shards of a given size and the number of nodes to determine the destination node of the alarm report; 2. Local hash module: The destination node has an alarm hash table, which stores the hash value of the key field of the alarm data and the primary key ID of the alarm record in the database. After the destination node receives the hash value of the key field of the alarm and the alarm data reported by the device, it calculates the position in the alarm hash table through the hash value. If there is already alarm data at this location, the alarm data recorded in the database is queried through the primary key ID of the alarm record at this location, and the alarm data is fully compared with the reported alarm data. If the final results are the same, the alarm data is considered to be repeated and the alarm data is no longer saved repeatedly; if the final results are different, it is considered that there is a hash conflict, and a linked list is formed at the same position of the hash table in a chain method to save the new alarm data; 3. Shard management: This module determines the number of hash shards mapped to each node. At the same time, when the node is expanded or reduced, the mapping relationship between the shard and the node is updated according to the change in the number of nodes; 4. Client module: Running on the equipment in the data center, when the alarm data is reported on the device, the reporting target node is determined according to the shard mapping relationship provided by the client. If the shard mapping relationship changes, the reporting operation will return an error message, which carries the current latest mapping relationship. After the client updates the saved mapping relationship, it will re-report the alarm data.

[0119] Specifically, an embodiment of the present invention provides a specific method for processing alarm data, including:

[0120] S1. When the device reports alarm data, it calculates the hash value based on the key fields of the alarm data, and determines the hash shard to which the alarm data belongs by taking the remainder of the hash value and the number of hash shards, thereby determining the target storage node to which the alarm data should be reported;

[0121] The calculation formula of the hash value of the alarm key field is as follows, where s[i] is the i-th character of the string, n is the length of the string, and P is an odd prime number (prime numbers are generally used to calculate hashes. If even numbers are used, multiplication overflow may occur, resulting in information loss). ; then through In this way, the high half area and the low half area of ​​the hashcode are XORed, some features of the low and high bits are mixed, the randomness of the hash result is increased, and the final alarm key field hash value hashcode is obtained;

[0122] Divide the hash shards roughly according to the number of nodes, and map the shards to different nodes. For example, suppose the number of hash shards is set to 1024 (need to be , so that the remainder operation can be converted into an AND operation to improve the computing speed). The management software has a total of 3 nodes, each of which corresponds to approximately 1024 / 3≈341 shards;

[0123] pass (For example, n is 10) and a shard numbered between 0 and 1023 is obtained, which is mapped to a certain node.

[0124] S2. After the alarm data is reported to the target storage node, The location of the hash table in this node is calculated by ), if there is no data at this location, it is considered that this node does not save the alarm information, and all fields of the reported alarm information are saved in the node database, and the alarm hash value and the primary key ID of the alarm data in the database are saved in the alarm hash table; if there is already alarm data at this location, it indicates that a hash conflict has occurred, and it is necessary to further compare all fields of the new and old alarm data. At this time, the primary key ID of the alarm record in the database is obtained through the alarm hash table, and the complete alarm data is queried in the database through the primary key ID, and then the comparison is continued. If there are different alarm fields, it is considered that they do not belong to the same alarm. In a chain method, a linked list is formed in the field corresponding to the hash table to save the new alarm data;

[0125] S3: When the management software node is expanded, data migration is performed in shards.

[0126] S4. When a node is scaled down, the hash shards on the scaled-down node need to be transferred to other nodes.

[0127] It can be seen that in the embodiment of the present invention, when an alarm is reported on a device, the key field of the alarm is hashed and modulo the number of hash fragments (the number of hash fragments is , the remainder operation is converted to AND operation to improve the calculation speed), and then the reporting target storage node is determined according to the mapping relationship between the number of alarm shards and the management software nodes; after reporting to the target storage node, it is compared with the local alarm hash table of the node. Only the alarm information with matching key information will actually initiate a query request to the database to perform a full comparison of the complete alarm fields, reducing the burden on the database; the mapping relationship between hash shards and management software nodes is maintained through the shard management module. When expanding or shrinking the capacity, the number of hash shards allocated on the existing nodes is changed to adapt to the changes in the nodes.

[0128] In an embodiment of the present invention, the key fields of the alarm data are stored in the memory in the form of a hash table. Although the memory usage is increased by exchanging space for time, the efficiency of alarm deduplication is greatly improved, and at the same time, the excessive memory usage caused by the cache of all data is avoided; the hash table stored in the memory is scattered and distributed on multiple nodes, thereby increasing the available space of the memory; through the hash sharding method, a layer of data sharding is added between the alarm data and the node, which is used to manage the mapping relationship between the alarm data and the node, and solve the problem of load balancing between nodes.

[0129] A device provided by an embodiment of the present invention is introduced below. The device described below and the method described above can be referred to each other. The device of this embodiment is set in an electronic device. Figure 8 , Figure 8 : is a structural block diagram of a device according to one embodiment of the present invention, comprising:

[0130] The first determination module 210 is used to determine, after receiving a storage request for multiple alarm data, a target storage node for storing target alarm information of the target alarm data from multiple storage nodes according to a hash value corresponding to the target alarm data; wherein the target alarm data is any data among the multiple alarm data, a corresponding alarm hash table is stored in the memory of each storage node, and each alarm hash table records the alarm information corresponding to the alarm data; the hash value corresponding to the target alarm data is obtained by performing a hash value calculation based on a key field of the target alarm data;

[0131] A second determination module 220, configured to determine a target location corresponding to the target alarm information from a target alarm hash table of a target storage node according to a hash value corresponding to the target alarm data;

[0132] The writing module 230 is used to write the target alarm information into the target position if the target position of the target alarm hash table meets the preset conditions, and store the target alarm data in the database.

[0133] In one achievable manner, the present invention further includes:

[0134] The hash calculation module is used to perform hash calculation according to the key fields of the target alarm data to determine the initial hash value corresponding to the target alarm data; perform an XOR operation on the high half and the low half of the initial hash value to obtain the hash value corresponding to the target alarm data.

[0135] In an implementable manner, the first determining module 210 is configured to:

[0136] Performing a bitwise AND operation on the hash value corresponding to the target alarm data and the first preset value to obtain a first value;

[0137] A target storage node storing target alarm information of target alarm data is determined from the multiple storage nodes according to the first value and the total number of the multiple storage nodes.

[0138] In one achievable manner, the second determining module 220 is configured to:

[0139] A bitwise AND operation is performed on the hash value corresponding to the target alarm data and the second preset value to obtain a second value as the target position corresponding to the target alarm information.

[0140] In one achievable manner, the alarm information includes: a hash value and a primary key identifier corresponding to the alarm data, wherein each alarm data corresponds to a unique primary key identifier;

[0141] The writing module 230 is used for:

[0142] If the target location of the target alarm hash table does not contain information, the target alarm information is written to the target location, and the target alarm data is stored in the database;

[0143] If there is information at the target location of the target alarm hash table, then the plaintiff alarm data corresponding to the primary key identifier of the alarm information at the target location is obtained from the database;

[0144] If the original alarm data is different from the target alarm data, the target alarm information is added to the end of the linked list corresponding to the target position, and the target alarm data is stored in the database; if the original alarm data is the same as the target alarm data, the target alarm data is determined to be duplicate data.

[0145] In one achievable manner, the database includes sub-databases corresponding to each of the plurality of storage nodes;

[0146] The writing module 230 is used to:

[0147] A modulo operation is performed according to the hash values ​​and the number of nodes corresponding to the multiple alarm data, so as to determine the storage node corresponding to each alarm data;

[0148] According to the storage node corresponding to the target alarm data, the target alarm data is stored in the sub-database of the corresponding storage node.

[0149] In one achievable manner, the present invention further includes:

[0150] The expansion module is used to respond to the storage node expansion operation, determine the alarm data that needs to be migrated for the sub-databases of the multiple storage nodes according to the total number of nodes of the multiple storage nodes and the total number of storage nodes after the expansion; migrate the alarm data that needs to be migrated for the sub-databases of the multiple storage nodes to the newly added sub-database after the expansion;

[0151] The shrinking module is used to respond to the storage node shrinking operation and migrate the alarm data of the sub-database of the shrunken storage node to the remaining storage nodes according to the total number of multiple storage nodes and the total number of storage nodes after shrinking.

[0152] In one achievable manner, the writing module 230 is further used to:

[0153] Obtain the remaining space of each sub-database corresponding to multiple alarm data;

[0154] Determine whether the difference between the remaining spaces of the sub-databases corresponding to the multiple alarm data is within the preset difference range:

[0155] If they match, a modulo operation is performed based on the hash values ​​and node numbers corresponding to the multiple alarm data, so as to determine the storage node corresponding to each alarm data;

[0156] If it does not meet the requirements, the target total value is determined according to the ratio of the remaining space of the sub-databases corresponding to the multiple alarm data, and a modulus operation is performed based on the target total value according to the hash values ​​corresponding to the multiple alarm data, so as to determine the storage node corresponding to each alarm data.

[0157] An embodiment of the present invention provides an electronic device, such as Fig. 9 As shown, Fig. 9 The electronic device 300 shown includes: a processor 301 and a memory 303. The processor 301 and the memory 303 are connected, such as through a bus 302. Optionally, the electronic device 300 may also include a transceiver 304. It should be noted that in actual applications, the transceiver 304 is not limited to one, and the structure of the electronic device 300 does not constitute a limitation on the embodiments of the present invention.

[0158] The processor 301 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the present invention. The processor 301 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0159] The bus 302 may include a path to transmit information between the above components. The bus 302 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 302 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0160] The memory 303 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.

[0161] The memory 303 is used to store application code for executing the solution of the present invention, and the execution is controlled by the processor 301. The processor 301 is used to execute the application code stored in the memory 303 to implement the content shown in the above method embodiment.

[0162] Fig. 9 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0163] An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer can execute the corresponding contents of the aforementioned method embodiment.

[0164] An embodiment of the present invention provides a computer program product, including a computer program, which implements the corresponding contents of the aforementioned method embodiment when the computer program is executed by a processor.

[0165] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0166] The above are only some embodiments of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for processing alarm data, characterized in that: include: After receiving storage requests for multiple alarm data, determine a target storage node for storing target alarm information of the target alarm data from multiple storage nodes according to a hash value corresponding to the target alarm data; wherein the target alarm data is any data among the multiple alarm data, a corresponding alarm hash table is stored in the memory of each storage node, and each alarm hash table records the alarm information corresponding to the alarm data; the hash value corresponding to the target alarm data is obtained by performing a hash value calculation based on a key field of the target alarm data; Determining a target location corresponding to the target alarm information from a target alarm hash table of the target storage node according to a hash value corresponding to the target alarm data; If the target position of the target alarm hash table meets the preset conditions, the target alarm information is written into the target position, and the target alarm data is stored in a database.

2. The alarm data processing method according to claim 1, characterized in that: Also includes: Perform hash calculation based on the key fields of the target alarm data to determine the initial hash value corresponding to the target alarm data; Perform an XOR operation on the high half and the low half of the initial hash value to obtain the hash value corresponding to the target alarm data.

3. The alarm data processing method according to claim 1, characterized in that: The step of determining a target storage node storing target alarm information of the target alarm data from a plurality of storage nodes according to a hash value corresponding to the target alarm data includes: Performing a bitwise AND operation on the hash value corresponding to the target alarm data and a first preset value to obtain a first value; According to the first value and the total number of the plurality of storage nodes, a target storage node for storing the target alarm information of the target alarm data is determined from the plurality of storage nodes.

4. The alarm data processing method according to claim 1, characterized in that: The determining, according to the hash value corresponding to the target alarm data, from the target alarm hash table of the target storage node, a target location corresponding to the target alarm information includes: A bitwise AND operation is performed on the hash value corresponding to the target alarm data and a second preset value to obtain a second value as the target position corresponding to the target alarm information.

5. The alarm data processing method according to claim 1, characterized in that: The alarm information includes: a hash value and a primary key identifier corresponding to the alarm data, wherein each alarm data corresponds to a unique primary key identifier; If the target position of the target alarm hash table meets the preset condition, the target alarm information is written into the target position, and the target alarm data is stored in a database, including: If the target location of the target alarm hash table does not contain information, the target alarm information is written into the target location, and the target alarm data is stored in a database; If there is information at the target location of the target alarm hash table, obtaining the plaintiff alarm data corresponding to the primary key identifier of the alarm information at the target location from the database; If the plaintiff alarm data is different from the target alarm data, the target alarm information is added to the end of the linked list corresponding to the target position, and the target alarm data is stored in the database; if the plaintiff alarm data is the same as the target alarm data, the target alarm data is determined to be duplicate data.

6. The alarm data processing method according to claim 1, characterized in that: The database includes sub-databases corresponding to each of the multiple storage nodes; The storing the target alarm data in a database comprises: Performing a modulo operation according to the hash values ​​and the number of nodes corresponding to the plurality of alarm data, so as to determine the storage node corresponding to each alarm data; According to the storage node corresponding to the target alarm data, the target alarm data is stored in the sub-database of the corresponding storage node.

7. The alarm data processing method according to claim 6, characterized in that: Also includes at least one of the following: In response to the storage node expansion operation, according to the total number of the multiple storage nodes and the total number of storage nodes after the expansion, determine the alarm data that needs to be migrated for the sub-databases of the multiple storage nodes; migrate the alarm data that needs to be migrated for the sub-databases of the multiple storage nodes to the newly added sub-database after the expansion; In response to the storage node shrinking operation, the alarm data of the sub-database of the shrunken storage node is migrated to the remaining storage nodes according to the total number of the multiple storage nodes and the total number of storage nodes after shrinking.

8. The alarm data processing method according to claim 6, characterized in that: According to the hash values ​​corresponding to the plurality of alarm data, a modulo operation is performed based on the number of nodes to determine the storage node corresponding to each alarm data, including: Obtain the remaining space of each sub-database corresponding to multiple alarm data; Determine whether the difference between the remaining spaces of the sub-databases corresponding to the multiple alarm data is within the preset difference range: If they are in compliance, a modulo operation is performed according to the hash values ​​and the number of nodes corresponding to each of the plurality of alarm data, so as to determine the storage node corresponding to each alarm data; If it does not match, the target total value is determined according to the ratio of the remaining space of the sub-databases corresponding to the multiple alarm data, and a modulo operation is performed based on the target total value according to the hash values ​​corresponding to the multiple alarm data, so as to determine the storage node corresponding to each alarm data.

9. An alarm data processing device, characterized in that: include: A determination module is used to determine, after receiving storage requests for multiple alarm data, a target storage node for storing target alarm information of the target alarm data from multiple storage nodes according to a hash value corresponding to the target alarm data; wherein the target alarm data is any data among the multiple alarm data, a corresponding alarm hash table is stored in the memory of each storage node, and each alarm hash table records the alarm information corresponding to the alarm data; the hash value corresponding to the target alarm data is obtained by performing a hash value calculation based on a key field of the target alarm data; A target position determination module, configured to determine a target position corresponding to the target alarm information from a target alarm hash table of the target storage node according to a hash value corresponding to the target alarm data; A writing module is used to write the target alarm information into the target position if the target position of the target alarm hash table meets the preset conditions, and store the target alarm data in a database.

10. An electronic device, characterized in that: include: one or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to: perform the steps of the method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded by the processor and executes the steps of the method according to any one of claims 1 to 8.