Python-based automatic communication cooperative control device and method in extreme environment

By using Python-based automatic communication collaborative control device in extreme environments, using WebSocket server to realize wireless bidirectional communication between devices, solving the problem of communication compatibility between devices and achieving efficient remote control and collaborative work.

CN119907134AActive Publication Date: 2025-04-29XUZHOU NORMAL UNIVERSITY
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510084446.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-20
Publication Date
2025-04-29
Estimated Expiration
2045-01-20

AI Technical Summary

Technical Problem

In extreme environments, there are compatibility issues between devices for communication, making it difficult for existing systems to achieve efficient remote control and collaborative work, especially in resource scarcity and complex environments.

Method used

It adopts an automatic communication collaborative control device in extreme environments based on Python, and realizes wireless bidirectional communication between devices through a WebSocket server, supporting a variety of operating systems and hardware platforms, including Android, iOS and Harmony os.

Benefits of technology

It realizes efficient real-time communication and control between devices in extreme environments, reduces the need for manual intervention, ensures the stability and reliability of the system, and is suitable for the high concurrency and low latency requirements of multiple devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119907134A_ABST
    Figure CN119907134A_ABST
Patent Text Reader

Abstract

The invention discloses a Python-based automatic communication cooperative control device in an extreme environment, and the device comprises a PC server building and monitoring system which comprises a computer equipped with a Python support platform, and a WebSocket server which is built through the Python support platform, the WebSocket server is provided with an exception handling and resource cleaning module, a message processing general module, a server connection management sub-module and a server initialization sub-module and is used for receiving and processing a data transmission request from external equipment, and wireless two-way communication is carried out between the data transmission request and the external equipment through the WebSocket server; an Android / Harmony os communication system is adopted; an iOS communication control system; and the motion control system comprises an STM32F103ZET6 chip, is in communication connection with the WebSocket server through an embedded Wi-Fi data connection module, and is provided with a communication signal analysis module, a motion system analysis coordination module and a motion control execution module. According to the invention, efficient remote control and cooperative work among equipment can be guaranteed, automatic response can be realized, a control strategy can be adjusted and optimized in real time, and the requirement of an exploration task is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of communication technology, and specifically relates to an automatic communication collaborative control device and method under extreme environments based on Python. Background Art

[0002] In the current technological environment, with the rapid development of the Internet of Things (IoT), human beings' ability to explore extreme environments (such as extremely cold environments, sandstorm environments, Mars, the back of the moon, etc.) continues to increase, especially the demand for multi-device interconnection and remote control is becoming increasingly strong. In order to meet these challenges, iterative innovation of technology and the popularization of smart devices have become key driving forces. Interoperability between devices has become particularly important. Through real-time data transmission, remote control systems and efficient collaborative operations, humans can better cope with tasks in complex environments. However, with the growth of communication needs, how to ensure the convenience of real-time communication and remote control and system stability has also put forward higher technical requirements, especially in extreme environments, the reliability and communication capabilities of equipment face huge tests.

[0003] Currently, communication between devices faces compatibility issues. Different operating systems, communication protocols, and hardware interfaces create barriers to communication between devices. For example, there are significant differences between Android and iOS devices at the operating system level, and embedded devices usually use specific low-power protocols, making it difficult to communicate with smart mobile devices. Therefore, seamless interconnection between multiple devices often requires complex middleware or gateways to coordinate communication protocols, which increases system complexity and maintenance costs.

[0004] The demand for remote control is also increasing, especially in extreme environments, where communicators need to remotely control the operating parameters of the equipment, monitor the system status in real time, and respond quickly to abnormalities. This puts forward new requirements for control systems, which must support low-latency, flexible and adaptable remote control operations. However, existing systems usually lack sufficient flexibility and scalability, and it is difficult to simultaneously meet the requirements of efficient control of multiple devices and real-time data exchange. For example, although traditional IoT communication methods such as infrared, Bluetooth, Wi-Fi, and Java-based control systems are widely used in simple applications, they often expose significant limitations when facing multi-device collaboration and complex environments. The infrared communication range is limited and requires line of sight between devices, which has poor applicability. Although Bluetooth is suitable for short-distance communication, it has low bandwidth, limited effective range, and is prone to communication bottlenecks when the number of devices increases, resulting in unstable connections. Wi-Fi provides higher bandwidth and long-distance communication, but it is prone to network congestion in densely populated environments, and it has high power consumption and is sensitive to electromagnetic interference, making it difficult to operate stably for a long time. Although programming languages ​​such as Java are used for device communication, although they have cross-platform capabilities, the development environment is complex, the configuration is cumbersome, and the response speed is slow, making it difficult to meet the requirements of real-time control and low power consumption. With the increasing demand for multiple devices, high concurrency and low latency, traditional communication methods are unable to meet the high requirements of intelligence, real-time and adaptability. Summary of the invention

