WO2021056502A1 - 控制方法、系统、可移动平台和存储介质 - Google Patents
控制方法、系统、可移动平台和存储介质 Download PDFInfo
- Publication number
- WO2021056502A1 WO2021056502A1 PCT/CN2019/108859 CN2019108859W WO2021056502A1 WO 2021056502 A1 WO2021056502 A1 WO 2021056502A1 CN 2019108859 W CN2019108859 W CN 2019108859W WO 2021056502 A1 WO2021056502 A1 WO 2021056502A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- thread
- service thread
- application
- service
- current state
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3051—Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/3013—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is an embedded system, i.e. a combination of hardware and software dedicated to perform a certain function in mobile devices, printers, automotive or aircraft systems
Definitions
- This application relates to the technical field of embedded systems, and in particular to a control method, system, removable platform and storage medium.
- sensor devices There are usually many sensor devices in embedded devices.
- aircraft is a typical embedded device that integrates many sensors, such as image sensors, Time of Flight (ToF) sensors, and gyroscopes.
- sensors usually have a corresponding software sub-module or hardware sub-module to control and detect, so there are many sub-modules in the embedded system, and a state system is also needed to detect and process the state of these sub-modules; correspondingly
- the sub-module can be called Client (application thread), the state system can be called Server (service thread), and the sub-module and state system perform state detection in the Client/Server mode.
- the existing methods usually only allow the sub-module to actively report the state change to the state system when the state of the sub-module changes. In this way, the connection between the sub-module and the state system is unstable and may not be able to feed back the state change to the state system in time. .
- This detection mechanism has poor security and stability.
- this specification provides a control method, system, removable platform, and storage medium, aiming to solve the technical problems of poor security and stability of the existing state detection mechanism.
- this specification provides a control method, including:
- the application thread gets the current state
- the service thread periodically sends a query instruction to the application thread, and the application thread sends the current state to the service thread in response to the query instruction.
- this specification provides a control system, including: a memory and a processor, wherein:
- the memory is used to store program instructions
- the processor is configured to execute the program instructions to implement a multi-threaded structure, the multi-threaded structure includes a service thread and an application thread; the multi-threaded structure is used to implement:
- the application thread obtains the current state
- the service thread periodically sends a query instruction to the application thread, and the application thread sends the current state to the service thread in response to the query instruction.
- this specification provides a movable platform, including: a memory and a processor, wherein,
- the memory is used to store program instructions
- the processor is configured to execute the program instructions to implement a multi-threaded structure, the multi-threaded structure includes a service thread and an application thread; the multi-threaded structure is used to implement:
- the application thread obtains the current state
- the service thread periodically sends a query instruction to the application thread, and the application thread sends the current state to the service thread in response to the query instruction.
- this specification provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the above-mentioned method.
- the embodiments of this specification provide a control method, system, removable platform and storage medium.
- the status of an application thread changes, the current status is actively sent to the service thread; and the service thread periodically queries the application thread for the current status of the application thread. Status, so the service thread can obtain the status of the application thread in a timely and stable manner.
- the service thread and the application thread work together, the detection mechanism is safer and more stable, and the system has better fault tolerance and robustness.
- FIG. 1 is a schematic flowchart of a control method provided by an embodiment of this specification
- Fig. 2 is a schematic block diagram of an embodiment of a control system applying a control method
- Figure 3 is a schematic diagram of the application thread state machine diagram
- Fig. 4 is a schematic block diagram of another embodiment of a control system applying a control method
- Fig. 5 is a schematic block diagram of another embodiment of a control system applying a control method
- Fig. 6 is a schematic block diagram of a control system provided by an embodiment of the present specification.
- Fig. 7 is a schematic block diagram of a movable platform provided by an embodiment of the present specification.
- FIG. 1 is a schematic flowchart of a control method provided by an embodiment of this specification.
- the control method can be applied in a control system to obtain the state of the system and/or the environment and other processes.
- control system is, for example, an embedded system.
- Embedded System Embedded System
- Embedded System is a computer system embedded in a mechanical or electrical system with specific functions and real-time computing performance.
- control method can be applied to a movable platform.
- the movable platform includes at least one of the following: an unmanned aerial vehicle, a handheld pan-tilt, and a pan-tilt cart.
- the unmanned aerial vehicle can be a rotary-wing drone, such as a four-rotor drone, a hexa-rotor drone, an eight-rotor drone, or a fixed-wing drone.
- the processor of the control system is configured to execute program instructions to implement a multi-threaded structure.
- the multi-thread structure includes service threads and application threads.
- control method of the embodiment of this specification includes step S110 to step S130.
- the application thread enters the state corresponding to the state machine of the application thread according to the input data or sensor data.
- the state of the application thread may include waiting for acquiring sensor data, processing sensor data, and outputting monitoring results. , Suspend, abnormal exit and other states, each state corresponds to a unique status code.
- FIG. 3 it is a schematic diagram of a state machine diagram of an application thread in an embodiment.
- the application thread obtains sensor data collected by the sensor, and determines the current state according to the sensor data.
- control system includes one or more input devices, such as a mouse, a keyboard, and a touch screen.
- the input device is used to obtain input data, and the control system can determine the state of the system and/or the environment according to the input data.
- control system includes one or more sensors. Sensors are used to obtain sensing data, and the control system can determine the state of the system and/or the environment based on the sensing data.
- the sensors in the control system include resistive sensors, capacitive sensors, inductive sensors, piezoelectric sensors, pyroelectric sensors, impedance sensors, magnetoelectric sensors, piezoelectric sensors, photoelectric sensors, resonance Sensor, Hall sensor, ultrasonic sensor, isotope sensor, electrochemical sensor, microwave sensor, ultrasonic sensor, temperature sensor, humidity sensor, gas sensor, pressure sensor, acceleration sensor, ultraviolet sensor, magnetic sensor, magnetic sensor Resistance sensor, image sensor, power sensor, displacement sensor, pressure sensor, PH sensor, flow sensor, liquid level sensor, immersion sensor, illuminance sensor, differential pressure transmitter, acceleration sensor, displacement sensor, load cell, distance sensor At least one of them.
- the application thread obtains sensor data from the corresponding sensor, and determines the current state according to the sensor data.
- the current state may be the state of waiting to acquire the sensor data
- the current state may be the state of processing the sensor data.
- the application thread judges whether the state has changed according to the state code of the state machine corresponding to the current state.
- the application thread sends the status code of the current status to the service thread.
- the status code includes three fields, one of which is used to identify the application thread corresponding to the status code, the other is used to identify the current state of the application thread, and another field can indicate the value of the current state.
- the upper 12 bits of the status code can distinguish up to 4096 application threads, so the control system can support up to 4096 application threads; the middle 12 bits of the status code are used to distinguish the internal state of the application thread, so each application thread can define a maximum 4096 states; the lower 6 bits of the state code are used to indicate the value of the state, so each state can have 256 values.
- the service thread may determine the current status of the application thread corresponding to the status code according to the status code sent by the application thread when the status changes.
- the service thread periodically sends a query instruction to the application thread, and the application thread sends the current state to the service thread in response to the query instruction.
- the service thread has a fixed cycle, such as 100 milliseconds to actively query the status of the application thread.
- the service thread periodically sends a query instruction to the application thread, and the application thread sends a status code indicating the current state to the service thread after receiving the query instruction.
- the service thread may determine the current state of the application thread corresponding to the status code according to the status code sent by the application thread in response to the query instruction.
- the number of the application threads is multiple.
- the service thread periodically sending a query instruction to the application thread includes: the service thread periodically sends a query instruction to each of the application threads according to the ordering of the multiple application threads.
- the query instruction is first sent to the application thread A1, then the query instruction is sent to the application thread A2, and then the query instruction is sent to the application thread A3. It can be realized that each application thread can periodically respond to query instructions and send the current status to the service thread.
- the control method provided by the foregoing embodiment of this specification actively sends the current status to the service thread when the status of the application thread changes; and the service thread periodically queries the application thread for the current status of the application thread, so the service thread can be timely and stable Get the status of the application thread.
- the service thread and the application thread work together, the detection mechanism is safer and more stable, and the system has better fault tolerance and robustness.
- control method further includes: the service thread executes task operations according to the monitoring result sent by the application thread.
- the application thread obtains the sensor data collected by the sensor, obtains the monitoring result according to the sensor data, and sends the monitoring result to the service thread; the service thread performs task operations according to the monitoring result , Such as controlling unmanned aerial vehicles to fly or controlling unmanned aerial vehicles to track targets.
- the service thread performs task operations based on the flying height determined by the application thread A1 and/or the position information of the target of interest in the image determined by the application thread A2, such as controlling the unmanned aerial vehicle such as hovering, raising the flying height, and Fly left and wait.
- control method further includes: the application thread detects whether the application thread and the service thread are in a connected state according to the query instruction.
- the query instruction periodically sent by the service thread to the application thread may serve as a heartbeat packet function for judging the connection state between the service thread and the application thread. In this way, the application thread disconnected from the service thread can be discovered in time.
- the application thread is separated by a first preset duration, such as 0.5 seconds, if the query instruction sent by the service thread is not received, it is determined that the application thread and the service thread are not in a connected state. It can be further determined that the application thread exits abnormally.
- a first preset duration such as 0.5 seconds
- the processor of the control system is configured to execute program instructions to implement a multi-threaded structure.
- the multi-threaded structure includes service threads, application threads and daemon threads.
- control method further includes: a daemon thread monitoring whether the application thread exits abnormally; if the daemon thread detects that the application thread exits abnormally, the daemon thread restarts the application thread.
- the daemon thread determines that the application thread exits abnormally.
- the service thread cannot obtain the current state of the application thread in time, and it can be determined that the application thread exits abnormally.
- the daemon thread may monitor whether the application thread exits abnormally according to whether the application thread has not received the query instruction sent by the service thread for a long time; and when the application thread exits abnormally, the daemon thread restarts Start the application thread.
- the daemon thread determines that the application thread exits abnormally according to the error reporting instruction.
- the daemon thread may determine that the application thread exits abnormally according to the error reporting instruction, and when it is detected that the application thread exits abnormally, the daemon thread restarts the application thread.
- the service thread of the control system includes a main service thread and a backup service thread.
- the main service thread when the main service thread is running normally, the main service thread performs task operations according to the monitoring result; when the main service thread exits abnormally, the backup service thread performs tasks according to the monitoring result operating.
- the main service thread receives the current state sent by the application thread, and performs task operations according to the current state.
- the standby service thread receives the current status sent by the application thread, and performs task operations according to the current status.
- the main service thread makes decisions based on the monitoring results of the application threads, and the backup service thread does not make decisions when the main service thread is normal. However, after the main service thread exits abnormally, the backup service thread is converted to the main service thread to make a decision based on the monitoring result of the application thread.
- both the main service thread and the backup service thread may communicate with the application thread, and obtain the monitoring result of the application thread from the application thread, such as periodically querying the monitoring result of the application thread, or receiving the monitoring result actively reported by the application thread.
- the backup service thread can make decisions faster based on the monitoring results of the application thread.
- the main service thread when the main service thread is running normally, the main service thread periodically sends query instructions to the application thread and/or performs response operations according to the current status sent by the application thread; when the main service thread exits abnormally, the standby service thread cycles Send a query instruction to the application thread and/or execute a response operation according to the current state sent by the application thread.
- the standby service thread may not obtain the current state of the application thread from the application thread. After the main service thread exits abnormally, the standby service thread obtains the current state of the application thread from the application thread, and performs a response operation according to the current state.
- control method further includes: the main service thread periodically sends a heartbeat packet to the backup service thread; if the backup service thread does not receive the heartbeat sent by the main service thread for a second preset period of time Package, it is determined that the main service thread exits abnormally. In this way, the abnormal exit of the main service thread can be detected in time, which is conducive to the faster conversion of the standby service thread to the main service thread.
- the second preset duration may be equal to the first preset duration, or may not be equal to the first preset duration.
- a new backup service thread is created.
- the original backup service thread turns to the main service thread to receive the monitoring result sent by the application thread, and perform task operations according to the monitoring result.
- the new backup service thread receives the monitoring result sent by the application thread, and performs task operations according to the monitoring result.
- a new backup service thread is created.
- a backup service thread will take over the main service thread to make decisions based on the monitoring results of the application thread.
- control method further includes: the standby service thread periodically sends a heartbeat packet to the main service thread. Therefore, the main service thread can judge the status of the standby service thread according to the heartbeat packet.
- the main service thread does not receive the heartbeat packet sent by the backup service thread during the third preset period of time, it is determined that the backup service thread exits abnormally.
- the third preset duration may be the same as the aforementioned first preset duration and second preset duration, or may be different from the first preset duration and second preset duration.
- main service thread does not receive the heartbeat packet of the standby service thread for too long, it is determined that the standby service thread exits abnormally, and the main service thread creates a new standby service thread. In order to maintain that after the main service thread often exits, a backup service thread will take over the main service thread to make a decision based on the monitoring results of the application thread.
- the control method provided by the embodiment of this specification actively sends the current status to the service thread when the status of the application thread changes; and the service thread periodically queries the application thread for the current status of the application thread, so the service thread can obtain the current status in a timely and stable manner.
- the status of the application thread is a timely and stable manner.
- a daemon thread is used to guard the application thread, restarting the application thread when the application thread is abnormal; also by setting a backup service thread, after the main service thread exits abnormally, the backup service thread obtains the monitoring result of the application thread from the application thread, And perform task operations based on the monitoring results.
- the control system can quickly resume normal operation, which improves the "survival rate" of the control system, such as the movable platform.
- FIG. 6 is a schematic block diagram of a control system 600 according to an embodiment of the present specification.
- the control system 600 includes a processor 601 and a memory 602.
- the processor 601 and the memory 602 are connected by a bus 603, and the bus 603 is, for example, an I2C (Inter-integrated Circuit) bus.
- I2C Inter-integrated Circuit
- the processor 601 may be a micro-controller unit (MCU), a central processing unit (CPU), a digital signal processor (Digital Signal Processor, DSP), or the like.
- MCU micro-controller unit
- CPU central processing unit
- DSP Digital Signal Processor
- the memory 602 may be a Flash chip, a read-only memory (ROM, Read-Only Memory) disk, an optical disk, a U disk, or a mobile hard disk.
- the processor 601 is configured to run program instructions stored in the memory 602, and implement the aforementioned control method when the program instructions are executed.
- the processor 601 is configured to execute the program instructions to implement a multi-thread structure, the multi-thread structure includes a service thread and an application thread; the multi-thread structure is used to implement:
- the application thread obtains the current state
- the service thread periodically sends a query instruction to the application thread, and the application thread sends the current state to the service thread in response to the query instruction.
- control system further includes at least one sensor for acquiring sensor data.
- the application thread obtains sensor data from the sensor; and the application thread determines the current state according to the sensor data.
- the multi-threaded structure is also used to implement:
- the application thread detects whether the application thread and the service thread are in a connected state according to the query instruction.
- the multi-threaded structure is also used to implement:
- the application thread does not receive the query instruction sent by the service thread at the first preset time interval, it is determined that the application thread and the service thread are not in a connected state.
- the number of the application threads is multiple;
- the service thread periodically sending query instructions to the application thread includes:
- the service thread periodically sends query instructions to each of the application threads according to the ordering of the multiple application threads.
- the multi-threaded structure is also used to implement:
- the daemon thread monitors whether the application thread exits abnormally
- the daemon thread If the daemon thread detects that the application thread exits abnormally, the daemon thread restarts the application thread.
- the application thread obtains sensor data collected by the sensor, obtains a monitoring result according to the sensor data, and sends the monitoring result to the service thread;
- the service thread executes task operations according to the monitoring result.
- the service thread includes a main service thread and a backup service thread:
- the main service thread When the main service thread is running normally, the main service thread performs task operations according to the monitoring result;
- the backup service thread When the main service thread exits abnormally, the backup service thread performs task operations according to the monitoring result.
- the multi-threaded structure is also used to implement:
- the main service thread periodically sends a heartbeat packet to the backup service thread
- the backup service thread does not receive the heartbeat packet sent by the main service thread at a second preset time interval, it is determined that the main service thread exits abnormally.
- the multi-threaded structure is also used to implement:
- the multi-threaded structure is also used to implement:
- the multi-threaded structure is also used to implement:
- the standby service thread periodically sends a heartbeat packet to the main service thread
- the main service thread does not receive the heartbeat packet sent by the backup service thread for the third preset time interval, it is determined that the backup service thread exits abnormally.
- FIG. 7 is a schematic block diagram of a movable platform 700 according to an embodiment of the present specification.
- the mobile platform 700 includes a processor 701 and a memory 702.
- the processor 701 and the memory 702 are connected by a bus 703, and the bus 703 is, for example, an I2C (Inter-integrated Circuit) bus.
- I2C Inter-integrated Circuit
- the processor 701 may be a micro-controller unit (MCU), a central processing unit (Central Processing Unit, CPU), a digital signal processor (Digital Signal Processor, DSP), or the like.
- MCU micro-controller unit
- CPU Central Processing Unit
- DSP Digital Signal Processor
- the memory 702 may be a Flash chip, a read-only memory (ROM, Read-Only Memory) disk, an optical disk, a U disk, or a mobile hard disk.
- the processor 701 is configured to run program instructions stored in the memory 702, and implement the aforementioned control method when the program instructions are executed.
- the processor 701 is configured to execute the program instructions to implement a multi-threaded structure, the multi-threaded structure includes a service thread and an application thread; the multi-threaded structure is used to implement:
- the application thread obtains the current state
- the service thread periodically sends a query instruction to the application thread, and the application thread sends the current state to the service thread in response to the query instruction.
- the movable platform further includes at least one sensor for acquiring sensor data.
- the movable platform includes an image sensor, a Time of Flight (ToF) sensor, a gyroscope, and the like.
- ToF Time of Flight
- the application thread obtains sensor data from the sensor; and the application thread determines the current state according to the sensor data.
- the embodiments of this specification also provide a computer-readable storage medium, the computer-readable storage medium stores a computer program, the computer program includes program instructions, and the processor executes the program instructions to implement the foregoing implementation The control method provided by the example.
- the computer-readable storage medium may be the control system described in any of the foregoing embodiments, such as an internal storage unit of a movable platform, for example, a hard disk or memory of the control system.
- the computer-readable storage medium may also be an external storage device of the control system, such as a plug-in hard disk equipped on the control system, a smart memory card (SMC), or a secure digital (SD) ) Card, Flash Card, etc.
- SMC smart memory card
- SD secure digital
- control method, system, removable platform, and storage medium provided by the foregoing embodiments of this specification actively send the current status to the service thread when the status of the application thread changes; and the service thread periodically queries the application thread for the current status of the application thread Therefore, the service thread can obtain the status of the application thread in a timely and stable manner.
- a daemon thread is used to guard the application thread and restarts the application thread when the application thread is abnormal.
- a standby service thread is also set so that after the main service thread exits abnormally, the standby service thread obtains the current state of the application thread from the application thread.
- the control system can quickly resume normal operation, which improves the "survival rate" of the control system, such as the movable platform.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computing Systems (AREA)
- Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Debugging And Monitoring (AREA)
Abstract
一种控制方法,包括:应用线程获取当前状态(S110);若应用线程根据当前状态判定状态发生变化,将当前状态发送给服务线程(S120);服务线程周期性向应用线程发送查询指令,应用线程响应于查询指令将当前状态发送给服务线程(S130)。该控制方法解决了现有的状态检测机制安全性和稳定性较差等技术问题。另外,还涉及一种控制系统、可移动平台和存储介质。
Description
本申请涉及嵌入式系统技术领域,尤其涉及一种控制方法、系统、可移动平台和存储介质。
随着信息化和智能化技术的发展,越来越多的场合需要对一些状态进行监测,例如工厂生产线的自检、生产线所生产产品的检测、或者电子设备运行前或运行中的自检等。
在嵌入式设备中通常有很多的传感器设备,例如飞行器是典型的嵌入式设备,集成了很多传感器,如图像传感器、飞行时间(Time of Flight,ToF)传感器、陀螺仪等。各种传感器通常有对应的一个软件子模块或硬件子模块来控制和检测,所以在嵌入式系统中就有很多子模块,同时也需要一个状态系统来检测和处理这些子模块的状态;相应的,子模块可以称作Client(应用线程),状态系统可以称作Server(服务线程),子模块和状态系统以Client/Server模式进行状态检测。
但是现有的方法通常只能由子模块在子模块的状态发生变化时主动给状态系统上报状态变化,这种方式下子模块与状态系统之间的连接不稳定,可能无法及时向状态系统反馈状态变化。这种检测机制安全性和稳定性较差。
发明内容
基于此,本说明书提供了一种控制方法、系统、可移动平台和存储介质,旨在解决现有的状态检测机制安全性和稳定性较差等技术问题。
第一方面,本说明书提供了一种控制方法,包括:
应用线程获取当前状态;
若所述应用线程根据所述当前状态判定状态发生变化,将所述当前状态发 送给服务线程;
所述服务线程周期性向所述应用线程发送查询指令,所述应用线程响应于所述查询指令将所述当前状态发送给服务线程。
第二方面,本说明书提供了一种控制系统,包括:存储器和处理器,其中,
所述存储器,用于存储程序指令;
所述处理器,被配置为执行所述程序指令来实施多线程结构,所述多线程结构包括服务线程和应用线程;所述多线程结构用于实现:
所述应用线程获取当前状态;
若所述应用线程根据所述当前状态判定状态发生变化,将所述当前状态发送给服务线程;
所述服务线程周期性向所述应用线程发送查询指令,所述应用线程响应于所述查询指令将所述当前状态发送给服务线程。
第三方面,本说明书提供了一种可移动平台,包括:存储器和处理器,其中,
所述存储器,用于存储程序指令;
所述处理器,被配置为执行所述程序指令来实施多线程结构,所述多线程结构包括服务线程和应用线程;所述多线程结构用于实现:
所述应用线程获取当前状态;
若所述应用线程根据所述当前状态判定状态发生变化,将所述当前状态发送给服务线程;
所述服务线程周期性向所述应用线程发送查询指令,所述应用线程响应于所述查询指令将所述当前状态发送给服务线程。
第四方面,本说明书提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时使所述处理器实现上述的方法。
本说明书实施例提供了一种控制方法、系统、可移动平台和存储介质,在应用线程的状态发生变化时,主动将当前状态发送给服务线程;并且服务线程周期性向应用线程查询应用线程的当前状态,因此服务线程可以及时、稳定的获取应用线程的状态。服务线程和应用线程相互协同工作,检测机制更安全、稳定,系统的容错能力更好、健壮性更强。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本说明书的公开内容。
为了更清楚地说明本说明书实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本说明书的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本说明书一实施例提供的一种控制方法的流程示意图;
图2是应用控制方法的控制系统的一实施方式的示意性框图;
图3是应用线程状态机图的示意图;
图4是应用控制方法的控制系统的另一实施方式的示意性框图;
图5是应用控制方法的控制系统的又一实施方式的示意性框图;
图6是本说明书一实施例提供的一种控制系统的示意性框图;
图7是本说明书一实施例提供的一种可移动平台的示意性框图。
下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本说明书一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本说明书保护的范围。
附图中所示的流程图仅是示例说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解、组合或部分合并,因此实际执行的顺序有可能根据实际情况改变。
下面结合附图,对本说明书的一些实施方式作详细说明。在不冲突的情况下,下述的实施例及实施例中的特征可以相互组合。
请参阅图1,图1是本说明书一实施例提供的一种控制方法的流程示意图。所述控制方法可以应用在控制系统中,用于获取系统和/或环境的状态等过程。
示例性的,控制系统例如为嵌入式系统。嵌入式系统(Embedded System), 是一种嵌入机械或电气系统内部、具有专一功能和实时计算性能的计算机系统。
在一些实施方式中,控制方法可以应用在可移动平台。示例性的,可移动平台包括如下至少一种:无人飞行器、手持云台、云台车。
进一步而言,无人飞行器可以为旋翼型无人机,例如四旋翼无人机、六旋翼无人机、八旋翼无人机,也可以是固定翼无人机。
示例性的,如图2所示,控制系统的处理器被配置为执行程序指令来实施多线程结构。所述多线程结构包括服务线程和应用线程。
如图1所示,本说明书实施例的控制方法包括步骤S110至步骤S130。
S110、应用线程获取当前状态。
在一些实施方式中,应用线程根据输入数据或者传感器的传感数据来进入应用线程的状态机对应的状态,应用线程的状态可以包括等待获取传感器的传感数据、处理传感数据、输出监测结果、挂起、异常退出等等状态,每个状态对应唯一的状态码。
如图3所示,为一实施方式中应用线程的状态机图的示意图。
示例性的,所述应用线程获取传感器采集到的传感数据,并根据所述传感数据确定当前状态。
在一些实施方式中,控制系统包括一个或多个输入设备,如鼠标、键盘、触控屏等。输入设备用于获取输入数据,控制系统可以根据输入数据确定系统和/或环境的状态。
在一些实施方式中,如图2所示,控制系统包括一个或多个传感器。传感器用于获取传感数据,控制系统可以根据传感数据确定系统和/或环境的状态。
示例性的,控制系统中的传感器包括电阻式传感器、电容式传感器、电感式传感器、压电式传感器、热电式传感器、阻抗式传感器、磁电式传感器、压电式传感器、光电式传感器、谐振式传感器、霍尔式传感器、超声式传感器、同位素式传感器、电化学式传感器、微波式传感器、超声波传感器、温度传感器、湿度传感器、气体传感器、压力传感器、加速度传感器、紫外线传感器、磁敏传感器、磁阻传感器、图像传感器、电量传感器、位移传感器、压力传感器、PH传感器、流量传感器、液位传感器、浸水传感器、照度传感器、差压变送器、加速度传感器、位移传感器、称重传感器、测距传感器中的至少一种。
示例性的,应用线程从相应的传感器获取传感数据,并根据所述传感数据 确定当前状态。例如,应用线程可以确定还没接收到所述传感数据时,当前状态可以为等待获取传感数据状态,当已经获取到所述传感数据时,当前状态可以为处理传感数据状态。
S120、若所述应用线程根据所述当前状态判定状态发生变化,将所述当前状态发送给服务线程。
示例性的,应用线程根据所述状态机对应当前状态的状态码判断状态是否发生变化。
示例性的,如果判定状态发生变化,则所述应用线程将当前状态的状态码发送给服务线程。
示例性的,状态码包括三个字段,其中一个字段用于标识状态码对应的应用线程、另一个字段用于标识所述应用线程的当前状态、还有一个字段可以表示当前状态的取值。
例如,状态码的高12位可以区分最多4096个应用线程,因此控制系统可以支持最多4096个应用线程;状态码的中间12位用于区分应用线程的内部状态,因此每个应用线程最大可以定义4096种状态;状态码的低6位用于表示状态的取值,因此每个状态的取值可以有256种。
示例性的,所述服务线程根据应用线程在状态发生变化时发送的状态码,可以确定状态码对应的应用线程的当前状态。
S130、所述服务线程周期性向所述应用线程发送查询指令,所述应用线程响应于所述查询指令将所述当前状态发送给服务线程。
服务线程固定周期,如100毫秒主动查询应用线程的状态。
具体的,服务线程周期性向应用线程发送查询指令,应用线程接收到查询指令后将表示当前状态的状态码发送给服务线程。所述服务线程根据应用线程响应于所述查询指令发送的状态码,可以确定状态码对应的应用线程的当前状态。
在一些实施方式中,如图2所示,所述应用线程的数目为多个。
所述服务线程周期性向所述应用线程发送查询指令,包括:所述服务线程根据所述多个应用线程的排序,周期性向各所述应用线程发送查询指令。
例如,在100毫秒的周期内,先向应用线程A1发送查询指令,然后向应用线程A2发送查询指令,之后向应用线程A3发送查询指令。可以实现各应用线 程均可周期性的响应查询指令将当前状态发送给服务线程。
本说明书上述实施例提供的控制方法,在应用线程的状态发生变化时,主动将当前状态发送给服务线程;并且服务线程周期性向应用线程查询应用线程的当前状态,因此服务线程可以及时、稳定的获取应用线程的状态。服务线程和应用线程相互协同工作,检测机制更安全、稳定,系统的容错能力更好、健壮性更强。
在一些实施方式中,控制方法还包括:所述服务线程根据所述应用线程发送的监测结果执行任务操作。
示例性的,所述应用线程获取传感器采集到的传感数据,根据所述传感数据获取监测结果,并将监测结果发送给所述服务线程;所述服务线程根据所述监测结果执行任务操作,例如控制无人飞行器飞行或者控制无人飞行器对目标进行跟踪等。
示例性的,服务线程根据应用线程A1确定的飞行高度和/或应用线程A2确定的感兴趣的目标在图像中的位置信息执行任务操作,例如控制无人飞行器如悬停、上升飞行高度、向左飞行等。
在一些实施方式中,控制方法还包括:所述应用线程根据所述查询指令检测所述应用线程与所述服务线程是否处于连接状态。
示例性的,服务线程周期性向所述应用线程发送的查询指令可以充当心跳包的功能,用于判断服务线程和应用线程之间的连接状态。从而可以及时发现与服务线程断开连接的应用线程。
示例性的,若所述应用线程间隔第一预设时长,如0.5秒未接收到所述服务线程发送的查询指令,则判定所述应用线程与所述服务线程不处于连接状态。可以进而判定所述应用线程异常退出。
在一些实施方式中,如图4所示,控制系统的处理器被配置为执行程序指令来实施多线程结构。所述多线程结构包括服务线程、应用线程和守护线程。
示例性的,所示控制方法还包括:守护线程监测所述应用线程是否异常退出;若所述守护线程监测到所述应用线程异常退出,所述守护线程重新启动所述应用线程。
因此,可以保证应用线程的正常运行和应用线程与服务线程之间的连接,提高系统出错的恢复能力和容错能力、健壮性更强。
示例性的,若所述应用线程断开与所述服务线程的连接,所述守护线程判定所述应用线程异常退出。
应用线程与服务线程不处于连接状态时,服务线程无法及时获取应用线程的当前状态,可以判定所述应用线程异常退出。
示例性的,守护线程可以根据应用线程是否长时间未接收到所述服务线程发送的查询指令监测所述应用线程是否异常退出;并在监测到所述应用线程异常退出时,所述守护线程重新启动所述应用线程。
示例性的,若所述应用线程发出报错指令,所述守护线程根据所述报错指令判定所述应用线程异常退出。
应用线程在运行时,如果运行出错则根据预设的规则发出报错指令。守护线程根据报错指令可以判定所述应用线程异常退出,并在监测到所述应用线程异常退出时,所述守护线程重新启动所述应用线程。
在一些实施方式中,如图5所示,控制系统的服务线程包括主服务线程和备用服务线程。
示例性的,当所述主服务线程正常运行时,所述主服务线程根据所述监测结果执行任务操作;当所述主服务线程异常退出时,所述备用服务线程根据所述监测结果执行任务操作。
示例性的,若所述主服务线程正常,所述主服务线程接收所述应用线程发送的当前状态,并根据所述当前状态执行任务操作。
若主服务线程异常退出,所述备用服务线程接收所述应用线程发送的当前状态,并根据所述当前状态执行任务操作。
可以理解的,主服务线程根据应用线程的监测结果作出决策,备用服务线程在主服务线程正常时不做决策。但是在主服务线程异常退出后,备用服务线程转换为主服务线程,以根据应用线程的监测结果作出决策。
示例性的,主服务线程和备用服务线程都可以与应用线程通信,并从应用线程获取应用线程的监测结果,如周期性查询应用线程的监测结果,或者接收应用线程主动上报的监测结果。在主服务线程异常退出后,备用服务线程可以更快的根据应用线程的监测结果作出决策。
示例性的,当主服务线程正常运行时,主服务线程周期性向所述应用线程发送查询指令和/或根据所述应用线程发送的当前状态执行响应操作;当主服务 线程异常退出时,备用服务线程周期性向所述应用线程发送查询指令和/或根据所述应用线程发送的当前状态执行响应操作。
示例性的,主服务线程正常运行时,备用服务线程也可以不从应用线程获取应用线程的当前状态。在主服务线程异常退出后,备用服务线程从应用线程获取应用线程的当前状态,并根据所述当前状态执行响应操作。
在一些实施方式中,控制方法还包括:所述主服务线程周期性向所述备用服务线程发送心跳包;若所述备用服务线程间隔第二预设时长未接收到所述主服务线程发送的心跳包,判定所述主服务线程异常退出。从而可以及时检测到主服务线程异常退出,利于备用服务线程更快的转换为主服务线程。
示例性的,第二预设时长可以与第一预设时长相等,也可以与第一预设时长不相等。
示例性的,若判定所述主服务线程异常退出,创建新的备用服务线程。
具体的,在主服务线程异常退出后,原来的备用服务线程转为主服务线程接收所述应用线程发送的监测结果,并根据所述监测结果执行任务操作。通过创建新的备用服务线程,以在主服务线程异常退出时,所述新的备用服务线程接收所述应用线程发送的监测结果,并根据所述监测结果执行任务操作。
示例性的,若所述备用服务线程异常退出,创建新的备用服务线程。以保持在主服务线程常退出后,会有备用服务线程接替主服务线程根据应用线程的监测结果作出决策。
示例性的,控制方法还包括:所述备用服务线程周期性向所述主服务线程发送心跳包。从而主服务线程可以根据心跳包判断备用服务线程的状态。
示例性的,若所述主服务线程间隔第三预设时长未接收到所述备用服务线程发送的心跳包,判定所述备用服务线程异常退出。
第三预设时长可以与前述的第一预设时长、第二预设时长相同,也可以与第一预设时长、第二预设时长不同。
如果主服务线程过长时间未接收到备用服务线程的心跳包,则判定备用服务线程异常退出,那么主服务线程创建一个新的备用服务线程。以保持在主服务线程常退出后,会有备用服务线程接替主服务线程根据应用线程的监测结果作出决策。
本说明书实施例提供的控制方法,在应用线程的状态发生变化时,主动将 当前状态发送给服务线程;并且服务线程周期性向应用线程查询应用线程的当前状态,因此服务线程可以及时、稳定的获取应用线程的状态。
而且采用了守护线程守护应用线程,在应用线程异常时重新启动所述应用线程;还通过设置备用服务线程,以在主服务线程异常退出后,备用服务线程从应用线程获取应用线程的监测结果,并根据所述监测结果执行任务操作。
从而,服务线程和应用线程相互协同工作,检测机制更安全、稳定,系统的容错能力更好、健壮性更强。在单点的故障情况下,控制系统都能快速的恢复正常工作,提高了控制系统,如可移动平台的“生存率”。
请结合上述实施例参阅图6,图6是本说明书一实施例提供的控制系统600的示意性框图。该控制系统600包括处理器601和存储器602。
示例性的,处理器601和存储器602通过总线603连接,该总线603例如为I2C(Inter-integrated Circuit)总线。
具体地,处理器601可以是微控制单元(Micro-controller Unit,MCU)、中央处理单元(Central Processing Unit,CPU)或数字信号处理器(Digital Signal Processor,DSP)等。
具体地,存储器602可以是Flash芯片、只读存储器(ROM,Read-Only Memory)磁盘、光盘、U盘或移动硬盘等。
其中,所述处理器601用于运行存储在存储器602中的程序指令,并在执行所述程序指令时实现前述的控制方法。
示例性的,所述处理器601被配置为执行所述程序指令来实施多线程结构,所述多线程结构包括服务线程和应用线程;所述多线程结构用于实现:
所述应用线程获取当前状态;
若所述应用线程根据所述当前状态判定状态发生变化,将所述当前状态发送给服务线程;
所述服务线程周期性向所述应用线程发送查询指令,所述应用线程响应于所述查询指令将所述当前状态发送给服务线程。
在一些实施方式中,控制系统还包括至少一个传感器,所述传感器用于获取传感数据。
所述应用线程从所述传感器获取传感数据;以及所述应用线程根据所述传感数据确定当前状态。
在一些实施方式中,所述多线程结构还用于实现:
所述应用线程根据所述查询指令检测所述应用线程与所述服务线程是否处于连接状态。
在一些实施方式中,所述多线程结构还用于实现:
若所述应用线程间隔第一预设时长未接收到所述服务线程发送的查询指令,判定所述应用线程与所述服务线程不处于连接状态。
在一些实施方式中,所述应用线程的数目为多个;
所述服务线程周期性向所述应用线程发送查询指令,包括:
所述服务线程根据所述多个应用线程的排序,周期性向各所述应用线程发送查询指令。
在一些实施方式中,所述多线程结构还用于实现:
守护线程监测所述应用线程是否异常退出;
若所述守护线程监测到所述应用线程异常退出,所述守护线程重新启动所述应用线程。
在一些实施方式中,所述应用线程获取传感器采集到的传感数据,根据所述传感数据获取监测结果,并将监测结果发送给所述服务线程;
所述服务线程根据所述监测结果执行任务操作。
在一些实施方式中,所述服务线程包括主服务线程和备用服务线程:
当所述主服务线程正常运行时,所述主服务线程根据所述监测结果执行任务操作;
当所述主服务线程异常退出时,所述备用服务线程根据所述监测结果执行任务操作。
在一些实施方式中,所述多线程结构还用于实现:
所述主服务线程周期性向所述备用服务线程发送心跳包;
若所述备用服务线程间隔第二预设时长未接收到所述主服务线程发送的心跳包,判定所述主服务线程异常退出。
在一些实施方式中,所述多线程结构还用于实现:
若判定所述主服务线程异常退出,创建新的备用服务线程。
在一些实施方式中,所述多线程结构还用于实现:
若所述备用服务线程异常退出,创建新的备用服务线程。
在一些实施方式中,所述多线程结构还用于实现:
所述备用服务线程周期性向所述主服务线程发送心跳包;
若所述主服务线程间隔第三预设时长未接收到所述备用服务线程发送的心跳包,判定所述备用服务线程异常退出。
具体的,本说明书实施例提供的控制系统的具体原理和实现方式均与前述实施例的控制方法类似,此处不再赘述。
请参阅图7,图7是本说明书一实施例提供的可移动平台700的示意性框图。该可移动平台700包括处理器701和存储器702。
示例性的,处理器701和存储器702通过总线703连接,该总线703比如为I2C(Inter-integrated Circuit)总线。
具体地,处理器701可以是微控制单元(Micro-controller Unit,MCU)、中央处理单元(Central Processing Unit,CPU)或数字信号处理器(Digital Signal Processor,DSP)等。
具体地,存储器702可以是Flash芯片、只读存储器(ROM,Read-Only Memory)磁盘、光盘、U盘或移动硬盘等。
其中,所述处理器701用于运行存储在存储器702中的程序指令,并在执行所述程序指令时实现前述的控制方法。
示例性的,所述处理器701被配置为执行所述程序指令来实施多线程结构,所述多线程结构包括服务线程和应用线程;所述多线程结构用于实现:
所述应用线程获取当前状态;
若所述应用线程根据所述当前状态判定状态发生变化,将所述当前状态发送给服务线程;
所述服务线程周期性向所述应用线程发送查询指令,所述应用线程响应于所述查询指令将所述当前状态发送给服务线程。
在一些实施方式中,可移动平台还包括至少一个传感器,所述传感器用于获取传感数据。
示例性的,可移动平台包括图像传感器、飞行时间(Time of Flight,ToF)传感器、陀螺仪等。
所述应用线程从所述传感器获取传感数据;以及所述应用线程根据所述传感数据确定当前状态。
具体的,本说明书实施例提供的可移动平台的具体原理和实现方式均与前述实施例的控制方法类似,此处不再赘述。
本说明书的实施例中还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序中包括程序指令,所述处理器执行所述程序指令,实现上述实施例提供的控制方法。
其中,所述计算机可读存储介质可以是前述任一实施例所述的控制系统,如可移动平台的内部存储单元,例如所述控制系统的硬盘或内存。所述计算机可读存储介质也可以是所述控制系统的外部存储设备,例如所述控制系统上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。
本说明书上述实施例提供的控制方法、系统、可移动平台和存储介质,在应用线程的状态发生变化时,主动将当前状态发送给服务线程;并且服务线程周期性向应用线程查询应用线程的当前状态,因此服务线程可以及时、稳定的获取应用线程的状态。
而且采用了守护线程守护应用线程,在应用线程异常时重新启动所述应用线程;还通过设置备用服务线程,以在主服务线程异常退出后,备用服务线程从应用线程获取应用线程的当前状态。
从而,服务线程和应用线程相互协同工作,检测机制更安全、稳定,系统的容错能力更好、健壮性更强。在单点的故障情况下,控制系统都能快速的恢复正常工作,提高了控制系统,如可移动平台的“生存率”。
应当理解,在此本说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本说明书。
还应当理解,在本说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。
以上所述,仅为本说明书的具体实施方式,但本说明书的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本说明书揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本说明书的保护范围之内。因此,本说明书的保护范围应以权利要求的保护范围为准。
Claims (38)
- 一种控制方法,其特征在于,包括:应用线程获取当前状态;若所述应用线程根据所述当前状态判定状态发生变化,将所述当前状态发送给服务线程;所述服务线程周期性向所述应用线程发送查询指令,所述应用线程响应于所述查询指令将所述当前状态发送给服务线程。
- 根据权利要求1所述的方法,其特征在于,所述应用线程获取当前状态,包括:所述应用线程获取传感器采集到的传感数据;所述应用线程根据所述传感数据确定当前状态。
- 根据权利要求1所述的方法,其特征在于,还包括:所述应用线程根据所述查询指令检测所述应用线程与所述服务线程是否处于连接状态。
- 根据权利要求3所述的方法,其特征在于,还包括:若所述应用线程间隔第一预设时长未接收到所述服务线程发送的查询指令,判定所述应用线程与所述服务线程不处于连接状态。
- 根据权利要求1所述的方法,其特征在于,所述应用线程的数目为多个;所述服务线程周期性向所述应用线程发送查询指令,包括:所述服务线程根据所述多个应用线程的排序,周期性向各所述应用线程发送查询指令。
- 根据权利要求1-5中任一项所述的方法,其特征在于,还包括:守护线程监测所述应用线程是否异常退出;若所述守护线程监测到所述应用线程异常退出,所述守护线程重新启动所述应用线程。
- 根据权利要求1-6任一项所述的方法,其特征在于,所述应用线程获取传感器采集到的传感数据,根据所述传感数据获取监测结果,并将监测结果发送给所述服务线程;所述服务线程根据所述监测结果执行任务操作。
- 根据权利要求7所述的方法,其特征在于,所述服务线程包括主服务线程和备用服务线程,当所述主服务线程正常运行时,所述主服务线程根据所述监测结果执行任务操作;当所述主服务线程异常退出时,所述备用服务线程根据所述监测结果执行任务操作。
- 根据权利要求8所述的方法,其特征在于,还包括:所述主服务线程周期性向所述备用服务线程发送心跳包;若所述备用服务线程间隔第二预设时长未接收到所述主服务线程发送的心跳包,判定所述主服务线程异常退出。
- 根据权利要求8所述的方法,其特征在于,还包括:若判定所述主服务线程异常退出,创建新的备用服务线程。
- 根据权利要求8-10中任一项所述的方法,其特征在于,还包括:若所述备用服务线程异常退出,创建新的备用服务线程。
- 根据权利要求11所述的方法,其特征在于,还包括:所述备用服务线程周期性向所述主服务线程发送心跳包;若所述主服务线程间隔第三预设时长未接收到所述备用服务线程发送的心跳包,判定所述备用服务线程异常退出。
- 一种控制系统,其特征在于,包括:存储器和处理器,其中,所述存储器,用于存储程序指令;所述处理器,被配置为执行所述程序指令来实施多线程结构,所述多线程结构包括服务线程和应用线程;所述多线程结构用于实现:所述应用线程获取当前状态;若所述应用线程根据所述当前状态判定状态发生变化,将所述当前状态发送给服务线程;所述服务线程周期性向所述应用线程发送查询指令,所述应用线程响应于所述查询指令将所述当前状态发送给服务线程。
- 根据权利要求13所述的控制系统,其特征在于,所述应用线程获取当前状态,包括:所述应用线程获取传感器采集到的传感数据;所述应用线程根据所述传感数据确定当前状态。
- 根据权利要求13所述的控制系统,其特征在于,所述多线程结构还用于实现:所述应用线程根据所述查询指令检测所述应用线程与所述服务线程是否处于连接状态。
- 根据权利要求15所述的控制系统,其特征在于,所述多线程结构还用于实现:若所述应用线程间隔第一预设时长未接收到所述服务线程发送的查询指令,判定所述应用线程与所述服务线程不处于连接状态。
- 根据权利要求13所述的控制系统,其特征在于,所述应用线程的数目为多个;所述服务线程周期性向所述应用线程发送查询指令,包括:所述服务线程根据所述多个应用线程的排序,周期性向各所述应用线程发送查询指令。
- 根据权利要求13-17中任一项所述的控制系统,其特征在于,所述多线程结构还用于实现:守护线程监测所述应用线程是否异常退出;若所述守护线程监测到所述应用线程异常退出,所述守护线程重新启动所述应用线程。
- 根据权利要求13-18任一项所述的控制系统,其特征在于,所述应用线程获取传感器采集到的传感数据,根据所述传感数据获取监测结果,并将监测结果发送给所述服务线程;所述服务线程根据所述监测结果执行任务操作。
- 根据权利要求19所述的控制系统,其特征在于,所述服务线程包括主服务线程和备用服务线程:当所述主服务线程正常运行时,所述主服务线程根据所述监测结果执行任务操作;当所述主服务线程异常退出时,所述备用服务线程根据所述监测结果执行任务操作。
- 根据权利要求20所述的控制系统,其特征在于,所述多线程结构还用于实现:所述主服务线程周期性向所述备用服务线程发送心跳包;若所述备用服务线程间隔第二预设时长未接收到所述主服务线程发送的心跳包,判定所述主服务线程异常退出。
- 根据权利要求20所述的控制系统,其特征在于,所述多线程结构还用于实现:若判定所述主服务线程异常退出,创建新的备用服务线程。
- 根据权利要求20-22中任一项所述的控制系统,其特征在于,所述多线程结构还用于实现:若所述备用服务线程异常退出,创建新的备用服务线程。
- 根据权利要求23所述的控制系统,其特征在于,所述多线程结构还用于实现:所述备用服务线程周期性向所述主服务线程发送心跳包;若所述主服务线程间隔第三预设时长未接收到所述备用服务线程发送的心跳包,判定所述备用服务线程异常退出。
- 一种可移动平台,其特征在于,包括:存储器和处理器,其中,所述存储器,用于存储程序指令;所述处理器,被配置为执行所述程序指令来实施多线程结构,所述多线程结构包括服务线程和应用线程;所述多线程结构用于实现:所述应用线程获取当前状态;若所述应用线程根据所述当前状态判定状态发生变化,将所述当前状态发送给服务线程;所述服务线程周期性向所述应用线程发送查询指令,所述应用线程响应于所述查询指令将所述当前状态发送给服务线程。
- 根据权利要求25所述的可移动平台,其特征在于,还包括至少一个传感器,所述传感器用于获取传感数据;所述应用线程获取当前状态,包括:所述应用线程从所述传感器获取传感数据;所述应用线程根据所述传感数据确定当前状态。
- 根据权利要求25所述的可移动平台,其特征在于,所述多线程结构还用于实现:所述应用线程根据所述查询指令检测所述应用线程与所述服务线程是否处于连接状态。
- 根据权利要求27所述的可移动平台,其特征在于,所述多线程结构还用于实现:若所述应用线程间隔第一预设时长未接收到所述服务线程发送的查询指令,判定所述应用线程与所述服务线程不处于连接状态。
- 根据权利要求25所述的可移动平台,其特征在于,所述应用线程的数目为多个;所述服务线程周期性向所述应用线程发送查询指令,包括:所述服务线程根据所述多个应用线程的排序,周期性向各所述应用线程发送查询指令。
- 根据权利要求25-29中任一项所述的可移动平台,其特征在于,所述多线程结构还用于实现:守护线程监测所述应用线程是否异常退出;若所述守护线程监测到所述应用线程异常退出,所述守护线程重新启动所述应用线程。
- 根据权利要求25-30任一项所述的可移动平台,其特征在于,所述应用线程获取传感器采集到的传感数据,根据所述传感数据获取监测结果,并将监测结果发送给所述服务线程;所述服务线程根据所述监测结果执行任务操作。
- 根据权利要求31所述的可移动平台,其特征在于,所述服务线程包括主服务线程和备用服务线程:当所述主服务线程正常运行时,所述主服务线程根据所述监测结果执行任务操作;当所述主服务线程异常退出时,所述备用服务线程根据所述监测结果执行任务操作。
- 根据权利要求32所述的可移动平台,其特征在于,所述多线程结构还用于实现:所述主服务线程周期性向所述备用服务线程发送心跳包;若所述备用服务线程间隔第二预设时长未接收到所述主服务线程发送的心跳包,判定所述主服务线程异常退出。
- 根据权利要求32所述的可移动平台,其特征在于,所述多线程结构还用于实现:若判定所述主服务线程异常退出,创建新的备用服务线程。
- 根据权利要求32-34中任一项所述的可移动平台,其特征在于,所述多线程结构还用于实现:若所述备用服务线程异常退出,创建新的备用服务线程。
- 根据权利要求35所述的可移动平台,其特征在于,所述多线程结构还用于实现:所述备用服务线程周期性向所述主服务线程发送心跳包;若所述主服务线程间隔第三预设时长未接收到所述备用服务线程发送的心跳包,判定所述备用服务线程异常退出。
- 根据权利要求25所述的可移动平台,其特征在于,其特征在于,所述可移动平台包括如下至少一种:无人飞行器、手持云台、云台车。
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时使所述处理器实现:如权利要求1-12中任一项所述的方法。
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201980031889.0A CN112119381A (zh) | 2019-09-29 | 2019-09-29 | 控制方法、系统、可移动平台和存储介质 |
| PCT/CN2019/108859 WO2021056502A1 (zh) | 2019-09-29 | 2019-09-29 | 控制方法、系统、可移动平台和存储介质 |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2019/108859 WO2021056502A1 (zh) | 2019-09-29 | 2019-09-29 | 控制方法、系统、可移动平台和存储介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2021056502A1 true WO2021056502A1 (zh) | 2021-04-01 |
Family
ID=73798835
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/108859 Ceased WO2021056502A1 (zh) | 2019-09-29 | 2019-09-29 | 控制方法、系统、可移动平台和存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN112119381A (zh) |
| WO (1) | WO2021056502A1 (zh) |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2016186379A1 (ko) * | 2015-05-15 | 2016-11-24 | 주식회사 한글과컴퓨터 | 무인 스마트카용 주차장 운용 장치 및 방법 |
| CN206619024U (zh) * | 2017-03-09 | 2017-11-07 | 华南理工大学 | 一种移动机器人无线集群系统 |
| CN108614543A (zh) * | 2015-04-24 | 2018-10-02 | 深圳市大疆创新科技有限公司 | 用于呈现移动平台的操作信息的方法和装置 |
| CN108762295A (zh) * | 2018-02-09 | 2018-11-06 | 华南理工大学 | 基于软件总线的一体化无人机控制系统 |
| US10281916B1 (en) * | 2016-09-21 | 2019-05-07 | Amazon Technologies, Inc. | Detection of transparent elements using specular reflection |
| US10395543B2 (en) * | 2015-01-22 | 2019-08-27 | Zipline International Inc. | Unmanned aerial vehicle management system |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104601668B (zh) * | 2014-12-24 | 2019-01-18 | 北京京东尚科信息技术有限公司 | 基于状态管理的数据推送方法、装置和系统 |
| CN107465553A (zh) * | 2017-09-01 | 2017-12-12 | 上海斐讯数据通信技术有限公司 | 一种可自动上报路由器状态的方法及系统 |
-
2019
- 2019-09-29 WO PCT/CN2019/108859 patent/WO2021056502A1/zh not_active Ceased
- 2019-09-29 CN CN201980031889.0A patent/CN112119381A/zh active Pending
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10395543B2 (en) * | 2015-01-22 | 2019-08-27 | Zipline International Inc. | Unmanned aerial vehicle management system |
| CN108614543A (zh) * | 2015-04-24 | 2018-10-02 | 深圳市大疆创新科技有限公司 | 用于呈现移动平台的操作信息的方法和装置 |
| WO2016186379A1 (ko) * | 2015-05-15 | 2016-11-24 | 주식회사 한글과컴퓨터 | 무인 스마트카용 주차장 운용 장치 및 방법 |
| US10281916B1 (en) * | 2016-09-21 | 2019-05-07 | Amazon Technologies, Inc. | Detection of transparent elements using specular reflection |
| CN206619024U (zh) * | 2017-03-09 | 2017-11-07 | 华南理工大学 | 一种移动机器人无线集群系统 |
| CN108762295A (zh) * | 2018-02-09 | 2018-11-06 | 华南理工大学 | 基于软件总线的一体化无人机控制系统 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN112119381A (zh) | 2020-12-22 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10715411B1 (en) | Altering networking switch priority responsive to compute node fitness | |
| CN117280327B (zh) | 使用机器学习模型通过近实时/离线数据来检测数据中心大规模中断 | |
| US10693813B1 (en) | Enabling and disabling links of a networking switch responsive to compute node fitness | |
| US11630692B2 (en) | Efficient worker utilization | |
| JP2026076225A (ja) | クラスタコンピューティング環境を修正するための技術 | |
| US8880936B2 (en) | Method for switching application server, management computer, and storage medium storing program | |
| US9772920B2 (en) | Dynamic service fault detection and recovery using peer services | |
| WO2015169199A1 (zh) | 分布式环境下虚拟机异常恢复方法 | |
| CN106445755A (zh) | 一种整机柜服务器自动化测试方法 | |
| WO2021035645A1 (zh) | 传感系统、传感设备及其控制方法、可移动平台和存储介质 | |
| CN104570834B (zh) | 一种激光器及其的错误检测与恢复装置、方法 | |
| US11507444B1 (en) | Platform framework error handling | |
| US20120136970A1 (en) | Computer system and method for managing computer device | |
| CN103888983B (zh) | 终端wifi工作模式自动切换方法和系统 | |
| CN118025210A (zh) | 自动泊车过程中域控制器故障诊断系统、方法、车辆和存储介质 | |
| US9317354B2 (en) | Dynamically determining an external systems management application to report system errors | |
| CN109144314A (zh) | Usb触摸屏的控制方法和装置 | |
| CN105978999A (zh) | 告警方法及装置 | |
| CN117149482A (zh) | 一种对线程状态进行检测的方法和装置、电子设备、介质 | |
| CN104811343A (zh) | 对等网络的网络检测方法和系统 | |
| US20110051194A1 (en) | Image forming apparatus and method thereof | |
| CN112119381A (zh) | 控制方法、系统、可移动平台和存储介质 | |
| US9575865B2 (en) | Information processing system and monitoring method | |
| CN114844807A (zh) | 系统检测方法、装置、设备、存储介质、车辆和云控平台 | |
| CN114594979A (zh) | 资源文件更新方法、装置、存储介质及终端设备 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19946359 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 19946359 Country of ref document: EP Kind code of ref document: A1 |