Alarm statistical method, system and device and readable storage medium

By splitting alarm statistics into network element level and user level in the network management system, and using distributed cache and a combination of full statistics and incremental statistics, the problem of large alarm volume and complex statistical logic is solved, and efficiency and expansion are improved. It meets the needs of equipment management and resource slicing functions in multiple cities.

CN118784448AActive Publication Date: 2024-10-15FIBERHOME TELECOMMUNICATION TECHNOLOGIES CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410982039.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2024-10-15
Estimated Expiration
2044-07-22

AI Technical Summary

Technical Problem

In the existing technology, the alarm statistics method has low efficiency, high resource consumption, and poor scalability when the alarm volume is large and the alarm statistics logic is complex. It is difficult to meet the needs of network management software for multi-city equipment management and resource slicing functions.

Method used

By splitting alarm statistics into network element level and user level, using distributed cache and a combination of full statistics and incremental statistics, irregular and regular statistical methods are implemented, slice statistics are supported, and calculation volume and resource consumption are reduced.

Benefits of technology

It improves the efficiency of alarm statistics, reduces resource consumption, increases the scalability of the system, and supports efficient alarm statistics for multiple users and multiple network elements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118784448A_ABST
    Figure CN118784448A_ABST
Patent Text Reader

Abstract

The invention provides an alarm statistical method, system and device and a readable storage medium, and the method comprises the steps: continuously analyzing alarm information, calculating to obtain a first alarm count of each network element, and storing the alarm information and the first alarm count in a distributed cache; when each first user is switched from the logout state to the login state, executing irregular total statistics; periodically acquiring network element IDs with updated first alarm counts; and for the network element with the updated first alarm count and the to-be-calculated network element, performing irregular increment statistics in sequence. According to the method and the device, the network element level alarm statistics and the user level alarm statistics are separated, the overall calculation amount is reduced in cooperation with the design of total statistics and increment statistics, and when the alarm amount is large and the alarm statistics logic is complex, the efficiency can be improved, the resource consumption can be reduced, and the expansibility can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of network management, and in particular to an alarm statistics method, system, device and readable storage medium. Background Art

[0002] With the rapid development of 5G technology, the network scale is getting larger and larger. At the same time, communication operators are promoting intensive network management. A set of network management software needs to manage devices in more cities at the same time. Accordingly, the number of alarms that the network management software needs to process and display has greatly increased.

[0003] On the other hand, many operators' networks are currently rented to other small operators or corporate customers. Users require the network resource slicing function and the ability to manage the sliced ​​network resource control rights, and link them with the network resource slices to achieve efficient resource allocation and authority control. Therefore, the alarm data statistics of different users on the same set of network management software are different because the users have different resources, and the complexity of alarm statistics calculation increases. In the current alarm statistics method, alarm analysis and alarm statistics calculation are processed serially. When the alarm volume is large and the alarm statistics logic is complex, it will cause problems such as low efficiency, high resource consumption, and poor scalability. Summary of the invention

[0004] The present application provides an alarm statistics method, system, device and readable storage medium, which can solve the technical problems existing in the prior art such as low efficiency, high resource consumption and poor scalability when the alarm volume is large and the alarm statistics logic is complex.

[0005] In a first aspect, an embodiment of the present application provides an alarm statistics method, the alarm statistics method comprising: Continuously parse the alarm information and calculate the first alarm count of each network element, and save the alarm information and the first alarm count to the distributed cache; When each first user switches from a logged-out state to a logged-in state, perform rule-free full statistics: if a network element to which the current user has authority has a second alarm count, then the full alarm count of the network element is calculated based on the second alarm count of the network element and the authority of the current user to the network element; otherwise, the full alarm count of the network element is determined to be zero, and the network element is marked as a network element to be calculated; the sum of the full alarm counts of all network elements to which the current user has authority is calculated to obtain the third alarm count of the current user, and the sum is saved in the distributed cache, wherein the first user is in a logged-in state and no custom statistical rules are set, and the second alarm count of the network element to be calculated is equal to zero; Regularly obtain the network element ID of the network element whose first alarm count is updated; For network elements whose first alarm counts have been updated and network elements to be calculated, perform rule-free incremental statistics in sequence: if there is a second user, obtain the first alarm count of the current network element from the distributed cache, calculate the difference between the first alarm count and the second alarm count of the current network element to obtain the fourth alarm count of the current network element, for each second user, obtain the third alarm count of the current user from the distributed cache, calculate the incremental alarm count of the current network element according to the fourth alarm count of the current network element and the current user's authority over the current network element, calculate the sum of the third alarm count of the current user and the incremental alarm count of the current network element to obtain the new third alarm count of the current user, and save it to the distributed cache, after the third alarm counts of all second users are updated, update the second alarm count of the current network element to the first alarm count, wherein the second user is logged in, has no custom statistical rules set, and has authority over the current network element.

[0006] Furthermore, in one embodiment, the alarm statistics method further includes: For users who have not set custom statistical rules, the first rule is constructed based on the network element permissions that the user has; When performing irregular incremental statistics, the first rule is used to determine which users have the authority of the current network element, which users are recorded as third users, and the intersection of the first user and the third user is obtained to obtain the second user.

[0007] Furthermore, in one embodiment, the alarm statistics method further includes: When each fourth user switches from a logged-out state to a logged-in state, a full-quantity statistics with rules is performed: the alarm information of all network elements to which the current user has authority is obtained from the distributed cache, and the obtained alarm information is traversed. If the current alarm information matches the custom statistical rule of the current user, and the current user has authority over the alarm source corresponding to the current alarm information, the third alarm count of the current user is increased by one. After the traversal is completed, the third alarm count of the current user is saved to the distributed cache, wherein the initial value of the third alarm count is zero, and the fourth user is in a logged-in state and a custom statistical rule is set; Regularly obtain new alarm IDs; For the newly added alarm ID, regular incremental statistics are performed in sequence: the current alarm information corresponding to the current alarm ID is obtained from the distributed cache. If there is a fifth user, the third alarm count of the current user is obtained from the distributed cache for each fifth user, the third alarm count of the current user is increased by one to obtain the new third alarm count of the current user, and saved to the distributed cache. Among them, the fifth user is logged in and a custom statistical rule is set. The custom statistical rule matches the current alarm information and has the corresponding alarm source authority.

[0008] Furthermore, in one embodiment, the alarm statistics method further includes: For users who have set custom statistical rules, the second rule is constructed based on the network element permissions owned by the user, and the third rule is constructed based on the custom statistical rules set by the user; The second rule is used to determine which users have the corresponding alarm source authority, recorded as the sixth user. The third rule is used to determine which users' custom rules match the current alarm information, recorded as the seventh user. When executing regular full statistics, when the current user is at the intersection of the sixth user and the seventh user, the third alarm count of the current user is increased by one. When executing regular incremental statistics, the intersection of the fourth user, the sixth user, and the seventh user is taken to obtain the fifth user.

[0009] Further, in one embodiment, the third alarm count of the user is counted through multiple alarm query service instances; Each user in the logged-in state is bound to one of the alarm query service instances, and each alarm query service instance is used to count the third alarm count of the user bound thereto.

[0010] Further, in one embodiment, the user login message and the user logout message are sent by the client to one of the alarm query service instances, and the user login message and the user logout message both include the user ID and the login ID; The alarm statistics method also includes: When the alarm query service instance receives a user login message, it queries the local login list. If the user ID is found in the local login list, the login ID is added under the user ID in the local login list. If the user ID is not found in the local login list, the distributed cache is queried. If the binding relationship of the user ID is found in the distributed cache, the user login message is sent to the bound alarm query service instance. If the binding relationship of the user ID is not found in the distributed cache, the binding relationship between itself and the user ID is saved in the distributed cache, and the user ID and the login ID are saved in the local login list to determine that the user is switched from the logged-out state to the logged-in state. When the alarm query service instance receives a user logout message, it queries the local login list. If the user ID is found in the local login list, the login ID is deleted from the local login list. If the login ID is empty after deletion, the binding relationship between itself and the user ID is deleted from the distributed cache, and the user ID is deleted from the local login list to determine that the user has switched from the logged-in state to the logged-out state. If the user ID is not found in the local login list, the binding relationship of the user ID is obtained from the distributed cache, and the user logout message is sent to the bound alarm query service instance.

