A general design method for UAV time series data playback based on finite state machine

By designing the drone replayer as a finite state machine model, the problems of complex state transition and event response logic are solved, the versatility and maintainability of the replayer are achieved, the development and version management costs are reduced, and the data formats of different drone models are adapted.

CN119888884BActive Publication Date: 2025-09-23THE 54TH RESEARCH INSTITUTE OF CHINA ELECTRONICS TECHNOLOGY GROUP CORPORATION +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411836864.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-09-23
Estimated Expiration
2044-12-13

AI Technical Summary

Technical Problem

In the existing drone ground station playback device design, the state transition and event response logic are complex, resulting in complex business behavior coupling, difficulty in expansion and maintenance, and poor compatibility and security of different data formats.

Method used

Using a finite state machine-based approach, the replayer is abstracted into a finite state machine model, defining the total number of states, basic actions, and state transition conditions to form a structured logical framework, including ready, running, and suspended states and their corresponding event processing, to achieve clear definition and isolation of state transitions and event responses.

Benefits of technology

It improves the versatility and maintainability of the player, reduces development and version management costs, adapts to the data formats of different drone models, and realizes polymorphic modularization and agile development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119888884B_ABST
    Figure CN119888884B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of unmanned aerial vehicle measurement and control and communication link data mining, and in particular to a general design method for a finite state machine-based unmanned aerial vehicle time series data replayer in the research and development of unmanned aerial vehicle ground stations. The design method includes two design elements: a finite state machine model and a structured logic framework, and is applicable to unmanned aerial vehicle ground stations and computer technology application fields. The finite state machine model in this design method clearly defines and decouples the various behaviors and states of the replayer; the structured logic framework describes the general interface and core logic of the replayer, wherein the custom data decoding module can polymorphically implement playback data files of different formats in a loosely coupled manner. This design method ensures the security, maintainability and scalability of the replayer program.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of UAV measurement and control and communication link data mining, and in particular to a general design method for a UAV timing data replayer based on a finite state machine in the research and development of a UAV ground station. Background Art

[0002] The drone ground station is a crucial component of the drone system. The data management module is responsible for recording multi-source time-series data transmitted and processed by the station's terminal devices and various host computer software into files (also known as playback data files). After the flight mission is completed, the time-series data replay module (replayer) reads and replays the data, aligning the time and recreating the data-driven mission scene. In existing replayer designs, state transition conditions and event response logic are often interspersed throughout the code, making the replayer's business behavior coupling complex and difficult to scale and maintain.

[0003] In response to the above difficulties, the present invention proposes a general design method for a UAV time series data replay device based on a finite state machine mechanism, which has not been reported in current literature and is an innovative invention. Summary of the Invention

[0004] In light of this, the present invention proposes a universal design method for a UAV time-series data replayer based on a finite state machine, adaptable to diverse data playback scenarios. This method abstracts the behavior and state of a time-series data replayer into a finite state machine, encapsulating the common logic of the replayer's functions in a typical ground station system. It also exposes the replayer's behavioral interface in different states, enabling efficient polymorphic implementation for various ground stations. This addresses the complex state transition and event response logic, low security, and poor compatibility and maintainability of traditional replayers.

[0005] The technical solution adopted by the present invention is:

[0006] A general design method for a UAV time series data replay device based on a finite state machine includes the following steps:

[0007] (1) Based on the actual business of the data management function module, the replay device is abstracted into a finite state machine model, and the total number of states of the replay device, the basic actions and the trigger conditions of state transitions, and the response actions are determined to form a state machine model diagram;

[0008] (2) Based on the state machine model diagram, the functional entities and function interfaces that the replay needs to create and the relationships between them are depicted to form a structured logical framework. The structured logical framework generally describes the behavioral activities of the replay, including state transitions and event responses.

[0009] Furthermore, the state machine model diagram includes three basic states: Runnable, Running, and Suspend, as well as basic internal actions, and four basic state transition events: start, pause, stop, and shutdown.

[0010] (1.1) Ready state Runnable contains two basic actions:

