CN114363225A - MTQQ protocol-based device debugging mode, system and storage medium - Google Patents

MTQQ protocol-based device debugging mode, system and storage medium Download PDF

Info

Publication number
CN114363225A
CN114363225A CN202111585736.6A CN202111585736A CN114363225A CN 114363225 A CN114363225 A CN 114363225A CN 202111585736 A CN202111585736 A CN 202111585736A CN 114363225 A CN114363225 A CN 114363225A
Authority
CN
China
Prior art keywords
theme
target
mtqq
debugging
protocol
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111585736.6A
Other languages
Chinese (zh)
Other versions
CN114363225B (en
Inventor
申凯枫
江滔
邵国光
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Umeox Innovations Co ltd
Original Assignee
Umeox Innovations Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Umeox Innovations Co ltd filed Critical Umeox Innovations Co ltd
Priority to CN202111585736.6A priority Critical patent/CN114363225B/en
Publication of CN114363225A publication Critical patent/CN114363225A/en
Application granted granted Critical
Publication of CN114363225B publication Critical patent/CN114363225B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a device debugging method, a system and a storage medium based on an MTQQ protocol, wherein the method comprises the following steps: when test data aiming at a theme to be debugged sent by a server are received, acquiring a target theme corresponding to the test data; obtaining a theme template according to preset JSON data; obtaining theme content corresponding to the target theme according to the data to be processed; generating a response result corresponding to the test data according to the theme content and the theme template; and returning the response result to the server so that the server can determine the target debugging result of the equipment to be tested according to the response result. According to the method and the device, the preset JSON data are extracted and set, when the test data including the target theme returned by the server are received, the theme template is obtained according to the preset JSON data, the theme content is obtained according to the data to be processed, the response result can be generated according to the theme content and the theme template, and the problem that debugging errors are caused due to the fact that the JSON data need to be written manually is solved.

Description

MTQQ protocol-based device debugging mode, system and storage medium
Technical Field
The invention relates to the technical field of computers, in particular to a device debugging method, a device debugging system and a storage medium based on an MTQQ protocol.
Background
Due to the requirement of the intelligent equipment of the internet of things on a debugging terminal, a client side of an MQTT protocol and the intelligent equipment are required to perform technical test based on client-server message publishing/subscribing. However, when the existing MQTT platform is debugged, a connection is usually established between a client and a server, the server sends a corresponding debugging item to the client, and after the client receives the corresponding debugging item, JSON data is manually compiled according to the corresponding debugging item, which is prone to error and long in time consumption.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a device debugging method, a device debugging system and a storage medium based on an MTQQ protocol, and aims to solve the problems of high error rate and long time consumption when equipment is debugged.
In order to achieve the above object, the present invention provides an apparatus debugging method based on MQTT protocol, which is applied to an apparatus to be tested of an apparatus debugging system based on MTQQ protocol, where the apparatus debugging system includes an apparatus to be tested and a server, and the apparatus debugging method includes the steps of:
when test data aiming at a theme to be debugged sent by the server are received, acquiring a target theme corresponding to the test data;
obtaining a theme template according to preset JSON data;
obtaining theme content corresponding to the target theme according to the data to be processed;
generating a response result corresponding to the target theme according to the theme content and the theme template;
and returning the response result to the server so that the server can determine the target debugging result of the equipment to be tested according to the response result.
Optionally, when receiving test data for a topic to be debugged returned by the server, before the step of obtaining a target topic corresponding to the test data, the method further includes:
sending a connection packet to the server, wherein the connection packet comprises the theme to be debugged;
and receiving a connection confirmation returned by the server to complete the connection between the equipment to be tested and the server.
Optionally, the step of obtaining the theme template according to the preset JSON data includes:
analyzing the test data according to a preset algorithm to obtain the target theme;
verifying whether the target test data is associated with the subject to be debugged;
and if so, analyzing the preset JSON data to obtain the theme template.
Optionally, the step of obtaining the theme content corresponding to the target theme according to the data to be processed includes:
performing condition judgment operation and/or condition filtering operation on the data to be processed and the target theme to obtain a matching result matched with the target theme;
and determining the subject content according to the matching result.
Optionally, the step of generating a response result corresponding to the target topic according to the topic content and the topic template includes:
and sleeving the theme content and the target theme in the theme template to generate the response result.
In addition, in order to achieve the above object, the present invention further provides a device debugging method based on the MTQQ protocol, which is applied to a server of a device debugging system based on the MTQQ communication protocol, and the steps of the device debugging method based on the MTQQ protocol include:
when a connection packet sent by equipment to be tested is received, returning a connection confirmation to the equipment to be tested according to the connection packet so as to complete the connection with the equipment to be tested;
acquiring a theme to be debugged corresponding to the connection packet, and sending a target theme aiming at the theme to be debugged to the equipment to be tested;
receiving a response result returned by the equipment to be tested;
and determining a target debugging result of the equipment to be tested according to the response result.
Optionally, the step of determining the target debugging result of the device under test according to the response result includes:
judging whether the response result is matched with a preset response result corresponding to the target theme or not;
if so, determining that the target debugging result is successful in debugging;
if not, determining that the target debugging result is debugging failure.
In addition, in order to achieve the above object, the present invention further provides an apparatus debugging system based on the MTQQ protocol, where the apparatus debugging system based on the MTQQ communication protocol includes an apparatus to be tested and a server;
the device debugging system based on the MTQQ protocol further comprises a memory, a processor and a device debugging program based on the MTQQ protocol, wherein the device debugging program based on the MTQQ protocol is stored in the memory and can run on the processor, and when being executed by the processor, the device debugging program based on the MTQQ protocol realizes the steps of the device debugging method based on the MTQQ protocol.
In addition, in order to achieve the above object, the present invention further provides a storage medium, wherein the storage medium stores a device debugging program based on the MTQQ protocol, and the device debugging program based on the MTQQ protocol implements the steps of the device debugging method based on the MTQQ protocol when being executed by a processor.
The embodiment of the invention provides a device debugging method, a system and a storage medium based on an MTQQ protocol, which are characterized in that preset JSON data are set in advance, in the process of debugging a device to be tested, test data aiming at a theme to be debugged returned by a server are received, a target theme corresponding to the test data is obtained, the preset JSON data are directly called, a theme template is obtained according to the preset JSON data, theme content corresponding to the target theme is obtained according to the data to be processed, a response result aiming at the test data is generated according to the theme template and the theme content, the response result is returned to the server so that the server can determine the debugging result of the device to be debugged according to the response result, the application presets the JSON data in advance, when the intelligent device needs to be debugged, the debugging of the intelligent device can be completed by directly calling the preset JSON data without manually writing the JSON data, so that the efficiency of debugging the device is improved, and the accuracy of debugging the device is improved.
Drawings
FIG. 1 is a schematic diagram of a terminal \ device structure of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a first embodiment of a method for debugging a device based on the MTQQ protocol according to the present invention;
FIG. 3 is a schematic flow chart of a first embodiment of a method for debugging a device based on the MTQQ protocol according to the present invention;
fig. 4 is a detailed flowchart of step S20 of the method for debugging a device based on the MTQQ protocol according to the first embodiment of the present invention;
fig. 5 is a detailed flowchart of step S30 of the method for debugging a device based on the MTQQ protocol according to the first embodiment of the present invention;
FIG. 6 is a flowchart illustrating a second embodiment of a method for debugging a device based on the MTQQ protocol according to the present invention;
fig. 7 is a detailed flowchart of step S90 of the method for debugging a device based on the MTQQ protocol according to the second embodiment of the present invention;
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The main solution of the embodiment of the invention is as follows: when test data aiming at a theme to be debugged sent by the server are received, acquiring a target theme corresponding to the test data; obtaining a theme template according to preset JSON data; obtaining theme content corresponding to the target theme according to the data to be processed; generating a response result corresponding to the test data according to the theme content and the theme template; and returning the response result to the server so that the server can determine the target debugging result of the equipment to be tested according to the response result.
As shown in fig. 1, fig. 1 is a schematic terminal structure diagram of a hardware operating environment according to an embodiment of the present invention.
The terminal of the embodiment of the invention can be a PC, and can also be terminal equipment such as a smart phone, a tablet computer, a portable computer and the like.
As shown in fig. 1, the terminal may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Optionally, the terminal may further include a camera, a Radio Frequency (RF) circuit, a sensor, an audio circuit, a WiFi module, and the like. Such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display screen according to the brightness of ambient light, and a proximity sensor that may turn off the display screen and/or the backlight when the mobile terminal is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), detect the magnitude and direction of gravity when the mobile terminal is stationary, and can be used for applications (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer and tapping) and the like for recognizing the attitude of the mobile terminal; of course, the mobile terminal may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which are not described herein again.
Those skilled in the art will appreciate that the terminal structure shown in fig. 1 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a device debugging program based on the MTQQ protocol.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be configured to call the MTQQ protocol-based device debugging program stored in the memory 1005, and perform the following operations:
when test data aiming at a theme to be debugged sent by the server are received, acquiring a target theme corresponding to the test data;
obtaining a theme template according to preset JSON data;
obtaining theme content corresponding to the target theme according to the data to be processed;
generating a response result corresponding to the test data according to the theme content and the theme template;
and returning the response result to the server so that the server can determine the target debugging result of the equipment to be tested according to the response result.
Further, the processor 1001 may call the MTQQ protocol-based device debugger program stored in the memory 1005, and also perform the following operations:
sending a connection packet to the server, wherein the connection packet comprises the theme to be debugged;
and receiving a connection confirmation returned by the server to complete the connection between the equipment to be tested and the server.
Further, the processor 1001 may call the MTQQ protocol-based device debugger program stored in the memory 1005, and also perform the following operations:
analyzing the test data according to a preset algorithm to obtain the target theme;
verifying whether the target test data is associated with the subject to be debugged;
and if so, analyzing the preset JSON data to obtain the theme template.
Further, the processor 1001 may call the MTQQ protocol-based device debugger program stored in the memory 1005, and also perform the following operations:
performing condition judgment operation and/or condition filtering operation on the data to be processed and the target theme to obtain a matching result matched with the target theme;
and determining the subject content according to the matching result.
Further, the processor 1001 may call the MTQQ protocol-based device debugger program stored in the memory 1005, and also perform the following operations:
and sleeving the theme content and the target theme in the theme template to generate the response result.
Further, the processor 1001 may call the MTQQ protocol-based device debugger program stored in the memory 1005, and also perform the following operations:
when a connection packet sent by equipment to be tested is received, returning a connection confirmation to the equipment to be tested according to the connection packet so as to complete the connection with the equipment to be tested;
acquiring a theme to be debugged corresponding to the connection packet, and sending a target theme aiming at the theme to be debugged to the equipment to be tested;
receiving a response result returned by the equipment to be tested;
and determining a target debugging result of the equipment to be tested according to the response result.
Further, the processor 1001 may call the MTQQ protocol-based device debugger program stored in the memory 1005, and also perform the following operations:
judging whether the response result is matched with a preset response result corresponding to the target theme or not;
if so, determining that the target debugging result is successful in debugging;
if not, determining that the target debugging result is debugging failure.
First embodiment
Referring to fig. 2, a first embodiment of the device debugging method based on the MTQQ protocol according to the present invention provides a device debugging method based on the MTQQ protocol, where the device debugging method based on the MTQQ protocol includes:
step S10, when test data aiming at the theme to be debugged sent by the server is received, a target theme corresponding to the test data is obtained;
step S20, obtaining a theme template according to preset JSON data;
step S30, obtaining the subject content corresponding to the target subject according to the data to be processed;
step S40, generating a response result corresponding to the test data according to the theme content and the theme template;
step S50, returning the response result to the server, so that the server determines the target debugging result of the device under test according to the response result.
In this embodiment, the device to be tested is applied to a device debugging system based on an MTQQ protocol, the device debugging system based on the MTQQ protocol includes a device to be tested and a server, the device to be tested the intelligent device is a device which transforms a conventional device in a mode of combining software and hardware, and further has an intelligent function. After the intelligent operation, the equipment has the connection capability, the loading of the internet service is realized, a typical architecture of 'cloud + end' is formed, and the additional values of big data and the like are achieved. The smart devices may include, for example, but are not limited to: intelligent wrist-watch, micro-game machine, virtual reality product, smart mobile phone, intelligent bracelet, intelligent drinking cup, smart TV, intelligent glasses, intelligent lock, intelligent house product (intelligent refrigerator, intelligent air conditioner etc.), smart car, intelligent medical health product, intelligent toy, intelligent robot etc..
Optionally, before debugging the device under test, the device under test needs to be connected to the server, referring to fig. 3, before step S10, the method further includes:
step S11, sending a connection packet to the server, wherein the connection packet comprises the theme to be debugged;
and step S12, receiving a connection confirmation returned by the server to complete the connection between the device to be tested and the server.
Optionally, the device to be tested sends a connection packet to the server through an MTQQ protocol, where the connection packet includes the theme to be debugged.
Optionally, the connection packet further includes an authentication password, and the server verifies the access eligibility of the device to be tested through the authentication password. The authentication password may be configured by the server for the device to be tested in advance, or may be configured by a developer.
Optionally, the authentication password is obtained through an MD5 encryption algorithm according to the device identifier of the device to be tested, and it can be understood that the server stores a preset authentication password of the device to be tested in advance, where the preset authentication password is obtained by presetting and acquiring the device identifier of the device to be tested by the server and performing MD5 encryption operation according to the device identifier. In the actual debugging process, the equipment to be tested sends the connection package that contains the authentication password to the server, the server is receiving connect package back, the analysis connect the package and acquire the authentication password to call the storage before predetermineeing the authentication password, judge whether the authentication password with predetermine the authentication password unanimity, when the authentication password with predetermine the authentication password unanimity, confirm the equipment to be tested inserts qualifiedly.
Optionally, the connection packet includes, but is not limited to, a theme to be debugged and an authentication password, and may further include a certificate file corresponding to the device to be tested, so that the server performs certificate verification on the device to be tested through the certificate file.
Optionally, in an embodiment, the device to be tested sends a connection packet including an authentication password and a theme to be debugged to the server, after the server receives the connection packet, the authentication password in the connection packet is extracted, password verification is performed on the device to be tested according to the authentication password to verify the access qualification of the device to be tested, when it is determined that the device to be tested is qualified in access, a connection confirmation is sent to the device to be tested to complete connection with the device to be tested, the theme to be debugged in the connection packet is extracted, test data for the theme to be debugged is generated according to the theme to be debugged, and the test data is sent to the device to be tested which is successfully connected.
Optionally, in another embodiment, the device under test sends a connection packet including an authentication password and/or a certificate file to the server, when the server receives the connection packet, the device under test is subjected to password verification and/or certificate verification according to the connection packet to verify the access eligibility of the device under test, when it is determined that the device under test is eligible for access, a connection confirmation is sent to the device under test to complete the connection between the device under test and the server, and after the device under test is successfully connected to the server, the device under test sends the theme to be debugged to the server, so that the server returns test data for the theme to be debugged to the device under test according to the theme to be debugged.
Optionally, after receiving the test data, the device to be tested analyzes the test data through a preset algorithm to obtain a target theme corresponding to the test data, where the preset algorithm may be a BUS function, it can be understood that the test data includes the target theme, the target theme is associated with the theme to be debugged, and a fine granularity of the target theme is smaller than the theme to be debugged.
It can be understood that the server stores the mapping relationship between the to-be-debugged theme and the target theme, and after receiving the to-be-debugged theme, the server determines the target theme associated with the to-be-debugged theme according to the mapping relationship, and then generates the test data according to the target theme.
Optionally, after receiving the test data, in order to determine whether the device under test has successfully subscribed to the theme to be debugged, with reference to fig. 4, step S20 includes:
step S21, analyzing the test data according to a preset algorithm to obtain the target theme;
step S22, verifying whether the target theme is associated with the theme to be debugged;
and step S23, if yes, analyzing the preset JSON data to obtain the theme template.
Optionally, after receiving the test data, the device to be tested analyzes the test data through a preset algorithm, where the preset algorithm is a BUS function.
Optionally, after the target theme is obtained, it is verified whether the target theme is associated with the theme to be debugged, and when the target theme is associated with the theme to be debugged, it is determined that the device to be tested has successfully subscribed to the theme to be debugged.
Optionally, when the target theme is not associated with the theme to be debugged, if it is determined that the device to be tested does not successfully subscribe to the theme to be debugged, sending a message including a subscription theme to be debugged to the server until the device to be tested successfully subscribes to the theme to be debugged.
Optionally, the verifying whether the target theme is associated with the theme to be debugged may be invoking a corresponding relationship of the theme to be debugged, where the corresponding relationship includes each theme associated with the theme to be debugged, and after the corresponding relationship is invoked, determining whether the corresponding relationship includes the target theme, and if so, determining that the target theme is associated with the theme to be debugged.
Optionally, when the target theme is associated with the theme to be debugged, the preset JSON data is called, where the preset JSON data includes a theme template stored in a JSON format, and a JSON (JSON Object Notation) is a lightweight data exchange format.
Optionally, the preset JSON data includes an RPC array, and the RPC array has data such as identifier, name, rpcType RPC type, callType call type, sendParams transmission parameter, and the like.
Optionally, the preset JSON data is a theme template generated by a developer according to a function module of the intelligent device, and the theme template may be applied to various types of intelligent devices.
Optionally, after the device to be tested has successfully subscribed to the theme to be debugged, the preset JSON data is analyzed to obtain the theme template.
Optionally, after the device to be tested has successfully subscribed to the theme to be debugged, obtaining theme content corresponding to the target theme according to data to be processed, where the data to be processed is device data acquired by the device to be tested in a networking and real-time manner, and the device data includes, but is not limited to, working state information and operation data of an intelligent device. For example, the device to be processed may include operating state information of an uninterruptible power supply, a temperature sensor, temperature and humidity data collected by a smoke sensor, operating state information of an air conditioner and an access control, and the like.
It is understood that the data to be processed includes not only the data corresponding to the target subject but also the data not matching the target subject, and based on this, referring to fig. 5, the step S30 includes:
step S31, performing condition judgment operation and/or condition filtering operation on the data to be processed and the target theme to obtain a matching result matched with the target theme;
and step S32, determining the subject content according to the matching result.
Optionally, the condition determining operation is to determine whether the data to be processed matches the target theme by using the target theme as a determining condition to obtain a corresponding determining result, and the condition filtering operation is to perform a filtering condition on the determining result to filter out data that does not match the target theme, only to retain data that matches the target theme, and further to determine the data as a matching result that matches the target theme.
Optionally, when the condition determining operation is performed, if the device data in the data to be processed does not match the target topic, determining that the determination result is not matching, and if the device data in the data to be processed matches the target topic, determining that the determination result is matching.
Optionally, after the condition determining operation is completed, a determining result corresponding to each piece of device data is obtained, the condition filtering operation is executed according to the determining result, when the determining result is a match, the device data is retained, and when the determining result is a mismatch, the device data is filtered.
Optionally, after the condition filtering operation is completed, obtaining and retaining the device data, determining the device as the matching result matched with the target topic, and further determining the matching result as the topic content.
It can be understood that the execution sequence of step S20 and step S30 can be set by user, and the preset JSON data can be parsed first to obtain a theme template, and then the theme content corresponding to the target theme can be obtained according to the data to be processed, or the theme content corresponding to the target theme can be obtained according to the data to be processed, and then the preset JSON data can be parsed to obtain the theme template, or the execution can be performed in parallel, and the preset JSON data can be parsed to obtain the theme template, and the theme content corresponding to the target theme can be obtained according to the data to be processed.
Optionally, after the theme template and the theme content are obtained, a response result corresponding to the test data is generated according to the theme content and the theme template. Optionally, the manner of generating the response result is: and sleeving the theme content and the target theme in the theme template to generate the response result, namely packaging the theme content and the target theme in a custom format and applying the theme template.
Optionally, after the response result is generated, the response result is returned to the server, so that the server determines the target debugging result of the device to be tested according to the response result.
Optionally, the manner in which the server determines the target debugging result of the device to be tested according to the response result may be to determine whether the response result matches a preset response result corresponding to the test data, if so, determine that the response result is the correct response result meeting the server requirement, and determine that the target debugging result of the device to be tested is a debugging success, where the preset response result includes at least one of a preset theme, preset theme content, a preset response frequency, and a preset data type.
Optionally, the manner of determining, by the server according to the response result, the target debugging result of the device to be tested may be to obtain a response time point at which the response result is received, obtain the response time and a test time point at which the server returns test data, obtain a response time between the test time point and the response time point, and determine whether the response time is less than or equal to a preset response time, if the response time is less than or equal to the preset response time, it is proved that communication between the device to be tested and the server is normal, and the target debugging result of the device to be tested is successful in debugging.
Optionally, the manner in which the server determines the target debugging result of the device to be tested according to the response result may be that the server starts timing to the test time point of the device to be tested, and when the device to be tested can return the response result to the server within a preset time, the target debugging result of the device to be tested is determined to be successful in debugging.
Optionally, the server determines the target debugging result of the device to be tested according to the response result, which includes but is not limited to the above several manners, and may also determine whether the response result meets a grammar specification, and if the response result meets the grammar specification, determine that the target debugging result of the device to be tested is a debugging success.
Optionally, when it is determined that the target debugging result of the device to be tested is successful in debugging, the server may stop sending the test data to the device to be tested, and the device to be tested may be used on line normally.
In the embodiment of the application, the device to be tested is connected with the server by sending a connection packet to the server, so as to receive test data which is sent by the server and is specific to the theme to be debugged, analyze the test data to obtain the target theme, further obtain a corresponding theme template according to calling the preset JSON data and analyzing the preset JSON data, further perform condition judgment operation and condition filtering operation according to the collected data to be processed and the target theme to obtain theme content corresponding to the target theme, further sleeve-connect the theme template with the theme content based on the target theme to obtain a response result corresponding to the test data, and return the response result to the server so that the server determines a target debugging result of the device to be tested according to the response result, according to the embodiment of the application, the preset JSON data comprising the theme template is set in advance, the preset JSON data can be directly analyzed in the actual debugging process to obtain the theme template, the target theme and the theme content are automatically sleeved in the theme template, and the response result is automatically generated to achieve the purpose of automatically adding the theme and the load, so that the debugging efficiency of debugging equipment is improved, and the accuracy of the debugging equipment is improved.
Second embodiment
Optionally, referring to fig. 6, the MTQQ protocol-based device debugging method according to the present application further provides an MTQQ protocol-based device debugging method, where the MTQQ protocol-based device debugging method is applied to the server, and the MTQQ protocol-based device debugging method includes:
step S60, when receiving a connection packet sent by a device to be tested, returning a connection confirmation to the device to be tested according to the connection packet to complete the connection with the device to be tested;
step S70, obtaining the theme to be debugged corresponding to the connection packet, and sending a target theme aiming at the theme to be debugged to the equipment to be tested;
step S80, receiving a response result returned by the equipment to be tested;
and step S90, determining the target debugging result of the device to be tested according to the response result.
In the embodiment of the application, the method is applied to the server, and the device to be tested sends a connection packet to the server through an MTQQ protocol, wherein the connection packet includes the theme to be debugged.
Optionally, the connection packet further includes an authentication password, and the server verifies the access eligibility of the device to be tested through the authentication password. The authentication password may be configured by the server for the device to be tested in advance, or may be configured by a developer.
Optionally, the authentication password is obtained through an MD5 encryption algorithm according to the device identifier of the device to be tested, and it can be understood that the server stores a preset authentication password of the device to be tested in advance, where the preset authentication password is obtained by presetting and acquiring the device identifier of the device to be tested by the server and performing MD5 encryption operation according to the device identifier. In the actual debugging process, the equipment to be tested sends to the server and contains the connection package of authentication password, ask for book number U weapon to receive connect package back, the analysis connect the package and acquire the authentication password to call the storage before predetermine the authentication password, judge whether the authentication password with predetermine the authentication password unanimity when the authentication password with predetermine the authentication password unanimity, confirm the equipment to be tested inserts qualifiedly, and then to the equipment to be tested sends the connection and confirms, in order with the equipment to be tested inserts in the server.
Optionally, the connection packet includes, but is not limited to, a theme to be debugged and an authentication password, and may further include a certificate file corresponding to the device to be tested, so that the server performs certificate verification on the device to be tested through the certificate file.
Optionally, in an embodiment, the device to be tested sends a connection packet including an authentication password and a theme to be debugged to the server, after the server receives the connection packet, the authentication password in the connection packet is extracted, password verification is performed on the device to be tested according to the authentication password to verify the access qualification of the device to be tested, when it is determined that the device to be tested is qualified in access, a connection confirmation is sent to the device to be tested to complete connection with the device to be tested, the theme to be debugged in the connection packet is extracted, test data for the theme to be debugged is generated according to the theme to be debugged, and the test data is sent to the device to be tested which is successfully connected.
Optionally, in another embodiment, the device under test sends a connection packet including an authentication password and/or a certificate file to the server, when the server receives the connection packet, the device under test is subjected to password verification and/or certificate verification according to the connection packet to verify the access eligibility of the device under test, when it is determined that the device under test is eligible for access, a connection confirmation is sent to the device under test to complete the connection between the device under test and the server, and then a message including a theme to be debugged sent by the device under test is received, after the message is received, the server parses the message to obtain the theme to be debugged, and then test data for the theme to be debugged is returned to the device under test according to the theme to be debugged.
Optionally, the step of returning, to the device to be tested, the test data for the theme to be debugged according to the theme to be debugged includes: obtaining a target theme according to the theme to be debugged, and generating the test data according to the target theme, wherein the manner of obtaining the target theme according to the theme to be debugged may be obtaining a mapping relationship between the theme to be debugged and the target theme, the target theme of the theme to be debugged is determined according to the mapping relationship, the target theme is associated with the theme to be debugged, and the fine granularity of the target theme is smaller than that of the theme to be debugged.
Optionally, after the test data is sent to the device to be tested, the connection with the device to be tested is continuously maintained, and whether the response result returned by the device to be tested is received is monitored in real time, it can be understood that when the server cannot receive the response result returned by the device to be tested, the server represents that the device to be tested cannot normally communicate with the server, and then the target debugging result of the device to be tested is directly determined to be a debugging failure.
Optionally, when the server can successfully receive a response result returned by the device to be tested, determining a target debugging result of the device to be tested according to the response result, and judging whether the device to be tested can successfully return a response result required by the server.
Alternatively, referring to fig. 7, the S90 includes:
step S91, judging whether the response result is matched with a preset response result corresponding to the target theme;
step S92, if yes, determining that the target debugging result is successful in debugging;
and step S93, if not, determining that the target debugging result is debugging failure.
Optionally, the preset response result includes one of a preset theme, preset theme content, preset response duration, a preset data type, and a preset grammar specification, and it can be understood that the preset theme is consistent with the target theme.
Optionally, after receiving the response result, analyzing the response result, and obtaining a theme, theme content, response duration, a data type and a grammar specification corresponding to the response result, and further determining whether the theme, the theme content, the data type and the grammar specification corresponding to the response result are matched with the preset response result one by one, if yes, determining that the response result is matched with the preset response result, and determining that the target debugging result is successful, that is, the device to be tested and the server can normally communicate with the server; if not, determining that the response result is not matched with the preset response result, and determining that the target debugging result is debugging failure.
In this application embodiment, through setting up the server, through the server inserts the equipment to be tested successfully inserts behind the server, through the server to the equipment to be tested sends the test data to treat the debugging theme, and then receives the response result that the equipment to be tested returned, with the basis the response result is confirmed the target debugging result of equipment to be tested, this application is used through the cooperation of server with the equipment to be tested, carries out the rapid debugging to smart machine, has improved the efficiency of debugging and the accuracy of debugging.
Furthermore, an embodiment of the present invention further provides a computer-readable storage medium, where a device debugging program based on the MTQQ protocol is stored on the computer-readable storage medium, and when executed by a processor, the device debugging program based on the MTQQ protocol implements the steps of the above-described embodiments.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (9)