[0005] The purpose of the present invention is to provide an automatic communication and collaborative control device and method based on Python in extreme environments, which can ensure efficient remote control and collaborative work between devices, and can also greatly reduce the need for manual intervention. In extreme scenarios with scarce resources and complex environments, the system can automatically respond, adjust and optimize control strategies in real time, ensure that the equipment can operate autonomously and stably for a long time, and meet the needs of exploration tasks.

[0006] To achieve the above object, the present invention provides an automatic communication cooperative control device in extreme environment based on Python, comprising:

[0007] The PC server building and monitoring system includes a computer equipped with a Python support platform, a WebSocket server is built through the Python support platform, and has an exception handling and resource cleanup module, a message processing general module, a server connection management submodule, and a server initialization submodule, which are used to receive and process data transmission requests from external devices, and the data transmission is wirelessly bidirectionally communicated with the external device through the WebSocket server;

[0008] Android / Harmony os communication system, Android / Harmony os device uses Hil105 Wi-Fi module to communicate with WebSocket server, equipped with QPython / Harmony os platform, Android / Harmony os communication input module and Android / Harmony os feedback display module, realizes data transmission and reception and feedback display through WebSocket protocol;

[0009] iOS communication control system, iOS devices use AFEM-8240 (iOS) Wi-Fi module to communicate with WebSocket server, equipped with Python (iOS) support platform, iOS communication input module and iOS feedback display module, realize data transmission and status feedback display through WebSocket protocol;

[0010] The motion control system includes an STM32F103ZET6 chip, which is connected to the monitoring system through an embedded Wi-Fi data connection module and a WebSocket server. It is equipped with a communication signal analysis module, a motion system analysis and coordination module, and a motion control execution module.

[0011] In order to achieve the above-mentioned invention object, a Python-based automatic communication collaborative control method in an extreme environment is also provided, comprising the following steps:

[0012] 1) Use Python programming language to build a WebSocket server on the PC, use Python's built-in WebSocket library to create a server instance WebSocket server, and initialize it;

[0013] 2) Android / Harmony OS devices and iOS devices use their own Wi-Fi modules to connect to the same Internet, ensuring that they are in the same network environment as the WebSocket server. Android / Harmony OS and iOS devices can exchange data with the WebSocket server through the Wi-Fi module to achieve two-way communication;

[0014] 3) During operation, the WebSocket server will continuously monitor the connection requests from Android / Harmony OS and iOS devices, and receive, parse and process data transmission requests from the client;

[0015] 4) The STM32F103ZET6 chip joins the WebSocket communication system through the Wi-Fi data connection module. The WEBSOCKET server parses the control instructions in the received data information and sends them to the STM32F103ZET6 chip. The STM32F103ZET6 chip uses the motion control execution module to complete the instructions and feedback the execution results to the WebSocket server.

[0016] As a further solution of the present invention: in step 1), when the WebSocket server is initialized, the server's exception handling module is configured to capture and handle various abnormal situations in time during operation; a resource cleanup module is configured to release system resources when an abnormal disconnection occurs or the client actively disconnects; and a logging function is set for subsequent analysis and optimization.

[0017] As a further solution of the present invention: in step 2), Android / Harmony OS side: on the Android / Harmony OS device, a Python script is loaded through the QPython / Harmony OS platform to realize the client WebSocket connection. The QPython / Harmony OS platform provides Python environment support, and Python code can be written and executed to establish a connection with the WebSocket server through the WebSocket library;

[0018] iOS: On the iOS device, use a development environment that supports Python to write the client connection code, and use the WebSocket library method to establish a WebSocket connection between the iOS device and the WebSocket server.