[0011] do, indicating that when entering this state, the system waits for the user to select the playback data file to be processed; FileSelection, indicating that when the user selects the playback data file event, the data decoding module entity of the corresponding data format is created and initialized. The initialization process includes setting the playback data file pointer of the data decoding module entity to point to the current playback data file, calling the playback file parsing interface, extracting and saving the data in the playback data file in the time series data table format;

[0012] In the ready state Runnable responds to the two basic state transition events of start and shutdown:

[0013] Start means that after receiving the start event in this state, the start action in this state is triggered, and then the state is transferred to the Running state; Shutdown means that after receiving the shutdown signal in this state, the shutdown action in this state is triggered, and then the state machine stops working;

[0014] (1.2) The running state Running contains one basic action:

[0015] do, indicating that in this state, the data reading thread is started and the data decoding module entity is loaded in the corresponding thread. When the playback data file pointer is not empty, that is, it has not moved to the end of the playback data file, the data reading thread continues to call the time series data acquisition interface, inputs time information according to the time sequence, obtains the time series data frame index and frame length, moves the playback data file pointer, reads and outputs the time series data frame; when the playback data file pointer is empty, the current state is automatically migrated to the ready state Runnable;

[0016] In the Running state, respond to the three basic state transition events of pause, stop, and shutdown:

[0017] pause, which means that after receiving a pause signal in this state, the pause action in this state is triggered, and then the state is transferred to the suspended state Suspend; stop, which means that after receiving an end signal in this state, the end action in this state is triggered, and then the state is transferred to the ready state Runnable; shutdown, which means that after receiving a shutdown signal in this state, the shutdown action in this state is triggered, and then the state machine stops working;

[0018] (1.3) The Suspend state contains one basic action:

[0019] do, indicating that in this state, the data reading thread is continuously suspended;

[0020] In the Suspend state, respond to the two basic state transition events of start and shutdown:

[0021] Start means that after receiving the start event in this state, the start action in this state is triggered, and then the state is migrated to the running state. Shutdown means that after receiving the shutdown signal in this state, the shutdown action in this state is triggered, and then the state machine stops working.

[0022] Furthermore, the structured logic framework includes: an event parent class Event and four child event classes Start, Stop, Pause, and Shutdown; a state parent class State and three state subclasses Runnable, Running, and Suspend; a functional interface Action; and a data decoding module Decoder;

[0023] Construct the state machine entity of the player, where:

[0024] Each State subclass entity uses the do method to perform basic actions when entering its own state, and custom methods to perform other necessary basic actions;

[0025] Each state subclass entity contains an "event-action" mapping table. When creating, the "event-action" entity key-value pair is added to the mapping table through the "add event action" method;

[0026] Each state entity responds to the received event entity through the "response event" method. If the "event-action" mapping table contains the "key" of the corresponding event, the corresponding "value", that is, the action entity, is retrieved and the "event action" method of the action entity is executed.

[0027] The data decoding module contains a playback data file pointer and provides a unified playback file parsing interface and a time series data acquisition interface to the outside world. The playback file parsing interface is customized by the user according to the playback data format of different drone models. It is used to extract time information, time series data frame index position and time series data frame length from the selected playback data file in the corresponding format and save them to the time series data table; the time series data acquisition interface is used to query the index position and data frame length of the corresponding time series data frame in the file from the time series data table based on the input time information, and move the playback data file pointer to the corresponding index position to extract data of the corresponding length and return it to the caller.

[0028] Furthermore, the do method and custom method of the state subclass entity specifically include:

[0029] The "do" method of the Runnable entity in the ready state executes the action of waiting for the user to select the playback data file to be processed. The action executed by the "select file" method is to create and initialize the data decoding module entity corresponding to the data format when the user selects the playback data file event. The initialization work includes pointing the playback data file pointer of the data decoding module entity to the current playback data file, calling the playback file parsing interface, extracting and saving the data in the playback data file in the time series data table format;

