Universal design method of unmanned aerial vehicle time sequence data playback device based on finite-state machine

By abstracting the behavior and state of the drone timing data player into a finite state machine model, the complex problems of existing player state transition and event response logic are solved, and higher versatility, maintainability and security are achieved.

CN119888884AActive Publication Date: 2025-04-25THE 54TH RESEARCH INSTITUTE OF CHINA ELECTRONICS TECHNOLOGY GROUP CORPORATION +1
View PDF 10 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The state transition and event response logic of existing drone timing data replays is complex, with low security, poor compatibility and maintainability.

Method used

Using a design method based on finite state machine, the behavior and state of the drone timing data player are abstracted into a finite state machine model, and the behavioral activities of the player are described through a structured logic framework, including state transitions and event responses.

Benefits of technology

Improves the versatility and maintainability of the player, reduces development and version management costs, and enhances the security and compatibility of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119888884A_ABST
    Figure CN119888884A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of unmanned aerial vehicle measurement and control and communication link data mining, in particular to a universal design method of an unmanned aerial vehicle time sequence data playback device based on a finite-state machine in unmanned aerial vehicle ground station research and development. Comprising two design elements of a finite-state machine model and a structured logic framework, and is suitable for the application fields of unmanned aerial vehicle ground stations and computer technologies. The finite-state machine model in the design method definitely defines and decouples each behavior and state of the playback device; the structured logic framework describes a universal interface and core logic of the playback device, wherein the user-defined data decoding module can be used for multi-state implementation of playback data files in different formats in a loose coupling manner. According to the design method, the security, maintainability and expandability of the playback program are guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] 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 an unmanned aerial vehicle timing data player based on a finite state machine in the research and development of an unmanned aerial vehicle ground station. Background Art

[0002] The UAV ground station is an important part of the UAV system. The data management module is responsible for recording the multi-source time series data transmitted and processed by the terminal equipment of the entire station and each host computer software into files (also called playback data files). After the flight mission is completed, it can be handed over to the time series data replay device (referred to as replay device) function module to read and align the time for playback, thereby restoring the data-driven mission scene. In the existing replay device design, state transition conditions and event response logic are usually mixed and scattered throughout the code, making the business behavior coupling of the replay device complex and difficult to expand and maintain.

[0003] In view of the above difficulties, the present invention proposes a universal design method for an unmanned time series data player 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 view of this, the present invention proposes a general design method for a UAV time series data player based on a finite state machine, which can adapt to different data playback scenarios. This method abstracts the behavior and state of the time series data player into a finite state machine, which encapsulates the general logic of the player function in a general ground station system, opens the behavior interface of the player in different states to efficiently implement polymorphism for various types of ground stations, and solves the problems of complex state conversion and event response logic, low security, poor compatibility and maintainability of traditional players.

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

[0006] A general design method for a UAV timing data playback device based on a finite state machine includes the following processes:

[0007] (1) According to the actual business of the data management function module, the player is abstracted into a finite state machine model, and the total number of states of the player, basic actions, trigger conditions of state transitions, and 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 player 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 player, including state transitions and event responses.

[0009] Furthermore, the contents of the state machine model diagram include: three basic states of Runnable, Running and Suspend and the basic actions inside, as well as four basic state transition events of start, pause, stop and shutdown, among which:

[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 the playback data file pointer of the data decoding module entity pointing to the current playback data file, and calling the playback file parsing interface to extract and save 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, which 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, which 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 a 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 the 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;

[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 the 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 the 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 the 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 Running; 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 child classes 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, add the "event-action" entity key-value pair 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 taken out, 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 playback file parsing interface and a timing data acquisition interface to the outside. The playback file parsing interface is implemented by the user in a custom polymorphic manner according to the playback data format of different drone models. It is used to extract the time information, timing data frame index position and timing data frame length from the selected playback data file in the corresponding format, and save them to the timing data table; the timing data acquisition interface is used to query the index position and data frame length of the corresponding timing data frame in the file from the timing data table through the input time information, and move the playback data file pointer to the corresponding index position to extract the 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 Runnable entity in the ready state, the action performed by the do method is to wait for the user to select the playback data file to be processed; the action performed 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, and the initialization work includes the playback data file pointer of the data decoding module entity pointing 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 entity in the running state Running, the action performed 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 the 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 entity is in the Suspend state, and 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 the Runnable entity in the ready state, add the start event Start 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 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;

[0034] When creating the 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 be migrated to the Suspended state; the Stop event entity and action, that is, receiving the Stop event will trigger the End action in this state, and then the state will be migrated 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 stops working.

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

[0037] The present invention solves the problems of poor versatility and high development and version management costs. The data interfaces of various ground station subsystems are different, and the functions of various data management modules are different, so playback data with different data structures will be generated, which need to be read and played back by different playback devices. The inconsistent technical standards of these playback devices will cause high development costs and version management costs.

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

[0039] The structured logic framework of the present invention is easy to adapt to the playback data formats of different drone models, which solves the high development cost and version management cost of the playback device due to the inconsistency of data formats and technical standards. It also has polymorphic modularization that is independent of the programming language, realizes universal adaptation and low-cost expansion, achieves the purpose of agile development, and improves maintainability. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 It is a schematic flow chart of the method of the present invention.

[0041] Figure 2 It 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 timing data table implemented by the method of the present invention. DETAILED DESCRIPTION

[0044] The present invention is further described below in conjunction with the accompanying drawings.

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

[0046] (1): According to the actual business of the data management function module, the replay 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 are clarified to form a state machine model diagram.

[0047] The state machine model is shown in the figure 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, it 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 pointing the playback data file pointer of the data decoding module entity 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, which 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 Running;

[0053] shutdown, indicating that a shutdown signal is received in this state, which triggers the shutdown action in this state, and then 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 timing data acquisition interface, inputs the time information in sequence, obtains the timing data frame index and frame length, moves the playback data file pointer, reads and outputs the timing 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, indicating that a pause signal is received in this state, which triggers the pause action in this state and the state is transferred 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 is transferred to the ready state shutdown;

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

[0060] (1.3) The Suspend state includes 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 is transferred 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 then the state machine stops working.

[0065] (2): Based on the state machine model diagram, the functional entities and function interfaces that the player needs to create and the relationships between them are depicted to form a structured logical framework. This framework does not specifically point to a particular player, but rather generally describes the player's state transitions, event responses, and other behavioral activities.

[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 subclasses Runnable, Running and Suspend, a functional interface Action, and a data decoding module Decoder, through which the state machine entity of the player is constructed, where:

[0067] (2.1) Each State subclass entity uses the do method to execute the basic actions to be performed when entering its own state, and uses custom methods to execute 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 pairs are added to the mapping table through the "Add Event Action" 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 takes out 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 playback file parsing interface (paringData method) and a time series data acquisition interface (readData method) to the outside. The playback file parsing interface is a polymorphic implementation defined by the user according to the playback data format of different drone models. It is responsible for extracting the time information, the index position of the time series data frame, and the length of the time series data frame from the selected playback data file according to its format, and saving it to the time series data table (see Figure 4 ) in the file; 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 through the input time information, and moving the playback data file pointer to the index position, extracting the data of the length and returning it to the caller.

[0071] Furthermore, in the structured logic framework of the present invention, the do method and the 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 "select file" method executing 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 occurs. 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, whose do method performs 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 entity in the Suspend state has its do method executing the action of continuing to suspend the data reading thread.

[0075] Furthermore, in the structured logic 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 the Runnable entity in the ready state, add the start event Start 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 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;

[0077] When creating the 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 be migrated to the Suspended state; the Stop event entity and action, that is, receiving the Stop event will trigger the End action in this state, and then the state will be migrated 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 stops working.

[0079] The present invention uses specific embodiments 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 idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A general design method for a UAV timing data playback device based on a finite state machine, characterized in that: The process includes: (1) According to the actual business of the data management function module, the player is abstracted into a finite state machine model, and the total number of states of the player, basic actions, trigger conditions of state transitions, and response actions are determined to form a state machine model diagram; (2) Based on the state machine model diagram, the functional entities and function interfaces that the player 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 player, including state transitions and event responses.

2. The general design method of the UAV timing data playback device based on the finite state machine according to claim 1 is characterized in that: The contents of the state machine model diagram include: three basic states and internal basic actions of the ready state Runnable, running state Running and suspended state Suspend, as well as four basic state transition events of start, pause, stop and shutdown, among which: (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 the playback data file pointer of the data decoding module entity pointing to the current playback data file, and calling the playback file parsing interface to extract and save 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, which 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, which 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 a 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 the 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; In the running state, respond to the three basic state transition events of pause, stop and shutdown: pause, which means that after receiving the 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 the 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 the 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 migrated to the running state Running; 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.

3. The general design method of the UAV timing data playback device based on the finite state machine according to claim 2 is characterized in that: 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 pair 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 taken out, 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 playback file parsing interface and a timing data acquisition interface to the outside. The playback file parsing interface is implemented by the user in a custom polymorphic manner according to the playback data format of different drone models. It is used to extract the time information, timing data frame index position and timing data frame length from the selected playback data file in the corresponding format, and save them to the timing data table; the timing data acquisition interface is used to query the index position and data frame length of the corresponding timing data frame in the file from the timing data table through the input time information, and move the playback data file pointer to the corresponding index position to extract the data of the corresponding length and return it to the caller.

4. The general design method of the UAV timing data playback device based on the finite state machine according to claim 3 is characterized in that: The do methods and custom methods of the state subclass entity include: The Runnable entity in the ready state, the action performed by the do method is to wait for the user to select the playback data file to be processed; the action performed 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 occurs. 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, and extracting and saving the data in the playback data file in the time series data table format; The entity in the running state Running, the action performed 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 the 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 entity is in the Suspend state, and the action performed by the do method is to continuously suspend the data reading thread.

5. The general design method of the UAV timing data playback device based on the finite state machine according to claim 3 is characterized in that: The specific contents of adding and executing the "event-action" entity include: When creating the 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; When creating the 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 be transferred to the Suspended state; the Stop event entity and action, that is, receiving the Stop event will trigger the End action in this state, and then the state will be transferred 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; When creating the Suspend state Suspend entity, add the start event Start 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 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.

Citation Information

Patent Citations

  • Playback universal module

    CN101763876A

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

    CN106681167A

  • Method for multi-cycle storage and playback of aircraft simulation data of flight simulator

    CN109557937A

  • Unmanned aerial vehicle multi-source measurement and control data playback method

    CN111935533A

  • Unmanned aerial vehicle comprehensive monitoring data multi-mode playback method and system

    CN112383757A