[0019] As a further solution of the present invention: in step 3), when the Android / Harmony os or iOS client sends a connection request, the WebSocket server performs identity authentication according to preset rules, and allows the connection and records the client information after the authentication is passed;

[0020] After a successful connection, the WebSocket server receives data from the client, parses the received data, and processes it according to the data type and content.

[0021] As a further solution of the present invention: repeat steps 1) to 4) to access more motion control systems, and multiple groups of motion control systems automatically coordinate and interconnect with the WebSocket server as the central hub to achieve information sharing and collaborative operation.

[0022] As a further solution of the present invention: the WebSocket server accesses satellite communication through the client satellite data connection module to achieve stable sending and receiving of network-free state instructions and state information.

[0023] Compared with the prior art, the present invention has the following beneficial effects:

[0024] The communication protocol and efficient data transmission mechanism of the present invention enable it to maintain a stable connection in a low-bandwidth, high-latency and unstable network environment, ensuring real-time communication and control between devices. Especially in extreme environments such as the polar regions, deep space or underground, it can overcome network interference and communication bottlenecks under harsh conditions, provide reliable communication quality, and support efficient and stable mission execution. In addition, access to satellite communications realizes short message functions, expands application scenarios, and realizes global communication and positioning services through the construction of low-orbit satellite Internet. It also enables low-cost, high-reliability communication and data exchange in remote and remote areas.

[0025] The present invention has significant promotion advantages. It is not only highly compatible with multiple operating systems such as Windows, Android, iOS, and Harmony OS, but also due to the cross-platform characteristics of the Python platform and the standardization of the WebSocket protocol, the system can run stably on different hardware platforms and operating systems. This wide compatibility improves the scope of application and flexibility of the system, enabling it to meet the needs of various terminal devices. In particular, the present invention can achieve offline positioning based on satellite communication, enhance the positioning and communication capabilities in an environment without network coverage, and provide a more flexible and reliable solution for Internet of Things devices.

[0026] The present invention has a significant low-cost advantage and is suitable for large-scale promotion. Python, as an open source platform, reduces software development and operating costs, while the simplicity and efficiency of the WebSocket protocol also reduce hardware and network requirements. The system's architectural design optimizes resource utilization, reduces dependence on expensive equipment and complex infrastructure, and enables the control device to achieve efficient communication and control functions at low cost. In addition, the system's design allows motion control equipment to use daily smartphones as communication terminals, with the help of the newly developed satellite communication software environment in the current mobile phone market, without the need to purchase additional dedicated satellite hardware or equipment, greatly reducing costs. These advantages make the technology highly competitive in the market, while the system deployment is more economical, and maintenance costs are reduced, promoting the popularization and promotion of technology in the fields of the Internet of Things and extreme environments.

[0027] The present invention can effectively solve the problem of intelligent communication between mobile terminals and motion control systems. As an efficient and easily extensible programming language, Python has strong adaptability and flexibility. Its huge ecosystem and rich third-party libraries enable developers to quickly realize device connection, control and data interaction, and meet the communication needs in different scenarios. Python not only supports a variety of communication protocols and data formats, but also can be flexibly integrated with hardware interfaces and sensors, greatly expanding its application in the Internet of Things. Compared with traditional programming languages, Python implements complex logic through concise code, improving development efficiency and system maintainability. In addition, the wide area coverage and high reliability of satellite communications ensure the stability and continuity of communication between devices in remote or extreme environments. Even when the ground communication infrastructure is insufficient or damaged, satellite communications can still maintain the connectivity and data transmission of the system, further enhancing the overall performance and applicability of the system. This combination not only improves the operating capability of the automatic communication collaborative control device in complex environments, but also ensures the timeliness and accuracy of data transmission, thereby achieving a more efficient and reliable Internet of Things solution.

[0028] In addition, the Python platform supports the combination of cloud and local models, providing flexibility in data storage and processing. In IoT systems, the demand for large-scale real-time data processing and storage is growing. The powerful computing and storage capabilities of the cloud enable the system to efficiently process massive amounts of data and perform complex analysis. At the same time, the data synchronization and backup capabilities of the cloud ensure the reliability of the system. In this way, the combination of WebSocket and the Python platform not only improves remote control and real-time communication capabilities, but also ensures the continued stable operation of equipment in extreme environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 It is the overall control flow chart of the automatic communication cooperative control device in extreme environment based on Python of the present invention.