[0011] Further, in one embodiment, the user login message and the user logout message are sent by the client to the bound alarm query service instance, the user login message and the user logout message both include the user ID and the login ID, and the binding relationship is determined according to the user ID; The alarm statistics method also includes: When the alarm query service instance receives a user login message, the login ID is added under the user ID in the local login list. If the login ID under the user ID is empty before the addition, it is determined that the user is switched from the logged-out state to the logged-in state; When the alarm query service instance receives a user logout message, it deletes the login ID under the user ID in the local login list. If the login ID under the user ID is empty after the deletion, it is determined that the user is switched from the login state to the logout state.

[0012] In a second aspect, an embodiment of the present application further provides an alarm statistics system, the alarm statistics system comprising an alarm parsing service, a distributed cache and an alarm query service; The alarm analysis service is used to continuously analyze the alarm information and calculate the first alarm count of each network element, and save the alarm information and the first alarm count to the distributed cache; The alarm query service is used to perform rule-free full statistics when each first user switches from a logged-out state to a logged-in state: if a network element to which the current user has authority has a second alarm count, the full alarm count of the network element is calculated based on the second alarm count of the network element and the authority of the current user to the network element; otherwise, the full alarm count of the network element is determined to be zero, and the network element is marked as a network element to be calculated; the sum of the full alarm counts of all network elements to which the current user has authority is calculated to obtain the third alarm count of the current user, and the count is saved in the distributed cache, wherein the first user is in a logged-in state and no custom statistical rules are set, and the second alarm count of the network element to be calculated is equal to zero; The alarm analysis service is used to periodically send the network element ID of the first alarm count update to the alarm query service; The alarm query service is used to perform irregular incremental statistics in sequence for network elements with updated first alarm counts and network elements to be calculated: if there is a second user, the first alarm count of the current network element is obtained from the distributed cache, and the difference between the first alarm count and the second alarm count of the current network element is calculated to obtain the fourth alarm count of the current network element. For each second user, the third alarm count of the current user is obtained from the distributed cache, and the incremental alarm count of the current network element is calculated according to the fourth alarm count of the current network element and the current user's authority over the current network element. The sum of the third alarm count of the current user and the incremental alarm count of the current network element is calculated to obtain the new third alarm count of the current user, and saved to the distributed cache. After the third alarm counts of all second users are updated, the second alarm count of the current network element is updated to the first alarm count, wherein the second user is logged in, no custom statistical rules are set, and has authority over the current network element.

[0013] In a third aspect, an embodiment of the present application further provides an alarm statistics device, comprising a processor, a memory, and an alarm statistics program stored in the memory and executable by the processor, wherein when the alarm statistics program is executed by the processor, the steps of the above-mentioned alarm statistics method are implemented.

[0014] In a fourth aspect, an embodiment of the present application further provides a readable storage medium, on which an alarm statistics program is stored, wherein when the alarm statistics program is executed by a processor, the steps of the above-mentioned alarm statistics method are implemented.

[0015] In this application, the alarm information is continuously parsed and the alarm count of the network element is calculated. The alarm count of the network elements that have been updated is checked regularly. The alarm count of the logged-in users is counted. Slice statistics are supported. For users who do not set custom statistical rules, a ruleless full statistics is performed when the user switches from the logged-out state to the logged-in state. While the user is logged in, a ruleless incremental statistics is performed each time there is an updated network element ID. Through this application, the alarm statistics at the network element level and the alarm statistics at the user level are separated, and the overall calculation amount is reduced by coordinating the design of full statistics and incremental statistics. When the alarm volume is large and the alarm statistics logic is complex, it helps to improve efficiency, reduce resource consumption, and increase scalability. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 This is a flowchart of an alarm statistics method in one embodiment of the present application; Figure 2 This is a schematic diagram of the hardware structure of the alarm statistics device involved in the embodiment of the present application. DETAILED DESCRIPTION

[0017] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0018] In the prior art, the alarm statistics method mainly includes the following process: 1. Selection of statistical rules. The default statistical rules are used by the system, and users can create and use custom statistical rules.

[0019] 2. The alarm analysis service calculates alarm statistics for different users based on statistical rules.

[0020] 3. When there are many network elements, one alarm resolution service cannot handle them all. In this case, the network management will deploy multiple alarm resolution services, each of which handles the alarms of a part of the network elements. Therefore, each alarm resolution service will calculate the alarms of each user.

[0021] 4. The alarm analysis service reports the alarm statistics results to the client.

[0022] 5. The client adds up the statistics of multiple alarm analysis service instances of the same user to obtain the final result and displays it.

[0023] The main problems with the above solutions include: 1. Low efficiency. Each user has his or her own statistical rules, which are different from each other. Each alarm and each rule needs to be calculated separately.

[0024] 2. High resource consumption. After the network management introduces the user domain and slicing functions, according to the current framework, it is necessary to add statistical information of each network element slice in the network element analysis service, and calculate based on the slicing results. The resource consumption and calculation amount are greatly increased, which is difficult to meet the needs.

[0025] 3. Poor scalability. Each alarm analysis service needs to calculate the statistics of all users, and the statistical calculation cannot be shared. As the number of users increases, the amount of alarm statistical calculation becomes larger and larger.

[0026] In general, the existing technology combines alarm analysis and alarm statistics calculation closely, and processes them in series. At the same time, the amount of calculation increases linearly with the increase in the number of users, which restricts the timeliness and computing capacity of alarm statistics. The existing technology does not support slice alarm statistics, and adding slice support will further increase the amount of calculation and resource consumption.

[0027] Therefore, the present application provides an alarm statistics method, system and device, which can solve the technical problems existing in the prior art such as low efficiency, high resource consumption and poor scalability when the alarm volume is large and the alarm statistics logic is complex.

[0028] First, some technical terms in the present application are explained to facilitate those skilled in the art to understand the present application.

[0029] Alarm information: When a system failure occurs, the monitoring unit (equipment) sends an alarm signal to the receiving unit (network management). After receiving the alarm signal, the network management interprets it into detailed alarm information and can query it through the client. An alarm message usually contains: alarm code, alarm source, alarm level, alarm generation time, clearing status, clearing time, confirmation status, confirmation time, etc.

[0030] Alarm statistics: alarm status statistics of different alarm levels. For example, alarm levels include but are not limited to: emergency, major, minor, prompt, interruption. Alarm status includes but is not limited to: uncleared and unconfirmed, uncleared and confirmed, cleared and confirmed. After permutation and combination, an alarm statistic includes: emergency / major / minor / prompt / interruption + uncleared and unconfirmed / uncleared and confirmed / cleared and unconfirmed / cleared and confirmed alarm counts, as well as emergency / major / minor / prompt / interruption / all alarm counts, a total of 26 alarm counts.

[0031] NE-level alarm statistics: count the number of alarms belonging to this NE according to the alarm level and alarm status. User-level alarm statistics: count the number of alarms belonging to this user according to the alarm level and alarm status. Generally, a user has multiple NEs, and the user-level alarm statistics are the sum of the NE alarm statistics he owns.

[0032] Custom statistical rules: Users set alarm code, alarm level, alarm type, alarm status, alarm clearing type, alarm source, alarm generation time range, alarm confirmation time range, alarm frequency, alarm engineering state and other conditions to filter the alarm information of the network elements to which they have authority and count the data they need. If the user does not set custom statistical rules, all alarm information of the network elements to which they have authority needs to be counted.

[0033] Network resource slices and slice alarm statistics: Network elements are divided into transmission network elements and access network elements according to the type of network element. A transmission network element includes multiple single disks, and a single disk includes multiple ports. An access network element includes multiple single disks, and a single disk includes multiple PON (Passive Optical Network) ports. A PON port corresponds to multiple ONUs (Optical Network Units), and an ONU contains multiple ports. Users are not limited to having full permissions for each network element, and can only have partial permissions, for example, only having permissions for a single disk in the network element. Accordingly, in the user-level alarm statistics, only the part for which the user has permissions is counted.

[0034] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0035] In a first aspect, an embodiment of the present application provides an alarm statistics method.

[0036] Figure 1 A flow chart of an alarm statistics method in an embodiment of the present application is shown.

