A method and device for determining the offline status of large-scale geological disaster monitoring equipment

By creating shadow devices in the cache library and setting off offline countdown, the dependence of geological disaster monitoring equipment status monitoring on the database is reduced, the problem of excessive database pressure is solved, and efficient equipment status determination and timely status synchronization are achieved.

CN116704726BActive Publication Date: 2025-08-26武汉达梦数据技术有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310569480.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-17
Publication Date
2025-08-26
Estimated Expiration
2043-05-17

AI Technical Summary

Technical Problem

In the prior art, the status monitoring of geological disaster monitoring equipment requires frequent interaction with the database, resulting in excessive pressure on the database, affecting monitoring efficiency and timeliness.

Method used

By creating shadow devices in the cache library, recording the reporting time and status of the device to be monitored, setting off-line countdown, reducing the frequency of interaction with the database, and performing database synchronization only at the end of the offline countdown or when the status changes.

Benefits of technology

It effectively reduces the pressure on the database, improves the efficiency and timeliness of monitoring equipment status judgment, and reduces the burden on the database.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116704726B_ABST
    Figure CN116704726B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for determining the offline status of equipment to be monitored for large-scale geological disaster monitoring. A shadow device is created for each equipment to be monitored in a cache library. The shadow device is used to record one or more of the basic information of the equipment to be monitored, the reporting time, the current status of the equipment to be monitored, and the offline countdown. The offline countdown and the last reporting time of the equipment to be monitored are queried through the shadow device to determine whether the equipment to be monitored is offline. Therefore, most of the query process only needs to interact with the cache library, and there is no need to frequently interact with the database, which greatly reduces the pressure on the database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of geological monitoring technology, and in particular to a method and device for determining the offline status of equipment to be monitored for large-scale geological disaster monitoring. Background Art

[0002] Early geological disaster monitoring relied primarily on manual observation of surface changes. However, due to the influence of climatic conditions and terrain visibility, continuous monitoring was not possible, automation was low, labor-intensive, data processing was difficult, and monitoring cycles were too long, resulting in less than ideal prevention results. Later, with the advancement of human science and technology and the rapid development of the Internet, automated professional monitoring equipment (universal monitoring equipment) for geological disasters emerged. By replacing manual monitoring with automated monitoring equipment, monitoring information from potential hazards at the sites where monitoring equipment is deployed can be immediately delivered to the Internet platform. The platform can calculate the received monitoring data and issue timely warnings for potential hazards, playing a significant role in protecting people's lives and property.

[0003] As the number of geological disaster monitoring equipment continues to increase, there are more and more cases where monitoring equipment fails or other reasons cause data to be unable to be transmitted to the platform. Managers are paying more and more attention to the online status (online rate) of monitoring equipment. They need to promptly grasp the status of each monitoring device and arrange for problem investigation and maintenance.

[0004] In the existing technology, status monitoring of the monitored equipment usually requires direct interaction with the database to query whether the monitored equipment reports normally within the reporting period, so as to determine whether the monitored equipment is online. However, frequent interaction with the database will undoubtedly increase the database pressure.

[0005] In view of this, overcoming the defects of the prior art is an urgent problem to be solved in this technical field. Summary of the Invention

[0006] The technical problem to be solved by the present invention is how to monitor the status of a device to be monitored while reducing the query pressure on a database.

[0007] The present invention selects the following technical solutions:

[0008] In a first aspect, a method for determining the offline status of a large number of geological disaster monitoring devices is provided, comprising:

[0009] Obtain information of all devices to be monitored from the database, and create shadow devices associated with all devices to be monitored in the cache based on the information of all devices to be monitored, wherein the shadow devices are used to record the reporting time and status of the devices to be monitored;

[0010] Set an offline countdown based on the allowed offline time for each device to be monitored;

[0011] When the offline countdown ends and the shadow device has not updated the reporting time of the device to be monitored, the corresponding device to be monitored is offline and the device status to be monitored of the shadow device is updated; when the shadow device has updated the reporting time of the device to be monitored before the offline countdown ends, the device to be monitored is online and the device status to be monitored of the shadow device is updated, and the offline countdown is restarted.

[0012] Preferably, setting an offline countdown according to the allowed offline time of each device to be monitored specifically includes:

[0013] When the allowed offline duration is less than the first preset duration, the offline countdown duration is set to the allowed offline duration plus the first preset fault tolerance duration;

[0014] When the allowed offline time is greater than or equal to the first preset time, the offline countdown time is set to the allowed offline time plus the second preset fault tolerance time.

[0015] Preferably, setting an offline countdown according to the allowed offline duration of each device to be monitored specifically includes:

[0016] Devices to be monitored with the same offline time will be allowed to have the same offline countdown time.

[0017] When there are two or more monitored devices with the same allowed offline time, the offline countdown time of all monitored devices with the same allowed offline time is set to the allowed offline time plus the same fault tolerance time, thereby ensuring that the offline countdown time of all monitored devices with the same allowed offline time is consistent, thereby alleviating program pressure.

[0018] Preferably, the offline countdown is set according to the allowed offline time of each device to be monitored, further comprising:

[0019] Grouping the monitored devices whose offline duration is within a preset range into the same group, and setting the same offline countdown duration for the monitored devices in the same group;

[0020] Obtaining a first device to be monitored with a minimum allowed offline duration in the same group, and a maximum fault-tolerant duration of the first device to be monitored;

