Methods, systems, and media for processing drone formation performance script files

By merging and fragmenting the drone formation performance script files, and then verifying and decoding them on the flight control device, the problem of low transmission and loading efficiency was solved, enabling fast and reliable takeoff preparation.

CN123113940APending Publication Date: 2026-11-17SHENZHEN DAMO DAZHI CONTROL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611578029.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-13
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

The current drone formation performance script files have low transmission and loading efficiency, resulting in long takeoff preparation time and difficulty in guaranteeing reliability.

Method used

At least two script segments are merged into a single script file and divided into multiple segments. These segments are transmitted via communication equipment and assembled and verified by the flight control unit. After verification, the ground station sends a takeoff command. The flight control unit decodes the command and stores it in a message queue, thus enabling parallel loading and takeoff preparation.

Benefits of technology

It improved transmission efficiency and reliability, shortened the drone takeoff preparation time, and ensured the integrity and security of script documents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123113940A_ABST
    Figure CN123113940A_ABST
Patent Text Reader

Abstract

This invention discloses a method, system, and medium for processing drone formation performance script files. The invention relates to the field of drone technology. The method includes: a ground station merging at least two script segments into a single script file, dividing the single script file into multiple segments, and sending them to a communication device; a flight control device assembling the multiple segments forwarded by the communication device into a single script file, performing verification on the single script file, and sending the verification result back to the ground station via the communication device; after the verification result indicates successful verification, the ground station sends a takeoff command carrying a script identifier to the flight control device via the communication device; in response to the takeoff command, the flight control device decodes the single script file corresponding to the script identifier, stores the decoded performance frames in a message queue, and provides them for consumption by the target drone during flight execution. This invention improves the transmission efficiency and reliability of formation performance script files and shortens the drone takeoff preparation time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of unmanned aerial vehicle (UAV) technology, and in particular to a method, system and medium for processing UAV formation performance script files. Background Technology

[0002] Drone formation performances involve pre-programming script files at a ground station and distributing these files to the flight controllers (flight control units) of each drone. The flight control units then control the drones to execute actions such as positioning and lighting frame by frame along the performance timeline, according to the script files. The script files are typically sent to the flight control units via an air-to-ground data transmission link. After receiving and verifying the script files, the flight control units load them into onboard storage for use during flight missions.

[0003] The aforementioned script file transmission and loading process involves multiple steps and is time-consuming: from the completion of script file editing at the ground station to its readiness for execution on the flight control device, it must go through multiple stages, including file distribution, link transmission, reception verification, and loading parsing. These stages are executed sequentially, and the takeoff preparation process can only proceed after the script file is loaded. Furthermore, the air-to-ground data transmission link has limited and unstable bandwidth, making it susceptible to interference and errors during transmission. Since the script file transmission and loading process involves many steps, an error in any stage often requires re-execution of the entire process, further extending takeoff preparation time. After loading, the script file must also be parsed before execution, further consuming pre-takeoff preparation time. Consequently, the script file transmission and loading efficiency is low, takeoff preparation time is long, and the reliability of transmission and loading is difficult to guarantee, making it difficult to meet the needs of rapid deployment of large-scale UAV formations.

[0004] Therefore, how to improve the efficiency and reliability of the transmission and loading of formation performance script files and shorten takeoff preparation time is a technical problem that needs to be solved in this field. Summary of the Invention

[0005] This invention provides a method, system, and medium for processing drone formation performance script files, aiming to solve the problem of low efficiency and reliability in the transmission and loading of existing formation performance script files, resulting in long drone takeoff preparation times.

[0006] In a first aspect, embodiments of the present invention provide a method for processing a script file for a drone formation performance, applied to a script file processing system. The script file processing system includes a ground station, communication equipment, and a flight control device, wherein the flight control device is mounted on a target drone in the drone formation. The method includes: The ground station merges at least two script segments into a single script file, divides the single script file into multiple segments, and sends them to the communication device. The flight control device assembles the multiple fragments forwarded by the communication device into the single script file, performs verification on the single script file, and sends the verification result back to the ground station via the communication device. After the verification result indicates that the verification has passed, the ground station sends a takeoff command carrying a script identifier to the flight control device via the communication equipment. In response to the takeoff command, the flight control device decodes the single script file corresponding to the script identifier and stores the decoded performance frames into a message queue for consumption by the target UAV during flight execution.

[0007] Secondly, embodiments of the present invention also provide a script file processing system, including a ground station, communication equipment, and a flight control device. The flight control device is mounted on a target UAV in a UAV formation. The ground station is equipped with a merging and splitting unit and a sending unit. The flight control device is equipped with an assembly and verification unit and a decoding and storage unit, wherein: The merging and splitting unit is used by the ground station to merge at least two script segments into a single script file, split the single script file into multiple segments, and send them to the communication device; The assembly and verification unit is used by the flight control device to assemble the multiple fragments forwarded by the communication device into the single script file, perform verification on the single script file, and send the verification result back to the ground station via the communication device. The sending unit is used by the ground station to send a takeoff command carrying a script identifier to the flight control device via the communication device after the verification result indicates that the verification has passed. The decoding and storage unit is used by the flight control device to decode the single script file corresponding to the script identifier in response to the takeoff command, and store the decoded performance frames into a message queue for consumption by the target UAV during flight execution tasks.