[0037] Reference Figure 1 In one embodiment, the alarm statistics method includes the following steps: S11. Continue to parse the alarm information and calculate the first alarm count of each network element, and save the alarm information and the first alarm count to a distributed cache.

[0038] Specifically, the first alarm count is the alarm statistics at the network element level. The latest alarm statistics of the network element are calculated based on the parsed alarm information and saved to the distributed cache. The new first alarm count will overwrite the old first alarm count, so that the first alarm count in the distributed cache always represents the latest alarm statistics of the network element.

[0039] The first alarm statistics requires splitting the network element into different statistical units to calculate the alarm statistics separately, including the alarm statistics of the following 9 statistical units: Count 1: includes all alarm statistics of the NE itself and the ports of the NE. Count 2: only includes the alarm statistics of the NE itself, excluding the alarm statistics of the single disk port of the NE; Count 3: includes the alarm statistics of the single disk itself and all PON / ports under the single disk; Count 4: only includes the alarm statistics of a single disk; Count 5: includes the alarm statistics of the PON port itself and all ONUs under the PON port; Count 6: only includes the alarm statistics of the PON port itself; Count 7: includes the alarm statistics of the ONU itself and all ports under the ONU port; Count 8: only includes the alarm statistics of the ONU itself; Count 9: Contains alarm statistics falling on the port itself.

[0040] The port is the smallest alarm statistics unit and there is no smaller device.

[0041] Each of counts 1 to 9 is subdivided according to different alarm levels and different alarm states, for example, the 26 types of subdivided data in the example of the alarm statistics section above.

[0042] All NEs managed by the transmission network management system are transmission NEs. The statistical data include count 1, count 2, count 3, count 4, and count 9.

[0043] All NEs managed by the access network management system are access NEs. The statistical data includes counts 1 to 9.

[0044] The transmission and access converged network management manages a part of transmission network elements and a part of access network elements. The statistical data includes counts 1 to 9.

[0045] S12. When each first user switches from a logged-out state to a logged-in state, perform rule-free full statistics: if a network element to which the current user has authority has a second alarm count, then the full alarm count of the network element is calculated based on the second alarm count of the network element and the authority of the current user to the network element; otherwise, the full alarm count of the network element is determined to be zero, and the network element is marked as a network element to be calculated; the sum of the full alarm counts of all network elements to which the current user has authority is calculated to obtain the third alarm count of the current user, and the sum is saved in the distributed cache; wherein, if the first user is logged in and no custom statistical rules are set, the second alarm count of the network element to be calculated is equal to zero.

[0046] In this application, user-level alarm statistics are only performed on users who are logged in to avoid unnecessary computing for users who are logged out. Depending on whether the user sets custom statistical rules, user-level alarm statistics are divided into two statistical routes: rule-free statistics and rule-based statistics. The calculation basis of the two statistical routes is different. Rule-free statistics can use the calculated first alarm count, and rule-based statistics need to match the alarm information with custom statistical rules. Each statistical route is divided into two statistical stages: one-time full statistics and continuous incremental statistics. The difference is that the full statistics directly calculates the total amount at the current moment, and the incremental statistics first calculates the increment of the current moment relative to the previous moment, and then superimposes the increment on the total amount of the previous moment to obtain the total amount at the current moment, so as to further reduce the amount of calculation.

[0047] Therefore, the user-level alarm statistics operation in this application includes irregular full statistics, irregular incremental statistics, regular full statistics and regular incremental statistics. This embodiment only describes the operations of irregular full statistics and irregular incremental statistics.

[0048] In this embodiment, the irregular full statistics and irregular incremental statistics are performed for users who are logged in and have not set custom statistical rules. Such users are referred to as first users. The second alarm count is the first alarm count obtained when the network element participates in the most recent round of irregular incremental statistics. It is not the latest alarm statistical information of the network element. It will not be updated until the next round of irregular incremental statistics. The second alarm count is saved in the local cache. The third alarm count is a user-level alarm statistic. The alarm statistical information of the first user is calculated through irregular full statistics and irregular incremental statistics, and saved to the distributed cache. The new third alarm count will overwrite the old third alarm count, so that the third alarm count in the distributed cache always represents the user's latest alarm statistical information. The full alarm count has the same components as the third alarm count, and only the part for which the user has authority is counted.

[0049] In the process of irregular full statistics, first query which network elements the current user has permissions to. Here, it does not distinguish whether the permissions are complete or not. As long as there is permission for part of the network element, the network element is called the network element to which the current user has permissions. If a network element has the second alarm count, it means that it has participated in the latest round of irregular incremental statistics, and can feedback alarm statistics information that is closer to the latest status in the irregular full statistics. If a network element does not have the second alarm count, it means that it has not participated in the latest round of irregular incremental statistics, and can only feedback the initial alarm statistics information in the irregular full statistics, that is, the count is zero, and it is marked as a network element to be calculated to ensure that it will definitely participate in the next round of irregular incremental statistics, so as to update the status in time.

[0050] The following example A is used to illustrate the slice calculation method in irregular statistics. By way of example, network element 1 and network element 2 are transmission network elements, and network element 3 is an access network element.

[0051] The user has full permissions for NE 1. For the user, the alarm statistics for NE 1 are counted as 1.

[0052] The user has all permissions for disk 1 in NE 2, and permissions for ports 1 and 2 of disk 2. For the user, the alarm statistics for NE 2 are: count 2 + count 3 of disk 1 + count 4 of disk 2 + count 9 of port 1 under disk 2 + count 9 of port 2 under disk 2.

[0053] The user has all permissions of single disk 1 in NE 3, all permissions of PON1 of single disk 2, and all permissions of ONU1 under PON2 of single disk 2. For the user, the alarm statistics of NE 3 are: count 2 + count 3 of single disk 1 + count 4 of single disk 2 + count 5 of PON1 under single disk 2 + count 6 of PON2 under single disk 2 + count 7 of ONU1 under PON2 under single disk 2.

[0054] The following example B is used to illustrate the irregular full statistics process. For example, existing users 1 and 2 do not set custom statistics rules. User 1 has the authority of network element 1 and network element 2, and user 2 has the authority of network element 1, network element 2, network element 3, and network element 4. All network elements have not participated in the irregular incremental statistics before, and there is no second alarm count of any network element in the local cache.

[0055] B1. User 1 switches from the logged-out state to the logged-in state, and an irregular full statistics is performed on user 1. It is found that the network elements to which user 1 has authority are network element 1 and network element 2, neither of which has a second alarm count. It is determined that the full alarm count of network element 1 and network element 2 is zero, and network element 1 and network element 2 are marked as network elements to be calculated. The third alarm count of user 1 is calculated to be zero and saved to the distributed cache.

[0056] B2, network element 1 and network element 2 are network elements to be calculated, participate in the next round of irregular incremental statistics, and have the second alarm count. The process is detailed in Example C below.

[0057] B3. User 2 switches from the logout state to the login state, and an irregular full statistics is performed on user 2. It is found that the network elements to which user 2 has authority are network element 1, network element 2, network element 3, and network element 4. Network element 1 and network element 2 have a second alarm count. The full alarm count of network element 1 and network element 2 is calculated based on the second alarm count of network element 1 and network element 2 and the authority of user 2 to network element 1 and network element 2. The calculation method refers to the above embodiment A. Network element 3 and network element 4 do not have a second alarm count. It is determined that the full alarm count of network element 3 and network element 4 is zero, and network element 3 and network element 4 are marked as network elements to be calculated. The third alarm count of user 1 is calculated as the sum of the full alarm counts of network element 1 and network element 2, and is saved in the distributed cache.

[0058] S13. Regularly obtain the network element ID whose first alarm count is updated.

[0059] For example, an updated network element ID is obtained every A seconds. Assuming that the current time is the Bth second, the updated network element IDs between the BAth second and the Bth second are sent.

