Multi-channel hardware environment cloud broadcasting method and system based on multi-type warning
By building a unified access framework and building a distributed cluster, the complexity of multi-channel and multi-entry access and interoperability between devices are solved, efficient data integration and rapid response are achieved, and the overall performance and stability of the system are improved. sex.
Patent Information
- Application Number
- CN202411537901.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-10-31
AI Technical Summary
Multi-channel and multi-entry access leads to complex data integration interaction, lack of interoperability between devices, and complex management; there are performance bottlenecks in message synchronization processing, high resource usage, complex error processing, degraded database performance, high storage costs, and complex data backup and recovery.
Build a unified access framework, access multiple hardware devices through the access framework, build a distributed cluster for parallel processing and asynchronous processing, and store alarm messages through a distributed full-text search engine.
Simplify the access process of hardware equipment, realize efficient integration of equipment from different manufacturers, reduce alarm message response time, improve system query performance and response speed, and achieve millisecond response of millions of data.
Smart Images

Figure CN119420751A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of Internet of Things, and in particular to a multi-channel hardware environment cloud broadcasting method and system based on multi-type warnings. Background Art
[0002] At present, the multi-type device access system is based on the multi-entry access defined by different manufacturers. When the alarm message arrives, the set linkage record is triggered for cloud broadcast notification. There are many technical problems with multi-channel and multi-entry access. The main technical problems are: multi-channel and multi-entry access makes data integration and interaction complicated, which is not convenient for data integration and difficult to manage uniformly; the lack of interoperability between multi-type devices increases the complexity of use; multi-channel and multi-entry access management is complex, and the resources and events required are increased.
[0003] Secondary technical issues include: performance bottlenecks in message synchronization processing, resulting in delayed response time and inability to respond in time; high resource usage, excessive number of messages will increase thread usage, resulting in increased system resource consumption, and may also cause crashes or failures; the complexity of error handling increases, and when errors occur, the entire processing flow will be blocked, resulting in the need for complex retry and recovery mechanisms; using MySQL database for data storage, there are problems such as performance degradation, increased query events, and reduced system real-time performance; storage costs increase, and large-scale data storage requires more storage resources, especially for high availability and fast reading and writing requirements; data backup and recovery are complex and time-consuming, which increases the difficulty of operation and maintenance, and there are problems such as index maintenance burden, query optimization difficulty, and low transaction processing efficiency. Summary of the invention
[0004] In order to solve the above technical problems, the purpose of the present invention is to provide a multi-channel hardware environment cloud broadcast method and system based on multi-type warnings with efficient and simple data integration.
[0005] To achieve the above purpose, one aspect of an embodiment of the present application proposes a multi-channel hardware environment cloud broadcast method based on multi-type warnings, comprising the following steps:
[0006] Building an access framework, accessing various hardware devices through the access framework, and receiving alarm messages triggered by each of the hardware devices;
[0007] Building a distributed cluster, performing parallel and asynchronous processing on each of the alarm messages through the distributed cluster to obtain a cloud broadcast task, and performing a cloud broadcast notification according to the cloud broadcast task;
[0008] Each of the warning messages is stored through a distributed full-text search engine.
[0009] In some embodiments, constructing the access framework specifically includes:
[0010] Defining an application programming interface so that a plurality of said hardware devices can be accessed through the same access method;
[0011] An interface document is set, wherein the interface document at least includes a request method, request parameters, and a response format.
[0012] In some embodiments, the building of a distributed cluster is specifically:
[0013] Use Kafka as the message middleware to build the distributed cluster.
[0014] In some embodiments, the parallel processing and asynchronous processing of each of the alarm messages by the distributed cluster to obtain a cloud broadcast task, and performing cloud broadcast notification according to the cloud broadcast task specifically includes:
[0015] Querying preset linkage records, and performing parallel and asynchronous processing on each of the alarm messages according to the linkage records through the distributed cluster;
[0016] The cloud broadcast task is triggered according to the alarm message after parallel processing and asynchronous processing, and the corresponding alarm message is sent to the user end for cloud broadcast notification according to the cloud broadcast task.
[0017] In some embodiments, the multi-channel hardware environment cloud broadcast method further includes:
[0018] A current load rate is obtained, and the distributed cluster is expanded according to the current load rate.
[0019] In some embodiments, obtaining the current load rate and expanding the distributed cluster according to the current load rate specifically includes:
[0020] Obtaining the current load rate;
[0021] When the current load rate is greater than a preset load rate threshold, configuring a new server node, and then adding the node information of the server node to the distributed cluster;
[0022] The partitions of the distributed cluster are reallocated.
[0023] In some embodiments, the storing of each of the warning messages by a distributed full-text search engine is specifically as follows:
[0024] Each of the alarm messages is stored through ElasticSearch.
[0025] To achieve the above purpose, another aspect of the embodiment of the present application proposes a multi-channel hardware environment cloud broadcast system based on multi-type warnings, including:
[0026] An access framework construction module, used to construct an access framework, access a variety of hardware devices through the access framework, and receive alarm messages triggered by each of the hardware devices;
[0027] A message asynchronous processing module is used to build a distributed cluster, perform parallel and asynchronous processing on each of the alarm messages through the distributed cluster, obtain a cloud broadcast task, and perform cloud broadcast notification according to the cloud broadcast task;
[0028] The data storage module is used to store the warning message through a distributed full-text search engine.
[0029] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application proposes an electronic device, which includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory. When the program is executed by the processor, the multi-channel hardware environment cloud broadcast method based on multi-type warnings as described above is realized.
[0030] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application proposes a storage medium, which is a computer-readable storage medium used for computer-readable storage, and the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the multi-channel hardware environment cloud broadcast method based on multi-type warnings as described above.
[0031] The beneficial effects of the present invention are as follows: the multi-channel hardware environment cloud broadcast method and system based on multi-type alarms of the present invention first constructs an access framework, accesses a variety of hardware devices through the access framework, and receives alarm messages triggered by each hardware device. Then, a distributed cluster is built, and each alarm message is processed in parallel and asynchronously through the distributed cluster to obtain a cloud broadcast task, and then a cloud broadcast notification is performed according to the cloud broadcast task. Finally, each alarm message is stored through a distributed full-text retrieval engine. On the one hand, by constructing a unified access framework, the present invention can allow hardware devices of various channels to access through the access framework, thereby simplifying the access process of each hardware device, realizing efficient integration of hardware devices from different manufacturers, and improving the fluency and compatibility of data interaction; on the other hand, by constructing a distributed cluster to process each alarm message in parallel and asynchronously, the response time of the alarm message can be reduced; in addition, by storing each alarm message through a distributed full-text retrieval engine, the query performance and response speed of the system can be improved, achieving a millisecond-level response for querying billions of data. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solution in the embodiments of the present invention, the following introduction is made to the drawings required for use in the embodiments of the present invention. It should be understood that the drawings introduced below are only for the convenience of clearly describing some embodiments of the technical solution of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0033] Figure 1 A flowchart of a multi-channel hardware environment cloud broadcast method based on multi-type warnings provided in an embodiment of the present invention;
[0034] Figure 2 A flowchart of steps for constructing an access framework provided by an embodiment of the present invention;
[0035] Figure 3 A flow chart of steps for building a distributed cluster provided by an embodiment of the present invention;
[0036] Figure 4 A flowchart of the steps of alarm message processing provided by an embodiment of the present invention;
[0037] Figure 5 A step flow chart of step S113 provided in an embodiment of the present invention;
[0038] Figure 6 A step flow chart of step S103 provided in an embodiment of the present invention;
[0039] Figure 7 A schematic diagram of a message processing flow provided by an embodiment of the present invention;
[0040] Figure 8 A schematic diagram of a process flow of a multi-channel hardware environment cloud broadcast method based on multi-type warnings provided by an embodiment of the present invention;
[0041] Fig. 9 A schematic diagram of a structure of a multi-channel hardware environment cloud broadcast system based on multi-type warnings provided by an embodiment of the present invention;
[0042] Fig.10 A schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.
[0044] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".
[0045] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.
[0046] Before describing the embodiments of the present application in detail, some nouns and terms involved in the embodiments of the present application are first described. The nouns and terms involved in the embodiments of the present application are subject to the following explanations.
[0047] 1) Message middleware is a software architecture responsible for delivering messages in a distributed system. It supports asynchronous communication, enabling decoupling of different systems or services. Common functions include message queues, publish-subscribe mechanisms, and message routing. Message middleware improves the reliability, scalability, and flexibility of the system and is widely used in scenarios such as event-driven architecture, microservices, and real-time data processing.
[0048] 2) Kafka, an open source stream processing platform, is used to process real-time data streams and is widely used in data transmission, log collection, and real-time analysis. It adopts a publish-subscribe model, organizes messages by topic, and supports high throughput and scalability.
[0049] 3) RESTful API (Representational State Transfer API), which is an application programming interface based on the REST architecture style. Its core idea is to abstract resources on the Internet into a series of entities that can be accessed and operated through a unified interface, with the characteristics of simplicity, scalability and easy maintenance.
[0050] 4) Elasticsearch is an open source, highly scalable distributed full-text search engine that can store and retrieve data in near real time. It is highly scalable and can be expanded to hundreds of servers to process PB-level data. In Elasticsearch, data is organized into indexes, and each index can be regarded as a collection of documents with similar characteristics. These documents are stored in JSON format, which contains multiple fields, similar to rows and columns in relational databases. Elasticsearch indexes these documents to support efficient search operations.
[0051] 5) Equipment affiliation refers to the transfer of the right to use or manage a piece of equipment to other units or individuals. In this way, flexibility can be achieved in resource allocation and equipment efficiency can be optimized. This is common in industries such as production and transportation, involving equipment sharing or outsourcing management.
[0052] At present, the multi-type device access system is based on the multi-entry access defined by different manufacturers. When the alarm message arrives, the set linkage record is triggered for cloud broadcast notification. There are many technical problems with multi-channel and multi-entry access. The main technical problems are: multi-channel and multi-entry access makes data integration and interaction complicated, which is not convenient for data integration and difficult to manage uniformly; the lack of interoperability between multi-type devices increases the complexity of use; multi-channel and multi-entry access management is complex, and the resources and events required are increased.
[0053] Secondary technical issues include: performance bottlenecks in message synchronization processing, resulting in delayed response time and inability to respond in time; high resource usage, excessive number of messages will increase thread usage, resulting in increased system resource consumption, and may also cause crashes or failures; the complexity of error handling increases, and when errors occur, the entire processing flow will be blocked, resulting in the need for complex retry and recovery mechanisms; using MySQL database for data storage, there are problems such as performance degradation, increased query events, and reduced system real-time performance; storage costs increase, and large-scale data storage requires more storage resources, especially for high availability and fast reading and writing requirements; data backup and recovery are complex and time-consuming, which increases the difficulty of operation and maintenance, and there are problems such as index maintenance burden, query optimization difficulty, and low transaction processing efficiency.
[0054] To this end, the embodiment of the present invention proposes a multi-channel hardware environment cloud broadcast method based on multi-type warnings. First, an access framework is constructed, and multiple hardware devices are accessed through the access framework, and alarm messages triggered by each hardware device are received. Then, a distributed cluster is built, and each alarm message is processed in parallel and asynchronously through the distributed cluster to obtain a cloud broadcast task, and then a cloud broadcast notification is performed according to the cloud broadcast task. Finally, each alarm message is stored through a distributed full-text retrieval engine. On the one hand, by constructing a unified access framework, the present invention can allow hardware devices of various channels to access through the access framework, thereby simplifying the access process of each hardware device, realizing efficient integration of hardware devices from different manufacturers, and improving the fluency and compatibility of data interaction; on the other hand, by constructing a distributed cluster, each alarm message is processed in parallel and asynchronously, which can reduce the response time of the alarm message; in addition, by storing each alarm message through a distributed full-text retrieval engine, the system query performance and response speed can be improved, and a millisecond-level response for querying billions of data can be achieved. The multi-channel hardware environment cloud broadcast method can be applied to disaster warning, smart home monitoring, industrial Internet of Things and other fields, but is not limited to this.
[0055] Reference Figure 1 , Figure 1 A flowchart of a multi-channel hardware environment cloud broadcast method based on multi-type warnings provided by an embodiment of the present invention. An embodiment of the present invention proposes a multi-channel hardware environment cloud broadcast method based on multi-type warnings, and the method includes steps S101 to S103:
[0056] S101, constructing an access framework, accessing various hardware devices through the access framework, and receiving alarm messages triggered by various hardware devices;
[0057] Specifically, a unified access framework is established based on business needs and technical specifications. The access framework allows hardware devices from different channels and different manufacturers to access through a unified application program interface (API), which simplifies the access process for hardware devices from different channels and different manufacturers, thereby enhancing the fluency and compatibility of data interaction. After the hardware devices are connected, the operating status, performance indicators, and environmental parameters of each hardware device are monitored in real time. When abnormal equipment or collected data is detected, the corresponding alarm message is triggered to alert the corresponding staff or users.
[0058] It should be noted that the hardware equipment can be sensor equipment, smart home appliances and security monitoring equipment, etc. The sensor equipment can include environmental monitoring sensors for real-time monitoring of environmental parameters and industrial sensors for status monitoring and fault diagnosis of industrial equipment. The environmental monitoring sensors can be temperature sensors, humidity sensors, light sensors, smoke sensors and gas sensors, etc. The industrial sensors can be pressure sensors, flow sensors, vibration sensors and liquid level sensors, etc. Smart home appliances can include smart home devices and smart kitchen devices. Smart home devices can be smart light bulbs, smart sockets and smart door locks, etc. Smart kitchen equipment can be smart refrigerators, smart ovens and smart trash cans, etc. Security monitoring equipment can include security cameras and intrusion monitoring equipment. The intrusion monitoring equipment can be infrared sensors, door and window sensors, etc.
[0059] Reference Figure 2 , Figure 2 A flowchart of steps for constructing an access framework provided in an embodiment of the present invention, further as an optional implementation manner, the step of constructing an access framework can be further divided into the following steps S1011 and S1012:
[0060] S1011. Define an application programming interface to enable multiple hardware devices to access through the same access method;
[0061] S1012. Set an interface document, which at least includes a request method, request parameters, and a response format.
[0062] In some optional embodiments, by defining a standard application program interface to implement an interface abstraction layer, device manufacturers can simplify the hardware device access process and minimize development investment. The interface abstraction layer is the core part of the unified access framework design, which can hide the underlying complexity and provide a simple and intuitive interface for device manufacturers, thereby enhancing the fluency and compatibility of data interaction.
[0063] Specifically, the embodiment of the present invention designs a set of RESTful APIs as standard application programming interfaces. RESTful API is an interface design style based on the HTTP protocol, which uses standard HTTP methods (such as GET, POST, PUT, DELETE, etc.) to operate resources. Designing RESTful API as an application programming interface allows different channels and hardware devices from different manufacturers to which the system is attached to to access the system in the same access method, that is, to access the system using the same request method, URL structure, and data format, thereby achieving interface standardization. Next, a clear interface document is set up, and the function, request method, request parameters, and response format of each API are recorded in detail in the interface document to speed up the developer's getting started, so that the developer can quickly understand how to use these APIs for device access and data exchange. Further, as time goes by, the system may need to update or expand its functions, and the device manufacturer may also need to upgrade its equipment. Therefore, a RESTful API that supports version management is designed, allowing the system to support both old and new versions of the API to meet the adaptation requirements of different hardware devices and improve the compatibility and stability of the system.
[0064] S102, building a distributed cluster, performing parallel and asynchronous processing on each alarm message through the distributed cluster, obtaining a cloud broadcast task, and performing a cloud broadcast notification according to the cloud broadcast task;
[0065] Specifically, traditional synchronous processing often causes performance bottlenecks. The embodiments of the present invention improve system performance by processing different alarm messages simultaneously through multiple server nodes in a distributed cluster. At the same time, the message queue technology is introduced to asynchronously process the received alarm messages, so that the system will not be blocked due to waiting for the processing result of a single alarm message, and multiple alarm messages can be processed simultaneously, thereby improving the throughput and response speed of cloud broadcasting, and improving the overall stability and scalability of the system.
[0066] Reference Figure 3 , Figure 3 A flowchart of steps for building a distributed cluster provided in an embodiment of the present invention, further as an optional implementation manner, the step of building a distributed cluster can be further divided into the following steps S1021:
[0067] S1021. Use Kafka as the message middleware to build a distributed cluster.
[0068] In some optional embodiments, the embodiments of the present invention use Kafka as a message middleware to implement asynchronous processing. Kafka can process high-throughput messages, thereby ensuring that the system can process a large number of alarm messages at the same time. The distributed cluster consists of multiple Kafka servers (server nodes), each of which can store and transmit messages.
[0069] Among them, Kafka adopts a publish-subscribe model, and its core components include producers, consumers, brokers, topics, partitions, replicas, and ZooKeeper. Producers are responsible for sending messages to the Kafka cluster; consumers are responsible for pulling messages from the Kafka cluster and processing them; brokers are responsible for storing message data; topics represent a class of messages. Each topic can be subdivided into multiple partitions; partitions are the basic units for storing messages in Kafka, and each partition is an ordered, immutable sequence of records that can be continuously appended; replicas are responsible for ensuring data reliability and fault tolerance; ZooKeeper is responsible for metadata management of the Kafka cluster, controller election, and other operations.
[0070] Specifically, in an embodiment of the present invention, a corresponding Kafka topic is created according to the processing requirements of the alarm message. The number of topics and the number of partitions are set according to the data flow and parallel processing requirements. A Kafka producer is configured at the generation end of the alarm message (i.e., the access framework) to send the alarm message to the corresponding topic in the Kafka cluster. At the same time, a Kafka consumer is configured at the processing end of the alarm message (i.e., the user end) to subscribe to and consume the alarm message from the Kafka cluster to achieve asynchronous processing and high-throughput processing of the alarm message.
[0071] Reference Figure 4 , Figure 4 A flowchart of a step of alarm message processing provided in an embodiment of the present invention, further as an optional implementation mode, each alarm message is processed in parallel and asynchronously by a distributed cluster to obtain a cloud broadcast task, and the step of performing cloud broadcast notification according to the cloud broadcast task can be further divided into the following steps S1022 and S1023:
[0072] S1022, querying the preset linkage record, and performing parallel and asynchronous processing on each alarm message according to the linkage record through the distributed cluster;
[0073] S1023: triggering a cloud broadcast task according to the alarm message after parallel processing and asynchronous processing, and sending the corresponding alarm message to the user end for cloud broadcast notification according to the cloud broadcast task.
[0074] In some optional embodiments, after receiving the alarm message, the pre-set linkage records will be queried at this time. These linkage records define how to perform subsequent processing when a certain type of alarm message is received. After querying the corresponding linkage records, the computing power of the distributed cluster is used to perform parallel processing and asynchronous processing on the received alarm messages according to these linkage records, and then trigger the corresponding cloud broadcast task according to the alarm messages after parallel processing and asynchronous processing. The cloud broadcast task is a mechanism for sending notifications to the user end through the cloud, which can quickly and accurately convey the alarm information to the user. According to the specific requirements of the cloud broadcast task, the processed alarm message is encapsulated into a format suitable for transmission and sent to the specified user end through the network. After receiving these alarm messages, the user end will immediately perform cloud broadcast notifications, and remind the user to pay attention through sound, pop-up windows, vibrations, etc., to ensure that the user can obtain important alarm information in time and take corresponding countermeasures.
[0075] Specifically, when an alarm message arrives, the linkage records that need to be queried refer to the records of related operations or events that are automatically triggered by the system or device according to preset rules and policies after receiving the alarm signal. These records contain key information such as the status of the system or device when the alarm is triggered, the operations performed, and the results of the operations, which are of great reference value for subsequent analysis, troubleshooting, and optimization of system configuration.
[0076] Exemplarily, the linkage record may include alarm trigger information, linkage operation information, operation result information, and related device status information. The alarm trigger information is used to record key information such as the specific time of alarm triggering, the trigger source (such as which device or sensor), the alarm type (such as intrusion, fire, etc.), and the alarm level. This information helps to understand the background and cause of the alarm. The linkage operation information is used to record the related operations automatically triggered by the system or device after receiving the alarm signal, such as adjusting the camera's field of view, starting recording, sending notifications, etc. These operations are automatically performed by the system according to preset rules and policies, and are intended to respond to and handle alarms in a timely manner. The operation result information is used to record the results after the linkage operation is executed, such as whether the camera's field of view is successfully adjusted, whether the recording is successfully started, whether the notification is successfully sent, etc. This information helps to evaluate the effectiveness of the linkage operation and the response speed of the system. The related device status information is used to record the status information of the device or system related to the alarm and linkage operation, such as the operating status of the camera, the network connection status, etc. This information helps to understand the overall performance and stability of the device or system. By querying and analyzing linkage records, relevant personnel can timely understand the situation of alarm triggering and linkage operations, evaluate the performance and response speed of the system, discover potential problems and loopholes, and take corresponding measures to optimize and improve.
[0077] As an optional implementation, the multi-channel hardware environment cloud broadcast method further includes the following step S113:
[0078] S113. Obtain the current load rate, and expand the distributed cluster according to the current load rate.
[0079] Specifically, the current load rate is monitored and obtained in real time. When the current load rate is high, the distributed cluster (i.e., Kafka cluster) is expanded to cope with sudden traffic and improve the system's processing capacity and stability.
[0080] Reference Figure 5 , Figure 5 A step flow chart of step S113 provided in an embodiment of the present invention is further provided as an optional implementation mode, wherein the step of obtaining the current load rate and expanding the distributed cluster according to the current load rate can be further divided into the following steps S1131 to S1133:
[0081] S1131, obtaining the current load rate;
[0082] In some optional embodiments, the load rate data of each server node in the distributed cluster (i.e., Kafka cluster) can be collected in real time through monitoring tools or APIs, including but not limited to performance indicators such as CPU usage, memory occupancy, disk I / O, and network bandwidth, and the current load rate can be obtained by comprehensive judgment.
[0083] S1132, when the current load rate is greater than a preset load rate threshold, configuring a new server node, and then adding the node information of the server node to the distributed cluster;
[0084] S1133. Reallocate partitions of the distributed cluster.
[0085] In some optional embodiments, when the current load rate is greater than a preset load rate threshold, the distributed cluster (i.e., Kafka cluster) is expanded. First, prepare a new server node (i.e., Broker node), install and configure the Kafka service in the server node, and then add the node information of the server node (i.e., Broker node) to the administrator (ZooKeeper) so that the distributed cluster (i.e., Kafka cluster) can identify and manage the new node. Then use the partition rebalancing tool or API provided by Kafka to reallocate the existing partitions to the new server node (i.e., Broker node). After expanding the distributed cluster (i.e., Kafka cluster), you can further use Kafka's own monitoring tool to track the cluster's load and performance indicators in real time, and further optimize and adjust the cluster's configuration based on the monitoring results to improve the system's performance and stability.
[0086] It should be noted that the load rate threshold can be set according to actual conditions such as cluster performance, cluster resource utilization, historical operation data, etc. Exemplarily, the load rate threshold can be 80%, 85%, etc.
[0087] S103: Store each alarm message through a distributed full-text search engine.
[0088] Specifically, the embodiment of the present invention uses a distributed full-text search engine to replace the traditional MySQL database to improve query performance and response speed. The backup and recovery of the traditional MySQL database often involves complex script writing and manual operations, while the distributed full-text search engine provides a more convenient and automated backup and recovery mechanism. Through simple configuration and commands, regular backup and rapid recovery of alarm data can be achieved, greatly reducing operation and maintenance costs and risks.
[0089] Reference Figure 6 , Figure 6 A step flow chart of step S103 provided in an embodiment of the present invention, further as an optional implementation manner, the step of storing each alarm message by a distributed full-text search engine can be further divided into the following steps S1031:
[0090] S1031. Store each alarm message through ElasticSearch.
[0091] Specifically, considering the query performance and response speed, the embodiment of the present invention adopts ElasticSearch for data storage. When the system receives an alarm message, a storage process will be triggered immediately. In this process, the alarm message will undergo a series of preprocessing operations, such as formatting the message content to ensure that it meets the index requirements of ElasticSearch, and extracting key information (such as alarm level, occurrence time, trigger source, etc.) for subsequent retrieval and analysis. Then, the preprocessed alarm message will be sent to the ElasticSearch cluster. Using the powerful distributed storage and indexing capabilities of ElasticSearch, these messages will be efficiently stored and the corresponding index structure will be established. When the user needs to query or analyze the alarm message, the query interface provided by ElasticSearch in the front-end interface can be used to quickly locate the relevant alarm information, and further process or respond as needed.
[0092] ElasticSearch is an open source search engine built on Lucene. It provides a distributed, multi-tenant full-text search engine with an HTTP web interface and schema-free JSON documents. Elastic Search is designed to handle large amounts of rapidly changing data and is suitable for scenarios that require complex search queries and real-time analysis. It supports full-text search, structured search, analysis, and a combination of the three, and can be expanded to hundreds of servers and process PB-level data.
[0093] Further, if Figure 7 The figure shows a schematic diagram of the message processing flow. The alarm message triggered by the hardware device flows from the business system to the message center for processing, and then enters the ElasticSearch storage layer, forming an efficient message processing flow. By implementing redundancy and backup of the data, the security and availability of the data can be further guaranteed.
[0094] In summary, the processing flow of the multi-channel hardware environment cloud broadcast method based on multi-type warnings in the embodiment of the present invention is as follows: Figure 8 As shown:
[0095] The first step is to design a RESTful API as an access framework, through which multiple hardware devices can be connected and alarm messages triggered by each hardware device can be received;
[0096] The second step is to introduce Kafka as a message middleware, through which each alarm message is processed in parallel and asynchronously, triggering the cloud broadcast task, and sending the corresponding alarm message to the user end for cloud broadcast notification according to the cloud broadcast task;
[0097] The third step is to use ElasticSearch for data storage and store the alarm messages in ElasticSearch in real time for backup.
[0098] In order to better understand the solution of the embodiment of the present invention, the multi-channel hardware environment cloud broadcast method provided by the embodiment of the present invention is described below through specific application examples.
[0099] In the smart home security monitoring project, different types of hardware devices such as smoke sensors, gas sensors and temperature sensors are deployed in various corners of the home. It is necessary to integrate the environmental data collected by each sensor so that users can monitor and control in real time. The specific implementation steps are as follows:
[0100] 1) Build a unified access framework: Develop a RESTful API and provide detailed API documentation so that smoke sensors, gas sensors, and temperature sensors can be accessed in the same way and receive alarm messages triggered by each sensor.
[0101] 2) Introduce Kafka message middleware: Build a Kafka cluster to realize parallel data and asynchronous processing of each sensor alarm message, and configure consumers to process different types of alarm messages.
[0102] 3) Use ElasticSearch for data storage, store alarm messages in the ElasticSearch storage layer in real time, and use the query interface provided by ElasticSearch on the front-end interface to achieve fast search and visualization for user-friendly access and use.
[0103] After a period of deployment and testing, the project successfully achieved fast and efficient data interaction. The response time for querying billions of messages can reach milliseconds, the user operation process is significantly simplified, the equipment is intuitive and easy to use, and the overall user experience is significantly improved.
[0104] The above is a description of the multi-channel hardware environment cloud broadcast method based on multi-type alarms in the embodiment of the present invention. It can be recognized that compared with the alarm message cloud broadcast notification method in the prior art, the embodiment of the present invention has the following advantages:
[0105] 1. Design a set of RESTful APIs as standard application programming interfaces, so that hardware devices from different channels and different manufacturers can be accessed in the same way, thereby reducing the adaptation work between different systems and services. Developers only need to rely on a unified application programming interface, without having to write different integration codes for each system, thus reducing development and maintenance costs;
[0106] Second, Kafka is introduced as the message middleware. The parallel message processing mechanism is combined with the message queue to achieve high throughput and process multiple alarm messages at the same time, further improving the system throughput and meeting the needs of large-scale data processing. Users can add consumers and producers as needed and dynamically expand the system to adapt to business growth;
[0107] 3. Using ElasticSearch as a storage solution can significantly improve query performance and response speed, achieving millisecond-level response for queries of billions of data.
[0108] Reference Fig. 9 The embodiment of the present invention also provides a multi-channel hardware environment cloud broadcast system based on multi-type warnings, including:
[0109] The access framework construction module is used to construct the access framework, access various hardware devices through the access framework, and receive alarm messages triggered by various hardware devices;
[0110] The message asynchronous processing module is used to build a distributed cluster, perform parallel and asynchronous processing on each alarm message through the distributed cluster, obtain the cloud broadcast task, and perform cloud broadcast notification according to the cloud broadcast task;
[0111] The data storage module is used to store each alarm message through a distributed full-text search engine.
[0112] It can be understood that the contents of the above-mentioned multi-channel hardware environment cloud broadcast method embodiment based on multi-type warnings are all applicable to the present multi-channel hardware environment cloud broadcast system embodiment based on multi-type warnings, and the functions specifically implemented by the present multi-channel hardware environment cloud broadcast system embodiment based on multi-type warnings are the same as those of the above-mentioned multi-channel hardware environment cloud broadcast method embodiment based on multi-type warnings, and the beneficial effects achieved are also the same as the beneficial effects achieved by the above-mentioned multi-channel hardware environment cloud broadcast method embodiment based on multi-type warnings.
[0113] The embodiment of the present invention also provides an electronic device, the electronic device comprising: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, and when the program is executed by the processor, the multi-channel hardware environment cloud broadcast method based on multi-type warnings is realized. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0114] like Fig.10 FIG. 1 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention, referring to FIG. Fig.10 , an embodiment of the present invention provides an electronic device, including:
[0115] The processor 1001 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present invention.
[0116] The memory 1002 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1002 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1002, and the processor 1001 calls and executes the multi-channel hardware environment cloud broadcast method based on multi-type warnings in the embodiment of the present invention;
[0117] Input / output interface 1003, used to implement information input and output;
[0118] The communication interface 1004 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);
[0119] A bus 1005 , which transmits information between various components of the device (e.g., the processor 1001 , the memory 1002 , the input / output interface 1003 , and the communication interface 1004 );
[0120] The processor 1001 , the memory 1002 , the input / output interface 1003 and the communication interface 1004 are connected to each other in communication within the device via the bus 1005 .
[0121] An embodiment of the present invention also provides a storage medium, which is a computer-readable storage medium used for computer-readable storage. The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the above-mentioned multi-channel hardware environment cloud broadcast method based on multi-type warnings.
[0122] It can be understood that the contents of the above-mentioned multi-channel hardware environment cloud broadcast method embodiment based on multi-type warnings are all applicable to the present storage medium embodiment, and the functions specifically implemented by the present storage medium embodiment are the same as those in the above-mentioned multi-channel hardware environment cloud broadcast method embodiment based on multi-type warnings, and the beneficial effects achieved are also the same as those achieved by the above-mentioned multi-channel hardware environment cloud broadcast method embodiment based on multi-type warnings.
[0123] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0124] The embodiment of the present invention also discloses a computer program product or a computer program, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes Figure 1 The method shown.
[0125] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the above-mentioned boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part for which is described as a larger operation is performed independently.
[0126] In addition, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise specified to the contrary, one or more of the above-mentioned functions and / or features can be integrated into a single physical device and / or software module, or one or more functions and / or features can be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present invention. More specifically, in view of the properties, functions and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional skills of the engineer. Therefore, those skilled in the art can implement the present invention set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.
[0127] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the above methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0128] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0129] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the above-mentioned program is printed, since the above-mentioned program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or processing in other suitable ways as necessary, and then stored in a computer memory.
[0130] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0131] In the above description of this specification, the description with reference to the terms "one embodiment / example", "another embodiment / example" or "certain embodiments / examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0132] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
[0133] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.
Claims
1. A multi-channel hardware environment cloud broadcast method based on multi-type warnings, characterized in that: The following steps are involved: Building an access framework, accessing various hardware devices through the access framework, and receiving alarm messages triggered by each of the hardware devices; Building a distributed cluster, performing parallel and asynchronous processing on each of the alarm messages through the distributed cluster to obtain a cloud broadcast task, and performing a cloud broadcast notification according to the cloud broadcast task; Each of the warning messages is stored through a distributed full-text search engine.
2. A multi-channel hardware environment cloud broadcast method based on multi-type warnings according to claim 1, characterized in that: The construction of the access framework specifically includes: Defining an application programming interface so that a plurality of said hardware devices can be accessed through the same access method; An interface document is set, wherein the interface document at least includes a request method, request parameters, and a response format.
3. A multi-channel hardware environment cloud broadcast method based on multi-type warnings according to claim 1, characterized in that: The construction of a distributed cluster is specifically as follows: Use Kafka as the message middleware to build the distributed cluster.
4. A multi-channel hardware environment cloud broadcast method based on multi-type warnings according to claim 1, characterized in that: The parallel processing and asynchronous processing of each of the alarm messages by the distributed cluster to obtain a cloud broadcast task, and performing cloud broadcast notification according to the cloud broadcast task specifically includes: Querying preset linkage records, and performing parallel and asynchronous processing on each of the alarm messages according to the linkage records through the distributed cluster; The cloud broadcast task is triggered according to the alarm message after parallel processing and asynchronous processing, and the corresponding alarm message is sent to the user end for cloud broadcast notification according to the cloud broadcast task.
5. The multi-channel hardware environment cloud broadcast method based on multi-type warnings according to claim 1 is characterized in that: The multi-channel hardware environment cloud broadcast method also includes: A current load rate is obtained, and the distributed cluster is expanded according to the current load rate.
6. A multi-channel hardware environment cloud broadcast method based on multi-type warnings according to claim 5, characterized in that: The obtaining of the current load rate and the expansion of the distributed cluster according to the current load rate specifically includes: Obtaining the current load rate; When the current load rate is greater than a preset load rate threshold, configuring a new server node, and then adding the node information of the server node to the distributed cluster; The partitions of the distributed cluster are reallocated.
7. A multi-channel hardware environment cloud broadcasting method based on multi-type warnings according to any one of claims 1 to 6, characterized in that: The storing of each of the warning messages by the distributed full-text search engine is specifically as follows: Each of the alarm messages is stored through ElasticSearch.
8. A multi-channel hardware environment cloud broadcast system based on multi-type warnings, characterized in that: include: An access framework construction module, used to construct an access framework, access a variety of hardware devices through the access framework, and receive alarm messages triggered by each of the hardware devices; A message asynchronous processing module is used to build a distributed cluster, perform parallel and asynchronous processing on each of the alarm messages through the distributed cluster, obtain a cloud broadcast task, and perform cloud broadcast notification according to the cloud broadcast task; The data storage module is used to store each of the alarm messages through a distributed full-text search engine.
9. An electronic device, characterized in that: The electronic device includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory. When the program is executed by the processor, the steps of the multi-channel hardware environment cloud broadcast method based on multi-type alerts as described in any one of claims 1 to 7 are realized.
10. A storage medium, the storage medium being a computer-readable storage medium, used for computer-readable storage, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the multi-channel hardware environment cloud broadcast method based on multi-type warnings as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Distributed equipment access, control and data transmission method, system and device
CN115865680A
Medical device system including information technology infrastructure having secure cluster domain supporting external domain
EP3559951A1
Systems and methods for content management in an on-demand environment
US20140230076A1