[0021] Obtain the second monitored device with the maximum allowed offline time in the same group;

[0022] The offline countdown duration is less than or equal to the minimum allowed offline duration plus the maximum fault tolerance duration, and is greater than or equal to the maximum allowed offline duration.

[0023] Preferably, when the third allowed offline duration of the third device to be monitored plus its fault tolerance duration exceeds each offline countdown duration corresponding to each current group, the method further includes:

[0024] Obtain a third allowed offline duration and a corresponding fault tolerance duration for the third device to be monitored, and filter out corresponding offline countdown durations from the established groupings such that: n*i-th offline countdown duration <= third allowed offline duration <= (n+1)*i-th offline countdown duration, and (n+1)*i-th offline countdown duration - third allowed offline duration <= third fault tolerance duration;

[0025] Divide the shadow device of the third device to be monitored into the i-th group represented by the i-th offline countdown duration, and set the offline countdown number thereof to n+1;

[0026] Among them, each time the offline analysis result of the third monitored device is not reported after the i-th offline countdown is completed, the offline countdown number is reduced by 1; if the offline countdown number returns to zero, it is confirmed that the third monitored device is offline; if it is confirmed that the report of the third monitored device is received before the offline countdown returns to zero, the offline countdown number is reset to n+1.

[0027] Preferably, when the number of devices to be monitored that have undergone multiple offline countdowns exceeds a preset upper limit of a group, a round of group update operation is performed to try to establish a new group for the devices to be monitored that originally completed offline timing through multiple offline countdowns.

[0028] Preferably, when the number of devices to be monitored with the same reporting period is greater than a preset number, all devices to be monitored with the same reporting period are clustered, the number of devices to be monitored in each cluster is less than or equal to the preset number, and the initial reporting time points of devices to be monitored in different clusters are delayed for different lengths of time to ensure that devices to be monitored in different clusters report information at different time points, thereby receiving the reported information of devices to be monitored in different clusters in batches, reducing the pressure on the judgment program.

[0029] Preferably, when the device status to be monitored of the shadow device is updated from online to offline or from offline to online, the device status to be monitored corresponding to the shadow device in the database is updated to the current device status to be monitored of the shadow device.

[0030] Preferably, when the device status to be monitored of the shadow device is updated from online to offline or from offline to online, the shadow device is marked with an unsynchronized label;

[0031] Establish a timed scheduling task, the scheduling period of which is a preset period. The timed scheduling task obtains all shadow devices with unsynchronized tags in the cache library, and synchronizes the device status to be monitored of all shadow devices with unsynchronized tags in the database to the current device status to be monitored of the shadow devices, and at the same time changes all shadow devices with unsynchronized tags to synchronized tags.

[0032] In the second aspect, a device for determining the offline status of equipment to be monitored for large-scale geological disaster monitoring includes at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the processor to execute the method for determining the offline status of equipment to be monitored for large-scale geological disaster monitoring.

[0033] An embodiment of the present invention provides a method and device for determining the offline status of equipment to be monitored for large-scale geological disaster monitoring. A shadow device is created for each equipment to be monitored in a cache library. The shadow device is used to record one or more of the basic information of the equipment to be monitored, the reporting time, the current status of the equipment to be monitored, and the offline countdown. The offline countdown and the last reporting time of the equipment to be monitored are queried through the shadow device to determine whether the equipment to be monitored is offline. Therefore, most of the query process only needs to interact with the cache library, and there is no need to frequently interact with the database, which greatly reduces the pressure on the database. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. Those skilled in the art can also derive other drawings based on these drawings without inventive effort.

[0035] Figure 1 This is a flow chart of a method for determining the offline status of equipment to be monitored for large-scale geological disaster monitoring provided by an embodiment of the present invention;

[0036] Figure 2 This is a flow chart of a method for setting an offline countdown duration for a method for determining an offline state of equipment to be monitored for large-scale geological disaster monitoring provided by an embodiment of the present invention;

[0037] Figure 3 This is a flow chart of a method for monitoring equipment with a long allowable offline time for a method for determining the offline status of equipment to be monitored for large-scale geological disaster monitoring provided by an embodiment of the present invention;

[0038] Figure 4This is a comparison diagram of the monitoring method duration of devices with a longer allowable offline time in an example of a method for determining the offline status of devices to be monitored for large-scale geological disaster monitoring provided by an embodiment of the present invention;

[0039] Figure 5 This is a flowchart of a method for determining the offline status of a large number of geological disaster monitoring equipment and synchronizing it with a database, provided by an embodiment of the present invention;

[0040] Figure 6 The present invention provides a schematic diagram of an offline status determination device for large-scale geological disaster monitoring equipment. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0042] In the description of the present invention, the terms "inside", "outside", "longitudinal", "lateral", "upper", "lower", "top", "bottom", etc. indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings. They are only for the convenience of describing the present invention and do not require that the present invention must be constructed and operated in a specific orientation. Therefore, they should not be understood as limitations on the present invention.

[0043] In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0044] Embodiment 1:

[0045] Embodiment 1 of the present invention provides a method for determining the offline status of a large number of geological disaster monitoring equipment to be monitored, such as Figure 1 As shown, including:

[0046] In step 101, information of all devices to be monitored is obtained from a database.

