A remote automation operation method and operating system based on MQTT protocol

Through the MQTT protocol and user interface automation technology, a remote automated operation method is realized, which solves the problem of high cost of existing software updates and achieves the effect of integrating functions and improving efficiency without updating software.

CN119652745BActive Publication Date: 2025-09-19BOE TECHNOLOGY GROUP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411775391.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-09-19
Estimated Expiration
2044-12-04

AI Technical Summary

Technical Problem

The cost of updating existing software is high and some software manufacturers no longer provide follow-up services, making it difficult to integrate existing software functions and automate operations.

Method used

A remote automation operation method based on the MQTT protocol is adopted. By automating the communication between the server and the client, the MQTT message server is used as an intermediary to realize remote automation operation of the target software, and the user interface automation technology is used to obtain controls and perform operations.

Benefits of technology

Function integration and automated operation can be achieved without updating existing software, which improves automated operation performance, reduces production costs and improves production efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119652745B_ABST
    Figure CN119652745B_ABST
Patent Text Reader

Abstract

The present invention discloses a remote automation operation method and operating system based on the MQTT protocol. The remote automation operation method applied to an automation client comprises: receiving a monitoring request sent by the automation server according to a topic subscribed to an 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; determining whether the operation is executable according to the operation content of the monitoring request; if the operation is executable, operating the corresponding control of the target software according to the operation content and generating an operation result, wherein the target software is the software that performs the automation operation on the automation client; generating a monitoring result based on the operation result and publishing it through the MQTT message server, so that the automation server obtains the operation result according to the subscribed topic. The embodiments provided by the present invention superimpose the MQTT protocol on the basis of user interface automation technology to achieve remote automation.
Need to check novelty before this filing date? Find Prior Art

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 advancement of automation technology, the use of software to control manufacturing systems has become a mainstream operation in industrial production. However, the constant emergence of new requirements and features has led to an increasing cost for software updates. In particular, when software manufacturers no longer provide follow-up services, how to integrate and automate existing software functions has become a pressing technical challenge for those skilled in the art. 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 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;

[0005] Determining whether the operation is executable based on the operation content of the monitoring request, and if it is an executable operation, operating the corresponding control of the target software according to the operation content and generating an operation result, wherein the target software is the software on which the automation client performs 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 an executable operation, operating the corresponding control of the target software according to the operation content and generating an 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 the result through the MQTT message server, so that the automation server obtains the first error result according to a subscribed topic;

[0010] If the processing function is found, the instruction content is parsed; if the format of the instruction content does not conform to a 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; 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; 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] Generating the monitoring result according to the MQTT message format of the operation result, and sending 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 to 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. 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] Register the processing function 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 and includes:

[0024] Generate a monitoring request and publish it through an MQTT message server. The monitoring request includes a server ID and operation content, so that the automation client obtains the monitoring request according to the subscribed topic, and determines whether the operation is executable according to the operation content of the monitoring request. If the operation is executable, operate the corresponding control of the target software according to the operation content and generate an operation result. 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 to 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] Generating the monitoring request in the MQTT message format and sending 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 a 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 based on 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 to:

[0034] Receive 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;

[0035] Determining whether the operation is executable based on the operation content of the monitoring request, and if it is an executable operation, operating the corresponding control of the target software according to the operation content and generating an operation result, wherein the target software is the software on which the automation client performs 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 response to the current problems, the present invention develops a remote automation operation method and operating system based on the MQTT protocol. By using user interface automation technology, a service framework including an automation server and an automation client is formed. At the same time, by using the MQTT protocol as a communication medium between the automation server and the automation client, remote automation operation based on the MQTT protocol is 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 operation, effectively improving the automation operation performance, increasing 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 illustrating a remote automated operation method according to an embodiment of the present invention;

[0051] Figure 4 A flowchart showing a remote automated 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 following detailed description is illustrative rather than restrictive and should not be used to limit the scope of protection of the present invention.

[0054] In response to the problems existing in related technologies, such as Figure 1 As shown, one embodiment of the present invention provides a remote automation operation method based on the MQTT protocol, which is applied to an automation client, including:

[0055] Receive 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;

[0056] Determining whether the operation is executable based on the operation content of the monitoring request, and if it is an executable operation, operating the corresponding control of the target software according to the operation content and generating an operation result, wherein the target software is the software on which the automation client performs 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, which includes an automation server, an MQTT message server, and at least one automation client.