[0008] Thirdly, embodiments of the present invention also provide a script file processing system, wherein the script file processing system includes a memory and a processor, the memory stores a computer program, and the processor executes the computer program to implement the above-described method.

[0009] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the above-described method.

[0010] This invention provides a method, system, and medium for processing drone formation performance script files. The method includes: a ground station merging at least two script segments into a single script file, dividing the single script file into multiple segments, and sending them to a communication device; a flight control device assembling the multiple segments forwarded by the communication device into the single script file, performing a verification on the single script file, and sending the verification result back to the ground station via the communication device; after the verification result indicates successful verification, the ground station sends a takeoff command carrying a script identifier to the flight control device via the communication device; in response to the takeoff command, the flight control device decodes the single script file corresponding to the script identifier, stores the decoded performance frames in a message queue, and provides them for consumption by the target drone during flight execution. The technical solution of this invention improves transmission efficiency by merging at least two script segments into a single script file and dividing it into fragments for transmission via communication equipment, thus avoiding the separate distribution of multiple files. After assembly by the flight control device, verification is performed and the verification result is returned. The takeoff command is sent only after the ground station verifies the result, ensuring transmission reliability. The flight control device responds to the takeoff command by decoding and storing the performance frame in a message queue for asynchronous consumption by the flight execution task, allowing loading and takeoff preparation to proceed in parallel, thus shortening the takeoff preparation time of the UAV. Attached Figure Description

[0011] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 A flowchart illustrating a method for processing a drone formation performance script file according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a sub-process of a method for processing a drone formation performance script file according to an embodiment of the present invention; Figure 3 This is a schematic diagram of another sub-process of a method for processing a drone formation performance script file according to an embodiment of the present invention; Figure 4 This is a schematic diagram of another sub-process of a method for processing a drone formation performance script file according to an embodiment of the present invention; Figure 5 A schematic block diagram of a script document processing system provided in an embodiment of the present invention; Figure 6 This is a schematic block diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0013] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0014] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0015] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0016] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0017] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."

[0018] Currently, in the field of UAV technology, the efficiency and reliability of existing formation performance script file transmission and loading are low, resulting in long UAV takeoff preparation times. To address these issues, this invention proposes a method for processing UAV formation performance script files. This method merges at least two script segments into a single script file, divides it into fragments, and transmits them via communication equipment, avoiding the separate distribution of multiple files and improving transmission efficiency. The flight control device assembles the files, performs verification, and sends a verification result receipt. Takeoff commands are only sent after the ground station verifies the data, ensuring transmission reliability. The flight control device responds to the takeoff command by decoding and storing the performance frames in a message queue for asynchronous consumption during flight execution tasks, allowing loading and takeoff preparation to proceed in parallel, thus shortening the UAV takeoff preparation time. The invention will be described in detail below through specific embodiments.

[0019] Please see Figure 1 , Figure 1 This is a flowchart illustrating a method for processing drone formation performance script files according to an embodiment of the present invention. Figure 1 As shown, the method includes the following steps S110-S140.

[0020] S110. The ground station merges at least two script segments into a single script file, divides the single script file into multiple segments, and sends them to the communication device.

[0021] In this embodiment of the invention, the at least two scripts include a takeoff script, a performance script, and a landing script. The takeoff script describes the action of the target drone taking off from the ground and climbing into the formation. The performance script describes the action of the formation presenting patterns and changing formations in the air. The landing script describes the action of the target drone leaving the formation and returning to land.

[0022] It should be noted that the method for processing the drone formation performance script file in this embodiment is applied to a script file processing system, which includes a ground station, communication equipment, and a flight control device. The flight control device is installed on the target drone in the drone formation. In this embodiment, a communication link is established between the ground station and the flight control device via the communication equipment. This communication link includes a wireless link and a serial port link. The ground station sends the script file and takeoff commands to the flight control device in segments via the communication equipment using a common file transfer protocol. The flight control device sends responses and verification results back to the ground station segment by segment via the communication equipment. The communication equipment acts as a communication bridge, transmitting bidirectional data between the ground station and the flight control device without being aware of the script file content. Furthermore, in this embodiment, the flight control device is installed on the target drone in the drone formation. As the onboard control core of the target drone, it is responsible for receiving the script file sent by the ground station via the communication equipment, assembling, verifying, and decoding the script file, and controlling the target drone to perform position, lighting, and other performance actions frame by frame on the performance timeline according to the script file, coordinating with other drones in the formation to complete the entire performance.

[0023] Among them, such as Figure 2 As shown, step S110 specifically includes steps S111-S115: S111. The ground station splices the takeoff script, the performance script, and the landing script into a single script file based on a unified frame number axis. The takeoff script, the performance script, and the landing script correspond to the takeoff segment, the performance segment, and the landing segment on the frame number axis, respectively. The single script file records segment markers used to distinguish the takeoff segment, the performance segment, and the landing segment on the frame number axis. S112. For each time slot on the frame sequence number axis, the ground station generates a frame record without an explicit frame number, wherein the frame record describes the data type contained in the corresponding time frame and carries corresponding field data according to the content changes of the corresponding time frame relative to the previous time frame. S113. The frame sequence consisting of the frame records of each time slot is stored in the single script file in compressed form. S114. Divide the single script file into multiple segments of a preset length, wherein each segment carries a segment number and a segment verification value; S115. Each of the aforementioned fragments is sent to the communication device via a general file transfer command, and the communication device then transmits the received fragments to the flight control device.

