Equipment monitoring method and equipment monitoring device based on rule engine and electronic fence
By using the rules engine and distributed stream processing platform on the Internet of Things platform, preprocessing of device positioning data and judgment of electronic fences is achieved, and the problems of low scalability and high cost of electronic fence monitoring in the existing technology are solved, and low-cost electronic fence monitoring in different scenarios are realized.
Patent Information
- Application Number
- CN202510197825.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-21
- Publication Date
- 2025-05-27
AI Technical Summary
There is a lack of a method for implementing electronic fence monitoring in different scenarios at a low cost in the prior art, resulting in low scalability, high cost and difficult to reuse.
The equipment monitoring method based on the rules engine and electronic fence is adopted. Through the distributed stream processing platform and the rules engine of the Internet of Things platform, the preprocessing of the device positioning data and the judgment of the electronic fence are controlled to determine whether the device exceeds the preset electronic fence, and alarm operations are carried out when necessary.
It reduces the amount of data interaction between the device and the Internet of Things platform, reduces the requirements for networks and devices, improves the reusability and scalability of electronic fences, and realizes low-cost electronic fence monitoring in different scenarios.
Smart Images

Figure CN120050600A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of the Internet of Things, and in particular, to a device monitoring method, a device monitoring device, a computer-readable storage medium, and a device monitoring system based on a rule engine and an electronic fence. Background Art
[0002] Currently, most of the electronic fence methods are designed for a single scenario. The high degree of customization and coupling results in low scalability. When adding a new scenario, it can only be redesigned, with low versatility and high cost.
[0003] The Internet of Things is an intelligent service system that connects things, people, systems, and information resources through sensing devices according to agreed protocols, and realizes the processing and response to information in the physical and virtual worlds. The Internet of Things platform provides a unified access service, control service, and data service for Internet of Things sensing devices by integrating various Internet of Things technologies, such as sensor technology, geofencing technology, media data collection, etc. Its main functional modules include device access, device management, product management, message communication, rule engine, etc.
[0004] The rule engine has the characteristics of flexible configuration and high customization for processing complex events. Only need to customize the corresponding rule nodes and rule chains. The rule chain matches the specific application scenario to determine the data flow path, and the rule nodes implement the specific processing logic. Different rule nodes are independent of each other, and only the relationship between the rule nodes is defined in the rule chain. Therefore, when adding a new scenario, the original rule nodes can be reused, and only a new rule chain and the rule nodes with additional processing logic need to be added.
[0005] Therefore, implementing the electronic fence technology based on the rule engine can obviously avoid the customization and coupling of the electronic fence and the usage scenario, and achieve high reusability of the electronic fence. However, there is no method in the prior art to use the rule engine for the implementation of the electronic fence. Summary of the Invention
[0006] The main purpose of this application is to provide a device monitoring method, a device monitoring device, a computer-readable storage medium, and a device monitoring system based on a rule engine and an electronic fence, so as to at least solve the problem in the prior art that there is a lack of a method for implementing electronic fence monitoring in different scenarios at low cost.
[0007] To achieve the above object, according to one aspect of the present application, a device monitoring method based on a rule engine and an electronic fence is provided. The Internet of Things platform includes a distributed stream processing platform and a rule engine, and the rule engine includes a filtering node and an event node. The method includes controlling the distributed stream processing platform to obtain device positioning data from each device to obtain the first device positioning; controlling the rule engine to grab the first device positioning from the distributed stream processing platform, controlling the filtering node to preprocess the first device positioning to obtain the second device positioning, and judging according to the second device positioning and a preset electronic fence to determine whether the device exceeds the preset electronic fence; in the case where the device exceeds the electronic fence, controlling the event node to perform an alarm operation according to the second device positioning and the preset electronic fence.
[0008] Optionally, before judging according to the second device positioning and the preset electronic fence to determine whether the device exceeds the electronic fence, the method includes obtaining the preset positioning data of each device to obtain the third device positioning; taking the third device positioning as the geometric center and drawing a corresponding closed figure to obtain the preset electronic fence, wherein the closed figure is a circle or a polygon; inputting the preset electronic fence into the filtering node of the rule engine.
[0009] Optionally, after taking the third device positioning as the geometric center and drawing a corresponding closed figure to obtain the preset electronic fence, the method further includes, in the case where there is an overlapping area between different preset electronic fences, drawing a target line segment starting from the geometric center of any preset electronic fence with an overlapping area and ending at the geometric center of the other preset electronic fence where the overlapping area is located; dividing the overlapping area with the midpoint of the target line segment as the boundary to obtain a plurality of target areas, and dividing the target areas into the preset electronic fence corresponding to the geometric center with the smallest distance from the boundary of the target area.
[0010] Optionally, the filtering node includes a first rule node and a second rule node. Controlling the filtering node to preprocess the first device positioning to obtain the second device positioning and judging according to the second device positioning and the preset electronic fence to determine whether the device exceeds the preset electronic fence includes controlling the first rule node to perform integrity verification and data format verification on the first device positioning, and in the case where the verification passes, performing data cleaning on the first device positioning and performing authentication on the first device positioning after data cleaning, and in the case where the authentication passes, determining the first device positioning as the second device positioning; controlling the second rule node to mark the second device positioning in the preset map and determining whether the device exceeds the preset electronic fence according to the mark and the preset electronic fence.
[0011] Optionally, the filtering node further includes a third rule node. After controlling the second rule node to mark according to the second device location in the preset map and determining whether the device exceeds the preset electronic fence based on the mark and the preset electronic fence, the method further includes controlling the third rule node to generate a target identifier and send it to the event node when the device exceeds the preset electronic fence; controlling the third rule node to store the second device location in the preset location when the device does not exceed the preset electronic fence.
[0012] Optionally, the event node includes a fourth rule node, a fifth rule node, and a sixth rule node. When the device exceeds the electronic fence, controlling the event node to perform an alarm operation according to the second device location and the preset electronic fence, including controlling the fourth rule node to determine the corresponding second device location and the preset electronic fence according to the target identifier when receiving the target identifier; controlling the fifth rule node to query the target mapping relationship according to the preset electronic fence to obtain the target path, where the target mapping relationship is the mapping relationship between the name of the preset electronic fence and the preset sending path of the alarm information in the alarm operation; controlling the sixth rule node to generate alarm information according to the second device location and send it according to the target path.
[0013] Optionally, before controlling the fifth rule node to query the target mapping relationship according to the preset electronic fence to obtain the target path, the method further includes determining the communication device corresponding to the corresponding management personnel according to each device to obtain the target device; determining the corresponding preset sending path according to each target device; and determining the target mapping relationship based on the association relationship between each preset electronic fence and the preset sending path.
[0014] According to another aspect of the present application, there is provided a device monitoring device based on a rule engine and an electronic fence. The Internet of Things platform includes a distributed stream processing platform and a rule engine. The rule engine includes a filtering node and an event node. The device monitoring device includes a first control unit for controlling the distributed stream processing platform to obtain device location data from each device to obtain a first device location; a second control unit for controlling the rule engine to grab the first device location from the distributed stream processing platform, controlling the filtering node to preprocess the first device location to obtain a second device location, and judging according to the second device location and the preset electronic fence to determine whether the device exceeds the preset electronic fence; a third control unit for controlling the event node to perform an alarm operation according to the second device location and the preset electronic fence when the device exceeds the electronic fence.
[0015] According to still another aspect of the present application, there is provided a computer-readable storage medium, where the computer-readable storage medium includes a stored program, and when the program runs, it controls the device where the computer-readable storage medium is located to execute any one of the above methods.
[0016] According to another aspect of the present application, there is provided a device monitoring system, including: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include those for executing any one of the above methods.
[0017] Applying the technical solution of the present application, in the above device monitoring method based on a rule engine and an electronic fence, first, the distributed stream processing platform is controlled to obtain device positioning data from each device to obtain the first device positioning; then, the rule engine is controlled to grab the first device positioning from the distributed stream processing platform, and the filtering node is controlled to preprocess the first device positioning to obtain the second device positioning, and the second device positioning is judged against the preset electronic fence to determine whether the device exceeds the preset electronic fence; finally, in the case where the device exceeds the electronic fence, the event node is controlled to perform an alarm operation according to the second device positioning and the preset electronic fence. In the present application, the electronic fence is implemented through the Internet of Things platform. The device is only responsible for collecting its own positioning data, and the monitoring function of the electronic fence is jointly performed by the distributed stream processing platform and the rule engine configured on the Internet of Things platform. The amount of data exchanged between the device and the Internet of Things platform is reduced during the data interaction process, the requirements for the network and the device are lowered, and the high coupling between the electronic fence and the application scenario is avoided based on the Internet of Things, improving the reusability and solving the problem in the prior art that there is a lack of a method for implementing electronic fence monitoring in different scenarios at low cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 The hardware structure block diagram of a mobile terminal showing a device monitoring method based on a rule engine and an electronic fence provided in an embodiment of the present application is shown;
[0019] Figure 2 The flowchart showing a device monitoring method based on a rule engine and an electronic fence provided in an embodiment of the present application is shown;
[0020] Figure 3 The structural diagram showing a device monitoring system provided in an embodiment of the present application is shown;
[0021] Figure 4 The structural block diagram showing a device monitoring device based on a rule engine and an electronic fence provided in an embodiment of the present application is shown.
[0022] Among them, the above drawings include the following reference numerals:
[0023] 102. Processor; 104. Memory; 106. Transmission device; 108. Input / output device. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0024] It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments may be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances for the embodiments of the present application described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily need to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0027] For the convenience of description, some nouns or terms involved in the embodiments of the present application are described below:
[0028] Distributed stream processing platform: The Distributed Stream Processing Platform is a platform for real-time data processing, which can process large-scale data streams and can run in parallel on multiple nodes. It usually includes functions such as collection, processing, analysis, and storage of stream data.
[0029] Rule engine: The rule engine is an easy-to-use workflow framework developed based on events, mainly composed of Message (message), Rule Node (rule node), and Rule Chain (rule chain).
[0030] Filter node and event node: A type of rule node. A rule node is the basic component of the rule engine that processes a single input message each time and generates one or more output messages.
[0031] Rule chain: The rule chain is a logical group of rule nodes and their relationships.
[0032] As introduced in the background art, most of the existing electronic fence methods are designed for single scenarios. The high degree of customization and coupling lead to low scalability. The rule engine has the characteristics of being able to be flexibly configured while achieving a high degree of customization in processing complex events. To address the problem that there is a lack of a method for low-cost implementation of electronic fence monitoring for different scenarios in the existing technology, embodiments of the present application provide a device monitoring method, a device monitoring device, a computer-readable storage medium, and a device monitoring system based on a rule engine and an electronic fence.
[0033] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention.
[0034] The method embodiments provided in the embodiments of the present application can be executed on a mobile terminal, a computer terminal, or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 is a hardware structure block diagram of a mobile terminal of a device monitoring method based on a rule engine and an electronic fence according to an embodiment of the present invention. As Figure 1 shown, the mobile terminal may include one or more ( Figure 1 only one is shown in the figure) processors 102 (the processors 102 may include, but are not limited to, processing devices such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Among them, the above mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 1 the structure shown is only illustrative and does not limit the structure of the above mobile terminal. For example, the mobile terminal may further include more or fewer components than those Figure 1 shown in the figure, or have a different configuration from that Figure 1 shown in the figure.
[0035] The memory 104 can be used to store computer programs, such as software programs and modules of application software, such as the computer program corresponding to the device monitoring method based on a rule engine and an electronic fence in the embodiments of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely disposed relative to the processor 102, and these remote memories can be connected to the mobile terminal through a network. Examples of the above networks include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof. The transmission device 106 is used to receive or send data via a network. Specific examples of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one instance, the transmission device 106 includes a network adapter (Network Interface Controller, abbreviated as NIC), which can be connected to other network devices through a base station and thus can communicate with the Internet. In one instance, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0036] In this embodiment, a device monitoring method based on a rule engine and an electronic fence running on a mobile terminal, a computer terminal, or a similar computing device is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.
[0037] Figure 2 It is a flowchart of a device monitoring method based on a rule engine and an electronic fence according to an embodiment of the present application.
[0038] As Figure 2 shown, the method includes the following steps:
[0039] Step S201, control the distributed stream processing platform to obtain device location data from each device to obtain a first device location;
[0040] Specifically, the role of the distributed stream processing platform is to collect and process real-time data streams from various devices. In the present invention, it is responsible for obtaining device location data from each device, and such data includes, but is not limited to, the longitude and latitude information of the device. The obtained data is referred to as "the first device location". Due to the large number of devices and the huge amount of data, the distributed stream processing platform can ensure the real-time nature of the data and the efficiency of processing.
[0041] In one embodiment, the Internet of Things platform of the present application is as Figure 3 shown. The Internet of Things platform includes a distributed stream processing platform (Kafka) and a rules engine. In the rules engine, an electronic fence rule chain is configured according to the execution order of the electronic fence to implement the data processing of the electronic fence. Moreover, to achieve the data stream throughput of multiple devices, the Internet of Things platform receives the location data uploaded by each device through the distributed stream processing platform.
[0042] Step S202: Control the rules engine to grab the first device location from the distributed stream processing platform, control the filtering node to preprocess the first device location to obtain the second device location, and determine whether the device exceeds the preset electronic fence according to the second device location and the preset electronic fence.
[0043] Specifically, the rules engine grabs the first device location data from the distributed stream processing platform. The rule nodes inside the rules engine include a filtering node (Filter Node) and an event node (Action Node). The filtering node first preprocesses the first device location data, which includes steps such as data cleaning, decryption, and device authentication, to ensure the accuracy and security of the data. The preprocessed data is referred to as "the second device location". The purpose of the preprocessing is to make the data more accurate and reliable, thereby avoiding false alarms or missed alarms. The filtering node in the rules engine will match the second device location with the preset electronic fence rules to determine whether the device exceeds the range of the preset electronic fence. The electronic fence is a virtual boundary preset by the Internet of Things platform and can be drawn through a graphical interface, and its shape and size can be flexibly adjusted according to actual needs. If the second device location shows that the device position is outside the electronic fence, the rules engine will enter the next step of processing.
[0044] Step S203: In the case where the device exceeds the electronic fence, control the event node to perform an alarm operation according to the second device location and the preset electronic fence.
[0045] Specifically, if the device exceeds the preset electronic fence, the event node in the control rule engine performs an alarm operation, which includes generating an alarm message and sending the alarm message to a specified recipient. The type and method of the alarm operation can be configured according to different application scenarios. For example, the alarm can be sent via SMS, email, or application notification. This series of operations ensures that when the device crosses the boundary, relevant personnel can be notified in a timely manner so that corresponding measures can be taken.
[0046] Through this embodiment, first, the distributed stream processing platform is controlled to obtain device location data from each device to obtain the first device location; then, the rule engine is controlled to capture the first device location from the distributed stream processing platform, and the filtering node is controlled to preprocess the first device location to obtain the second device location, and determine whether the device exceeds the preset electronic fence based on the second device location and the preset electronic fence; finally, in the case where the device exceeds the electronic fence, the event node is controlled to perform an alarm operation according to the second device location and the preset electronic fence. In this application, the electronic fence is implemented through the Internet of Things platform. The device is only responsible for collecting its own location data, and the monitoring function of the electronic fence is jointly performed by the distributed stream processing platform and the rule engine configured on the Internet of Things platform. During the data interaction process, the amount of data exchanged between the device and the Internet of Things platform is reduced, the requirements for the network and the device are lowered, and the high coupling between the electronic fence and the application scenario is avoided based on the Internet of Things, improving the reusability and solving the problem in the prior art that there is a lack of a method for implementing electronic fence monitoring in different scenarios at low cost.
[0047] In a specific embodiment, when an enterprise monitors devices, for example, the enterprise purchases devices with GPS positioning functions for field construction. To ensure the safety of the devices, an electronic fence is set up for monitoring. The front-end page of the Internet of Things platform is used to draw the electronic fence, which is set as a circular area with a radius of 500 meters around each device. After the device starts working, the real-time GPS data is sent to Kafka (distributed stream processing platform) of the Internet of Things platform. Kafka pushes the data to the rule engine. The filtering node in the rule engine first decrypts the data, cleans up invalid or incorrect data, and then performs device authentication to ensure that the data comes from a legitimate device. After the authentication passes, the filtering node determines whether the GPS position of the device exceeds the range of the electronic fence. If the device leaves the warehouse by more than 500 meters, the event node in the rule engine will be triggered to automatically send an alarm message to the device management department to notify them that the device may be stolen or misused.
[0048] In an alternative implementation manner for setting the electronic fence, before determining whether the device exceeds the electronic fence based on the second device location and the preset electronic fence, the method includes:
[0049] Step S301: Obtain the preset positioning data of each device to get the third device positioning.
[0050] Specifically, obtain the preset positioning data of each device, and this data is called "the third device positioning".
[0051] Step S302: Draw a corresponding closed figure with the third device positioning as the geometric center to obtain a preset electronic fence, where the closed figure is a circle or a polygon.
[0052] Specifically, draw a corresponding closed figure, such as a circle or a polygon, with the third device positioning as the geometric center to define the boundary of the preset electronic fence.
[0053] Step S303: Input the preset electronic fence into the filtering node of the rule engine.
[0054] Specifically, input the preset electronic fence into the filtering node of the rule engine so that the rule engine can accurately determine whether a device crosses the boundary when processing the real-time position data of the device.
[0055] In a specific embodiment, assume that the company needs to set up an electronic fence to prevent the illegal movement of devices. First, obtain the preset positioning data of the devices through the Internet of Things platform, that is, the initial installation position of the devices, which is the above-mentioned third device positioning. On the front-end page of the Internet of Things platform, a circular electronic fence can be drawn with the initial position of the device as the geometric center and a radius of 500 meters to represent the safe range of the device in the warehouse. After the drawing is completed, the definition of this circular electronic fence will be input into the filtering node of the rule engine.
[0056] It can be understood that when the device starts to run and sends real-time position data, the distributed stream processing platform of the Internet of Things platform will collect this data. The rule engine then grabs the data from the stream processing platform, and the filtering node will preprocess the real-time position data, including data decryption, cleaning, and authentication, to ensure the accuracy and security of the data. The data after preprocessing becomes "the second device positioning". At this time, the filtering node of the rule engine uses the previously input preset electronic fence definition to judge the second device positioning to see if the device exceeds the 500-meter circular area. If the device crosses the boundary, the rule engine will trigger the event node to perform an alarm operation and notify relevant personnel to take measures.
[0057] To prevent the above-mentioned preset electronic fences from overlapping, in an optional implementation manner, after drawing a corresponding closed figure with the third device positioning as the geometric center to obtain a preset electronic fence, the method further includes:
[0058] Step S401, when there is an overlapping area between different preset electronic fences, draw a target line segment starting from the geometric center of any preset electronic fence with an overlapping area and ending at the geometric center of the other preset electronic fence where the overlapping area is located;
[0059] Specifically, when there are multiple preset electronic fences and there are overlapping areas between these electronic fences, the method of the present invention proposes to optimize the overlapping areas. First, draw a target line segment starting from the geometric center of any preset electronic fence with an overlapping area and ending at the geometric center of the other preset electronic fence where the overlapping area is located. This line segment will be used as the basis for dividing the overlapping area.
[0060] Step S402, divide the overlapping area with the midpoint of the target line segment as the boundary to obtain multiple target areas, and divide the target areas into the preset electronic fences corresponding to the geometric centers with the smallest distance from the boundaries of the target areas.
[0061] Specifically, divide the overlapping area with the midpoint of the target line segment as the boundary to obtain multiple target areas, and the division of each target area will be based on the preset electronic fence corresponding to the geometric center with the smallest distance from the boundary of the target area.
[0062] Through this embodiment, we can see that when the method of the present invention processes the overlapping areas of multiple electronic fences, by drawing the target line segment and dividing the overlapping areas, it realizes the reasonable division of the target areas within the overlapping areas, ensures that each target area can be monitored by the most suitable preset electronic fence, thereby improving the overall efficiency and accuracy of the electronic fence monitoring system, and providing a more efficient and accurate solution for device monitoring in multiple enterprises or multiple application scenarios.
[0063] In order to determine whether the device exceeds the preset range according to the real-time positioning of the device, in an optional implementation manner, the above step S202 includes:
[0064] Step S2021, control the first rule node to perform integrity verification and data format verification on the first device positioning. When the verification passes, perform data cleaning on the first device positioning, and perform authentication on the first device positioning after data cleaning. When the authentication passes, determine the first device positioning as the second device positioning;
[0065] Specifically, the first rule node first performs integrity verification and data format verification on the first device positioning data sent by the slave device. This step is to ensure that the received data is complete and conforms to the preset format, avoiding inaccurate monitoring caused by missing data or incorrect formats. If the data passes the integrity verification and data format verification, the first rule node will perform data cleaning to remove invalid or redundant information, and then perform an authentication operation to verify the legitimacy of the device identity. Only the positioning data that has passed authentication and is legal will be recognized as the second device positioning for subsequent electronic fence judgment.
[0066] Step S2022, control the second rule node to mark according to the second device positioning in the preset map, and determine whether the device exceeds the preset electronic fence according to the mark and the preset electronic fence.
[0067] Specifically, the second rule node receives the second device positioning data processed and authenticated by the first rule node. Next, it marks the device in the preset electronic map, that is, displays the real-time position of the device as a point on the map. Subsequently, the second rule node determines whether the device exceeds the set range according to the mark on the map and the preset electronic fence. If the position mark of the device falls outside the electronic fence, the second rule node will trigger the event node to perform corresponding alarm operations, such as sending an alarm notification to the device management department to prompt that the device may be stolen or illegally moved.
[0068] To reduce unnecessary data flow, in an optional implementation manner, after controlling the second rule node to mark according to the second device positioning in the preset map and determining whether the device exceeds the preset electronic fence according to the mark and the preset electronic fence, the method further includes:
[0069] Step S501, control the third rule node to generate a target identifier and send it to the event node when the device exceeds the preset electronic fence;
[0070] Specifically, if the second rule node determines that the device position data exceeds the preset electronic fence range, a signal will be sent to the third rule node. After receiving the out-of-bounds signal from the second rule node, the third rule node will generate a target identifier, and the above target identifier includes specific information about the device out-of-bounds, such as device ID, out-of-bounds time, current position, etc. Subsequently, the third rule node sends this target identifier to the event node, and the event node performs an alarm operation, such as sending an alarm notification to the device management department, to ensure that the device security is responded to in a timely manner.
[0071] Step S502, control the third rule node to store the second device positioning in a preset position when the device does not exceed the preset electronic fence.
[0072] Specifically, if the second rule node determines that the device has not exceeded the preset electronic fence, that is, the device location is still within the safe area, the third rule node will not generate a target identifier. Instead, it will store the second device location data at a preset location, such as the database of the Internet of Things platform. This operation retains the real-time location information of the device, providing basic data support for subsequent device location tracking, data analysis, and report generation, and also contributing to the long-term operation and maintenance of the monitoring system.
[0073] Through the above embodiments, we can clearly understand the two key functions of the third rule node in the method of the present invention after the electronic fence judgment: generating a target identifier and triggering an alarm operation when the device exceeds the preset electronic fence; storing the device location data when the device does not exceed the electronic fence, providing a basis for subsequent data analysis and device management. This design ensures the efficient operation of the device monitoring system, while meeting the dual requirements of data storage and security monitoring, and avoiding unnecessary data streams.
[0074] To perform the alarm operation, in an optional embodiment, the above step S203 includes:
[0075] Step S2031, controlling the fourth rule node to determine the corresponding second device location and the preset electronic fence according to the target identifier when receiving the target identifier;
[0076] Specifically, when the Internet of Things platform detects that the real-time location data of the device (i.e., the second device location) exceeds the range of the preset electronic fence, the third rule node generates a target identifier and sends it to the event node. At this time, after receiving the target identifier, the fourth rule node will determine the corresponding second device location and the preset electronic fence according to the information in the identifier, such as the device ID and the time of crossing the boundary. This process ensures that the event node can accurately identify the specific location of the device that crosses the boundary and the boundary of the electronic fence, providing accurate information for subsequent alarm operations.
[0077] Step S2032, controlling the fifth rule node to query the target mapping relationship according to the preset electronic fence to obtain the target path, where the target mapping relationship is the mapping relationship between the name of the preset electronic fence and the preset sending path of the alarm information in the alarm operation;
[0078] Specifically, once the fourth rule node confirms the specific situation of the device crossing the boundary, the fifth rule node will query the target mapping relationship according to the preset electronic fence to determine the sending path of the alarm information. The target mapping relationship is a preset rule that, based on the name of the electronic fence, specifies to which recipients the alarm information should be sent and by what communication means when the device exceeds the electronic fence. For example, if the warehouse electronic fence is named "Warehouse Safety Area", the corresponding target mapping relationship may include the device management department and the security team, and the alarm is sent via email and text message.
[0079] Step S2033, control the sixth rule node to generate alarm information based on the second device location and send it along the target path.
[0080] Specifically, the sixth rule node is responsible for generating alarm information based on the second device location. The alarm information usually includes key information such as the device ID, the time of crossing the boundary, and the current exact location. After generating the alarm information, the sixth rule node will follow the target path determined by the fifth rule node and send the alarm information to the designated recipients. For example, in the case of a device exceeding the "Warehouse Safety Area" electronic fence, the alarm information will be sent to the device management department and the security team in a timely manner via the preset email and text message alarm paths so that they can take prompt countermeasures to ensure the safety of the device.
[0081] From these embodiments, we can see that the event nodes of the present invention achieve efficient and accurate alarm operations for devices exceeding the electronic fence through the collaborative work of the fourth, fifth, and sixth rule nodes. The processing flow of this series of nodes ensures the accurate generation, reasonable path query, and timely sending of alarm information, providing strong protection for the safety of devices and personnel. At the same time, through the flexible configuration of the rule engine, this alarm operation can adapt to different scenario requirements, demonstrating the broad application potential of the present invention in the field of electronic fence monitoring.
[0082] To configure the above target mapping relationship, in an optional implementation manner, before controlling the fifth rule node to query the target mapping relationship according to the preset electronic fence to obtain the target path, the method further includes:
[0083] Step S601, determine the communication devices corresponding to the corresponding management personnel for each device to obtain the target devices;
[0084] Specifically, the Internet of Things platform determines the corresponding management personnel for each device according to the attributes and management requirements of enterprise devices. For example, for the devices in the warehouse, they may be monitored by the specialists in the device management department; for the devices in the office area, they may be managed by the administrators in the IT department. Then, the platform determines their corresponding communication devices according to the list of management personnel, such as email addresses, mobile phone numbers, or enterprise instant messaging software accounts, etc. These communication devices are recorded as the target devices for receiving the warning information of device out-of-bounds.
[0085] Step S602, determine the corresponding preset sending paths respectively according to each target device;
[0086] Specifically, for each target device, the Internet of Things platform defines a preset sending path, that is, the specific way to send the warning information to this device. For example, for the email address of the specialist in the device management department, the preset sending path may be set to send the warning by email; for the mobile phone number of the administrator in the IT department, the preset sending path may be set to send a text message warning.
[0087] Step S603, determine the target mapping relationship based on the association relationship between each preset electronic fence and the preset sending path.
[0088] Specifically, after determining the target device and the preset sending path, the Internet of Things platform establishes a target mapping relationship based on the association relationship between each preset electronic fence and the preset sending path. This relationship clarifies which management personnel and their target devices the warning information should be sent to when a specific electronic fence is triggered, and through which preset sending path to send. For example, for the electronic fence of the "warehouse safety area", its target mapping relationship may be set to send a warning to the email of the specialist in the device management department; while for the electronic fence of the "office area safety area", it may be set to send a text message warning to the mobile phone number of the administrator in the IT department.
[0089] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order from here.
[0090] The embodiments of the present application also provide a device monitoring apparatus based on a rule engine and an electronic fence. It should be noted that the device monitoring apparatus based on the rule engine and the electronic fence in the embodiments of the present application can be used to execute the device monitoring method based on the rule engine and the electronic fence provided by the embodiments of the present application. The apparatus is used to implement the above embodiments and preferred embodiments, and those that have been described will not be repeated. As used hereinafter, the term "module" can be a combination of software and / or hardware that realizes a predetermined function. Although the apparatuses described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0091] The following introduces the device monitoring apparatus based on the rule engine and the electronic fence provided by the embodiments of the present application.
[0092] Figure 4 It is a structural block diagram of the device monitoring apparatus based on the rule engine and the electronic fence according to the embodiments of the present application. As Figure 4 shown, the apparatus includes:
[0093] A first control unit 10, configured to control the distributed stream processing platform to obtain device location data from each device, and obtain a first device location;
[0094] Specifically, the role of the distributed stream processing platform is to collect and process real-time data streams from various devices. In the present invention, it is responsible for obtaining device location data from each device, and these data include, but are not limited to, the longitude and latitude information of the device. The obtained data is called "the first device location". Due to the large number of devices and the huge amount of data, the distributed stream processing platform can ensure the real-time nature of the data and the efficiency of processing.
[0095] In one embodiment, the Internet of Things platform of the present application is as Figure 3 shown. The Internet of Things platform includes a distributed stream processing platform (Kafka) and a rule engine. In the rule engine, an electronic fence rule chain is configured according to the execution order of the electronic fence to implement data processing of the electronic fence. And, to achieve the data stream throughput of multiple devices, the Internet of Things platform receives the location data uploaded by each device through the distributed stream processing platform.
[0096] A second control unit 20, configured to control the rule engine to grab the first device location from the distributed stream processing platform, control the filtering node to preprocess the first device location to obtain a second device location, and determine whether the device exceeds the preset electronic fence according to the second device location and the preset electronic fence;
[0097] Specifically, the rule engine fetches the first device location data from the distributed stream processing platform. The rule nodes within the rule engine include a filter node (Filter Node) and an action node (Action Node). The filter node first preprocesses the first device location data, which includes steps such as data cleaning, decryption, and device authentication, to ensure the accuracy and security of the data. The preprocessed data is called "second device location". The purpose of preprocessing is to make the data more accurate and reliable, thus avoiding false alarms or missed alarms. The filter node in the rule engine matches the second device location with the preset electronic fence rules to determine whether the device has exceeded the range of the preset electronic fence. The electronic fence is a virtual boundary preset by the Internet of Things platform, which can be drawn through a graphical interface, and its shape and size can be flexibly adjusted according to actual needs. If the second device location shows that the device is outside the electronic fence, the rule engine will proceed to the next step of processing.
[0098] The third control unit 30 is used to control the action node to perform an alarm operation according to the second device location and the preset electronic fence when the device exceeds the electronic fence.
[0099] Specifically, if the device exceeds the preset electronic fence, the action node in the rule engine is controlled to perform an alarm operation, which includes generating an alarm message and sending the alarm message to a specified recipient. The type and method of the alarm operation can be configured according to different application scenarios. For example, it can be alarmed through text messages, emails, or application notifications. This series of operations ensures that when the device crosses the boundary, relevant personnel can be notified in a timely manner so that corresponding measures can be taken.
[0100] Through this embodiment, the first control unit controls the distributed stream processing platform to obtain device location data from each device to obtain the first device location; the second control unit controls the rule engine to fetch the first device location from the distributed stream processing platform, controls the filter node to preprocess the first device location to obtain the second device location, and judges according to the second device location and the preset electronic fence to determine whether the device exceeds the preset electronic fence; the third control unit controls the action node to perform an alarm operation according to the second device location and the preset electronic fence when the device exceeds the electronic fence. In this application, the electronic fence is implemented through the Internet of Things platform. The device is only responsible for collecting its own location data. The monitoring function of the electronic fence is jointly carried out by the distributed stream processing platform and the rule engine configured on the Internet of Things platform. During the data interaction process, the amount of data exchanged between the device and the Internet of Things platform is reduced, the requirements for the network and the device are lowered, and the high coupling between the electronic fence and the application scenario is avoided based on the Internet of Things, improving the reusability and solving the problem in the prior art that there is a lack of a method for low-cost implementation of electronic fence monitoring in different scenarios.
[0101] In a specific embodiment, when an enterprise conducts equipment monitoring, for example, the enterprise purchases equipment with GPS positioning function for field construction. To ensure the safety of the equipment, an electronic fence is set up for monitoring. The front-end page of the Internet of Things platform is used to draw the electronic fence, which is set as a circular area with a radius of 500 meters around each device. After the device starts working, the real-time GPS data is sent to Kafka (a distributed stream processing platform) of the Internet of Things platform. Kafka pushes the data to the rule engine. The filtering node in the rule engine first decrypts the data, cleans up invalid or incorrect data, and then conducts device authentication to ensure that the data comes from a legitimate device. After the authentication passes, the filtering node determines whether the GPS position of the device exceeds the range of the electronic fence. If the device leaves the warehouse by more than 500 meters, the event node in the rule engine will be triggered, and an alarm message will be automatically sent to the device management department to notify them that the device may be stolen or misused.
[0102] In an alternative implementation manner for setting the electronic fence, the device further includes:
[0103] A first acquisition unit, configured to obtain the preset positioning data of each device to obtain the third device positioning before determining whether the device exceeds the electronic fence according to the second device positioning and the preset electronic fence;
[0104] Specifically, the preset positioning data of each device is obtained, and this data is called "the third device positioning".
[0105] A first processing unit, configured to draw a corresponding closed figure with the third device positioning as the geometric center to obtain the preset electronic fence, where the closed figure is a circle or a polygon;
[0106] Specifically, a corresponding closed figure, such as a circle or a polygon, is drawn with the third device positioning as the geometric center to define the boundary of the preset electronic fence.
[0107] A first sending unit, configured to input the preset electronic fence into the filtering node of the rule engine.
[0108] Specifically, the preset electronic fence is input into the filtering node of the rule engine so that the rule engine can accurately determine whether the device crosses the boundary when processing the real-time position data of the device.
[0109] In a specific embodiment, assume that the company needs to set up an electronic fence to prevent the illegal movement of the device. First, obtain the preset positioning data of the device through the Internet of Things platform, that is, the initial installation position of the device, namely the above-mentioned third device positioning. On the front-end page of the Internet of Things platform, a circular electronic fence can be drawn with the initial position of the device as the geometric center and a radius of 500 meters to represent the safe range of the device in the warehouse. After the drawing is completed, the definition of this circular electronic fence will be input into the filtering node of the rule engine.
[0110] It can be understood that when the device starts running and sends real-time position data, the distributed stream processing platform of the Internet of Things platform will collect this data. Subsequently, the rule engine grabs the data from the stream processing platform, and the filtering node will preprocess the real-time position data, including data decryption, cleaning, and authentication, to ensure the accuracy and security of the data. The data after preprocessing becomes the "second device positioning". At this time, the filtering node of the rule engine uses the previously input preset electronic fence definition to judge the second device positioning to see if the device exceeds the 500-meter circular area. If the device crosses the boundary, the rule engine will trigger the event node to perform an alarm operation and notify relevant personnel to take measures.
[0111] To prevent the above-mentioned preset electronic fences from overlapping, in an alternative embodiment, the device further includes:
[0112] A second processing unit, configured to, after drawing a corresponding closed figure with the third device positioning as the geometric center to obtain a preset electronic fence, when there is an overlapping area between different preset electronic fences, draw a target line segment starting from the geometric center of any preset electronic fence with an overlapping area and ending at the geometric center of another preset electronic fence where the overlapping area is located;
[0113] Specifically, when there are multiple preset electronic fences and there are overlapping areas between these electronic fences, the method of the present invention proposes to perform optimization processing on the overlapping areas. First, draw a target line segment starting from the geometric center of any preset electronic fence with an overlapping area and ending at the geometric center of another preset electronic fence where the overlapping area is located. This line segment will be used as the benchmark for dividing the overlapping area.
[0114] A third processing unit, configured to divide the overlapping area with the midpoint of the target line segment as the boundary to obtain multiple target areas, and divide the target areas into the preset electronic fences corresponding to the geometric center with the smallest distance from the boundary of the target area.
[0115] Specifically, divide the overlapping area with the midpoint of the target line segment as the boundary to obtain multiple target areas, and the division of each target area will be based on the preset electronic fence corresponding to the geometric center with the smallest distance from the boundary of the target area.
[0116] Through this embodiment, we can see that when the method of the present invention processes the overlapping area of multiple electronic fences, by drawing target line segments and dividing the overlapping area, a reasonable division of the target area within the overlapping area is achieved, ensuring that each target area can be monitored by the most suitable preset electronic fence, thereby improving the overall efficiency and accuracy of the electronic fence monitoring system and providing a more efficient and accurate solution for device monitoring in multiple enterprises or multiple application scenarios.
[0117] In an optional implementation manner, to determine whether a device exceeds a preset range based on the real-time positioning of the device, the above-mentioned second control unit includes:
[0118] A first processing module, configured to control a first rule node to perform integrity verification and data format verification on the first device positioning. When the verification is passed, perform data cleaning on the first device positioning, and perform authentication on the first device positioning after data cleaning. When the authentication is passed, determine the first device positioning as the second device positioning;
[0119] Specifically, the first rule node first performs integrity verification and data format verification on the first device positioning data sent by the device. This step is to ensure that the received data is complete and conforms to the preset format, avoiding inaccurate monitoring caused by data loss or format errors. If the data passes the integrity verification and data format verification, the first rule node will perform data cleaning to remove invalid or redundant information, and then perform an authentication operation to verify the legitimacy of the device identity. Only the authenticated and legitimate positioning data will be recognized as the second device positioning for subsequent electronic fence judgment.
[0120] A second processing module, configured to control a second rule node to mark the second device positioning in a preset map, and determine whether the device exceeds the preset electronic fence according to the mark and the preset electronic fence.
[0121] Specifically, the second rule node receives the second device positioning data processed and authenticated by the first rule node. Next, it marks the device in the preset electronic map, that is, displays the real-time position of the device as a point on the map. Subsequently, the second rule node determines whether the device exceeds the set range according to the mark on the map and the preset electronic fence. If the position mark of the device falls outside the electronic fence, the second rule node will trigger an event node to perform corresponding alarm operations, such as sending an alarm notification to the device management department to prompt that the device may be stolen or illegally moved.
[0122] In an optional implementation manner, to reduce unnecessary data flow, the method further includes:
[0123] A second sending unit, configured to control a second rule node to mark according to the second device location in a preset map, and determine whether the device exceeds a preset electronic fence based on the mark and the preset electronic fence, and then control a third rule node to generate a target identifier and send it to an event node when the device exceeds the preset electronic fence;
[0124] Specifically, if the second rule node determines that the device location data exceeds the range of the preset electronic fence, a signal will be sent to the third rule node. After receiving the out-of-bounds signal from the second rule node, the third rule node will generate a target identifier, which includes specific information about the device's out-of-bounds, such as device ID, out-of-bounds time, current location, etc. Subsequently, the third rule node sends this target identifier to the event node, and the event node performs an alarm operation, such as sending an alarm notification to the device management department, to ensure that the device security is responded to in a timely manner.
[0125] A storage unit, configured to control the third rule node to store the second device location to a preset location when the device does not exceed the preset electronic fence.
[0126] Specifically, if the second rule node determines that the device does not exceed the preset electronic fence, that is, the device location is still within the safe area, the third rule node will not generate a target identifier. Instead, it will store the second device location data to a preset location, such as the database of the Internet of Things platform. This operation retains the real-time location information of the device, provides basic data support for subsequent device location tracking, data analysis, and report generation, and helps the long-term operation and maintenance of the monitoring system.
[0127] Through the above embodiments, it can be clearly understood that the third rule node in the method of the present invention has two key functions after the electronic fence judgment: generating a target identifier and triggering an alarm operation when the device exceeds the preset electronic fence; storing the device location data when the device does not exceed the electronic fence, providing a basis for subsequent data analysis and device management. This design ensures the efficient operation of the device monitoring system, meets the dual requirements of data storage and security monitoring, and avoids unnecessary data streams.
[0128] In order to perform the alarm operation, in an optional embodiment, the above third control unit includes:
[0129] A first determination module, configured to control a fourth rule node to determine the corresponding second device location and the preset electronic fence according to the target identifier when receiving the target identifier;
[0130] Specifically, when the Internet of Things platform detects that the real-time location data of the device (i.e., the second device positioning) exceeds the preset electronic fence range, the third rule node generates a target identifier and sends it to the event node. At this time, after receiving the target identifier, the fourth rule node will determine the corresponding second device positioning and the preset electronic fence according to the information in the identifier, such as the device ID and the crossing time. This process ensures that the event node can accurately identify the specific location of the crossing device and the boundary of the electronic fence, providing accurate information for subsequent alarm operations.
[0131] A second determination module, configured to control the fifth rule node to query a target mapping relationship according to the preset electronic fence to obtain a target path, where the target mapping relationship is a mapping relationship between the name of the preset electronic fence and the preset sending path of the alarm information in the alarm operation;
[0132] Specifically, once the fourth rule node confirms the specific situation of the device crossing the boundary, the fifth rule node will query the target mapping relationship according to the preset electronic fence to determine the sending path of the alarm information. The target mapping relationship is a preset rule that, based on the name of the electronic fence, specifies to which recipients the alarm information should be sent and by what communication method when the device exceeds the electronic fence. For example, if the warehouse electronic fence is named "Warehouse Safety Area", the corresponding target mapping relationship may include the device management department and the security team, and the alarm is sent via email and text message.
[0133] A sending module, configured to control the sixth rule node to generate alarm information according to the second device positioning and send it according to the target path.
[0134] Specifically, the sixth rule node is responsible for generating alarm information according to the second device positioning. The alarm information usually includes key information such as the device ID, the crossing time, and the current exact location. After generating the alarm information, the sixth rule node will follow the target path determined by the fifth rule node and send the alarm information to the designated recipients. For example, in the case where the device exceeds the "Warehouse Safety Area" electronic fence, the alarm information will be sent to the device management department and the security team in a timely manner through the preset email and text message alarm paths, so that they can quickly take countermeasures to ensure the safety of the device.
[0135] Through these embodiments, we can see that the event node of the present invention realizes efficient and accurate alarm operations for devices exceeding the electronic fence through the collaborative work of the fourth, fifth, and sixth rule nodes. The processing flow of this series of nodes ensures the accurate generation, reasonable path query, and timely sending of alarm information, providing strong protection for the safety of devices and personnel. At the same time, through the flexible configuration of the rule engine, this alarm operation can adapt to different scenario requirements, demonstrating the broad application potential of the present invention in the field of electronic fence monitoring.
[0136] In an alternative implementation, to configure the above target mapping relationship, the apparatus further includes:
[0137] A first determination unit, configured to determine a corresponding communication device of the corresponding management personnel according to each device to obtain a target device before controlling the fifth rule node to query the target mapping relationship according to a preset electronic fence to obtain a target path;
[0138] Specifically, the Internet of Things platform determines the management personnel corresponding to each device according to the attributes and management requirements of the enterprise devices. For example, for the devices in the warehouse, they may be monitored by a commissioner in the device management department; for the devices in the office area, they may be managed by an administrator in the IT department. Then, the platform determines their corresponding communication devices according to the list of management personnel, such as email addresses, mobile phone numbers, or enterprise instant messaging software accounts, etc. These communication devices are recorded as target devices for receiving alarm information of device boundary crossing.
[0139] A second determination unit, configured to respectively determine corresponding preset sending paths according to each target device;
[0140] Specifically, for each target device, the Internet of Things platform defines a preset sending path, that is, the specific manner in which the alarm information is sent to the device. For example, for the email address of the commissioner in the device management department, the preset sending path may be set to send an alarm via email; for the mobile phone number of the administrator in the IT department, the preset sending path may be set to send an SMS alarm.
[0141] A third determination unit, configured to determine the target mapping relationship based on the association relationship between each preset electronic fence and the preset sending path.
[0142] Specifically, after determining the target device and the preset sending path, the Internet of Things platform establishes a target mapping relationship based on the association relationship between each preset electronic fence and the preset sending path. This relationship clarifies which management personnel and their target devices the alarm information should be sent to when a specific electronic fence is triggered, and through which preset sending path it is sent. For example, for the electronic fence of the "warehouse safety area", its target mapping relationship may be set to send an alarm to the email of the commissioner in the device management department; while for the electronic fence of the "office area safety area", it may be set to send an SMS alarm to the mobile phone number of the administrator in the IT department.
[0143] The above-mentioned device monitoring device based on a rule engine and an electronic fence includes a processor and a memory. The above-mentioned first control unit, second control unit, third control unit, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to implement corresponding functions. The above-mentioned modules are all located in the same processor; or, the above-mentioned modules are respectively located in different processors in any combination form.
[0144] The processor contains a kernel, and the kernel retrieves the corresponding program units from the memory. One or more kernels can be set, and the communication efficiency can be improved by adjusting the kernel parameters.
[0145] The memory may include non-permanent memory in a computer-readable medium, forms such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM), and the memory includes at least one storage chip.
[0146] An embodiment of the present invention provides a computer-readable storage medium. The above-mentioned computer-readable storage medium includes a stored program, wherein when the above-mentioned program runs, it controls the device where the above-mentioned computer-readable storage medium is located to execute the above-mentioned device monitoring method based on a rule engine and an electronic fence.
[0147] An embodiment of the present invention provides a processor. The above-mentioned processor is used to run a program, wherein when the above-mentioned program runs, it executes the above-mentioned device monitoring method based on a rule engine and an electronic fence.
[0148] An embodiment of the present invention provides a device monitoring system. The communication system includes a primary communication domain, a secondary communication domain processor, a memory, and a program stored on the memory and executable on the processor. When the processor executes the program, it implements at least the steps of the device monitoring method based on a rule engine and an electronic fence.
[0149] This application also provides a computer program product, which is adapted to execute a program initialized with at least the steps of the device monitoring method based on a rule engine and an electronic fence when executed on a data processing device.
[0150] Obviously, those skilled in the art should understand that the various modules or steps of the present invention described above can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. They can be implemented by program codes executable by the computing device. Thus, they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described can be executed in a different order than here, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module for implementation. In this way, the present invention is not limited to any specific combination of hardware and software.
[0151] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0152] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the functions specified in Figure 1 one or more flows Figure 1 or multiple flows and / or blocks
[0153] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device that implements the functions specified in Figure 1 one or more flows Figure 1 or multiple flows and / or blocks
[0154] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide for implementing the functions in the flowFigure 1 one or more processes and / or blocks Figure 1 steps of functions specified in one or more blocks
[0155] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.
[0156] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM) and / or non-volatile memory such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of computer-readable media.
[0157] Computer-readable media includes permanent and non-permanent, removable and non-removable media and can be implemented by any method or technology for information storage. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.
[0158] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, commodity or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, commodity or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, commodity or device comprising the element.
[0159] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:
[0160] 1) The device monitoring method based on the rule engine and the electronic fence of the present application, first, controls the distributed stream processing platform to obtain the device positioning data from each device to obtain the first device positioning; then, controls the rule engine to grab the first device positioning from the distributed stream processing platform, controls the filtering node to pre-process the first device positioning, obtains the second device positioning, and judges according to the second device positioning and the preset electronic fence to determine whether the device exceeds the preset electronic fence; finally, when the device exceeds the electronic fence, controls the event node to perform an alarm operation according to the second device positioning and the preset electronic fence. The present application sets up an electronic fence through the Internet of Things platform, and the device is only responsible for collecting its own positioning data. The monitoring function of the electronic fence is jointly performed by the distributed stream processing platform and the rule engine configured on the Internet of Things platform. In the process of data interaction, the amount of data exchanged between the device and the Internet of Things platform is reduced, the requirements for the network and the device are reduced, and the high coupling between the electronic fence and the application scenario is avoided based on the Internet of Things, the reusability is improved, and the problem of the lack of a low-cost method for realizing electronic fence monitoring in different scenarios in the prior art is solved.
[0161] 2) The device monitoring device based on the rule engine and the electronic fence of the present application, the first control unit controls the distributed stream processing platform to obtain the device positioning data from each device to obtain the first device positioning; the second control unit controls the rule engine to capture the first device positioning from the distributed stream processing platform, controls the filtering node to pre-process the first device positioning, obtains the second device positioning, and judges according to the second device positioning and the preset electronic fence to determine whether the device exceeds the preset electronic fence; the third control unit controls the event node to perform an alarm operation according to the second device positioning and the preset electronic fence when the device exceeds the electronic fence. The present application sets up an electronic fence through the Internet of Things platform, and the device is only responsible for collecting its own positioning data. The monitoring function of the electronic fence is jointly performed by the distributed stream processing platform and the rule engine configured on the Internet of Things platform. In the process of data interaction, the amount of data exchanged between the device and the Internet of Things platform is reduced, the requirements for the network and the device are reduced, and the high coupling between the electronic fence and the application scenario is avoided based on the Internet of Things, the reusability is improved, and the problem of the lack of a low-cost method for realizing electronic fence monitoring in different scenarios in the prior art is solved.
[0162] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A device monitoring method based on rule engine and electronic fence, characterized in that: The Internet of Things platform includes a distributed stream processing platform and a rule engine, the rule engine includes a filtering node and an event node, and the device monitoring method includes: Control the distributed stream processing platform to obtain device positioning data from each device to obtain a first device positioning; Control the rule engine to capture the first device location from the distributed stream processing platform, control the filtering node to pre-process the first device location to obtain the second device location, and make a judgment based on the second device location and a preset electronic fence to determine whether the device exceeds the preset electronic fence; When the device exceeds the electronic fence, the event node is controlled to perform an alarm operation according to the second device location and the preset electronic fence.
2. The method according to claim 1, characterized in that Before determining whether the device is beyond the electronic fence based on the location of the second device and the preset electronic fence, the method includes: Obtaining preset positioning data of each device to obtain the positioning of the third device; Taking the location of the third device as the geometric center, drawing a corresponding closed figure to obtain the preset electronic fence, wherein the closed figure is a circle or a polygon; The preset electronic fence is input into the filtering node of the rule engine.
3. The method according to claim 2, characterized in that With the third device positioned as the geometric center, After drawing the corresponding closed figure to obtain the preset electronic fence, the method further includes: In the case where there is an overlapping area between different preset electronic fences, a target line segment is drawn with the geometric center of any preset electronic fence where the overlapping area exists as the starting point and the geometric center of another preset electronic fence where the overlapping area is located as the end point; The overlapping area is segmented with the midpoint of the target line segment as the boundary to obtain a plurality of target areas, and the target area is divided into the preset electronic fence corresponding to the geometric center with the smallest distance from the boundary of the target area.
4. The method according to claim 1, characterized in that The filtering node includes a first rule node and a second rule node, and controls the filtering node to pre-process the first device location to obtain the second device location, and makes a judgment based on the second device location and a preset electronic fence to determine whether the device exceeds the preset electronic fence, including: Control the first rule node to perform integrity check and data format check on the first device location, and if the check passes, perform data cleaning on the first device location, and authenticate the first device location after data cleaning, and if the authentication passes, determine the first device location as the second device location; The second rule node is controlled to mark the second device location in a preset map, and determine whether the device exceeds the preset electronic fence according to the mark and the preset electronic fence.
5. The method according to claim 4, characterized in that The filtering node further includes a third rule node. After controlling the second rule node to mark the second device location in a preset map and determining whether the device exceeds the preset electronic fence according to the mark and the preset electronic fence, the method further includes: Control the third rule node to generate a target identifier and send the target identifier to the event node when the device exceeds the preset electronic fence; The third rule node is controlled to store the location of the second device to a preset position when the device does not exceed the preset electronic fence.
6. The method according to claim 5, characterized in that The event node includes a fourth rule node, a fifth rule node, and a sixth rule node. When the device exceeds the electronic fence, controlling the event node to perform an alarm operation according to the second device location and the preset electronic fence includes: Controlling the fourth rule node to determine the corresponding second device location and the preset electronic fence according to the target identifier when receiving the target identifier; Control the fifth rule node to query a target mapping relationship according to the preset electronic fence to obtain a target path, wherein the target mapping relationship is a mapping relationship between a name of the preset electronic fence and a preset sending path of the alarm information in the alarm operation; Control the sixth rule node to generate alarm information according to the positioning of the second device, and send it according to the target path.
7. The method according to claim 6, characterized in that Before controlling the fifth rule node to query the target mapping relationship according to the preset electronic fence to obtain the target path, the method further includes: Determine the communication device corresponding to the corresponding management personnel according to each of the devices, and obtain the target device; Determine the corresponding preset sending path according to each of the target devices respectively; The target mapping relationship is determined based on the association relationship between each of the preset electronic fences and the preset sending path.
8. A device monitoring device based on rule engine and electronic fence, characterized in that: The Internet of Things platform includes a distributed stream processing platform and a rule engine, the rule engine includes a filtering node and an event node, and the device monitoring device includes: A first control unit, configured to control the distributed stream processing platform to obtain device positioning data from each device to obtain a first device positioning; A second control unit is used to control the rule engine to capture the first device location from the distributed stream processing platform, control the filtering node to pre-process the first device location to obtain the second device location, and make a judgment based on the second device location and a preset electronic fence to determine whether the device exceeds the preset electronic fence; The third control unit is used to control the event node to perform an alarm operation according to the second device positioning and the preset electronic fence when the device exceeds the electronic fence.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 7.
10. A device monitoring system, characterized in that: include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include methods for executing any one of claims 1 to 7.