[0059] The automation client is installed or runs on the device or equipment of the target software to be updated or integrated. The automation client uses 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 accessibility framework provided by Microsoft for the Windows platform. It allows programmatic access to user interface (UI) information and interacts with the target software by simulating traditional mouse and keyboard input through code. In this embodiment, the automation client uses UI automation technology to obtain controls on the target software's operating interface. For example, it uses scoping and filtering to determine controls such as buttons, text boxes, and image boxes on the target software's operating interface, initiates monitoring of each control, and responds to changes and updates to each control. For example, it implements operations on the target software's operating interface through actions such as single-clicking, double-clicking, and screenshots.

[0060] The automation server is installed on a remote server, on-site server or 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 Broker is a core component of the MQTT (Message Queuing Telemetry Transport) protocol. It serves as a communication intermediary and is responsible for handling message transmission between clients. The MQTT protocol is a lightweight communication protocol based on the publish / subscribe model, built on top of the TCP / IP protocol. It is simple, open, and easy to implement. The MQTT Broker can operate efficiently in resource-constrained environments and is particularly suitable for scenarios such as industrial automation and the Internet of Things. Both the automation client and the automation server in this embodiment are clients of the MQTT Broker, enabling remote automation operations through the MQTT Broker.

[0062] In this embodiment, the automation server serves as the primary control terminal, while the automation client serves as the execution terminal. The MQTT message server, based on a publish / subscribe model, provides intermediary transmission services between the two. This embodiment, building on the service framework formed by the automation server and the automation client using user interface automation technology, further implements remote automation via MQTT. This allows for the integration and automation of software functions without requiring existing software updates, effectively improving automation performance, increasing 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 is started by first launching the target software, then connecting to the MQTT message server, subscribing to a topic based on the automation client's MQTT identifier, and setting the processing function for operating the target software. Specifically, for example, when the device on which the target software is installed or running is powered on and started, the automation client is started, and the target software is started. The automation client includes a controller and an MQTT client. The MQTT client is started and connects to the MQTT message server, establishing a communication connection between the automation client and the MQTT message server. Simultaneously, the automation client subscribes to a topic on the MQTT message server based on the automation client's MQTT client identifier, thereby implementing a topic subscription model between the automation client and the MQTT message server. Finally, the automation client controller sets processing functions for operating the target software, such as processing functions for operating window text, buttons, mouse clicks, mouse double-clicks, screenshots, and the like. For example, if the automation client is programmed in a language that supports reflection search, such as C#, the corresponding processing function is found through reflection search during the application process. In other words, the automation client completes its own startup and various operational preparations for operating the target software during the initialization phase.

[0066] In an optional embodiment, the automation client uses a first-class language to register the processing function in 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 the corresponding processing function can be found through the memory registry during the application process.

[0068] It is worth noting that this 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 based on actual application requirements, which are all within the scope of protection of this 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 this 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 via the MQTT messaging server. The monitoring request includes a server ID and operation details. For example, the automation server sends a monitoring request to the MQTT messaging server at a preset time or time interval. The monitoring request includes the automation server's server ID and operation details, where the operation details include an operation instruction and instruction content.

[0075] In a specific embodiment, the automation server generates the monitoring request in accordance with 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 and sends it to an MQTT message server, which then publishes the monitoring request. Specifically, the automation server's processor first generates the monitoring request in the MQTT message format and then sends the monitoring request to the MQTT message server via the MQTT client. Upon receiving the monitoring request, the MQTT message server identifies the topic to which the automation server is subscribed based on the MQTT identifier in the monitoring request and publishes the monitoring request to that topic, allowing all MQTT clients subscribed to that topic to receive 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 on 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 and asynchronous interfaces. Those skilled in the art should select the appropriate interface based on actual application requirements and design the communication process according to the interface type. This will not be detailed 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. 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. If it is an executable operation, the automation client 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 verifies the received monitoring request and executes the instructions in the monitoring request on the target software after the verification is successful. The specific steps include:

[0084] First, the automation client searches for a corresponding processing function according to the operation instruction. If no processing function is found, a first error result is generated and published 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 instruction content, wherein the instruction content includes a target control of the target software. Based on the operation instruction in the operation content, the automation client uses a reflection search function or searches the memory registry for a processing function corresponding to the operation instruction. 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 a corresponding processing function is found, the verification step is continued. If a 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 publishes the first error result to the topics subscribed by the automation client and the automation server, thereby allowing the automation server to confirm 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, verifying it according to a preset instruction content format. If the instruction content format conforms to the preset format, the verification step continues. If the instruction content format does not conform to the preset format, the instruction content is deemed to be erroneous, a second error result is generated, and sent to the MQTT message server. The MQTT message server then publishes the second error result to topics subscribed to by the automation client and the automation server, thereby confirming that the instruction content of the sent monitoring request is erroneous and invalidating the sent monitoring request.

[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 target software's main window, such as the target software's user interface. If the target software's user interface is found, the verification step continues. If the target software's user interface is not found, the automation client determines that there is a problem with the target software's startup and subsequent operations cannot be performed. A third error result is generated and sent to the MQTT message server. The MQTT message server then publishes the third error result to topics subscribed to by the automation client and the automation server, thereby confirming that the automation client has not found the target software's main window and that 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 a button on the target software's user interface. If the button is found, the automation client continues with the subsequent operation. If the button is not found, the automation client determines that the instruction content of the monitoring request is incorrect and the subsequent operation cannot be performed. A fourth error result is generated and sent to the MQTT message server. The MQTT message server then publishes the fourth error result to topics subscribed to by the automation client and the automation server, thereby confirming that the automation client did not find the button on the target software and that the monitoring request sent is invalid.

[0092] Fifth, if the target control exists, the operation instruction is executed on the target control using the processing function and an operation result is generated.

[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 a button on the operation interface of the target software, thereby enabling the automation server to control the automation client through the MQTT message server to operate the target software, that is, to realize remote automation operation.

[0094] It is worth noting that this embodiment is only used to illustrate the specific implementation method of this application. This 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, by clicking a button on the target software's user interface, the user interface updates its window based on the operation, such as by presenting feedback information or a feedback image, or by providing no feedback. The automation client then generates an operation result based on the operation, such as by extracting text from the feedback information or feedback image or by taking a screenshot. The automation client then sends the operation result to an MQTT message server, specifically including: generating a monitoring result from the operation result in an MQTT message format, and sending 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 based on the MQTT identifier of the automation client. Specifically, the automation client sends the operation result to the MQTT message server, which in turn publishes the operation result to topics subscribed to by the automation client and the automation server, thereby confirming that the automation client has clicked the button on the target software, that the sent monitoring request has been effectively executed, and that the returned operation result has been 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 command requests based on the text or images in the operation results, and publishing the command requests via the MQTT message server to control the automation client to execute the command requests. Those skilled in the art will understand that the above operations are all within the scope of protection of this application and will not be further described 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 serves as the master control terminal, the automation client serves as the execution terminal, and the MQTT message server serves as the intermediary transmission between the two. Based on the publish / subscribe model of the MQTT protocol, remote automated operation of the target software is achieved. Specifically, this embodiment, building on the service framework formed by the automation server and automation client using user interface automation technology, further implements remote automated operation via MQTT. This allows for the integration and automated operation of software functions without the need to update existing software, effectively improving automated operation performance, increasing production efficiency, and reducing production costs.

[0103] Based on the remote automation operation method of the above embodiment, Figure 4 As shown, one 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. The monitoring request includes a server ID and operation content, so that the automation client obtains the monitoring request according to the subscribed topic, and determines whether the operation is executable according to the operation content of the monitoring request. If the operation is executable, operate the corresponding control of the target software according to the operation content and generate an operation result. 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 to 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 via MQTT. This allows for integration and automation of software functions without having to update existing software, effectively improving automation performance, increasing production efficiency, and reducing production costs. The specific implementation of this embodiment is described in the previous embodiment and 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 to:

[0108] Receive 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;

[0109] Determining whether the operation is executable based on the operation content of the monitoring request, and if it is an executable operation, operating the corresponding control of the target software according to the operation content and generating an operation result, wherein the target software is the software on which the automation client performs 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] This embodiment addresses the current problems by using 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 existing technology. There is no need to update the existing software to achieve functional integration and automation operations, effectively improving the performance of automation operations, increasing production efficiency, and reducing 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. When the program is executed by a processor, a remote automation operation method based on the MQTT protocol is implemented.

[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, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. 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 thereof. 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] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0115] Program code embodied on a 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 stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving 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., through the Internet using an Internet service provider).

[0117] like Figure 5As shown, a structural 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 a general-purpose computing device. 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 various 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, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. 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, often called a "hard drive"). Although Figure 5 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) 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 configured to perform the functions of various embodiments of the present invention.

