Remote automatic operation method and operation system based on MQTT protocol
Through the remote automation operation method based on the MQTT protocol, the MQTT message server and user interface automation technology are used to solve the problems of high update costs and difficult software maintenance, and the functional integration and automation operations without the need for update software are achieved, which improves production efficiency and reduces costs.
Patent Information
- Application Number
- CN202411775391.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-12-04
AI Technical Summary
The cost of updating existing automation software and software manufacturers no longer provide follow-up services, making it difficult for existing software to achieve functional integration and automated operations.
The remote automation operation method based on the MQTT protocol is adopted to realize communication between the automated server and the automated client through the MQTT message server. The automated client uses user interface automation technology to operate the target software, and the automated server sends monitoring requests and receives operation results.
Functional integration and automated operation can be achieved without updating existing software, which improves automated operation performance, improves production efficiency and reduces production costs.
Smart Images

Figure CN119652745A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of automated operation, and in particular to a remote automated operation method and an operating system based on the MQTT protocol. Background Art
[0002] With the continuous development of automation technology, the use of software to control manufacturing systems has become the mainstream operation of industrial production. However, due to the continuous emergence of new requirements and new functions, the cost of software updates continues to increase. In particular, when some software manufacturers no longer provide follow-up services, how to achieve functional integration and automated operation for existing software has become a technical problem that technicians in this field need to solve urgently. Summary of the invention
[0003] In order to solve at least one of the above problems, a first embodiment of the present invention provides a remote automation operation method based on the MQTT protocol, which is applied to an automation client, comprising:
[0004] Receive a monitoring request sent by the automation server according to a topic subscribed in the MQTT message server, wherein the monitoring request is issued by the automation server through the MQTT message server and includes a server ID and operation content;
[0005] Determine whether the operation is executable according to the operation content of the monitoring request, and if it is executable, operate the corresponding control of the target software according to the operation content and generate an operation result, wherein the target software is the software for the automation client to perform the automation operation;
[0006] A monitoring result is generated according to the operation result and published through the MQTT message server, so that the automation server obtains the operation result according to the subscribed topic.
[0007] For example, in the remote automation operation method provided in some embodiments of the present application, the operation content includes an operation instruction and instruction content, and the instruction content includes a target control of the target software,
[0008] The step of determining whether the operation is executable according to the operation content of the monitoring request, and if it is executable, operating the corresponding control of the target software according to the operation content and generating the operation result further includes:
[0009] Searching for a corresponding processing function according to the operation instruction, and if no processing function is found, generating a first error result and publishing it through the MQTT message server, so that the automation server obtains the first error result according to the subscribed topic;
[0010] If the processing function is found, the instruction content is parsed, and if the format of the instruction content does not conform to the preset format, a second error result is generated and published through the MQTT message server, so that the automation server obtains the second error result according to the subscribed topic;
[0011] If the format of the instruction content conforms to the preset format, searching for the main window of the target software, and if the main window does not exist, generating a third error result and publishing it through the MQTT message server, so that the automation server obtains the third error result according to the subscribed topic;
[0012] If the main window of the target software is found, the target control is searched, and if the target control does not exist, a fourth error result is generated and published through the MQTT message server, so that the automation server obtains the fourth error result according to the subscribed topic;
[0013] If the target control exists, the operation instruction is executed on the target control using the processing function and an operation result is generated.
[0014] For example, in the remote automation operation method provided in some embodiments of the present application, generating the monitoring result according to the operation result and publishing it through the MQTT message server further includes:
[0015] Generate the monitoring result according to the MQTT message format based on the operation result, and send the monitoring result to the MQTT message server, wherein the monitoring result includes the MQTT identifier of the automation client;
[0016] The MQTT message server receives the monitoring result and publishes it to a topic subscribed by the automation client according to the MQTT identifier of the automation client.
[0017] For example, in the remote automation operation method provided in some embodiments of the present application, before receiving the monitoring request sent by the automation server according to the topic subscribed in the MQTT message server, the remote automation operation method further includes:
[0018] Starting the target software;
[0019] Connecting to the MQTT message server and subscribing to a topic according to the MQTT identifier of the automation client;
[0020] The processing function for operating the target software is set.
[0021] For example, in the remote automation operation method provided in some embodiments of the present application, the automation client uses the first type of language, and after connecting to the MQTT message server and subscribing to a topic according to the MQTT identifier of the automation client, the remote automation operation method further includes:
[0022] The processing function is registered in the memory registry of the system where the automation client is installed.
[0023] A second embodiment of the present invention provides a remote automation operation method based on the MQTT protocol, which is applied to an automation server, comprising:
[0024] Generate a monitoring request and publish it through an MQTT message server, wherein the monitoring request includes a server ID and an operation content, so that the automation client obtains the monitoring request according to the subscribed topic, and determines whether it is an executable operation according to the operation content of the monitoring request. If it is an executable operation, the corresponding control of the target software is operated according to the operation content and an operation result is generated. The target software is the software on which the automation client performs the automation operation;
[0025] The monitoring result sent by the automation client is received according to the topic subscribed in the MQTT message server, where the monitoring result is generated by the automation client according to the operation result and published through the MQTT message server.
[0026] For example, in the remote automation operation method provided in some embodiments of the present application, generating a monitoring request and publishing it through an MQTT message server further includes:
[0027] Generate the monitoring request according to the MQTT message format and send the monitoring request to the MQTT message server, wherein the monitoring request includes the MQTT identifier of the automation server;
[0028] The MQTT message server receives the monitoring request and publishes it to the topic subscribed by the automation server according to the MQTT identifier of the automation server.
[0029] For example, in the remote automation operation method provided in some embodiments of the present application, generating the monitoring request according to the MQTT message format and sending the monitoring request to the MQTT message server further includes:
[0030] The monitoring request is sent to the MQTT message server using a synchronous interface or an asynchronous interface.
[0031] For example, in the remote automation operation method provided in some embodiments of the present application, before generating the monitoring request and publishing it through the MQTT message server, the remote automation operation method further includes:
[0032] Connect to the MQTT message server and subscribe to a topic according to the MQTT identifier of the automation server.
[0033] A third embodiment of the present invention provides a remote automation operating system based on the MQTT protocol, comprising an automation server, an MQTT message server, and at least one automation client, wherein the automation client is configured as follows:
[0034] Receive a monitoring request sent by the automation server according to a topic subscribed in the MQTT message server, wherein the monitoring request is issued by the automation server through the MQTT message server and includes a server ID and operation content;
[0035] Determine whether the operation is executable according to the operation content of the monitoring request, and if it is executable, operate the corresponding control of the target software according to the operation content and generate an operation result, wherein the target software is the software for the automation client to perform the automation operation;
[0036] A monitoring result is generated according to the operation result and published through the MQTT message server, so that the automation server obtains the operation result according to the subscribed topic.
[0037] A fourth embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon.
[0038] When the program is executed by a processor, the method described in the first embodiment is implemented;
[0039] or
[0040] When the program is executed by a processor, the method described in the second embodiment is implemented.
[0041] A fifth embodiment of the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor.
[0042] When the processor executes the program, the method described in the first embodiment is implemented;
[0043] or
[0044] When the processor executes the program, the method described in the second embodiment is implemented.
[0045] The beneficial effects of the present invention are as follows:
[0046] In view of the current existing problems, the present invention develops a remote automation operation method and operating system based on the MQTT protocol, forms a service framework including an automation server and an automation client by using user interface automation technology, and realizes remote automation operation based on the MQTT protocol by using the MQTT protocol as a communication medium between the automation server and the automation client, thereby making up for the problems existing in the prior art, and there is no need to update the existing software to realize the integration and automation operation of functions, effectively improving the automation operation performance, improving production efficiency, and reducing production costs, and has broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0048] Figure 1 A flowchart showing a remote automation operation method according to an embodiment of the present invention;
[0049] Figure 2 A structural block diagram of a remote automation operating system according to an embodiment of the present invention is shown;
[0050] Figure 3 A swim lane diagram showing a remote automated operation method according to an embodiment of the present invention;
[0051] Figure 4 A flowchart showing a remote automation operation method according to another embodiment of the present invention;
[0052] Figure 5 A schematic structural diagram of a computer device according to another embodiment of the present invention is shown. DETAILED DESCRIPTION
[0053] In order to more clearly illustrate the present invention, the present invention is further described below in conjunction with preferred embodiments and accompanying drawings. Similar components in the accompanying drawings are represented by the same reference numerals. It should be understood by those skilled in the art that the content specifically described below is illustrative rather than restrictive, and should not be used to limit the scope of protection of the present invention.
[0054] In view of the problems existing in related technologies, such as Figure 1 As shown, an embodiment of the present invention provides a remote automation operation method based on the MQTT protocol, which is applied to an automation client and includes:
[0055] Receive a monitoring request sent by the automation server according to a topic subscribed in the MQTT message server, wherein the monitoring request is issued by the automation server through the MQTT message server and includes a server ID and operation content;
[0056] Determine whether the operation is executable according to the operation content of the monitoring request, and if it is executable, operate the corresponding control of the target software according to the operation content and generate an operation result, wherein the target software is the software for the automation client to perform the automation operation;
[0057] A monitoring result is generated according to the operation result and published through the MQTT message server, so that the automation server obtains the operation result according to the subscribed topic.
[0058] In this embodiment, if Figure 2 The remote automation operating system is shown, including an automation server, an MQTT message server, and at least one automation client.
[0059] Among them, the automation client is installed or runs on the device or equipment of the target software to be updated or integrated, and the automation client uses the user interface automation technology to operate according to the interface structure of the software's operating interface. User interface automation technology (UI Automation) is an auxiliary function framework provided by Microsoft for the Windows platform, which allows programmatic access to user interface (UI) information and interacts by imitating traditional mouse and keyboard input through code. In this embodiment, the automation client uses the user interface automation technology to obtain controls on the target software operating interface, such as determining controls such as buttons, text boxes, and image boxes on the target software operating interface through scope and filtering, starting monitoring of each control, responding to changes and updates of each control, such as single-clicking, double-clicking, screenshots, etc. to achieve operations on the target software operating interface.
[0060] The automation server is installed on a remote server, an on-site server or a cloud server, and is used to send instructions to the automation client, receive monitoring results from the automation client, and further send instructions based on the monitoring results, that is, actively send instructions, or passively send instructions based on the received information.
[0061] The MQTT message server (MQTT Broker) is the core component of the MQTT (Message Queuing Telemetry Transport) protocol. As a communication intermediary media, it is responsible for processing message transmission between clients. The MQTT protocol is a lightweight communication protocol based on the publish / subscribe model, built on the TCP / IP protocol, and is simple, open, and easy to implement. The MQTT message server can run efficiently in a resource-constrained environment, and is particularly suitable for scenarios such as industrial automation and the Internet of Things. The automation client and automation server of this embodiment are both clients of the MQTT message server, and remote automation operations are implemented through the MQTT message server.
[0062] The automation server of this embodiment is the main control end, the automation client is the execution end, and the MQTT message server provides an intermediary transmission service for the two based on the publish / subscribe mode. Based on the use of user interface automation technology to form a service framework including the automation server and the automation client, this embodiment further implements remote automation operation through MQTT, thereby realizing the integration and automation of software functions without updating the existing software, effectively improving the automation operation performance, improving production efficiency, and reducing production costs.
[0063] To further illustrate the operation process of this embodiment, the automation client, MQTT message server and automation server perform remote automation operations on the target software as an example. Figure 3 As shown, the specific steps include:
[0064] The first step is to automate the initialization of the client.
[0065] In this embodiment, the automation client starts, first starts the target software, then connects to the MQTT message server, subscribes to the topic according to the MQTT identifier of the automation client, and sets the processing function for operating the target software. Specifically, for example, the device on which the target software is installed or running is powered on and started, the automation client starts, the target software starts, the automation client includes a controller and an MQTT client, the MQTT client starts, connects to the MQTT message server, realizes the communication connection between the automation client and the MQTT message server, and at the same time subscribes to the topic in the MQTT message server according to the identifier of the MQTT client of the automation client, thereby realizing the topic subscription mode between the automation client and the MQTT message server, and finally sets the processing function for operating the target software in the controller of the automation client, such as the window text, button, mouse click, mouse double click, screenshot and other processing functions of operating the target software, for example, when the programming language of the automation client is a language that supports reflection search, such as C#, the corresponding processing function is found by reflection search during the application process. That is, the automation client completes its own startup and various operation preparations for operating the target software in the initialization operation stage.
[0066] In an optional embodiment, the automation client uses a first type of language to register the processing function into a memory registry of a system where the automation client is installed.
[0067] In this embodiment, for programming languages that do not support the reflection search function, such as C language / C++ language, when the automation client is initialized, each processing function is registered in the memory registry of the system where the automation client is installed, so that during the application process, the corresponding processing function can be found through the memory registry.
[0068] It is worth noting that the present application does not specifically limit the startup order of the automation client and the target software. To facilitate the operation of the target software, the target software can be started first and then the automation client. Those skilled in the art should understand and make settings according to actual application requirements, which are all within the protection scope of the present application.
[0069] The second step is to automate the initialization operation on the server side.
[0070] In this embodiment, the automation server is started, and the automation server includes a processor and an MQTT client. The MQTT client is started and connected to the MQTT message server to realize the communication connection between the automation server and the MQTT message server. At the same time, according to the identifier of the MQTT client of the automation server, the topic is subscribed to the MQTT message server, thereby realizing the topic subscription mode between the automation server and the MQTT message server.
[0071] It is worth noting that the present application does not limit the specific order of initialization operations of the automation server and the automation client. For example, when the automation server communicates with multiple automation clients, the automation server is in a long-term running state. Those skilled in the art should understand this and will not elaborate on it here.
[0072] In the third step, the automation server sends a monitoring request to the MQTT message server.
[0073] Step 4: The MQTT message server publishes a monitoring request.
[0074] In this embodiment, the automation server generates a monitoring request and publishes it through the MQTT message server, wherein the monitoring request includes a server ID and operation content. For example, the automation server sends a monitoring request to the MQTT message server at a preset time or a preset time interval, wherein the monitoring request includes the server ID of the automation server and operation content, and the operation content includes an operation instruction and instruction content.
[0075] In a specific embodiment, the automation server generates the monitoring request according to the MQTT message format and sends the monitoring request to the MQTT message server, wherein the monitoring request includes the MQTT identifier of the automation server; the MQTT message server receives the monitoring request and publishes it to the topic subscribed by the automation server according to the MQTT identifier of the automation server.
[0076] In this embodiment, the automation server generates a monitoring request, sends the monitoring request to the MQTT message server, and the MQTT message server further publishes the monitoring request. Specifically, first, the processor of the automation server generates a monitoring request according to the MQTT message format, and then sends the monitoring request to the MQTT message server through the MQTT client. When the MQTT message server receives the monitoring request, it confirms the topic subscribed by the automation server according to the MQTT identifier in the monitoring request, and publishes the monitoring request to the topic, so that each MQTT client subscribed to the topic receives the message.
[0077] In an optional embodiment, the automation server sends the monitoring request to the MQTT message server using a synchronous interface or an asynchronous interface.
[0078] In this embodiment, the processor of the automation server provides two operation interfaces for remote operation, including a synchronous interface and an asynchronous interface. It is worth noting that this embodiment does not specifically limit the use of synchronous interfaces and asynchronous interfaces. Those skilled in the art should select appropriate interfaces according to actual application requirements and design communication processes according to the types of interfaces, which will not be described in detail here.
[0079] Step 5: The automation client receives the monitoring request.
[0080] In this embodiment, the automation client receives a monitoring request sent by the automation server according to a topic subscribed to the MQTT message server, wherein the monitoring request is issued by the automation server through the MQTT message server and includes a server ID and operation content.
[0081] In the sixth step, the automated client operates the target software according to the monitoring request.
[0082] In this embodiment, the automation client determines whether the operation is executable according to the operation content of the monitoring request, and if it is executable, operates the corresponding control of the target software according to the operation content and generates an operation result.
[0083] In a specific example, the automation client performs request verification on the received monitoring request, and executes the instructions in the monitoring request on the target software after the verification is successful. Specifically, the following steps are included:
[0084] First, the automation client searches for a corresponding processing function according to the operation instruction, and if the processing function is not found, generates a first error result and publishes it through the MQTT message server, so that the automation server obtains the first error result according to the subscribed topic.
[0085] In this embodiment, the monitoring request includes a server ID and an operation content, wherein the operation content includes an operation instruction and an instruction content, wherein the instruction content includes a target control of the target software. The automation client uses a reflection search function or searches for a processing function corresponding to the operation instruction in a memory registry according to the operation instruction in the operation content. For example, if the operation instruction is a single-click operation, the automation client searches for a processing function corresponding to the single-click operation. If the corresponding processing function is found, the verification step is continued. If the corresponding processing function is not found, the monitoring request is considered to be an error instruction, a first error result is generated, and sent to the MQTT message server. The MQTT message server is published to the topics subscribed by the automation client and the automation server according to the first error result, so that the automation server confirms that the operation instruction of the sent monitoring request is an error instruction and the sent monitoring request is invalid.
[0086] Second, if the processing function is found, the instruction content is parsed. If the format of the instruction content does not conform to the preset format, a second error result is generated and published through the MQTT message server, so that the automation server obtains the second error result according to the subscribed topic.
[0087] In this embodiment, the automation client continues to parse the instruction content of the operation content of the monitoring request, for example, checks according to the preset instruction content format, and continues the checking step when the format of the instruction content meets the preset format, and if the format of the instruction content does not meet the preset format, the instruction content is considered to be erroneous content, generates a second error result and sends it to the MQTT message server. The MQTT message server publishes the second error result to the topics subscribed by the automation client and the automation server, so that the automation server confirms that the instruction content of the sent monitoring request is erroneous content and the sent monitoring request is invalid.
[0088] Third, if the format of the instruction content conforms to the preset format, the main window of the target software is searched; if the main window does not exist, a third error result is generated and published through the MQTT message server, so that the automation server obtains the third error result according to the subscribed topic.
[0089] In this embodiment, the automation client continues to search for the main window of the target software, for example, the operation interface of the target software. If the operation interface of the target software is found, the verification step is continued. If the operation interface of the target software is not found, it is considered that there is a problem with the startup of the target software and subsequent operations cannot be performed, and a third error result is generated and sent to the MQTT message server. The MQTT message server publishes the third error result to the topics subscribed by the automation client and the automation server, so that the automation server confirms that the automation client has not found the main window of the target software and the monitoring request sent is invalid.
[0090] Fourth, if the main window of the target software is found, the target control is searched; if the target control does not exist, a fourth error result is generated and published through the MQTT message server, so that the automation server obtains the fourth error result according to the subscribed topic.
[0091] In this embodiment, the automation client continues to search for the target control in the main window of the target software, such as searching for a button on the operation interface of the target software. If the button on the operation interface of the target software is found, the subsequent operation continues. If the button on the operation interface of the target software is not found, it is considered that the instruction content of the operation content of the monitoring request is incorrect and the subsequent operation cannot be performed, and a fourth error result is generated and sent to the MQTT message server. The MQTT message server publishes the fourth error result to the topics subscribed by the automation client and the automation server, so that the automation server confirms that the automation client has not found the button of the target software and the sent monitoring request is invalid.
[0092] Fifth, if the target control exists, the processing function is used to execute the operation instruction on the target control and generate an operation result.
[0093] In this embodiment, based on the successful verification of the aforementioned steps, the automation client executes the operation instructions of the operation content of the monitoring request, such as calling the processing function corresponding to the single-click operation to click the button on the operation interface of the target software, thereby realizing the automation server controlling the automation client to operate the target software through the MQTT message server, that is, realizing remote automation operation.
[0094] It is worth noting that this embodiment is only used to illustrate the specific implementation method of the present application. The present application does not specifically limit the instructions of the monitoring request. It can be one instruction or multiple instructions. Those skilled in the art should understand and select appropriate instructions according to actual application requirements to achieve remote automated operation of the target software as the design criterion, which will not be repeated here.
[0095] Step 7: The automated client generates the operation results.
[0096] In the eighth step, the automation client sends the operation results to the MQTT message server.
[0097] Step 9: The MQTT message server publishes the operation results.
[0098] Step 10: The automation server receives the operation results.
[0099] In this embodiment, after the automation client operates the target software, for example, after clicking a button on the operation interface of the target software, the operation interface updates the window according to the operation, for example, presents feedback information or feedback images, or no feedback, and the automation client generates an operation result according to the situation after the operation, for example, extracts the feedback information or feedback images through text or screenshots to generate the operation result. Then the automation client sends the operation result to the MQTT message server, specifically including: generating the monitoring result according to the MQTT message format of the operation result, and sending the monitoring result to the MQTT message server, the monitoring result includes the MQTT identifier of the automation client; the MQTT message server receives the monitoring result and publishes it to the topic subscribed by the automation client according to the MQTT identifier of the automation client. That is, the automation client sends the operation result to the MQTT message server, so that the MQTT message server publishes it to the topics subscribed by the automation client and the automation server according to the operation result, so that the automation server confirms that the automation client has clicked the button of the target software, the sent monitoring request is effectively implemented and the returned operation result is received.
[0100] It is worth noting that the automation server can further perform subsequent operations based on the received operation results, such as generating subsequent instruction requests based on the text or image in the operation results, and publishing the instruction requests through the MQTT message server to control the automation client to execute the instruction requests. Those skilled in the art should understand that the above operations are all within the protection scope of this application and will not be repeated here.
[0101] At this point, remote automation operation of the target software is achieved through the automation client, MQTT message server and automation server.
[0102] In this embodiment, the automation server is used as the main control end, the automation client is used as the execution end, and the MQTT message server is used as the intermediary transmission between the two, and the publish / subscribe mode of the MQTT protocol is used to realize remote automation operation of the target software. That is, on the basis of using the user interface automation technology to form a service framework including the automation server and the automation client, this embodiment further realizes remote automation operation through MQTT, thereby realizing the integration and automation operation of software functions without updating the existing software, effectively improving the automation operation performance, improving production efficiency, and reducing production costs.
[0103] Based on the remote automation operation method of the above embodiment, Figure 4 As shown, an embodiment of the present invention provides a remote automation operation method based on the MQTT protocol, which is applied to an automation server, including:
[0104] Generate a monitoring request and publish it through an MQTT message server, wherein the monitoring request includes a server ID and an operation content, so that the automation client obtains the monitoring request according to the subscribed topic, and determines whether it is an executable operation according to the operation content of the monitoring request. If it is an executable operation, the corresponding control of the target software is operated according to the operation content and an operation result is generated. The target software is the software on which the automation client performs the automation operation;
[0105] The monitoring result sent by the automation client is received according to the topic subscribed in the MQTT message server, where the monitoring result is generated by the automation client according to the operation result and published through the MQTT message server.
[0106] This embodiment uses user interface automation technology to form a service framework including an automation server and an automation client, and further implements remote automation operation through MQTT, thereby realizing the integration and automation of software functions without updating existing software, effectively improving the performance of automation operation, improving production efficiency, and reducing production costs. The specific implementation of this embodiment refers to the above-mentioned embodiment, which will not be repeated here.
[0107] Based on the remote automation operation method of the above embodiment, Figure 2 As shown, the present application also provides a remote automation operating system based on the MQTT protocol, including an automation server, an MQTT message server, and at least one automation client, wherein the automation client is configured as:
[0108] Receive a monitoring request sent by the automation server according to a topic subscribed in the MQTT message server, wherein the monitoring request is issued by the automation server through the MQTT message server and includes a server ID and operation content;
[0109] Determine whether the operation is executable according to the operation content of the monitoring request, and if it is executable, operate the corresponding control of the target software according to the operation content and generate an operation result, wherein the target software is the software for the automation client to perform the automation operation;
[0110] A monitoring result is generated according to the operation result and published through the MQTT message server, so that the automation server obtains the operation result according to the subscribed topic.
[0111] In response to the current existing problems, this embodiment uses user interface automation technology to form a service framework including an automation server and an automation client. At the same time, by using the MQTT protocol as a communication medium between the automation server and the automation client, remote automation operations based on the MQTT protocol are realized, thereby making up for the problems existing in the prior art. There is no need to update the existing software to achieve functional integration and automation operations, which effectively improves the automation operation performance, improves production efficiency, and reduces production costs, and has practical application value.
[0112] Another embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which implements a remote automation operation method based on the MQTT protocol when the program is executed by a processor.
[0113] In practical applications, the computer-readable storage medium can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present embodiment, the computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0114] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0115] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0116] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0117] like Figure 5As shown, a structural schematic diagram of a computer device provided by another embodiment of the present invention. Figure 5 The computer device T12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0118] like Figure 5 As shown, the computer device T12 is in the form of a general-purpose computing device. The components of the computer device T12 may include, but are not limited to: one or more processors or processing units T16, a system memory T28, and a bus T18 connecting different system components (including the system memory T28 and the processing unit T16).
[0119] Bus T18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0120] The computer device T12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device T12, including volatile and non-volatile media, removable and non-removable media.
[0121] The system memory T28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) T30 and / or cache memory T32. The computer device T12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system T34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5 not shown, usually called a "hard drive"). Although Figure 5 Not shown in the figure, a disk drive for reading and writing a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical medium) may be provided. In these cases, each drive may be connected to the bus T18 via one or more data medium interfaces. The memory T28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0122] A program / utility T40 having a set (at least one) of program modules T42 may be stored in, for example, memory T28, such program modules T42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules T42 typically perform the functions and / or methods of the embodiments described herein.
[0123] The computer device T12 may also communicate with one or more external devices T14 (e.g., keyboard, pointing device, display T24, etc.), one or more devices that enable a user to interact with the computer device T12, and / or any device that enables the computer device T12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed via an input / output (I / O) interface T22. Furthermore, the computer device T12 may also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN) and / or public network, such as the Internet) via a network adapter T20. Figure 5 As shown, the network adapter T20 communicates with other modules of the computer device T12 via the bus T18. Figure 5 Not shown, other hardware and / or software modules may be used in conjunction with computer device T12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0124] The processor unit T16 executes various functional applications and data processing by running programs stored in the system memory T28, for example, implementing a remote automation operation method based on the MQTT protocol provided in an embodiment of the present invention.
[0125] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not limitations on the implementation methods of the present invention. For ordinary technicians in the relevant field, other different forms of changes or modifications can be made based on the above description. It is impossible to list all the implementation methods here. All obvious changes or modifications derived from the technical solution of the present invention are still within the protection scope of the present invention.
Claims
1. A remote automation operation method based on the MQTT protocol, applied to an automation client, characterized in that: include: Receive a monitoring request sent by the automation server according to a topic subscribed in the MQTT message server, wherein the monitoring request is issued by the automation server through the MQTT message server and includes a server ID and operation content; Determine whether the operation is executable according to the operation content of the monitoring request, and if it is executable, operate the corresponding control of the target software according to the operation content and generate an operation result, wherein the target software is the software for the automation client to perform the automation operation; A monitoring result is generated according to the operation result and published through the MQTT message server, so that the automation server obtains the operation result according to the subscribed topic.
2. The remote automated operation method according to claim 1, characterized in that: The operation content includes an operation instruction and instruction content, and the instruction content includes a target control of the target software. The step of determining whether the operation is executable according to the operation content of the monitoring request, and if it is executable, operating the corresponding control of the target software according to the operation content and generating the operation result further includes: Searching for a corresponding processing function according to the operation instruction, and if no processing function is found, generating a first error result and publishing it through the MQTT message server, so that the automation server obtains the first error result according to the subscribed topic; If the processing function is found, the instruction content is parsed, and if the format of the instruction content does not conform to the preset format, a second error result is generated and published through the MQTT message server, so that the automation server obtains the second error result according to the subscribed topic; If the format of the instruction content conforms to the preset format, searching for the main window of the target software, and if the main window does not exist, generating a third error result and publishing it through the MQTT message server, so that the automation server obtains the third error result according to the subscribed topic; If the main window of the target software is found, the target control is searched, and if the target control does not exist, a fourth error result is generated and published through the MQTT message server, so that the automation server obtains the fourth error result according to the subscribed topic; If the target control exists, the operation instruction is executed on the target control using the processing function and an operation result is generated.
3. The remote automated operation method according to claim 2, characterized in that: Generating the monitoring result according to the operation result and publishing it through the MQTT message server further includes: Generate the monitoring result according to the MQTT message format based on the operation result, and send the monitoring result to the MQTT message server, wherein the monitoring result includes the MQTT identifier of the automation client; The MQTT message server receives the monitoring result and publishes it to a topic subscribed by the automation client according to the MQTT identifier of the automation client.
4. The remote automated operation method according to claim 3, characterized in that: Before receiving the monitoring request sent by the automation server according to the topic subscribed in the MQTT message server, the remote automation operation method further includes: Starting the target software; Connecting to the MQTT message server and subscribing to a topic according to the MQTT identifier of the automation client; The processing function for operating the target software is set.
5. The remote automated operation method according to claim 4, characterized in that: The automation client uses the first type of language, and after connecting to the MQTT message server and subscribing to a topic according to the MQTT identifier of the automation client, the remote automation operation method further includes: The processing function is registered in the memory registry of the system where the automation client is installed.
6. A remote automation operation method based on the MQTT protocol, applied to an automation server, characterized in that: include: Generate a monitoring request and publish it through an MQTT message server, wherein the monitoring request includes a server ID and an operation content, so that the automation client obtains the monitoring request according to the subscribed topic, and determines whether it is an executable operation according to the operation content of the monitoring request. If it is an executable operation, the corresponding control of the target software is operated according to the operation content and an operation result is generated. The target software is the software on which the automation client performs the automation operation; The monitoring result sent by the automation client is received according to the topic subscribed in the MQTT message server, where the monitoring result is generated by the automation client according to the operation result and published through the MQTT message server.
7. The remote automated operation method according to claim 6, characterized in that: Generating a monitoring request and publishing it via an MQTT message server further comprises: Generate the monitoring request according to the MQTT message format and send the monitoring request to the MQTT message server, wherein the monitoring request includes the MQTT identifier of the automation server; The MQTT message server receives the monitoring request and publishes it to the topic subscribed by the automation server according to the MQTT identifier of the automation server.
8. The remote automated operation method according to claim 7, characterized in that: Generating the monitoring request according to the MQTT message format and sending the monitoring request to the MQTT message server further includes: The monitoring request is sent to the MQTT message server using a synchronous interface or an asynchronous interface.
9. The remote automated operation method according to claim 7, characterized in that: Before generating the monitoring request and publishing it through the MQTT message server, the remote automation operation method further includes: Connect to the MQTT message server and subscribe to a topic according to the MQTT identifier of the automation server.
10. A remote automation operating system based on the MQTT protocol, characterized in that: The system comprises an automation server, an MQTT message server, and at least one automation client, wherein the automation client is configured as follows: Receive a monitoring request sent by the automation server according to a topic subscribed in the MQTT message server, wherein the monitoring request is issued by the automation server through the MQTT message server and includes a server ID and operation content; Determine whether the operation is executable according to the operation content of the monitoring request, and if it is executable, operate the corresponding control of the target software according to the operation content and generate an operation result, wherein the target software is the software for the automation client to perform the automation operation; A monitoring result is generated according to the operation result and published through the MQTT message server, so that the automation server obtains the operation result according to the subscribed topic.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented; or When the program is executed by a processor, the method according to any one of claims 6 to 9 is implemented.
12. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 5 is implemented; or When the processor executes the program, the method according to any one of claims 6 to 9 is implemented.
Citation Information
Patent Citations
Internet of Things management method, device and equipment based on MQTT protocol and storage medium
CN117176749A
Dynamic security policy management
US10868836B1
Receiving a Data Object at a Device
US20190097962A1