[0030] The running state of the entity is Running. The action executed by the do method is to start the data reading thread and load the data decoding module entity in the corresponding thread. When the playback data file pointer is not empty, that is, it has not moved to the end of the playback data file, the data thread continues to call the time series data acquisition interface, inputs time information according to the time sequence, obtains the time series data frame index and frame length, moves the playback data file pointer, reads and outputs the time series data frame; when the playback data file pointer is empty, it automatically migrates from the current state to the ready state Runnable;

[0031] The Suspend state entity, the action performed by the do method is to continuously suspend the data reading thread.

[0032] Furthermore, the specific contents of adding and executing the "event-action" entity include:

[0033] When creating a Runnable entity in the ready state, add the Start event entity and action through the "Add Event Action" method. That is, receiving the Start event will trigger the start action in this state, and then the state will migrate to the Running state; the Shutdown event entity and action, that is, receiving the Shutdown event will trigger the shutdown action in this state, and then the state machine will stop working;

[0034] When creating a Running state entity, add the Pause event entity and its action through the "Add Event Action" method. That is, receiving the Pause event will trigger the Pause action in this state, and then the state will migrate to the Suspended state; the End event entity and action, that is, receiving the Stop event will trigger the End action in this state, and then the state will migrate to the Ready state; the Shutdown event entity and action, that is, receiving the Shutdown event will trigger the Shutdown action in this state, and then the state machine will stop working;

[0035] When creating the Suspend state Suspend entity, the start event Start entity and action are added through the "Add Event Action" method, that is, receiving the Start event will trigger the start action in this state, and then the state will migrate to the Running state; the shutdown event Shutdown entity and action, that is, receiving the Shutdown event will trigger the shutdown action in this state, and then the state machine will stop working.

[0036] The present invention adopts the above technical solution, which has the following technical effects compared with the prior art:

[0037] This invention solves the problems of poor versatility and high development and version management costs. Different ground station subsystems have different data interfaces and different data management modules have different functions, resulting in playback data with different data structures. These playback devices need to be read and played back by different players. The lack of unified technical standards among these players leads to high development and version management costs.

[0038] The present invention clearly defines and isolates various states and business logics of a player based on the design of a finite state machine, thereby improving the security of the program.

[0039] The structured logical framework of the present invention can easily adapt to the playback data formats of different drone models, solving the high development and version management costs of the playback device due to the lack of unified data formats and technical standards. It also has polymorphic modularity that is independent of the programming language, realizing universal adaptation and low-cost expansion, achieving the purpose of agile development, and improving maintainability. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 Schematic flow chart of the method of the present invention.

[0041] Figure 2 This is a finite state machine model diagram of the player implemented by the method of the present invention.

[0042] Figure 3 It is a structured logical framework diagram of the player implemented by the method of the present invention.

[0043] Figure 4It is a time series data table implemented by the method of the present invention. DETAILED DESCRIPTION

[0044] The present invention will be further described below with reference to the accompanying drawings.

[0045] Figure 1 This paper presents a general design method for a UAV time series data replay device based on a finite state machine, which specifically includes the following design processes:

[0046] : According to the actual business of the data management function module, the replay device is abstracted into a finite state machine model, and the total number of states, basic actions, trigger conditions for state transitions, and response actions of the replay device are clarified to form a state machine model diagram.

[0047] The state machine model diagram is as follows Figure 2 As shown in the figure, the content includes three basic states: Runnable, Running, and Suspend, as well as the basic actions within them, and four basic state transition events: start, pause, stop, and shutdown. Among them:

[0048] (1.1) The ready state includes the following two basic actions:

[0049] do, indicating that when entering this state, the system waits for the user to select the playback data file to be processed;

[0050] FileSelection indicates that when a user selects a playback data file event, a data decoding module entity corresponding to the data format is created and initialized. The initialization work includes setting the playback data file pointer of the data decoding module entity to point to the current playback data file, calling the playback file parsing interface, and extracting and saving the data in the playback data file in the time series data table format.

[0051] In the ready state, respond to the two basic state transition events of start and shutdown:

[0052] Start: After receiving the start event in this state, the start action in this state is triggered, and then the state transitions to the running state.

