An automatic communication and collaborative control device and method based on Python in extreme environments

Through the Python-based WebSocket protocol and the STM32F103ZET6 chip, seamless communication and remote control between devices in extreme environments are achieved, solving the problems of compatibility and remote control between devices and providing an efficient and reliable communication solution.

CN119907134BActive Publication Date: 2025-09-30XUZHOU NORMAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In extreme environments, there are compatibility issues in communication between devices. Existing communication methods are difficult to achieve seamless interconnection, and remote control systems lack flexibility and scalability, making it difficult to meet the needs of efficient control of multiple devices and real-time data exchange.

Method used

The monitoring system is built through a PC server using the Python-based WebSocket protocol. Combining the Android/Harmony OS and iOS communication systems, the STM32F103ZET6 chip is used to achieve seamless communication and control between devices. It supports compatibility with multiple operating systems and expands application scenarios through satellite communications.

Benefits of technology

Maintain stable connections in low-bandwidth, high-latency, and unstable network environments, ensure real-time communication and control between devices, provide reliable communication quality, reduce costs, adapt to multiple operating systems and hardware platforms, support global communication and positioning services, and enhance the scope and flexibility of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119907134B_ABST
    Figure CN119907134B_ABST
Patent Text Reader

Abstract

The present invention discloses an automatic communication collaborative control device in an extreme environment based on Python, comprising: a PC server construction and monitoring system, comprising a computer equipped with a Python support platform, a WebSocket server built through the Python support platform, and having an exception handling and resource cleanup module, a message processing main module, a server connection management submodule, and a server initialization submodule for receiving and processing data transmission requests from external devices, wherein the data transmission is wirelessly bidirectionally communicated with the external device via the WebSocket server; an Android / Harmony os communication system; an iOS communication control system; and a motion control system, comprising an STM32F103ZET6 chip, connected to the WebSocket server through an embedded Wi-Fi data connection module and a communication signal analysis module, a motion system analysis and coordination module, and a motion control execution module. The present invention can ensure efficient remote control and collaborative work between devices, and can automatically respond, adjust and optimize control strategies in real time to meet the needs of exploration tasks.
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 in particular relates to a Python-based automatic communication collaborative control device and method in extreme environments. Background Art

[0002] In today's technological landscape, with the rapid development of the Internet of Things (IoT), humanity's ability to explore extreme environments (such as extremely cold environments, sandstorms, Mars, and the far side of the moon) continues to grow. In particular, the demand for multi-device connectivity and remote control is growing stronger. To meet these challenges, iterative technological innovation and the widespread adoption of smart devices have become key drivers. Interoperability between devices has become increasingly important. Real-time data transmission, remote control systems, and efficient collaborative operations enable humans to better handle tasks in complex environments. However, as communication demands grow, ensuring the convenience and stability of real-time communication and remote control also raises higher technical requirements. This is especially true in extreme environments, where device reliability and communication capabilities face significant challenges.

[0003] Currently, inter-device communication faces compatibility issues. Differing operating systems, communication protocols, and hardware interfaces create barriers to inter-device communication. For example, Android and iOS devices differ significantly at the operating system level. Embedded devices often use specialized low-power protocols, making communication with smart mobile devices difficult. Consequently, achieving seamless connectivity between multiple devices often requires complex middleware or gateways to coordinate communication protocols, increasing system complexity and maintenance costs.

[0004] The demand for remote control is also increasing, especially in extreme environments. Communicators need to remotely control device operating parameters, monitor system status in real time, and respond quickly to anomalies. This places new demands on control systems, which must support low-latency, flexible, and adaptable remote control operations. However, existing systems often lack sufficient flexibility and scalability, making it difficult to simultaneously meet the requirements for efficient multi-device control and real-time data exchange. For example, traditional IoT communication methods such as infrared, Bluetooth, Wi-Fi, and Java-based control systems, while widely used in simple applications, often exhibit significant limitations when faced with multi-device collaboration and complex environments. Infrared communication has a limited range and requires line-of-sight between devices, making it less suitable for use. While Bluetooth is suitable for short-range communication, it has low bandwidth and a limited effective range. As the number of devices increases, communication bottlenecks can easily occur, leading to unstable connections. Wi-Fi offers higher bandwidth and long-range communication, but it is prone to network congestion in densely populated environments, consumes high power, and is sensitive to electromagnetic interference, making it difficult to maintain stable operation over the long term. Using programming languages ​​like Java for device communication, despite its cross-platform capabilities, can lead to complex development environments, cumbersome configuration, and slow response times, making it difficult to meet the requirements for 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 a Python-based automatic communication and collaborative control device and method for extreme environments, which can ensure efficient remote control and collaborative work between devices, and can also significantly 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, ensuring that the equipment can operate autonomously and stably for a long time to meet the needs of exploration tasks.

