Printing monitoring data processing method and device, 3D printing equipment and storage medium
By preallocating formatted partitions in 3D printing equipment to solve the fragmentation problem of mechanical hard disks, efficient data storage and reading and writing are achieved, and the problem of low data storage efficiency in 3D printing technology is solved.
Patent Information
- Application Number
- CN202410994837.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-12-20
AI Technical Summary
In the existing 3D printing technology, the data storage method of mechanical hard disks is easily fragmented when frequently created, modified and deleted, resulting in problems such as degradation of read and write performance, wasted disk space and file access delays, and the cost of solid-state hard disks is relatively high. It is difficult to promote in the consumer-grade 3D printer market.
By obtaining the printing monitoring data of the 3D printing device, data encapsulation is performed and the location to be written to the target formatted partition is determined based on the data packet type and the formatted partition index information of the storage hard disk, and the formatted partition is pre-allocated to store different types of data. Reduce fragmentation and improve access efficiency.
It realizes fast and continuous data storage and reading and writing, reduces disk fragmentation, improves file access speed and efficiency, avoids space waste, and supports data export at any time period.
Smart Images

Figure CN119166040A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of 3D printing, and in particular to a printing monitoring data processing method, device, 3D printing equipment and readable storage medium. Background Art
[0002] 3D printing technology is a rapid prototyping manufacturing technology that can transform digital models into actual object models. With the continuous development of 3D printing technology, its application fields are becoming more and more extensive, such as industrial manufacturing, medical treatment, construction, etc. At present, the data storage of 3D printing technology includes solid-state hard disk storage and mechanical hard disk storage. The solid-state hard disk storage method uses flash storage technology and can be read and written randomly, but because solid-state hard disks are relatively expensive, the cost of using solid-state hard disks in the consumer 3D printer market is relatively high. The mechanical hard disk storage method has a lower cost, but the storage method of the mechanical hard disk may cause the file data to be stored in different physical locations when the file is frequently created, modified, and deleted, resulting in discontinuous file data and fragmentation. Disk fragmentation can easily cause mechanical hard disks to have problems such as reduced read and write performance, waste of disk space, and file access delays. Summary of the invention
[0003] In view of this, the present application provides a printing monitoring data processing method, device, 3D printing equipment and readable storage medium.
[0004] In a first aspect, an embodiment of the present application provides a method for processing printing monitoring data, comprising:
[0005] Acquire printing monitoring data of a 3D printing device, and encapsulate the printing monitoring data to obtain a data packet of the printing monitoring data;
[0006] Determine the location to be written in the target formatted partition corresponding to the data packet according to the type of the data packet and the index information of the formatted partition storing the hard disk; the formatted partition has been pre-allocated to different types of data for data storage;
[0007] The data packet is written into the to-be-written location, and the index information of the target formatted partition is updated.
[0008] In a second aspect, an embodiment of the present application provides a 3D printing device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method of the first aspect are implemented.
[0009] In a third aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method of the first aspect are implemented.
[0010] In an embodiment of the present application, the printing monitoring data of the 3D printing device is obtained, and the printing monitoring data is encapsulated to obtain a data packet of the printing monitoring data. According to the type of the data packet and the index information of the formatted partition of the storage hard disk, the to-be-written position of the target formatted partition corresponding to the data packet is determined; the formatted partition has been pre-allocated to different types of data for data storage. The data packet is written to the to-be-written position, and the index information of the target formatted partition is updated.
[0011] In an embodiment of the present application, formatted partitions are pre-allocated for different types of data before data storage, so as to facilitate subsequent classified data access, make data access faster, and reduce frequent hard disk space allocation operations, thereby helping to reduce fragmentation caused by frequent allocation and release of space. By reducing fragmentation, the access speed is improved, and the pre-allocated space can ensure that files do not need to wait for disk space allocation operations when being written, thereby improving the reading and writing efficiency of files.
[0012] In addition, since the formatted partitions are allocated continuously, real-time continuous storage can be achieved during data storage, avoiding space waste. When data export is needed later, data of any length in any time period can be exported, improving access efficiency.
[0013] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0015] Figure 1 One of the flow charts of the printing monitoring data processing method according to the embodiment of the present application is shown;
[0016] Figure 2 The second flowchart of the printing monitoring data processing method according to the embodiment of the present application is shown;
[0017] Figure 3 A structural block diagram of a 3D printing device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0018] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0019] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0020] The following, in conjunction with the accompanying drawings, describes in detail the printing monitoring data processing method, device, 3D printing equipment and readable storage medium provided in the embodiments of the present application through specific embodiments and their application scenarios.
[0021] The present application embodiment provides a method for processing printing monitoring data, such as Figure 1 As shown, the method includes:
[0022] S101, obtaining printing monitoring data of a 3D printing device, and encapsulating the printing monitoring data to obtain a data packet of the printing monitoring data.
[0023] The printing process of the 3D printing device is monitored to obtain printing monitoring data of the 3D printing device, and the data is packaged in units of one video channel, that is, one video GOP (Group of Pictures), to obtain a data packet corresponding to one video channel.
[0024] S102, determining the writing position of the target formatted partition corresponding to the data packet according to the type of the data packet and the index information of the formatted partition storing the hard disk; the formatted partition has been pre-allocated to different types of data for data storage.
[0025] The storage hard disk of the 3D printing device can be a mechanical hard disk. The formatted partition is to divide the storage hard disk into multiple partitions, and each partition is formatted in a preset format, that is, the storage hard disk is divided into multiple formatted partitions. Also, before data storage, the formatted partition is pre-allocated to different types of data for data storage. Each type of data corresponds to a formatted partition or sub-partition, which facilitates subsequent classified data access, making data access faster. In addition, pre-allocation is the continuous allocation of partition space, thereby avoiding fragmentation.
[0026] The formatted partition has index information, and the index information may include information such as historical written data information of the formatted partition, timestamp of the historical written data, writing position of the historical written data, and current writable position, and the historical written data information includes historical written data identification, historical written data size, etc. In the embodiment of the present application, the corresponding target formatted partition is determined according to the type of the data packet, and the current writable position of the target formatted partition is determined according to the index information of the target formatted partition, so that the current writable position is used as the position to be written by the data packet in the target formatted partition.
[0027] S103, writing the data packet to the location to be written, and updating the index information of the target formatted partition.
[0028] In this step, the data packet is written to the position to be written, and index information such as historical written data information, timestamp of historical written data, writing position of historical written data and current writable position of the target formatted partition is updated.
[0029] In an embodiment of the present application, formatted partitions are pre-allocated for different types of data before data storage, so as to facilitate subsequent classified data access, make data access faster, and reduce frequent hard disk space allocation operations, thereby helping to reduce fragmentation caused by frequent allocation and release of space. By reducing fragmentation, the access speed is improved, and the pre-allocated space can ensure that files do not need to wait for disk space allocation operations when being written, thereby improving the reading and writing efficiency of files.
[0030] In addition, since the formatted partitions are allocated continuously, real-time continuous storage can be achieved during data storage, avoiding space waste. When data export is needed later, data of any length in any time period can be exported, improving access efficiency.
[0031] In one embodiment of the present application, before obtaining the printing monitoring data of the 3D printing device, the method further includes:
[0032] Obtaining hard disk partition formatting information of a storage hard disk of a 3D printing device, and determining whether a partition format of the storage hard disk is a first preset format according to the hard disk partition formatting information;
[0033] If it is the first preset format, determining the formatted partition of the storage hard disk according to the hard disk partition formatting information, and pre-allocating the formatted partition to different types of data for data storage;
[0034] If it is not in the first preset format, the storage hard disk is partitioned and formatted to obtain a formatted partition in the first preset format, and the formatted partition is pre-allocated to different types of data for data storage.
[0035] In this embodiment, the hard disk partition formatting information of the storage hard disk is read, and the hard disk partition formatting information records partition information such as the number of partitions, the size of the partitions, the location of the partitions, and the partition format information. According to the partition format information in the hard disk partition formatting information, it is determined whether the format of the partition of the storage hard disk is a first preset format, and the first preset format can be a file system format such as FAT32, NTFS, EXT4, etc. If the partition format of the storage hard disk is already the first preset format, then multiple formatted partitions of the storage hard disk are determined based on the hard disk partition formatting information; if the partition format of the storage hard disk is not the first preset format, the storage hard disk is repartitioned and formatted to obtain multiple formatted partitions of the storage hard disk in the first preset format.
[0036] In the embodiment of the present application, the storage hard disk partition is formatted into a partition of a preset format to meet the requirements for the use of the storage hard disk and the compatibility requirements of the 3D printing device.
[0037] In one embodiment, the first preset format is the FAT32 file system format. The FAT32 file system works well on a variety of operating systems and devices, including Windows, macOS, Linux, etc. The file structure of FAT32 is relatively simple, and there is no complicated permission setting, so that users do not need to worry about complicated file system operations when using the 3D printing device, and users can easily export data from the 3D printing device.
[0038] After determining multiple formatted partitions of the storage hard disk, the multiple formatted partitions are pre-allocated to different types of data for subsequent data storage. For example, the data types include video data, picture data, and system data. Then, formatted partition 1 is pre-allocated to video data for subsequent video data storage, formatted partition 2 is pre-allocated to picture data for subsequent picture data storage, and formatted partition 3 is pre-allocated to system data for subsequent system data storage.
[0039] In one embodiment of the present application, partitioning and formatting a storage hard disk to obtain a formatted partition in a first preset format includes:
[0040] Use the fdisk command to divide the storage hard disk into multiple partitions;
[0041] The partition is formatted into the first preset format by using the mkfs.fat command to obtain a formatted partition in the first preset format.
[0042] In this embodiment, partitioning and formatting are two different steps. Partitioning refers to the process of dividing the storage hard disk logical address into multiple logical areas. Each partition can be regarded as an independent logical disk by the operating system. The partition can be evenly divided or unevenly divided. The partition table format of the storage hard disk can include two forms: MBR (Master Boot Record) and GPT (GUID Partition Table). In the Linux system, the fdisk command can be used to partition the storage hard disk, thereby dividing the storage hard disk into multiple partitions.
[0043] Formatting refers to performing a preset formatting process on a partition so that the partition is in a first preset format. For example, in a Linux system, the partition is formatted into a FAT32 file system format using the mkfs.fat command.
[0044] In the embodiment of the present application, according to the partition table format and the first preset format, the system command (fdisk command and mkfs.fat command) is called to perform partition formatting to realize the partition and formatting functions. According to the partition table format and the first preset format, the system command is called to realize the partition and formatting functions, rather than directly using the system command to format the partition, so that the user can understand the specific execution steps, and if an abnormality occurs, the problem can be located more accurately. In addition, the start mark, end mark and other mark information of the data can be added to the free position of the file allocation table (File Allocation Table, FAT) to realize the positioning of the data.
[0045] In one embodiment of the present application, formatted partitions are pre-allocated to different types of data for data storage, including: different formatted partitions are pre-allocated to different types of data as corresponding storage spaces; and the remaining formatted partitions obtained after the pre-allocation are pre-allocated to different types of data as corresponding storage spaces.
[0046] In this embodiment, space pre-allocation, that is, file pre-creation, means that after the storage hard disk partition is formatted, the formatted partitions are pre-allocated to different types of data as corresponding storage space. Multiple formatted partitions can be pre-allocated as video data partitions, picture data partitions, system data partitions, etc.
[0047] For the remaining formatted partitions, their sub-partitions are pre-allocated to different types of data as corresponding storage spaces. For example, for a remaining formatted partition, 30% of the sub-partitions are pre-allocated as video data partitions, 30% of the sub-partitions are pre-allocated as picture data partitions, and 40% of the sub-partitions are pre-allocated as system data partitions.
[0048] Space pre-allocation can avoid the re-creation and deletion of storage space. It only needs to be done once after formatting is completed, and it will not be repeated later. Instead, only the data content in the file can be modified. This reduces frequent hard disk space allocation operations, helps reduce disk fragmentation, and improves access speed.
[0049] In one embodiment of the present application, the method also includes: writing the hard disk status information of the storage hard disk into a free position in the file configuration table, the hard disk status information including at least one of the following: data name, data size, start address, end address, and data format of different types of data.
[0050] In this embodiment, after the formatted partition is pre-allocated to different types of data, by writing hard disk status information such as data name, data size, start address, end address, data format, etc. of different types of data in the free position of the file configuration table, the space of the file configuration table can be fully utilized to avoid wasting the file configuration table space, and the status of the storage hard disk can be monitored in real time.
[0051] In one embodiment of the present application, encapsulating the printing monitoring data to obtain a data packet of the printing monitoring data includes: encapsulating the printing monitoring data of a video channel to obtain a data packet;
[0052] Writing the data packet into the to-be-written position includes: if the acquired printing monitoring data of the 3D printing device includes printing monitoring data of multiple video channels, writing the data packets of the printing monitoring data in sequence according to the acquisition time of each printing monitoring data.
[0053] In this embodiment, the written data packet is obtained by encapsulating data in units of a video GOP of a video channel, that is, encapsulating data in units of the interval between two I frames (key frames). For example, if the interval between two I frames is 30 frames, then the 30 frames of image data of the video channel, as well as the audio data and device status data of the time period, are uniformly encapsulated into one data packet. Each data packet can be regarded as an independent module. Since the data packet is an independent module, a new data packet instance can be quickly created by copying the data packet, thereby improving the reusability of the code.
[0054] In an embodiment of the present application, only one video channel is allowed to write data at the same time. When the print monitoring data of multiple video channels are obtained, the first-come-first-served principle is used, that is, the data packets of the print monitoring data are written in sequence according to the acquisition time of the print monitoring data. By only allowing one video channel to write data at the same time, data conflicts or overwriting caused by simultaneous writing of multiple channels can be avoided, and competition for storage space can be prevented, thereby reducing the storage error rate.
[0055] In one embodiment of the present application, the index information of the formatted partition includes a first index table and a second index table, the first index table is the same as the second index table, and the second index table is used as a backup index table when the first index table is damaged.
[0056] In this embodiment, for each formatted partition, two index tables are pre-created, a first index table P1 and a second index table P2, and the two tables record the same content. The first index table P1 is used normally, and the second index table P2 is used as a backup. When the first index table P1 is damaged, data can be restored from the second index table P2 to avoid data loss.
[0057] In one embodiment of the present application, according to the type of the data packet and the index information of the formatted partition of the storage hard disk, the to-be-written position of the target formatted partition corresponding to the data packet is determined, including: determining the target formatted partition corresponding to the type of the data packet; determining a time chain table according to the index information of the target formatted partition, the time chain table recording the correspondence between the timestamp and the written data and the written position; and using the current writable position of the target formatted partition recorded in the time chain table as the to-be-written position of the data packet.
[0058] In this embodiment, before writing data, the corresponding target formatted partition is determined according to the type of the data packet. The target formatted partition can be a partition or a partition. For example, if the data packet is picture data, the picture data partition for storing the picture data is used as the target formatted partition. In addition, a time chain table is established according to the index information of the target formatted partition. The time chain table records the correspondence between the timestamp and the written data and the written position. For example, the first timestamp corresponds to the first written data and the first written position, the second timestamp corresponds to the second written data and the second written position, and so on. Through the time chain table, the last written data, the corresponding writing time and the writing position data information can be determined, and the position where the next data can be written can be determined, that is, the current writable position of the target formatted partition. The current writable position is the adjacent idle position of the position where the last data has been written, and the data packet is written to the current writable position of the target formatted partition.
[0059] In the embodiment of the present application, the current writable position can be determined accurately and quickly through the time linked table, thereby achieving continuous storage of data.
[0060] As a refinement and extension of the above embodiment, the embodiment of the present invention provides another printing monitoring data processing method, such as Figure 2 As shown, the method includes:
[0061] S201, obtaining printing monitoring data of a 3D printing device, and encapsulating the printing monitoring data to obtain a data packet of the printing monitoring data.
[0062] S202, determining the location to be written in the target formatted partition corresponding to the data packet according to the type of the data packet and the index information of the formatted partition storing the hard disk; the formatted partition has been pre-allocated to different types of data for data storage.
[0063] S203, writing the data packet to the location to be written, and updating the index information of the target formatted partition.
[0064] S204, when performing data recovery of the printing monitoring data, if it is determined according to the time chain table of the index information that there is a problem of missing records in the index information, the data information is obtained, and the index information is updated based on the data information.
[0065] Among them, S201 to S203 are the same as or similar to S101 to S103 of the above embodiment, and are not described again here.
[0066] In the event of a sudden power outage, data may not be fully stored, such as data cached but not recorded in time. In this case, the missing data records need to be supplemented during data recovery. First, determine whether the index information has a missing record problem based on the time chain table of the index information. If this problem occurs, re-acquire the data information and update the index information based on the data information to ensure the integrity of the index information.
[0067] In one embodiment of the present application, judging whether the index information has a record missing problem according to the time chain table of the index information includes:
[0068] Get the timestamp of the last written data packet recorded in the time chain table;
[0069] Compare the timestamp of the last written data packet with the timestamp of the data packet to be restored of the printing monitoring data, the data packet to be restored is the next data packet of the last written data packet;
[0070] If the timestamp of the data packet to be restored is later than the timestamp of the last written data packet, it is determined that there is a problem of missing records in the index information;
[0071] Get data information and update index information based on the data information, including:
[0072] The packet header of the next data packet of the to-be-recovered data packet is read to extract data information, and the index information is updated based on the data information.
[0073] In this embodiment, when the data of the printing monitoring data is restored after power-on, the timestamp of the last written data packet recorded in the time chain table is read, and the timestamp of the data packet to be restored is compared with the timestamp of the last written data packet. If the timestamp of the data packet to be restored is equal to the timestamp of the last written data packet, it means that the data has been written to the storage hard disk and the index information has been synchronized.
[0074] If the timestamp of the data packet to be restored is later than the timestamp of the last written data packet, it means that data has been written to the storage hard disk, but the index information has not been synchronized. At this time, by reading the header of the next data packet of the data packet to be restored, the content required in the index information, including data identification, data size and other data information, is extracted, and the data information is updated to the index information to ensure the integrity of the index information.
[0075] In one embodiment of the present application, the method further includes: in response to a video playback instruction for the first target data packet, transmitting the first target data packet stored in the storage hard disk to a streaming media server, so that the streaming media server sends the first target data packet to a user device.
[0076] In this embodiment, the application scenario of data export includes real-time video playback. After receiving the video playback instruction for the first target data packet, the first target data packet (i.e., video stream data) can be transmitted to the streaming media server through RTP (Real-Time Transport Protocol), and then the streaming media server sends the first target data packet to the user device. Compressed video streams can be sent through RTP, because when data is stored, the data is packaged and stored, and there is no need to decapsulate it here, and it can be directly transmitted to the streaming media server, which improves the transmission speed.
[0077] Through the above method, real-time viewing and playback of stored data is achieved on the user device to meet the user's viewing needs.
[0078] In one embodiment of the present application, the method further includes: in response to the video export instruction for the second target data packet, reading the second target data packet stored in the storage hard disk, encapsulating the second target data packet into data in a second preset format, and transmitting the data in the second preset format to a file server or an external storage device;
[0079] Among them, if the available capacity of the memory of the 3D printing device is greater than or equal to a preset threshold, the second target data packet is cached in the memory after reading the second target data packet, and the second target data packet is encapsulated as data in the second preset format in the memory; if the available capacity of the memory of the 3D printing device is less than the preset threshold, the second target data packet is cached in the system data partition of the storage hard disk after reading the second target data packet, and the second target data packet is encapsulated as data in the second preset format in the system data partition.
[0080] In this embodiment, the application scenarios of data export also include remote export of data and local export of data. When the video export instruction for the second target data packet is obtained, the second target data packet is read, and the second target data packet is encapsulated as data in a second preset format such as AVI (Audio Video Interleaved) or MP4. If the video export instruction is a remote video export instruction, the data in the second preset format is transferred to the file server via FTP (File Transfer Protocol). If the video export instruction is a local video export instruction, it is not necessary to transfer the exported file to the file server, but the data in the second preset format is exported to an external memory, and the external memory includes a U disk, a TF card, an SD card, etc.
[0081] Since the read second target data needs to be packaged again to be packaged into data of the second preset format, the read second target data needs to be cached first. If the available memory capacity of the 3D printing device is greater than or equal to the preset threshold, that is, the memory is sufficient, the second target data can be directly packaged again in the memory; if the available memory capacity of the 3D printing device is less than the preset threshold, that is, the memory is insufficient, the second target data can be cached in the system data partition to obtain a larger memory space.
[0082] Through the above method, remote export or local export of stored data is realized to meet the user's demand for exporting stored data.
[0083] The present application also provides a 3D printing device, such as Figure 3 As shown, the 3D printing device 300 includes a processor 301 and a memory 302. The memory 302 stores programs or instructions that can be run on the processor 301. When the program or instruction is executed by the processor 301, the various steps of the above-mentioned printing monitoring data processing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0084] The memory 302 can be used to store software programs and various data. The memory 302 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 302 may include a volatile memory or a non-volatile memory, or the memory 302 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 302 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0085] The processor 301 may include one or more processing units; optionally, the processor 301 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 301.
[0086] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned printing monitoring data processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0087] The present application also provides the following embodiments:
[0088] Reference numeral 1, a printing monitoring data processing method, comprising:
[0089] Acquire printing monitoring data of a 3D printing device, and encapsulate the printing monitoring data to obtain a data packet of the printing monitoring data;
[0090] Determine the location to be written in the target formatted partition corresponding to the data packet according to the type of the data packet and the index information of the formatted partition storing the hard disk; the formatted partition has been pre-allocated to different types of data for data storage;
[0091] The data packet is written into the to-be-written location, and the index information of the target formatted partition is updated.
[0092] Reference number 2, based on reference number 1, before obtaining the printing monitoring data of the 3D printing device, the method further includes:
[0093] Acquire hard disk partition formatting information of a storage hard disk of the 3D printing device, and determine whether a partition format of the storage hard disk is a first preset format according to the hard disk partition formatting information;
[0094] If it is the first preset format, determining the formatted partition of the storage hard disk according to the hard disk partition formatting information, and pre-allocating the formatted partition to different types of data for data storage;
[0095] If it is not in the first preset format, the storage hard disk is partitioned and formatted to obtain a formatted partition in the first preset format, and the formatted partition is pre-allocated to different types of data for data storage.
[0096] Reference numeral 3, based on reference numeral 2, partitioning and formatting the storage hard disk to obtain the formatted partitions in the first preset format, including:
[0097] Using the fdisk command, the storage hard disk is divided into multiple partitions;
[0098] The partition is formatted into the first preset format by using the mkfs.fat command to obtain a formatted partition in the first preset format.
[0099] Reference numeral 4, based on reference numeral 2, pre-allocating the formatted partition to different types of data for data storage includes:
[0100] pre-allocating different formatted partitions to different types of data as corresponding storage spaces; and,
[0101] The remaining formatted partitions obtained after pre-allocation are pre-allocated to different types of data as corresponding storage spaces.
[0102] Reference number 5, based on reference number 1, the method further includes:
[0103] The hard disk status information of the storage hard disk is written into a free position of the file configuration table, wherein the hard disk status information includes at least one of the following: data name, data size, start address, end address, and data format of different types of data.
[0104] Reference number 6, based on reference number 1, encapsulating the printing monitoring data to obtain a data packet of the printing monitoring data, including:
[0105] Encapsulating the printing monitoring data of a video channel to obtain the data packet;
[0106] Writing the data packet into the to-be-written location comprises:
[0107] If the acquired printing monitoring data of the 3D printing device includes printing monitoring data of multiple video channels, the data packets of the printing monitoring data are written in sequence according to the acquisition time of each of the printing monitoring data.
[0108] Label 7, based on label 1, the index information of the formatted partition includes a first index table and a second index table, the first index table is the same as the second index table, and the second index table is used as a backup index table when the first index table is damaged.
[0109] Reference numeral 8, based on reference numeral 1, determining the to-be-written position of the target formatted partition corresponding to the data packet according to the type of the data packet and the index information of the formatted partition storing the hard disk, comprises:
[0110] determining a target formatted partition corresponding to the type of the data packet;
[0111] Determine a time chain table according to the index information of the target formatted partition, wherein the time chain table records the correspondence between the timestamp and the written data and the written position;
[0112] The current writable position of the target formatted partition recorded in the time chain table is used as the position to be written to the data packet.
[0113] Reference number 9, based on reference number 1, the method further includes:
[0114] When performing data recovery of the printing monitoring data, judging whether the index information has a problem of missing records according to the time chain table of the index information;
[0115] If there is a problem of missing records, the data information is obtained, and the index information is updated based on the data information.
[0116] Reference numeral 10, based on reference numeral 9, the step of determining whether the index information has a problem of missing records according to the time chain table of the index information includes:
[0117] Obtaining the timestamp of the last written data packet recorded in the time chain table;
[0118] Compare the timestamp of the last written data packet with the timestamp of the data packet to be restored of the printing monitoring data, the data packet to be restored being the next data packet of the last written data packet;
[0119] If the timestamp of the data packet to be restored is later than the timestamp of the last written data packet, it is determined that there is a problem of missing records in the index information;
[0120] The acquiring the data information and updating the index information based on the data information includes:
[0121] The header of the next data packet of the data packet to be restored is read to extract data information, and the index information is updated based on the data information.
[0122] Label 11, based on any one of labels 1 to 10, the method further includes:
[0123] In response to a video playback instruction for a first target data packet, the first target data packet stored in the storage hard disk is transmitted to a streaming media server, so that the streaming media server sends the first target data packet to a user device.
[0124] Label 12, based on any one of labels 1 to 10, the method further includes:
[0125] In response to a video export instruction for a second target data packet, reading the second target data packet stored in the storage hard disk, encapsulating the second target data packet into data in a second preset format, and transmitting the data in the second preset format to a file server or an external memory;
[0126] Wherein, if the available capacity of the memory of the 3D printing device is greater than or equal to a preset threshold, the second target data packet is cached in the memory after reading the second target data packet, and the second target data packet is encapsulated as data in a second preset format in the memory; if the available capacity of the memory of the 3D printing device is less than the preset threshold, the second target data packet is cached in the system data partition of the storage hard disk after reading the second target data packet, and the second target data packet is encapsulated as data in the second preset format in the system data partition.
[0127] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0128] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A printing monitoring data processing method, It is characterized in that include: Acquire printing monitoring data of a 3D printing device, and encapsulate the printing monitoring data to obtain a data packet of the printing monitoring data; Determine the to-be-written position of the target formatted partition corresponding to the data packet according to the type of the data packet and the index information of the formatted partition storing the hard disk; The formatted partitions are pre-allocated to different types of data for data storage; The data packet is written into the to-be-written location, and the index information of the target formatted partition is updated.
2. The method according to claim 1, It is characterized in that The method further comprises: Acquire hard disk partition formatting information of a storage hard disk of the 3D printing device, and determine whether a partition format of the storage hard disk is a first preset format according to the hard disk partition formatting information; If it is the first preset format, determining the formatted partition of the storage hard disk according to the hard disk partition formatting information, and pre-allocating the formatted partition to different types of data for data storage; If it is not in the first preset format, partitioning and formatting the storage hard disk to obtain formatted partitions in the first preset format, and pre-allocating the formatted partitions to different types of data for data storage; Partitioning and formatting the storage hard disk to obtain the formatted partitions in the first preset format includes: Using the fdisk command, the storage hard disk is divided into multiple partitions; formatting the partition into the first preset format by using the mkfs.fat command to obtain a formatted partition in the first preset format; The pre-allocating the formatted partition to different types of data for data storage includes: Pre-allocating different formatted partitions to different types of data as corresponding storage spaces; The remaining formatted partitions obtained after pre-allocation are pre-allocated to different types of data as corresponding storage spaces.
3. The method according to claim 1, It is characterized in that The method further comprises: The hard disk status information of the storage hard disk is written into a free position of the file configuration table, wherein the hard disk status information includes at least one of the following: data name, data size, start address, end address, and data format of different types of data.
4. The method according to claim 1, It is characterized in that The step of encapsulating the printing monitoring data to obtain a data packet of the printing monitoring data includes: Encapsulating the printing monitoring data of a video channel to obtain the data packet; Writing the data packet into the to-be-written location comprises: If the acquired printing monitoring data includes printing monitoring data of multiple video channels, the data packets of the printing monitoring data are written in sequence according to the acquisition time of each printing monitoring data.
5. The method according to claim 1, It is characterized in that The index information of the formatted partition includes a first index table and a second index table, the first index table is the same as the second index table, and the second index table is used as a backup index table when the first index table is damaged; Determining the to-be-written position of the target formatted partition corresponding to the data packet according to the type of the data packet and the index information of the formatted partition storing the hard disk includes: determining a target formatted partition corresponding to the type of the data packet; Determine a time chain table according to the index information of the target formatted partition, wherein the time chain table records the correspondence between the timestamp and the written data and the written position; The current writable position of the target formatted partition recorded in the time chain table is used as the position to be written to the data packet.
6. The method according to claim 1, It is characterized in that The method further comprises: When performing data recovery of the printing monitoring data, judging whether the index information has a problem of missing records according to the time chain table of the index information; If there is a problem of missing records, the data information is obtained, and the index information is updated based on the data information; The determining, according to the time chain table of the index information, whether the index information has a problem of missing records includes: Obtaining the timestamp of the last written data packet recorded in the time chain table; Compare the timestamp of the last written data packet with the timestamp of the data packet to be restored of the printing monitoring data, the data packet to be restored being the next data packet of the last written data packet; If the timestamp of the data packet to be restored is later than the timestamp of the last written data packet, it is determined that there is a problem of missing records in the index information; The acquiring the data information and updating the index information based on the data information includes: The header of the next data packet of the data packet to be restored is read to extract data information, and the index information is updated based on the data information.
7. The method according to any one of claims 1 to 6, It is characterized in that The method further comprises: In response to a video playback instruction for a first target data packet, the first target data packet stored in the storage hard disk is transmitted to a streaming media server, so that the streaming media server sends the first target data packet to a user device.
8. The method according to any one of claims 1 to 6, It is characterized in that The method further comprises: In response to a video export instruction for a second target data packet, reading the second target data packet stored in the storage hard disk, encapsulating the second target data packet into data in a second preset format, and transmitting the data in the second preset format to a file server or an external memory; Wherein, if the available capacity of the memory of the 3D printing device is greater than or equal to a preset threshold, the second target data packet is cached in the memory after reading the second target data packet, and the second target data packet is encapsulated as data in a second preset format in the memory; if the available capacity of the memory of the 3D printing device is less than the preset threshold, the second target data packet is cached in the system data partition of the storage hard disk after reading the second target data packet, and the second target data packet is encapsulated as data in the second preset format in the system data partition.
9. A 3D printing device, It is characterized in that The method comprises a processor and a memory, wherein the memory stores a program or instruction running on the processor, and when the program or instruction is executed by the processor, the steps of the printing monitoring data processing method according to any one of claims 1 to 8 are implemented.
10. A readable storage medium having a program or instruction stored thereon, It is characterized in that When the program or instruction is executed by a processor, the steps of the printing monitoring data processing method according to any one of claims 1 to 8 are implemented.