[0030] Figure 2 It is the overall control flow chart of accessing satellite communication of the present invention.

[0031] Figure 3 It is a schematic diagram of the overall control structure of an example of satellite communication access according to the present invention.

[0032] Figure 4 It is a diagram of the monitoring and controlling client obtained by the present invention under the drive of Sypder on the PC side.

[0033] Figure 5 It is a graphical representation of the execution result of the communication client of the present invention relying on the Qpython platform in an Android environment.

[0034] Figure 6 It is a diagram of the execution result of the communication client of the present invention relying on the Qpython platform in the Harmony os environment.

[0035] Figure 7 It is a graphical representation of the execution result of the communication client of the present invention relying on the Python Editor platform in an iOS environment.

[0036] Figure 8 It is a diagrammatic representation of the execution result of regulating the motion control device according to the present invention.

[0037] In the figure: 1. WebSocket server construction and monitoring system, 2. Android / Harmony os communication system, 3. iOS communication control system, 4. Motion control system. DETAILED DESCRIPTION

[0038] The present invention will be further described below by way of examples.

[0039] like Figure 1 and Figure 3 As shown, an automatic communication and cooperative control device in an extreme environment based on Python includes:

[0040] PC server building and monitoring system 1, including a computer with a Python support platform, a WebSocket server is built through the Python support platform, the WebSocket server can receive and process data transmission requests from external devices, including but not limited to commands, status updates and user inputs, and has an exception handling and resource cleanup module, a message processing module, a server connection management submodule, and a server initialization submodule, which are used to receive and process data transmission requests from external devices. The data transmission is wirelessly bidirectionally communicated with external devices through the WebSocket server, and the connection requests and data transmission requests of Android / Harmony os and iOS systems are received and processed to ensure that devices with different operating systems can be seamlessly connected;

[0041] Android / Harmony os communication system 2, the Android / Harmony os device uses the Hil105 Wi-Fi module to communicate with the WEBSOCKET server, and is equipped with a QPython / Harmony os platform, an Android / Harmony os communication input module and an Android / Harmony os feedback display module, and realizes data transmission and reception and feedback display through the WebSocket protocol;

[0042] iOS communication control system 3, iOS devices use AFEM-8240 (iOS) Wi-Fi module to communicate with WebSocket server, equipped with Python (iOS) support platform, iOS communication input module and iOS feedback display module, realize data transmission and status feedback display through WebSocket protocol;

[0043] AFEM-8240 is an ultra-high frequency RF front-end module, mainly used for wireless communication in mobile devices. It supports multi-mode functions, can handle transmission and reception functions, and supports LTE and 5G NR n48 / n77 / n78 / n79 frequency bands. The module contains multiple chips such as power amplifier, low noise amplifier, RF switch, RFFE controller, RC coupler and film bulk acoustic resonator (FBAR) filter, which work together to improve the communication performance and efficiency of mobile devices. The SiPBGA package type of AFEM-8240 enables it to save space while providing powerful wireless connection performance;

[0044] The motion control system 4 includes an STM32F103ZET6 chip, which is connected to the monitoring system through an embedded Wi-Fi data connection module and a WebSocket server, and is equipped with a communication signal analysis module, a motion system analysis and coordination module, and a motion control execution module.