[0006] To achieve the above objectives, the present invention provides a Python-based automatic communication and collaborative control device for extreme environments, comprising:

[0007] The PC server construction 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 module, a server connection management submodule, and a server initialization submodule, which is used to receive and process data transmission requests from external devices. The data transmission is carried out through wireless two-way communication between the WebSocket server and the external device;

[0008] Android / Harmony OS communication system: Android / Harmony OS devices use the Hil105 Wi-Fi module to communicate with the WebSocket server. It is equipped with a QPython / Harmony OS platform, an Android / Harmony OS communication input module, and an Android / Harmony OS feedback display module. Data transmission and reception and feedback display are realized through the WebSocket protocol.

[0009] iOS communication control system: iOS devices use the AFEM-8240 (iOS) Wi-Fi module to communicate with the WebSocket server. It is equipped with a Python (iOS) support platform, an iOS communication input module, and an iOS feedback display module to achieve data transmission and status feedback display through the WebSocket protocol.

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

[0011] To achieve the above-mentioned purpose of the invention, a Python-based automatic communication collaborative control method in extreme environments 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) The Android / Harmony OS device and iOS device each use their own Wi-Fi module to connect to the same Internet, ensuring that they are in the same network environment as the WebSocket server. The Android / Harmony OS and iOS devices can exchange data with the WebSocket server through the Wi-Fi module, achieving two-way communication;

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

[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 promptly capture and handle various abnormal situations 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 up for subsequent analysis and optimization.

[0017] As a further solution of the present invention: in step 2), on the Android / Harmony OS side: on the Android / Harmony OS device, a Python script is loaded via the QPython / Harmony OS platform to implement a client WebSocket connection. The QPython / Harmony OS platform provides Python environment support, which allows for writing and executing Python code, and establishing a connection with the WebSocket server via 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 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 based on the data type and content.

[0021] As a further solution of the present invention: repeat steps 1) to 4) to connect 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 low-bandwidth, high-latency and unstable network environments, ensuring real-time communication and control between devices. In particular, 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 enables 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 isolated areas.

[0025] The present invention has significant promotional advantages. Not only is it highly compatible with multiple operating systems such as Windows, Android, iOS, and Harmony OS, but due to the cross-platform nature 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 increases the applicability 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, enhancing positioning and communication capabilities in environments without network coverage, providing a more flexible and reliable solution for IoT 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. At the same time, 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 design of the system allows motion control equipment to use everyday smartphones as communication terminals. With the help of the newly developed satellite communication software environment in the current mobile phone market, there is no need to purchase additional dedicated satellite hardware or equipment, which greatly reduces costs. These advantages make the technology highly competitive in the market, while making system deployment more economical and reducing maintenance costs, thereby promoting the popularization and promotion of technology in areas such as 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 to meet 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 operational capabilities 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] Furthermore, the Python platform supports the integration 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 cloud's powerful computing and storage capabilities enable systems to efficiently process massive amounts of data and perform complex analysis. Meanwhile, the cloud's data synchronization and backup capabilities ensure system reliability. In this way, the combination of WebSocket and the Python platform not only enhances remote control and real-time communication capabilities, but also ensures the continued stable operation of devices in extreme environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 This is the overall control flow chart of the automatic communication cooperative control device in extreme environments 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 structural diagram of the overall control of an example of accessing satellite communication of the present invention.

[0032] In the figure: 1. PC server setup and monitoring system, 2. Android / Harmony OS communication system, 3. iOS communication control system, 4. Motion control system. DETAILED DESCRIPTION

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

[0034] like Figure 1 and Figure 3 As shown, a Python-based automatic communication and cooperative control device for extreme environments includes:

[0035] A PC server construction and monitoring system 1 includes a computer equipped with a Python support platform, and a WebSocket server is built using 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 input. The WebSocket server has an exception handling and resource cleanup module, a message processing module, a server connection management submodule, and a server initialization submodule, and is used to receive and process data transmission requests from external devices. The data transmission is carried out through wireless two-way communication between the WebSocket server and the external device, and the WebSocket server receives and processes connection requests and data transmission requests from Android / Harmony OS and iOS systems, ensuring seamless access to devices with different operating systems.

[0036] Android / Harmony OS communication system 2: The Android / Harmony OS device uses the Hil105 Wi-Fi module to communicate with the WEBSOCKET server. It is equipped with a QPython / Harmony OS platform, an Android / Harmony OS communication input module, and an Android / Harmony OS feedback display module. Data transmission and reception and feedback display are realized through the WebSocket protocol.

[0037] iOS communication control system 3, where iOS devices use the AFEM-8240 (iOS) Wi-Fi module to communicate with the WebSocket server. It is equipped with a Python (iOS) support platform, an iOS communication input module, and an iOS feedback display module, and implements data transmission and status feedback display through the WebSocket protocol.

[0038] The AFEM-8240 is an ultra-high frequency (UHF) RF front-end module (RFFE) primarily used for wireless communications in mobile devices. It supports multimode functionality, handling both transmit and receive functions, and supports the LTE and 5G NR n48 / n77 / n78 / n79 frequency bands. The module contains multiple chips, including a power amplifier, low-noise amplifier, RF switch, RFFE controller, RC coupler, and film bulk acoustic resonator (FBAR) filter, that work together to improve the communication performance and efficiency of mobile devices. The AFEM-8240's SiP BGA package saves space while providing robust wireless connectivity.

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

[0040] The STM32F103ZET6 chip, equipped with the STM32F103ZET6 parsing module and control execution module, 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 offers multiple timers, three SPIs, two I2Cs, five USARTs, one USB, and one CAN interface, supporting a variety of communication protocols to meet complex communication needs. Furthermore, the STM32F103ZET6 features three 12-bit ADCs and one 12-bit DAC, suitable for precise analog signal processing and widely used in sensor data acquisition and signal generation. It supports multiple low-power modes, such as sleep, stop, and standby, to meet energy-saving needs, making it particularly suitable for battery-powered devices. It also provides 112 general-purpose I / O ports for flexible configuration to meet various peripheral access needs. The chip also supports SWD and JTAG debugging interfaces, facilitating program debugging and burning, improving development efficiency. During operation, the STM32F103ZET6 is first provided with a clock signal by the clock system, and the controller performs various tasks based on 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 and processing interrupt requests from the chip to ensure its stability and reliability. The power manager is responsible for managing the chip's power supply, including power switching and power monitoring, to ensure chip security and stability. The present invention utilizes the STM32F103ZET6 chip to communicate with a WEBSOCKET server via an embedded Wi-Fi data connection module, receiving and executing control commands sent by the server. The embedded system includes an embedded motion system module. The motion module of the motion control system is a key component, responsible for movement and navigation in a specific operating environment. Its design must adapt to various extreme environmental conditions, including low gravity, rough terrain, high radiation, and extreme temperature fluctuations. The motion module primarily consists of wheels and tires, an electric drive system, a navigation and control system, and an energy system. Typically equipped with multiple wheels approximately 0.5 meters in diameter and 0.3 meters in width, these are constructed from aluminum alloy or composite materials, with deep grooves designed on the surface to enhance grip. A five-link independent suspension system ensures vehicle stability and good wheel contact. Each wheel is driven by a brushless DC motor, each with an output of approximately 200 watts. This power is transmitted through a gear system and a speed reducer, providing sufficient torque to navigate complex terrain such as sand and rocks. The navigation and control system integrates a gyroscope, accelerometer, laser rangefinder, and high-resolution camera. The central processor is responsible for path planning and motion control, enabling autonomous navigation and real-time obstacle avoidance.The energy system primarily relies on chemical energy or solar panels for power, and is equipped with high-capacity lithium-ion batteries for energy storage, ensuring continuous operation at night or in inclement weather conditions. The motion module uses differential drive to achieve forward, reverse, and steering, and the suspension system automatically adjusts the wheel's contact angle with the ground to absorb shock and vibration, protecting the vehicle body and internal equipment. For example, an advanced motion control system features a motion module with independent electric motor drive, a five-link suspension, and a high-precision navigation system, demonstrating a highly integrated mechanical structure, electric drive system, and intelligent control system. This ensures the motion control system can efficiently move and navigate autonomously in harsh environments, completing complex scientific exploration and surface survey tasks. The coordinated interconnection of multiple motion modules can be used to receive motion control commands from iOS or Android / Harmony OS and execute corresponding actions.