[0053] shutdown, indicating that a shutdown signal is received in this state, which triggers the shutdown action in this state, and the state machine stops working.

[0054] (1.2) The running state includes the following basic actions:

[0055] do, indicating that in this state, the data reading thread is started and the data decoding module entity is loaded in the corresponding thread. When the playback data file pointer is not empty (that is, it has not moved to the end of the playback data file), the data thread continues to call the time series data acquisition interface, inputs time information according to the time sequence, obtains the time series data frame index and frame length, moves the playback data file pointer, reads and outputs the time series data frame; when the playback data file pointer is empty, it automatically migrates from the current state to the ready state Runnable.

[0056] In the Running state, respond to the three basic state transition events of pause, stop, and shutdown:

[0057] Pause means that a pause signal is received in this state, which triggers the pause action in this state and the state transitions to the Suspend state.

[0058] stop, indicating that an end signal is received in this state, which triggers the end action in this state and the state transitions to the ready state Runnable;

[0059] shutdown, indicating that a shutdown signal is received in this state, which triggers the shutdown action in this state, and the state machine stops working.

[0060] (1.3) The Suspend state includes one of the following basic actions:

[0061] do, indicating that in this state, the data reading thread is continuously suspended.

[0062] In the suspended state, respond to the two basic state transition events of start and shutdown:

[0063] Start: indicates that a start event is received in this state, which triggers the start action in this state and the state transitions to the Running state.

[0064] shutdown, indicating that a shutdown signal is received in this state, which triggers the shutdown action in this state, and the state machine stops working.

[0065] (2): Based on the state machine model diagram, the functional entities and function interfaces that the replay needs to create and the relationship between them are depicted to form a structured logical framework. This framework does not specifically point to a specific replay, but generally describes the state transition, event response and other behavioral activities of the replay.

[0066] like Figure 3As shown in the figure, the structured logic framework includes an event parent class Event and its four child event classes Start, Stop, Pause, and Shutdown, a state parent class State and its three state child classes Runnable, Running, and Suspend, a functional interface Action, and a data decoding module Decoder. These are used to build the state machine entity of the player, where:

[0067] (2.1) Each State subclass entity uses the do method to perform the basic actions to be performed when entering its own state, as well as custom methods to perform other necessary basic actions;

[0068] (2.2) Each state subclass entity contains an "Event-Action" mapping table (mapEventAction). When creating, the "Event-Action" entity key-value pair is added to the mapping table through the "AddEventAction" method;

[0069] (2.3) Each state entity responds to the received event entity through the "response event" method. If its "event-action" mapping table contains the "key" of the event, it retrieves the corresponding "value", that is, the action entity, and executes the "event action" method of the action entity;

[0070] (2.4) The data decoding module Decoder contains a playback data file pointer (pFile) and provides a unified playback file parsing interface (paringData method) and time series data acquisition interface (readData method) to the outside. The playback file parsing interface is customized by the user according to the playback data format of different drone models. It is responsible for extracting the time information, time series data frame index position and the time series data frame length from the selected playback data file according to its format and saving it to the time series data table (see Figure 4 ); The time series data acquisition interface is responsible for querying the index position of the corresponding time series data frame in the file and the length of the data frame from the time series data table based on the input time information, and moving the playback data file pointer to the index position, extracting the data of that length and returning it to the caller.

[0071] Furthermore, in the structured logic framework of the present invention, the do method and custom method of the state entity described in (2.1) specifically include:

[0072] The Runnable entity in the ready state has its do method executing the action of waiting for the user to select the playback data file to be processed; the action executed by the "select file" method is to create and initialize the data decoding module entity corresponding to the data format when the user selects the playback data file event. The initialization work includes pointing the playback data file pointer (pFile) of the entity to the current playback data file, calling the playback file parsing interface (paringData method), and extracting and saving the data in the playback data file in the time series data table format.

[0073] The entity in the running state Running has its do method executing the action of starting the data reading thread and loading the data decoding module entity in the thread. When the playback data file pointer is not empty (that is, it has not moved to the end of the playback data file), the data thread continues to call the time series data acquisition interface (readData method), inputs the time information in sequence, obtains the time series data frame index and frame length, moves the playback data file pointer, reads and outputs the time series data frame; when the playback data file pointer is empty, it automatically migrates from the current state to the ready state Runnable.