[0047] In step 102, shadow devices of all devices to be monitored are created in a cache library according to the information of all devices to be monitored.

[0048] The shadow device is used to record and update the reporting time of the corresponding device to be monitored and the status of the corresponding device to be monitored.

[0049] The monitored equipment in this embodiment is used to be set up in areas prone to geological disasters, such as landslide areas, mountain and valley accumulation areas, etc., to monitor the above-mentioned areas. When a geological disaster or a precursor of a geological disaster occurs in the above-mentioned area, the monitored equipment returns alarm information to the database, thereby providing early warning of the geological disaster.

[0050] The database is a central server that is used to store the information status of all monitored devices, send control commands to the monitored devices, and receive messages returned from the monitored devices. The shadow device is electronic attribute information of the monitored device, described by a JSON string. Each shadow device corresponds to a single monitored device one-to-one. The shadow device is stored in a cache library. In this embodiment, most interactions are performed with the shadow device, thereby ensuring that most interactive operations do not need to go through the database, reducing the interaction pressure on the database. The status of the monitored device includes: the monitored device is online and the monitored device is offline. The reporting time of the monitored device is: all monitored devices will periodically send information to the database. The information is current monitoring information of the location of the monitored device (including but not limited to: surface displacement in the XYZ direction, crack opening, rainfall, soil moisture, mud water level, pore water pressure, etc.), so that the database can obtain the current status of the area where the hidden danger point is located. The time point when the monitored device sends the information is the reporting time of the monitored device. It should be noted that the shadow device is not used to receive information reported by the monitored device, but only records the time point when the monitored device reports the information. The shadow device also records the model and model data of the corresponding device to be monitored, so that it corresponds to the corresponding device to be monitored.

[0051] In step 103, an offline countdown is set according to the reporting period and the allowed offline time of each device to be monitored.

[0052] In step 104, when the offline countdown ends and the shadow device has not updated the reporting time of the corresponding device to be monitored, the device to be monitored is offline and the device status to be monitored of the corresponding shadow device is updated; when the shadow device has updated the reporting time of the corresponding device to be monitored before the offline countdown ends, the device to be monitored is online and the device status to be monitored of the corresponding shadow device is updated, and the offline countdown is restarted.

[0053] The reporting period is: the periodic duration of the reporting information of each device to be monitored, and the reporting periods of different devices to be monitored can be the same or different, but in most application scenarios, since the geological activities in the same area are generally the same, the reporting periods of the devices to be monitored in the same area are usually set to be the same; it should be noted that those skilled in the art can change and adjust the reporting period of each device to be monitored based on actual conditions.

[0054] The allowed offline duration is as follows: each monitored device has its own reporting cycle, but also an acceptable unresponsiveness period. If a monitored device fails to report information within the reporting cycle, it may be experiencing a temporary failure and not completely offline. It may recover and report information within the allowed offline duration. However, if it fails to report information after the allowed offline duration, it can be determined that the monitored device is offline. The allowed offline duration starts from the initial or previous information reporting time. If the monitored device is able to report information within the allowed offline duration, it is determined to be online. If the monitored device fails to report information within the allowed offline duration, it can be determined to be offline. It should be noted that the allowed offline duration is only a property of the monitored device itself. In this embodiment, when the allowed offline duration is actually used to determine whether the monitored device is offline, the offline countdown is set based on the allowed offline duration.

[0055] It should be noted that this embodiment is only applicable to the case where the allowed offline time is longer than the reporting period, and the allowed offline time is usually multiple times of the reporting period.

[0056] In the prior art, whether the device to be monitored is offline is usually determined by directly querying the information reported by the device to be monitored in the database and the time series database. However, when the number of devices to be monitored exceeds a certain number, in this case, if the period for querying whether the device to be monitored is online is set too short, it will cause great pressure on the database and the database. If the period for querying whether the device to be monitored is online is set too long in order to alleviate this pressure, the device to be monitored with a shorter offline time will be allowed to be offline for a long time without being discovered.

[0057] In this embodiment, a shadow device is created for each device to be monitored in the cache library. The shadow device is used to record one or more of the basic information of the device to be monitored, the reporting time, the current status of the device to be monitored, and the offline countdown. The offline countdown and the last reporting time of the device to be monitored are queried through the shadow device to determine whether the device to be monitored is offline. The device to be monitored that has changed its status is then synchronized with the database separately. Therefore, most of the query process only needs to interact with the cache library, and there is no need to frequently interact with the database, which greatly reduces the pressure on the database.

[0058] Although the allowed offline time is the acceptable unresponsiveness time of the monitored device, when setting the offline countdown based on the allowed offline time, a fault tolerance range needs to be added. Therefore, this embodiment involves the following design:

[0059] The offline countdown is set according to the allowed offline time of each device to be monitored, specifically including:

[0060] When the allowed offline duration is less than the first preset duration, the offline countdown duration is the allowed offline duration plus the first preset fault tolerance duration.

[0061] When the allowed offline time is greater than or equal to the first preset time, the offline countdown time is the allowed offline time plus the second preset fault tolerance time.