[0041] A Python-based automatic communication and collaborative control method in extreme environments includes the following steps:

[0042] 1) Use Python to build a WebSocket server on your PC. Use Python's built-in WebSocket library (such as websockets or websocket-client) to create and initialize a WebSocket server instance. The server listens on a specific port (such as port 8080) to wait for client connection requests.

[0043] 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 and message transmission failures. A resource cleanup module is configured to release system resources when an abnormal disconnection occurs or the client actively disconnects, thus avoiding resource leaks. A logging function is set up to record detailed information such as connection requests, data transmission, and exception handling for subsequent analysis and optimization.

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

[0045] Furthermore, on the Android / Harmony OS side: 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 allows you to write and execute Python code and establish a connection with the WebSocket server through the WebSocket library.

[0046] iOS: On the iOS device, use a Python-supported development environment to write client connection code, and use the WebSocket library to establish a WebSocket connection between the iOS device and the WebSocket server.

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

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

[0049] After a successful connection, the WebSocket server receives data from the client, parses the data, including text messages and control commands, and processes it based on the data type and content. For example, after receiving a control command from the Android / HarmonyOS client, the server can send the command to the iOS client 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.

[0050] 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.

[0051] After receiving a control command, the STM32F103ZET6 chip uses its parsing module to identify the command content and invoke the corresponding execution module to complete the task. For example, when an Android / Harmony OS device sends a "move forward" command, the server transmits the command to the STM32F103ZET6 chip, which interprets it and controls the motion system to perform the corresponding action. Simultaneously, the STM32F103ZET6 chip reports the execution results to the WebSocket server, which then forwards the feedback information to the client.

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

[0053] With this extended command architecture, when a WebSocket server receives an "object capture" command, it forwards it to the STM32F103ZET6 chip. The STM32F103ZET6 chip's parsing module determines which execution module needs to be activated, such as the robotic arm control module, to grasp or pick up an object at a specified location. Once completed, the STM32F103ZET6 chip transmits the execution results back to the server, allowing the client to monitor the operation status and results. Similarly, when a gimbal rotation or image capture command is issued, the STM32F103ZET6 chip's driver module precisely controls the gimbal and camera's angle, zoom, and shooting parameters to capture the desired image. The image is then transmitted back to the WebSocket server via Wi-Fi for data processing and storage. These extended functions enable the entire system to collaboratively execute multiple complex operations while simultaneously performing motion control, meeting the needs of diverse applications. Through real-time, two-way communication and feedback mechanisms, they ensure task controllability and execution efficiency.

[0054] During operation, the WebSocket server monitors the client's connection status in real time, including detecting network latency, connection timeouts, and other issues. When an anomaly is detected (such as a client disconnection or network anomaly), the server immediately triggers the exception handling module to maintain system stability by cleaning up resources and disconnecting.

[0055] Specifically, a WebSocket server is deployed on the PC side, which listens to a fixed port, supports simultaneous access by multiple clients, 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.

[0056] During the exception handling process, when a client unexpectedly disconnects, the WebSocket server records the event and releases occupied system resources. The WebSocket server also attempts to reconnect or sends notifications to other normally functioning clients to ensure normal system operation.

[0057] During connection maintenance, the WebSocket server monitors the client's connection status through a heartbeat mechanism (i.e., periodically sending ping messages to the client). If no response is received from the client, the server determines that the client connection is abnormal and executes the appropriate handling process. The exception handling module ensures that any unexpected situation does not affect the communication of other clients or the overall operation of the system.

[0058] Use the WebSocket server to implement message exchange between Android / Harmony OS and iOS systems, achieving efficient data transmission and real-time feedback:

[0059] The WebSocket server acts as a hub, supporting two-way messaging between Android / Harmony OS and iOS devices. Data sent by the client is forwarded to other clients via the WebSocket server, ensuring stable and real-time data transmission.

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

[0061] Upon receiving a message, the WebSocket server immediately sends feedback to the sender to confirm successful transmission. If a transmission fails, the WebSocket server automatically resends the message, ensuring accurate and timely data transmission. Furthermore, the WebSocket server records the timestamp and status of each transmission to facilitate subsequent monitoring and debugging.

