Message scheduling center construction method based on Aviactor
By adopting the Aviactor-based construction method in the message scheduling center of the industrial Internet platform, the problem of poor reusability of regular expressions, data type conversion takes up a lot of development time, and the websocket protocol cannot flexibly subscribe to topics in the existing technology, achieving high efficiency message processing and data transmission improve system performance and scalability.
Patent Information
- Application Number
- CN202411559554.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-02-14
AI Technical Summary
When implementing the message scheduling center of the industrial Internet platform, the existing technology has poor reusability of regular expressions, data type conversion takes up a lot of development time, and the websocket protocol cannot flexibly subscribe to topics, resulting in redundant system messaging and receiving, increasing browser and web processing. The burden issue.
Using the Aviactor-based message scheduling center construction method, by introducing rule engines and message queue agents in Java projects, defining rule expressions for alarm judgment, setting message queue agents for message subscription and publishing, creating resource path allocation mechanisms, and realizing resource Store and present, and introduce asynchronous message processing mechanisms to process data in parallel.
It realizes the unity and coverage of rule judgments, improves data comparison performance, reduces redundant data transmission, reduces front-end data reception range, and improves the scalability and performance of the system.
Smart Images

Figure CN119449786A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a method for constructing a message dispatching center based on Aviactor. Background Art
[0002] The scenario-level industrial Internet platform for inspection robots and intelligent operation and maintenance applications can connect industrial hardware such as inspection robots, sensors, cameras, security equipment, auxiliary control equipment, etc. through standardized protocols. While receiving and processing messages from various devices, it can display the online and offline status and alarm content of various devices in real time, and realize the message flow and control of the entire platform through the message dispatch center.
[0003] In order to meet the functional requirements of the above-mentioned message dispatch center, custom judgment and websocket are usually used to implement it. Its main content is: using JAVA's own numerical judgment logic to judge the alarm results, processing the conversion of various data types, and combining the use of websocket for message sending and receiving.
[0004] However, in the specific application process, this implementation method still has at least some technical problems, including: using JAVA's own numerical judgment logic to judge the alarm results, the conversion of various types of data takes up a lot of development time, and it is relatively impossible to reuse all regular expressions; websocke cannot flexibly subscribe to topics, and will send and receive messages throughout the system. A large amount of redundant data will be used in different modules, increasing the browser and web processing burden.
[0005] Due to the existence of the above problems, it is impossible to achieve platform unification and free configuration of the platform, which brings great challenges to subsequent demand growth, maintenance, and problem location. Summary of the invention
[0006] The present invention aims to solve one of the technical problems existing in the related art at least to a certain extent. Therefore, the object of the present invention is to provide a method for constructing a message dispatch center based on Aviactor.
[0007] In order to achieve the above-mentioned object, the present invention provides a method for constructing a message dispatch center based on Aviactor, comprising the following steps:
[0008] S1. Introduce the rule engine and message queue agent as dependencies in the Java project through Maven;
[0009] S2. Define a set of regular expressions, where the regular expressions are used to describe the alarm conditions of the data; receive data from industrial hardware devices, and use a rule engine combined with predefined regular expressions to make alarm judgments;
[0010] S3. Set up the message queue agent and add public subscription and publishing methods for message subscription and publishing;
[0011] S4. Create a resource path allocation mechanism to allocate a unique resource path for the connected industrial hardware devices for storing and accessing related resources;
[0012] S5. Securely transfer resources to the designated file server through the FTP protocol, and use the Web server proxy to provide external resource access to achieve resource storage and display processing;
[0013] S6. Develop alarm level determination logic, classify alarms into different levels according to their severity, and store them in the database; design the storage and push process of alarm data, use relational database to store alarm records, and use message queue agent to push alarm information to front-end application in real time;
[0014] S7. Use the cache system to record the start and end time of the alarm, and update the status in the database and cache after the alarm ends;
[0015] S8, introduce asynchronous message processing mechanism to process received data and processed data in parallel;
[0016] S9. Push real-time data to the front-end application based on user permissions and device status to achieve real-time display and monitoring of data.
[0017] A further preferred technical solution of the present invention is that the rule expression in step S2 is one or more of numerical comparison, time series analysis and event triggering conditions.
[0018] Preferably, the message queue agent is set in step S3 so that various message dispatch center data are sent externally through different protocols, including mqtt, modbus, socket, http, opc, 104, enterprise WeChat, SMS or email.
[0019] Preferably, the resource path allocation mechanism in step S4 includes generating a unique identifier for each device and mapping it to a corresponding file system path.
[0020] Preferably, when providing external resource access through the Web server proxy in step S5, the HTTPS protocol is used for data transmission.
[0021] Preferably, the alarm level determination logic in step S6 includes analysis of historical alarm data to predict possible equipment failures.
[0022] Preferably, when the real-time data is pushed to the front-end application in step S9, the data is formatted to adapt to the data display requirements of different front-end applications.
[0023] Another aspect of the present invention provides a non-transitory computer-readable storage medium having computer instructions stored thereon, the computer instructions enabling a computer to execute the above-mentioned method for constructing a message dispatch center based on Aviactor.
[0024] Yet another aspect of the present invention is an electronic device comprising: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus, and the processor calls logic instructions in the memory to execute the above-mentioned method for constructing a message dispatching center based on Aviactor.
[0025] On the other hand, the present invention provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer executes the above-mentioned method for constructing a message dispatching center based on Aviactor.
[0026] Beneficial effects: The message dispatch center based on Aviactor constructed by the present invention has unified judgment rules, covers all data types, and improves the performance of data comparison. The message dispatch center unifies the sending and receiving of messages, covers most of the current industrial Internet protocols, and can realize the free conversion and sending and receiving of protocols. In addition, the front-end and back-end communication formats are unified in the present invention, shortening the data receiving range of the front end and reducing the browser data cache. In addition, the rule engine and data push method of the present invention can also be used for other Internet platforms, with a streamlined code amount, strong reusability, and a wide range of applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a processing flow chart of the method for constructing a message dispatch center based on Aviactor of the present invention. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings in the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments, and they should not be understood as limitations on the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. In the description of the present invention, it should be understood that the terms used are only for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0029] Combine the following Figure 1The present invention describes the method for constructing a message dispatch center based on Aviactor. The general idea of the method is to add detection items and alarm thresholds of various types of equipment to the platform, generate expression rules; access various types of equipment protocol data, enter the message processing center, call the Aviactor rule engine processing method, and obtain the result of whether to alarm. The data results are classified, and the real-time and alarm data are sent out through different topic channels. After the front-end subscribes, the data is received to realize pop-up windows, voice broadcasts and data display; according to the site requirements, the protocol conversion channel can also be configured, and various message center data can be sent out through different protocols (mqtt, modbus, socket, http, opc, 104, enterprise WeChat, SMS, mailbox and other protocols or technologies).
[0030] Its working process and principle are as follows: In the Java project, pom.xml introduces complete dependency packages such as Aviactor and emqx; uses the expression generation method to establish a public util processing class; agrees on different message push topic channels and subscribes on demand; establishes a message dispatch center to generate different data results according to different configurations, thereby performing corresponding message processing. The front-end and the third-party protocol docking platform subscribe on demand, or perform protocol docking on demand, thereby realizing the complete life cycle of data.
[0031] It can be seen that the construction of the message dispatch center of the present invention mainly relies on five parts, namely, rules, rule engine (Aviactor), subscription and publishing (emqx), resources (resource), and result set (result). Among them:
[0032] Rules are mainly platform configurations that assist in generating expressions and are the underlying basis for the entire rule engine to make judgments.
[0033] Different devices can set multiple levels of rules, which will generate multiple expressions. After receiving real-time data, the rule engine (Aviactor) combines the rule expressions to judge the data results;
[0034] Introducing subscription publishing (emqx) to facilitate the sending and receiving of different data results through different topics, reducing data redundancy, and thus achieving on-demand sending and receiving;
[0035] Resources are an indispensable part of the platform data center. On the basis of expanding the State Grid protocol, resource paths are allocated, resource receiving protocols are unified, and resource displays are unified, making the data richer.
[0036] The result set (result) is the display basis of the entire platform and is used for historical data query and statistics. Based on the result extension protocol conversion, the received and processed data is converted through different docking protocols to unify the format for future secondary development.
[0037] Embodiment 1: This embodiment provides a method for constructing a message dispatching center based on Aviactor, which is mainly applicable to the deployment and construction of a basic message dispatching center.
[0038] Step 1: Environment Setup
[0039] In the Java project, introduce the rule engine library (such as Drools) and the message queue agent library (such as ActiveMQ) as dependencies through Maven.
[0040] Step 2: Define the regular expression
[0041] Define a set of rule expressions, such as "temperature>80℃", to describe the alarm conditions of the device, and configure these rules into the rule engine.
[0042] Step 3: Rule Engine Configuration
[0043] Configure the rule engine so that it can receive data from industrial hardware devices (such as sensors) and make alarm judgments based on predefined rule expressions.
[0044] Step 4: Message Queue Agent Settings
[0045] Set up a message queue agent, such as emqx, for message subscription and publishing, supporting the MQTT protocol to achieve lightweight message transmission. emqx is the culmination of MQTT, with a visual configuration interface, and the front and back ends can be directly connected and used; the JAVA back end introduces dependencies through pom.xml.
[0046] Add subscribe and publish public methods:
[0047] topic: public use topic;
[0048] publish: Java service provides a publishing method to publish the message after it is processed;
[0049] subscribe: web subscribes to a topic and processes the message after receiving it;
[0050] Step 5: Resource path allocation
[0051] Resources include pictures, videos, audio, files, etc. Along with the generation of messages, a unique resource path is allocated to the connected industrial hardware device for storing and accessing related resources, such as log files, configuration files, etc.
[0052] Step 6: Resource storage and display processing
[0053] Implement resource storage and display processing, securely transfer resources to the designated file server through the FTP protocol, and use the Web server proxy to provide external resource access.
[0054] Step 7: Alarm level determination logic
[0055] Develop alarm level determination logic, classify alarms into different levels according to their severity, and store them in the database.
[0056] Step 8: Alarm data storage and push process
[0057] Design the storage and push process of alarm data, use relational database (such as MySQL) to store alarm records, and use message queue agent to push alarm information to front-end application in real time.
[0058] Step 9: Alarm end time processing mechanism
[0059] Implement the alarm end time processing mechanism, use a cache system (such as Redis) to record the start and end time of the alarm, and update the status in the database and cache after the alarm ends.
[0060] Step 10: Asynchronous message processing mechanism
[0061] The introduction of asynchronous message processing mechanism ensures that data reception and processing can be carried out in parallel, improving the system's response speed and processing capabilities.
[0062] Step 11: Real-time data storage and push function
[0063] Develop real-time data storage and push functions to push real-time data to front-end applications based on user permissions and device status to achieve real-time display and monitoring of data.
[0064] Embodiment 2: This embodiment provides a method for constructing a message dispatching center based on Aviactor, which is mainly applicable to the deployment and construction of an advanced message dispatching center.
[0065] Step 1: Environment Construction (Extension)
[0066] Based on step one, more rule engine libraries and message queue agent libraries are introduced to support more industrial protocols and data formats.
[0067] Step 2: Regular expression definition (extension)
[0068] Define more complex rule expressions, such as "temperature>80℃&&humidity<30%", to support more complex alarm conditions.
[0069] Step 3: Rule Engine Configuration (Extension)
[0070] Configure the rule engine so that it can receive data from more types of industrial hardware devices and make alarm judgments based on predefined rule expressions.
[0071] Step 4 to step 11: The same as Example 1, but more functions and optimizations are added in each step to improve the scalability and performance of the system.
[0072] These two embodiments demonstrate how to deploy and configure a message dispatch center based on a rule engine according to different requirements and environments.
[0073] Embodiment 3: This embodiment provides a non-transitory computer-readable storage medium, on which computer instructions are stored, and the computer instructions enable the computer to execute a method for constructing a message dispatch center based on Aviactor, the method being:
[0074] S1. Introduce the rule engine and message queue agent as dependencies in the Java project through Maven;
[0075] S2. Define a set of regular expressions, where the regular expressions are used to describe the alarm conditions of the data; receive data from industrial hardware devices, and use a rule engine combined with predefined regular expressions to make alarm judgments;
[0076] S3. Set up the message queue agent and add public subscription and publishing methods for message subscription and publishing;
[0077] S4. Create a resource path allocation mechanism to allocate a unique resource path for the connected industrial hardware devices for storing and accessing related resources;
[0078] S5. Securely transfer resources to the designated file server through the FTP protocol, and use the Web server proxy to provide external resource access to achieve resource storage and display processing;
[0079] S6. Develop alarm level determination logic, classify alarms into different levels according to their severity, and store them in the database; design the storage and push process of alarm data, use relational database to store alarm records, and use message queue agent to push alarm information to front-end application in real time;
[0080] S7. Use the cache system to record the start and end time of the alarm, and update the status in the database and cache after the alarm ends;
[0081] S8, introduce asynchronous message processing mechanism to process received data and processed data in parallel;
[0082] S9. Push real-time data to the front-end application based on user permissions and device status to achieve real-time display and monitoring of data.
[0083] Embodiment 4: This embodiment provides an electronic device, which may include: a processor, a communications interface, a memory, and a communication bus, wherein the processor, the communications interface, and the memory communicate with each other via the communication bus. The processor may call the logic instructions in the memory to execute a method for constructing a message dispatch center based on Aviactor, which is:
[0084] S1. Introduce the rule engine and message queue agent as dependencies in the Java project through Maven;
[0085] S2. Define a set of regular expressions, where the regular expressions are used to describe the alarm conditions of the data; receive data from industrial hardware devices, and use a rule engine combined with predefined regular expressions to make alarm judgments;
[0086] S3. Set up the message queue agent and add public subscription and publishing methods for message subscription and publishing;
[0087] S4. Create a resource path allocation mechanism to allocate a unique resource path for the connected industrial hardware devices for storing and accessing related resources;
[0088] S5. Securely transfer resources to the designated file server through the FTP protocol, and use the Web server proxy to provide external resource access to achieve resource storage and display processing;
[0089] S6. Develop alarm level determination logic, classify alarms into different levels according to their severity, and store them in the database; design the storage and push process of alarm data, use relational database to store alarm records, and use message queue agent to push alarm information to front-end application in real time;
[0090] S7. Use the cache system to record the start and end time of the alarm, and update the status in the database and cache after the alarm ends;
[0091] S8, introduce asynchronous message processing mechanism to process received data and processed data in parallel;
[0092] S9. Push real-time data to the front-end application based on user permissions and device status to achieve real-time display and monitoring of data.
[0093] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, 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, which is stored in a storage medium and includes 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 method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0094] Embodiment 5: This embodiment provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute it, and the memory completes mutual communication through a communication bus. The processor can call the logic instructions in the memory to execute the message dispatch center construction method based on Aviactor, which is:
[0095] S1. Introduce the rule engine and message queue agent as dependencies in the Java project through Maven;
[0096] S2. Define a set of regular expressions, where the regular expressions are used to describe the alarm conditions of the data; receive data from industrial hardware devices, and use a rule engine combined with predefined regular expressions to make alarm judgments;
[0097] S3. Set up the message queue agent and add public subscription and publishing methods for message subscription and publishing;
[0098] S4. Create a resource path allocation mechanism to allocate a unique resource path for the connected industrial hardware devices for storing and accessing related resources;
[0099] S5. Securely transfer resources to the designated file server through the FTP protocol, and use the Web server proxy to provide external resource access to achieve resource storage and display processing;
[0100] S6. Develop alarm level determination logic, classify alarms into different levels according to their severity, and store them in the database; design the storage and push process of alarm data, use relational database to store alarm records, and use message queue agent to push alarm information to front-end application in real time;
[0101] S7. Use the cache system to record the start and end time of the alarm, and update the status in the database and cache after the alarm ends;
[0102] S8, introduce asynchronous message processing mechanism to process received data and processed data in parallel;
[0103] S9. Push real-time data to the front-end application based on user permissions and device status to achieve real-time display and monitoring of data.
[0104] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0105] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0106] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for constructing a message dispatch center based on Aviactor, characterized in that: The steps include: S1. Introduce the rule engine and message queue agent as dependencies in the Java project through Maven; S2. define a set of regular expressions, where the regular expressions are used to describe the alarm conditions of the data; Receive data from industrial hardware devices and use the rule engine combined with predefined rule expressions to make alarm judgments; S3. Set up the message queue agent and add public subscription and publishing methods for message subscription and publishing; S4. Create a resource path allocation mechanism to allocate a unique resource path for the connected industrial hardware devices for storing and accessing related resources; S5. Securely transfer resources to the designated file server through the FTP protocol, and use the Web server proxy to provide external resource access to achieve resource storage and display processing; S6. Develop alarm level determination logic, classify alarms into different levels according to their severity, and store them in the database; design the storage and push process of alarm data, use relational database to store alarm records, and use message queue agent to push alarm information to front-end application in real time; S7. Use the cache system to record the start and end time of the alarm, and update the status in the database and cache after the alarm ends; S8, introduce asynchronous message processing mechanism to process received data and processed data in parallel; S9. Push real-time data to the front-end application based on user permissions and device status to achieve real-time display and monitoring of data.
2. The method for constructing a message dispatch center based on Aviactor according to claim 1, characterized in that: The rule expression in step S2 is one or more of numerical comparison, time series analysis and event triggering conditions.
3. The method for constructing a message dispatch center based on Aviactor according to claim 1, characterized in that: The message queue agent is set in step S3 for various message dispatch center data to be sent externally through different protocols, including mqtt, modbus, socket, http, opc, 104, enterprise WeChat, SMS or email.
4. The method for constructing a message dispatch center based on Aviactor according to claim 1, characterized in that: The resource path allocation mechanism in step S4 includes generating a unique identifier for each device and mapping it to a corresponding file system path.
5. The method for constructing a message dispatch center based on Aviactor according to claim 1, characterized in that: When providing external resource access through the Web server proxy in step S5, the HTTPS protocol is used for data transmission.
6. The method for constructing a message dispatch center based on Aviactor according to claim 1, characterized in that: The alarm level determination logic in step S6 includes analysis of historical alarm data to predict possible equipment failures.
7. The method for constructing a message dispatch center based on Aviactor according to claim 1, characterized in that: When the real-time data is pushed to the front-end application in step S9, the data is formatted to adapt to the data display requirements of different front-end applications.
8. A non-transitory computer-readable storage medium having computer instructions stored thereon, wherein the computer instructions enable a computer to execute the method for constructing a message dispatch center based on Aviactor as described in any one of claims 1 to 7.
9. An electronic device, comprising: A processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus, and the processor calls the logic instructions in the memory to execute the method for constructing a message dispatch center based on Aviactor as described in any one of claims 1-7.
10. A computer program product, comprising a computer program stored on a non-transitory computer-readable storage medium, wherein when the computer program is executed by a processor, the computer executes the method for constructing a message dispatch center based on Aviactor according to any one of claims 1 to 7.