1. The device debugging method based on the MTQQ protocol is characterized by being applied to a device to be tested of a device debugging system based on the MTQQ protocol, wherein the device debugging system comprises the device to be tested and a server, and the device debugging method comprises the following steps:
when test data aiming at a theme to be debugged sent by the server are received, acquiring a target theme corresponding to the test data;
obtaining a theme template according to preset JSON data;
obtaining theme content corresponding to the target theme according to the data to be processed;
generating a response result corresponding to the test data according to the theme content and the theme template;
and returning the response result to the server so that the server can determine the target debugging result of the equipment to be tested according to the response result.
2. The MTQQ protocol-based device debugging method according to claim 1, wherein before the step of obtaining the target subject corresponding to the test data when receiving the test data for the subject to be debugged returned by the server, the method further comprises:
sending a connection packet to the server, wherein the connection packet comprises the theme to be debugged;
and receiving a connection confirmation returned by the server to complete the connection between the equipment to be tested and the server.
3. The MTQQ protocol-based device debugging method according to claim 1, wherein the step of obtaining the theme template according to the preset JSON data comprises:
analyzing the test data according to a preset algorithm to obtain the target theme;
verifying whether the target subject is associated with the subject to be debugged;
and if so, analyzing the preset JSON data to obtain the theme template.
4. The MTQQ protocol-based device debugging method of claim 1, wherein the step of obtaining the theme content corresponding to the target theme from the data to be processed comprises:
performing condition judgment operation and/or condition filtering operation on the data to be processed and the target theme to obtain a matching result matched with the target theme;
and determining the subject content according to the matching result.
5. The MTQQ-protocol-based device debugging method of claim 1, wherein the step of generating the response result corresponding to the test data according to the subject content and the subject template comprises:
and sleeving the theme content and the target theme in the theme template to generate the response result.
6. A device debugging method based on MTQQ protocol is characterized in that the method is applied to a server of a device debugging system based on MTQQ communication protocol, and the steps of the device debugging method based on the MTQQ protocol comprise:
when a connection packet sent by equipment to be tested is received, returning a connection confirmation to the equipment to be tested according to the connection packet so as to complete the connection with the equipment to be tested;
acquiring a theme to be debugged corresponding to the connection packet, and sending a target theme aiming at the theme to be debugged to the equipment to be tested;
receiving a response result returned by the equipment to be tested;
and determining a target debugging result of the equipment to be tested according to the response result.
7. The MTQQ-protocol-based device debugging method of claim 6, wherein the step of determining the target debugging result of the device under test according to the response result comprises:
judging whether the response result is matched with a preset response result corresponding to the target theme or not;
if so, determining that the target debugging result is successful in debugging;
if not, determining that the target debugging result is debugging failure.
8. The equipment debugging system based on the MTQQ protocol is characterized by comprising equipment to be tested and a server;
the MTQQ-protocol-based device debugging system further comprises a memory, a processor, and an MTQQ-protocol-based device debugging program stored on the memory and executable on the processor, the MTQQ-protocol-based device debugging program implementing the steps of the MTQQ-protocol-based device debugging method according to any one of claims 1 to 7 when executed by the processor.
9. A storage medium having a device debugging program based on the MTQQ protocol stored thereon, wherein the device debugging program based on the MTQQ protocol implements the steps of the device debugging method based on the MTQQ protocol according to any one of claims 1 to 7 when executed by a processor.
CN202111585736.6A 2021-12-22 2021-12-22 MTQQ protocol-based equipment debugging mode, system and storage medium Active CN114363225B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111585736.6A CN114363225B (en) 2021-12-22 2021-12-22 MTQQ protocol-based equipment debugging mode, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111585736.6A CN114363225B (en) 2021-12-22 2021-12-22 MTQQ protocol-based equipment debugging mode, system and storage medium