[0024] In this embodiment of the invention, the ground station edits the takeoff script, performance script, and landing script of the target UAV separately, and performs a three-in-one encoding on the three scripts, splicing them into a single script file. During splicing, the takeoff script, performance script, and landing script are aligned to a unified frame number axis: the frame number axis is a sequence of frame numbers that increases continuously from the starting point. The takeoff script occupies the starting frame number interval, the performance script's frame number immediately follows the takeoff script, and the landing script's frame number immediately follows the performance script. These three correspond to the takeoff segment, performance segment, and landing segment on the frame number axis, respectively. The ground station writes the start frame number of the performance segment and the start frame number of the landing segment as segment markers into the header of the single script file. The flight control device can then determine the segment to which any frame belongs without needing to store a separate segment identifier for each frame. It should be noted that the frames of the takeoff segment are located before the start frame number of the performance segment, the frames of the performance segment are located between the start frame number of the performance segment and the start frame number of the landing segment, and the frames of the landing segment are located at and after the start frame number of the landing segment.

[0025] Furthermore, the frame record includes type bytes and field data. The type bytes include a synchronization field and a bitmap field. The synchronization field carries a code pattern consistent with the frame synchronization code pattern recorded in the file header to describe the data type contained in the corresponding time frame. The bitmap field is a payload presence bitmap, which indicates whether the frame record carries a waypoint field, a light field, and an extended payload field. The field data includes the waypoint field, the light field, and the extended payload field. The waypoint field carries the offset increment of the current time frame relative to the previous waypoint frame. Specifically, a frame record is a data unit of one time slot on the corresponding frame sequence axis in a single script file, consisting of type bytes and field data. The type byte is located at the beginning of the frame record and includes a synchronization field and a bitmap field. The synchronization field carries a code pattern consistent with the frame synchronization code pattern recorded in the file header. During decoding, the frame boundary is determined by the bitwise AND result of the type byte and the synchronization mask, which equals the frame synchronization code pattern. It also describes the data type contained in the corresponding time frame. The bitmap field is a payload presence bitmap, with each bit indicating whether the frame record carries a waypoint field, a light field, and an extended payload field. The decoding side uses this to determine the field composition and frame length of the frame record. Field data is selectively written according to content changes: the waypoint field carries the offset increment of the current time frame relative to the previous waypoint frame and is omitted when the position remains unchanged; the light field carries the absolute value of the light status and is only written when the status changes; the extended payload field carries a length prefix and a payload action message serialized in Protobuf format. Adding a new payload type only requires extending the message field. For time slots without any data, the frame record consists of only one type byte. The frame record does not carry an explicit frame number; its frame number is implicitly determined by its position in the frame sequence.

[0026] Furthermore, the frame records carry corresponding field data based on the content changes of the corresponding time frame relative to the previous time frame. Specifically, when the position changes, only the offset increment relative to the previous waypoint frame is written; if the position remains unchanged, the waypoint field is not written. When the light status changes, the absolute value of the light status is written; if it remains unchanged, it is omitted. When there is a payload action, an extended payload field serialized in Protobuf format is written. For time slots that do not contain any data, only a type byte is written. The frame records of each time slot constitute a frame sequence, which is compressed and stored in the script content segment of a single script file. After the content segment is decompressed, a checksum for verifying the frame sequence is also included.

[0027] Furthermore, the ground station divides the single script file into multiple fragments of a preset length (e.g., approximately 240 bytes). Each fragment carries a fragment number and a fragment checksum: the fragment number identifies the fragment's position within the single script file, allowing the flight control unit to assemble it sequentially; the fragment checksum is the CRC32 value calculated for that fragment's data, used by the receiving side for fragment-by-fragment error checking. After segmentation, the ground station sends each fragment sequentially to the communication equipment via a general file transfer command. No prior script transmission initialization negotiation is required; the script type and identity are self-descriptive based on the filename and content of the single script file. The communication equipment, acting as a transparent transmission bridge, only forwards each fragment to the flight control unit in the receiving order, without parsing or being aware of the script content within the fragments. Therefore, changes to the script file format do not require alterations to the communication equipment's processing logic.

[0028] In one embodiment, such as this embodiment, step S113 specifically includes: writing a file header (HEADER), a script description header (dramaHeader), and a script content segment (dramaContent) into the single script file; writing a first checksum, the script identifier, the segment marker, and the frame synchronization code pattern into the file header, wherein the first checksum is used to perform file-level verification on the remaining fields in the file header except for the first checksum; writing a second checksum and a script description field serialized according to a preset serialization format into the script description header, wherein the second checksum is used to perform file-level verification on the script description field; and compressing the frame sequence along with a third checksum and writing it into the script content segment. Specifically, the single script file is organized in a three-level structure, with the file header, script description header, and script content segment written sequentially. The file header is a fixed-length structure, containing a first checksum, a script identifier, segment markers, and a frame synchronization code. The first checksum is a CRC32 value calculated from all fields in the file header except itself. The flight control unit can verify the integrity of the file header by recalculating and comparing the values ​​after reading it, without relying on external information. The script identifier uniquely identifies the script for this event, allowing takeoff commands to locate the file based on the identifier. The segment markers include the start frame number of the performance segment and the start frame number of the landing segment, used to distinguish between takeoff, performance, and landing segments on the frame sequence number axis. The frame synchronization code is the synchronization feature value in the frame record type byte, used to determine frame boundaries during decoding. The script description header contains a second checksum and a script description field serialized in Protobuf format. The script description field records metadata such as frame rate and total number of frames for various data types. The second checksum is used to perform file-level verification on the script description field; adding new description items does not require modifying the file header structure. The script content segment carries the frame sequence: First, the frame records of each time slot are sequentially spliced ​​together, along with a third checksum covering all frame records, and then compressed before being stored in the content segment. The third checksum is used to verify the entire frame sequence after decompression. The three-level structure carries the checksum level by level from top to bottom, and any damage at any level can be independently located.