[0062] The first preset duration, the first preset fault tolerance duration, and the second preset fault tolerance duration are all set by those skilled in the art according to actual circumstances. The first preset fault tolerance duration and the second preset fault tolerance duration are fault tolerance durations based on the allowed offline duration, meaning that if no report information from the monitored device is received before the end of the fault tolerance duration after the end of the allowed offline duration, the monitored device can still be considered online, and if no report information from the monitored device is received after the end of the allowed offline duration plus the fault tolerance duration, the monitored device can be considered offline. It should be noted that the fault tolerance durations of different monitored devices can be the same or different. However, if the reporting periods of two different monitored devices are the same or similar, then the allowed offline durations and fault tolerance durations of the two different monitored devices will also be the same or similar. It should be noted that in addition to the first preset fault tolerance duration and the second preset fault tolerance duration, those skilled in the art can also set a fault tolerance duration for each monitored device according to actual circumstances. Each monitored device has its own maximum fault tolerance duration, and when setting the fault tolerance duration, it cannot exceed the maximum fault tolerance duration.

[0063] In this embodiment, the first preset time length can be 60 seconds, and the first preset fault tolerance time length can be 1 second; the first preset time length can also be 60 minutes, and the first preset fault tolerance time length can also be 10 seconds; the second preset fault tolerance time length can be 1 minute; the above settings take into account the differences in different geological conditions and different periods. Some areas are prone to geological disasters during special periods, so the monitored equipment in the area needs to report frequently, such as reporting information every few seconds, while some areas are not prone to geological disasters under non-special circumstances. Therefore, the monitored equipment set up in the area does not need to report frequently, such as reporting information every half hour or one hour; when the reporting cycle is short, the fault tolerance time length is relatively short, and when the reporting cycle is long, the fault tolerance time length is relatively long.

[0064] When there are multiple devices to be monitored with the same or similar offline durations, the offline countdowns of the multiple devices to be monitored are often the same or similar. Under the premise that the number of devices to be monitored is not too large, using the same offline countdown for multiple devices to be monitored can often reduce program pressure. Therefore, this embodiment also involves the following design:

[0065] Devices to be monitored with the same offline time will be allowed to set the same offline countdown time.

[0066] When there are two or more monitored devices with the same allowed offline time, the offline countdown time of all monitored devices with the same allowed offline time is set to the allowed offline time plus the same fault tolerance time, thereby ensuring that the offline countdown time of all monitored devices with the same allowed offline time is consistent, thereby alleviating program pressure.

[0067] Since the fault tolerance time of each monitored device can be set individually according to actual conditions, the same fault tolerance time can be set for some or all monitored devices with the same allowed offline time, ensuring that the offline countdown time of some or all monitored devices with the same allowed offline time is consistent, thereby reducing program pressure.

[0068] The devices to be monitored whose allowed offline time is within a preset interval are grouped into the same group, and the same offline countdown time is set for the devices to be monitored in the same group.

[0069] Among them, the preset interval is set by technical personnel in this field according to actual conditions. It should be noted that the interval size of the preset interval needs to be smaller than the sum of the allowed offline time of most of the monitored devices plus the maximum fault tolerance time, that is, the allowed offline time of the monitored devices in the same group is relatively similar. Setting the offline countdown time of these monitored devices to be the same can avoid performing multiple different offline countdown tasks at dense time points, thereby reducing program pressure.

[0070] When there are multiple devices to be monitored with similar offline durations, the offline countdown durations of the multiple devices to be monitored are set to be the same, such as Figure 2 As shown, the method flow includes:

[0071] In step 201, the devices to be monitored whose offline duration is allowed to be within a preset interval are grouped into the same group.

[0072] In step 202, the first device to be monitored with the minimum allowed offline time in the same group and the maximum fault-tolerant time of the first device to be monitored are obtained.

[0073] In step 203, the second device to be monitored with the maximum allowed offline time in the same group is obtained.

[0074] In step 204, the offline countdown duration is less than or equal to the minimum allowed offline duration plus the maximum fault tolerance duration, and is greater than or equal to the maximum allowed offline duration.

[0075] For monitored devices in the same group, that is, devices with similar offline durations, the offline countdown durations of the monitored devices can be adjusted to be consistent, thereby reducing program pressure. The offline countdown duration must be set to ensure that it is less than or equal to the minimum allowed offline duration plus the maximum tolerance duration, and greater than or equal to the maximum allowed offline duration. To more clearly illustrate the offline countdown duration setting method, this embodiment takes the following scenario as an example:

[0076] The allowed offline time for the first device to be monitored is 40 seconds, the allowed offline time for the second device to be monitored is 43 seconds, and the allowed offline time for the third device to be monitored is 45 seconds, wherein the first device to be monitored has the minimum allowed offline time in the same group, the third device to be monitored has the maximum allowed offline time in the same group, and the maximum fault tolerance time of the first device to be monitored is 10 seconds. When the offline countdown time of the above three devices to be monitored needs to be set to be consistent, the offline countdown time is set to a second, wherein a second should be greater than or equal to 45 seconds and less than or equal to 50 seconds. If the offline countdown time is set to less than 45 seconds, the third device to be monitored has no fault tolerance time. If the offline countdown time is set to greater than 50 seconds, the maximum fault tolerance time of the first device to be monitored is exceeded.

[0077] Since in most cases, the monitored devices set in the same area usually set the same reporting period for information reporting, the start time of the reporting period timing of all the monitored devices is usually the same, and the multiple monitored devices with the same reporting period report information at the same time point each time. If the number of monitored devices with the same reporting period is small, it usually does not cause a large pressure on the database. However, if the number of monitored devices with the same reporting period is too large, it will cause a large pressure on the database. In order to avoid the above situation, this embodiment also involves the following design:

[0078] When the number of devices to be monitored in the same reporting period is greater than the preset number, all devices to be monitored in the same reporting period are clustered, and the number of devices to be monitored in each cluster is less than or equal to the preset number. The initial reporting time points of devices to be monitored in different clusters are delayed for different lengths of time to ensure that devices to be monitored in different clusters report information at different time points, thereby receiving the reported information of devices to be monitored in different clusters in batches, reducing the pressure on the judgment program.

[0079] Among them, the preset number is set by those skilled in the art according to the pressure resistance of the judgment program. When the number of devices to be monitored in the same reporting period is less than or equal to the preset number, it means that the simultaneous reporting of the devices to be monitored by this number at the same time point is within the pressure range that the judgment program can withstand. When the number of devices to be monitored in the same reporting period is greater than the preset number, it means that the simultaneous reporting of the devices to be monitored by this number at the same time point will exceed the pressure range that the judgment program can withstand. Therefore, this embodiment divides all devices to be monitored with the same reporting period into clusters, and the number of devices to be monitored in each cluster can be the same or different. The same, but the number of devices to be monitored in each cluster is less than or equal to the preset number. Under the premise of keeping the reporting period of the devices to be monitored in all clusters unchanged, the initial reporting time points of the devices to be monitored in different clusters are delayed for different lengths of time, so as to ensure that the devices to be monitored in different clusters will report information to each other at different time points, while the devices to be monitored in the same cluster will report information at the same time point, thereby avoiding a large number of devices to be monitored reporting information at the same time point and causing greater pressure on the judgment program, wherein the initial reporting time point is the starting time point of the first reporting period counting.

[0080] In order to more clearly illustrate the above method, this embodiment takes the following scenario as an example:

[0081] In this example, the preset number is 300. There are 1000 devices to be monitored, and the reporting period is 20 seconds. The number is far more than 300. Therefore, the 1000 devices to be monitored are divided into four clusters, with 300 devices to be monitored in the first cluster, 200 in the second cluster, 300 in the third cluster, and 200 in the fourth cluster. The initial reporting time of the devices to be monitored in the first cluster remains unchanged, the initial reporting time of the devices to be monitored in the second cluster is delayed by 5 seconds, the initial reporting time of the devices to be monitored in the third cluster is delayed by 10 seconds, and the initial reporting time of the devices to be monitored in the fourth cluster is delayed by 1 second. 5 seconds, that is, the monitored devices in the first cluster report their first information at the 20th second, the monitored devices in the second cluster report their first information at the 25th second, the monitored devices in the third cluster report their first information at the 30th second, and the monitored devices in the fourth cluster report their first information at the 35th second. Under the premise that the reporting period of all monitored devices remains unchanged, the reporting time points of the monitored devices in the first, second, third and fourth clusters are staggered with each other, so as to avoid the situation where more than 300 monitored devices report their information at the same time point, thereby avoiding greater pressure on the judgment program.

[0082] When the shadow device updates the status of the device to be monitored from online to offline or from offline to online, the status needs to be synchronized to the database so that the database can obtain the current latest status of the device to be monitored. Therefore, this embodiment also involves the following design:

[0083] When the device status to be monitored of the shadow device is updated from online to offline or from offline to online, the device status to be monitored corresponding to the shadow device in the database is updated to the current device status to be monitored of the shadow device.

[0084] In actual scenarios, the status changes of the monitored device from online to offline or from offline to online are relatively obvious. Both of the above statuses need to be synchronized to the database so that the database can perform corresponding processing in a timely manner. For example, when the monitored device changes from online to offline, the database must promptly feedback the situation to the user to replace or maintain the monitored device to avoid affecting the monitoring of geological disasters. When the monitored device changes from offline to online, the database must also promptly feedback the situation to the user so as to re-send instructions to the monitored device to resume normal operation. If the monitored device remains online or offline, there is no need to keep informing the database of the status. In the prior art, regardless of whether the monitored device has an offline or online status change, the status will be directly updated in the database, which puts unnecessary pressure on the database. In this embodiment, all updates to the status of the monitored device are only performed through the shadow device, that is, only interacting with the cache library. When the status of the monitored device of the shadow device is updated from online to offline or from offline to online, the status update will be directly synchronized to the database. If the monitored device remains offline or online, it does not need to be synchronized with the database. It should be noted that the above synchronization process can ensure that the database obtains the change in a timely manner when the status of the monitored device changes. However, if the status of the monitored device changes frequently, it will cause relatively frequent interactions with the database, which may cause additional pressure on the database.

[0085] Example 2:

[0086] Based on Example 1, this Example 2 provides another method for determining the offline status of equipment to be monitored in large quantities of geological disaster monitoring.

[0087] This embodiment is implemented in the scenario where, within a batch of devices, a large number of devices have short permitted offline durations. These devices have been grouped accordingly, each grouping uses the same offline countdown. The grouping rules follow those described in Example 1: monitored devices with permitted offline durations within a preset range are grouped together. However, within the same batch of devices, a small number of devices may have permitted offline durations far exceeding those of the majority of other devices in the batch.

