Methods, devices, equipment, and media for transmitting alarm information in embedded environments
By maintaining an active alarm list and a recently deleted alarm list on the master node, and combining a subscription reporting and active query mechanism, the problem of alarm information acquisition occupying communication resources in embedded systems is solved, and efficient alarm information transmission is achieved.
Patent Information
- Application Number
- CN202111649817.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-29
- Publication Date
- 2026-03-06
- Estimated Expiration
- 2041-12-29
AI Technical Summary
In existing technologies, the methods for obtaining alarm information in embedded systems result in excessive consumption of communication resources between nodes, affecting normal data communication. Furthermore, there is a high degree of redundancy in alarm querying and reporting, leading to resource waste and delays.
The master node maintains an active alarm list and a recently deleted alarm list. By combining a subscription reporting mechanism and an active query mechanism, alarm information is managed through sequence numbers to reduce missed and duplicate reporting and optimize the use of communication resources.
It effectively reduces the occupation of communication resources, avoids duplicate reporting and missed reporting of alarm information, and improves the efficiency and accuracy of data communication.
Smart Images

Figure CN116414821B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of embedded technology, and in particular to a method, apparatus, device and medium for transmitting alarm information in an embedded environment. Background Technology
[0002] The network structure of an embedded system typically consists of a master node and multiple child nodes mounted on an unreliable communication link. The child nodes perform specific functions, while the master node collects information from the child nodes, synthesizes it, and outputs it externally. Child nodes can automatically generate / deactivate alarms, and the master node needs to collect and analyze all active and historical alarms from all child nodes. Additionally, a large amount of routine data acquisition and control data needs to be transmitted between the nodes.
[0003] In existing technologies, alarm information is obtained by the master node sequentially polling each child node for the current active alarms, comparing them with the responses received in the previous poll, and recording historical alarms based on the comparison results.
[0004] However, the existing method of obtaining alarm information results in a large number of repeated alarm queries and alarm reports, which consumes a lot of communication resources and affects normal data communication between nodes. Summary of the Invention
[0005] This application provides a method, apparatus, device, and medium for transmitting alarm information in an embedded environment, which solves the problem that the acquisition of alarm information between nodes affects the normal data communication of nodes.
[0006] In a first aspect, embodiments of this application provide a method for transmitting alarm information in an embedded environment, applied to a master node, the method comprising:
[0007] Obtain alarm information and the sequence number of the alarm information from the child node. The alarm information includes an indication of an alarm generation event or an alarm clearance event.
[0008] Based on the alarm information, the sequence number, and the active alarm list, it is determined whether there are any missed alarms; wherein, the active alarm list is used to store alarms that have not yet been cleared and their sequence numbers;
[0009] If there are any missed alarms, the missed alarms and the alarm information will be reported to the northbound device.
[0010] In one possible design of the first aspect, the method further includes:
[0011] If there are no missed alarms and the alarm information is an alarm clearance event, then based on the sequence number and the recently deleted alarm list, it is determined whether the alarm information has been reported. The recently deleted alarm list is used to store the sequence numbers of alarms deleted within a preset time period before the current time.
[0012] If the alarm information has already been reported, then delete the alarm information;
[0013] If the alarm information is not reported, the alarm information is reported to the northbound device, the alarm corresponding to the serial number in the active alarm list is deleted according to the serial number, and the serial number is updated in the recently deleted alarm list.
[0014] In another possible design of the first aspect, determining whether the alarm information has been reported based on the sequence number and the recently deleted alarm list includes:
[0015] If the sequence number of the alarm information is included in the recently deleted alarm list, then it is determined that the alarm information has been reported.
[0016] If the sequence number of the alarm information is not included in the recently deleted alarm list, it is determined that the alarm information was not reported.
[0017] In another possible design of the first aspect, the method further includes:
[0018] If there are no missed alarms and the alarm information is an alarm generation event, then the alarm information is reported to the northbound device, and the alarm generation corresponding to the sequence number is added to the active alarm list according to the sequence number.
[0019] In another possible design of the first aspect, determining whether there is a missed alarm based on the alarm information, the sequence number, and the active alarm list includes:
[0020] If the alarm information is an alarm that generates an alarm event, and the last alarm stored in the active alarm list is also an alarm that generates an alarm event, and the sequence number of the alarm information is different from the sequence number of the last alarm stored in the active alarm list, then it is determined that the alarm cancellation event of the last alarm stored in the active alarm list was missed.
[0021] Accordingly, the reported missed alarms and alarm information to the northbound device include:
[0022] Report the alarm clearing event of the last alarm stored in the active alarm list to the northbound device;
[0023] The alarm information is reported to the northbound device.
[0024] In another possible design of the first aspect, determining whether there is a missed alarm based on the alarm information, the sequence number, and the active alarm list includes:
[0025] If the alarm information is an alarm cancellation event, the last alarm stored in the active alarm list is an alarm generation event, and the sequence number of the alarm information is different from the sequence number of the last alarm stored in the active alarm list, then it is determined that the alarm cancellation event of the last alarm stored in the active alarm list and the alarm generation event corresponding to the sequence number of the alarm information have been missed.
[0026] Accordingly, the reported missed alarms and alarm information to the northbound device include:
[0027] Report the alarm clearing event of the last alarm stored in the active alarm list to the northbound device;
[0028] The alarm generation event corresponding to the sequence number of the alarm information is reported to the northbound device;
[0029] The alarm information is reported to the northbound device.
[0030] In another possible design of the first aspect, determining whether there is a missed alarm based on the alarm information, the sequence number, and the active alarm list includes:
[0031] If the alarm information is an alarm clearing event alarm, and the last alarm stored in the active alarm list is also an alarm clearing event alarm, then it is determined that the alarm generation event corresponding to the sequence number of the alarm information was missed.
[0032] Accordingly, the reported missed alarms and alarm information to the northbound device include:
[0033] The alarm generation event corresponding to the sequence number of the alarm information is reported to the northbound device;
[0034] The alarm information is reported to the northbound device.
[0035] In another possible design of the first aspect, obtaining the alarm information and the sequence number of the alarm information from the child node includes:
[0036] Receive the alarm information and the sequence number of the alarm information actively reported by the child node;
[0037] or,
[0038] The alarm information and the sequence number of the alarm information are retrieved from the child node according to a preset period.
[0039] Secondly, embodiments of this application provide a method for transmitting alarm information in an embedded environment, applied to a child node, the method comprising:
[0040] According to the predefined alarm sequence numbering rules, obtain the alarm information and the sequence number of the alarm information. The alarm sequence numbering rules stipulate that the generation event and the cancellation event of the same alarm use the same sequence number, and different alarms have different sequence numbers.
[0041] The alarm information and its sequence number are reported to the master node.
[0042] Thirdly, embodiments of this application provide an alarm information transmission device in an embedded environment, comprising:
[0043] The acquisition module is used to acquire alarm information and the sequence number of the alarm information from the child node. The alarm information includes an indication of an alarm generation event or an alarm clearance event.
[0044] The determination module is used to determine whether there are any missed alarms based on the alarm information, the sequence number, and the active alarm list; wherein, the active alarm list is used to store alarms that have not yet been cleared and their sequence numbers;
[0045] The reporting module is used to report the missed alarms and the alarm information to the northbound device if there are any missed alarms.
[0046] Fourthly, embodiments of this application provide an alarm information transmission device in an embedded environment, comprising:
[0047] The definition module is used to obtain alarm information and the sequence number of the alarm information according to a predefined alarm sequence numbering rule. The alarm sequence numbering rule stipulates that the generation event and the cancellation event of the same alarm use the same sequence number, and different alarms have different sequence numbers.
[0048] The transmission module is used to report the alarm information and the sequence number of the alarm information to the master node.
[0049] Fifthly, embodiments of this application provide an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0050] The memory stores computer-executed instructions;
[0051] The processor executes computer execution instructions stored in the memory to implement the above-described method.
[0052] Sixthly, embodiments of this application provide a readable storage medium storing computer instructions that, when executed by a processor, are used to implement the above-described method.
[0053] In a seventh aspect, embodiments of this application provide a program product including computer instructions that, when executed by a processor, implement the method described above.
[0054] The alarm information transmission method, apparatus, device, and medium provided in this application embodiment for embedded environment, by maintaining an active alarm list on the master node and establishing corresponding sequence numbers for alarm information of child nodes, can determine whether there are any missed alarms in child nodes through the active alarm list on the master node, prevent duplicate reporting, reduce resource occupation on child nodes, and avoid alarm reporting consuming too much communication resources and affecting normal data communication. Attached Figure Description
[0055] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application;
[0056] Figure 1 A schematic diagram illustrating a scenario for the method of transmitting alarm information in an embedded environment provided in an embodiment of this application;
[0057] Figure 2 A flowchart illustrating an embodiment of the method for transmitting alarm information in an embedded environment provided in this application.
[0058] Figure 3 A flowchart illustrating a second embodiment of the method for transmitting alarm information in an embedded environment provided in this application.
[0059] Figure 4 A schematic diagram of the structure of an alarm information transmission system in an embedded environment provided in this application embodiment;
[0060] Figure 5 A flowchart illustrating Embodiment 3 of the method for transmitting alarm information in an embedded environment provided in this application.
[0061] Figure 6 A schematic diagram of the structure of an embodiment of the alarm information transmission device in an embedded environment provided in this application;
[0062] Figure 7 A schematic diagram of the structure of a second embodiment of the alarm information transmission device in an embedded environment provided in this application;
[0063] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0064] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0065] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0066] Figure 1 This is a schematic diagram illustrating a scenario for the method of transmitting alarm information in an embedded environment provided in an embodiment of this application, such as... Figure 1 As shown, this method can be applied to management device 10. Management device 10 includes a master node, and the first functional device 11, second functional device 12, third functional device 13, and fourth functional device 14 each include child nodes. For example, management device 10 can connect to the first functional device 11, second functional device 12, third functional device 13, and fourth functional device 14 via a Controller Area Network (CAN) bus to establish data communication for periodically collecting data from the functional devices, issuing control commands, and statistically analyzing alarm statuses. For example, the CAN bus baud rate can be 125Kbps, and data synchronization can also be performed between the functional devices.
[0067] In practical applications, each child node automatically generates / clears alarms, while the master node needs to collect and track all active and historical alarms from all child nodes. A relatively straightforward existing method involves the master node sequentially polling each child node for its current active alarms and comparing them with the responses from the previous query, recording historical alarms based on the comparison results. However, this method has three main problems: First, when there are many alarms from each child node, a large amount of data is generated, putting significant pressure on the CAN bus bandwidth and node processing resources. Furthermore, if alarms persist, repeated queries will yield the same result, wasting communication resources. Second, if a child node alarm is generated and cleared between two queries from the master node, the master node will not be aware of the alarm. Increasing the master node's query frequency increases CAN bus usage, affecting other data communication. Third, the time it takes for the master node to detect an alarm depends on the query cycle, resulting in a delay between the alarm's occurrence and the actual situation, which can affect the assessment of the system's actual condition.
[0068] To address the aforementioned issues, this application provides a method for transmitting alarm information in an embedded environment. By maintaining a queue of currently active alarm states and a list of recently deleted alarm summary information on the master node, the method combines periodic query refresh and subscription reporting mechanisms to maintain alarm states by utilizing changes in alarm sequence numbers in the list of recently deleted alarm information. The asynchronous subscription reporting mechanism reduces bandwidth pressure during most normal communication times. The subscription reporting mechanism and active query check work together to compensate for the omission of alarm states caused by frame loss in the reporting mechanism in a few cases.
[0069] The technical solution of this application will now be described in detail through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0070] Figure 2 This is a flowchart illustrating an embodiment of a method for transmitting alarm information in an embedded environment, provided in this application. This method can be applied to the master node in the network structure of an embedded system. Figure 2 As shown, the method may specifically include the following steps:
[0071] S201. Obtain alarm information and alarm information sequence number from child nodes.
[0072] The alarm information includes indications of either an alarm generation event or an alarm clearance event. For example, when an alarm event occurs on a child node, it can send the alarm generation event and its corresponding sequence number to the master node. When an alarm clearance event occurs on a child node, it can send the alarm clearance event and its corresponding sequence number to the master node. The alarm generation event indicates that an alarm has been generated on the child node, and the alarm clearance event indicates that the alarm has been cleared.
[0073] In this embodiment, based on the subscription reporting mechanism, child nodes should send the corresponding alarm details and sequence number to the master node whenever an alarm generation event or alarm clearance event occurs. However, when the link is unstable, missed reports may occur, meaning that child nodes may not report alarm generation events or alarm clearance events to the master node. For the same alarm (including alarm generation events and alarm clearance events), a child node may miss reporting the alarm generation event but report the alarm clearance event normally; it may also report the alarm generation event normally but miss reporting the alarm clearance event; or it may miss reporting both.
[0074] For example, the master node can query the child nodes sequentially through the active query mechanism after each active query cycle. The active query cycle can be preset and is usually long to avoid causing traffic pressure and to avoid the master device repeatedly reporting to the northbound device.
[0075] S202. Based on the alarm information, serial number, and active alarm list, determine whether there are any missed alarms.
[0076] The active alarm list stores alarms and their sequence numbers that have not yet been cleared. For example, alarm events and their corresponding sequence numbers reported by child nodes before the current time can be stored in the active alarm list. If alarm information is obtained at the current time, the stored events and sequence numbers can be used to search for any missed alarms.
[0077] In this embodiment, there are three situations where the child node has missed alarms: the first is that only the alarm generation event is missed, the second is that only the alarm cancellation event is missed, and the third is that both the alarm generation event and the alarm cancellation event are missed.
[0078] For example, when the master node receives alarm information reported by the child node, such as the child node reporting an alarm generation event and its corresponding sequence number, the master node will store the alarm generation event and its corresponding sequence number in the active alarm list.
[0079] Typically, the alarm generation event occurs first, followed by the alarm clearance event. That is, if a child node misses reporting the alarm generation event but reports the alarm clearance time correctly, the master node can detect this through the active alarm list. If a child node reports the alarm generation event correctly but misses reporting the alarm clearance time, the master node records the alarm generation event and sequence number in the active alarm list. The master node then periodically checks the list using an active query mechanism to determine if the alarm clearance event was missed. If both alarm generation and clearance events are missed by the child node, an active query period can be set. If no alarm reports are received from the child node within this query period, the master node will trigger the active query mechanism to detect any missed alarms.
[0080] S203. If there are any missed alarms, report the missed alarms and alarm information to the northbound device.
[0081] In this embodiment, the northbound device refers to the device above the master node. For example, if the management device contains the master node, the northbound device refers to the device above the management device.
[0082] When reporting missed alarms and alarm information to the northbound device, the reported alarms and alarm information may differ depending on whether the sub-nodes missed reporting them. For example, if a sub-node missed reporting the alarm generation event and the corresponding sequence number, the master node will report the missed alarm generation event and the corresponding sequence number to the northbound device. Similarly, if a sub-node missed reporting the alarm clearance time and the corresponding sequence number, the master node will report the missed alarm clearance time and the corresponding sequence number to the northbound device.
[0083] In this embodiment, when the master node reports alarms and alerts, it needs to investigate them. Alarms and alerts that have already been reported to the northbound device will not be reported to the northbound device again.
[0084] This application embodiment maintains an active alarm list on the master node. When the child node reports through the subscription reporting mechanism, if the link is unstable and a missed report occurs, the missed report can be detected in a timely manner directly based on the active alarm list maintained on the master node. This solves the problem in the prior art that it is necessary to maintain a cache queue for reporting alarms on the child node and cooperate with an acknowledgment and retransmission mechanism to ensure that there are no frame drops in the transmission between the child node and the master node. For child nodes with limited memory, maintaining an additional cache queue would affect resource consumption.
[0085] In some embodiments, the above method may further include the following steps:
[0086] If there are no missed alarms and the alarm information is an alarm clearing event, then determine whether the alarm information has been reported based on the sequence number and the recently deleted alarm list;
[0087] If the alarm information has already been reported, delete the alarm information;
[0088] If the alarm information is not reported, the alarm information is reported to the northbound device, the alarm corresponding to the serial number in the active alarm list is deleted according to the serial number, and the serial number is updated in the recently deleted alarm list.
[0089] The recently deleted alarm list stores the sequence numbers of alarms deleted within a preset time period prior to the current moment. For example, the recently deleted alarm list also stores the disappearance time of the deleted alarms.
[0090] In this embodiment, an expiration time can be set for the sequence numbers of alarms stored in the recently deleted alarm list. The expiration time can be an active query cycle; that is, after one active query cycle, the sequence numbers of alarms stored in the previous active query cycle will expire. The active query cycle refers to the period set by the master node actively querying the child nodes through the active query mechanism. That is, after each active query cycle, the master node will actively query each child node. The purpose of setting the active query cycle is mainly to avoid the situation where child nodes fail to report both alarm generation and alarm clearance events. Specifically, if after one active query cycle, a child node neither reports an alarm generation event nor an alarm clearance event, the master node will actively query the child node for alarm events through the active query mechanism.
[0091] In this embodiment, when there is no missed reporting (i.e., the child node has already successfully reported the alarm generation event for the alarm information), the alarm information needs to be reported to the northbound device when the child node uploads the alarm clearance time for the alarm information. During the upload to the northbound device, a check is required to avoid duplicate uploads of the alarm information.
[0092] Once the alarm information is uploaded to the northbound device, the alarm information completes the entire process (from generation to elimination). At this point, the alarm corresponding to the serial number recorded in the active alarm list needs to be deleted and added to the recently deleted alarm list.
[0093] This application embodiment sets up an active alarm list and a recently deleted alarm list. When a child node reports alarm information normally (i.e., no missed alarms occur), the master node updates the active alarm list and the recently deleted alarm list after uploading the alarm information to the northbound device. On the one hand, the active alarm list can be used to verify whether the child node has missed alarms. On the other hand, the recently deleted alarm list can be used to detect whether the same alarm information is uploaded to the northbound device repeatedly, avoiding duplicate uploads and saving communication resources.
[0094] In some embodiments, the step of "determining whether alarm information has been reported based on the serial number and the recently deleted alarm list" can be implemented through the following steps:
[0095] If the serial number containing the alarm information is recently deleted from the alarm list, it is confirmed that the alarm information has been reported.
[0096] If the serial number of the alarm is not included in the recently deleted alarm list, it is determined that the alarm was not reported.
[0097] In this embodiment, after each alarm disappearance event reported by the master node to the northbound device, the alarm and its sequence number are deleted from the active alarm list, and simultaneously stored in the recently deleted alarm list. The recently deleted alarm list has an expiration time; after this expiration time, the alarms and sequence numbers stored in the previous period expire. Before the master node reports an alarm clearance event again, it needs to query this recently deleted alarm list to avoid repeatedly reporting the same alarm information to the northbound device.
[0098] Among them, the expiration time is the active query cycle of the master node.
[0099] This application embodiment stores the alarms and sequence numbers deleted from the alarm list for each activity by setting a recently deleted alarm list, and can set the expiration time as an active query cycle. It can realize the combination of the sub-node subscription reporting mechanism and the master node active query mechanism, so as to achieve the purpose of accurately collecting alarm information of each sub-node.
[0100] In some embodiments, the above method further includes the following steps:
[0101] If there are no missed alarms and the alarm information is an alarm that generates an event, then the alarm information is reported to the northbound device, and the alarm corresponding to the serial number is added to the active alarm list according to the serial number.
[0102] In this embodiment, the sequence number of the alarm generation event and the alarm clearance time can be the same. If the child node has not uploaded the alarm generation event before the current time, then the current reported alarm generation event is not a missed report. At this time, the master node normally reports the alarm information of the alarm generation event to the northbound device and maintains its sequence number in the active alarm list to facilitate subsequent determination of whether the alarm clearance event of the alarm information has been missed.
[0103] For example, if a child node reported an alarm event before the current time and then reports another alarm event, it means that the alarm cancellation time corresponding to the previous alarm event was missed.
[0104] This application embodiment sets up an active alarm list on the master node and adds the alarms corresponding to the sequence numbers of alarm events normally reported by the child nodes to the active alarm list. This enables the master node to determine whether there are any missed alarms in subsequent child nodes, solving the problem in the prior art that the child nodes need to maintain an alarm reporting cache queue, which occupies the child node's memory resources.
[0105] In some embodiments, the above method further includes the following steps:
[0106] If the alarm information is an alarm that generates an alarm event, and the last alarm stored in the active alarm list is also an alarm that generates an alarm event, and the sequence number of the alarm information is different from the sequence number of the last alarm stored in the active alarm list, then it is determined that the alarm clearing event of the last alarm stored in the active alarm list was missed.
[0107] Correspondingly, report any missed alarms and alarm information to the northbound device, including:
[0108] Report the alarm clearing event of the last alarm stored in the active alarm list to the northbound device;
[0109] Report the alarm information to the device to the north.
[0110] In this embodiment, if a child node previously reported an alarm event and then reported another alarm event, it means that the child node missed reporting the alarm disappearance event corresponding to the previous alarm event. The master node needs to report the missed alarm disappearance event to the northbound device, and then report the other alarm event to the northbound device.
[0111] At the same time, when the master node reports another alarm event to the northbound device, it will also update the active alarm list, that is, add another alarm event to the active alarm list.
[0112] This application embodiment determines whether there is a missed alarm cancellation event in the child node by detecting whether the last alarm in the active alarm list is the same as the alarm obtained at the current time. This avoids the problem of the child node's memory resources being occupied by the prior art, which requires the child node to maintain a cache queue for reporting alarms and cooperate with an acknowledgment and retransmission mechanism to ensure that there are no missed alarms in the transmission with the master node.
[0113] In some embodiments, step S202 above can also be implemented through the following steps:
[0114] If the alarm information is an alarm clearing event, and the last alarm stored in the active alarm list is an alarm generation event, and the sequence number of the alarm information is different from the sequence number of the last alarm stored in the active alarm list, then it is determined that the alarm clearing event of the last alarm stored in the active alarm list and the alarm generation event corresponding to the sequence number of the alarm information have been missed.
[0115] Correspondingly, report any missed alarms and alarm information to the northbound device, including:
[0116] Report the alarm clearing event of the last alarm stored in the active alarm list to the northbound device;
[0117] The alarm event corresponding to the serial number that reports alarm information to the device to the north is generated.
[0118] Report the alarm information to the device to the north.
[0119] In this embodiment, if a child node previously reported an alarm event to the master node, the master node will record it in the active alarm list as the last alarm event. If the current event is an alarm clearing event, the sequence number of the last alarm event needs to be compared with the sequence number of the current alarm clearing event. If the sequence number changes, it means that the alarm clearing event corresponding to the last alarm event and the alarm event corresponding to the current alarm clearing event were both missed. The master node needs to report the alarm clearing event corresponding to the last alarm event, the alarm event corresponding to the current alarm clearing event, and the alarm clearing event to the northbound device.
[0120] This application embodiment determines whether there are any alarm disappearance events or missed alarm generation events in the child node by detecting whether the sequence number of the last alarm in the active alarm list is the same as that of the alarm obtained at the current time. This avoids the problem of the child node's memory resources being occupied by maintaining a cache queue for reporting alarms on the child node and cooperating with an acknowledgment and retransmission mechanism to ensure that there are no missed alarms in the transmission between the child node and the master node, which is a problem in the prior art.
[0121] In some embodiments, step S202 above can also be implemented through the following steps:
[0122] If the alarm information is an alarm clearing event, and the last alarm stored in the active alarm list is also an alarm clearing event, then it is determined that the alarm generation event corresponding to the sequence number of the alarm information was missed.
[0123] Correspondingly, report any missed alarms and alarm information to the northbound device, including:
[0124] The alarm event corresponding to the serial number that reports alarm information to the device to the north is generated.
[0125] Report the alarm information to the device to the north.
[0126] In this embodiment, if the last alarm stored in the active alarm list is an alarm clearing event, and an alarm clearing event reported by a child node is obtained at the current moment, it can be determined that the child node missed reporting the alarm generation event corresponding to the alarm clearing event reported at the current moment. Accordingly, the master node needs to report the missed alarm generation event to the northbound device, and also needs to report the alarm clearing event at the current moment to the northbound device.
[0127] This application embodiment detects the last alarm in the active alarm list. When the last alarm is an alarm clearance event and the alarm clearance event is obtained from the child node at the current time, it can be determined that there is a case of missed alarm generation event in the child node. This avoids the problem of the child node's memory resources being occupied by the prior art, which requires the child node to maintain a cache queue for reporting alarms and cooperate with an acknowledgment and retransmission mechanism to ensure that there are no missed alarms in the transmission with the master node.
[0128] In some embodiments, step S201 above can be implemented through the following steps:
[0129] Receive alarm information and alarm sequence number actively reported by child nodes;
[0130] or,
[0131] Alarm information and its sequence number are retrieved from child nodes according to a preset cycle.
[0132] In this embodiment, the subscription reporting mechanism means that child nodes should proactively report alarm information, such as alarm generation events and alarm clearance events. Due to link instability, child nodes may miss alarms. In such cases, an active query mechanism can be used, where the master node proactively queries the child nodes for alarm information and sequence numbers at preset intervals.
[0133] The subscription reporting mechanism and the active query mechanism can be implemented in parallel. The active query mechanism can be triggered passively, for example, when the child node has not reported any alarm information within a preset period, the active query mechanism is triggered.
[0134] For example, the preset period is the aforementioned active query period.
[0135] This application embodiment combines a subscription reporting mechanism and an active query mechanism to accurately collect alarm information from each sub-node, improving the accuracy of alarm information acquisition and avoiding missed alarms due to sub-nodes.
[0136] Figure 3 This is a flowchart illustrating a second embodiment of the alarm information transmission method in an embedded environment provided by this application. This method can be applied to functional devices containing child nodes. Figure 3 As shown, the method may specifically include the following steps:
[0137] S301. Obtain the alarm information and the alarm information sequence number according to the predefined alarm sequence number numbering rules;
[0138] S302. Report the alarm information and its sequence number to the master node.
[0139] The alarm sequence numbering rules stipulate that the generation and elimination events of the same alarm use the same sequence number, and different alarms have different sequence numbers.
[0140] In this embodiment, the child node reports alarm information and alarm sequence numbers to the master node based on the subscription reporting mechanism. However, due to potential instability in the communication link between the child node and the master node, alarm information may be missed by the child node, such as missing alarm generation events and / or alarm clearance events.
[0141] Figure 4 This is a schematic diagram of the structure of an alarm information transmission system in an embedded environment provided in an embodiment of this application, as shown below. Figure 4 As shown, after the acquisition component 41 connects to the child node 40, the alarm management component 42 can obtain the alarm information reported by the child node 40 to the acquisition component 41. At the same time, the acquisition component 41 can also actively collect alarm information from the child node 40 through an active query mechanism. The alarm management component 42 will maintain the alarm information reported by the child node 40 and the actively collected alarm information in two lists: one is the recently deleted alarm list 43, and the other is the historical alarm list 44.
[0142] Figure 5 A flowchart illustrating Embodiment 3 of the method for transmitting alarm information in an embedded environment provided in this application is shown below. Figure 5 As shown, the method may include the following steps:
[0143] S501. Clear expired data from the recently deleted alarm list;
[0144] S502. Determine whether alarm information actively reported by child nodes has been received within a certain period of time;
[0145] S503, Actively query the alarm information of child nodes;
[0146] S504. Determine if an alarm has been generated;
[0147] S505. Determine whether any alarms are stored in the active alarm list;
[0148] S506. Determine whether an alarm has been reported.
[0149] S507. Determine if the alarm exists in the recently deleted alarm list;
[0150] S508: Report alarm clearance and update the list of recently deleted alarms;
[0151] S509. Determine if any alarms have been generated in the current active alarm list;
[0152] S510, An alarm is reported and the active alarm list is updated;
[0153] S511, Ignore;
[0154] S512, End.
[0155] In this embodiment, each child node can define a sequence number alarmSerialNo = 0 and a list during initialization. The master node maintains an active alarm list and a recently deleted alarm list. When a child node generates an alarm, it increments alarmSerialNo and sends alarm details and the current alarmSerialNo to the master node. When a child node clears an alarm, it also sends alarm details to the master node.
[0156] When the master node receives an alarm event, it checks if the alarm has been reported before and adds it to the active alarm list. When the master node receives an alarm clearing event, if the alarm is in the active alarm list, it removes it from the active alarm list and adds it to the historical alarm list. If the alarm is not in the active alarm list and is not in the recently deleted alarm list, it directly adds it to the recently deleted alarm list and reports it to the northbound device.
[0157] The master node periodically queries the sequence number of the child nodes. If the sequence number of the child node is inconsistent with that stored locally on the master node, it queries the list of child nodes and then compares the list of child nodes with the list of active alarms. Missing parts indicate that the alarm has been cleared, so they are removed and added to the historical alarm list. Excess parts indicate that the alarm is new and are added to the active alarm list.
[0158] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.
[0159] Figure 6This is a schematic diagram of a first embodiment of an alarm information transmission device in an embedded environment provided by this application. This transmission device can be integrated into a management device containing a master node, or it can be implemented independently of the management device while cooperating with it. Figure 6 As shown, the transmission device includes an acquisition module 61, a determination module 62, and a reporting module 63.
[0160] Specifically, the acquisition module 61 is used to acquire alarm information and alarm sequence numbers from child nodes. The determination module 62 is used to determine whether there are any missed alarms based on the alarm information, sequence numbers, and active alarm list. The reporting module 63 is used to report the missed alarms and alarm information to the northbound device if there are any missed alarms.
[0161] The alarm information includes instructions indicating whether an alarm has been generated or cleared, and the active alarm list stores alarms and their sequence numbers that have not yet been cleared.
[0162] In some embodiments, the above apparatus further includes a reporting detection module, configured to:
[0163] If there are no missed alarms and the alarm information is an alarm clearing event, then determine whether the alarm information has been reported based on the sequence number and the recently deleted alarm list;
[0164] If the alarm information has already been reported, delete the alarm information;
[0165] If the alarm information is not reported, the alarm information is reported to the northbound device, the alarm corresponding to the serial number in the active alarm list is deleted according to the serial number, and the serial number is updated in the recently deleted alarm list.
[0166] The recently deleted alarm list stores the sequence numbers of alarms deleted within a preset time period prior to the current moment.
[0167] Optionally, in some embodiments, the above-described apparatus further includes a reporting and determination module, used for:
[0168] If the serial number containing the alarm information is recently deleted from the alarm list, it is confirmed that the alarm information has been reported.
[0169] If the serial number of the alarm is not included in the recently deleted alarm list, it is determined that the alarm was not reported.
[0170] In some embodiments, the above-described apparatus further includes an adding module for:
[0171] If there are no missed alarms and the alarm information is an alarm that generates an event, then the alarm information is reported to the northbound device, and the alarm corresponding to the serial number is added to the active alarm list according to the serial number.
[0172] In some embodiments, the above-described determining module can be specifically used for:
[0173] If the alarm information is an alarm that generates an alarm event, and the last alarm stored in the active alarm list is also an alarm that generates an alarm event, and the sequence number of the alarm information is different from the sequence number of the last alarm stored in the active alarm list, then it is determined that the alarm clearing event of the last alarm stored in the active alarm list was missed.
[0174] Correspondingly, the aforementioned reporting module can be specifically used for:
[0175] Report the alarm clearing event of the last alarm stored in the active alarm list to the northbound device;
[0176] Report the alarm information to the device to the north.
[0177] Optionally, in some embodiments, the above-described determining module may specifically be used for:
[0178] If the alarm information is an alarm clearing event, and the last alarm stored in the active alarm list is an alarm generation event, and the sequence number of the alarm information is different from the sequence number of the last alarm stored in the active alarm list, then it is determined that the alarm clearing event of the last alarm stored in the active alarm list and the alarm generation event corresponding to the sequence number of the alarm information were missed.
[0179] Correspondingly, the aforementioned reporting module can be specifically used for:
[0180] Report the alarm clearing event of the last alarm stored in the active alarm list to the northbound device;
[0181] The alarm event corresponding to the serial number that reports alarm information to the device to the north is generated.
[0182] Report the alarm information to the device to the north.
[0183] Optionally, in some embodiments, the above-described determining module may specifically be used for:
[0184] If the alarm information is an alarm clearing event, and the last alarm stored in the active alarm list is also an alarm clearing event, then it is determined that the alarm generation event corresponding to the sequence number of the alarm information was missed.
[0185] Correspondingly, the aforementioned reporting module can be specifically used for:
[0186] The alarm event corresponding to the serial number that reports alarm information to the device to the north is generated.
[0187] Report the alarm information to the device to the north.
[0188] In some embodiments, the above-mentioned acquisition module can be specifically used for:
[0189] Receive alarm information and alarm sequence number actively reported by child nodes;
[0190] or,
[0191] Alarm information and its sequence number are retrieved from child nodes according to a preset cycle.
[0192] Figure 7 This is a schematic diagram of a second embodiment of the alarm information transmission device in an embedded environment provided in this application. This transmission device can be integrated into a functional device containing child nodes, or it can be implemented independently of the functional device while cooperating with it to achieve this solution. Figure 7 As shown, the transmission device includes a definition module 71 and a transmission module 72.
[0193] The definition module 71 is used to obtain alarm information and its sequence number according to a predefined alarm sequence numbering rule. The transmission module is used to report the alarm information and its sequence number to the master node.
[0194] The alarm sequence numbering rules stipulate that the generation and clearing events of the same alarm use the same sequence number, while different alarms have different sequence numbers.
[0195] The apparatus provided in this application embodiment can be used to execute the methods in the above embodiments, and its implementation principle and technical effect are similar, so they will not be described again here.
[0196] It should be noted that the division of the various modules in the above device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, these modules can be implemented entirely in software via processing element calls; they can be fully implemented in hardware; or some modules can be implemented by processing element calls to software, while others are implemented in hardware. For example, the acquisition module can be a separate processing element, or it can be integrated into a chip in the above device. Alternatively, it can be stored as program code in the memory of the above device, and its function can be called and executed by a processing element. The implementation of other modules is similar. Moreover, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed through integrated logic circuits in the hardware of the processor element or through software instructions.
[0197] Figure 8This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 8 As shown, the electronic device 80 includes at least one processor 81, a memory 82, a bus 83, and a communication interface 84.
[0198] The processor 81, communication interface 84, and memory 82 communicate with each other via bus 83.
[0199] Communication interface 84 is used for communicating with other devices. This communication interface includes a communication interface for data transmission. Processor 81 is used to execute computer instructions, specifically the relevant steps in the methods described in the above embodiments.
[0200] The processor may be a central processing unit. Electronic devices include one or more processors, which can be of the same type, such as one or more CPUs; or they can be of different types, such as one or more CPUs and one or more ASICs.
[0201] Memory 82 is used to store computer instructions. Memory may include high-speed RAM, and may also include non-volatile memory, such as at least one disk drive.
[0202] This embodiment also provides a readable storage medium storing computer instructions. When at least one processor of the electronic device executes the computer instructions, the electronic device executes the alarm information transmission method in the embedded environment provided by the various embodiments described above.
[0203] This embodiment also provides a program product including computer instructions stored in a readable storage medium. At least one processor of the electronic device can read the computer instructions from the readable storage medium, and the processor executes the computer instructions to cause the electronic device to implement the alarm information transmission method in the embedded environment provided by the various embodiments described above.
[0204] In this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates an "or" relationship between the preceding and following related objects; in formulas, the character " / " indicates a "division" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0205] It is understood that the various numerical designations used in the embodiments of this application are merely for descriptive convenience and are not intended to limit the scope of the embodiments of this application. In the embodiments of this application, the order of the above-mentioned process numbers does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0206] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A method for transmitting alarm information in an embedded environment, characterized in that, The method applied to a master node comprises: obtaining alarm information and a serial number of the alarm information from a slave node, wherein the alarm information comprises an indication indicating an alarm generation event or an alarm elimination event; wherein the generation event and the elimination event of the same alarm adopt the same serial number, and the serial numbers of different alarms are different; if the alarm information is an alarm of the alarm generation event, the last alarm stored in an active alarm list is also an alarm of the alarm generation event, and the serial number of the alarm information is different from the serial number of the last alarm stored in the active alarm list, it is determined that the alarm elimination event of the last alarm stored in the active alarm list is missed; wherein the active alarm list is used for storing alarms and serial numbers which have not been eliminated; the alarm elimination event of the last alarm stored in the active alarm list is reported to a northbound device; and the alarm information is reported to the northbound device; if the alarm information is an alarm of the alarm elimination event, the last alarm stored in the active alarm list is an alarm of the alarm generation event, and the serial number of the alarm information is different from the serial number of the last alarm stored in the active alarm list, it is determined that the alarm elimination event of the last alarm stored in the active alarm list and the alarm generation event corresponding to the serial number of the alarm information are missed; the alarm elimination event of the last alarm stored in the active alarm list is reported to the northbound device; the alarm generation event corresponding to the serial number of the alarm information is reported to the northbound device; and the alarm information is reported to the northbound device; if the alarm information is an alarm of the alarm elimination event, the last alarm stored in the active alarm list is also an alarm of the alarm elimination event, it is determined that the alarm generation event corresponding to the serial number of the alarm information is missed; the alarm generation event corresponding to the serial number of the alarm information is reported to the northbound device; and the alarm information is reported to the northbound device.
2. The method of claim 1, wherein, The method further comprises: if there is no alarm missing, and the alarm information is an alarm of the alarm elimination event, it is determined whether the alarm information has been reported according to the serial number and a recently deleted alarm list; wherein the recently deleted alarm list is used for storing serial numbers of alarms deleted within a preset time period before the current time; if the alarm information has been reported, the alarm information is deleted; if the alarm information has not been reported, the alarm information is reported to the northbound device, the alarm corresponding to the serial number in the active alarm list is deleted according to the serial number, and the serial number is updated in the recently deleted alarm list.
3. The method of claim 2, wherein, The determination whether the alarm information has been reported according to the serial number and the recently deleted alarm list comprises: if the serial number of the alarm information is included in the recently deleted alarm list, it is determined that the alarm information has been reported; if the serial number of the alarm information is not included in the recently deleted alarm list, it is determined that the alarm information has not been reported.
4. The method according to any one of claims 1 to 3, characterized in that, The method further comprises: If there is no alarm missing report situation, and the alarm information is an alarm of an alarm generation event, the alarm information is reported to the northbound device, and an alarm generation corresponding to the sequence number is added in the active alarm list according to the sequence number.
5. The method according to claim 2 or 3, characterized in that, The alarm information and the sequence number of the alarm information obtained from the child node include: The alarm information and the sequence number of the alarm information actively reported by the child node are received; Or, The alarm information and the sequence number of the alarm information are obtained from the child node according to a preset period.
6. A method for transmitting alarm information in an embedded environment, characterized in that, Applied to a child node, the method includes: According to a predefined alarm sequence number numbering rule, obtain alarm information and the sequence number of the alarm information, and the alarm sequence number numbering rule stipulates that the generation event and the elimination event of the same alarm use the same sequence number, and the sequence numbers of different alarms are different; Report the alarm information and the sequence number of the alarm information to the master node, and the master node is used to execute the method in any one of claims 1-5 based on the alarm information and the sequence number of the alarm information.
7. A device for transmitting alarm information in an embedded environment, characterized in that, Include: The obtaining module is used for obtaining alarm information and the sequence number of the alarm information from the child node, and the alarm information includes an indication indicating an alarm generation event or an alarm elimination event; wherein the generation event and the elimination event of the same alarm use the same sequence number, and the sequence numbers of different alarms are different; The determination module is used for determining whether there is an alarm missing report situation according to the alarm information, the sequence number and the active alarm list; wherein the active alarm list is used for storing alarms and sequence numbers that have not been eliminated; The reporting module is used for reporting the missing alarm and the alarm information to the northbound device if there is an alarm missing report situation; The determination module is specifically used for: if the alarm information is an alarm of an alarm generation event, the last alarm stored in the active alarm list is also an alarm of an alarm generation event, and the sequence number of the alarm information is different from the sequence number of the last alarm stored in the active alarm list, it is determined that the alarm elimination event of the last alarm stored in the active alarm list is missing reported; wherein the active alarm list is used for storing alarms and sequence numbers that have not been eliminated; Correspondingly, the reporting module is specifically used for: reporting the alarm elimination event of the last alarm stored in the active alarm list to the northbound device; reporting the alarm information to the northbound device; The determination module is also specifically used for: if the alarm information is an alarm of an alarm elimination event, the last alarm stored in the active alarm list is an alarm of an alarm generation event, and the sequence number of the alarm information is different from the sequence number of the last alarm stored in the active alarm list, it is determined that the alarm elimination event of the last alarm stored in the active alarm list and the alarm generation event corresponding to the sequence number of the alarm information are missing reported; Correspondingly, the reporting module is further configured to report, to the northbound device, an alarm generation event corresponding to the sequence number of the alarm information; and report, to the northbound device, the alarm information. The determining module is further configured to determine that the alarm generation event corresponding to the sequence number of the alarm information is missed if the alarm information is an alarm of an alarm elimination event and the last alarm stored in the active alarm list is also an alarm of an alarm elimination event. Correspondingly, the reporting module is further configured to report, to the northbound device, an alarm generation event corresponding to the sequence number of the alarm information; and report, to the northbound device, the alarm information.
8. A device for transmitting alarm information in an embedded environment, characterized in that, The method comprises: a defining module configured to acquire alarm information and a sequence number of the alarm information according to a predefined alarm sequence number numbering rule, the alarm sequence number numbering rule stipulating that a generation event and an elimination event of a same alarm adopt a same sequence number and sequence numbers of different alarms are different; a transmission module configured to report the alarm information and the sequence number of the alarm information to a master node, the master node being configured to perform the method according to any one of claims 1-5 based on the alarm information and the sequence number of the alarm information.
9. An electronic device, comprising: The method comprises: a processor, and a memory connected to the processor in communication; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory to implement the method according to any one of claims 1-6.
10. A readable storage medium, characterized by, The readable storage medium stores computer instructions, and the computer instructions are executed by the processor to implement the method according to any one of claims 1-6.
11. A program product comprising computer instructions, characterized in that, The computer instructions are executed by the processor to implement the method according to any one of claims 1-6.
Citation Information
Patent Citations
Network management alarm managing method and system, and alarm collecting server
CN102083091A
Warning information management method and device of network management system
CN102882700A
Alarm reporting method and device
CN112039681A