CN115733854B - Robot remote data transmission method based on RocketMQ protocol - Google Patents
Robot remote data transmission method based on RocketMQ protocol Download PDFInfo
- Publication number
- CN115733854B CN115733854B CN202211237588.3A CN202211237588A CN115733854B CN 115733854 B CN115733854 B CN 115733854B CN 202211237588 A CN202211237588 A CN 202211237588A CN 115733854 B CN115733854 B CN 115733854B
- Authority
- CN
- China
- Prior art keywords
- robot
- rocketmq
- data
- server
- cloud
- 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.)
- Active
Links
- 230000005540 biological transmission Effects 0.000 title claims abstract description 28
- 238000000034 method Methods 0.000 title claims abstract description 19
- 238000012795 verification Methods 0.000 claims description 9
- 230000009471 action Effects 0.000 claims description 6
- 238000013500 data storage Methods 0.000 claims description 5
- 238000004891 communication Methods 0.000 claims description 3
- 230000007246 mechanism Effects 0.000 description 4
- 230000003993 interaction Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000004458 analytical method Methods 0.000 description 2
- 230000002776 aggregation Effects 0.000 description 1
- 238000004220 aggregation Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000002457 bidirectional effect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Landscapes
- Manipulator (AREA)
Abstract
The invention provides a robot remote data transmission system based on RocketMQ protocol, which comprises: the method can realize the high-real-time and high-reliability data transmission requirements of the robot and the robot cloud platform, can remotely transmit the message of the robot to various cross-platform clients for display in real time, and can ensure the low time delay and transmission quality of the message. Meanwhile, the method can collect a large amount of robot data, supports high concurrency and high load, and is particularly suitable for accurate data transmission and control under the conditions of poor network environment and unstable network of the robot.
Description
Technical Field
The invention relates to the technical field of data transmission, in particular to a robot remote data transmission method based on RocketMQ protocols.
Background
In service robots and special robot applications, robot data aggregation and data integration are indispensable with the increase of the types and the number of robots. Therefore, the robot cloud platform has been developed, and the main functions and roles of the robot cloud platform are centralized management, monitoring and data statistics summarization of a plurality of robots in operation. In the implementation and deployment process of the robot cloud platform, data transmission is not separated. The traditional industrial instrument performs unidirectional data uploading through a wired or wireless network, namely uploads on-site data to a cloud designated server through a wired network, a 4G, a 5G or a WIFI technology, so that display and data summarization are performed. For the robot cloud platform, the real-time control requirement of the robot cannot be met through unidirectional data uploading, the cloud platform is required to receive data uploaded by the robot and send control data to the robot end, and the real-time requirement of robot control is high. Meanwhile, since the robot cloud platform needs to integrate hundreds of thousands of robot data, the load capacity of the data server is also a great test. In addition, since the robot network environment, hardware performance, and the like are greatly limited, a data transmission method which is light in weight, good in instantaneity, and capable of supporting high concurrency is required.
Disclosure of Invention
In order to solve the technical problems, the invention utilizes RocketMQ protocol to realize bidirectional data interaction between the robot and the cloud platform end, thereby effectively solving the problems existing in the data interaction process between the robot and the cloud platform.
The technical scheme adopted by the invention is as follows: a robot remote data transmission system based on RocketMQ protocols, the system comprising: the robot is connected with the cloud RocketMQ server through the Internet/Intranet network and transmits robot data to the cloud RocketMQ server in real time; the cloud RocketMQ server stores the data in the data storage server according to the requirements; the client is connected with the cloud RocketMQ server through an Internet/Intranet network, and the client receives the message pushed by the cloud RocketMQ server for analysis and display; the client can check the information stored in the cloud RocketMQ server at any time; the client may be a PC, IOS, android or other wearable device.
Based on the remote data transmission system of the robot, the invention provides a remote data transmission method of the robot based on RocketMQ protocol, which comprises the following steps:
Step one: the robot is connected with a cloud RocketMQ server through RocketMQ SDK. If the connection is unsuccessful, reconnecting until the connection is successful. After the robot is successfully connected to the cloud RocketMQ server, the data headers topicHeartbeat (heartbeat data headers) and topicCtrlData (control data headers) of the cloud RocketMQ server are subscribed to.
Step two: the robot reports communication heartbeat data heartbeat to a cloud RocketMQ server at fixed time, wherein the heartbeat data comprises a current time stamp t1.
Step three: after receiving the heartbeat message reported by the robot, the cloud RocketMQ server immediately sends a reply message heartbeat1 to the data header topicHeartbeat, and the data has a timestamp t1 reported by the robot.
Step four: after the robot receives the data heartbeat1 sent by the cloud RocketMQ server, the reporting frequency and the reporting byte length of the data robotData of the data header topicRobotData are dynamically adjusted according to the difference ts between the time t1 in the received heartbeat1 and the current time. If ts is larger, the reporting frequency and byte length are reduced; if ts is smaller, reporting frequency and byte length are increased.
Step five: after receiving the robot upload data robotData, the cloud RocketMQ server transfers robotData to the data storage server so as to query historical data.
Preferably, when the cloud RocketMQ server needs to issue a control instruction to control the robot to work, the steps further include:
The cloud RocketMQ server sends the control data ctrlData1 to the data header topicCtrlData, after receiving the control data ctrlData1 sent by the cloud RocketMQ server, the robot performs MD5 verification, and the robot can execute corresponding control actions after the verification is successful; if the verification is unsuccessful, the robot records an error log and does not execute the action.
Preferably, when the client needs to collect the robot information, the steps further include:
The client is connected with the cloud RocketMQ server through RocketMQ SDK, and then subscribes to the header topicRobotData of the data reported by the robot, and robotData of the data reported by the robot can be received. After receiving robotData, the client can display the data in front end UI.
The invention has the following characteristics:
1. The server supports high concurrency, rocketMQ protocols can simultaneously support millions of clients to simultaneously receive and transmit data online, and the server is very suitable for the use requirements of a robot cloud platform;
2. Most robots are wifi or 4G network transmission, the network stability is poor, the message level in RocketMQ data transmission process can be set according to different levels, and for important robot alarm messages, accurate message delivery under the condition of unstable network can be ensured;
the RocketMQ supports the MQTT protocol, supports running on a singlechip, a single board computer and an RTU, has low power consumption, and is light and easy to realize;
4. in the process of uploading data by using 4G or 5G by a robot, the flow cost is an unavoidable problem, and RocketMQ is used for protocol transmission, so that the transmission flow is reduced to the greatest extent, and the flow is lower than that of http or xmpp iot.
The beneficial effects of the invention are as follows: the high real-time performance and high reliability data transmission requirements of the robot and the robot cloud platform can be met. Meanwhile, the invention can collect hundreds of thousands of robot data and support high concurrency and high load. In addition, the method is particularly suitable for accurately transmitting and controlling the data under the conditions of poor network environment and unstable network of the robot. Meanwhile, due to the characteristics of low power consumption and light protocol of RocketMQ transmission protocols, the method can be applied to the aspects of robot data transmission, and can also be applied to data uploading of sensors such as on-site wireless meters, temperature, vibration and the like, and has wide application prospects.
Drawings
Fig. 1 is a schematic diagram of a robot remote data transmission system based on RocketMQ protocol.
Fig. 2 is a flow chart of a robot remote data transmission method based on RocketMQ protocol.
Detailed Description
The invention is described in further detail below with reference to the accompanying drawings;
As shown in fig. 1, a robot remote data transmission system based on RocketMQ protocol, the system comprising: the robot is connected with the cloud RocketMQ server through the Internet/Intranet network and transmits robot data to the cloud RocketMQ server in real time; the cloud RocketMQ server stores the data in the data storage server according to the requirements; the client is connected with the cloud RocketMQ server through an Internet/Intranet network, and the client receives the message pushed by the cloud RocketMQ server for analysis and display; the client can check the information stored in the cloud RocketMQ server at any time; the client may be a PC, IOS, android or other wearable device.
As shown in fig. 2, based on the above-mentioned robot remote data transmission system, the present invention provides a robot remote data transmission method based on RocketMQ protocol, which includes the following steps:
Step one: the robot is connected with a cloud RocketMQ server through RocketMQ SDK. If the connection is unsuccessful, reconnecting until the connection is successful. After the robot is successfully connected to the cloud RocketMQ server, the data headers topicHeartbeat (heartbeat data headers) and topicCtrlData (control data headers) of the cloud RocketMQ server are subscribed to.
Step two: the robot reports communication heartbeat data heartbeat to a cloud RocketMQ server at fixed time, wherein the heartbeat data comprises a current time stamp t1.
Step three: after receiving the heartbeat message reported by the robot, the cloud RocketMQ server immediately sends a reply message heartbeat1 to the data header topicHeartbeat, and the data has a timestamp t1 reported by the robot.
Step four: after the robot receives the data heartbeat1 data sent by the cloud RocketMQ server, the reporting frequency and the reporting byte length of the data robotData of the data header topicRobotData are dynamically adjusted according to the difference ts between the t1 time and the current time in the received heartbeat 1. If ts is larger, the reporting frequency and byte length are reduced; if ts is smaller, reporting frequency and byte length are increased.
Step five: after receiving the robot upload data robotData, the cloud RocketMQ server transfers robotData to the data storage server so as to query historical data.
Preferably, when the cloud RocketMQ server needs to issue a control instruction to control the robot to work, the steps further include:
The cloud RocketMQ server sends the control data ctrlData1 to the data header topicCtrlData, after receiving the control data ctrlData1 sent by the cloud RocketMQ server, the robot performs MD5 verification, and the robot can execute corresponding control actions after the verification is successful; if the verification is unsuccessful, the robot records an error log and does not execute the action.
Preferably, when the client needs to collect the robot information, the steps further include:
The client is connected with the cloud RocketMQ server through RocketMQ SDK, and then subscribes to the header topicRobotData of the data reported by the robot, and robotData of the data reported by the robot can be received. After receiving robotData, the client can display the data in front end UI.
The invention optimizes the service quality of the message, checks and sends the release data based on a multi-check mechanism, analyzes the data flow and the check packet by the subscription receiving end, optimizes the integrity of the message data and ensures the accuracy of the message. In addition, the invention optimizes the expiration of the heartbeat mechanism for the message existing when the robot client issues the message, and the message is not received for code optimization, thereby realizing a 2-time retransmission mechanism and ensuring the timeliness of the message.
According to the RocketMQ-based method for pushing the robot data to the cloud platform, the message publishing and subscribing mechanism is optimized RocketMQ through codes, and the generated RocketMQ pushed message data is dynamically configured according to subscribed scene information requirements. The requirements of real-time data interaction data pushing during on-site operation of the fire-fighting robot are met, and particularly under the conditions of severe on-site conditions and complex interference sources, the performances of low delay, quick control response and accurate control of the command system are guaranteed.
Claims (3)
1. A robot remote data transmission method based on RocketMQ protocol is characterized in that: the method comprises the following steps:
Step one: the robot is connected with a cloud RocketMQ server through RocketMQ SDK; reconnecting if the connection is unsuccessful until the connection is successful; after the robot is successfully connected to the cloud RocketMQ server, subscribing to the data headers topicHeartbeat (heartbeat data header) and topicCtrlData (control data header) of the cloud RocketMQ server;
Step two: the robot reports communication heartbeat data heartbeat to a cloud RocketMQ server at fixed time, wherein the heartbeat data comprises a current time stamp t1;
Step three: after receiving the heartbeat message reported by the robot, the cloud RocketMQ server immediately sends a reply message heartbeat1 to the data header topicHeartbeat, wherein the data has a timestamp t1 reported by the robot;
step four: after the robot receives the data heartbeat1 issued by the cloud RocketMQ server, dynamically adjusting the reporting frequency and the reporting byte length of the data robotData of the data header topicRobotData according to the difference ts between the time t1 in the received heartbeat1 and the current time; if ts is larger, the reporting frequency and byte length are reduced; if ts is smaller, the reporting frequency and byte length are increased;
Step five: after receiving the robot upload data robotData, the cloud RocketMQ server transfers robotData to the data storage server so as to query historical data.
2. The robot remote data transmission method based on RocketMQ protocol according to claim 1, wherein: when the cloud RocketMQ server needs to issue a control instruction to control the robot to work, the steps further include:
The cloud RocketMQ server sends the control data ctrlData1 to the data header topicCtrlData, after receiving the control data ctrlData1 sent by the cloud RocketMQ server, the robot performs MD5 verification, and the robot can execute corresponding control actions after the verification is successful; if the verification is unsuccessful, the robot records an error log and does not execute the action.
3. The robot remote data transmission method based on RocketMQ protocol according to claim 1, wherein: when the client needs to collect the robot information, the steps further include: the client is connected with the cloud RocketMQ server through RocketMQ SDK, and then subscribes to a header topicRobotData of the data reported by the robot, namely robotData data reported by the robot can be received; after receiving robotData, the client can display the data in front end UI; the client may be a PC, IOS, android or other wearable device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211237588.3A CN115733854B (en) | 2022-10-11 | 2022-10-11 | Robot remote data transmission method based on RocketMQ protocol |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211237588.3A CN115733854B (en) | 2022-10-11 | 2022-10-11 | Robot remote data transmission method based on RocketMQ protocol |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115733854A CN115733854A (en) | 2023-03-03 |
CN115733854B true CN115733854B (en) | 2024-05-28 |
Family
ID=85293447
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211237588.3A Active CN115733854B (en) | 2022-10-11 | 2022-10-11 | Robot remote data transmission method based on RocketMQ protocol |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115733854B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP2254309A1 (en) * | 2009-05-20 | 2010-11-24 | Thomson Licensing | Method for sending data of a service |
WO2012174934A1 (en) * | 2011-06-21 | 2012-12-27 | 中兴通讯股份有限公司 | Adaptive method and device for heartbeat period |
CN108540565A (en) * | 2018-04-17 | 2018-09-14 | 中山市华南理工大学现代产业技术研究院 | A method of the mobile terminal push based on MQTT agreements and statistics |
CN108834179A (en) * | 2018-05-31 | 2018-11-16 | 深圳市酷达通讯有限公司 | Adjust method, the server and client side of heart beat cycle |
CN112738240A (en) * | 2020-12-29 | 2021-04-30 | 航天科工网络信息发展有限公司 | Large-scale distributed network data transmission and cooperation method |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140310243A1 (en) * | 2010-08-16 | 2014-10-16 | Mr. Steven James McGee | Heart beacon cycle |
WO2021042393A1 (en) * | 2019-09-06 | 2021-03-11 | Nokia Shanghai Bell Co., Ltd. | Managing notifications for communication surveillance |
-
2022
- 2022-10-11 CN CN202211237588.3A patent/CN115733854B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP2254309A1 (en) * | 2009-05-20 | 2010-11-24 | Thomson Licensing | Method for sending data of a service |
WO2012174934A1 (en) * | 2011-06-21 | 2012-12-27 | 中兴通讯股份有限公司 | Adaptive method and device for heartbeat period |
CN108540565A (en) * | 2018-04-17 | 2018-09-14 | 中山市华南理工大学现代产业技术研究院 | A method of the mobile terminal push based on MQTT agreements and statistics |
CN108834179A (en) * | 2018-05-31 | 2018-11-16 | 深圳市酷达通讯有限公司 | Adjust method, the server and client side of heart beat cycle |
CN112738240A (en) * | 2020-12-29 | 2021-04-30 | 航天科工网络信息发展有限公司 | Large-scale distributed network data transmission and cooperation method |
Also Published As
Publication number | Publication date |
---|---|
CN115733854A (en) | 2023-03-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110049014B (en) | OpenAPI conversion system and method based on multiple Modbus bus protocols | |
CN109347659B (en) | Intelligent terminal equipment and module remote upgrading method based on NB-IOT | |
CN111031034A (en) | Multi-protocol convergence edge computing gateway | |
US20100115137A1 (en) | Data compression method and data communication system utilizing the same | |
JP2001186210A (en) | Method and system for transmitting message, communicating method, deferred acknowledge communication system, process control system and method for communicating application information | |
CN110609782B (en) | Micro-service optimization system and method based on big data | |
CN110703617A (en) | Intelligent home control system based on MQTT | |
CN112422663B (en) | Data centralization system of industrial Internet of things and data aggregation, processing and storage method | |
CN114554618B (en) | Wireless access point device, equipment access method, equipment and storage medium | |
CN113572853A (en) | Method and system for forming Internet of things cloud platform based on MQTT | |
CN111158327A (en) | Production monitoring system of production equipment | |
US20030229716A1 (en) | System and method for transferring financial information | |
CN104660627A (en) | Communication method and communication system for upper computer and lower computer | |
CN103442003A (en) | Data acquisition backfill system for SCADA system and method thereof | |
CN117615043B (en) | Inter-service communication method and system on edge gateway | |
CN115733854B (en) | Robot remote data transmission method based on RocketMQ protocol | |
CN112702430B (en) | Data transmission method based on cloud edge mode and Web technology | |
EP1866787B1 (en) | Wireless data device with confirmation and retry capabilities for pushed data | |
CN114390033A (en) | Loop state patrol instrument acquisition system and method based on extensible communication protocol | |
CN117376418A (en) | Distributed energy power station data acquisition system based on MQTT protocol | |
CN117424910A (en) | Automatic synchronization method, system, equipment and medium for incremental data | |
CN113190583B (en) | Data acquisition system, method, electronic equipment and storage medium | |
CN116032911A (en) | Internet of things large-screen real-time monitoring system based on websocket | |
CN113364838B (en) | Equipment ad hoc network method and system based on MQTT | |
CN114817317A (en) | New energy power generation monitoring system |
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 |