[0045] The STM32F103ZET6 chip is equipped with the STM32F103ZET6 parsing module and control execution module. The STM32F103ZET6 is a 32-bit microcontroller based on the ARM Cortex-M3 core. It integrates up to 512KB of Flash memory and 64KB of SRAM, providing ample storage space for complex applications. The chip provides multiple timers, 3 SPIs, 2 I2Cs, 5 USARTs, 1 USB, 1 CAN and other interfaces, supports multiple communication protocols, and meets complex communication needs. In addition, the STM32F103ZET6 is also equipped with 3 12-bit ADCs and 1 12-bit DAC, which are suitable for precise analog signal processing and are widely used in sensor data acquisition and signal generation. It supports multiple low-power modes, such as sleep, stop and standby modes, to meet energy-saving needs, especially for battery-powered devices. It provides 112 general-purpose IO ports for flexible configuration to meet various peripheral access needs. The chip also supports SWD and JTAG debugging interfaces, which facilitates the debugging and burning of programs and improves development efficiency. When working, the STM32F103ZET6 is first provided with a clock signal by the clock system, and the controller performs various tasks according to the clock signal. Peripheral resources are responsible for communicating and exchanging data with external devices to complete specific functions. The interrupt controller is responsible for managing the interrupt request and processing of the chip to ensure the stability and reliability of the chip. The power manager is responsible for managing the power supply of the chip, including power switches, power monitoring, etc., to ensure the safety and stability of the chip. The present invention utilizes the STM32F103ZET6 chip to communicate with the WEBSOCKET server through the embedded Wi-Fi data connection module, and receives and executes the control instructions sent by the server. The embedded system includes an embedded motion system module, and the motion module of the motion control system is its key component, which is responsible for moving and navigating in a specific operating environment. Its design must adapt to various extreme environmental conditions, including low gravity, rough terrain, high radiation and extreme temperature changes. The motion module is mainly composed of wheels and tires, an electric drive system, a navigation and control system, and an energy system. It is usually equipped with multiple wheels with a diameter of about 0.5 meters and a width of about 0.3 meters. It is made of aluminum alloy or composite materials, with deep grooves on the surface to enhance grip, and a five-link independent suspension system is used to ensure the stability of the vehicle body and good ground contact of the wheels. Each wheel is driven by a brushless DC motor. The output power of a single motor is about 200 watts. The power is transmitted through a gear transmission system and a reducer to provide sufficient torque to cope with complex terrain such as sand and rocks. The navigation and control system integrates gyroscopes, accelerometers, laser rangefinders and high-resolution cameras. The central processor is responsible for path planning and motion control to achieve autonomous navigation and real-time obstacle avoidance.The energy system mainly relies on chemical energy or solar panels to provide electricity, and is equipped with high-capacity lithium-ion batteries for energy storage to ensure continuous operation at night or in severe weather conditions. The motion module realizes forward, backward and steering through differential drive, and the suspension system automatically adjusts the contact angle between the wheel and the ground to absorb shock and vibration and protect the vehicle body and internal equipment. Taking an advanced motion control system as an example, its motion module has an independent motor drive, a five-link suspension, and a high-precision navigation system, showing a highly integrated mechanical structure, electric drive system and intelligent control system, ensuring that the motion control system can move efficiently and navigate autonomously in harsh environments, and complete complex scientific exploration and surface exploration tasks. Through the mutual collaborative connection of multiple motion modules, it can be used to receive motion control instructions from iOS or Android / Harmony os and perform corresponding actions.

[0046] A Python-based automatic communication and collaborative control method in extreme environments, comprising the following steps:

[0047] 1) Use Python programming language to build a WebSocket server on the PC, use Python's built-in WebSocket library (such as websockets or websocket-client library) to create a server instance WebSocket server and initialize it; the server listens to a specific port (such as port 8080) to wait for the client's connection request;

[0048] Furthermore, when the WebSocket server is initialized, the server's exception handling module is configured to promptly capture and handle various exceptions during operation, including connection timeouts, message transmission failures, etc.; a resource cleanup module is configured to release system resources when an abnormal disconnection occurs or the client actively disconnects to avoid resource leakage; a logging function is set up to record detailed information such as connection requests, data transmission, and exception handling for subsequent analysis and optimization;

[0049] 2) Android / Harmony OS devices and iOS devices use their own Wi-Fi modules to connect to the same Internet, ensuring that they are in the same network environment as the WebSocket server. Android / Harmony OS and iOS devices can exchange data with the WebSocket server through the Wi-Fi module to achieve two-way communication;

[0050] Furthermore, on the Android / Harmony OS side: on the Android / Harmony OS device, the Python script is loaded through the QPython / Harmony OS platform to implement the client WebSocket connection. The QPython / Harmony OS platform provides Python environment support, which can write and execute Python code and establish a connection with the WebSocket server through the WebSocket library.

[0051] iOS: On the iOS device, use a development environment that supports Python to write the client connection code, and use the WebSocket library method to establish a WebSocket connection between the iOS device and the WebSocket server;

