CN112119381A - Control method, system, movable platform and storage medium - Google Patents

Control method, system, movable platform and storage medium Download PDF

Info

Publication number
CN112119381A
CN112119381A CN201980031889.0A CN201980031889A CN112119381A CN 112119381 A CN112119381 A CN 112119381A CN 201980031889 A CN201980031889 A CN 201980031889A CN 112119381 A CN112119381 A CN 112119381A
Authority
CN
China
Prior art keywords
thread
application
service thread
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.)
Pending
Application number
CN201980031889.0A
Other languages
Chinese (zh)
Inventor
雷云飞
陈庙红
郑伟宏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SZ DJI Technology Co Ltd
Original Assignee
SZ DJI Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SZ DJI Technology Co Ltd filed Critical SZ DJI Technology Co Ltd
Publication of CN112119381A publication Critical patent/CN112119381A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3013Monitoring 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

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

A control method, comprising: the application thread acquires the current state (S110); if the application thread judges that the state changes according to the current state, the current state is sent to the service thread (S120); 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 (S130). The control method solves the technical problems of poor safety and stability and the like of the existing state detection mechanism. Further, a control system, a movable platform and a storage medium are also related.

Description

Control method, system, movable platform and storage medium
Technical Field
The present application relates to the field of embedded system technologies, and in particular, to a control method, a control system, a movable platform, and a storage medium.
Background
With the development of informatization and intelligent technology, monitoring of some states, such as self-checking of a factory production line, detection of products produced by the production line, or self-checking before or during operation of electronic equipment, is required in more and more occasions.
There are usually many sensor devices in the embedded device, for example, the aircraft is a typical embedded device, and many sensors such as an image sensor, a Time of Flight (ToF) sensor, a gyroscope, and the like are integrated. Various sensors are usually provided with a corresponding software sub-module or hardware sub-module for control and detection, so that a plurality of sub-modules exist in an embedded system, and a state system is also needed for detecting and processing the states of the sub-modules; correspondingly, the sub-module may be called Client (application thread), the state system may be called Server (service thread), and the sub-module and the state system perform state detection in Client/Server mode.
However, in the existing method, the submodule can only report the state change to the state system actively when the state of the submodule changes, and the connection between the submodule and the state system is unstable in this way, and the state change may not be fed back to the state system in time. Such detection mechanisms are less secure and less stable.
Disclosure of Invention
Based on this, the present specification provides a control method, a control system, a mobile platform, and a storage medium, and aims to solve the technical problems of poor security and stability of the existing state detection mechanism.
In a first aspect, the present description provides a control method comprising:
the application thread acquires the current state;
if the application thread judges that the state changes according to the current state, the current state is sent to a service thread;
the service thread periodically sends a query instruction to the application thread, and the application thread responds to the query instruction to send the current state to the service thread.
In a second aspect, the present specification provides a control system comprising: a memory and a processor, wherein,
the memory to store program instructions;
the processor configured to execute the program instructions to implement a multi-threaded fabric comprising a service thread and an application thread; the multi-thread structure is used for realizing that:
the application thread acquires a current state;
if the application thread judges that the state changes according to the current state, the current state is sent to a service thread;
the service thread periodically sends a query instruction to the application thread, and the application thread responds to the query instruction to send the current state to the service thread.
In a third aspect, the present specification provides a moveable platform comprising: a memory and a processor, wherein,
the memory to store program instructions;
the processor configured to execute the program instructions to implement a multi-threaded fabric comprising a service thread and an application thread; the multi-thread structure is used for realizing that:
the application thread acquires a current state;
if the application thread judges that the state changes according to the current state, the current state is sent to a service thread;
the service thread periodically sends a query instruction to the application thread, and the application thread responds to the query instruction to send the current state to the service thread.
In a fourth aspect, the present specification provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, causes the processor to carry out the method described above.
The embodiment of the specification provides a control method, a control system, a movable platform and a storage medium, wherein when the state of an application thread changes, the current state is actively sent to a service thread; and the service thread periodically inquires the current state of the application thread from the application thread, so that the service thread can timely and stably acquire the state of the application thread. The service thread and the application thread work cooperatively, so that the detection mechanism is safer and more stable, and the fault-tolerant capability and the robustness of the system are better.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure as claimed.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present disclosure, and it is obvious for those skilled in the art to obtain other drawings based on the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a control method provided in an embodiment of the present disclosure;
FIG. 2 is a schematic block diagram of an embodiment of a control system to which a control method is applied;
FIG. 3 is a schematic diagram of an application thread state machine diagram;
FIG. 4 is a schematic block diagram of another embodiment of a control system to which the control method is applied;
FIG. 5 is a schematic block diagram of yet another embodiment of a control system to which the control method is applied;
FIG. 6 is a schematic block diagram of a control system provided in one embodiment of the present description;
FIG. 7 is a schematic block diagram of a movable platform provided by an embodiment of the present description.
Detailed Description
The technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are some, but not all, of the embodiments of the present disclosure. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present specification without any creative effort belong to the protection scope of the present specification.
The flow diagrams depicted in the figures are merely illustrative and do not necessarily include all of the elements and operations/steps, nor do they necessarily have to be performed in the order depicted. For example, some operations/steps may be decomposed, combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
Some embodiments of the present description will be described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a schematic flow chart of a control method according to an embodiment of the present disclosure. The control method can be applied to a control system and is used for acquiring the state of the system and/or the environment and other processes.
Illustratively, the control system is, for example, an embedded system. An Embedded System (Embedded System) is a computer System Embedded in a mechanical or electrical System and having a specific function and real-time computing performance.
In some embodiments, the control method may be applied to a movable platform. Illustratively, the movable platform includes at least one of: unmanned vehicles, handheld cloud platform, cloud platform truck.
Further, unmanned vehicles can be rotor-type unmanned aerial vehicles, such as quad-rotor unmanned aerial vehicles, hexa-rotor unmanned aerial vehicles, and octa-rotor unmanned aerial vehicles, and also can be fixed-wing unmanned aerial vehicles.
Illustratively, as shown in FIG. 2, the processor of the control system is configured to execute program instructions to implement a multi-threaded architecture. The multi-threaded structure includes a service thread and an application thread.
As shown in fig. 1, the control method of the embodiment of the present specification includes steps S110 to S130.
S110, the application thread acquires the current state.
In some embodiments, the application thread enters a state corresponding to a state machine of the application thread according to input data or sensing data of the sensor, and the state of the application thread may include states of waiting to acquire sensing data of the sensor, processing the sensing data, outputting a monitoring result, suspending, exiting abnormally, and the like, and each state corresponds to a unique state code.
FIG. 3 is a diagram illustrating a state machine diagram of an application thread according to an embodiment.
Illustratively, the application thread acquires sensing data collected by a sensor, and determines a current state according to the sensing data.
In some embodiments, the control system includes one or more input devices, such as a mouse, keyboard, touch screen, or the like. The input device is used to obtain input data from which the control system can determine the state of the system and/or environment.
In some embodiments, as shown in fig. 2, the control system includes one or more sensors. The sensors are used to acquire sensory data from which the control system can determine the state of the system and/or environment.
Exemplary sensors in the control system include resistive sensors, capacitive sensors, inductive sensors, piezoelectric sensors, pyroelectric sensors, impedance sensors, magnetoelectric sensors, piezoelectric sensors, photoelectric sensors, resonant sensors, hall sensors, ultrasonic sensors, isotopic sensors, electrochemical sensors, microwave sensors, ultrasonic sensors, temperature sensors, humidity sensors, gas sensors, pressure sensors, acceleration sensors, ultraviolet sensors, magnetosensitive sensors, magnetoresistive sensors, image sensors, electrical quantity sensors, displacement sensors, pressure sensors, PH sensors, flow sensors, liquid level sensors, immersion sensors, illuminance sensors, differential pressure transmitters, acceleration sensors, displacement sensors, weighing sensors, moisture, At least one of the ranging sensors.
Illustratively, the application thread acquires sensory data from the corresponding sensor and determines a current state based on the sensory data. For example, the application thread may determine that the sensing data has not been received, and the current state may be a state waiting for acquiring the sensing data, and may be a state processing the sensing data when the sensing data has been acquired.
And S120, if the application thread judges that the state changes according to the current state, sending the current state to a service thread.
Illustratively, the application thread determines whether the state changes according to the state code of the state machine corresponding to the current state.
Illustratively, if it is determined that the state has changed, the application thread sends a state code of the current state to the service thread.
Illustratively, the state code includes three fields, wherein one field is used to identify an application thread corresponding to the state code, another field is used to identify the current state of the application thread, and yet another field may represent a value of the current state.
For example, the upper 12 bits of the state code may distinguish up to 4096 application threads, and thus the control system may support up to 4096 application threads; the middle 12 bits of the state code are used for distinguishing the internal states of the application threads, so that 4096 states can be defined for each application thread at most; the lower 6 bits of the state code are used to represent the values of the states, so that each state can take 256 values.
For example, the service thread may determine the current state of the application thread corresponding to the state code according to the state code sent by the application thread when the state changes.
S130, the service thread sends a query instruction to the application thread periodically, and the application thread responds to the query instruction and sends the current state to the service thread.
The service thread actively queries the state of the application thread for a fixed period, such as 100 milliseconds.
Specifically, the service thread periodically sends a query instruction to the application thread, and the application thread sends a state code indicating the current state to the service thread after receiving the query instruction. The service thread can determine the current state of the application thread corresponding to the state code according to the state code sent by the application thread in response to the query instruction.
In some embodiments, as shown in FIG. 2, the number of application threads is multiple.
The service thread periodically sends a query instruction to the application thread, and the query instruction comprises the following steps: and the service thread periodically sends a query instruction to each application thread according to the sequence of the application threads.
For example, a query instruction is sent to application thread A1, then to application thread A2, and then to application thread A3 in a 100 millisecond cycle. The method can realize that each application thread can periodically respond to the query instruction to send the current state to the service thread.
In the control method provided by the above embodiment of the present specification, when the state of an application thread changes, the current state is actively sent to a service thread; and the service thread periodically inquires the current state of the application thread from the application thread, so that the service thread can timely and stably acquire the state of the application thread. The service thread and the application thread work cooperatively, so that the detection mechanism is safer and more stable, and the fault-tolerant capability and the robustness of the system are better.
In some embodiments, the control method further comprises: and the service thread executes task operation according to the monitoring result sent by the application thread.
Illustratively, the application thread acquires sensing data acquired by a sensor, acquires a monitoring result according to the sensing data, and sends the monitoring result to the service thread; and the service thread executes task operation according to the monitoring result, such as controlling the unmanned aerial vehicle to fly or controlling the unmanned aerial vehicle to track a target and the like.
Illustratively, the service thread performs task operations, such as controlling the unmanned aerial vehicle such as hovering, flying at an elevated altitude, flying to the left, etc., based on the flight altitude determined by the application thread a1 and/or the position information of the object of interest in the image determined by the application thread a 2.
In some embodiments, the control method further comprises: and the application thread detects whether the application thread and the service thread are in a connection state according to the query instruction.
For example, the query instruction periodically sent by the service thread to the application thread may serve as a function of the heartbeat packet, and is used for determining the connection state between the service thread and the application thread. Therefore, the application thread disconnected from the service thread can be discovered in time.
For example, if the application thread interval does not receive the query instruction sent by the service thread for 0.5 second for a first preset duration, it is determined that the application thread and the service thread are not in a connected state. The application thread may then be determined to exit abnormally.
In some embodiments, as shown in FIG. 4, the processor of the control system is configured to execute program instructions to implement a multi-threaded architecture. The multi-threaded structure comprises a service thread, an application thread and a daemon thread.
Illustratively, the control method further comprises: monitoring whether the application thread exits abnormally by a daemon thread; and if the daemon thread monitors that the application thread exits abnormally, the daemon thread restarts the application thread.
Therefore, the normal operation of the application thread and the connection between the application thread and the service thread can be ensured, the error recovery capability and the fault tolerance capability of the system are improved, and the robustness is stronger.
For example, if the application thread is disconnected from the service thread, the daemon thread determines that the application thread exits abnormally.
When the application thread and the service thread are not in a connected state, the service thread cannot acquire the current state of the application thread in time, and the abnormal exit of the application thread can be judged.
For example, the daemon thread may monitor whether the application thread exits abnormally according to whether the application thread does not receive the query instruction sent by the service thread for a long time; and when the application thread is monitored to be abnormally exited, the daemon thread restarts the application thread.
For example, if the application thread issues an error reporting instruction, the daemon thread determines that the application thread exits abnormally according to the error reporting instruction.
And when the application thread runs, if the running is wrong, an error reporting instruction is sent out according to a preset rule. And the daemon thread can judge that the application thread abnormally exits according to the error reporting instruction, and when the daemon thread monitors that the application thread abnormally exits, the daemon thread restarts the application thread.
In some embodiments, as shown in FIG. 5, the service threads of the control system include a main service thread and a standby service thread.
Illustratively, when the main service thread runs normally, the main service thread executes task operation according to the monitoring result; and when the main service thread exits abnormally, the standby service thread executes task operation according to the monitoring result.
Illustratively, if the main service thread is normal, the main service thread receives the current state sent by the application thread and executes task operation according to the current state.
And if the main service thread exits abnormally, the standby service thread receives the current state sent by the application thread and executes task operation according to the current state.
It can be understood that the main service thread makes a decision according to the monitoring result of the application thread, and the standby service thread does not make a decision when the main service thread is normal. But after the main service thread exits abnormally, the standby service thread is converted into the main service thread so as to make a decision according to the monitoring result of the application thread.
For example, both the main service thread and the standby 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 receive the monitoring result actively reported by the application thread. After the main service thread exits abnormally, the standby service thread can make a decision according to the monitoring result of the application thread more quickly.
Illustratively, when the main service thread runs normally, the main service thread periodically sends a query instruction to the application thread and/or executes a response operation according to the current state sent by the application thread; when the main service thread exits abnormally, the standby service thread periodically sends a query instruction to the application thread and/or executes response operation according to the current state sent by the application thread.
For example, when the main service thread is running normally, the standby service thread may not obtain the current state of the application thread from the application thread. And after the main service thread exits abnormally, the standby service thread acquires the current state of the application thread from the application thread and executes response operation according to the current state.
In some embodiments, the control method further comprises: the main service thread periodically sends heartbeat packets to the standby service thread; and if the standby service thread does not receive the heartbeat packet sent by the main service thread at a second preset time interval, judging that the main service thread exits abnormally. Therefore, the abnormal exit of the main service thread can be detected in time, and the standby service thread can be converted into the main service thread more quickly.
For example, the second preset time period may be equal to the first preset time period, or may not be equal to the first preset time period.
Illustratively, if the main service thread is determined to be abnormally exited, a new standby service thread is created.
Specifically, after the main service thread exits abnormally, the original standby service thread is switched to the main service thread to receive the monitoring result sent by the application thread, and task operation is executed according to the monitoring result. And creating a new standby service thread, so that when the main service thread exits abnormally, the new standby service thread receives the monitoring result sent by the application thread and executes task operation according to the monitoring result.
Illustratively, if the standby service thread exits abnormally, a new standby service thread is created. So that after the main service thread exits frequently, a standby service thread takes over the main service thread to make a decision according to the monitoring result of the application thread.
Illustratively, the control method further comprises: and the standby service thread periodically sends heartbeat packets to the main service thread. Thus, the main service thread can judge the state of the standby service thread according to the heartbeat packet.
Illustratively, if the heartbeat packet sent by the standby service thread is not received at the interval of the main service thread for a third preset time, it is determined that the standby service thread exits abnormally.
The third preset time period may be the same as the first preset time period and the second preset time period, or may be different from the first preset time period and the second preset time period.
And if the main service thread does not receive the heartbeat packet of the standby service thread for too long time, judging that the standby service thread exits abnormally, and creating a new standby service thread by the main service thread. So that after the main service thread exits frequently, a standby service thread takes over the main service thread to make a decision according to the monitoring result of the application thread.
In the control method provided by the embodiment of the present specification, when the state of an application thread changes, the current state is actively sent to a service thread; and the service thread periodically inquires the current state of the application thread from the application thread, so that the service thread can timely and stably acquire the state of the application thread.
Moreover, a daemon thread is adopted to daemon the application thread, and the application thread is restarted when the application thread is abnormal; and the standby service thread is also arranged, so that after the main service thread exits abnormally, the standby service thread acquires the monitoring result of the application thread from the application thread and executes task operation according to the monitoring result.
Therefore, the service thread and the application thread work cooperatively, the detection mechanism is safer and more stable, and the fault tolerance of the system is better and the robustness is stronger. Under the condition of single-point failure, the control system can quickly recover normal work, and the survival rate of the control system, such as a movable platform, is improved.
Referring to fig. 6 in conjunction with the above embodiments, fig. 6 is a schematic block diagram of a control system 600 according to an embodiment of the present disclosure. The control system 600 includes a processor 601 and a memory 602.
Illustratively, the processor 601 and the memory 602 are coupled by a bus 603, such as an I2C (Inter-integrated Circuit) bus.
Specifically, the Processor 601 may be a Micro-controller Unit (MCU), a Central Processing Unit (CPU), a Digital Signal Processor (DSP), or the like.
Specifically, the Memory 602 may be a Flash chip, a Read-Only Memory (ROM) magnetic disk, an optical disk, a usb disk, or a removable hard disk.
The processor 601 is configured to execute the program instructions stored in the memory 602, and when executing the program instructions, implement the foregoing control method.
Illustratively, the processor 601 is configured to execute the program instructions to implement a multi-threaded architecture comprising a service thread and an application thread; the multi-thread structure is used for realizing that:
the application thread acquires a current state;
if the application thread judges that the state changes according to the current state, the current state is sent to a service thread;
the service thread periodically sends a query instruction to the application thread, and the application thread responds to the query instruction to send the current state to the service thread.
In some embodiments, the control system further comprises at least one sensor for acquiring sensory data.
The application thread acquires sensing data from the sensor; and the application thread determines the current state according to the sensing data.
In some embodiments, the multi-threaded architecture is further configured to implement:
and the application thread detects whether the application thread and the service thread are in a connection state according to the query instruction.
In some embodiments, the multi-threaded architecture is further configured to implement:
and if the application thread does not receive the query instruction sent by the service thread at a first preset time interval, judging that the application thread and the service thread are not in a connection state.
In some embodiments, the number of application threads is multiple;
the service thread periodically sends a query instruction to the application thread, and the query instruction comprises the following steps:
and the service thread periodically sends a query instruction to each application thread according to the sequence of the application threads.
In some embodiments, the multi-threaded architecture is further configured to implement:
monitoring whether the application thread exits abnormally by a daemon thread;
and if the daemon thread monitors that the application thread exits abnormally, the daemon thread restarts the application thread.
In some embodiments, the application thread acquires sensing data acquired by a sensor, acquires a monitoring result according to the sensing data, and sends the monitoring result to the service thread;
and the service thread executes task operation according to the monitoring result.
In some embodiments, the service threads include a main service thread and a standby service thread:
when the main service thread runs normally, the main service thread executes task operation according to the monitoring result;
and when the main service thread exits abnormally, the standby service thread executes task operation according to the monitoring result.
In some embodiments, the multi-threaded architecture is further configured to implement:
the main service thread periodically sends heartbeat packets to the standby service thread;
and if the standby service thread does not receive the heartbeat packet sent by the main service thread at a second preset time interval, judging that the main service thread exits abnormally.
In some embodiments, the multi-threaded architecture is further configured to implement:
and if the main service thread is judged to be abnormally exited, a new standby service thread is created.
In some embodiments, the multi-threaded architecture is further configured to implement:
and if the standby service thread exits abnormally, creating a new standby service thread.
In some embodiments, the multi-threaded architecture is further configured to implement:
the standby service thread periodically sends heartbeat packets to the main service thread;
and if the main service thread does not receive the heartbeat packet sent by the standby service thread at a third preset time interval, judging that the standby service thread exits abnormally.
Specifically, the specific principle and implementation manner of the control system provided in the embodiment of this specification are similar to those of the control method in the foregoing embodiment, and are not described here again.
Referring to fig. 7, fig. 7 is a schematic block diagram of a movable platform 700 according to an embodiment of the present disclosure. The movable platform 700 includes a processor 701 and a memory 702.
Illustratively, the processor 701 and the memory 702 are connected by a bus 703, such as an I2C (Inter-integrated Circuit) bus.
Specifically, the Processor 701 may be a Micro-controller Unit (MCU), a Central Processing Unit (CPU), a Digital Signal Processor (DSP), or the like.
Specifically, the Memory 702 may be a Flash chip, a Read-Only Memory (ROM) magnetic disk, an optical disk, a usb disk, or a removable hard disk.
The processor 701 is configured to run program instructions stored in the memory 702, and implement the aforementioned control method when executing the program instructions.
Illustratively, the processor 701 is configured to execute the program instructions to implement a multi-threaded architecture comprising a service thread and an application thread; the multi-thread structure is used for realizing that:
the application thread acquires a current state;
if the application thread judges that the state changes according to the current state, the current state is sent to a service thread;
the service thread periodically sends a query instruction to the application thread, and the application thread responds to the query instruction to send the current state to the service thread.
In some embodiments, the movable platform further comprises at least one sensor for acquiring sensory data.
Illustratively, the movable platform includes an image sensor, a Time of Flight (ToF) sensor, a gyroscope, and the like.
The application thread acquires sensing data from the sensor; and the application thread determines the current state according to the sensing data.
Specifically, the specific principle and implementation manner of the movable platform provided in the embodiments of this specification are similar to those of the control method in the foregoing embodiments, and are not described here again.
In an embodiment of the present specification, a computer-readable storage medium is further provided, where a computer program is stored in the computer-readable storage medium, the computer program includes program instructions, and the processor executes the program instructions to implement the control method provided in the foregoing embodiment.
The computer readable storage medium may be the control system according to any of the foregoing embodiments, such as an internal storage unit of a removable platform, for example, a hard disk or a 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, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the control system.
In the control method, the control system, the mobile platform and the storage medium provided by the above embodiments of the present specification, when the state of the application thread changes, the current state is actively sent to the service thread; and the service thread periodically inquires the current state of the application thread from the application thread, so that the service thread can timely and stably acquire the state of the application thread.
Moreover, a daemon thread is adopted to daemon the application thread, and the application thread is restarted when the application thread is abnormal; and the standby service thread is also set, so that after the main service thread exits abnormally, the standby service thread acquires the current state of the application thread from the application thread.
Therefore, the service thread and the application thread work cooperatively, the detection mechanism is safer and more stable, and the fault tolerance of the system is better and the robustness is stronger. Under the condition of single-point failure, the control system can quickly recover normal work, and the survival rate of the control system, such as a movable platform, is improved.
It is to be understood that the terminology used in the description herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the description.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
The above description is only for the specific embodiments of the present disclosure, but the scope of the present disclosure is not limited thereto, and any person skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the present disclosure, and these modifications or substitutions should be covered within the scope of the present disclosure. Therefore, the protection scope of the present specification shall be subject to the protection scope of the claims.

