Alarm statistics method, system, device and readable storage medium
By saving network element-level alarm counts in distributed cache, and combining full and incremental statistics of user status switching, the problems of low efficiency and high resource consumption in large-scale alarm statistics are solved, and efficient user permission management and scalability are achieved.
Patent Information
- Application Number
- CN202410982039.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2044-07-22
AI Technical Summary
In the prior art, when the alarm volume is large and the alarm statistics logic is complex, the efficiency is low, the resource consumption is large, the scalability is poor, and it is difficult to support user permission management and alarm data statistics under the network resource slicing function.
By continuously analyzing the alarm information and calculating the first alarm count of the network element, saving it to a distributed cache, combining the full and incremental statistics during user status switching, separate the alarm statistics at the network element level and user level, and adopting the design of full and incremental statistics to reduce the calculation amount.
It improves the efficiency of alarm statistics, reduces resource consumption, increases the scalability of the system, and supports user permission management and alarm data statistics under the network resource slicing function.
Smart Images

Figure CN118784448B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network management technology, and in particular to an alarm statistics method, system, device and readable storage medium. Background Art
[0002] With the rapid development of 5G technology, network scale is growing. At the same time, telecom operators are promoting intensive network management. A single set of network management software needs to manage devices in more cities simultaneously. Consequently, the number of alarms that the network management software needs to process and display has increased significantly.
[0003] On the other hand, many operators currently lease their networks to other small operators or enterprise customers. Users demand network resource slicing capabilities, while also requiring the ability to manage sliced network resource control rights and link these slices to achieve efficient resource allocation and permission management. Consequently, alarm data statistics for different users on the same network management software vary due to their varying resource ownership, increasing the complexity of alarm statistics calculation. Current alarm statistics methods perform alarm analysis and alarm statistics calculation serially, resulting in low efficiency, high resource consumption, and poor scalability when dealing with large alarm volumes and complex alarm statistics logic. 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:
[0006] Continuously parse 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;
[0007] When each first user switches from a logged-out state to a logged-in state, an unregulated full statistics is performed: 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 for 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 in a logged-in state and no custom statistical rules are set, the second alarm count of the network element to be calculated is equal to zero;
[0008] Regularly obtain the network element ID of the network element with the updated first alarm count;
[0009] For network elements with updated first alarm counts and network elements to be calculated, irregular incremental statistics are performed in sequence: 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 based on 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.
[0010] Furthermore, in one embodiment, the alarm statistics method further includes:
[0011] For users who have not set custom statistical rules, the first rule is constructed based on the network element permissions owned by the user;
[0012] When performing irregular incremental statistics, the first rule is used to determine which users have the authority of the current network element, and record them as third users. The second user is obtained by taking the intersection of the first user and the third user.
[0013] Furthermore, in one embodiment, the alarm statistics method further includes:
[0014] When each fourth user switches from a logged-out state to a logged-in state, a full-scale 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, the obtained alarm information is traversed, and if the current alarm information matches the custom statistical rule of the current user, and the current user has the authority of the alarm source corresponding to the current alarm information, the third alarm count of the current user is increased by one, and 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;
[0015] Regularly obtain new alarm IDs;
[0016] 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, and the third alarm count of the current user is added 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 in the logged-in state, and the custom statistical rules are set. The custom statistical rules match the current alarm information and have the corresponding alarm source permissions.
[0017] Furthermore, in one embodiment, the alarm statistics method further includes:
[0018] 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;
[0019] The second rule is used to determine which users have the corresponding alarm source permissions, and they are recorded as the sixth user. The third rule is used to determine which users' custom rules match the current alarm information, and they are recorded as the seventh user. When performing 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 performing regular incremental statistics, the intersection of the fourth user, the sixth user, and the seventh user is taken to obtain the fifth user.
[0020] Furthermore, in one embodiment, the third alarm count of the user is counted through multiple alarm query service instances;
[0021] 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.
[0022] Furthermore, 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 both the user login message and the user logout message include the user ID and the login ID;
[0023] The alarm statistics method further includes:
[0024] 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 has switched from the logged-out state to the logged-in state.
[0025] 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 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 login state to the logout 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.
[0026] Furthermore, 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 based on the user ID;
[0027] The alarm statistics method further includes:
[0028] When the alarm query service instance receives a user login message, it adds the login ID under the user ID in the local login list. If the login ID under the user ID is empty before the addition, it determines that the user is switched from the logged-out state to the logged-in state;
[0029] 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.
[0030] In a second aspect, an embodiment of the present application further provides an alarm statistics system, which includes an alarm parsing service, a distributed cache, and an alarm query service;
[0031] The alarm parsing service is used to continuously parse 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;
[0032] 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 for 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 to the distributed cache; wherein, if the first user is in a logged-in state and no custom statistical rules are set, the second alarm count of the network element to be calculated is equal to zero;
[0033] The alarm analysis service is used to periodically send the network element ID of the network element with updated first alarm count to the alarm query service;
[0034] The alarm query service is used to perform irregular incremental statistics 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 based on 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 save it 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.
[0035] In a third aspect, an embodiment of the present application further provides an alarm statistics device, which includes a processor, a memory, and an alarm statistics program stored on 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.
[0036] 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.
[0037] In this application, the alarm information is continuously parsed and the alarm count of the network element is calculated. The alarm counts of the network elements that have been updated are checked regularly. The alarm counts of users in the logged-in state are counted. Slice statistics are supported. For users who do not set custom statistical rules, a ruleless full-scale 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. The design of full-scale statistics and incremental statistics is used to reduce the overall computing power. 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
[0038] Figure 1 This is a flowchart of an alarm statistics method according to an embodiment of the present application;
[0039] 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
[0040] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0041] In the prior art, the alarm statistics method mainly includes the following process:
[0042] 1. Selection of statistical rules. The system default statistical rules are used by default. Users can create and use custom statistical rules.
[0043] 2. The alarm analysis service calculates alarm statistics for different users based on statistical rules.
[0044] 3. When there are a large number of network elements, a single alarm resolution service cannot handle all the alarms. In this case, the network management will deploy multiple alarm resolution services, each of which handles the alarms of a portion of network elements. Therefore, each alarm resolution service will calculate the alarms of each user.
[0045] 4. The alarm analysis service reports the alarm statistics results to the client.
[0046] 5. The client adds up the statistics of multiple alarm analysis service instances for the same user to obtain the final result and displays it.
[0047] The main problems with the above scheme include:
[0048] 1. Low efficiency. Each user has his or her own statistical rules, which are different. Each alarm and each rule needs to be calculated separately.
[0049] 2. High resource consumption. After the network management introduces the user domain and slicing functions, the current framework requires adding statistical information for each network element slice to the network element resolution service, and performing calculations based on the slicing results. This significantly increases resource consumption and computing power, making it difficult to meet demand.
[0050] 3. Poor scalability. Each alarm analysis service needs to calculate statistics for all users, and statistical calculations cannot be shared. As the number of users increases, the amount of alarm statistics calculations increases.
[0051] In general, existing technologies closely integrate alarm analysis and alarm statistics calculation, processing them serially. This increases the computational load linearly with the number of users, limiting the timeliness and computational capacity of alarm statistics. Existing technologies currently do not support slice-based alarm statistics, and adding slice support would further increase computational load and resource consumption.
[0052] 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.
[0053] First, some technical terms in this application are explained to facilitate those skilled in the art to understand this application.
[0054] Alarm Information: When a system failure occurs, the monitoring unit (device) sends an alarm signal to the receiving unit (network management system). The network management system interprets the alarm signal into detailed alarm information and makes it available for query through the client. An alarm typically includes the alarm code, alarm source, alarm severity, alarm generation time, clearing status, clearing time, confirmation status, and confirmation time.
[0055] Alarm Statistics: Alarm status statistics for different alarm levels. For example, alarm levels include, but are not limited to, emergency, major, minor, warning, and interruption. Alarm statuses include, but are not limited to, uncleared unacknowledged, uncleared acknowledged, cleared unacknowledged, and cleared acknowledged. Alarm statistics include: emergency, major, minor, warning, interruption, uncleared unacknowledged, uncleared acknowledged, cleared unacknowledged, and cleared acknowledged alarm counts, as well as emergency, major, minor, warning, interruption, and all alarm counts, for a total of 26 alarm types.
[0056] NE-level alarm statistics: Alarms belonging to this NE are counted by severity and status. User-level alarm statistics: Alarms belonging to this user are counted by severity and status. Generally, a user owns multiple NEs, and user-level alarm statistics are the sum of all the alarms for each NE.
[0057] Customized statistical rules: Users can set conditions such as alarm code, alarm level, alarm type, alarm status, alarm clearing type, alarm source, alarm generation time range, alarm confirmation time range, alarm frequency, and alarm engineering status to filter alarm information for authorized network elements and collect the required data. If a user does not set customized statistical rules, all alarm information for authorized network elements will be counted.
[0058] Network resource slicing and slice alarm statistics: Network elements are divided into transmission network elements and access network elements based on their type. A transmission network element includes multiple disks, each of which includes multiple ports. An access network element includes multiple disks, each of which includes multiple PON (Passive Optical Network) ports. A PON port corresponds to multiple ONUs (Optical Network Units), and an ONU includes multiple ports. Users are not limited to having full permissions for each network element; they can have only partial permissions, for example, permissions for only a single disk within the network element. Accordingly, user-level alarm statistics only count the portions for which the user has permissions.
[0059] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0060] In a first aspect, an embodiment of the present application provides an alarm statistics method.
[0061] Figure 1 A flow chart of an alarm statistics method in an embodiment of the present application is shown.
[0062] Reference Figure 1 In one embodiment, the alarm statistics method includes the following steps:
[0063] S11. 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 a distributed cache.
[0064] 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.
[0065] The first alarm statistics requires dividing the network element into different statistical units and calculating the alarm statistics separately, including the alarm statistics of the following nine statistical units:
[0066] Count 1: includes all alarm statistics of the NE itself and the NE's single disk port;
[0067] Count 2: includes only alarm statistics for the NE itself, excluding alarm statistics for the NE's single disk port.
[0068] Count 3: includes alarm statistics for the disk itself and all PONs / ports under the disk;
[0069] Count 4: includes only the alarm statistics of a single disk;
[0070] Count 5: includes alarm statistics of the PON port itself and all ONUs connected to the PON port;
[0071] Count 6: only includes the alarm statistics of the PON port itself;
[0072] Count 7: includes alarm statistics of the ONU itself and all ports under the ONU port;
[0073] Count 8: includes only the alarm statistics of the ONU itself;
[0074] Count 9: Contains alarm statistics falling on the port itself.
[0075] The port is the smallest alarm statistics unit, and there is no smaller device.
[0076] Each count from count 1 to count 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.
[0077] All NEs managed by the transmission network management system are transmission NEs. The statistical data includes count 1, count 2, count 3, count 4, and count 9.
[0078] All NEs managed by the access network management system are access NEs. The statistical data includes counts 1 to 9.
[0079] The transmission and access converged network management system manages some transmission network elements and some access network elements. The statistical data includes counts 1 to 9.
[0080] 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 current user's authority over 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 to the distributed cache. Wherein, if the first user is in a logged-in state and no custom statistical rules are set, the second alarm count of the network element to be calculated is equal to zero.
[0081] In this application, user-level alarm statistics are only performed on users who are logged in, so as to avoid unnecessary computing time 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 the custom statistical rules. Each statistical route is divided into two statistical stages: one-time full statistics and continuous incremental statistics. The difference is that full statistics directly calculates the total amount at the current moment, and 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.
[0082] 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.
[0083] 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 and 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 the user-level alarm statistics. 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.
[0084] During the random full statistics process, the user is first queried to determine which network elements they have permission to access. This does not distinguish between complete and incomplete permissions; as long as a user has permission to access a portion of a network element, the network element is considered to be one for which the user has permission. If a network element has a second alarm count, it has participated in the most recent round of random incremental statistics and can report alarm statistics that are closer to the latest status in the random full statistics. If a network element does not have a second alarm count, it has not participated in the most recent round of random incremental statistics and can only report the initial alarm statistics (i.e., a count of zero) in the random full statistics. This marks it as a pending network element, ensuring its participation in the next round of random incremental statistics, thereby ensuring timely status updates.
[0085] The following describes a slice calculation method in irregular statistics using Example A. For example, NE 1 and NE 2 are transmission NEs, and NE 3 is an access NE.
[0086] The user has full permissions for NE 1. For the user, the alarm statistics for NE 1 are counted as 1.
[0087] The user has all permissions for disk 1 on NE 2, as well as permissions for ports 1 and 2 of disk 2. For the user, the alarm statistics for NE 2 are: count 2 + count 3 for disk 1 + count 4 for disk 2 + count 9 for port 1 on disk 2 + count 9 for port 2 on disk 2.
[0088] The user has all permissions for disk 1 in NE 3, all permissions for PON1 in disk 2, and all permissions for ONU1 under PON2 in disk 2. For the user, the alarm statistics for NE 3 are: count 2 + count 3 for disk 1 + count 4 for disk 2 + count 5 for PON1 under disk 2 + count 6 for PON2 under disk 2 + count 7 for ONU1 under PON2 under disk 2.
[0089] The following example illustrates the irregular full-scale statistics process using Example B. For example, User 1 and User 2 have no custom statistics rules set. User 1 has permissions for NEs 1 and 2, while User 2 has permissions for NEs 1, 2, 3, and 4. None of the NEs have previously participated in irregular incremental statistics, and the local cache contains no second alarm counts for any NE.
[0090] B1. User 1 switches from the logged-out state to the logged-in state. An irregular full statistics is performed on user 1. It is found that the network elements to which user 1 has permission are network element 1 and network element 2, neither of which has a second alarm count. The full alarm count of network element 1 and network element 2 is determined to be zero. 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.
[0091] B2, NE 1 and NE 2, as the NEs to be calculated, participate in the next round of irregular incremental statistics and have the second alarm count. Detailed description of the process is given in Example C below.
[0092] B3. User 2 switches from the logged-out state to the logged-in 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 second alarm counts. The full alarm counts of network element 1 and network element 2 are calculated based on the second alarm counts of network element 1 and network element 2 and user 2's authority over network element 1 and network element 2. The calculation method refers to the previous embodiment A. Network element 3 and network element 4 do not have second alarm counts. The full alarm counts of network element 3 and network element 4 are determined to be 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 saved to the distributed cache.
[0093] S13. Periodically obtain the network element ID of the network element with updated first alarm count.
[0094] For example, an updated network element ID is obtained every A seconds. Assuming that the current time is the B second, the network element IDs updated between the BA second and the B second are sent.
[0095] S14. For network elements with updated first alarm counts and 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, the second alarm count of the current network element is updated to the first alarm count, wherein the second user is in a logged-in state, has no custom statistical rules set, and has authority over the current network element.
[0096] In this embodiment, the fourth alarm count is the difference between the first and second alarm counts, representing the new alarm statistics for the network element after the previous round of irregular incremental statistics. Since the network element to be calculated did not participate in the previous round of irregular incremental statistics, all alarm statistics are new, 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, but only the user-authorized portion is counted.
[0097] During the irregular incremental statistics process, for each network element in the set of both the network element with updated first alarm counts and the network element to be calculated, a query is first performed to determine whether there is a user who is logged in, has no custom statistical rules set, and has permissions for the current network element. Such users are referred to as second users. The existence of a second user indicates that a fourth alarm count needs to be calculated using the first alarm count and the second alarm count to obtain new alarm statistics during the period, which is used to update the third alarm count of the second user. Since each second user may have different permissions for 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 corresponding user's current third alarm count to obtain a new third alarm count. After all second users have completed the update, the local second alarm count is updated.
[0098] The following embodiment C is used to illustrate the irregular incremental statistics process. The background setting of embodiment C follows that of embodiment B, and step B2 is first expanded.
[0099] C1. The updated NE IDs are NE 1 and NE 3. The NEs to be calculated are NE 1 and NE 2. Therefore, random incremental statistics are performed on NE 1, NE 2, and NE 3 in sequence.
[0100] 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 obtained from the distributed cache is 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 it is saved to the distributed cache. The second alarm count of network element 1 is updated to the first alarm count.
[0101] 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 based on 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. The second alarm count of network element 2 is updated to the first alarm count.
[0102] C23. For network element 3, since user 2 has not logged in yet, there is no second user, and the process ends without any operation.
[0103] 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.
[0104] C3. The updated NE IDs are NE 2 and NE 5, and the NEs to be calculated are NE 3 and NE 4. Therefore, random incremental statistics are performed on NE 2, NE 3, NE 4, and NE 5 in sequence.
[0105] 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 based on the fourth alarm count of network element 2 and the authority of user 1 for 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 the count 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 based on the fourth alarm count of network element 2 and the authority of user 2 for 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 the count is saved to the distributed cache. The second alarm count of network element 2 is updated to the first alarm count.
[0106] C42. For network element 3, the second user is user 2. The process refers to step C21.
[0107] C43. For network element 4, the second user is user 2. The process refers to step C22.
[0108] C44. For network element 5, there is no second user, and the process ends without any operation.
[0109] Therefore, in this embodiment, alarm information is continuously parsed and the alarm count of the network element is calculated. The alarm counts of the network elements that have been updated are regularly checked. The alarm counts of users in the logged-in state are counted, and slice statistics are supported. For users who do not set custom statistical rules, an irregular full-quantity statistics is performed when the user switches from the logged-out state to the logged-in state. While the user is in the logged-in state, irregular incremental statistics are 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 computational complexity is reduced by combining 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.
[0110] In particular, when a user switches from a logged-in state to a logged-out state, there is no need to perform additional processing on the second alarm count and the third alarm count. This is because in irregular full statistics, when a user switches from a logged-out state to a logged-in state, the old third alarm count will not be used, but a new third alarm count will be calculated directly. In 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.
[0111] Of course, the second alarm count and the third alarm count can also be cleared at an appropriate time as needed to free up storage space in the local cache and the distributed cache. For example, when any user transitions from a logged-in state to a logged-out state, the third alarm count of that user is cleared from the distributed cache. When any first user transitions from a logged-in state to a logged-out state, the network elements to which the user has permission are traversed. If no other first user has permission for the current network element, the second alarm count of the current network element is cleared.
[0112] Furthermore, in one embodiment, the alarm statistics method further includes:
[0113] For users who have not set custom statistical rules, the first rule is constructed based on the network element permissions owned by the user;
[0114] When performing irregular incremental statistics, the first rule is used to determine which users have the authority of the current network element, and record them as third users. The second user is obtained by taking the intersection of the first user and the third user.
[0115] Through this embodiment, the second user corresponding to the current network element can be quickly determined when performing irregular incremental statistics, thereby improving the efficiency of alarm statistics.
[0116] Specifically, when the service is started, the user's network element permissions are queried, and a 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, a list of all users who have full or partial permissions for the network element can be obtained through the network element ID.
[0117] For example, user 1 has full permissions on network element 1, and user 2 has permissions on a single disk on network element 1. Then the user list that can be found through network element 1 is: user 1, user 2.
[0118] The following describes the operations of regular full statistics and regular incremental statistics.
[0119] Furthermore, in one embodiment, the alarm statistics method further includes:
[0120] When each fourth user switches from a logged-out state to a logged-in state, a full-scale 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, the obtained alarm information is traversed, and if the current alarm information matches the custom statistical rule of the current user, and the current user has the authority of the alarm source corresponding to the current alarm information, the third alarm count of the current user is increased by one, and 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;
[0121] Regularly obtain new alarm IDs;
[0122] 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, and the third alarm count of the current user is added 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 in the logged-in state, and the custom statistical rules are set. The custom statistical rules match the current alarm information and have the corresponding alarm source permissions.
[0123] In this embodiment, regular full statistics and regular incremental statistics are performed for logged-in users who have configured custom statistical rules. These users are referred to as fourth users. The third alarm count is a user-level alarm statistic. Alarm statistics for the fourth user are calculated using regular full statistics and regular incremental statistics and saved to the distributed cache. The new third alarm count overwrites the old third alarm count, ensuring that the third alarm count in the distributed cache always represents the user's latest alarm statistics.
[0124] During the rule-based full statistics process, the user is first queried to determine which network elements they have permission to access. This does not distinguish between complete and incomplete permissions; as long as the user has permission to access a portion of an element, the element is considered to be one for which the user has permission. Alarm information for the corresponding element is then retrieved from the distributed cache based on the element ID. The obtained alarm information is analyzed piece by piece. To be counted in the third alarm count, alarm information must meet two conditions: first, the alarm information matches the user's custom statistics rule, and second, the user has permission to the corresponding alarm source.
[0125] It should be noted that the alarm source is not a necessary condition for custom statistical rules. The obtained alarm information does not distinguish whether the user's permissions are complete. Some alarm information, although meeting the custom statistical rules set by the user, such as meeting the alarm code and alarm level requirements, but the user does not have permission to the alarm source, should not be counted in the third alarm count. Therefore, it is necessary to further verify whether the user has permission to the alarm source. For example, if the alarm source of an alarm information is single disk 1 of network element 1 and meets the alarm code and alarm level requirements set by a user, but the user only has permission to single disk 2 of network element 1, then the alarm information will not be counted in the user's third alarm count.
[0126] The operation of obtaining a newly added alarm ID refers to the example of sending an updated network element ID in the previous article. 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.
[0127] During regular incremental statistics, for each newly added alarm ID, the current alarm information corresponding to the current alarm ID is first obtained from the distributed cache. A query is then made to determine whether there is a logged-in user with custom statistics rules set up that match the current alarm information and who has corresponding alarm source permissions. These users are referred to as fifth users. The existence of a fifth user indicates that the current alarm information needs to be included in the third alarm count for each fifth user, and the current third alarm count is updated by adding one.
[0128] 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:
[0129] 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;
[0130] Rule 101, alarm code: 1, 2, 3, 20, alarm level: 1, 4, alarm time: 0-3600, alarm day of the week: 0, 1;
[0131] Rule 102, alarm code: not set, alarm level: not set, alarm time: 0~7200, alarm day of the week: not set.
[0132] The description of alarm information 1 is as follows: alarm code: 1, alarm level: 1, alarm time: 0, alarm day of the week: 0, then alarm information 1 matches rules 100, 101, and 102 of user 1.
[0133] The description of alarm information 2 is as follows: alarm code: 10, alarm level: 4, alarm time: 10000, alarm day of the week: 4, then alarm information 2 does not match any of the user's rules.
[0134] Therefore, in this embodiment, it is regularly determined 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 the logged-out state to the 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.
[0135] Furthermore, in one embodiment, the alarm statistics method further includes:
[0136] 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;
[0137] The second rule is used to determine which users have the corresponding alarm source permissions, and they are recorded as the sixth user. The third rule is used to determine which users' custom rules match the current alarm information, and they are recorded as the seventh user. When performing 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 performing regular incremental statistics, the intersection of the fourth user, the sixth user, and the seventh user is taken to obtain the fifth user.
[0138] 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.
[0139] Specifically, when the service is started, the user's network element authority is queried, and a 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:
[0140] Condition 1: NE ID;
[0141] Condition 2: NE ID, single disk ID;
[0142] Condition 3: NE ID, disk ID, and port number;
[0143] Condition 4: NE ID, disk ID, PON ID;
[0144] Condition 5: NE ID, disk ID, PON ID, ONU ID;
[0145] Condition 6: NE ID, disk ID, PON ID, ONU ID, and port.
[0146] After the second rule is constructed, the user ID that meets the corresponding condition can be obtained through the above condition information.
[0147] For example, the network element permissions owned by user 1 include the full permission of network element 1 and the permission of single disk 1 of network element 2, and the network element permissions owned by user 2 include the full permission of network element 2. The conditions in the second rule are set as follows:
[0148] Condition 1: NE 1 corresponds to user 1, and NE 2 corresponds to user 2;
[0149] 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.
[0150] 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, and NE 2 + non-single disk 1 + any port corresponds to user 2.
[0151] 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, and NE 2 + non-single disk 1 + any PON ID corresponds to user 2.
[0152] 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, and NE 2 + non-single disk 1 + any PON ID + any ONU ID corresponds to user 2.
[0153] 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.
[0154] Specifically, when constructing the first and second rules, 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, and ONUID) for which the user has partial network element permissions.
[0155] For example, after logging in, a user creates a custom statistical rule on the client. Upon receiving the rule creation request, the alarm statistics system constructs the third rule. A single user can create multiple rules, and multiple users can each create their own rules. After the third rule is constructed, a list of all rules that meet the criteria and the corresponding user IDs can be obtained through the alarm information.
[0156] Continuing to refer to the above-mentioned Example D, based on Example D, User 2 defines the following statistical rules:
[0157] Rule 200, Alarm code: Not set, Alarm level: 1, 2, 3, Alarm time: Not set, Alarm day of the week: Not set.
[0158] 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.
[0159] 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.
[0160] Optionally, the rule construction and matching operations involved in this application can use the relevant algorithms in CN202311053084 to integrate statistical rules and improve rule matching efficiency.
[0161] Optionally, in the process of full statistics with rules, 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.
[0162] 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 there is no sixth user or seventh user, or if neither the sixth user nor the seventh user is 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, so as to reduce unnecessary matching calculations.
[0163] 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 to it.
[0164] 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 up 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.
[0165] Because a user can log in simultaneously through multiple clients, such as a webpage and apps on different devices, to distinguish between different logins of the same user, the client sends login and logout messages to the alarm query service with the user ID and login ID. User IDs are unique at the user level, and login IDs are unique at the login level. At the same time, a user ID and a login ID must be globally unique. The following two optional implementations illustrate how the alarm query service instance determines user login status and maintains binding relationships.
[0166] 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:
[0167] 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 has switched from the logged-out state to the logged-in state.
[0168] 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 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 login state to the logout 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.
[0169] In this embodiment, user login and logout messages are sent in a non-directional manner. Upon receiving a user login or logout message, the alarm query service instance first queries the local login list for a corresponding user ID. If so, the user is bound to the service instance, and the user can add or delete the login ID. If not, the user is not bound to the service instance, and the user ID's binding status can be retrieved by querying the distributed cache. If the user is bound to another instance, the binding relationship can be queried and the message forwarded to the bound instance. If the user is not bound to any instance, the binding relationship cannot be found.
[0170] When processing a user login message, if no binding relationship is found, the system will bind itself to the user ID and confirm that the user has switched from logged out to logged in. When processing a user logout message, the system will inevitably query the binding relationship. If the login ID is found to be empty after deleting the login ID, it means that the user has logged out of all clients. In this case, the system will unbind itself from the user ID and confirm that the user has switched from logged in to logged out.
[0171] 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 based on the user ID;
[0172] The alarm statistics method further includes:
[0173] When the alarm query service instance receives a user login message, it adds the login ID under the user ID in the local login list. If the login ID under the user ID is empty before the addition, it determines that the user is switched from the logged-out state to the logged-in state;
[0174] 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.
[0175] In this embodiment, user login messages and user logout messages are sent in a targeted manner 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 under the user ID is empty before or after adding or deleting.
[0176] As can be seen, the first implementation is a dynamic binding solution. The binding relationship between users and instances is uncertain. Each time a user logs in again, they may be bound to a different instance. This facilitates load balancing across different instances and avoids overloading individual instances. Consequently, the processing flow after messages arrive at the instance is more complex. The second implementation is a static binding solution. The binding relationship between users and instances is determined in advance based on the user ID. Each time a user logs in again, they are bound to the same instance. The processing flow after messages arrive at the instance is simple, but may cause overloading of individual instances.
[0177] 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.
[0178] User 1 logs in for the first time with a login ID of 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 queries 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 confirms that user 1 switches from the logged-out state to the logged-in state. If user 1 has not set custom statistical rules, a rule-free full statistics will be executed. If user 1 has set custom statistical rules, a rule-based full statistics will be executed.
[0179] 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 user 1 is not there. It then queries 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 user 1 is there. It then adds login 2 under user 1.
[0180] 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 user 1 is not there. It then queries 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 user 1 exists. It deletes login 2 from user 1. After the deletion, login 1 still exists under user 1.
[0181] 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 the deletion, the login ID under user 1 is empty. 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 has switched from the login state to the logout state.
[0182] 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.
[0183] The alarm parsing service is used to continuously parse 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;
[0184] 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 for 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 to the distributed cache; wherein, if the first user is in a logged-in state and no custom statistical rules are set, the second alarm count of the network element to be calculated is equal to zero;
[0185] The alarm analysis service is used to periodically send the network element ID of the network element with updated first alarm count to the alarm query service;
[0186] The alarm query service is used to perform irregular incremental statistics 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 based on 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 save it 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.
[0187] In this embodiment, the alarm parsing service continuously parses 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 and supports slice statistics. For users who do not set custom statistical rules, an irregular full-scale statistics is performed when the user switches from the logged-out state to the logged-in state. While the user is in the logged-in state, an irregular incremental statistics is performed each time an 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 computational complexity of the alarm parsing service. The computational complexity of the alarm query service is reduced by coordinating the full-scale statistics and the 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.
[0188] Furthermore, in one embodiment, the alarm query service is further configured to construct a first rule based on the network element permissions possessed by the user for the user who has not set a custom statistical rule;
[0189] 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.
[0190] 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 current user's custom statistical rule, and the current user has authority over the alarm source corresponding to the current alarm information, then add one to the current user's third alarm count, and after the traversal is completed, save the current user's third alarm count 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;
[0191] The alarm analysis service is also used to periodically send new alarm IDs to the alarm query service;
[0192] 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 the logged-in state, and a custom statistical rule is set. The custom statistical rule matches the current alarm information and has the corresponding alarm source authority.
[0193] Furthermore, in one embodiment, the alarm query service is further configured to construct a second rule based on the network element permissions possessed by the user for a user who has set a custom statistical rule, and to construct a third rule based on the custom statistical rule set by the user;
[0194] The alarm query service uses the second rule to determine which users have the corresponding alarm source permissions, recorded as the sixth user, and uses the third rule to determine which users' custom rules match the current alarm information, recorded as the seventh user. When performing 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 performing regular incremental statistics, the intersection of the fourth user, the sixth user, and the seventh user is taken to obtain the fifth user.
[0195] 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.
[0196] Furthermore, 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 both the user login message and the user logout message include the user ID and the login ID;
[0197] 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 has switched from the logged-out state to the logged-in state.
[0198] 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 login state to the logout 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.
[0199] Furthermore, 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 based on the user ID;
[0200] The alarm query service instance is further configured to, upon receiving a user login message, add the login ID 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 has switched from a logged-out state to a logged-in state.
[0201] 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 deletion, it is determined that the user has switched from the login state to the logout state.
[0202] 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 are no longer repeated here.
[0203] In a third aspect, an embodiment of the present application provides an alarm statistics device, which may be a personal computer (PC), a laptop computer, a server, or other device with data processing capabilities.
[0204] Figure 2 The figure shows a hardware structure diagram of the alarm statistics device involved in the embodiment of the present application.
[0205] 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.
[0206] The communication bus may be of any type and is used to interconnect the processor, memory, and communication interface.
[0207] Communication interfaces include input / output (I / O) interfaces, physical interfaces, and logical interfaces. These interfaces interconnect components within the alarm statistics device and connect the alarm statistics device to other devices, such as other computing devices or user devices. Physical interfaces can be Ethernet, fiber, or ATM interfaces; user devices can include displays and keyboards.
[0208] 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.
[0209] The processor may be a general-purpose processor that can invoke an alarm statistics program stored in a memory and execute the alarm statistics method provided in the embodiments 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 invoked can be referenced in the various embodiments of the alarm statistics method of the present application and will not be further described here.
[0210] Those skilled in the art will understand that Figure 2The hardware structure shown in the figure does not constitute a limitation to the present application and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.
[0211] In a fourth aspect, an embodiment of the present application also provides a readable storage medium.
[0212] 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 above-mentioned alarm statistics method are implemented.
[0213] Among them, the method implemented when the alarm statistics program is executed can refer to the various embodiments of the alarm statistics method of this application, and will not be repeated here.
[0214] It should be noted that the serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0215] 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 the "first", "second" and "third" to different types.
[0216] In the description of the embodiments of this application, the words "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 this application should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary," "for example," or "for example" is intended to present the relevant concepts in a concrete manner.
[0217] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; “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.
[0218] In some processes described in the embodiments of the present application, multiple operations or steps are included that appear in a specific order. However, it should be understood that these operations or steps may not be performed in the order in which they appear in the embodiments of the present application or may be performed in parallel. The sequence numbers of the operations are only used to distinguish between different operations, and the sequence numbers themselves do not represent any order of execution. In addition, these processes may include more or fewer operations, and these operations or steps may be performed in sequence or in parallel, and these operations or steps may be combined.
[0219] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, or the part that contributes to the existing technology, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above and includes a number of instructions for enabling a terminal device to execute the methods described in each embodiment of this application.
[0220] The above are only preferred embodiments of the present application and do not 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, characterized in that: The alarm statistics method includes: Continuously parse 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; When each first user switches from a logged-out state to a logged-in state, an unregulated full statistics is performed: 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 for 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 in a logged-in state and no custom statistical rules are set, 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 with the updated first alarm count; For network elements with updated first alarm counts and network elements to be calculated, irregular incremental statistics are performed in sequence: 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 based on 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.
2. The alarm statistics method according to claim 1, wherein: 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 owned by the user; When performing irregular incremental statistics, the first rule is used to determine which users have the authority of the current network element, and record them as third users. The second user is obtained by taking the intersection of the first user and the third user.
3. The alarm statistics method according to claim 1, wherein: The alarm statistics method further includes: When each fourth user switches from a logged-out state to a logged-in state, a full-scale 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, the obtained alarm information is traversed, and if the current alarm information matches the custom statistical rule of the current user, and the current user has the authority of the alarm source corresponding to the current alarm information, the third alarm count of the current user is increased by one, and 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, and the third alarm count of the current user is added 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 in the logged-in state, and the custom statistical rules are set. The custom statistical rules match the current alarm information and have the corresponding alarm source permissions.
4. The alarm statistics method according to claim 3, wherein: 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 permissions, and they are recorded as the sixth user. The third rule is used to determine which users' custom rules match the current alarm information, and they are recorded as the seventh user. When performing 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 performing 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, characterized in that: Count the user's third alarm count 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, characterized in that: The user login message and user logout message are sent by the client to one of the alarm query service instances. The user login message and user logout message both include the user ID and login ID. 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 has 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 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 login state to the logout 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, characterized in that: User login messages and user logout messages are sent by the client to the bound alarm query service instance. Both user login messages and user logout messages include the user ID and login ID. The binding relationship is determined based on the user ID. The alarm statistics method further includes: When the alarm query service instance receives a user login message, it adds the login ID under the user ID in the local login list. If the login ID under the user ID is empty before the addition, it determines 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, characterized in that: The alarm statistics system includes alarm analysis service, distributed cache and alarm query service; The alarm parsing service is used to continuously parse 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 for 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 to the distributed cache; wherein, if the first user is in a logged-in state and no custom statistical rules are set, 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 network element with updated first alarm count to the alarm query service; The alarm query service is used to perform irregular incremental statistics 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 based on 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 save it 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, characterized in that: The alarm statistics device includes 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, 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
Heterogeneous rule matching method and device
CN117235539A
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