[0052] 3) During operation, the WebSocket server will continuously monitor the connection requests from Android / Harmony OS and iOS devices, and receive, parse and process data transmission requests from the client;

[0053] Furthermore, when an Android / Harmony os or iOS client sends a connection request, the WebSocket server performs identity authentication according to preset rules. After the authentication is passed, the connection is allowed and the client information (such as the client's IP address, device type, etc.) is recorded to facilitate subsequent management;

[0054] After successful connection, the WebSocket server receives data from the client, parses the received data, including text messages, control instructions, etc., and processes it according to the data type and content; for example, after receiving a control instruction from the Android / Harmonyos end, the server can send the instruction to the iOS end, or forward it to the chip to perform the corresponding operation; the server supports two-way communication and can send messages to Android / Harmony os and iOS devices in real time to ensure the real-time and reliability of data;

[0055] 4) The STM32F103ZET6 chip joins the WebSocket communication system through the Wi-Fi data connection module. The WebSocket server parses the control instructions in the received data information and sends them to the STM32F103ZET6 chip. The STM32F103ZET6 chip uses the motion control execution module to complete the instructions and feedback the execution results to the WebSocket server.

[0056] After receiving the control command, the STM32F103ZET6 chip will identify the command content through its parsing module and call the corresponding execution module to complete the task. For example, when the Android / Harmony OS device sends the "move forward" command, the server transmits the command to the STM32F103ZET6 chip, which parses it and controls the motion system to perform the corresponding action. At the same time, the STM32F103ZET6 chip will feed back the execution results to the WebSocket server, and the WebSocket server will forward the feedback information to the client.

[0057] In addition to the most basic motion control instructions (such as forward, backward, turn and speed adjustment), the instructions can also include more complex operations, such as collecting objects at a pre-set location, controlling the rotation of the gimbal mounted on the motion control device to shoot high-resolution images or videos, or performing specific trajectory movements to adapt to specific mission scenarios.

[0058] Under this extended command architecture, when the WebSocket server receives the "item collection" command, the WebSocket server will forward the command to the STM32F103ZET6 chip. The parsing module of the STM32F103ZET6 chip will determine the execution module that needs to be activated, such as the robotic arm control module, to achieve the grabbing or picking up of items at the specified location. After completion, the STM32F103ZET6 chip will feed back the execution results to the server so that the client can know the operation status and results. Similarly, when the gimbal rotation or image acquisition instructions are issued, the relevant driver modules of the STM32F103ZET6 chip will accurately control the angle, zoom and shooting parameters of the gimbal and camera, capture the required images, and then transmit them back to the WebSocket server through the Wi-Fi module for data processing and storage. This type of extended function enables the entire system to perform a variety of complex operations in coordination while performing motion control, meet the application requirements of multiple fields, and ensure the controllability and execution efficiency of the task through real-time two-way communication and feedback mechanism.

[0059] The WebSocket server will monitor the client's connection status in real time during operation, including detecting network delays, connection timeouts, etc. When an abnormal situation is detected (such as client disconnection, network anomalies), the server will immediately trigger the exception handling module to maintain system stability by cleaning up resources and disconnecting.

[0060] Specifically, a WebSocket server is deployed on the PC side, which listens to a fixed port, supports multiple clients to access at the same time, and records their connection information. Each terminal user connects to the WebSocket server through the WebSocket protocol. The WebSocket server is responsible for receiving messages sent by the user and broadcasting them to other clients to achieve real-time communication across platforms. The access process includes establishing a connection between the client and the WebSocket server, message transmission and monitoring. The WebSocket server ensures low latency and high stability of messages through a full-duplex communication protocol. After the client connection is established, the WebSocket server displays the information of the access device in real time, and realizes information sharing among multiple terminal users through a broadcast mechanism. This method has the advantages of unified access, efficient communication, and good scalability. It is particularly suitable for collaboration scenarios in extreme environments and can provide a stable and efficient solution for real-time communication of multiple devices. Figure 4 , which is a diagram of the monitoring and control client (client) obtained by the present invention under the PC-side Sypder driver.

[0061] In the exception handling process, when the client is abnormally disconnected, the WebSocket server will record the event and release the occupied system resources. The WebSocket server will also try to reconnect or send notifications to other normal clients to ensure the normal operation of the system.