[0088] That is, in the same batch of devices, the allowed offline time of the third device to be monitored is much longer than that of most other devices in the same batch. If the offline countdown is set for the third device to be monitored alone, it will increase the pressure of the program. Therefore, when the allowed offline time of the third device to be monitored plus its third fault tolerance time exceeds the offline countdown time corresponding to each group, Figure 3 As shown, the method flow is as follows:

[0089] In step 301, a third allowed offline duration and a corresponding third fault-tolerant duration of the third device to be monitored are obtained.

[0090] The allowed offline time of the third device to be monitored here is much longer than that of other devices in the same batch, and the sum of the third allowed offline time and the corresponding third fault-tolerant time is .

[0091] In step 302, corresponding offline countdown durations are screened out from the established groups, satisfying the following conditions: n*i-th offline countdown duration <= third allowed offline duration <= (n+1)*i-th offline countdown duration, and (n+1)*i-th offline countdown duration - third allowed offline duration <= third fault tolerance duration.

[0092] The i-th offline countdown duration is the offline countdown of a group of devices in the same batch of devices, and the allowed offline duration of the group of devices is relatively short; the third fault tolerance duration is usually the maximum fault tolerance duration of the third monitored device.

[0093] In step 303, the shadow devices of the third device to be monitored are divided into the i-th group represented by the i-th offline countdown duration, and the number of offline countdowns is set to n+1.

[0094] The third device to be monitored is placed in the i-th group. When the actual program is running, the third device to be monitored shares the offline countdown with the devices in the i-th group. However, the difference from other devices in the i-th group is that since the third allowed offline duration is more than n times the i-th offline countdown duration, the third device to be monitored is checked every time the i-th offline countdown is performed to see whether it has reported. A total of n+1 checks are performed, which is the above-mentioned number of offline countdowns (the maximum number of countdowns required for the third device to be monitored to monitor and report in the i-th group).

[0095] In step 304, each time the offline analysis result of the third monitored device is not reported after the i-th offline countdown is completed, the offline countdown number is reduced by 1; if the offline countdown number returns to zero, it is confirmed that the third monitored device is offline; if it is confirmed that a report from the third monitored device is received before the offline countdown returns to zero, the offline countdown number is reset to n+1.

[0096] The third device to be monitored needs to perform n+1 reporting checks. If at least one report is submitted in the n+1 checks, it means that the third device to be monitored is online. If no report is submitted in the n+1 checks, it means that the third device to be monitored is offline. To more clearly illustrate the above method, this embodiment takes the following scenario as an example:

[0097] There are two groups of devices in the same batch of devices. The first offline countdown of the first device group in the two groups is 10s, and the second offline countdown of the second device group is 15s. In addition to the above two groups of devices, there is a third device to be monitored. Figure 4 As shown, the third allowed offline time of the third device to be monitored is 62s, and the maximum fault tolerance time is 10s. However, if a separate group is opened for the third device to be monitored, it is not cost-effective and will cause unnecessary pressure on the program. Among them, 6*first offline countdown time <= third allowed offline time <= (6+1)*first offline countdown time, and from Figure 4 As can be seen, (6+1)*the i-th offline countdown duration-the third allowed offline duration < the third fault-tolerant duration. Therefore, the third device to be monitored is placed in the first device group, and the number of offline countdowns for the third device to be monitored is 6+1=7 times. Therefore, when monitoring the third device to be monitored, a total of 7 first offline countdowns of 10 seconds are performed. If at least one report from the third device to be monitored is received during the 7 first offline countdowns, it means that the third device to be monitored is online. If no report from the third device to be monitored is received during the 7 first offline countdowns, it means that the third device to be monitored is offline.

[0098] Example 3:

[0099] Based on Example 2, this Example 3 provides another method for determining the offline status of equipment to be monitored in large-scale geological disaster monitoring.

[0100] The application scenario of this embodiment is: if there are too many devices to be monitored that are allowed to be offline for a long time in Example 2, then if a shared offline countdown method is used for these devices, it will cause greater pressure on the program. Therefore, this embodiment involves the following design:

[0101] When the number of devices to be monitored that have undergone multiple offline countdowns exceeds the preset upper limit of a group, a round of group update operation is performed to try to establish a new group for the devices to be monitored that originally completed offline timing through multiple offline countdowns.

[0102] In this embodiment, there is a preset upper limit on the number of devices to be monitored in each group, and the preset upper limit is set by those skilled in the art according to actual conditions; the devices to be monitored that perform multiple offline countdowns are, that is, the devices to be monitored that are allowed to be offline for a longer period of time in Example 2. In this embodiment, this type of device to be monitored is referred to as the fourth type of device to be monitored, and the multiple times in the multiple offline countdowns represent that the offline countdown of the device to be monitored needs to be performed at least twice; when the number of the fourth type of devices to be monitored is less than the preset upper limit, it is determined that the number of devices to be detected of this type is small, and the method of multiple offline countdowns in Example 2 can still be used for status monitoring, but when the number of the fourth type of devices to be monitored is greater than the preset upper limit, it is determined that the fourth type There are a large number of devices to be monitored in the fourth category. At this time, the fourth category of devices to be monitored has reached the number to establish another group. Therefore, a round of group update operation is performed. The group update operation is to regroup all devices to be monitored. The grouping rule still allows devices to be monitored with offline time in the same preset interval to be divided into the same group. The number of devices to be monitored in each group does not exceed the preset number. The fourth category of devices to be monitored is divided into at least one group. If there are remaining devices to be monitored in the fourth category, the remaining devices to be monitored in this embodiment are referred to as remaining monitoring devices. Multiple offline countdowns are used to complete the offline timing of the remaining monitoring devices, thereby avoiding too much pressure on the program. In order to more clearly demonstrate the above method, this embodiment takes the following scenario as an example:

[0103] In the same batch of devices, the devices to be monitored that are allowed to have a shorter offline time include three groups, and the preset upper limit of the number of each group is 100. Among them, the first offline countdown of the first device group in the three groups is 10s, the second offline countdown of the second device group is 15s, and the third offline countdown of the third device group is 20s. In addition to the above three groups of devices, there are 110 fourth-category devices to be monitored. The allowed offline time of the fourth-category devices to be monitored is between 60s and 70s. Therefore, a new fourth device group is created, and the 100 fourth-category devices to be monitored are included in the newly created fourth device group, and the offline countdown of the fourth device group is set to 70s. The fourth type of monitored devices in the fourth device group are monitored for a 70s offline countdown information report; the remaining 10 fourth type devices to be monitored are set as remaining monitoring devices, and the offline countdown duration of the remaining monitoring devices is set to 70s, but the remaining monitoring devices are placed in the first device group, and the number of offline countdowns for the remaining monitoring devices is 7 times. Therefore, when monitoring the remaining monitoring devices, a total of 7 first offline countdowns with a duration of 10s are performed. If at least one reporting information from the remaining monitoring devices is received in the 7 first offline countdowns, it means that the remaining monitoring devices are online. If no reporting information from the remaining monitoring devices is received in the 7 first offline countdowns, it means that the remaining monitoring devices are offline.

[0104] Embodiment 4:

[0105] Based on Example 1, this Example 4 provides another method for determining the offline status of equipment to be monitored in large-scale geological disaster monitoring, and this method provides another method for synchronizing the status of equipment to be monitored with a database.

[0106] In Example 1, whenever the state of the device to be monitored changes, the shadow device will directly synchronize the state change with the database. If the state of the device to be monitored changes frequently, the interaction with the database will also be relatively frequent, which may cause additional pressure on the database. Therefore, this embodiment provides another method for synchronizing the state of the device to be monitored with the database, such as Figure 5 As shown, the method flow includes:

[0107] In step 501, when the device status to be monitored of the shadow device is updated from online to offline or from offline to online, the shadow device is marked with an unsynchronized label.

[0108] In this embodiment, in addition to the offline and online status updates, each shadow device also includes two states: synchronized with the database and not synchronized with the database. When the monitored device status of the shadow device remains online or offline, the shadow device is in a state of being synchronized with the database, and the shadow device is marked with a synchronized label; when the monitored device status of the shadow device is updated from online to offline or from offline to online, the shadow device is in a state of not being synchronized with the database, and the shadow device is marked with a not synchronized label.

[0109] In step 502, a scheduled task is established.

[0110] The scheduling period of the timed scheduling task is a preset period and is set by those skilled in the art.

[0111] In step 503, the scheduled task obtains all shadow devices with unsynchronized tags in the cache library.

[0112] In step 504, the device status to be monitored of all shadow devices with unsynchronized tags in the database is synchronized to the current device status to be monitored of the shadow devices, and at the same time, all shadow devices with unsynchronized tags are changed to synchronized tags.

[0113] Among them, the preset period is set by technical personnel in this field according to actual conditions. All shadow devices with unsynchronized tags in the cache library are obtained in each scheduling period. The shadow device to be monitored must have been updated from online to offline or offline to online during the scheduling period. These shadow devices are found and synchronized in the status of the devices to be monitored in the database, so that the database can obtain which devices to be monitored have changed and perform corresponding processing; compared with Example 1, the cache library will not interact with the database too frequently, resulting in additional pressure on the database, but when the status of the device to be monitored changes, it cannot be synchronized with the database in the first time, but needs to wait until the scheduled scheduling task is performed to synchronize with the database. Therefore, this embodiment puts relatively less pressure on the database and is more stable, but the synchronization of the status change of the device to be monitored is not as timely as Example 1.

[0114] Example 5:

[0115] like Figure 6 FIG. 1 is a schematic diagram of a device for determining the offline status of a large number of geological disaster monitoring equipment according to an embodiment of the present invention. The device for determining the offline status of a large number of geological disaster monitoring equipment according to this embodiment includes one or more processors 61 and a memory 62. Figure 6 A processor 61 is taken as an example.

[0116] The processor 61 and the memory 62 may be connected via a bus or other means. Figure 6 The bus connection is taken as an example.

[0117] Memory 62, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs and non-volatile computer executable programs, such as the method for determining the offline status of large-scale geological hazard monitoring equipment in the above-mentioned embodiment. Processor 61 executes the method for determining the offline status of large-scale geological hazard monitoring equipment by running the non-volatile software program and instructions stored in memory 62.

[0118] The memory 62 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state memory device. In some embodiments, the memory 62 may optionally include a memory remotely located relative to the processor 61, and such remote memory may be connected to the processor 61 via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0119] The program instructions / modules are stored in the memory 62, and when executed by the one or more processors 61, the method for determining the offline status of the large-scale geological disaster monitoring equipment to be monitored in the above embodiment is executed, for example, the method described above is executed. Figures 1 to 5 The steps shown.