[0060] S14. For the network elements whose first alarm counts have been updated and the network elements to be calculated, perform irregular incremental statistics in sequence: if there is a second user, obtain the first alarm count of the current network element from the distributed cache, calculate the difference between the first alarm count and the second alarm count of the current network element to obtain the fourth alarm count of the current network element, for each second user, obtain the third alarm count of the current user from the distributed cache, calculate the incremental alarm count of the current network element according to the fourth alarm count of the current network element and the current user's authority over the current network element, calculate the sum of the third alarm count of the current user and the incremental alarm count of the current network element to obtain the new third alarm count of the current user, and save it to the distributed cache. After the third alarm counts of all second users are updated, update the second alarm count of the current network element to the first alarm count, wherein the second user is logged in, has no custom statistical rules set, and has authority over the current network element.

[0061] In this embodiment, the fourth alarm count is the difference between the first alarm count and the second alarm count, indicating the newly added alarm statistics of the network element after the last round of irregular incremental statistics. Since the network element to be calculated did not participate in the last round of irregular incremental statistics, all alarm statistics are newly added, and the fourth alarm count is equal to the first alarm count. The incremental alarm count has the same components as the third alarm count, and only the part that the user has permission to count is counted.

[0062] In the process of irregular incremental statistics, for each network element in the set of the network element with updated first alarm count and the network element to be calculated, first check whether there is a user who is logged in, has no custom statistical rules set, and has the authority of the current network element. Such users are referred to as second users. The existence of a second user indicates that the fourth alarm count needs to be calculated through the first alarm count and the second alarm count to obtain the alarm statistics information added during the period, which is used to update the third alarm count of the second user. Since each second user may have different authority over the current network element, the incremental alarm count of the current network element needs to be calculated for each second user and added to the current third alarm count of the corresponding user to obtain a new third alarm count. After all second users have completed the update, the local second alarm count is updated.

[0063] The irregular incremental statistics process is described below using Example C. The background setting of Example C follows that of Example B, and step B2 is first expanded.

[0064] C1. The updated network element IDs are obtained as network element 1 and network element 3, and the network elements to be calculated are network element 1 and network element 2, so irregular incremental statistics are performed on network element 1, network element 2 and network element 3 in sequence.

[0065] C21. For network element 1, the second user is user 1. The first alarm count of network element 1 is obtained from the distributed cache. The second alarm count of network element 1 is zero. The fourth alarm count of network element 1 is calculated to be equal to the first alarm count. For user 1, the third alarm count of user 1 is obtained from the distributed cache as zero. The incremental alarm count of network element 1 is calculated based on the fourth alarm count of network element 1 and the authority of user 1 to network element 1. The sum of the third alarm count of user 1 and the incremental alarm count of network element 1 is calculated to obtain the new third alarm count of user 1, and saved to the distributed cache. The second alarm count of network element 1 is updated to the first alarm count.

[0066] C22. For network element 2, the second user is user 1. The first alarm count of network element 2 is obtained from the distributed cache. The second alarm count of network element 2 is zero. The fourth alarm count of network element 2 is calculated to be equal to the first alarm count. For user 1, the third alarm count of user 1 is obtained from the distributed cache as the third alarm count updated after step C22. The incremental alarm count of network element 2 is calculated according to the fourth alarm count of network element 2 and the authority of user 1 to network element 2. The sum of the third alarm count of user 1 and the incremental alarm count of network element 2 is calculated to obtain the new third alarm count of user 1, and it is saved in the distributed cache. The second alarm count of network element 2 is updated to the first alarm count.

[0067] C23. For network element 3, since user 2 has not logged in, there is no second user, and the process ends without any operation.

[0068] After the irregular incremental statistics are completed, network element 1 and network element 2 are unmarked. After step B3, the network elements to be calculated are network element 3 and network element 4.

[0069] C3. The updated network element IDs are obtained as network element 2 and network element 5, and the network elements to be calculated are network element 3 and network element 4, so irregular incremental statistics are performed on network element 2, network element 3, network element 4 and network element 5 in sequence.

[0070] C41. For network element 2, the second user is user 1 and user 2. The first alarm count of network element 2 is obtained from the distributed cache, and the second alarm count is subtracted to obtain the fourth alarm count of network element 2. For user 1, the third alarm count of user 1 is obtained from the distributed cache. The incremental alarm count of network element 2 is calculated according to the fourth alarm count of network element 2 and the authority of user 1 to network element 2. The sum of the third alarm count of user 1 and the incremental alarm count of network element 2 is calculated to obtain the new third alarm count of user 1, and it is saved to the distributed cache. For user 2, the third alarm count of user 2 is obtained from the distributed cache. The incremental alarm count of network element 2 is calculated according to the fourth alarm count of network element 2 and the authority of user 2 to network element 2. The sum of the third alarm count of user 2 and the incremental alarm count of network element 2 is calculated to obtain the new third alarm count of user 2, and it is saved to the distributed cache. The second alarm count of network element 2 is updated to the first alarm count.

[0071] C42. For network element 3, the second user is user 2, and the process refers to step C21.

[0072] C43. For network element 4, the second user is user 2, and the process refers to step C22.

[0073] C44. For network element 5, there is no second user, and the process ends without any operation.

[0074] Therefore, in this embodiment, the alarm information is continuously parsed and the alarm count of the network element is calculated, and the alarm count of which network elements has been updated is checked regularly. The alarm count of the logged-in users is counted, and slice statistics are supported. For users who do not set custom statistical rules, a ruleless full statistics is performed when the user switches from the logged-out state to the logged-in state. While the user is logged in, a ruleless incremental statistics is performed each time there is an updated network element ID. Through this embodiment, the alarm statistics at the network element level and the alarm statistics at the user level are separated, and the overall calculation amount is reduced by coordinating the design of full statistics and incremental statistics. When the alarm volume is large and the alarm statistics logic is complex, it helps to improve efficiency, reduce resource consumption, and increase scalability.

[0075] In particular, when the user switches from the login state to the logout state, there is no need to perform additional processing on the second alarm count and the third alarm count. This is because in the irregular full statistics, when the user switches from the logout state to the login state, the old third alarm count will not be used, but the new third alarm count will be directly calculated. In the irregular incremental statistics, after all users who own a network element have logged out, there is no corresponding second user for the network element, and the second alarm count will remain unchanged until any user who owns the network element logs in again.

[0076] Of course, the second alarm count and the third alarm count can also be cleared at an appropriate time as needed to release the storage space of the local cache and the distributed cache. For example, when any user switches from the logged-in state to the logged-out state, the third alarm count of the user is cleared from the distributed cache, and when any first user switches from the logged-in state to the logged-out state, the network elements to which the user has authority are traversed, and if no other first user has authority over the current network element, the second alarm count of the current network element is cleared.

[0077] Furthermore, in one embodiment, the alarm statistics method further includes: For users who have not set custom statistical rules, the first rule is constructed based on the network element permissions that the user has; When performing irregular incremental statistics, the first rule is used to determine which users have the authority of the current network element, which users are recorded as third users, and the intersection of the first user and the third user is obtained to obtain the second user.

[0078] Through this embodiment, the second user corresponding to the current network element can be quickly determined when performing irregular incremental statistics, thereby improving the alarm statistics efficiency.

[0079] Specifically, when the service is started, the user's network element permissions are queried, and the first rule is constructed and saved locally. The information stored in the first rule is the user list corresponding to the network element. After the first rule is constructed, the list of all users who have full or partial permissions for the network element can be obtained through the network element ID.

[0080] For example, user 1 has full permissions for network element 1, and user 2 has permissions for a single disk of network element 1. Then the list of users that can be found through network element 1 is: user 1, user 2.

[0081] The following describes the operations of regular full statistics and regular incremental statistics.

[0082] Furthermore, in one embodiment, the alarm statistics method further includes: When each fourth user switches from a logged-out state to a logged-in state, a full-quantity statistics with rules is performed: the alarm information of all network elements to which the current user has authority is obtained from the distributed cache, and the obtained alarm information is traversed. If the current alarm information matches the custom statistical rule of the current user, and the current user has authority over the alarm source corresponding to the current alarm information, the third alarm count of the current user is increased by one. After the traversal is completed, the third alarm count of the current user is saved to the distributed cache, wherein the initial value of the third alarm count is zero, and the fourth user is in a logged-in state and a custom statistical rule is set; Regularly obtain new alarm IDs; For the newly added alarm ID, regular incremental statistics are performed in sequence: the current alarm information corresponding to the current alarm ID is obtained from the distributed cache. If there is a fifth user, the third alarm count of the current user is obtained from the distributed cache for each fifth user, the third alarm count of the current user is increased by one to obtain the new third alarm count of the current user, and saved to the distributed cache. Among them, the fifth user is logged in and a custom statistical rule is set. The custom statistical rule matches the current alarm information and has the corresponding alarm source authority.