Publications (2)

Publication Number Publication Date
CN114363225A true CN114363225A (en) 2022-04-15
CN114363225B CN114363225B (en) 2023-09-01

Family

ID=81101233

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111585736.6A Active CN114363225B (en) 2021-12-22 2021-12-22 MTQQ protocol-based equipment debugging mode, system and storage medium

Country Status (1)

Country Link
CN (1) CN114363225B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115208791A (en) * 2022-09-16 2022-10-18 江苏橙智云信息技术有限公司 Method for testing functions of Internet of things equipment
CN115314541A (en) * 2022-10-12 2022-11-08 阿里巴巴(中国)有限公司 Remote debugging method, communication system, electronic device, and storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461893A (en) * 2014-12-16 2015-03-25 用友软件股份有限公司 Data processing method and data processing device
US20180167476A1 (en) * 2016-12-12 2018-06-14 Sap Se Meta broker for publish-subscribe-based messaging
CN108322356A (en) * 2017-01-18 2018-07-24 重庆邮电大学 A kind of industrial network gateway compatibility test method based on MQTT
CN108932193A (en) * 2018-06-01 2018-12-04 四川斐讯全智信息技术有限公司 A kind of MQTT server interface test method and system
CN109788003A (en) * 2019-03-26 2019-05-21 华南理工大学 A kind of intelligent public lavatory equipment exchange method and system based on MQTT agreement
CN110430169A (en) * 2019-07-15 2019-11-08 华中科技大学 A kind of method of industry acquisition module connection MQTT Cloud Server
CN112328417A (en) * 2020-11-27 2021-02-05 杭州海兴电力科技股份有限公司 Embedded multi-program communication method and system
CN112422372A (en) * 2020-12-04 2021-02-26 重庆忽米网络科技有限公司 MQTT protocol industrial equipment data simulation method based on reflection mechanism
CN113254187A (en) * 2021-06-23 2021-08-13 京东科技控股股份有限公司 Test data generation method and device, electronic equipment and storage medium
CN214429551U (en) * 2021-03-29 2021-10-19 南京工程学院 Internet of things data acquisition terminal

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461893A (en) * 2014-12-16 2015-03-25 用友软件股份有限公司 Data processing method and data processing device
US20180167476A1 (en) * 2016-12-12 2018-06-14 Sap Se Meta broker for publish-subscribe-based messaging
CN108322356A (en) * 2017-01-18 2018-07-24 重庆邮电大学 A kind of industrial network gateway compatibility test method based on MQTT
CN108932193A (en) * 2018-06-01 2018-12-04 四川斐讯全智信息技术有限公司 A kind of MQTT server interface test method and system
CN109788003A (en) * 2019-03-26 2019-05-21 华南理工大学 A kind of intelligent public lavatory equipment exchange method and system based on MQTT agreement
CN110430169A (en) * 2019-07-15 2019-11-08 华中科技大学 A kind of method of industry acquisition module connection MQTT Cloud Server
CN112328417A (en) * 2020-11-27 2021-02-05 杭州海兴电力科技股份有限公司 Embedded multi-program communication method and system
CN112422372A (en) * 2020-12-04 2021-02-26 重庆忽米网络科技有限公司 MQTT protocol industrial equipment data simulation method based on reflection mechanism
CN214429551U (en) * 2021-03-29 2021-10-19 南京工程学院 Internet of things data acquisition terminal
CN113254187A (en) * 2021-06-23 2021-08-13 京东科技控股股份有限公司 Test data generation method and device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
卢阿丽等: ""基于MQTT和ILZ4压缩法的智慧能源云平台"", 《控制工程》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115208791A (en) * 2022-09-16 2022-10-18 江苏橙智云信息技术有限公司 Method for testing functions of Internet of things equipment
CN115314541A (en) * 2022-10-12 2022-11-08 阿里巴巴(中国)有限公司 Remote debugging method, communication system, electronic device, and storage medium