[0062] When maintaining the connection status, the WebSocket server detects the client's connection status through a heartbeat mechanism (i.e., regularly sending ping messages to the client). If no response is received from the client, the client connection is considered abnormal and the corresponding processing flow is executed. The exception handling module ensures that in the event of an accident, the communication of other clients and the overall operation of the system will not be affected.

[0063] The WebSocket server is used to send messages between Android / Harmony OS and iOS systems, achieving efficient data transmission and real-time feedback:

[0064] WebSocket server acts as a hub, supporting two-way messaging between Android / Harmony OS and iOS devices. Data sent by the client will be forwarded to other clients through the WebSocket server, which ensures the stability and real-time nature of data transmission.

[0065] When an Android / Harmony OS device sends a message, the WebSocket server forwards the message to the iOS device and vice versa. The WebSocket server can decide whether to broadcast to all clients or transmit the message only between specified clients based on the message content.

[0066] After receiving the message, the WebSocket server will immediately feedback to the sender to confirm whether the message was successfully transmitted. If the transmission fails, the WebSocket server will automatically resend it to ensure the accuracy and timeliness of data transmission. In addition, the WebSocket server records the timestamp and status of each transmission to facilitate subsequent monitoring and debugging.

[0067] Through the control method in the above steps, the WebSocket server can efficiently manage the communication between Android / Harmonyos and iOS devices, and realize real-time message exchange. At the same time, by controlling the motion control device chip, remote control of external devices can be achieved, ensuring the flexibility and reliability of the overall system.

[0068] like Figure 8 As shown in the figure, through the Python platform, we successfully implemented the WebSocket server to access Android / Harmony os and iOS devices as client requests, and managed the communication between Android / Harmony os and iOS devices to achieve real-time message exchange. At the same time, by controlling the motion control system, we successfully realized the intelligent control of the motion control system.

[0069] Specifically, first start the WebSocket server on the PC and listen to a specific port to receive control instructions from the client; the motion control device establishes a connection with the WebSocket server through the wireless module and enters the listening state. The user enters the operation instruction on the control terminal (such as a PC or mobile phone), and the WebSocket server transmits the instruction to the motion control device in real time. The motion control device parses and executes the corresponding task, such as driving the motor forward / backward or controlling the LED light switch, and feeds back the execution result to the WebSocket server through the wireless module. The whole process supports two-way low-latency communication, can display the device status or execution results in real time, is convenient and efficient to operate, and is widely used in extreme environments and other scenarios. Figure 8 The figure shows the execution result of regulating the motion control device according to the present invention, and the intelligent regulation of the motion control device is successfully realized.

[0070] Through the full-duplex communication characteristics of the WebSocket protocol, the server supports multiple clients to connect concurrently, and can achieve low-latency, high-efficiency information transmission between different terminals, ensuring the compatibility and stability of cross-platform communication. Further, repeat steps 1) to 4) to connect more motion control systems. Multiple groups of motion control systems automatically coordinate and interconnect with the WebSocket server as the central hub to achieve information sharing and collaborative operation.

[0071] Furthermore, the WebSocket server accesses satellite communication through the client satellite data connection module to achieve stable sending and receiving of network-free status instructions and status information.

[0072] Compared with traditional methods, this invention has the advantages of strong cross-platform compatibility, high real-time performance, wide adaptability, strong applicability in extreme environments, and easy expansion. It is especially suitable for communication needs in smart homes, industrial Internet of Things, and extreme environments such as the surface of Mars and the back of the moon. Based on the good scalability of the Python ecosystem, it can combine cloud services, data storage, and AI algorithms to achieve more intelligent functions and provide innovative solutions for efficient and reliable cross-platform communications. Figure 2 As shown in FIG. 1 , it is a general control flow chart of satellite communication access of the present invention. Figure 5 As shown in FIG. 1 , it is a diagram of the execution result of the communication client of the present invention relying on the Qpython platform in the Android environment. Figure 6 As shown in FIG. 1 , it is a diagram of the execution result of the communication client of the present invention relying on the Qpython platform in the Harmony os environment. Figure 7 As shown, it is a diagram of the execution result of the communication client of the present invention relying on the Python Editor platform in the iOS environment.

Claims