Claims (38)

1. A control method, comprising:
the application thread acquires the current state;
if the application thread judges that the state changes according to the current state, the current state is sent to a service thread;
the service thread periodically sends a query instruction to the application thread, and the application thread responds to the query instruction to send the current state to the service thread.
2. The method of claim 1, wherein obtaining the current state by the application thread comprises:
the application thread acquires sensing data acquired by a sensor;
and the application thread determines the current state according to the sensing data.
3. The method of claim 1, further comprising:
and the application thread detects whether the application thread and the service thread are in a connection state according to the query instruction.
4. The method of claim 3, further comprising:
and if the application thread does not receive the query instruction sent by the service thread at a first preset time interval, judging that the application thread and the service thread are not in a connection state.
5. The method of claim 1, wherein the number of application threads is plural;
the service thread periodically sends a query instruction to the application thread, and the query instruction comprises the following steps:
and the service thread periodically sends a query instruction to each application thread according to the sequence of the application threads.
6. The method according to any one of claims 1-5, further comprising:
monitoring whether the application thread exits abnormally by a daemon thread;
and if the daemon thread monitors that the application thread exits abnormally, the daemon thread restarts the application thread.
7. The method according to any one of claims 1 to 6, wherein the application thread acquires sensing data acquired by a sensor, acquires a monitoring result according to the sensing data, and sends the monitoring result to the service thread;
and the service thread executes task operation according to the monitoring result.
8. The method of claim 7, wherein the service threads comprise a main service thread and a standby service thread,
when the main service thread runs normally, the main service thread executes task operation according to the monitoring result;
and when the main service thread exits abnormally, the standby service thread executes task operation according to the monitoring result.
9. The method of claim 8, further comprising:
the main service thread periodically sends heartbeat packets to the standby service thread;
and if the standby service thread does not receive the heartbeat packet sent by the main service thread at a second preset time interval, judging that the main service thread exits abnormally.
10. The method of claim 8, further comprising:
and if the main service thread is judged to be abnormally exited, a new standby service thread is created.
11. The method according to any one of claims 8-10, further comprising:
and if the standby service thread exits abnormally, creating a new standby service thread.
12. The method of claim 11, further comprising:
the standby service thread periodically sends heartbeat packets to the main service thread;
and if the main service thread does not receive the heartbeat packet sent by the standby service thread at a third preset time interval, judging that the standby service thread exits abnormally.
13. A control system, comprising: a memory and a processor, wherein,
the memory to store program instructions;
the processor configured to execute the program instructions to implement a multi-threaded fabric comprising a service thread and an application thread; the multi-thread structure is used for realizing that:
the application thread acquires a current state;
if the application thread judges that the state changes according to the current state, the current state is sent to a service thread;
the service thread periodically sends a query instruction to the application thread, and the application thread responds to the query instruction to send the current state to the service thread.
14. The control system of claim 13, wherein the application thread obtaining the current state comprises:
the application thread acquires sensing data acquired by a sensor;
and the application thread determines the current state according to the sensing data.
15. The control system of claim 13, wherein the multithreading structure is further configured to implement:
and the application thread detects whether the application thread and the service thread are in a connection state according to the query instruction.
16. The control system of claim 15, wherein the multithreading structure is further configured to implement:
and if the application thread does not receive the query instruction sent by the service thread at a first preset time interval, judging that the application thread and the service thread are not in a connection state.
17. The control system according to claim 13, wherein the number of the application threads is plural;
the service thread periodically sends a query instruction to the application thread, and the query instruction comprises the following steps:
and the service thread periodically sends a query instruction to each application thread according to the sequence of the application threads.
18. The control system of any one of claims 13-17, wherein the multithreading structure is further configured to implement:
monitoring whether the application thread exits abnormally by a daemon thread;
and if the daemon thread monitors that the application thread exits abnormally, the daemon thread restarts the application thread.
19. The control system according to any one of claims 13 to 18, wherein the application thread acquires sensing data acquired by a sensor, acquires a monitoring result according to the sensing data, and sends the monitoring result to the service thread;
and the service thread executes task operation according to the monitoring result.
20. The control system of claim 19, wherein the service threads comprise a main service thread and a standby service thread:
when the main service thread runs normally, the main service thread executes task operation according to the monitoring result;
and when the main service thread exits abnormally, the standby service thread executes task operation according to the monitoring result.
21. The control system of claim 20, wherein the multithreading structure is further configured to implement:
the main service thread periodically sends heartbeat packets to the standby service thread;
and if the standby service thread does not receive the heartbeat packet sent by the main service thread at a second preset time interval, judging that the main service thread exits abnormally.
22. The control system of claim 20, wherein the multithreading structure is further configured to implement:
and if the main service thread is judged to be abnormally exited, a new standby service thread is created.
23. The control system of any one of claims 20-22, wherein the multithreading structure is further configured to implement:
and if the standby service thread exits abnormally, creating a new standby service thread.
24. The control system of claim 23, wherein the multithreading structure is further configured to implement:
the standby service thread periodically sends heartbeat packets to the main service thread;
and if the main service thread does not receive the heartbeat packet sent by the standby service thread at a third preset time interval, judging that the standby service thread exits abnormally.
25. A movable platform, comprising: a memory and a processor, wherein,
the memory to store program instructions;
the processor configured to execute the program instructions to implement a multi-threaded fabric comprising a service thread and an application thread; the multi-thread structure is used for realizing that:
the application thread acquires a current state;
if the application thread judges that the state changes according to the current state, the current state is sent to a service thread;
the service thread periodically sends a query instruction to the application thread, and the application thread responds to the query instruction to send the current state to the service thread.
26. The movable platform of claim 25, further comprising at least one sensor for acquiring sensory data;
the application thread obtaining the current state comprises:
the application thread acquires sensing data from the sensor;
and the application thread determines the current state according to the sensing data.
27. The movable platform of claim 25, wherein the multi-threaded architecture is further configured to implement:
and the application thread detects whether the application thread and the service thread are in a connection state according to the query instruction.
28. The movable platform of claim 27, wherein the multithreading structure is further configured to implement:
and if the application thread does not receive the query instruction sent by the service thread at a first preset time interval, judging that the application thread and the service thread are not in a connection state.
29. The movable platform of claim 25, wherein the number of application threads is plural;
the service thread periodically sends a query instruction to the application thread, and the query instruction comprises the following steps:
and the service thread periodically sends a query instruction to each application thread according to the sequence of the application threads.
30. The movable platform of any one of claims 25-29, wherein the multithreading structure is further configured to implement:
monitoring whether the application thread exits abnormally by a daemon thread;
and if the daemon thread monitors that the application thread exits abnormally, the daemon thread restarts the application thread.
31. The movable platform according to any one of claims 25-30, wherein the application thread acquires sensing data collected by a sensor, acquires a monitoring result according to the sensing data, and sends the monitoring result to the service thread;
and the service thread executes task operation according to the monitoring result.
32. The movable platform of claim 31, wherein the service threads comprise a main service thread and a standby service thread:
when the main service thread runs normally, the main service thread executes task operation according to the monitoring result;
and when the main service thread exits abnormally, the standby service thread executes task operation according to the monitoring result.
33. The movable platform of claim 32, wherein the multi-threaded architecture is further configured to implement:
the main service thread periodically sends heartbeat packets to the standby service thread;
and if the standby service thread does not receive the heartbeat packet sent by the main service thread at a second preset time interval, judging that the main service thread exits abnormally.
34. The movable platform of claim 32, wherein the multi-threaded architecture is further configured to implement:
and if the main service thread is judged to be abnormally exited, a new standby service thread is created.
35. The movable platform of any one of claims 32-34, wherein the multithreading structure is further configured to implement:
and if the standby service thread exits abnormally, creating a new standby service thread.
36. The movable platform of claim 35, wherein the multithreading structure is further configured to implement:
the standby service thread periodically sends heartbeat packets to the main service thread;
and if the main service thread does not receive the heartbeat packet sent by the standby service thread at a third preset time interval, judging that the standby service thread exits abnormally.
37. The movable platform of claim 25, wherein the movable platform comprises at least one of: unmanned vehicles, handheld cloud platform, cloud platform truck.
38. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, causes the processor to implement:
the method of any one of claims 1-12.
CN201980031889.0A 2019-09-29 2019-09-29 Control method, system, movable platform and storage medium Pending CN112119381A (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/108859 WO2021056502A1 (en) 2019-09-29 2019-09-29 Control method and system, movable platform and storage medium

Publications (1)

Publication Number Publication Date
CN112119381A true CN112119381A (en) 2020-12-22

Family

ID=73798835

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201980031889.0A Pending CN112119381A (en) 2019-09-29 2019-09-29 Control method, system, movable platform and storage medium

Country Status (2)

Country Link
CN (1) CN112119381A (en)
WO (1) WO2021056502A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104601668A (en) * 2014-12-24 2015-05-06 北京京东尚科信息技术有限公司 State management based data push method, device and system
CN206619024U (en) * 2017-03-09 2017-11-07 华南理工大学 A kind of mobile robot wireless clustered system
CN107465553A (en) * 2017-09-01 2017-12-12 上海斐讯数据通信技术有限公司 A kind of method and system that can report router state automatically

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9489852B1 (en) * 2015-01-22 2016-11-08 Zipline International Inc. Unmanned aerial vehicle management system
JP6657498B2 (en) * 2015-04-24 2020-03-04 エスゼット ディージェイアイ テクノロジー カンパニー リミテッドSz Dji Technology Co.,Ltd Method, apparatus, and computer program for presenting operational information of a mobile platform
KR101675885B1 (en) * 2015-05-15 2016-11-15 주식회사 한글과컴퓨터 Method and system for operating parkingspace autonomous smart car
US10281916B1 (en) * 2016-09-21 2019-05-07 Amazon Technologies, Inc. Detection of transparent elements using specular reflection
CN108762295B (en) * 2018-02-09 2021-12-21 华南理工大学 Integrated unmanned aerial vehicle control system based on software bus

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104601668A (en) * 2014-12-24 2015-05-06 北京京东尚科信息技术有限公司 State management based data push method, device and system
CN206619024U (en) * 2017-03-09 2017-11-07 华南理工大学 A kind of mobile robot wireless clustered system
CN107465553A (en) * 2017-09-01 2017-12-12 上海斐讯数据通信技术有限公司 A kind of method and system that can report router state automatically

Also Published As

Publication number Publication date
WO2021056502A1 (en) 2021-04-01

Similar Documents

Publication Publication Date Title
CN105095001B (en) Virtual machine abnormal restoring method under distributed environment
KR101944873B1 (en) Method for checking whether hardware of intelligent terminal runs abnormally and intelligent terminal
CN112015599B (en) Method and apparatus for error recovery
US20150220411A1 (en) System and method for operating system agnostic hardware validation
US10318392B2 (en) Management system for virtual machine failure detection and recovery
JP2011022934A (en) Electronic control unit and method for detecting failure
CN104239548A (en) Database disaster recovery system and database disaster recovery method
US11020853B2 (en) Robot, method for controlling motion of a robot and non-transitory readable medium
US20190361764A1 (en) Redundant processor architecture
US10102088B2 (en) Cluster system, server device, cluster system management method, and computer-readable recording medium
CN107291589B (en) Method for improving system reliability in robot operating system
CN106201439B (en) A kind of method and device of abnormality processing
WO2016036383A1 (en) Backup power and load discovery
CN117149482A (en) Method and device for detecting thread state, electronic equipment and medium
CN109709849B (en) Method and device for controlling safe operation of single chip microcomputer
KR102213676B1 (en) Terminal apparatus for autosar system with arithmetic operation supervision function and arithmetic operation supervision method of autosar system
US20130198575A1 (en) System error response
CN112119381A (en) Control method, system, movable platform and storage medium
KR102438148B1 (en) Abnormality detection apparatus, system and method for detecting abnormality of embedded computing module
US10176142B2 (en) Techniques of accessing BMC terminals through serial port
US9176830B2 (en) Method for determining software error in virtualization based integrated control system
CN103678095A (en) Warning detection method
JP6984119B2 (en) Monitoring equipment, monitoring programs, and monitoring methods
CN105337803B (en) A kind of loop system connection parallel off detection method
CN109144314A (en) The control method and device of USB touch screen

Legal Events

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