[0029] S120. The flight control device assembles the multiple fragments forwarded by the communication device into the single script file, performs verification on the single script file, and sends the verification result back to the ground station via the communication device.

[0030] In embodiments of the present invention, such as Figure 3 As shown, step S120 specifically includes steps S121-S125.

[0031] S121. The flight control device stores the multiple fragments forwarded by the communication device into a buffer. For each fragment received, it performs fragment verification based on the fragment verification value carried by the fragment. The fragment that passes the verification responds to the ground station through the communication device. The fragment that fails the verification does not respond. The verified fragments are assembled into the single script file according to the fragment sequence number carried by each fragment, so that the ground station can detect lost fragments based on the response and perform selective retransmission of the lost fragments. S122. After all the fragments have been received, the flight control device performs an MD5 check on the assembled single script file as a whole. S123. After the MD5 verification is successful, the flight control device receives a verification request sent by the ground station through the communication device, wherein the verification request carries the script identifier and the verification type. S124. In response to the verification request, firstly, file-level self-verification is performed by comparing the first verification value, the second verification value, and the third verification value embedded in the single script file level by level. Then, semantic-level verification of streaming decompression and frame-by-frame unpacking is performed on the single script file to verify the legality of frame synchronization, field structure, and payload content of each frame record, and the verification result is obtained. S125. The verification result is sent back to the ground station via the communication device.

[0032] In this embodiment of the invention, the verification type is used to specify the verification range, which can specify any combination of at least one segment from the takeoff segment, performance segment, and landing segment. In response to a verification request, the flight control device performs two levels of verification. The first level is file-level self-verification: a single script file contains a first verification value, a second verification value, and a third verification value. The flight control device compares these values ​​level by level: first, it recalculates the verification values ​​of all fields in the file header except the first verification value and compares them with the first verification value to confirm the integrity of the file header; then, it calculates the verification value of the script description field in the script description header and compares it with the second verification value to confirm the integrity of the description field; finally, it decompresses the script content segment, calculates the verification value of the frame sequence and compares it with the third verification value to confirm the integrity of the content segment. If any level of comparison fails, the file is deemed corrupted, and the verification fails. The second level is semantic-level verification: After the file-level self-verification passes, the single script file undergoes streaming decompression and frame-by-frame unpacking to verify the frame synchronization, field structure, and payload content validity of each frame. Specifically, it verifies whether the synchronization code of the type byte can correctly identify frame boundaries, whether the field composition and frame length indicated by the bitmap field are consistent, and whether the deserialized payload actions are executable. The two levels of verification are independent and redundantly cover each other; script files with identical bytes but structural errors in content can also be intercepted, yielding the verification result. Finally, the flight control unit sends the verification result back to the ground station via communication equipment: acceptance is received if verification passes, and rejection is received if verification fails. Based on this, the ground station decides whether to proceed with the takeoff preparation process or retransmit the single script file.

[0033] S130. After the verification result indicates that the verification is successful, the ground station sends a takeoff command carrying a script identifier to the flight control device via the communication equipment.

[0034] In this embodiment of the invention, the takeoff command only carries the script identifier and multi-aircraft synchronization information, without carrying script parameters such as frame rate. The script type and the frame rate of various data are self-described by a single script file. The ground station issues takeoff commands to each target UAV in the formation with the same script identifier. Each flight control device locates and loads the corresponding single script file accordingly. Combined with the multi-aircraft synchronization information, the takeoff time is aligned, realizing the decoupling of the script issuance and takeoff of the entire event, simplifying the command interaction process.

[0035] S140. In response to the takeoff command, the flight control device decodes the single script file corresponding to the script identifier and stores the decoded performance frames into a message queue for consumption by the target UAV during flight execution tasks.

[0036] In this embodiment of the invention, the flight control device responds to a takeoff command, such as... Figure 4 As shown, step S140 specifically includes steps S141-S143: S141. Perform streaming decompression on the single script file to obtain the frame sequence; S142. Determine the frame boundary of each frame record in the frame sequence according to the type byte and the frame synchronization code pattern, determine the field composition and frame length of the frame record according to the indication of the bitmap field, and implicitly recover the frame number of each frame record according to the position order of the frame record in the frame sequence. S143. Based on the frame number and field data recorded in each frame, restore the performance content of the corresponding time frame to obtain the performance frame.

