Methods, systems, electronic devices, and storage media for monitoring the heartbeat of the controller module.
By acquiring the heartbeat data of the controller module and dynamically adjusting the monitoring threshold based on the status information, the problem that the monitoring logic in the existing technology cannot adapt to the changes in the controller module's status is solved, realizing adaptive monitoring of the controller module and ensuring effective monitoring under different states.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-29
- Publication Date
- 2026-03-06
AI Technical Summary
In existing technologies, the monitoring logic of the controller module cannot adapt to changes in its working state, resulting in monitoring failure and failing to meet the continuous monitoring requirements of the controller module under different states.
By continuously acquiring the heartbeat data of the controller module, and dynamically adjusting the monitoring threshold based on the mapping relationship between the status information of the heartbeat data and the preset monitoring threshold, the normal and abnormal states of the controller module are determined.
It enables adaptive adjustment of monitoring logic after changes in the controller module's state, ensuring continuous and effective monitoring of the controller module and adapting to real-time monitoring needs under different working conditions.
Smart Images

Figure CN115695253B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of control technology, specifically to a method, system, electronic device, and storage medium for monitoring the heartbeat of a controller module. Background Technology
[0002] In the field of control technology, controller modules typically continuously transmit heartbeat data. Subsequent modules receive this heartbeat data and analyze and compare it with pre-set monitoring logic to determine the controller module's operating status. Existing technologies sometimes monitor application modules on sub-devices. Others have a dedicated heartbeat maintenance module that periodically sends heartbeat information to the control system throughout operation. However, with advancements in control technology, controller modules often require different operating states. When a controller's operating state changes, its heartbeat data also changes accordingly. The monitoring logic in subsequent modules, being pre-set, cannot adapt to these changes, leading to monitoring failure and failing to meet the need for continued monitoring of the controller module even after its operating state changes. Summary of the Invention
[0003] In view of the shortcomings of the prior art described above, the present invention provides a method, system, electronic device and storage medium for monitoring the heartbeat of a controller module to solve the above technical problems.
[0004] This invention provides a method for monitoring the heartbeat of a controller module, comprising:
[0005] The heartbeat data of the controller module is continuously acquired, and the heartbeat data includes status information.
[0006] Based on the current heartbeat data and the mapping relationship between the preset monitoring threshold and the status information, the monitoring threshold is obtained;
[0007] The time interval between the current heartbeat data and the next heartbeat data is compared with the monitoring threshold. If the time interval meets the monitoring threshold, the controller module is normal; if the time interval exceeds the monitoring threshold, the controller module is abnormal.
[0008] Optionally, the heartbeat data includes a heartbeat count, and before comparing the time interval between the current heartbeat data and the next heartbeat data with the monitoring threshold, it includes:
[0009] The validity of the current heartbeat data is determined based on the current heartbeat count and a pre-set reference count.
[0010] If the current heartbeat data is valid, the reference count is updated to the heartbeat count of the current heartbeat data; if the previous heartbeat data is invalid, the previous heartbeat data is discarded.
[0011] Optionally, the validity of the current heartbeat data is determined, including:
[0012] Obtain the heartbeat count of the current heartbeat data and compare the heartbeat count with the reference count.
[0013] If the heartbeat count is less than or equal to the preset reference count, the current heartbeat data is invalid; if the heartbeat count is greater than the preset reference count, the current heartbeat data is valid.
[0014] Optionally, the status information includes the heartbeat cycle and the maximum allowed number of consecutive losses.
[0015] Optionally, the monitoring threshold is the product of the heartbeat cycle and the maximum allowed number of consecutive losses.
[0016] Optionally, the time interval between the current heartbeat data and the next heartbeat data is compared with the monitoring threshold. If the time interval is less than or equal to the product of the heartbeat cycle and the maximum allowed number of consecutive losses, the controller module is normal. If the time interval is greater than the product of the heartbeat cycle and the maximum allowed number of consecutive losses, the controller module is malfunctioning.
[0017] This invention also provides a monitoring system for the heartbeat of a controller module. The system includes a back-end module that continuously acquires the heartbeat data of the controller module, the heartbeat data including status information. Based on the status information of the current heartbeat data and a preset mapping relationship between a monitoring threshold and the status information, the back-end module obtains a monitoring threshold. The back-end module compares the time interval between the current heartbeat data and the next heartbeat data with the monitoring threshold. If the time interval meets the monitoring threshold, the controller module is normal; if the time interval exceeds the monitoring threshold, the controller module is malfunctioning.
[0018] Optionally, the heartbeat data includes a heartbeat count. Before comparing the time interval between the current heartbeat data and the next heartbeat data with the monitoring threshold, the subsequent module determines the validity of the current heartbeat data based on the current heartbeat count and a pre-set reference count. If the current heartbeat data is valid, the reference count is updated to the heartbeat count of the current heartbeat data. If the previous heartbeat data is invalid, the previous heartbeat data is discarded.
[0019] The present invention also provides an electronic device, the electronic device comprising: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device enables the monitoring method for the heartbeat of the controller module as described in any of the preceding claims.
[0020] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a computer processor, causes the computer to perform the heartbeat monitoring method of the controller module as described in any of the preceding claims.
[0021] The beneficial effects of this invention are as follows: Based on the current heartbeat data's status information and a preset mapping relationship between the monitoring threshold and the status information, a monitoring threshold is obtained. By comparing the time interval between the current heartbeat data and the next heartbeat data with the monitoring threshold, it is possible to determine whether the controller module is functioning correctly. Since the monitoring threshold is derived from the current heartbeat data's status information, it changes accordingly when the controller module's status changes. This allows the monitoring logic to adapt to changes in the controller module's status, thereby maintaining monitoring of the controller module.
[0022] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0023] 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. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0024] In the attached diagram:
[0025] Figure 1 This is a flowchart illustrating a method for monitoring the heartbeat of a controller module, as shown in an exemplary embodiment of this application;
[0026] Figure 2 This is a logical block diagram illustrating an exemplary embodiment of the present application of a method for monitoring the heartbeat of a controller module;
[0027] Figure 3 This is a structural block diagram illustrating an exemplary embodiment of the present application of a system for monitoring the heartbeat of a controller module;
[0028] Figure 4 This is an exemplary embodiment of the present application illustrating a connection block diagram between the various controller modules;
[0029] Figure 5 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present application is shown. Detailed Implementation
[0030] The embodiments of the present invention will be described below with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention and not for limiting the scope of protection of the present invention.
[0031] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0032] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the invention. However, it will be apparent to those skilled in the art that embodiments of the invention may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the invention.
[0033] First, it's important to clarify that in the field of control technology, controller modules typically continuously send heartbeat data. Subsequent modules receive this data and analyze and compare it with pre-set monitoring logic based on parameters such as the heartbeat data's content and transmission cycle to determine if the controller module's operating status is normal. Some controllers monitor application modules on sub-devices to detect these modules. Others have a dedicated heartbeat maintenance module that periodically sends heartbeat information to the framework throughout operation, thus monitoring the controller module. However, with the development of control technology, controller modules often need to have different operating states. When the controller module's operating state changes, its heartbeat data also changes accordingly. The monitoring logic in subsequent modules, however, is pre-set and cannot adapt to these changes, leading to monitoring failure and failing to meet the need for continued monitoring of the controller module after its operating state changes.
[0034] like Figure 1 As shown, this embodiment provides a method for monitoring the heartbeat of a controller module, including the following steps:
[0035] S10: Continuously acquire the heartbeat data of the controller module, the heartbeat data including status information;
[0036] S20: Based on the status information of the current heartbeat data and the mapping relationship between the preset monitoring threshold and the status information, obtain the monitoring threshold;
[0037] S30: Compare the time interval between the current heartbeat data and the next heartbeat data with the monitoring threshold. If the time interval meets the monitoring threshold, the controller module is normal. If the time interval exceeds the monitoring threshold, the controller module is abnormal.
[0038] In some embodiments, the heartbeat data includes a heartbeat count, which is used to characterize the order in which the heartbeat data is sent, and is typically an incrementing integer. Using the heartbeat count, subsequent modules can determine whether the received heartbeat data is continuous.
[0039] Therefore, before step S30, that is, before the step of comparing the time interval between the current heartbeat data and the next heartbeat data with the monitoring threshold, the following steps are also included:
[0040] S00: Determine the validity of the current heartbeat data based on the current heartbeat count and a pre-set reference count. If the current heartbeat data is valid, update the reference count to the heartbeat count of the current heartbeat data. If the previous heartbeat data is invalid, discard the previous heartbeat data.
[0041] In practice, the downstream module needs to receive heartbeat data in real time to prevent data loss. Except when the upstream module's heartbeat count is reset to zero, when the upstream module is working normally, the downstream module needs to parse the received heartbeat data. First, it checks the validity of the current heartbeat data using the heartbeat count. If the heartbeat count is duplicated or less than the previous count, the heartbeat is considered invalid and discarded. Otherwise, the heartbeat data is considered valid.
[0042] In this embodiment, the time interval between the current heartbeat data and the next heartbeat data is obtained through a timer. When the heartbeat data is valid, the timer is configured using the parsed heartbeat period and the maximum allowed number of consecutive losses, and this is used as a reference for judging whether the next heartbeat data reception has timed out and whether the preceding module is abnormal.
[0043] Specifically, in some embodiments, step S00, which is the step of determining the validity of the current heartbeat data, includes the following sub-steps:
[0044] S01: Obtain the heartbeat count of the current heartbeat data and compare the heartbeat count with the reference count.
[0045] S02: If the heartbeat count is less than or equal to the preset reference count, the current heartbeat data is invalid; if the heartbeat count is greater than the preset reference count, the current heartbeat data is valid.
[0046] In some embodiments, the status information includes the heartbeat cycle and the maximum allowed number of consecutive losses.
[0047] Specifically, in some embodiments, the monitoring threshold is the product of the heartbeat cycle and the maximum allowed number of consecutive losses.
[0048] Therefore, in step S30, which is the step of comparing the time interval between the current heartbeat data and the next heartbeat data with the monitoring threshold, if the time interval is less than or equal to the product of the heartbeat cycle and the maximum allowed number of consecutive losses, the controller module is normal; if the time interval is greater than the product of the heartbeat cycle and the maximum allowed number of consecutive losses, the controller module is malfunctioning.
[0049] This embodiment analyzes the current heartbeat data, allowing the downstream module to dynamically adjust its monitoring logic for the heartbeat data of the upstream module, thus achieving adaptive switching of heartbeat data in different states of the upstream module. For example, under normal operating conditions, the upstream module has a heartbeat period of 100ms, meaning the heartbeat data transmission period is 100ms, and the maximum allowed consecutive loss count is 3. The downstream module then uses this information to judge subsequent heartbeat data. If the upstream module enters sleep mode, it needs to send heartbeat data before entering sleep mode. The heartbeat period and maximum allowed consecutive loss count in the heartbeat data are adjusted to the state after sleep mode, i.e., the heartbeat period is 1s, and the maximum allowed consecutive loss count is 5. The lower the heartbeat period and the lower the maximum allowed consecutive loss count, the better the monitoring effect of the upstream module, but the higher the energy consumption and computing resource usage. Increasing the heartbeat period and the maximum allowed consecutive loss count reduces energy consumption and computing resources accordingly, but also reduces the monitoring accuracy and sensitivity of the upstream module.
[0050] In this embodiment, a monitoring threshold is obtained based on the status information of the current heartbeat data and the mapping relationship between a preset monitoring threshold and the status information. The monitoring threshold is then compared with the time interval between the current heartbeat data and the next heartbeat data to determine whether the controller module is functioning correctly. Since the monitoring threshold is derived from the status information of the current heartbeat data, it changes accordingly when the controller module's status changes. This allows the monitoring logic to adjust accordingly after a change in the controller module's status, thereby maintaining monitoring of the controller module.
[0051] like Figure 2 As shown, this embodiment uses timeout limits as the monitoring logic to determine whether the preceding module is functioning correctly. When the maximum allowed number of consecutive data loss is zero, the heartbeat cycle of a single heartbeat data point can be used as the monitoring threshold to determine if a timeout has occurred. When the maximum allowed number of consecutive data loss is greater than zero, the total duration obtained by multiplying the heartbeat cycle by the maximum allowed number of consecutive data loss can also be used as the monitoring threshold. When the preceding module malfunctions, the following modules can execute the malfunction handling logic of the preceding module as needed.
[0052] This embodiment, through the transmission of different parameters in the heartbeat data, adapts to the differences in heartbeat data of the controller module under different functions and scenarios. It can not only ensure the real-time status monitoring of the controller module during normal operation, but also reduce the resource consumption of the controller module when it is in sleep or standby mode. It can effectively adapt to situations such as multiple modes of autonomous driving and solve the monitoring problem after the autonomous driving program switches between multiple modes.
[0053] Figure 3 This is a block diagram illustrating a controller module heartbeat monitoring system as an exemplary embodiment of this application. The system can be applied to... Figure 3 The implementation environment shown is specifically configured in the smart terminal 210. This device can also be applied to other exemplary implementation environments and specifically configured in other devices. This embodiment does not limit the implementation environment to which the device is applicable.
[0054] like Figure 3 As shown, this embodiment provides a heartbeat monitoring system for a controller module, including a back-end module, where the controller module is a front-end module. The back-end module continuously acquires the heartbeat data of the controller module, and the heartbeat data includes status information. Based on the status information of the current heartbeat data and a preset mapping relationship between a monitoring threshold and the status information, the back-end module obtains a monitoring threshold. The back-end module compares the time interval between the current heartbeat data and the next heartbeat data with the monitoring threshold. If the time interval meets the monitoring threshold, the controller module is normal; if the time interval exceeds the monitoring threshold, the controller module is malfunctioning.
[0055] Specifically, the heartbeat data includes a heartbeat count. Before comparing the time interval between the current heartbeat data and the next heartbeat data with the monitoring threshold, the subsequent module determines the validity of the current heartbeat data based on the current heartbeat count and a pre-set reference count. If the current heartbeat data is valid, the reference count is updated to the heartbeat count of the current heartbeat data. If the previous heartbeat data is invalid, the previous heartbeat data is discarded.
[0056] like Figure 4 As shown, the controller can use one module to monitor the operation of all other modules as a whole, or a downstream module to monitor a upstream module. The heartbeat mechanism of both is the same.
[0057] Embodiments of this application also provide an electronic device, including: one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, cause the electronic device to implement the heartbeat monitoring method of the controller module as described in any of the preceding claims.
[0058] Figure 5 A schematic diagram of a computer system suitable for implementing the embodiments of this application is shown. It should be noted that... Figure 5 The computer system 1200 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0059] like Figure 5 As shown, the computer system 1200 includes a Central Processing Unit (CPU) 1201, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 1202 or programs loaded from storage portion 1208 into Random Access Memory (RAM) 1203, such as performing the methods described in the above embodiments. Various programs and data required for system operation are also stored in RAM 1203. The CPU 1201, ROM 1202, and RAM 1203 are interconnected via bus 1204. An Input / Output (I / O) interface 1205 is also connected to bus 1204.
[0060] The following components are connected to I / O interface 1205: an input section 1206 including a keyboard, mouse, etc.; an output section 1207 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to I / O interface 1205 as needed. Removable media 1211, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1210 as needed so that computer programs read from them can be installed into storage section 1208 as needed.
[0061] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program including a computer program for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1209, and / or installed from removable medium 1211. When the computer program is executed by central processing unit (CPU) 1201, it performs various functions defined in the system of this application.
[0062] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable computer program. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0063] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0064] The units described in the embodiments of this application can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.
[0065] Another aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a computer's processor, causes the computer to perform the heartbeat monitoring method of the controller module as described above. This computer-readable storage medium may be included in the electronic device described in the above embodiments, or it may exist independently and not assembled into the electronic device.
[0066] Another aspect of this application provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the heartbeat monitoring method of the controller module provided in the various embodiments above.
[0067] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.
Claims
1. A method of monitoring controller module heartbeats, the method comprising: The system comprises: continuously acquiring heartbeat data of the controller module, the heartbeat data comprising state information; obtaining a monitoring threshold according to the state information of the current heartbeat data and a preset mapping relationship between monitoring thresholds and state information; comparing a time interval between the current heartbeat data and next heartbeat data with the monitoring threshold, if the time interval meets the monitoring threshold, the controller module is normal, if the time interval exceeds the monitoring threshold, the controller module is abnormal; the state information comprises a heartbeat period and a maximum allowed consecutive loss number, and the monitoring threshold is a product of the heartbeat period and the maximum allowed consecutive loss number.
2. The method of claim 1, wherein, The heartbeat data comprises a heartbeat count, before comparing the time interval between the current heartbeat data and next heartbeat data with the monitoring threshold, the method comprises: judging the validity of the current heartbeat data according to the current heartbeat count and a preset reference count; if the current heartbeat data is valid, updating the reference count to the heartbeat count of the current heartbeat data, if the current heartbeat data is invalid, discarding the current heartbeat data.
3. The method of claim 2, wherein, judging the validity of the current heartbeat data comprises: acquiring the heartbeat count of the current heartbeat data and comparing the heartbeat count with the reference count, if the heartbeat count is less than or equal to the preset reference count, the current heartbeat data is invalid, if the heartbeat count is greater than the preset reference count, the current heartbeat data is valid.
4. The method of claim 1, wherein, comparing the time interval between the current heartbeat data and next heartbeat data with the monitoring threshold, if the time interval is less than or equal to the product of the heartbeat period and the maximum allowed consecutive loss number, the controller module is normal, if the time interval is greater than the product of the heartbeat period and the maximum allowed consecutive loss number, the controller module is abnormal.
5. A monitoring system of controller module heartbeats, characterized by, The system comprises a later module, the later module continuously acquires heartbeat data of the controller module, the heartbeat data comprising state information; the later module obtains a monitoring threshold based on the state information of the current heartbeat data and a preset mapping relationship between monitoring thresholds and state information; the later module compares a time interval between the current heartbeat data and next heartbeat data with the monitoring threshold, if the time interval meets the monitoring threshold, the controller module is normal, if the time interval exceeds the monitoring threshold, the controller module is abnormal; the state information comprises a heartbeat period and a maximum allowed consecutive loss number, and the monitoring threshold is a product of the heartbeat period and the maximum allowed consecutive loss number.
6. The system for monitoring controller module heartbeats of claim 5, wherein, The heartbeat data comprises a heartbeat count, and the post-stage module judges validity of current heartbeat data according to the current heartbeat count and a preset reference count before comparing a time interval between the current heartbeat data and next heartbeat data with the monitoring threshold; if the current heartbeat data is valid, the reference count is updated as the heartbeat count of the current heartbeat data, and if the current heartbeat data is invalid, the previous heartbeat data is discarded.
7. An electronic device, comprising: The electronic device includes: one or more processors; a storage device for storing one or more programs, which, when executed by the one or more processors, cause the electronic device to implement the monitoring method for the heartbeat of the controller module as claimed in any one of claims 1 to 4.
8. A computer-readable storage medium, characterized in that, a computer program stored thereon, which, when executed by a processor of a computer, causes the computer to perform the monitoring method for the heartbeat of the controller module as claimed in any one of claims 1 to 4.
Citation Information
Patent Citations
Intelligent heartbeat keeping method and system
CN104144159A
Client connection state detection method and system
CN107360239A
Heartbeat monitoring method and monitoring equipment
CN110224880A