Also Published As

Publication number Publication date
CN114363225B (en) 2023-09-01

Similar Documents

Publication Publication Date Title
CN114363225A (en) MTQQ protocol-based device debugging mode, system and storage medium
CN110032507B (en) Application program testing method, device and system, electronic equipment and storage medium
CN110018860B (en) Workflow management method, device, equipment and computer storage medium
CN111078539B (en) Test method, device, system and computer readable storage medium
CN107807841B (en) Server simulation method, device, equipment and readable storage medium
CN110320378B (en) Method, apparatus, device and computer readable storage medium for applying for a quality control test
CN104519105A (en) Method and device for acquiring applications matched with terminals
CN113672441A (en) Method and device for testing intelligent equipment
CN109729582B (en) Information interaction method and device and computer readable storage medium
CN108958785A (en) A kind of application program updating method and device
CN110674023B (en) Interface testing method and device
JP2023504956A (en) Performance detection method, device, electronic device and computer readable medium
CN106095886B (en) Data processing method and device
WO2017092391A1 (en) Middle-tier database virtual control and testing method and system utilizing same
WO2020019291A1 (en) Information processing method, electronic device, server, and information processing system
CN107247661B (en) Method and system for supporting automatic verification of installation package of application
CN111339196B (en) Data processing method and system based on block chain and computer readable storage medium
CN111107100B (en) Equipment for transmitting industrial protocol flow message
CN105138373A (en) Vehicle diagnosis device firmware upgrading method and device
CN113037868A (en) Cross-border store login method, device, equipment and computer readable storage medium
CN113961064A (en) Method, device and equipment for controlling equipment interaction based on workstation and storage medium
CN107901854B (en) Maintenance lamp zeroing method and device and computer readable storage medium
CN105450410A (en) Verifying method and device
CN110544099A (en) Payment method, payment processing system and payment acceptance terminal based on block chain
CN111158744B (en) Cross-platform heterogeneous data integration method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant