WO2021016815A1 - Procédé et appareil d'écriture de paquets de données, terminal de commande et plateforme mobile - Google Patents

Procédé et appareil d'écriture de paquets de données, terminal de commande et plateforme mobile Download PDF

Info

Publication number
WO2021016815A1
WO2021016815A1 PCT/CN2019/098218 CN2019098218W WO2021016815A1 WO 2021016815 A1 WO2021016815 A1 WO 2021016815A1 CN 2019098218 W CN2019098218 W CN 2019098218W WO 2021016815 A1 WO2021016815 A1 WO 2021016815A1
Authority
WO
WIPO (PCT)
Prior art keywords
data packet
storage medium
target storage
writing
data
Prior art date
Application number
PCT/CN2019/098218
Other languages
English (en)
Chinese (zh)
Inventor
陈庙红
郑伟宏
雷云飞
Original Assignee
深圳市大疆创新科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to PCT/CN2019/098218 priority Critical patent/WO2021016815A1/fr
Priority to CN201980030068.5A priority patent/CN112136104A/zh
Publication of WO2021016815A1 publication Critical patent/WO2021016815A1/fr

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers

Definitions

  • the present disclosure relates to the technical field of data writing, and in particular to a data packet writing method, a data packet writing device, a control terminal, a movable platform, and a computer-readable storage medium.
  • the R&D personnel need to designate certain data generated by the aerial photography aircraft to be stored on a certain medium.
  • a storage framework needs to be developed and different API (Application Programming Interface) interfaces are provided to R&D users.
  • API Application Programming Interface
  • the embodiments of the present invention aim to solve at least one of the technical problems existing in the prior art or related technologies.
  • the first aspect of the embodiments of the present invention proposes a data packet writing method.
  • the second aspect of the embodiments of the present invention provides a data packet writing device.
  • the third aspect of the embodiments of the present invention provides a control terminal.
  • the fourth aspect of the embodiments of the present invention provides a movable platform.
  • the fifth aspect of the embodiments of the present invention provides a computer-readable storage medium.
  • an embodiment of the present invention provides a data packet writing method, including: receiving at least one data packet through a preset API interface, and obtaining the attribute characteristics of the data packet; and according to the attribute characteristics of the data packet , Select the target storage medium from multiple preset storage media, and write the data packet to the target storage medium.
  • the target storage medium is allocated to the received data packet among multiple preset storage media, and the data packet is written into the target storage medium, so that the storage interface , Data and storage media have a stable mapping relationship, have good portability and scalability, give full play to the advantages of different storage media, and effectively solve the problem of multiple storage media and multiple types of data storage in different types of aerial photography aircraft.
  • the development workload is large and repetitive, user operation is troublesome, and portability and scalability are poor. Since the mapping relationship between data packets, data interfaces, and storage media can be uniformly specified by preset rules, when the development version is transitioned to the official version, there is no need to manually code to generate firmware, which makes the switching process between the development version and the stable version change. It is simple and easy to operate.
  • an embodiment of the present invention provides a data packet writing device, including: a memory, in which a computer program is stored; a processor, and the processor is configured to run the computer program to realize: receiving at least one data packet through a preset API interface Data packet, and obtain the attribute characteristics of the data packet; According to the attribute characteristics of the data packet, the target storage medium is selected from a plurality of preset storage media, and the data packet is written into the target storage medium.
  • an embodiment of the present invention provides a control terminal that can be used to interact with a user and communicate with the data packet writing device provided in the second aspect of the present disclosure.
  • the control terminal includes: a memory, and the memory stores A computer program; a processor, and the processor is used to run the computer program to realize: receiving the setting operation input by the user; generating a configuration file according to the setting operation, and sending the configuration file to the data packet writing device.
  • the control terminal realizes the setting operation of receiving user input through the processor, wherein the setting operation includes the operation of sending a configuration file to the user, the operation of modifying an existing configuration file, and the operation of generating a new configuration file.
  • the file includes thread pool size, cache size, data package instance, and storage medium instance. It also includes the writing rules corresponding to the attribute information of the above-mentioned data package, that is, the mapping relationship between different data packages and different storage media. Therefore, through the control terminal, the user can freely set the mapping relationship between the data packet instance and the storage medium instance, and then give full play to the advantages of different storage media, effectively solving the problem of multiple storage media and multiple storage media in different models of aerial photography aircraft. Types of data storage require a large amount of development work and high repeatability, troublesome user operations, and poor portability and scalability.
  • an embodiment of the present invention provides a movable platform, including: a body; a power system provided on the body, and the power system is used to provide power for the movable platform; multiple sensors provided on the body, and used for multiple sensors For sensing the environmental information and status information of the mobile platform, and generating at least one data packet; one or more processors are used to receive at least one data packet through a preset API interface and obtain the attribute characteristics of the data packet; The attribute characteristics of the package, the target storage medium is selected from a plurality of preset storage media, and the data package is written into the target storage medium.
  • an embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored.
  • the computer program is executed by a processor, the method for writing data packets as provided in the first aspect of the present disclosure is implemented. Therefore, The computer-readable storage medium includes all the beneficial effects of the data packet writing method as provided in the first aspect of the present disclosure, and therefore will not be repeated.
  • Fig. 1 shows a flowchart of a data packet writing method provided according to an embodiment of this specification
  • FIG. 2 shows a schematic diagram of characteristics of different types of data packets in a method for writing data packets according to an embodiment of the present specification
  • FIG. 3 shows a schematic diagram of the characteristics of different storage media in the data packet writing method provided according to an embodiment of this specification
  • FIG. 4 shows a flowchart of a method for writing data packets according to another embodiment of this specification
  • FIG. 5 shows a flowchart of a method for writing a data packet according to another embodiment of this specification
  • Fig. 6 shows a flow chart of a method for writing data packets according to another embodiment of this specification
  • FIG. 7 shows a flowchart of a method for writing data packets according to another embodiment of the present specification.
  • FIG. 8 shows a flowchart of a method for writing data packets according to another embodiment of this specification.
  • FIG. 9 shows a flowchart of a method for writing data packets according to another embodiment of this specification.
  • FIG. 10 shows a structural block diagram of a data packet writing device provided according to an embodiment of this specification.
  • FIG. 11 shows a structural block diagram of a data packet writing device according to another embodiment of this specification.
  • FIG. 12 shows a schematic diagram of a system framework in a data packet writing device provided according to an embodiment of this specification
  • FIG. 13 shows a structural block diagram of a control terminal provided according to an embodiment of this specification.
  • Figure 14 shows a structural block diagram of a movable platform provided according to an embodiment of this specification
  • Fig. 15 shows a structural block diagram of a movable platform provided according to an embodiment of this specification.
  • the following describes the data packet writing method, the data packet writing device, the control terminal, the removable platform, and the computer-readable storage medium according to some embodiments of the present specification with reference to FIGS. 1 to 15.
  • a data packet writing method which includes:
  • S102 Receive at least one data packet through a preset API interface, and obtain attribute characteristics of the data packet;
  • a target storage medium is selected from a plurality of preset storage media, and the data packet is written into the target storage medium.
  • At least one data packet is received through a preset API interface, where the preset API interface is a unified API interface designated by the user, and all types of data packets are received through the unified API interface, avoiding storage media Different APIs are developed differently, leading to the problem of heavy development workload and high repetitiveness.
  • the attribute characteristics of the data packet are obtained, and the target storage medium for storing the data packet is selected from a plurality of preset storage media according to the attribute characteristics of the data packet. Specifically, as shown in Figure 2 and Figure 3, the frequency (that is, the frequency of the data packet received in a unit time), size and other types of different data packets are different, and the indicators of different storage media are also different.
  • the data packet is stored in a storage medium with indicators matching its attribute characteristics, which can effectively solve the problem of competing between storage IO (Input/Output) bandwidth and storage space in the storage of data, and at the same time solve the problem of Under the condition of limited storage space and bandwidth, the problem of real-time storage of data packets generated during the operation of aerial photography aircraft and other devices in a suitable storage medium.
  • storage IO Input/Output
  • the attribute feature includes one or more of the following: file size of the data packet, frequency of the data packet, configuration information corresponding to the data packet, and information about whether the data packet can be cached.
  • the attribute characteristics of the data packet include the file size of the data packet, the frequency of the data packet, the configuration information corresponding to the data packet, and whether the data packet can be cached.
  • the size of the data packet is the file of the data packet. Size. This attribute may include the storage medium space required to store the data packet.
  • the frequency of data packets can include the number of times the same type of data packets appear in a unit time.
  • the configuration information corresponding to the data package can include whether the data package is designated by the user or the developer to be stored in the designated storage medium, such as the "photo" data package designated by the user to be stored in the storage medium "TF (Trans-Flash) card” , Just use the configuration file to bind the configuration information "stored in TF card” with the data package "photo”.
  • the cacheable information of a data packet indicates whether the data packet can be cached in a cache area such as memory during the process of writing to the corresponding storage medium. If the data packet can be cached, it will be written after the data packet is received Before loading into the corresponding target storage medium, it is first cached in the cache area, and then extracted from the cache area and written to the target storage medium. If the data packet cannot be cached, the data packet is directly written to the target storage medium through an idle thread in the corresponding thread pool.
  • the step of obtaining the attribute characteristics of the data packet specifically includes:
  • S402 Acquire complete information of the data packet, and determine whether the data packet is a complete data packet according to the complete information of the data packet;
  • the storage engine after receiving the data packet, the storage engine triggers the message listener to obtain the complete information of the data packet, and then determines whether the data packet is a complete data packet.
  • the storage engine triggers the message listener to obtain the complete information of the data packet, and then determines whether the data packet is a complete data packet.
  • the integrity of the data packet needs to be verified, and only the corresponding target storage is allocated for the complete data packet.
  • the medium can avoid the risk of storing "damaged" data packets.
  • each preset storage medium corresponds to a preset thread pool; after the step of selecting the target storage medium from the multiple preset storage media, the writing method It also includes: distributing the data packets to the thread pool corresponding to the target storage medium, so as to store the data packets on the target storage medium through idle threads in the thread pool.
  • each preset storage medium corresponds to a preset thread pool.
  • the corresponding relationship may be preset by software or specified by the user or developer. After the target storage medium of the data packet is selected from the preset storage medium, the data packet is distributed to the thread pool corresponding to the target storage medium, so that the data packet is stored in the target storage medium through the idle thread in the thread pool.
  • the step of obtaining the attribute characteristics of the data packet further includes: discarding the data packet based on the fact that the data packet is an incomplete data packet.
  • the storage engine after receiving the data packet, the storage engine triggers the message listener to obtain the complete information of the data packet, and then determines whether the data packet is a complete data packet. If the data packet is an incomplete data packet, it means that the data packet has been damaged during transmission and is an invalid data packet. At this time, the data packet is discarded to avoid wasting resources and storage space.
  • the data packet writing method further includes: receiving a configuration file sent by the control terminal.
  • control terminal is a terminal held by a user or R&D personnel
  • the configuration file may include data that can be configured by the user, such as the mapping relationship between the attribute characteristics of the data packet and the target storage medium.
  • the configuration file sent by the terminal enables users to freely configure the writing process of data packets according to actual needs.
  • the data packet writing method further includes: receiving a configuration instruction sent by the control terminal, and generating a configuration file according to the configuration instruction.
  • a configuration instruction sent by a terminal held by a user or R&D personnel is received.
  • the user or R&D personnel sends the configuration instruction to a device such as a mobile platform, and then directly compiles and generates a corresponding configuration file on the device.
  • users can freely configure the writing process of data packets according to actual needs.
  • the data packet writing method further includes: receiving a modification instruction for the configuration file sent by the control terminal, and modifying the configuration file according to the modification instruction.
  • the user or researcher can send a modification instruction to the existing configuration file through the control terminal held by him, and modify one of the configuration files through the modification instruction.
  • One or more items to realize the dynamic and free configuration of data packet writing process are possible.
  • the configuration file includes one or more of the following: thread pool size, cache size, data package instance, and storage medium instance.
  • the configuration file may include the size of the thread pool, and the thread pool may be corresponding to at least one storage medium for accommodating at least one thread configured to write data packets into the storage medium, where the thread pool
  • the size can include the number of threads that the thread pool can hold.
  • the cache size may include the size of the cache area that can be used to cache data packets, where the cache area can be divided into the running memory or other internal storage space of devices such as mobile platforms through configuration files, where the cache size may include the divided The amount of space available for buffering data packets in the buffer area.
  • the data packet instance may include a mark for a specific data packet.
  • a mobile platform has a shooting function, after taking a picture, a data packet of the taken picture is generated, and the data packet satisfies an instance of a "picture" data packet.
  • the data packet instance may also include the size of the data packet, for example, for a mobile platform, how many times the flight data can be stored.
  • Examples of storage media include storage media names, such as TF card, FLASH memory, or APP server.
  • the configuration file may also include the storage medium corresponding to the data packet specifying an instance. For example, the data packet that conforms to the "picture" data packet instance is written into the "TF card” according to preset writing rules. "The storage medium of the instance.
  • the configuration file includes configuration information for selecting a local storage medium.
  • the configuration file includes configuration information for selecting an ontology storage medium.
  • the configuration information includes a mapping relationship between any data package instance and any local storage medium instance.
  • the step of determining the target storage medium corresponding to the attribute feature specifically includes:
  • S502 Obtain a configuration file, and determine a writing rule corresponding to the attribute information of the data packet according to the configuration file;
  • S504 Determine the target storage medium according to the writing rule.
  • the configuration file is received from the control terminal.
  • the configuration file includes thread pool size, cache size, data package instance, and storage medium instance, and includes a write indicating the mapping relationship between a specific data package instance and a specific storage medium instance.
  • Entry rules are specifically the mapping relationship between the attribute characteristics of the data packet instance and the target storage medium. Specifically, after the data packet is received and the attribute characteristics of the data packet are obtained, the writing rule corresponding to the corresponding attribute characteristic is obtained according to the configuration file, and the target storage medium corresponding to the data packet is determined according to the writing rule, And write the data packet to the corresponding target storage medium according to the writing rule.
  • each storage medium corresponds to a pre-configured thread pool.
  • the writing method further includes :
  • S602 Determine the thread pool corresponding to the data packet
  • S604 Call the first idle thread in the thread pool to buffer the data packet in the buffer area.
  • a pre-configured thread pool is allocated to each storage medium according to the configuration file, where each thread in the thread pool is used to write a data packet to the corresponding storage medium.
  • the system loads the user configuration file, initializes the thread pool according to the configuration file, and registers a message listener to intercept each data packet, and according to the attribute characteristics of the data packet, specifically the data packet For the cacheable data packet and the target storage medium corresponding to the data packet, the data packet is distributed to the thread pool corresponding to the target storage medium.
  • the thread pool After receiving the unconfigured data packet, the thread pool calls the first idle thread to cache the data packet in the buffer area based on the data packet being a cacheable data packet.
  • the data packet writing method further includes: setting a cache area in a preset storage space according to the configuration file; wherein the cache area is used to cache at least one data packet.
  • the cache area is set in the preset storage space according to the configuration file.
  • the preset storage space may be a running memory (RAM, random Access Memory), or any memory configured by itself.
  • the configuration file also includes the required cache area size.
  • the cache area of the specified size is divided in the specified storage space according to the configuration file. In the case of a data packet that can be cached, the first idle thread in the thread pool The data packet is buffered to the buffer area.
  • the step of writing the data packet to the target storage medium includes:
  • S702 Read multiple data packets in the buffer area, and perform a merge operation on the multiple data packets to generate a merged data packet;
  • S704 Write the combined data packet to the target storage medium.
  • the storage medium IO will be blocked and the writing time Long, resulting in lowering the efficiency of writing data packets.
  • the "fragmented" data packets with higher frequency and smaller file size are cached in the cache area first, and multiple data packets in the cache area are merged to generate a complete merged data packet.
  • Writing the combined data packet to the target storage medium can effectively reduce the blockage of the "fragmented" data packet on the target storage medium IO during the writing process, and effectively increase the writing speed of the data packet.
  • the step of writing the data packet to the target storage medium includes:
  • S802 Acquire the target storage medium corresponding to the data packet and the sequence information corresponding to the data packet;
  • S804 Call a second idle thread in the thread pool to write the data packet into the target storage medium according to the sequence information.
  • the corresponding thread pool is selected according to the target storage medium corresponding to each data packet in this type of data packet, and called The second idle thread in the corresponding thread pool writes the data packet into the target storage medium according to the sequence information.
  • the sequence information may be the sequence in which the data packet is cached to the cache area. Because the write bandwidth of the target storage medium is limited, when a large number of data packets are written to the target storage medium at the same time, it will cause IO congestion of the target storage medium. At this time, the data packets are written into the buffer area first, and multiple data packets are "queued" according to the order of the buffer. The second idle thread is called to write the data packets into the target storage medium in the order of queuing, which can effectively avoid storage The IO congestion caused by insufficient bandwidth of the medium improves the efficiency of data packet writing.
  • the data packet is first cached in the cache area and then stored in the target storage medium belongs to an asynchronous storage method.
  • the step of combining multiple data packets to generate a combined data packet includes: if the number of the multiple data packets meets a preset combining condition, the multiple data packets Perform a merge operation to generate a merged data package.
  • the step of writing the data packet to the target storage medium further includes:
  • S904 Call an idle thread in the thread pool to write the data packet directly into the target storage medium.
  • the cache information is not cacheable, or the configuration file indicates that the data packet needs to be written directly to the storage medium.
  • writing directly to the target storage medium belongs to a synchronous mode.
  • the data packet writing method further includes: if the remaining space of the target storage medium is less than a preset space threshold, deleting at least one data packet in all data packets.
  • the remaining space of the target storage medium is less than the preset space threshold
  • at least one data in all data packets stored in the target storage medium is deleted Packets, until the remaining space of the target storage medium is not less than the preset space threshold, that is, the write conditions of the latest data packet are met to ensure that the data packet may not be lost.
  • At least one data packet with a lower priority is deleted.
  • the data packet writing method further includes: if the remaining space of the target storage medium is less than a preset space threshold, deleting according to the writing time of all data packets in the target storage medium At least one data packet with the earliest write time.
  • the storage batch of data packets can also be configured.
  • the storage batch of data packets can also be configured.
  • the remaining space of the target storage medium is less than the preset space threshold, that is, when the remaining space is not enough to meet the writing condition of the latest data packet, delete all data packets in the order of writing time in the target storage medium. At least one data packet with the earliest writing time.
  • delete the "oldest" data packet according to the writing time sequence of the data packet thereby realizing the dynamic rolling writing of the data packet in the target storage medium, avoiding storage space Insufficiency causes data loss.
  • the data packet writing method further includes: if the remaining space of the target storage medium is less than the size of the data packet to be written to the target storage medium in the thread pool corresponding to the target storage medium, according to the target The write time of all data packets in the storage medium, delete at least one data packet in all the data packets, until the remaining space of the target storage medium is greater than the size of the data packet to be written to the target storage medium.
  • the system determines the remaining space of the target storage medium corresponding to the data packet. If the remaining space of the target storage medium is less than the size of the data packet to be written, That is, the remaining space of the current target storage medium is not enough to save the data packet. To ensure the smooth writing of the data packet, according to the writing time of all the data packets in the target storage medium, delete at least one data packet in all the data packets.
  • the target storage medium includes at least one or more: TF card, NAND flash memory, external storage terminal, and APP server.
  • the target storage medium includes a TF card, such as an expansion memory card, which is pluggably installed in a removable platform.
  • the TF card has large space, large link bandwidth and IO Features of small bandwidth.
  • the target storage medium also includes NAND flash memory (NAND flash memory), which is integrated on the motherboard and has the characteristics of small space, large link bandwidth and small IO bandwidth.
  • External storage terminals include control terminals, such as remote controllers, smart phones, upper computer control terminals, etc.
  • External storage terminals are generally a complete set of hardware terminals, including processors, communication devices, and memory.
  • the external storage terminals communicate with mobile devices through communication devices.
  • Platforms such as unmanned aerial vehicles
  • the unmanned aerial vehicle captures a video file during aerial photography, generates one or more data packets corresponding to the video file, and transfers the data through wireless transmission with an external storage terminal The packet is sent to the external storage terminal.
  • the external storage terminal After receiving the data packet through the communication device, the external storage terminal writes the data packet into its own memory through its own processor.
  • the APP server includes a cloud server.
  • the mobile platform (such as an unmanned aerial vehicle) uploads the data packet to the APP server in the cloud through its own network connection, and the APP server writes the data packet into the cloud storage space after receiving the data packet.
  • the data packet writing method is applied to a movable platform.
  • the mobile platform includes a communication device, which can be used to interact with an external storage terminal and/or an APP server;
  • the steps of writing data packets into the target storage medium include:
  • the communication device is called to send the data packet and the write instruction corresponding to the data packet to the external storage terminal and/or APP server, so that the external storage terminal and/or APP server write the data packet according to the write instruction.
  • the data packet writing method is applied to a movable platform.
  • the movable platform includes an unmanned aerial vehicle.
  • the unmanned aerial vehicle has a power device, a control device, a storage device, an energy storage device, a communication device, and a camera.
  • the energy storage device provides energy for the power device.
  • the power device drives the unmanned aerial vehicle to fly under the control of the control device, receives control instructions from the control terminal through the communication device, and controls the camera to shoot images/videos according to the control instructions.
  • various data packets will be generated, such as log data packets for recording the flight process, received control/debugging command data packets, and generated during image/video shooting Image data packets, etc., where the attributes and characteristics of each data packet are different.
  • the log data packet has a small size and high frequency
  • the image data packet has a small frequency and large size. Therefore, it is preferable to store different data packets in different
  • the storage medium of different frequencies and sizes can be automatically distributed to different storage media (such as TF) under the restriction of the storage space and performance bandwidth of different storage media corresponding to the unmanned aerial vehicle.
  • Card, NAND flash memory, external storage terminal, APP server, etc. for processing and storage.
  • the mobile platform interacts with the external storage terminal and the APP server through the communication device, and sends the data packet and the corresponding write instruction to the corresponding external storage by calling the communication device
  • the R&D personnel of the mobile platform combine the characteristics of the system and specify the thread pool size, cache area size, data package instance, storage medium instance and other items by setting the configuration file, so that the mobile platform is based on software
  • Different storage locations for different data packets are dynamically selected.
  • the storage medium can also be dynamically selected through a specific APP. For example, for users with confidential data protection needs, they can choose local storage media.
  • the mobile platform loads the configuration file, generates write rules according to the configuration file, initializes the memory pool to generate the cache area, and initializes the thread pool to obtain the minimum value corresponding to each storage medium.
  • a thread pool In the process of powering on and initializing the mobile platform, the mobile platform loads the configuration file, generates write rules according to the configuration file, initializes the memory pool to generate the cache area, and initializes the thread pool to obtain the minimum value corresponding to each storage medium.
  • a thread pool is
  • the R&D personnel can specify a preset API interface to receive various data packets and distribute them to the storage engine.
  • the storage engine triggers the message listener to check the integrity of the data packet and determine the attributes and characteristics of the data packet, including The frequency, size, and caching of data packets. After the integrity check of the data packet, the incomplete data packet is discarded to ensure the correctness of the data.
  • the data packet is assigned when the target according to the writing rules
  • the data packet is intercepted by the message processor, and the data packet is distributed to the thread pool of the corresponding target medium.
  • the thread pool allocates idle threads, and selects the data packet to be cached to the cache area according to the user configuration, or write directly Into the target storage medium.
  • the configuration file can be freely configured according to the actual needs of the user.
  • the remaining space of the target storage medium is insufficient, it can be based on information such as the write time, priority, data packet size, and number of data packets stored in the target storage medium. Delete at least one data packet to provide enough storage space for the new data packet, realize dynamic rolling storage, and avoid data loss due to insufficient storage space.
  • a data packet writing device 10 which includes: a memory 12 in which a computer program is stored; a processor 14, which is used to run the computer program To achieve: receive at least one data packet through the preset API interface, and obtain the attribute characteristics of the data packet; according to the attribute characteristics of the data packet, select the target storage medium from a plurality of preset storage media, and write the data packet into the target Storage medium.
  • At least one data packet is received through a preset API interface, where the preset API interface is a unified API interface designated by the user, and all types of data packets are received through the unified API interface, avoiding storage media Different APIs are developed differently, leading to the problem of heavy development workload and high repetitiveness.
  • the attribute characteristics of the data packet are obtained, and the target storage medium for storing the data packet is selected from a plurality of preset storage media according to the attribute characteristics of the data packet.
  • the frequency the frequency of the data packet received per unit time
  • size and other types of different data packets are different, and the indicators of different storage media are also different, so according to the data packet Attribute characteristics, storing the data packet in a storage medium with indicators matching its attribute characteristics can effectively solve the problem of competing between storage IO (Input/Output) bandwidth and storage space in the storage Under the condition of limited space and bandwidth, the problem of real-time storage of data packets generated during the working process of aerial photography aircraft and other devices in a suitable storage medium.
  • storage IO Input/Output
  • the attribute feature includes one or more of the following: file size of the data packet, frequency of the data packet, configuration information corresponding to the data packet, and information about whether the data packet can be cached.
  • the attribute characteristics of the data packet include the file size of the data packet, the frequency of the data packet, the configuration information corresponding to the data packet, and whether the data packet can be cached.
  • the size of the data packet is the file of the data packet. Size. This attribute may include the storage medium space required to store the data packet.
  • the frequency of data packets can include the number of times the same type of data packets appear in a unit time.
  • the configuration information corresponding to the data package can include whether the data package is designated by the user or the developer to be stored in the designated storage medium, such as the "photo" data package designated by the user to be stored in the storage medium "TF (Trans-Flash) card” , Just use the configuration file to bind the configuration information "stored in TF card” with the data package "photo”.
  • the cacheable information of a data packet indicates whether the data packet can be cached in a cache area such as memory during the process of writing to the corresponding storage medium. If the data packet can be cached, it will be written after the data packet is received Before loading into the corresponding target storage medium, it is first cached in the cache area, and then extracted from the cache area and written to the target storage medium. If the data packet cannot be cached, the data packet is directly written to the target storage medium through an idle thread in the corresponding thread pool.
  • the processor 14 runs a computer program to implement the step of acquiring the attribute characteristics of the data packet, which specifically includes: acquiring the complete information of the data packet, and according to the data packet The complete information determines whether the data packet is a complete data packet; when the data packet is a complete data packet, the target storage medium is selected from a plurality of preset storage media.
  • the storage engine after receiving the data packet, the storage engine triggers the message listener to obtain the complete information of the data packet, and then determines whether the data packet is a complete data packet.
  • the storage engine triggers the message listener to obtain the complete information of the data packet, and then determines whether the data packet is a complete data packet.
  • the integrity of the data packet needs to be verified, and only the corresponding target storage is allocated for the complete data packet.
  • the medium can avoid the risk of storing "damaged" data packets.
  • each preset storage medium corresponds to a preset thread pool; after the step of selecting the target storage medium from the multiple preset storage media, the writing method It also includes: distributing the data packets to the thread pool corresponding to the target storage medium, so as to store the data packets on the target storage medium through idle threads in the thread pool.
  • each preset storage medium corresponds to a preset thread pool.
  • the corresponding relationship may be preset by software or specified by the user or developer. After the target storage medium of the data packet is selected from the preset storage medium, the data packet is distributed to the thread pool corresponding to the target storage medium, so that the data packet is stored in the target storage medium through the idle thread in the thread pool.
  • the processor 14 runs a computer program to implement the step of obtaining the attribute characteristics of the data packet, and further includes: discarding the data based on the incomplete data packet. package.
  • the storage engine after receiving the data packet, the storage engine triggers the message listener to obtain the complete information of the data packet, and then determines whether the data packet is a complete data packet. If the data packet is an incomplete data packet, it means that the data packet has been damaged during the transmission process and is an invalid data packet. At this time, the data packet is discarded to avoid wasting resources and storage space.
  • the processor 14 runs a computer program to realize: receiving the configuration file sent by the control terminal.
  • control terminal is a terminal held by a user or R&D personnel
  • the configuration file may include data that can be configured by the user, such as the mapping relationship between the attribute characteristics of the data packet and the target storage medium.
  • the configuration file sent by the terminal enables users to freely configure the writing process of data packets according to actual needs.
  • the processor 14 runs a computer program to realize: receiving a configuration instruction sent by a control terminal, and generating a configuration file according to the configuration instruction.
  • a configuration instruction sent by a terminal held by a user or R&D personnel is received.
  • the user or R&D personnel sends the configuration instruction to a device such as a mobile platform, and then directly compiles and generates a corresponding configuration file on the device.
  • users can freely configure the writing process of data packets according to actual needs.
  • the processor 14 runs a computer program to realize: receiving a modification instruction for the configuration file sent by the control terminal, and modifying the configuration file according to the modification instruction.
  • the user or researcher can send a modification instruction to the existing configuration file through the control terminal held by him, and modify one of the configuration files through the modification instruction.
  • One or more items to realize the dynamic and free configuration of data packet writing process are possible.
  • the configuration file includes one or more of the following: thread pool size, cache size, data package instance, and storage medium instance.
  • the configuration file may include the size of the thread pool, and the thread pool may be corresponding to at least one storage medium for accommodating at least one thread configured to write data packets into the storage medium, where the thread pool
  • the size can include the number of threads that the thread pool can hold.
  • the cache size may include the size of the cache area that can be used to cache data packets, where the cache area can be divided into the running memory or other internal storage space of devices such as mobile platforms through configuration files, where the cache size may include the divided The amount of space available for buffering data packets in the buffer area.
  • a data packet instance may be a mark of a specific data packet.
  • a mobile platform has a shooting function, after taking a picture, a data packet of the taken picture is generated, and the data packet satisfies an instance of a "picture" data packet.
  • the data packet instance may also include the size of the data packet, for example, for a mobile platform, how many times the flight data can be stored.
  • Examples of storage media include storage media names, such as TF card, FLASH memory, or APP server.
  • the configuration file may also include the storage medium corresponding to the data packet specifying an instance. For example, the data packet that conforms to the "picture" data packet instance is written into the "TF card” according to the preset writing rules. "The storage medium of the instance.
  • the configuration file includes configuration information for selecting a local storage medium.
  • the configuration file includes configuration information for selecting an ontology storage medium.
  • the configuration information includes a mapping relationship between any data package instance and any local storage medium instance.
  • the processor 14 runs a computer program to implement the step of determining the target storage medium corresponding to the attribute feature, which specifically includes: obtaining a configuration file, and determining data according to the configuration file
  • the writing rule corresponding to the attribute information of the package; the target storage medium is determined according to the writing rule.
  • the configuration file is received from the control terminal.
  • the configuration file includes thread pool size, cache size, data package instance, and storage medium instance, and includes a write indicating the mapping relationship between a specific data package instance and a specific storage medium instance.
  • Entry rules are specifically the mapping relationship between the attribute characteristics of the data packet instance and the target storage medium. Specifically, after the data packet is received and the attribute characteristics of the data packet are obtained, the writing rule corresponding to the corresponding attribute characteristic is obtained according to the configuration file, and the target storage medium corresponding to the data packet is determined according to the writing rule, And write the data packet to the corresponding target storage medium according to the writing rule.
  • each storage medium corresponds to a pre-configured thread pool
  • the processor 14 runs a computer program to implement the step of writing data packets into the target storage medium. Before, it also includes: determining the thread pool corresponding to the data packet; calling the first idle thread in the thread pool to cache the data packet in the buffer area.
  • a pre-configured thread pool is allocated to each storage medium according to the configuration file, where each thread in the thread pool is used to write a data packet to the corresponding storage medium.
  • the system loads the user configuration file, initializes the thread pool according to the configuration file, and registers a message listener to intercept each data packet, and according to the attribute characteristics of the data packet, specifically the data packet For the cacheable data packet and the target storage medium corresponding to the data packet, the data packet is distributed to the thread pool corresponding to the target storage medium.
  • the thread pool After receiving the unconfigured data packet, the thread pool calls the first idle thread to cache the data packet in the buffer area based on the data packet being a cacheable data packet.
  • the processor 14 runs a computer program to realize: according to the configuration file, a cache area is set in a preset storage space; wherein the cache area is used for At least one packet is cached.
  • the cache area is set in the preset storage space according to the configuration file.
  • the preset storage space may be a running memory (RAM, random Access Memory), or any memory configured by itself.
  • the configuration file also includes the required cache area size.
  • the cache area of the specified size is divided in the specified storage space according to the configuration file. In the case of a data packet that can be cached, the first idle thread in the thread pool The data packet is buffered to the buffer area.
  • the processor 14 runs a computer program to implement the step of writing data packets into the target storage medium, including: reading multiple data packets in the cache area , And combine multiple data packets to generate a combined data packet; write the combined data packet into the target storage medium.
  • the storage medium IO will be blocked and the writing time Long, resulting in lowering the efficiency of writing data packets.
  • the "fragmented" data packets with higher frequency and smaller file size are cached in the cache area first, and multiple data packets in the cache area are merged to generate a complete merged data packet.
  • Writing the combined data packet to the target storage medium can effectively reduce the blockage of the "fragmented" data packet on the target storage medium IO during the writing process, and effectively increase the writing speed of the data packet.
  • the processor 14 runs a computer program to implement the step of writing the data packet to the target storage medium, including: obtaining the target storage medium and data corresponding to the data packet Sequence information corresponding to the packet; the second idle thread in the calling thread pool writes the data packet into the target storage medium according to the sequence information.
  • the corresponding thread pool is selected according to the target storage medium corresponding to each data packet in this type of data packet, and called The second idle thread in the corresponding thread pool writes the data packet into the target storage medium according to the sequence information.
  • the sequence information may be the sequence in which the data packet is cached to the cache area. Because the write bandwidth of the target storage medium is limited, when a large number of data packets are written to the target storage medium at the same time, it will cause IO congestion of the target storage medium. At this time, the data packets are written into the buffer area first, and multiple data packets are "queued" according to the order of the buffer. The second idle thread is called to write the data packets into the target storage medium in the order of queuing, which can effectively avoid storage The IO congestion caused by insufficient bandwidth of the medium improves the efficiency of data packet writing.
  • the data packet is first cached in the cache area and then stored in the target storage medium belongs to an asynchronous storage method.
  • the processor 14 runs a computer program to implement the step of combining multiple data packets to generate a combined data packet, including: When the quantity meets the preset merging condition, a merge operation is performed on multiple data packets to generate a merged data packet.
  • the processor 14 runs a computer program to implement the step of writing the data packet to the target storage medium, including: determining the thread pool corresponding to the data packet; The idle threads in the pool write data packets directly to the target storage medium.
  • the cache information is not cacheable, or the configuration file indicates that the data packet needs to be written directly to the storage medium.
  • writing directly to the target storage medium belongs to a synchronous mode.
  • the processor 14 is configured to run a computer program to realize: if the remaining space of the target storage medium is less than a preset space threshold, delete all data packets At least one packet.
  • the remaining space of the target storage medium is less than the preset space threshold
  • at least one data in all data packets stored in the target storage medium is deleted Packets, until the remaining space of the target storage medium is not less than the preset space threshold, that is, the write conditions of the latest data packet are met to ensure that the data packet may not be lost.
  • At least one data packet with a lower priority is deleted.
  • the processor 14 is used to run a computer program to realize: if the remaining space of the target storage medium is less than a preset space threshold, according to the target storage medium The write time of all data packets, delete at least one data packet with the earliest write time.
  • the storage batch of data packets can also be configured.
  • the storage batch of data packets can also be configured.
  • the remaining space of the target storage medium is less than the preset space threshold, that is, when the remaining space is not enough to meet the writing condition of the latest data packet, delete all data packets in the order of writing time in the target storage medium. At least one data packet with the earliest writing time.
  • delete the "oldest" data packet according to the writing time sequence of the data packet thereby realizing the dynamic rolling writing of the data packet in the target storage medium, avoiding storage space Insufficiency causes data loss.
  • the processor 14 is used to run a computer program to achieve: if the remaining space of the target storage medium is less than the thread pool corresponding to the target storage medium, the target will be written According to the data packet size of the storage medium, delete at least one data packet in all data packets according to the write time of all data packets in the target storage medium until the remaining space of the target storage medium is greater than the size of the data packet to be written to the target storage medium.
  • the system determines the remaining space of the target storage medium corresponding to the data packet. If the remaining space of the target storage medium is less than the size of the data packet to be written, That is, the remaining space of the current target storage medium is not enough to save the data packet. To ensure the smooth writing of the data packet, according to the writing time of all the data packets in the target storage medium, delete at least one data packet in all the data packets.
  • the target storage medium includes at least one or more: TF card, NAND flash memory, external storage terminal, and APP server.
  • the target storage medium includes a TF card, such as an expansion memory card, which is pluggably installed in a removable platform.
  • the TF card has large space, large link bandwidth and IO Features of small bandwidth.
  • the target storage medium also includes NAND flash memory (NAND flash memory), which is integrated on the motherboard and has the characteristics of small space, large link bandwidth and small IO bandwidth.
  • External storage terminals include control terminals, such as remote controllers, smart phones, upper computer control terminals, etc.
  • External storage terminals are generally a complete set of hardware terminals, including processors, communication devices, and memory.
  • the external storage terminals communicate with mobile devices through communication devices.
  • Platforms such as unmanned aerial vehicles
  • the unmanned aerial vehicle captures a video file during aerial photography, generates one or more data packets corresponding to the video file, and transfers the data through wireless transmission with an external storage terminal The packet is sent to the external storage terminal.
  • the external storage terminal After receiving the data packet through the communication device, the external storage terminal writes the data packet into its own memory through its own processor.
  • the APP server includes a cloud server.
  • the mobile platform (such as an unmanned aerial vehicle) uploads the data packet to the APP server in the cloud through its own network connection, and the APP server writes the data packet into the cloud storage space after receiving the data packet.
  • the data packet writing device 20 is applied to a movable platform.
  • the data packet writing device 20 includes a memory 22, a processor 24, and a communication device 26.
  • the communication device 26 can be used to interact with an external storage terminal and/or an APP server; the processor 24 is used to:
  • the external storage terminal and/or APP server calls the communication device 26 to send the data packet and the write instruction corresponding to the data packet to the external storage terminal and/or APP server, so that the external storage terminal and/or APP server writes according to the write instruction Into the data packet.
  • the data packet writing method is applied to a movable platform.
  • the movable platform includes an unmanned aerial vehicle.
  • the unmanned aerial vehicle has a power device, a control device, a storage device, an energy storage device, a communication device, and a camera.
  • the energy storage device provides energy for the power device.
  • the power device drives the unmanned aerial vehicle to fly under the control of the control device, receives control instructions from the control terminal through the communication device, and controls the camera to shoot images/videos according to the control instructions.
  • various data packets will be generated, such as log data packets for recording the flight process, received control/debugging command data packets, and generated during image/video shooting Image data packets, etc., where the attributes and characteristics of each data packet are different.
  • the log data packet has a small size and high frequency
  • the image data packet has a small frequency and large size. Therefore, it is preferable to store different data packets in different
  • the storage medium of different frequencies and sizes can be automatically distributed to different storage media (such as TF) under the restriction of the storage space and performance bandwidth of different storage media corresponding to the unmanned aerial vehicle.
  • Card, NAND flash memory, external storage terminal, APP server, etc. for processing and storage.
  • the mobile platform interacts with the external storage terminal and the APP server through the communication device, and sends the data packet and the corresponding write instruction to the corresponding external storage by calling the communication device
  • the R&D personnel of the mobile platform combine the characteristics of the system and specify the thread pool size, cache area size, data package instance, storage medium instance and other items by setting the configuration file, so that the mobile platform is based on software
  • Different storage locations for different data packets are dynamically selected.
  • the storage medium can also be dynamically selected through a specific APP. For example, for users with confidential data protection needs, they can choose local storage media.
  • the mobile platform loads the configuration file, generates write rules according to the configuration file, initializes the memory pool to generate the cache area, and initializes the thread pool to obtain the minimum value corresponding to each storage medium.
  • a thread pool In the process of powering on and initializing the mobile platform, the mobile platform loads the configuration file, generates write rules according to the configuration file, initializes the memory pool to generate the cache area, and initializes the thread pool to obtain the minimum value corresponding to each storage medium.
  • a thread pool is
  • the R&D personnel can specify a preset API interface to receive various data packets and distribute them to the storage engine.
  • the storage engine triggers the message listener to check the integrity of the data packet and determine the attributes and characteristics of the data packet, including The frequency, size, and caching of data packets. After the integrity check of the data packet, the incomplete data packet is discarded to ensure the correctness of the data.
  • the data packet is assigned when the target according to the writing rules
  • the data packet is intercepted by the message processor, and the data packet is distributed to the thread pool of the corresponding target medium.
  • the thread pool allocates idle threads, and selects the data packet to be cached to the cache area according to the user configuration, or write directly Into the target storage medium.
  • the configuration file can be freely configured according to the actual needs of the user.
  • the remaining space of the target storage medium is insufficient, it can be based on information such as the write time, priority, data packet size, and number of data packets stored in the target storage medium. Delete at least one data packet to provide enough storage space for the new data packet, realize dynamic rolling storage, and avoid data loss due to insufficient storage space.
  • the data packet writing device realizes automatic distribution of different data packets to different storage mediums through the system framework shown in Figure 12, which is based on the internal message listener and message processor to realize the complete data package Checking, and automatically selecting and assigning data packets to special storage media for storage.
  • the parameters of the framework can be configured, and users can configure the size of the thread pool in combination with storage media, system load, and data types.
  • asynchronous storage mode when writing data packets, it specifically includes asynchronous storage mode and synchronous storage mode.
  • buffer and cache can be selected. Buffer and cache are used to store asynchronous storage data packets. For high-frequency small Data can reduce the bandwidth pressure of the storage medium.
  • the synchronous storage method writes the data packet directly into the corresponding target storage medium.
  • the message processor intercepts data packets and distributes them to thread pools corresponding to different storage media. It is understandable that other data packet processing methods can also be customized.
  • the message listener can be used to check the frequency, size and other attributes of the data packet for integrity check, and in the case of a complete data packet, according to the attribute characteristics of the data packet, automatically select the data packet according to the writing rules Target storage medium.
  • a control terminal 30 is provided.
  • the control terminal 30 can be used to interact with the user and to write to the data packet provided in the second embodiment of this specification.
  • the control terminal 30 includes: a memory 32 in which a computer program is stored; a processor 34, which is used to run the computer program to realize: receiving a setting operation input by a user; generating a configuration file according to the setting operation, And send the configuration file to the data packet writing device.
  • the control terminal 30 receives the setting operation input by the user, and generates a corresponding configuration file according to the setting operation.
  • the control terminal 30 is a terminal held by a developer or a general user.
  • the control terminal 30 is provided with a corresponding human-computer interaction interface, such as a touch screen, a keyboard, a voice recognition device, etc., and receives user input setting operations through the human interaction interface ,
  • the processor 34 generates a corresponding configuration file according to the setting operation input by the user.
  • the control terminal 30 can also communicate with the data packet writing device to send the configuration file generated according to the setting operation input by the user to the data packet writing device to realize all custom settings for the data packet writing rules, and Live Update.
  • the processor 34 is configured to run a computer program to realize: generate a corresponding configuration instruction according to the setting operation, and send the configuration instruction to the data packet writing device.
  • the processor 34 After the control terminal 30 receives the setting operation input by the user, the processor 34 generates a corresponding configuration instruction according to the setting operation.
  • the configuration instruction is used to control the data packet writing device to generate a corresponding configuration file, that is, through The control terminal 30 remotely controls the data packet writing device to directly generate the configuration file.
  • the processor 34 is configured to run a computer program to realize: generate a modification instruction for the configuration file according to the setting operation, and send the modification instruction to the data packet write Device.
  • the processor 34 after the control terminal 30 receives the setting operation input by the user, the processor 34 generates a modification instruction for the existing configuration file of the data packet writing device according to the setting operation, and the modification instruction is used to instruct the data packet writing
  • the input device modifies the existing configuration file, that is, the remote control data packet writing device implements the modification of the existing configuration file by controlling the terminal 30 to realize the self-defined modification of the configuration file in real time.
  • a movable platform 40 is provided.
  • the movable platform 40 includes: a body 42; a power system 44 disposed on the body 42, and the power system 44 is used for The mobile platform provides power; a plurality of sensors 46 are arranged in the body, and the plurality of sensors 46 are used to perceive the environmental information and status information of the movable platform, and to generate at least one data packet; one or more processors 48 are used to pass the preset
  • the provided API interface receives at least one data packet and obtains the attribute characteristics of the data packet; according to the attribute characteristics of the data packet, a target storage medium is selected from a plurality of preset storage media, and the data packet is written into the target storage medium.
  • the mobile platform 40 receives at least one data packet through a preset API interface, where the preset API interface is a unified API interface designated by the user, and all types of data packets are received through the unified API interface, avoiding
  • the development of different APIs due to different storage media leads to the problem of large development workload and high repeatability.
  • the attribute characteristics of the data packet are obtained, and the target storage medium for storing the data packet is selected from a plurality of preset storage media according to the attribute characteristics of the data packet. Specifically, as shown in Figure 2 and Figure 3, the frequency (that is, the frequency of the data packet received in a unit time), size and other types of different data packets are different, and the indicators of different storage media are also different.
  • the data packet is stored in a storage medium with indicators matching its attribute characteristics, which can effectively solve the problem of competing between storage IO (Input/Output) bandwidth and storage space in the storage of data, and at the same time solve the problem of Under the condition of limited storage space and bandwidth, the problem of real-time storage of data packets generated during the operation of aerial photography aircraft and other devices in a suitable storage medium.
  • storage IO Input/Output
  • the attribute feature includes one or more of the following: file size of the data packet, frequency of the data packet, configuration information corresponding to the data packet, and information about whether the data packet can be cached.
  • the attribute characteristics of the data packet include the file size of the data packet, the frequency of the data packet, the configuration information corresponding to the data packet, and whether the data packet can be cached.
  • the size of the data packet is the file of the data packet. Size. This attribute may include the storage medium space required to store the data packet.
  • the frequency of data packets can include the number of times the same type of data packets appear in a unit time.
  • the configuration information corresponding to the data package can include whether the data package is designated by the user or the developer to be stored in the designated storage medium, such as the "photo" data package designated by the user to be stored in the storage medium "TF (Trans-Flash) card” , Just use the configuration file to bind the configuration information "stored in TF card” with the data package "photo”.
  • the cacheable information of a data packet indicates whether the data packet can be cached in a cache area such as memory during the process of writing to the corresponding storage medium. If the data packet can be cached, it will be written after the data packet is received Before loading into the corresponding target storage medium, it is first cached in the cache area, and then extracted from the cache area and written to the target storage medium. If the data packet cannot be cached, the data packet is directly written to the target storage medium through an idle thread in the corresponding thread pool.
  • the processor 48 is further configured to: obtain complete information of the data packet, and determine whether the data packet is a complete data packet according to the complete information of the data packet; When the package is a complete data package, select the target storage medium from multiple preset storage media.
  • the storage engine after receiving the data packet, the storage engine triggers the message listener to obtain the complete information of the data packet, and then determines whether the data packet is a complete data packet.
  • the storage engine triggers the message listener to obtain the complete information of the data packet, and then determines whether the data packet is a complete data packet.
  • the integrity of the data packet needs to be verified, and only the corresponding target storage is allocated for the complete data packet.
  • the medium can avoid the risk of storing "damaged" data packets.
  • each preset storage medium corresponds to a preset thread pool; the processor 48 is also used to: distribute data packets to the target storage
  • the thread pool corresponding to the medium is used to store data packets to the target storage medium through idle threads in the thread pool.
  • each preset storage medium corresponds to a preset thread pool.
  • the corresponding relationship may be preset by software or specified by the user or developer. After the target storage medium of the data packet is selected from the preset storage medium, the data packet is distributed to the thread pool corresponding to the target storage medium, so that the data packet is stored in the target storage medium through the idle thread in the thread pool.
  • the processor 48 is further configured to: discard the data packet based on the incomplete data packet.
  • the storage engine after receiving the data packet, the storage engine triggers the message listener to obtain the complete information of the data packet, and then determines whether the data packet is a complete data packet. If the data packet is an incomplete data packet, it means that the data packet has been damaged during the transmission process and is an invalid data packet. At this time, the data packet is discarded to avoid wasting resources and storage space.
  • the processor 48 is further configured to: receive a configuration file sent by the control terminal.
  • control terminal is a terminal held by a user or R&D personnel
  • the configuration file may include data that can be configured by the user, such as the mapping relationship between the attribute characteristics of the data packet and the target storage medium.
  • the configuration file sent by the terminal enables users to freely configure the writing process of data packets according to actual needs.
  • the processor 48 is further configured to: receive a configuration instruction sent by the control terminal, and generate a configuration file according to the configuration instruction.
  • a configuration instruction sent by a terminal held by a user or R&D personnel is received.
  • the user or R&D personnel sends the configuration instruction to a device such as a mobile platform, and then directly compiles and generates a corresponding configuration file on the device.
  • users can freely configure the writing process of data packets according to actual needs.
  • the processor 48 is further configured to: receive a modification instruction for the configuration file sent by the control terminal, and modify the configuration file according to the modification instruction.
  • the user or researcher can send a modification instruction to the existing configuration file through the control terminal held by him, and modify one of the configuration files through the modification instruction.
  • One or more items to realize the dynamic and free configuration of data packet writing process are possible.
  • the configuration file includes one or more of the following: thread pool size, cache size, data package instance, and storage medium instance.
  • the configuration file may include the size of the thread pool, and the thread pool may be corresponding to at least one storage medium for accommodating at least one thread configured to write data packets into the storage medium, where the thread pool
  • the size can include the number of threads that the thread pool can hold.
  • the cache size may include the size of the cache area that can be used to cache data packets, where the cache area can be divided into the running memory or other internal storage space of devices such as mobile platforms through configuration files, where the cache size may include the divided The amount of space available for buffering data packets in the buffer area.
  • the data packet instance may include a mark for a specific data packet. For example, a mobile platform has a shooting function.
  • a data packet of the taken picture is generated, and the data packet corresponds to an instance of a "picture" data packet.
  • the data packet instance may also include the size of the data packet, for example, for a mobile platform, how many times the flight data can be stored.
  • Examples of storage media include storage media names, such as TF card, FLASH memory, or APP server.
  • the configuration file may also include the storage medium corresponding to the data packet specifying an instance. For example, the data packet that conforms to the "picture" data packet instance is written into the "TF card” according to preset writing rules. "The storage medium of the instance.
  • the configuration file includes configuration information for selecting a local storage medium.
  • the configuration file includes configuration information for selecting an ontology storage medium.
  • the configuration information includes a mapping relationship between any data package instance and any local storage medium instance.
  • the processor 48 is further configured to: obtain a configuration file, determine the writing rule corresponding to the attribute information of the data packet according to the configuration file; and determine according to the writing rule Target storage medium.
  • the configuration file is received from the control terminal.
  • the configuration file includes thread pool size, cache size, data package instance, and storage medium instance, and includes a write indicating the mapping relationship between a specific data package instance and a specific storage medium instance.
  • Entry rules are specifically the mapping relationship between the attribute characteristics of the data packet instance and the target storage medium. Specifically, after the data packet is received and the attribute characteristics of the data packet are obtained, the writing rule corresponding to the corresponding attribute characteristic is obtained according to the configuration file, and the target storage medium corresponding to the data packet is determined according to the writing rule, And write the data packet to the corresponding target storage medium according to the writing rule.
  • each storage medium corresponds to a pre-configured thread pool
  • the processor 48 is also used to: determine the thread pool corresponding to the data packet; and call the thread pool The first idle thread in caches the data packet to the cache area.
  • a pre-configured thread pool is allocated to each storage medium according to the configuration file, where each thread in the thread pool is used to write a data packet to the corresponding storage medium.
  • the system loads the user configuration file, initializes the thread pool according to the configuration file, and registers a message listener to intercept each data packet, and according to the attribute characteristics of the data packet, specifically the data packet For the cacheable data packet and the target storage medium corresponding to the data packet, the data packet is distributed to the thread pool corresponding to the target storage medium.
  • the thread pool After receiving the unconfigured data packet, the thread pool calls the first idle thread to cache the data packet in the buffer area based on the data packet being a cacheable data packet.
  • the processor 48 is further configured to: set a cache area in a preset storage space according to the configuration file; wherein the cache area is used to cache at least One packet.
  • the cache area is set in the preset storage space according to the configuration file.
  • the preset storage space may be a running memory (RAM, random Access Memory), or any memory configured by itself.
  • the configuration file also includes the required cache area size.
  • the cache area of the specified size is divided in the specified storage space according to the configuration file. In the case of a data packet that can be cached, the first idle thread in the thread pool The data packet is buffered to the buffer area.
  • the processor 48 is further configured to: read multiple data packets in the cache area, and perform a merge operation on the multiple data packets to generate merged data Package; write the combined data package to the target storage medium.
  • the storage medium IO will be blocked and the writing time Long, resulting in lowering the efficiency of writing data packets.
  • the "fragmented" data packets with higher frequency and smaller file size are cached in the cache area first, and multiple data packets in the cache area are merged to generate a complete merged data packet.
  • Writing the combined data packet to the target storage medium can effectively reduce the blockage of the "fragmented" data packet on the target storage medium IO during the writing process, and effectively increase the writing speed of the data packet.
  • the processor 48 is further configured to: obtain the target storage medium corresponding to the data packet and the sequence information corresponding to the data packet; and call the second idle in the thread pool. The thread writes the data packet to the target storage medium according to the sequence information.
  • the corresponding thread pool is selected according to the target storage medium corresponding to each data packet in this type of data packet, and called The second idle thread in the corresponding thread pool writes the data packet into the target storage medium according to the sequence information.
  • the sequence information may be the sequence in which the data packet is cached to the cache area. Because the write bandwidth of the target storage medium is limited, when a large number of data packets are written to the target storage medium at the same time, it will cause IO congestion of the target storage medium. At this time, the data packets are written into the buffer area first, and multiple data packets are "queued" according to the order of the buffer. The second idle thread is called to write the data packets into the target storage medium in the order of queuing, which can effectively avoid storage The IO congestion caused by insufficient bandwidth of the medium improves the efficiency of data packet writing.
  • the data packet is first cached in the cache area and then stored in the target storage medium belongs to an asynchronous storage method.
  • the processor 48 is further configured to: if the number of multiple data packets meets a preset merging condition, perform a merging operation on the multiple data packets to generate Combine data packets.
  • the processor 48 is also used to: determine the thread pool corresponding to the data packet; call an idle thread in the thread pool to write the data packet directly into the target storage medium.
  • the cache information is not cacheable, or the configuration file indicates that the data packet needs to be written directly to the storage medium.
  • writing directly to the target storage medium belongs to a synchronous mode.
  • the processor 48 is further configured to: if the remaining space of the target storage medium is less than a preset space threshold, delete at least one data in all data packets package.
  • At least one data packet with a lower priority is deleted.
  • the processor 48 is further configured to: if the remaining space of the target storage medium is less than a preset space threshold, according to the statistics of all data packets in the target storage medium Write time, delete at least one data packet with the earliest write time.
  • the storage batch of data packets can also be configured.
  • the storage batch of data packets can also be configured.
  • the remaining space of the target storage medium is less than the preset space threshold, that is, when the remaining space is not enough to meet the writing condition of the latest data packet, delete all data packets in the order of writing time in the target storage medium. At least one data packet with the earliest writing time.
  • delete the "oldest" data packet according to the writing time sequence of the data packet thereby realizing the dynamic rolling writing of the data packet in the target storage medium, avoiding storage space Insufficiency causes data loss.
  • the processor 48 is further configured to: if the remaining space of the target storage medium is less than the data to be written to the target storage medium in the thread pool corresponding to the target storage medium Packet size, according to the write time of all data packets in the target storage medium, delete at least one data packet in all data packets until the remaining space of the target storage medium is greater than the size of the data packet to be written to the target storage medium.
  • the system determines the remaining space of the target storage medium corresponding to the data packet. If the remaining space of the target storage medium is less than the size of the data packet to be written, That is, the remaining space of the current target storage medium is not enough to save the data packet. To ensure the smooth writing of the data packet, according to the writing time of all the data packets in the target storage medium, delete at least one data packet in all the data packets.
  • the target storage medium includes: a TF card, a NAND flash memory, an external storage terminal, and an APP server.
  • the target storage medium includes a TF card, such as an expansion memory card, which is pluggably installed in the removable platform 40.
  • the TF card has large space, large link bandwidth, and IO Features of small bandwidth.
  • the target storage medium also includes NAND flash memory (NAND flash memory), which is integrated on the motherboard and has the characteristics of small space, large link bandwidth and small IO bandwidth.
  • External storage terminals include control terminals, such as remote controllers, smart phones, upper computer control terminals, etc.
  • External storage terminals are generally a complete set of hardware terminals, including processors, communication devices, and memory.
  • the external storage terminals communicate with mobile devices through communication devices.
  • the platform 40 interacts.
  • the unmanned aerial vehicle captures a video file during aerial photography, generates one or more data packets corresponding to the video file, and sends the data packets to the external storage through wireless transmission with the external storage terminal After receiving the data packet through the communication device, the external storage terminal writes the data packet into its own memory through its own processor.
  • the APP server includes a cloud server.
  • the mobile platform 40 uploads the data packet to the APP server in the cloud through its own network connection, and the APP server writes the data packet into the cloud storage space after receiving the data packet.
  • the movable platform 50 includes: a body 52, a power system 54, at least one sensor 56, at least one processor 58 and a communication device 59.
  • the communication device 59 Can be used to interact with an external storage terminal and/or APP server: the processor 58 is also used to: based on the target storage medium being the external storage terminal and/or APP server, call the communication device to write the data packet and the write instruction corresponding to the data packet Send to the external storage terminal and/or APP server, so that the external storage terminal and/or APP server write the data packet according to the write instruction.
  • various data packets are generated, such as flight log data packets for recording the flight process, received control/debugging command data packets, Image data packets generated when taking images/videos, etc., where the attributes and characteristics of each type of data packet are different, such as the log data packet has a small size and high frequency, while the image data packet has a small frequency and large size, so it is preferable to Different data packets are stored in different storage media, that is, to achieve automatic distribution of multiple types of data of different frequencies and sizes under the limitation of the storage space and performance bandwidth of different storage media corresponding to the mobile platform 50 without the user's feelings.
  • Different storage media such as TF card, NAND flash memory, external storage terminal, APP server, etc.
  • the mobile platform interacts with the external storage terminal and the APP server through the communication device, and sends the data packet and the corresponding write instruction to the corresponding external storage by calling the communication device
  • the R&D personnel of the mobile platform 50 specify the thread pool size, cache area size, data package instance, storage medium instance and other items by setting the configuration file, so that the mobile platform can dynamically select different data based on the software. Different storage locations for packages. For consumer users, the storage medium can also be dynamically selected through a specific APP. For example, for users with confidential data protection needs, they can choose local storage media.
  • the mobile platform loads the configuration file, generates write rules according to the configuration file, initializes the memory pool to generate the cache area, and initializes the thread pool to obtain the minimum value corresponding to each storage medium.
  • a thread pool In the process of powering on and initializing the mobile platform, the mobile platform loads the configuration file, generates write rules according to the configuration file, initializes the memory pool to generate the cache area, and initializes the thread pool to obtain the minimum value corresponding to each storage medium.
  • a thread pool is
  • the R&D personnel can specify a preset API interface to receive various data packets and distribute them to the storage engine.
  • the storage engine triggers the message listener to check the integrity of the data packet and determine the attribute characteristics of the data packet, including The frequency, size, and caching of data packets. After the integrity check of the data packet, the incomplete data packet is discarded to ensure the correctness of the data.
  • the data packet is assigned when the target according to the writing rules
  • the data packet is intercepted by the message processor, and the data packet is distributed to the thread pool of the corresponding target medium.
  • the thread pool allocates idle threads, and selects the data packet to be cached to the cache area according to the user configuration, or write directly Into the target storage medium.
  • the configuration file can be freely configured according to the actual needs of the user.
  • the remaining space of the target storage medium is insufficient, it can be based on information such as the write time, priority, data packet size, and number of data packets stored in the target storage medium. Delete at least one data packet to provide enough storage space for the new data packet, realize dynamic rolling storage, and avoid data loss due to insufficient storage space.
  • a computer-readable storage medium is provided, and a computer program is stored on the ride.
  • the computer program is executed by a processor, the implementation is as provided in the first embodiment of this specification. Therefore, the computer-readable storage medium includes all the beneficial effects of the data packet writing method provided in the first embodiment of this specification, so it will not be repeated here.
  • the term “plurality” refers to two or more than two, unless clearly defined otherwise, the directions or positional relationships indicated by the terms “upper”, “lower”, etc. are based on the directions described in the drawings. Or positional relationship is only for the convenience of describing this specification and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of this specification; “Connected”, “installed”, “fixed”, etc. should be understood in a broad sense. For example, “connected” can be a fixed connection, a detachable connection, or an integral connection; it can be directly connected or through an intermediate medium. Indirectly connected. For those of ordinary skill in the art, the specific meanings of the above-mentioned terms in this specification can be understood according to specific circumstances.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Selon divers modes de réalisation, la présente invention concerne un procédé et un appareil d'écriture de paquets de données, un terminal de commande et une plateforme mobile. Le procédé d'écriture de paquets de données consiste à : recevoir au moins un paquet de données au moyen d'une interface API prédéfinie, et obtenir une caractéristique d'attribut du paquet de données ; et sélectionner un support de stockage cible parmi une pluralité de supports de stockage prédéfinis en fonction de la caractéristique d'attribut du paquet de données, et écrire le paquet de données dans le support de stockage cible. Selon le procédé d'écriture de paquets de données décrit dans la présente invention, une interface API prédéfinie unique est spécifiée pour recevoir le paquet de données sans développer un ensemble d'interfaces API indépendantes pour chaque support de stockage, ce qui permet de réduire la charge de travail de recherche et de développement, d'avoir une bonne portabilité et une bonne évolutivité, et de résoudre efficacement les problèmes de forte charge de travail de développement, de grande répétabilité, d'opérations complexes pour l'utilisateur et de portabilité et d'évolutivité médiocres lorsqu'un stockage de données de multiples types d'une pluralité de supports de stockage est accompli dans différents modèles de drones de photographie aérienne ; pendant la transition d'une version de développeur à une version officielle, il n'y a aucun besoin de codage manuel pour générer un micrologiciel.
PCT/CN2019/098218 2019-07-29 2019-07-29 Procédé et appareil d'écriture de paquets de données, terminal de commande et plateforme mobile WO2021016815A1 (fr)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2019/098218 WO2021016815A1 (fr) 2019-07-29 2019-07-29 Procédé et appareil d'écriture de paquets de données, terminal de commande et plateforme mobile
CN201980030068.5A CN112136104A (zh) 2019-07-29 2019-07-29 数据包写入方法及装置、控制终端和可移动平台

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/098218 WO2021016815A1 (fr) 2019-07-29 2019-07-29 Procédé et appareil d'écriture de paquets de données, terminal de commande et plateforme mobile

Publications (1)

Publication Number Publication Date
WO2021016815A1 true WO2021016815A1 (fr) 2021-02-04

Family

ID=73849586

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/098218 WO2021016815A1 (fr) 2019-07-29 2019-07-29 Procédé et appareil d'écriture de paquets de données, terminal de commande et plateforme mobile

Country Status (2)

Country Link
CN (1) CN112136104A (fr)
WO (1) WO2021016815A1 (fr)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113608771A (zh) * 2021-06-20 2021-11-05 山东云海国创云计算装备产业创新中心有限公司 一种fpga固件快速烧写的方法、装置、设备及可读介质
CN113590381B (zh) * 2021-06-30 2024-07-16 北京旷视科技有限公司 特征分发方法、装置、电子设备及计算机可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102667736A (zh) * 2010-01-27 2012-09-12 株式会社东芝 存储器管理装置及存储器管理方法
CN104991736A (zh) * 2015-06-15 2015-10-21 联想(北京)有限公司 写数据方法、装置以及存储设备
CN106021506A (zh) * 2016-05-23 2016-10-12 深圳市中博科创信息技术有限公司 集群系统的文件存储方法及装置
CN109164974A (zh) * 2018-06-27 2019-01-08 阿里巴巴集团控股有限公司 一种数据存储方法及装置、一种计算设备及存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101539617B1 (ko) * 2014-04-24 2015-08-06 서강대학교산학협력단 모바일 기기에서 파일구조 유형에 따른 파일 삭제 방법 및 이를 이용한 장치
CN110022335B (zh) * 2018-01-09 2021-10-29 腾讯科技(深圳)有限公司 数据包发送方法、装置、服务器及计算机可读存储介质
CN109768926B (zh) * 2019-01-10 2021-07-20 维沃移动通信有限公司 一种数据处理方法、终端设备及计算机可读存储介质
CN109977129A (zh) * 2019-03-28 2019-07-05 中国联合网络通信集团有限公司 多级数据缓存方法及设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102667736A (zh) * 2010-01-27 2012-09-12 株式会社东芝 存储器管理装置及存储器管理方法
CN104991736A (zh) * 2015-06-15 2015-10-21 联想(北京)有限公司 写数据方法、装置以及存储设备
CN106021506A (zh) * 2016-05-23 2016-10-12 深圳市中博科创信息技术有限公司 集群系统的文件存储方法及装置
CN109164974A (zh) * 2018-06-27 2019-01-08 阿里巴巴集团控股有限公司 一种数据存储方法及装置、一种计算设备及存储介质

Also Published As

Publication number Publication date
CN112136104A (zh) 2020-12-25

Similar Documents

Publication Publication Date Title
US11082397B2 (en) Management system and method for remote controller of electronic device
JP7100154B2 (ja) プロセッサコアのスケジューリング方法、装置、端末及び記憶媒体
WO2018035856A1 (fr) Procédé, dispositif et système de mise en œuvre d'un traitement d'accélération matérielle
US20130073600A1 (en) Remote process execution management
AU2021229220B2 (en) Image processing method and device
US20160210159A1 (en) User Mode Driver Extension and Preprocessing
EP3076296A1 (fr) Ordinateur, dispositif de commande et procédé de traitement de données
JP2008538829A (ja) 圧縮を用いて分散処理環境における図形表示を更新する方法および装置
US20220409999A1 (en) Rendering method and apparatus
JP2006338505A (ja) 画像処理装置、方法及びプログラム
US20180006963A1 (en) Network-accessible data volume modification
WO2021016815A1 (fr) Procédé et appareil d'écriture de paquets de données, terminal de commande et plateforme mobile
WO2022022132A1 (fr) Procédé et appareil de mise à jour d'image, dispositif informatique et support d'enregistrement
CN102984189A (zh) 一种无线网络及其实现方法、终端
CN108496198A (zh) 一种图像处理方法及设备
WO2023173516A1 (fr) Procédé et appareil d'échange de données, support d'enregistrement et dispositif électronique
US20240212255A1 (en) Scene Rendering Method, Apparatus, Device, and System
CN115865874A (zh) 一种会议消息推送方法、会议服务端及电子设备
CN117312229B (zh) 一种数据传输装置、数据处理设备、系统、方法及介质
CN114581580A (zh) 渲染图像的方法、装置、存储介质及电子设备
CN113422669A (zh) 数据传输方法、装置和系统、电子设备以及计算机可读存储介质
CN111831451A (zh) 云主机内存分配方法及云主机、设备及存储介质
Calagna et al. Processing-aware migration model for stateful edge microservices
CN114726657A (zh) 中断管理和数据收发管理的方法、装置及智能网卡
JP2023028375A (ja) 情報処理装置、情報処理方法、プログラム、及びシステム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19939592

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19939592

Country of ref document: EP

Kind code of ref document: A1