[0122] A program / utility T40 having a set (at least one) of program modules T42 may be stored, for example, in memory T28. Such program modules T42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may include an implementation of a network environment. The program modules T42 generally implement 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., a keyboard, a pointing device, a 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., a network card, a 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., a local area network (LAN), a wide area network (WAN), and / or a 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 the 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, such as 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 scope of protection 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 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; Determining whether the operation is executable based on the operation content of the monitoring request, and if it is an executable operation, operating the corresponding control of the target software according to the operation content and generating an operation result, wherein the target software is the software on which the automation client performs the automation operation; Generate a monitoring result according to the operation result and publish it through the MQTT message server, so that the automation server obtains the operation result according to the subscribed topic; 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 an executable operation, operating the corresponding control of the target software according to the operation content and generating an 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 the result through the MQTT message server, so that the automation server obtains the first error result according to a subscribed topic; If the processing function is found, the instruction content is parsed; if the format of the instruction content does not conform to a 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; 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; 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.

2. The remote automated operation method according to claim 1, characterized in that: Generating a monitoring result according to the operation result and publishing it through the MQTT message server further includes: Generating the monitoring result according to the MQTT message format of the operation result, and sending 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.

3. The remote automated operation method according to claim 2, characterized in that: Before receiving the monitoring request sent by the automation server according to the topic subscribed to 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.

4. The remote automated operation method according to claim 3, 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: Register the processing function in the memory registry of the system where the automation client is installed.

5. A remote automation operation method based on the MQTT protocol, applied to the automation server, characterized in that: include: Generate a monitoring request and publish it through an MQTT message server. The monitoring request includes a server ID and operation content, so that the automation client obtains the monitoring request according to the subscribed topic, and determines whether the operation is executable according to the operation content of the monitoring request. If the operation is executable, operate the corresponding control of the target software according to the operation content and generate an operation result. The target software is the software on which the automation client performs the automation operation; The operation content includes an operation instruction and instruction content, and the instruction content includes a target control of the target software. The automation client further includes: searching for a corresponding processing function according to the operation instruction, generating a first error result if the processing function is not found, and publishing the result through the MQTT message server, so that the automation server obtains the first error result according to a subscribed topic; parsing the instruction content if the processing function is found, generating a second error result if the format of the instruction content does not conform to a preset format, and publishing the result through the MQTT message server, so that the automation server obtains the second error result according to a subscribed topic; searching for a main window of the target software if the main window does not exist, generating a third error result if the main window does not exist, and publishing the result through the MQTT message server, so that the automation server obtains the third error result according to the subscribed topic; searching for the target control if the main window of the target software is found, generating a fourth error result if the target control does not exist, and publishing the result through the MQTT message server, so that the automation server obtains the fourth error result according to the subscribed topic; and executing the operation instruction on the target control using the processing function and generating an operation result if the target control exists. The monitoring result sent by the automation client is received according to the topic subscribed to 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.

6. The remote automated operation method according to claim 5, characterized in that: Generating a monitoring request and publishing it via an MQTT message server further includes: Generate the monitoring request in 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 a topic subscribed by the automation server according to the MQTT identifier of the automation server.

7. The remote automated operation method according to claim 6, 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.

8. The remote automated operation method according to claim 6, 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 based on the MQTT identifier of the automation server.

9. 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 to: Receive 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; Determining whether the operation is executable based on the operation content of the monitoring request; if it is an executable operation, operating a corresponding control of the target software according to the operation content and generating an operation result, wherein the target software is the software on which the automation client performs the automation operation; the operation content includes an operation instruction and instruction content, and the instruction content includes a target control of the target software; and further comprising: 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 the result through the MQTT message server, so that the automation server obtains the first error result according to a subscribed topic; If the processing function is found, the instruction content is parsed; if the format of the instruction content does not conform to a 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; 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; 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, executing the operation instruction on the target control using the processing function and generating an operation result; 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.

10. 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 4 is implemented; or When the program is executed by a processor, the method according to any one of claims 5 to 8 is implemented.

11. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 4 is implemented; or When the processor executes the program, the method according to any one of claims 5 to 8 is implemented.

Citation Information

Patent Citations

  • Internet of Things management method, device and equipment based on MQTT protocol and storage medium

    CN117176749A

  • Receiving a Data Object at a Device

    US20190097962A1