[0037] In this embodiment of the invention, the flight control device performs streaming decompression on the script content segments of a single script file, outputting the decompressed data block by block to obtain a frame sequence composed of the frame records of each time slot. During decoding, the frame sequence is scanned byte by byte, and the frame boundary is determined by the bitwise AND result of the type byte and the synchronization mask being equal to the frame synchronization code recorded in the file header, thus locating the starting position of each frame record. After reading the type byte of the frame record, it is determined whether the frame record carries waypoint fields, light fields, and extended load fields according to the indication of the bitmap field, thereby determining its field composition and frame length. After reading the field data according to the frame length, the process proceeds to the next frame record. The frame record does not carry an explicit frame number; its frame number is implicitly recovered from the position order of the frame record in the frame sequence, that is, the nth frame record corresponds to the time frame numbered on the frame sequence axis as the starting frame number plus n minus 1. During restoration, the offset increment carried by the waypoint field is accumulated to the absolute coordinates in the cache to obtain the absolute position of the current time frame. For frames that do not carry the light field, the most recent light state is used. For frames that carry the extended payload field, the byte segment is truncated according to the length prefix and deserialized to obtain the payload action. Combined with the restored frame number, the position, light and payload actions of each time frame are assembled into the corresponding performance frame.

[0038] In one embodiment, such as this embodiment, the step of decoding the single script file corresponding to the script identifier further includes: a loading task independent of the flight execution task performing decoding on the single script file corresponding to the script identifier, wherein the loading task operates according to a state machine including an idle state, an initialization state, a loading state, and an unloading state; in the loading state, the file data of the single script file is read and sent to a streaming decompressor, the decompressed output is written to a circular buffer, and the performance frame is parsed frame by frame from the circular buffer to obtain the performance frame; wherein when the data of the performance frame crosses the wraparound boundary of the circular buffer, the loading task dynamically splices it into a continuous frame body before parsing; when the frame boundary determination fails, the loading task discards it byte by byte and re-determines it; in the initialization state, if the file size of the single script file is not greater than a preset cache limit, the loading task reads the single script file into memory at once; otherwise, it retains the file handle and reads it in blocks. In the unloading state, when the loading task receives an unloading request forwarded by the communication device, it emptys the message queue and resets the state machine. Specifically, the decoding of the script file is performed by a loading task independent of the flight execution task. The loading task runs as an independent thread or task on the flight control device, exchanging data with the flight execution task through a message queue. The two do not block each other, and the decoding progress of the loading task does not affect the real-time control cycle of the flight execution task. The loading task operates according to a state machine that includes an idle state, an initialization state, a loading state, and an unloading state: in the idle state, the loading task is suspended and waits; upon receiving a takeoff command carrying a script identifier, it enters the initialization state.

[0039] It should be noted that in the initialization state, the loading task opens a single script file and determines its file size: if the file size is not greater than the preset cache limit, the single script file is read into memory and parsed at once to save the overhead of repeated disk reads; otherwise, the file handle is retained and the script is read in blocks, so that the memory usage of the flight control device is decoupled from the total duration of the script, and long scripts can also be loaded on resource-constrained airborne platforms.

[0040] It should also be noted that in the loading state, the loading task reads the file data of a single script file block by block and sends it to the streaming decompressor. The decompressed output is written to a fixed-size circular buffer, and the task parses the performance frames frame by frame from the circular buffer and pushes them into the message queue. Since the capacity of the circular buffer is limited, the data of a performance frame may cross the wraparound boundary between the end and the beginning of the buffer. In this case, the loading task dynamically splices the frame data into a continuous frame body before parsing. If the frame boundary determination fails, that is, the current byte position cannot match the frame synchronization code pattern, the loading task discards the data byte by byte and slides back to determine the boundary until the frame synchronization is restored, without interrupting the overall decoding process.

[0041] It should also be noted that in the unloading state, when the loading task receives an unloading request forwarded by the communication device, it stops reading and parsing, emptys the remaining performance frames in the message queue, releases the file handle, the ring buffer and cache occupation, resets the state machine to return to the idle state, and prepares to load the next script file.

[0042] In summary, the method for processing drone formation performance script files in this invention has the following beneficial effects: First, by splicing the takeoff script, performance script, and landing script into a single script file based on a unified frame number axis, and recording segment markers in the single script file, the entire script can be completely sent to the flight control device after being split once and transmitted in a single session. This eliminates the need for multiple files to be negotiated and transmitted separately, simplifying the interaction process between the ground station and the flight control device.

[0043] Second, by not carrying explicit frame numbers in the frame records, the frame numbers are implicitly recovered from the order in which the frame records appear in the frame sequence. Furthermore, the frame records carry corresponding field data based on the changes in the content of the corresponding time frame relative to the previous time frame. Data whose content has not changed does not need to be rewritten. In addition, the frame sequence is superimposed and stored in a compressed form, which significantly reduces the size of a single script file and reduces the transmission burden.

[0044] Third, by dividing a single script file into multiple segments of a preset length, each segment carries a segment sequence number and a segment check value, which are sent via a general file transfer command and transparently transmitted by the communication equipment, the flight control device checks and responds to each segment one by one. Segments that fail to be checked do not respond. The ground station detects lost segments based on this and performs selective retransmission only for lost segments. When an error occurs, there is no need to retransmit the entire file, which improves the transmission efficiency and reliability of bandwidth-limited and interference-prone links.