[0120] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for determining the offline status of large-scale geological disaster monitoring equipment, characterized in that: include: Obtain information of all devices to be monitored from the database, and create shadow devices associated with all devices to be monitored in the cache based on the information of all devices to be monitored, wherein the shadow devices are used to record the reporting time and status of the devices to be monitored; Set an offline countdown based on the allowed offline time for each device to be monitored; When the allowed offline duration is less than the first preset duration, the offline countdown duration is set to the allowed offline duration plus the first preset fault tolerance duration; When the allowed offline time is greater than or equal to the first preset time, the offline countdown time is set to the allowed offline time plus the second preset fault tolerance time; When the offline countdown ends and the shadow device has not updated the reporting time of the device to be monitored, the corresponding device to be monitored is offline and the device status to be monitored of the shadow device is updated; when the shadow device has updated the reporting time of the device to be monitored before the offline countdown ends, the device to be monitored is online and the device status to be monitored of the shadow device is updated, and the offline countdown is restarted.

2. The method for determining the offline status of large-scale geological disaster monitoring equipment according to claim 1 is characterized in that: The offline countdown is set according to the allowed offline time of each device to be monitored, specifically including: Devices to be monitored with the same offline time will be allowed to have the same offline countdown time. When there are two or more monitored devices with the same allowed offline time, the offline countdown time of all monitored devices with the same allowed offline time is set to the allowed offline time plus the same fault tolerance time, thereby ensuring that the offline countdown time of all monitored devices with the same allowed offline time is consistent, thereby alleviating program pressure.

3. The method for determining the offline status of large-scale geological disaster monitoring equipment according to claim 2 is characterized in that: The offline countdown is set according to the allowed offline duration of each device to be monitored, and further includes: Grouping the monitored devices whose offline duration is within a preset range into the same group, and setting the same offline countdown duration for the monitored devices in the same group; Obtaining a first device to be monitored with a minimum allowed offline duration in the same group, and a maximum fault-tolerant duration of the first device to be monitored; Obtain the second monitored device with the maximum allowed offline time in the same group; The offline countdown duration is less than or equal to the minimum allowed offline duration plus the maximum fault tolerance duration, and is greater than or equal to the maximum allowed offline duration.

4. The method for determining the offline status of large-scale geological disaster monitoring equipment according to claim 3 is characterized in that: When there is a third allowed offline duration of the third device to be monitored plus its fault tolerance duration exceeds each offline countdown duration corresponding to each current group, the method further includes: Obtain a third allowed offline duration and a corresponding fault tolerance duration for the third device to be monitored, and filter out corresponding offline countdown durations from the established groupings such that: n*i-th offline countdown duration <= third allowed offline duration <= (n+1)*i-th offline countdown duration, and (n+1)*i-th offline countdown duration - third allowed offline duration <= third fault tolerance duration; Divide the shadow device of the third device to be monitored into the i-th group represented by the i-th offline countdown duration, and set the offline countdown number thereof to n+1; Among them, each time the offline analysis result of the third monitored device is not reported after the i-th offline countdown is completed, the offline countdown number is reduced by 1; if the offline countdown number returns to zero, it is confirmed that the third monitored device is offline; if it is confirmed that the report of the third monitored device is received before the offline countdown returns to zero, the offline countdown number is reset to n+1.

5. The method for determining the offline status of large-scale geological disaster monitoring equipment according to claim 4 is characterized in that: When the number of monitored devices that have undergone multiple offline countdowns exceeds the preset upper limit of a group, a round of group update operation is performed to try to establish a new group for the monitored devices that originally completed offline countdowns through multiple offline countdowns.

6. The method for determining the offline status of large-scale geological disaster monitoring equipment according to claim 1 is characterized in that: When the number of devices to be monitored in the same reporting period is greater than the preset number, all devices to be monitored in the same reporting period are clustered, and the number of devices to be monitored in each cluster is less than or equal to the preset number. The initial reporting time points of devices to be monitored in different clusters are delayed for different lengths of time to ensure that devices to be monitored in different clusters report information at different time points, thereby receiving the reported information of devices to be monitored in different clusters in batches, reducing the pressure on the judgment program.

7. The method for determining the offline status of large-scale geological disaster monitoring equipment according to claim 1 is characterized in that: When the device status to be monitored of the shadow device is updated from online to offline or from offline to online, the device status to be monitored corresponding to the shadow device in the database is updated to the current device status to be monitored of the shadow device.

8. The method for determining the offline status of large-scale geological disaster monitoring equipment according to claim 1 is characterized in that: When the monitored device status of the shadow device is updated from online to offline or from offline to online, the shadow device is marked as unsynchronized; Establish a timed scheduling task, the scheduling period of which is a preset period. The timed scheduling task obtains all shadow devices with unsynchronized tags in the cache library, and synchronizes the device status to be monitored of all shadow devices with unsynchronized tags in the database to the current device status to be monitored of the shadow devices, and at the same time changes all shadow devices with unsynchronized tags to synchronized tags.

9. A device for determining the offline status of large-scale geological disaster monitoring equipment, characterized in that: It includes at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the processor to execute the offline status determination method for large-scale geological disaster monitoring equipment to be monitored as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Equipment shadow management method and method for monitoring equipment by applying equipment shadow management method

    CN114490759A