[0083] In this embodiment, the regular full statistics and regular incremental statistics are performed for users who are logged in and have set custom statistical rules. Such users are referred to as fourth users. The third alarm count is a user-level alarm statistic. The alarm statistical information of the fourth user is calculated through the regular full statistics and regular incremental statistics, and saved to the distributed cache. The new third alarm count will overwrite the old third alarm count, so that the third alarm count in the distributed cache always represents the latest alarm statistical information of the user.

[0084] In the process of full statistics with rules, first query which network elements the current user has permissions to. Here, it does not distinguish whether the permissions are complete or not. As long as there is permission for part of the network element, the network element is called the network element to which the current user has permissions, and then obtain the alarm information of the corresponding network element from the distributed cache according to the network element ID. The obtained alarm information needs to be analyzed one by one. The alarm information that can be counted in the third alarm count needs to meet two conditions: one is that the alarm information matches the current user's custom statistical rules, and the other is that the current user has the permission for the alarm source corresponding to the alarm information.

[0085] It should be noted that the alarm source is not a necessary condition in the custom statistical rules. The obtained alarm information does not distinguish whether the user's permissions are complete. Although some alarm information meets the custom statistical rules set by the user, such as meeting the requirements of the alarm code and alarm level, the user does not have the authority of the alarm source. This alarm information should not be counted in the third alarm count. Therefore, it is necessary to further verify whether the user has the authority of the alarm source. For example, the alarm source of a certain alarm information is single disk 1 of network element 1, and it meets the requirements of the alarm code and alarm level set by a user, but the user only has the authority of single disk 2 of network element 1, then the alarm information is not counted in the third alarm count of the user.

[0086] The operation of obtaining a newly added alarm ID refers to the example of sending an updated network element ID in the previous text. It is particularly noted that the acquisition cycles of the two can be synchronized or asynchronous, and this application does not impose any restrictions on this.

[0087] In the process of regular incremental statistics, for each newly added alarm ID, first obtain the current alarm information corresponding to the current alarm ID from the distributed cache, and then query whether there is a user who is logged in, has set a custom statistical rule, and the custom statistical rule matches the current alarm information, and has the corresponding alarm source authority. Such users are referred to as fifth users. The existence of a fifth user means that the current alarm information needs to be counted in the third alarm count of each fifth user, and is updated by adding one to the current third alarm count.

[0088] The following example D is used to illustrate the setting and matching of custom statistical rules. For example, user 1 defines the following statistical rules: Rule 100, alarm code: 1, 2, 3, 4, 5, 6, 7, alarm level: 1, 2, 3, alarm time: not set, alarm week: 0, 1, 2; Rule 101, alarm code: 1, 2, 3, 20, alarm level: 1, 4, alarm time: 0~3600, alarm week: 0, 1; Rule 102, alarm code: not set, alarm level: not set, alarm time: 0~7200, alarm day of the week: not set.

[0089] The description of alarm information 1 is as follows: alarm code: 1, alarm level: 1, alarm time: 0, alarm week: 0, then alarm information 1 matches rules 100, 101, and 102 of user 1.

[0090] The description of alarm information 2 is as follows: alarm code: 10, alarm level: 4, alarm time: 10000, alarm week: 4, then alarm information 2 does not match any of the user's rules.

[0091] Therefore, in this embodiment, it is determined regularly which new alarm IDs have been added. For users who have set custom statistical rules, a regular full statistics is performed when the user switches from a logged-out state to a logged-in state. While the user is logged in, a regular incremental statistics is performed each time a new alarm ID is received to reduce the amount of calculation.

[0092] Furthermore, in one embodiment, the alarm statistics method further includes: For users who have set custom statistical rules, the second rule is constructed based on the network element permissions owned by the user, and the third rule is constructed based on the custom statistical rules set by the user; The second rule is used to determine which users have the corresponding alarm source authority, recorded as the sixth user. The third rule is used to determine which users' custom rules match the current alarm information, recorded as the seventh user. When executing regular full statistics, when the current user is at the intersection of the sixth user and the seventh user, the third alarm count of the current user is increased by one. When executing regular incremental statistics, the intersection of the fourth user, the sixth user, and the seventh user is taken to obtain the fifth user.

[0093] Through this embodiment, when executing regular full statistics, it is possible to quickly determine whether the current alarm information should be included in the third alarm count of the current user. When executing regular incremental statistics, it is possible to quickly determine the fifth user corresponding to the current alarm information, and then determine which users' third alarm counts the current alarm information needs to be included in, thereby improving the efficiency of alarm statistics.

[0094] Specifically, when the service is started, the user's network element authority is queried, and the second rule is constructed and saved locally. The information stored in the second rule is a list of user IDs corresponding to conditions 1 to 6. The conditions are as follows: Condition 1: NE ID; Condition 2: NE ID, single disk ID; Condition 3: NE ID, disk ID, port; Condition 4: NE ID, single disk ID, PON ID; Condition 5: NE ID, single disk ID, PON ID, ONU ID; Condition 6: NE ID, single disk ID, PON ID, ONU ID, port.

[0095] After the second rule is constructed, the user ID that meets the corresponding condition can be obtained through the above condition information.

[0096] For example, the network element permissions owned by user 1 include the full permissions of network element 1 and the permissions of single disk 1 of network element 2, and the network element permissions owned by user 2 include the full permissions of network element 2. The conditions in the second rule are set as follows: Condition 1: NE 1 corresponds to user 1, and NE 2 corresponds to user 2; Condition 2: NE 1 + any single disk corresponds to user 1, NE 2 + single disk 1 corresponds to user 1 and user 2, and NE 2 + non-single disk 1 corresponds to user 2; Condition 3: NE 1 + any single disk + any port corresponds to user 1, NE 2 + single disk 1 + any port corresponds to user 1 and user 2, NE 2 + non-single disk 1 + any port corresponds to user 2; Condition 4: NE 1 + any single disk + any PON ID corresponds to user 1, NE 2 + single disk 1 + any PON ID corresponds to user 1 and user 2, NE 2 + non-single disk 1 + any PON ID corresponds to user 2; Condition 5: NE 1 + any single disk + any PON ID + any ONU ID corresponds to user 1, NE 2 + single disk 1 + any PON ID + any ONU ID corresponds to user 1 and user 2, NE 2 + non-single disk 1 + any PON ID + any ONU ID corresponds to user 2; Condition 6: NE 1 + any single disk + any PON ID + any ONU ID + any port corresponds to user 1, NE 2 + single disk 1 + any PON ID + any ONU ID + any port corresponds to user 1 and user 2, NE 2 + non-single disk 1 + any PON ID + any ONU ID + any port corresponds to user 2.

[0097] Specifically, when the first rule and the second rule are constructed, the input data includes the user ID, the list of network element IDs for which the user has full network element permissions, and the object information (including network element ID, single disk ID, port, PON ID, ONUID) for which the user has partial network element permissions.

[0098] For example, after the user logs in, he creates a custom statistical rule on the client, and the alarm statistics system constructs the third rule after receiving the rule creation request. A user can create multiple rules, and multiple users can create their own rules. After the third rule is constructed, the list of all rules that meet the conditions and the user ID corresponding to the rule can be obtained through the alarm information.

[0099] Continuing to refer to the above-mentioned embodiment D, based on the embodiment D, user 2 defines the following statistical rules: Rule 200, alarm code: not set, alarm level: 1, 2, 3, alarm time: not set, alarm week: not set.

[0100] The third rule determines that alarm information 1 matches rules 100, 101, 102, and 200, and the user IDs corresponding to the rules are user 1 and user 2.

[0101] Specifically, during the third construction, the input data includes alarm code, alarm level, alarm type, alarm status, alarm clearing type, alarm source, alarm generation time range, alarm confirmation time range, alarm frequency, alarm engineering status and other conditions.

[0102] Optionally, the rule construction and matching operations involved in this application can use the relevant algorithms in CN202311053084 to integrate the statistical rules and improve the efficiency of rule matching.

[0103] Optionally, in the process of regular full statistics, the current alarm information is first matched with one of the second rule and the third rule. If the sixth user or the seventh user does not exist, or the sixth user or the seventh user is not the current user, the process of the current alarm information is directly terminated without matching the other of the second rule and the third rule to reduce unnecessary matching calculations.

[0104] Optionally, in the process of regular incremental statistics, the current alarm information is first matched with one of the second rule and the third rule. If the sixth user or the seventh user does not exist, or the sixth user or the seventh user is not the fourth user, the process of the current alarm information is directly terminated without matching the other of the second rule and the third rule to reduce unnecessary matching calculations.

[0105] Furthermore, in one embodiment, the third alarm count of the user is counted through multiple alarm query service instances, each logged-in user is bound to one of the alarm query service instances, and each alarm query service instance is used to count the third alarm count of the user bound thereto.

[0106] In this embodiment, since the alarm statistics at the network element level and the alarm statistics at the user level are separated, the alarm statistics at the user level can be independently calculated by a single instance of the alarm query service. There is no need to add the statistical results of all instances as in the prior art. Through this embodiment, the alarm query service can copy multiple instances, and each alarm query service instance only processes the alarm statistics of the user bound to it, thereby sharing the computing pressure.

[0107] Since a user can log in to multiple clients at the same time, such as web pages, apps on different devices, etc., in order to distinguish the operations of the same user at different logins, the user login message and user logout message sent by the client to the alarm query service carry the user ID and login ID. The user ID is unique at the user level, and the login ID is unique at the login level. At the same time, a user ID and a login ID must be globally unique. The following provides two optional implementation methods to illustrate how the alarm query service instance determines the user login status and maintains the binding relationship.

[0108] As an optional implementation manner, the user login message and the user logout message are sent by the client to one of the alarm query service instances, and the alarm statistics method further includes: When the alarm query service instance receives a user login message, it queries the local login list. If the user ID is found in the local login list, the login ID is added under the user ID in the local login list. If the user ID is not found in the local login list, the distributed cache is queried. If the binding relationship of the user ID is found in the distributed cache, the user login message is sent to the bound alarm query service instance. If the binding relationship of the user ID is not found in the distributed cache, the binding relationship between itself and the user ID is saved in the distributed cache, and the user ID and the login ID are saved in the local login list to determine that the user is switched from the logged-out state to the logged-in state. When the alarm query service instance receives a user logout message, it queries the local login list. If the user ID is found in the local login list, the login ID is deleted from the local login list. If the login ID is empty after deletion, the binding relationship between itself and the user ID is deleted from the distributed cache, and the user ID is deleted from the local login list to determine that the user has switched from the logged-in state to the logged-out state. If the user ID is not found in the local login list, the binding relationship of the user ID is obtained from the distributed cache, and the user logout message is sent to the bound alarm query service instance.

[0109] In this embodiment, user login messages and user logout messages are not sent in a directional manner. When the alarm query service instance receives the user login message and the user logout message, it first queries whether there is a corresponding user ID in the local login list. If there is, it means that the user is bound to itself, and the login ID can be added or deleted. If not, it means that the user is not bound to itself, and the binding status of the user ID can be obtained by querying the distributed cache. If the user is bound to other instances, the binding relationship can be queried and the message can be forwarded to the binding instance. If the user is not bound to any instance, the binding relationship cannot be found.

[0110] When processing a user login message, if no binding relationship is found, the system will bind itself to the user ID and determine that the user has switched from the logged-out state to the logged-in state. When processing a user logout message, the system will inevitably query the binding relationship. If the login ID is found to be empty under the user ID after deleting it, it means that the user has logged out of all clients. The system will then unbind itself from the user ID and determine that the user has switched from the logged-in state to the logged-out state.

[0111] As another optional implementation, the user login message and the user logout message are sent by the client to the bound alarm query service instance, and the binding relationship is determined according to the user ID; The alarm statistics method also includes: When the alarm query service instance receives a user login message, the login ID is added under the user ID in the local login list. If the login ID under the user ID is empty before the addition, it is determined that the user is switched from the logged-out state to the logged-in state; When the alarm query service instance receives a user logout message, it deletes the login ID under the user ID in the local login list. If the login ID under the user ID is empty after the deletion, it is determined that the user is switched from the login state to the logout state.

[0112] In this embodiment, user login messages and user logout messages are sent out according to the user ID. When the alarm query service instance receives the user login message and the user logout message, it performs the addition or deletion operation of the login ID, and determines whether there is a switch between the login state and the logout state based on whether the login ID is empty under the user ID before adding or after deleting.

[0113] It can be seen that the first implementation is a dynamic binding solution. The binding relationship between the user and the instance is uncertain. Each time the user logs in again, a binding relationship may be established with a different instance, which is convenient for balancing the load of different instances and avoiding the problem of overloading of individual instances. Accordingly, the processing flow after the message reaches the instance will be more complicated. The second implementation is a static binding solution. The binding relationship between the user and the instance is determined in advance according to the user ID. Each time the user logs in again, a binding relationship is established with the same instance. The processing flow after the message reaches the instance is simple, but the problem of overloading of individual instances may occur.

[0114] The following is an example to illustrate the process of the dynamic binding solution. For example, it is assumed that the alarm query service has three instances, namely instance 1, instance 2 and instance 3.

[0115] User 1 logs in for the first time, with login ID 1. User login message 1 is randomly sent to instance 2. Instance 2 first queries the local login list and finds that there is no user 1. It then continues to query the distributed cache and finds that there is no binding relationship with user 1. It then saves the binding relationship between instance 2 and user 1 to the distributed cache, saves user 1 and login 1 to the local login list, and determines that user 1 switches from the logged-out state to the logged-in state. If user 1 has not set custom statistical rules, full statistics without rules will be executed. If user 1 has set custom statistical rules, full statistics with rules will be executed.

[0116] User 1 logs in for the second time, with login ID 2. User login message 2 is randomly sent to instance 1. Instance 1 first queries the local login list and finds that there is no user 1. It then continues to query the distributed cache and finds the binding relationship between user 1 and instance 2. It then forwards user login message 2 to instance 2. Instance 2 queries the local login list and finds that there is user 1. It then adds login 2 under user 1.

[0117] User 1's login 2 is logged out, and user logout message 1 is randomly sent to instance 3. Instance 3 first queries the local login list and finds that there is no user 1. It then continues to query the distributed cache and finds the binding relationship between user 1 and instance 2. It then forwards user logout message 1 to instance 2. Instance 2 queries the local login list and finds that there is user 1. It deletes login 2 from user 1. After the deletion, login 1 still exists under user 1.

[0118] User 1's login 1 is logged out, and user logout message 2 is randomly sent to instance 2. Instance 2 queries the local login list and finds user 1. It deletes login 1 from user 1. After deletion, the login ID of user 1 is empty, so the binding relationship between instance 2 and user 1 is deleted from the distributed cache, and user 1 is deleted from the local login list, confirming that user 1 switches from the login state to the logout state.

[0119] In a second aspect, an embodiment of the present application further provides an alarm statistics system, which includes an alarm analysis service, a distributed cache, and an alarm query service.

[0120] The alarm analysis service is used to continuously analyze the alarm information and calculate the first alarm count of each network element, and save the alarm information and the first alarm count to the distributed cache; The alarm query service is used to perform rule-free full statistics when each first user switches from a logged-out state to a logged-in state: if a network element to which the current user has authority has a second alarm count, the full alarm count of the network element is calculated based on the second alarm count of the network element and the authority of the current user to the network element; otherwise, the full alarm count of the network element is determined to be zero, and the network element is marked as a network element to be calculated; the sum of the full alarm counts of all network elements to which the current user has authority is calculated to obtain the third alarm count of the current user, and the count is saved in the distributed cache, wherein the first user is in a logged-in state and no custom statistical rules are set, and the second alarm count of the network element to be calculated is equal to zero; The alarm analysis service is used to periodically send the network element ID of the first alarm count update to the alarm query service; The alarm query service is used to perform irregular incremental statistics in sequence for network elements with updated first alarm counts and network elements to be calculated: if there is a second user, the first alarm count of the current network element is obtained from the distributed cache, and the difference between the first alarm count and the second alarm count of the current network element is calculated to obtain the fourth alarm count of the current network element. For each second user, the third alarm count of the current user is obtained from the distributed cache, and the incremental alarm count of the current network element is calculated according to the fourth alarm count of the current network element and the current user's authority over the current network element. The sum of the third alarm count of the current user and the incremental alarm count of the current network element is calculated to obtain the new third alarm count of the current user, and saved to the distributed cache. After the third alarm counts of all second users are updated, the second alarm count of the current network element is updated to the first alarm count, wherein the second user is logged in, no custom statistical rules are set, and has authority over the current network element.

[0121] In this embodiment, the alarm analysis service continuously analyzes the alarm information and calculates the alarm count of the network element, and regularly informs the alarm query service of which network elements have updated alarm counts. The alarm query service counts the alarm counts of users in the logged-in state, supports slice statistics, and for users who do not set custom statistical rules, performs a ruleless full statistics when the user switches from the logged-out state to the logged-in state. While the user is in the logged-in state, the ruleless incremental statistics are performed each time the updated network element ID is received. Through this embodiment, the alarm statistics at the network element level and the alarm statistics at the user level are separated to reduce the calculation amount of the alarm analysis service. The calculation amount of the alarm query service is reduced by the coordination of full statistics and incremental statistics. When the alarm volume is large and the alarm statistics logic is complex, it helps to improve efficiency, reduce resource consumption, and increase scalability.

[0122] Further, in one embodiment, the alarm query service is also used to construct a first rule according to the network element authority possessed by the user for the user who has not set a custom statistical rule; When the alarm query service performs irregular incremental statistics, it determines which users have the authority of the current network element through the first rule, records them as third users, and obtains the second user by taking the intersection of the first user and the third user.

[0123] Furthermore, in one embodiment, the alarm query service is also used to perform regular full statistics when each fourth user switches from a logged-out state to a logged-in state: obtain the alarm information of all network elements to which the current user has authority from the distributed cache, traverse the obtained alarm information, and if the current alarm information matches the custom statistical rule of the current user, and the current user has authority over the alarm source corresponding to the current alarm information, then add one to the third alarm count of the current user, and after the traversal is completed, save the third alarm count of the current user to the distributed cache, wherein the initial value of the third alarm count is zero, and the fourth user is in a logged-in state and a custom statistical rule is set; The alarm analysis service is also used to periodically send newly added alarm IDs to the alarm query service; The alarm query service is also used to perform regular incremental statistics for newly added alarm IDs in sequence: obtain the current alarm information corresponding to the current alarm ID from the distributed cache. If there is a fifth user, then for each fifth user, obtain the current user's third alarm count from the distributed cache, add one to the current user's third alarm count to obtain the current user's new third alarm count, and save it to the distributed cache. Among them, the fifth user is in a logged-in state and has set custom statistical rules. The custom statistical rules match the current alarm information and have corresponding alarm source permissions.

[0124] Further, in one embodiment, the alarm query service is also used to construct a second rule according to the network element authority owned by the user for the user who has set the custom statistical rule, and to construct a third rule according to the custom statistical rule set by the user; The alarm query service determines which users have the corresponding alarm source permissions through the second rule, recorded as the sixth user, and determines which users' custom rules match the current alarm information through the third rule, recorded as the seventh user. When performing regular full statistics, the third alarm count of the current user is increased by one when the current user is at the intersection of the sixth user and the seventh user. When performing regular incremental statistics, the intersection of the fourth user, the sixth user, and the seventh user is taken to obtain the fifth user.

[0125] Furthermore, in one embodiment, the alarm query service has multiple instances, each logged-in user is bound to one of the alarm query service instances, and each alarm query service instance is used to count the third alarm count of the user bound thereto.

[0126] Further, in one embodiment, the user login message and the user logout message are sent by the client to one of the alarm query service instances, and the user login message and the user logout message both include the user ID and the login ID; The alarm query service instance is also used to query the local login list when receiving a user login message. If the user ID is found in the local login list, the login ID is added under the user ID in the local login list. If the user ID is not found in the local login list, the distributed cache is queried. If the binding relationship of the user ID is found in the distributed cache, the user login message is sent to the bound alarm query service instance. If the binding relationship of the user ID is not found in the distributed cache, the binding relationship between itself and the user ID is saved in the distributed cache, and the user ID and the login ID are saved in the local login list to determine that the user is switched from the logged-out state to the logged-in state. The alarm query service instance is also used to query the local login list when receiving a user logout message. If the user ID is found in the local login list, the login ID is deleted from the local login list under the user ID. If the login ID under the user ID is empty after deletion, the binding relationship between itself and the user ID is deleted from the distributed cache, and the user ID is deleted from the local login list to determine that the user has switched from the logged-in state to the logged-out state. If the user ID is not found in the local login list, the binding relationship of the user ID is obtained from the distributed cache, and the user logout message is sent to the bound alarm query service instance.

[0127] Further, in one embodiment, the user login message and the user logout message are sent by the client to the bound alarm query service instance, the user login message and the user logout message both include the user ID and the login ID, and the binding relationship is determined according to the user ID; The alarm query service instance is also used to add the login ID under the user ID in the local login list when receiving the user login message, and if the login ID under the user ID is empty before adding, it is determined that the user is switched from the logged-out state to the logged-in state; The alarm query service instance is also used to delete the login ID under the user ID in the local login list when receiving a user logout message. If the login ID under the user ID is empty after the deletion, it is determined that the user is switched from the logged-in state to the logged-out state.

[0128] Among them, the functional implementation of each module in the above-mentioned alarm statistics system corresponds to the various steps in the above-mentioned alarm statistics method embodiment, and its functions and implementation processes will not be repeated here one by one.

[0129] In a third aspect, an embodiment of the present application provides an alarm statistics device, which may be a device with data processing function, such as a personal computer (PC), a laptop computer, or a server.

[0130] Figure 2 A schematic diagram of the hardware structure of the alarm statistics device involved in the embodiment of the present application is shown.

[0131] Reference Figure 2 In an embodiment of the present application, the alarm statistics device may include a processor, a memory, a communication interface, and a communication bus.

[0132] The communication bus may be of any type and is used to interconnect the processor, the memory, and the communication interface.

[0133] Communication interfaces include input / output (I / O) interfaces, physical interfaces, and logical interfaces, which are used to interconnect components within the alarm statistics device, and interfaces used to interconnect the alarm statistics device with other devices (such as other computing devices or user devices). Physical interfaces can be Ethernet interfaces, optical fiber interfaces, ATM interfaces, etc.; user devices can be display screens (Display), keyboards (Keyboard), etc.

[0134] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.

[0135] The processor may be a general-purpose processor, and the general-purpose processor may call the alarm statistics program stored in the memory and execute the alarm statistics method provided in the embodiment of the present application. For example, the general-purpose processor may be a central processing unit (CPU). The method executed when the alarm statistics program is called may refer to the various embodiments of the alarm statistics method of the present application, and will not be repeated here.

[0136] Those skilled in the art will understand that Figure 2 The hardware structure shown in the figure does not constitute a limitation on the present application, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0137] In a fourth aspect, an embodiment of the present application also provides a readable storage medium.

[0138] The readable storage medium of the present application stores an alarm statistics program, wherein when the alarm statistics program is executed by a processor, the steps of the alarm statistics method as described above are implemented.

[0139] Among them, the method implemented when the alarm statistics program is executed can refer to the various embodiments of the alarm statistics method of the present application, and will not be repeated here.

[0140] It should be noted that the serial numbers of the above-mentioned embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.

[0141] The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit "first", "second" and "third" to different types.

[0142] In the description of the embodiments of the present application, "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a specific way.

[0143] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; the “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.

[0144] In some processes described in the embodiments of the present application, multiple operations or steps that appear in a specific order are included, but it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present application or in parallel, and the sequence number of the operation is only used to distinguish the different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.

[0145] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present application.

[0146] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. An alarm statistics method, It is characterized in that The alarm statistics method comprises: Continuously parse the alarm information and calculate the first alarm count of each network element, and save the alarm information and the first alarm count to the distributed cache; When each first user switches from a logged-out state to a logged-in state, perform rule-free full statistics: if a network element to which the current user has authority has a second alarm count, then the full alarm count of the network element is calculated based on the second alarm count of the network element and the authority of the current user to the network element; otherwise, the full alarm count of the network element is determined to be zero, and the network element is marked as a network element to be calculated; the sum of the full alarm counts of all network elements to which the current user has authority is calculated to obtain the third alarm count of the current user, and the sum is saved in the distributed cache, wherein the first user is in a logged-in state and no custom statistical rules are set, and the second alarm count of the network element to be calculated is equal to zero; Regularly obtain the network element ID of the network element whose first alarm count is updated; For network elements whose first alarm counts have been updated and network elements to be calculated, perform rule-free incremental statistics in sequence: if there is a second user, obtain the first alarm count of the current network element from the distributed cache, calculate the difference between the first alarm count and the second alarm count of the current network element to obtain the fourth alarm count of the current network element, for each second user, obtain the third alarm count of the current user from the distributed cache, calculate the incremental alarm count of the current network element according to the fourth alarm count of the current network element and the current user's authority over the current network element, calculate the sum of the third alarm count of the current user and the incremental alarm count of the current network element to obtain the new third alarm count of the current user, and save it to the distributed cache, after the third alarm counts of all second users are updated, update the second alarm count of the current network element to the first alarm count, wherein the second user is logged in, has no custom statistical rules set, and has authority over the current network element.

2. The alarm statistics method according to claim 1, It is characterized in that The alarm statistics method also includes: For users who have not set custom statistical rules, the first rule is constructed based on the network element permissions that the user has; When performing irregular incremental statistics, the first rule is used to determine which users have the authority of the current network element, which users are recorded as third users, and the intersection of the first user and the third user is obtained to obtain the second user.

3. The alarm statistics method according to claim 1, It is characterized in that The alarm statistics method also includes: When each fourth user switches from a logged-out state to a logged-in state, a full-quantity statistics with rules is performed: the alarm information of all network elements to which the current user has authority is obtained from the distributed cache, and the obtained alarm information is traversed. If the current alarm information matches the custom statistical rule of the current user, and the current user has authority over the alarm source corresponding to the current alarm information, the third alarm count of the current user is increased by one. After the traversal is completed, the third alarm count of the current user is saved to the distributed cache, wherein the initial value of the third alarm count is zero, and the fourth user is in a logged-in state and a custom statistical rule is set; Regularly obtain new alarm IDs; For the newly added alarm ID, regular incremental statistics are performed in sequence: the current alarm information corresponding to the current alarm ID is obtained from the distributed cache. If there is a fifth user, the third alarm count of the current user is obtained from the distributed cache for each fifth user, the third alarm count of the current user is increased by one to obtain the new third alarm count of the current user, and saved to the distributed cache. Among them, the fifth user is logged in and a custom statistical rule is set. The custom statistical rule matches the current alarm information and has the corresponding alarm source authority.

4. The alarm statistics method according to claim 3, It is characterized in that The alarm statistics method also includes: For users who have set custom statistical rules, the second rule is constructed based on the network element permissions owned by the user, and the third rule is constructed based on the custom statistical rules set by the user; The second rule is used to determine which users have the corresponding alarm source authority, recorded as the sixth user. The third rule is used to determine which users' custom rules match the current alarm information, recorded as the seventh user. When executing regular full statistics, when the current user is at the intersection of the sixth user and the seventh user, the third alarm count of the current user is increased by one. When executing regular incremental statistics, the intersection of the fourth user, the sixth user, and the seventh user is taken to obtain the fifth user.

5. The alarm statistics method according to any one of claims 1 to 4, It is characterized in that Count the third alarm count of users through multiple alarm query service instances; Each user in the logged-in state is bound to one of the alarm query service instances, and each alarm query service instance is used to count the third alarm count of the user bound thereto.

6. The alarm statistics method according to claim 5, It is characterized in that The user login message and the user logout message are sent by the client to one of the alarm query service instances, and the user login message and the user logout message both include the user ID and the login ID; The alarm statistics method also includes: When the alarm query service instance receives a user login message, it queries the local login list. If the user ID is found in the local login list, the login ID is added under the user ID in the local login list. If the user ID is not found in the local login list, the distributed cache is queried. If the binding relationship of the user ID is found in the distributed cache, the user login message is sent to the bound alarm query service instance. If the binding relationship of the user ID is not found in the distributed cache, the binding relationship between itself and the user ID is saved in the distributed cache, and the user ID and the login ID are saved in the local login list to determine that the user is switched from the logged-out state to the logged-in state. When the alarm query service instance receives a user logout message, it queries the local login list. If the user ID is found in the local login list, the login ID is deleted from the local login list. If the login ID is empty after deletion, the binding relationship between itself and the user ID is deleted from the distributed cache, and the user ID is deleted from the local login list to determine that the user has switched from the logged-in state to the logged-out state. If the user ID is not found in the local login list, the binding relationship of the user ID is obtained from the distributed cache, and the user logout message is sent to the bound alarm query service instance.

7. The alarm statistics method according to claim 5, It is characterized in that The user login message and the user logout message are sent by the client to the bound alarm query service instance. The user login message and the user logout message both include the user ID and the login ID. The binding relationship is determined based on the user ID. The alarm statistics method also includes: When the alarm query service instance receives a user login message, the login ID is added under the user ID in the local login list. If the login ID under the user ID is empty before the addition, it is determined that the user is switched from the logged-out state to the logged-in state; When the alarm query service instance receives a user logout message, it deletes the login ID under the user ID in the local login list. If the login ID under the user ID is empty after the deletion, it is determined that the user is switched from the login state to the logout state.

8. An alarm statistics system, It is characterized in that The alarm statistics system includes alarm analysis service, distributed cache and alarm query service; The alarm analysis service is used to continuously analyze the alarm information and calculate the first alarm count of each network element, and save the alarm information and the first alarm count to the distributed cache; The alarm query service is used to perform rule-free full statistics when each first user switches from a logged-out state to a logged-in state: if a network element to which the current user has authority has a second alarm count, the full alarm count of the network element is calculated based on the second alarm count of the network element and the authority of the current user to the network element; otherwise, the full alarm count of the network element is determined to be zero, and the network element is marked as a network element to be calculated; the sum of the full alarm counts of all network elements to which the current user has authority is calculated to obtain the third alarm count of the current user, and the count is saved in the distributed cache, wherein the first user is in a logged-in state and no custom statistical rules are set, and the second alarm count of the network element to be calculated is equal to zero; The alarm analysis service is used to periodically send the network element ID of the first alarm count update to the alarm query service; The alarm query service is used to perform irregular incremental statistics in sequence for network elements with updated first alarm counts and network elements to be calculated: if there is a second user, the first alarm count of the current network element is obtained from the distributed cache, and the difference between the first alarm count and the second alarm count of the current network element is calculated to obtain the fourth alarm count of the current network element. For each second user, the third alarm count of the current user is obtained from the distributed cache, and the incremental alarm count of the current network element is calculated according to the fourth alarm count of the current network element and the current user's authority over the current network element. The sum of the third alarm count of the current user and the incremental alarm count of the current network element is calculated to obtain the new third alarm count of the current user, and saved to the distributed cache. After the third alarm counts of all second users are updated, the second alarm count of the current network element is updated to the first alarm count, wherein the second user is logged in, no custom statistical rules are set, and has authority over the current network element.

9. An alarm statistics device, It is characterized in that The alarm statistics device comprises a processor, a memory, and an alarm statistics program stored in the memory and executable by the processor, wherein when the alarm statistics program is executed by the processor, the steps of the alarm statistics method according to any one of claims 1 to 7 are implemented.

10. A readable storage medium, It is characterized in that An alarm statistics program is stored on the readable storage medium, wherein when the alarm statistics program is executed by the processor, the steps of the alarm statistics method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Network element alarming intelligent monitoring system

    CN101345972A

  • Alarm information processing method and device, electronic equipment and readable storage medium

    CN116225866A

  • Computer security operation and maintenance service system

    CN118264548A

  • Method and apparatus for managing alarm in the network managing system, computer program for the same

    KR1020170138875A

  • Billing, Alarm, Statistics and Log Information Handling in Multi-Services Gateway Device at User Premises

    US20080165789A1