[0045] Fourth, by embedding the first check value, the second check value, and the third check value in the file header, script description header, and script content section of a single script file, respectively, and transmitting the check value along with the file, the flight control device can perform file-level self-checks step by step and independently locate the level of damage, thus avoiding the mismatch risk caused by the separate transmission of check values ​​and files.

[0046] Fifth, a multi-level verification system is constructed by segmented verification, overall MD5 verification, file-level self-verification, and semantic-level verification of frame synchronization, field structure, and payload content legality. The verification results are sent back to the ground station. Only after the verification is passed will the ground station send the takeoff command. This intercepts anomalies such as file corruption, frame misalignment, and missing fields before takeoff, ensuring that the loaded script is complete and reliable, and improving the safety of formation performance.

[0047] Sixth, by carrying script identifiers in the takeoff command, the flight control device responds to the takeoff command by decoding the single script file corresponding to the script identifier, and stores the decoded performance frames in the message queue for asynchronous consumption by the flight execution task. The script loading and flight execution are decoupled, and the decoding process does not block flight control, thus shortening the takeoff preparation time.

[0048] Seventh, by having a loading task independent of the flight execution mission perform decoding according to a state machine, the file data is read in blocks, decompressed and written to a circular buffer for frame-by-frame parsing. When the performance frame data crosses the wrap-around boundary, it is dynamically spliced ​​and parsed. When the frame boundary judgment fails, it is discarded byte by byte and re-judged. Furthermore, it adaptively selects to read into memory all at once or read in blocks according to the file size, thus decoupling the memory usage of the flight control device from the total duration of the script. Errors do not interrupt the overall decoding, and it supports reliable loading of long and large-scale scripts on resource-constrained airborne platforms.

[0049] Figure 5This is a schematic block diagram of a script document processing system 200 provided in an embodiment of the present invention. Figure 5 As shown, corresponding to the above-described method for processing drone formation performance script files, the present invention also provides a script file processing system 200. This script file processing system 200 includes a unit for executing the above-described method for processing drone formation performance script files. Specifically, please refer to... Figure 5 The script document processing system 200 includes a merging and splitting unit 101 and a sending unit 102 configured in the ground station 10, and an assembly and verification unit 201 and a decoding and storage unit 202 configured in the flight control device 20. The functional modules are described in detail below: The merging and splitting unit 101 is used by the ground station to merge at least two scripts into a single script file, split the single script file into multiple segments, and send them to the communication device; The assembly verification unit 201 is used by the flight control device to assemble the multiple fragments forwarded by the communication device into the single script file, perform verification on the single script file, and send the verification result back to the ground station via the communication device. The sending unit 102 is used by the ground station to send a takeoff command carrying a script identifier to the flight control device via the communication device after the verification result indicates that the verification has passed. The decoding and storage unit 202 is used by the flight control device to decode the single script file corresponding to the script identifier in response to the takeoff command, and store the decoded performance frames into a message queue for consumption by the target UAV during flight execution tasks.

[0050] In some embodiments, such as this one, the merging and segmentation unit 101 is specifically used for: The ground station splices the takeoff script, the performance script, and the landing script into a single script file based on a unified frame number axis. The takeoff script, the performance script, and the landing script correspond to the takeoff segment, the performance segment, and the landing segment on the frame number axis, respectively. The single script file records segment markers used to distinguish the takeoff segment, the performance segment, and the landing segment on the frame number axis. For each time slot on the frame sequence number axis, the ground station generates a frame record without an explicit frame number. The frame record describes the data type contained in the corresponding time frame and carries corresponding field data according to the content changes of the corresponding time frame relative to the previous time frame. The frame sequence, composed of frame records from various time slots, is stored in compressed form in the single script file. Specifically, this includes: writing a file header, a script description header, and a script content segment into the single script file; writing a first checksum, the script identifier, the segment marker, and a frame synchronization code pattern into the file header, wherein the first checksum is used to perform file-level verification on all fields in the file header except for the first checksum; writing a second checksum and a script description field serialized according to a preset serialization format into the script description header, wherein the second checksum is used to perform file-level verification on the script description field; and compressing the frame sequence along with a third checksum before writing it into the script content segment. The single script file is divided into multiple segments of a preset length, wherein each segment carries a segment number and a segment check value; Each of the aforementioned fragments is sent to the communication device via a general file transfer command, and the communication device then transmits the received fragments to the flight control device.

[0051] In some embodiments, such as this one, the assembly verification unit 201 is specifically used for: The flight control device stores the multiple fragments forwarded by the communication device into a buffer. Each time a fragment is received, a fragment check is performed based on the fragment check value carried by the fragment. The fragment that passes the check is responded to by the communication device to the ground station. The fragment that fails the check is not responded to. The verified fragments are assembled into the single script file according to the fragment sequence number carried by each fragment, so that the ground station can detect lost fragments based on the response and perform selective retransmission of the lost fragments. After all the fragments have been received, the flight control device performs an MD5 check on the assembled single script file as a whole. After the MD5 verification is successful, the flight control device receives a verification request sent by the ground station via the communication equipment, wherein the verification request carries the script identifier and the verification type; In response to the verification request, file-level self-verification is first performed by comparing the first verification value, the second verification value, and the third verification value embedded in the single script file level by level. Then, semantic-level verification of streaming decompression and frame-by-frame unpacking is performed on the single script file to verify the legality of frame synchronization, field structure, and payload content of each frame record, and the verification result is obtained. The verification result is sent back to the ground station via the communication device.