[0074] The Suspend state entity, whose do method performs the action of continuously suspending the data reading thread.

[0075] Furthermore, in the structured logical framework of the present invention, the specific contents of adding and executing the "event-action" entity in (2.2) and (2.3) include:

[0076] When creating a Runnable entity in the ready state, add the Start event entity and action through the "Add Event Action" method. That is, receiving the Start event will trigger the start action in this state, and then the state will migrate to the Running state; the Shutdown event entity and action, that is, receiving the Shutdown event will trigger the shutdown action in this state, and then the state machine will stop working;

[0077] When creating a Running state entity, add the Pause event entity and its action through the "Add Event Action" method. That is, receiving the Pause event will trigger the Pause action in this state, and then the state will migrate to the Suspended state; the End event entity and action, that is, receiving the Stop event will trigger the End action in this state, and then the state will migrate to the Ready state; the Shutdown event entity and action, that is, receiving the Shutdown event will trigger the Shutdown action in this state, and then the state machine will stop working;

[0078] When creating the Suspend state Suspend entity, the start event Start entity and action are added through the "Add Event Action" method, that is, receiving the Start event will trigger the start action in this state, and then the state will migrate to the Running state; the shutdown event Shutdown entity and action, that is, receiving the Shutdown event will trigger the shutdown action in this state, and then the state machine will stop working.

[0079] Specific embodiments are used in the present invention to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core ideas. At the same time, for those skilled in the art, according to the ideas of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the contents of this specification should not be understood as limiting the present invention.

Claims

1. A general design method for a UAV time series data player based on a finite state machine, characterized in that: The following processes are included: (1) Based on the actual business of the data management function module, the replay device is abstracted into a finite state machine model, and the total number of states of the replay device, the basic actions and the trigger conditions of state transitions, and the response actions are determined to form a state machine model diagram; (2) Based on the state machine model diagram, describe the functional entities and function interfaces that the replay needs to create and the relationships between them to form a structured logical framework. The structured logical framework generally describes the behavior of the replay, including state transitions and event responses; The state machine model diagram includes the three basic states of Runnable, Running, and Suspend, as well as the basic actions within them, and the four basic state transition events of start, pause, stop, and shutdown. (1.1) Ready state Runnable contains two basic actions: do, indicating that when entering this state, the system waits for the user to select the playback data file to be processed; FileSelection, indicating that when the user selects the playback data file event, the data decoding module entity of the corresponding data format is created and initialized. The initialization process includes setting the playback data file pointer of the data decoding module entity to point to the current playback data file, calling the playback file parsing interface, extracting and saving the data in the playback data file in the time series data table format; In the ready state Runnable responds to the two basic state transition events of start and shutdown: Start means that after receiving the start event in this state, the start action in this state is triggered, and then the state is transferred to the Running state; Shutdown means that after receiving the shutdown signal in this state, the shutdown action in this state is triggered, and then the state machine stops working; (1.2) The running state Running contains one basic action: do, indicating that in this state, the data reading thread is started and the data decoding module entity is loaded in the corresponding thread. When the playback data file pointer is not empty, that is, it has not moved to the end of the playback data file, the data reading thread continues to call the time series data acquisition interface, inputs time information according to the time sequence, obtains the time series data frame index and frame length, moves the playback data file pointer, reads and outputs the time series data frame; when the playback data file pointer is empty, the current state is automatically migrated to the ready state Runnable; In the Running state, respond to the three basic state transition events of pause, stop, and shutdown: pause, which means that after receiving a pause signal in this state, the pause action in this state is triggered, and then the state is transferred to the suspended state Suspend; stop, which means that after receiving an end signal in this state, the end action in this state is triggered, and then the state is transferred to the ready state Runnable; shutdown, which means that after receiving a shutdown signal in this state, the shutdown action in this state is triggered, and then the state machine stops working; (1.3) The Suspend state contains one basic action: do, indicating that in this state, the data reading thread is continuously suspended; In the Suspend state, respond to the two basic state transition events of start and shutdown: Start means that after receiving the start event in this state, the start action in this state is triggered, and then the state is transferred to the Running state; Shutdown means that after receiving the shutdown signal in this state, the shutdown action in this state is triggered, and then the state machine stops working; The structured logic framework includes: an event parent class Event and four child event classes Start, Stop, Pause, and Shutdown; a state parent class State and three state subclasses Runnable, Running, and Suspend; a functional interface Action; and a data decoding module Decoder. Construct the state machine entity of the player, where: Each State subclass entity uses the do method to perform basic actions when entering its own state, and custom methods to perform other necessary basic actions; Each state subclass entity contains an "event-action" mapping table. When creating, add the "event-action" entity key-value pairs to the mapping table through the "add event action" method; Each state entity responds to the received event entity through the "response event" method. If the "event-action" mapping table contains the "key" of the corresponding event, the corresponding "value", that is, the action entity, is retrieved and the "event action" method of the action entity is executed. The data decoding module Decode contains a playback data file pointer and provides a unified playback file parsing interface and a time series data acquisition interface to the outside world. The playback file parsing interface is customized by the user according to the playback data format of different drone models. It is used to extract time information, time series data frame index position and time series data frame length from the selected playback data file in the corresponding format and save them to the time series data table; the time series data acquisition interface is used to query the index position and data frame length of the corresponding time series data frame in the file from the time series data table based on the input time information, and move the playback data file pointer to the corresponding index position to extract data of the corresponding length and return it to the caller.