[0062] By using the control method described in the preceding steps, the WebSocket server can efficiently manage communication between Android / Harmonyos and iOS devices, enabling real-time message exchange. Furthermore, by controlling the motion control device chip, it can also enable remote control of external devices, ensuring overall system flexibility and reliability.

[0063] Using the Python platform, we successfully implemented a WebSocket server that connects to Android / Harmony OS and iOS devices as client requests, and managed communication between these devices, enabling real-time message exchange. Furthermore, by controlling the motion control system, we successfully implemented intelligent control of the motion control system.

[0064] Specifically, a WebSocket server is first started on the PC, listening on a specific port to receive control commands from the client. The motion control device then establishes a connection with the WebSocket server via a wireless module and enters a listening state. The user enters an operating command on a control terminal (such as a PC or mobile phone), and the WebSocket server transmits the command in real time to the motion control device. The motion control device interprets the command and performs the corresponding task, such as driving a motor forward / reverse or turning an LED light on and off. The result is then fed back to the WebSocket server via the wireless module. This entire process supports two-way low-latency communication and displays device status and execution results in real time, making it convenient and efficient, and widely applicable to extreme environments.

[0065] Leveraging the full-duplex communication capabilities of the WebSocket protocol, the server supports multiple concurrent client connections, enabling low-latency, high-efficiency information transmission between different terminals, ensuring cross-platform communication compatibility and stability. Furthermore, by repeating steps 1) through 4) to connect more motion control systems, multiple motion control systems will automatically coordinate and interconnect with the WebSocket server as the central hub, enabling information sharing and collaborative operation.

[0066] Furthermore, 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.

[0067] 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 scalability. 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 be combined with cloud services, data storage and AI algorithms to achieve more intelligent functions and provide innovative solutions for efficient and reliable cross-platform communication. Figure 2 FIG. 1 is a flow chart of the overall control of accessing satellite communications according to the present invention.

Claims

1. A Python-based automatic communication and cooperative control device for extreme environments, characterized by: include: A PC server building and monitoring system (1) includes a computer equipped with a Python support platform, a WebSocket server 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; Android / Harmony OS communication system (2), Android / Harmony OS device uses Hil105 Wi-Fi module to communicate with WebSocket server, and is equipped with QPython / Harmony OS platform, Android / Harmony OS communication input module and Android / Harmony OS feedback display module; iOS communication control system (3), where the iOS device uses the AFEM-8240 (iOS) Wi-Fi module to communicate with the WebSocket server, and is equipped with a Python (iOS) support platform, an iOS communication input module, and an iOS feedback display module; The motion control system (4) includes an STM32F103ZET6 chip, which is connected to the PC server through an embedded Wi-Fi data connection module to communicate with the monitoring system (1), and is equipped with a communication signal analysis module, a motion system analysis and coordination module, and a motion control execution module; The device performs the following steps: 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) The Android / Harmony OS device and iOS device each use their own Wi-Fi module to connect to the same Internet, ensuring that they are in the same network environment as the WebSocket server. The Android / Harmony OS and iOS devices can exchange data with the WebSocket server through the Wi-Fi module, achieving two-way communication; 3) During operation, the WebSocket server will continuously listen for connection requests from Android / Harmony OS and iOS devices, and receive, parse and process data transmission requests from clients; 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.

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

3. The Python-based automatic communication and cooperative control device for extreme environments according to claim 1, characterized in that: In step 2), on the Android / Harmony OS side: On the Android / Harmony OS device, load a Python script through the QPython / Harmony OS platform to implement the client WebSocket connection. The QPython / Harmony OS platform provides Python environment support, allowing you to 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 to establish a WebSocket connection between the iOS device and the WebSocket server.

4. The Python-based automatic communication and cooperative control device for extreme environments according to claim 1, 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. If the authentication is successful, the server allows the connection and records the client information. After a successful connection, the WebSocket server receives data from the client, parses the received data, and processes it based on the data type and content.

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

6. The Python-based automatic communication and cooperative control device for extreme environments according to claim 5, 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 commands and status information.

Citation Information

Patent Citations

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

    CN108700889A

  • Control configuration for a plurality of endpoint devices

    US20220345371A1