[0052] In some embodiments, such as this one, the decoding and storage unit 202 is specifically used for: The single script file is stream-decompressed to obtain the frame sequence; The frame boundaries of each frame record in the frame sequence are determined according to the type byte and the frame synchronization code pattern. The field composition and frame length of the frame record are determined according to the indication of the bitmap field. The frame number of each frame record is implicitly recovered according to the position order of the frame record in the frame sequence. Based on the frame number and field data recorded in each frame, the performance content of the corresponding time frame is reconstructed to obtain the performance frame.

[0053] In some embodiments, such as this one, the decoding and storage unit 202 is further configured to: The single script file corresponding to the script identifier is decoded by a loading task independent of the flight execution mission, wherein the loading task operates according to a state machine including idle state, initialization state, loading state and unloading state; In the loading state, the file data of the single script file is read and sent to the streaming decompressor. The decompressed output is written to the circular buffer, and the performance frame is obtained by parsing the circular buffer frame by frame. When the data of the performance frame crosses the wraparound boundary of the circular buffer, the loading task dynamically splices it into a continuous frame body before parsing. If the frame boundary determination fails, the loading task discards the data byte by byte and re-determines the boundary. In the initialization state, if the file size of the single script file is not greater than the preset cache limit, the loading task will read the single script file into memory at once; otherwise, the file handle will be retained for reading in blocks. In the unloading state, when the loading task receives an unloading request forwarded by the communication device, it emptys the message queue and then resets the state machine.

[0054] The aforementioned device for processing drone formation performance script files can be implemented as a computer program, which can, for example... Figure 6 It runs on the electronic device shown.

[0055] Please see Figure 6 , Figure 6 This is a schematic block diagram of an electronic device provided in an embodiment of the present invention. The electronic device 300 can be the aforementioned ground station, communication equipment, and flight control device.

[0056] See Figure 6 The electronic device 300 includes a processor 302, a memory, and a network interface 305 connected via a system bus 301. The memory may include a non-volatile storage medium 303 and internal memory 304.

[0057] The non-volatile storage medium 303 may store an operating system 3031 and a computer program 3032. When the computer program 3032 is executed, it causes the processor 302 to execute a method for processing a drone formation performance script file.

[0058] The processor 302 provides computing and control capabilities to support the operation of the entire electronic device 300.

[0059] The internal memory 304 provides an environment for the operation of the computer program 3032 in the non-volatile storage medium 303. When the computer program 3032 is executed by the processor 302, the processor 302 can execute a method for processing a drone formation performance script file.

[0060] This network interface 305 is used for network communication with other devices. Those skilled in the art will understand that... Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present invention and does not constitute a limitation on the electronic device 300 to which the present invention is applied. The specific electronic device 300 may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0061] The processor 302 is used to run a computer program 3032 stored in a memory to implement any embodiment of the above-described method for processing drone formation performance script files.

[0062] It should be understood that, in this embodiment of the invention, the processor 302 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0063] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by a processor in the computer system to implement the process steps of the embodiments of the above methods.

[0064] Therefore, the present invention also provides a storage medium. This storage medium can be a computer-readable storage medium. The storage medium stores a computer program. When executed by a processor, the computer program causes the processor to perform any embodiment of the above-described method for processing drone formation performance script files.

[0065] The storage medium can be any computer-readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.

[0066] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0067] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.

[0068] The steps in the method of this invention can be adjusted, merged, or reduced in order according to actual needs. The units in the device of this invention can be merged, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0069] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a drone to execute all or part of the steps of the methods described in the various embodiments of the present invention.

[0070] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0071] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Since these modifications and variations fall within the scope of the claims and their equivalents, this invention also intends to include these modifications and variations.

[0072] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for processing script files for drone formation performances, applied to a script file processing system, the script file processing system comprising a ground station, communication equipment, and a flight control device, wherein the flight control device is mounted on a target drone in the drone formation, characterized in that... The method includes: The ground station merges at least two script segments into a single script file, divides the single script file into multiple segments, and sends them to the communication device. The flight control device assembles the multiple fragments forwarded by the communication device into the single script file, performs verification on the single script file, and sends the verification result back to the ground station via the communication device. After the verification result indicates that the verification has passed, the ground station sends a takeoff command carrying a script identifier to the flight control device via the communication equipment. In response to the takeoff command, the flight control device decodes the single script file corresponding to the script identifier and stores the decoded performance frames into a message queue for consumption by the target UAV during flight execution.

2. The method according to claim 1, characterized in that, The at least two script segments include a takeoff script, a performance script, and a landing script; the ground station merges the at least two script segments into a single script file, divides the single script file into multiple segments, and sends them to the communication device, including: The ground station splices the takeoff script, the performance script, and the landing script into a single script file based on a unified frame number axis. The takeoff script, the performance script, and the landing script correspond to the takeoff segment, the performance segment, and the landing segment on the frame number axis, respectively. The single script file records segment markers used to distinguish the takeoff segment, the performance segment, and the landing segment on the frame number axis. For each time slot on the frame sequence number axis, the ground station generates a frame record without an explicit frame number. The frame record describes the data type contained in the corresponding time frame and carries corresponding field data according to the content changes of the corresponding time frame relative to the previous time frame. The frame sequence, consisting of the frame records of each time slot, is stored in the single script file in compressed form; The single script file is divided into multiple segments of a preset length, wherein each segment carries a segment number and a segment verification value; Each of the aforementioned fragments is sent to the communication device via a general file transfer command, and the communication device then transmits the received fragments to the flight control device.