1. A Python-based automatic communication and cooperative control device in extreme environments, characterized in that: include: A PC server building and monitoring system (1) includes a computer with a Python support platform installed, a WebSocket server is built through the Python support platform, and has an exception handling and resource cleanup module, a message processing module, a server connection management submodule, and a server initialization submodule, which are used to receive and process data transmission requests from external devices, and the data transmission is wirelessly bidirectionally communicated with the external device through the WebSocket server; Android / Harmony os communication system (2), the Android / Harmony os device uses the Hil105 Wi-Fi module to communicate with the WebSocket server, and is provided with a QPython / Harmony os platform, an Android / Harmony os communication input module and an Android / Harmony os feedback display module, and realizes data transmission and reception and feedback display through the WebSocket protocol; iOS communication control system (3), the iOS device uses AFEM-8240 (iOS) Wi-Fi module to communicate with the WebSocket server, is equipped with Python (iOS) support platform, iOS communication input module and iOS feedback display module, and realizes data transmission and status feedback display through WebSocket protocol; The motion control system (4) includes an STM32F103ZET6 chip, which is connected to the monitoring system through an embedded Wi-Fi data connection module and a WebSocket server, and is provided with a communication signal analysis module, a motion system analysis and coordination module, and a motion control execution module.

2. A Python-based automatic communication and collaborative control method in extreme environments, characterized in that: The following steps are involved: 1) Use Python programming language to build a WebSocket server on the PC, use Python's built-in WebSocket library to create a server instance WebSocket server, and initialize it; 2) Android / Harmony OS devices and iOS devices use their own Wi-Fi modules to connect to the same Internet, ensuring that they are in the same network environment as the WebSocket server. Android / Harmony OS and iOS devices can exchange data with the WebSocket server through the Wi-Fi module to achieve two-way communication; 3) During operation, the WebSocket server will continuously monitor the connection requests from Android / Harmony OS and iOS devices, and receive, parse and process data transmission requests from the client; 4) The STM32F103ZET6 chip joins the WebSocket communication system through the Wi-Fi data connection module. The WebSocket server parses the control instructions in the received data information and sends them to the STM32F103ZET6 chip. The STM32F103ZET6 chip uses the motion control execution module to complete the instructions and feedback the execution results to the PC server.

3. According to claim 2, a Python-based automatic communication and collaborative control method in extreme environments, characterized in that: In step 1), when the WebSocket server is initialized, the server's exception handling module is configured to capture and handle various exceptions in time during operation; a resource cleanup module is configured to release system resources when an abnormal disconnection occurs or the client actively disconnects; and a logging function is set for subsequent analysis and optimization.

4. According to the Python-based automatic communication and cooperative control method in extreme environments according to claim 2, it is characterized in that: In step 2), Android / Harmony OS: On the Android / Harmony OS device, load the Python script through the QPython / Harmony OS platform to implement the client WebSocket connection. The QPython / Harmony OS platform provides Python environment support, which can write and execute Python code and establish a connection with the WebSocket server through the WebSocket library. iOS: On the iOS device, use a development environment that supports Python to write the client connection code, and use the WebSocket library method to establish a WebSocket connection between the iOS device and the WebSocket server.

5. According to claim 2, the automatic communication and cooperative control method in extreme environment based on Python is characterized in that: In step 3), when the Android / Harmony os or iOS client sends a connection request, the WebSocket server performs identity authentication according to the preset rules, and allows the connection and records the client information after the authentication is passed; After a successful connection, the WebSocket server receives data from the client, parses the received data, and processes it according to the data type and content.

6. The Python-based automatic communication and cooperative control method in extreme environments according to any one of claims 2 to 5, characterized in that: Repeat steps 1) to 4) to connect more motion control systems. Multiple motion control systems automatically coordinate and interconnect with the WebSocket server as the central hub to achieve information sharing and collaborative operation.

7. The Python-based automatic communication and cooperative control method in extreme environments according to claim 6 is characterized in that: The WebSocket server accesses satellite communications through the client satellite data connection module to achieve stable sending and receiving of network-free status instructions and status information.

Citation Information

Patent Citations

  • WebSocket server monitoring method and device

    CN105306288A

  • Control method, remote monitoring device, base station, server and steaming media server

    CN108700889A

  • Control configuration for a plurality of endpoint devices

    US20220345371A1