2. The general design method of the UAV time series data playback device based on the finite state machine according to claim 1 is characterized in that: The do method and custom method of the state subclass entity specifically include: The "do" method of the Runnable entity in the ready state executes the action of waiting for the user to select the playback data file to be processed. The "select file" method executes the action of creating and initializing the data decoding module entity corresponding to the data format when the user selects the playback data file event. The initialization work includes setting the playback data file pointer of the data decoding module entity to point to the current playback data file, calling the playback file parsing interface, extracting and saving the data in the playback data file in the time series data table format; The running state of the entity is Running. The action executed by the do method is to start the data reading thread and load the data decoding module entity in the corresponding thread. When the playback data file pointer is not empty, that is, it has not moved to the end of the playback data file, the data thread continues to call the time series data acquisition interface, inputs time information according to the time sequence, obtains the time series data frame index and frame length, moves the playback data file pointer, reads and outputs the time series data frame; when the playback data file pointer is empty, it automatically migrates from the current state to the ready state Runnable; The Suspend state entity, the action performed by the do method is to continuously suspend the data reading thread.

3. The general design method of the UAV time series data playback device based on the finite state machine according to claim 1 is characterized in that: The specific contents of adding and executing "event-action" entities include: When creating a Runnable entity in the Ready state, use the "Add Event Action" method to add a Start event entity and action. This means that receiving a Start event triggers the Start action in this state, and the state transitions to the Running state. Also, add a Shutdown event entity and action. This means that receiving a Shutdown event triggers the Shutdown action in this state, and the state machine stops. When creating a Running state entity, use the "Add Event Action" method to add a Pause event entity and its action. This means that receiving a Pause event triggers the Pause action in this state, and the state transitions to the Suspended state. Also, add a Stop event entity and its action. This means that receiving a Stop event triggers the Stop action in this state, and the state transitions to the Ready state. Also, add a Shutdown event entity and its action. This means that receiving a Shutdown event triggers the Shutdown action in this state, and the state machine stops. When creating a Suspend state entity, use the "Add Event Action" method to add a Start event entity and action. This means that receiving a Start event triggers the Start action in this state, and the state transitions to the Running state. Also, add a Shutdown event entity and action. This means that receiving a Shutdown event triggers the Shutdown action in this state, and the state machine stops working.

Citation Information

Patent Citations

  • Playback universal module

    CN101763876A

  • Model-independent universal record / playback system and model-independent universal record / playback method

    CN106681167A