3. The method according to claim 2, characterized in that, The step of storing the frame sequence, composed of the frame records of each time slot, in compressed form in the single script file includes: Write a file header, a script description header, and a script content section into the single script file; The first checksum, the script identifier, the segment marker, and the frame synchronization code pattern are written into the file header, wherein the first checksum is used to perform file-level verification on the remaining fields in the file header except for the first checksum. A second check value and a script description field serialized according to a preset serialization format are written into the script description header, wherein the second check value is used to perform file-level verification on the script description field; The frame sequence, along with the third check value, is compressed and written into the script content segment.

4. The method according to claim 3, characterized in that, The steps of the flight control device assembling the multiple fragments forwarded by the communication device into the single script file, performing verification on the single script file, and sending the verification result back to the ground station via the communication device include: The flight control device stores the multiple fragments forwarded by the communication device into a buffer. Each time a fragment is received, a fragment check is performed based on the fragment check value carried by the fragment. The fragment that passes the check is responded to by the communication device to the ground station. The fragment that fails the check is not responded to. The verified fragments are assembled into the single script file according to the fragment sequence number carried by each fragment, so that the ground station can detect lost fragments based on the response and perform selective retransmission of the lost fragments. After all the fragments have been received, the flight control device performs an MD5 check on the assembled single script file as a whole. After the MD5 verification is successful, the flight control device receives a verification request sent by the ground station via the communication equipment, wherein the verification request carries the script identifier and the verification type; In response to the verification request, file-level self-verification is first performed by comparing the first verification value, the second verification value, and the third verification value embedded in the single script file level by level. Then, semantic-level verification of streaming decompression and frame-by-frame unpacking is performed on the single script file to verify the legality of frame synchronization, field structure, and payload content of each frame record, and the verification result is obtained. The verification result is sent back to the ground station via the communication device.

5. The method according to claim 3, characterized in that, The frame record includes a type byte and field data. The type byte includes a synchronization field and a bitmap field. The synchronization field carries a code pattern consistent with the frame synchronization code pattern recorded in the file header to describe the data type contained in the corresponding time frame. The bitmap field is a payload presence bitmap, which is used to indicate whether the frame record carries a waypoint field, a light field, and an extended payload field. The field data includes the waypoint field, the light field, and the extended payload field. The waypoint field carries the offset increment of the current time frame relative to the previous waypoint frame.

6. The method according to claim 5, characterized in that, The step of decoding the single script file corresponding to the script identifier includes: The single script file is stream-decompressed to obtain the frame sequence; The frame boundaries of each frame record in the frame sequence are determined according to the type byte and the frame synchronization code pattern. The field composition and frame length of the frame record are determined according to the indication of the bitmap field. The frame number of each frame record is implicitly recovered according to the position order of the frame record in the frame sequence. Based on the frame number and field data recorded in each frame, the performance content of the corresponding time frame is reconstructed to obtain the performance frame.

7. The method according to claim 6, characterized in that, The step of decoding the single script file corresponding to the script identifier further includes: The single script file corresponding to the script identifier is decoded by a loading task independent of the flight execution mission, wherein the loading task operates according to a state machine including idle state, initialization state, loading state and unloading state; In the loading state, the file data of the single script file is read and sent to the streaming decompressor. The decompressed output is written to the circular buffer, and the performance frame is obtained by parsing the circular buffer frame by frame. When the data of the performance frame crosses the wraparound boundary of the circular buffer, the loading task dynamically splices it into a continuous frame body before parsing. If the frame boundary determination fails, the loading task discards the data byte by byte and re-determines the boundary. In the initialization state, if the file size of the single script file is not greater than the preset cache limit, the loading task will read the single script file into memory at once; otherwise, the file handle will be retained for reading in blocks. In the unloading state, when the loading task receives an unloading request forwarded by the communication device, it emptys the message queue and then resets the state machine.

8. A script file processing system, characterized in that, The system includes a ground station, communication equipment, and a flight control unit. The flight control unit is installed on the target UAV in the UAV formation. The ground station is equipped with a merging and splitting unit and a transmission unit. The flight control unit is equipped with an assembly and verification unit and a decoding and storage unit. The merging and splitting unit is used by the ground station to merge at least two script segments into a single script file, split the single script file into multiple segments, and send them to the communication device; The assembly and verification unit is used by the flight control device to assemble the multiple fragments forwarded by the communication device into the single script file, perform verification on the single script file, and send the verification result back to the ground station via the communication device. The sending unit is used by the ground station to send a takeoff command carrying a script identifier to the flight control device via the communication device after the verification result indicates that the verification has passed. The decoding and storage unit is used by the flight control device to decode the single script file corresponding to the script identifier in response to the takeoff command, and store the decoded performance frames into a message queue for consumption by the target UAV during flight execution tasks.

9. A script file processing system, characterized in that, The system includes a ground station, communication equipment, and flight control device. Each of the ground station, communication equipment, and flight control device includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, can implement the method as described in any one of claims 1-7.