Large file printing method and device for embedded system and storage medium

By splitting large swat data into multiple data slices and reorganizing it in an embedded system, the problem that traditional printing systems cannot process large swat data due to memory capacity limitations is solved, and an efficient and reliable printing process is achieved, reducing hardware Cost and waiting time.

CN119415052AActive Publication Date: 2025-02-11GUANGZHOU SENYANG ELECTRONIC TECH CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202411426926.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-12
Publication Date
2025-02-11
Estimated Expiration
2044-10-12

AI Technical Summary

Technical Problem

Traditional printing systems cannot meet the needs of large format or high-speed printing when processing large Swath data due to memory capacity limitations, and redesigning the hardware architecture is expensive and difficult to deliver quickly.

Method used

By dividing large swath data into multiple smaller data slices, assigning a unique serial number to each data slice, sending it to the embedded system side for reorganization and printing, and using data compression and subcontracting technology, we ensure that Traceability and integrity of data transmission.

Benefits of technology

It effectively solves the problem of memory capacity limitation of embedded systems, improves printing efficiency, reduces waiting time, reduces the requirements and costs of hardware architecture, and significantly reduces the risk of transmission failure caused by network problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119415052A_ABST
    Figure CN119415052A_ABST
Patent Text Reader

Abstract

The invention discloses a large file printing method and device for an embedded system and a storage medium. The large file printing method comprises the steps that whether the size of swath data to be sent currently exceeds the size of a board card end memory or not is judged; wherein the swath data is the total amount of data to be output by a printing page; when the size of the swath data exceeds the size of the internal memory of the board card end, segmenting the swath data into a plurality of data pieces, attaching a serial number to each data piece, informing the embedded system end of the size of the data pieces and the total data volume, and then sequentially transmitting and sending; according to the method, large swath data is divided into a plurality of small data pieces, a unique serial number is distributed to each data piece, and then the data pieces are sequentially sent to the embedded system end to be recombined and printed, so that the problem of memory capacity limitation of the embedded system is effectively solved, the printing efficiency is improved, the waiting time is shortened, and the printing efficiency is improved. And the requirement and the cost on a hardware architecture are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of printers, and in particular to a large file printing method, device and storage medium for an embedded system. Background Art

[0002] In the field of printing technology, especially in the application scenarios of large-format printers and multi-head printers, traditional printing systems usually need to receive the entire image data (called swath data) completely into the memory of the embedded system before the printing process can begin. However, due to cost and historical reasons, many embedded systems have limited memory capacity, which limits their ability to process large swath data. When the size of the swath data exceeds the capacity of the system memory, the traditional printing process cannot be carried out, resulting in an inability to meet the needs of large-format or high-speed printing. In addition, redesigning the hardware architecture to accommodate larger memory requirements is not only costly, but may not meet customer needs for fast delivery. Summary of the invention

[0003] The purpose of the present invention is to provide a large file printing method, device and storage medium for an embedded system, which solves the problem of memory capacity limitation of the embedded system and allows large swath data to be processed and printed in a system with smaller memory.

[0004] The purpose of the present invention can be achieved through the following technical solutions:

[0005] The present application provides a large file printing method for an embedded system, comprising the following steps:

[0006] Determine whether the size of the swath data to be sent currently exceeds the size of the memory on the board; wherein the swath data is the total amount of data to be output for a print page;

[0007] When the size of the swath data exceeds the size of the board memory, the swath data is divided into multiple data slices, each data slice is attached with a sequence number, the size of the data slice and the total data volume are notified to the embedded system end, and then transmitted and sent in sequence.

[0008] Furthermore, before determining whether the size of the swath data currently to be sent exceeds the size of the memory on the board, it also includes: inputting a prn file in the embedded system; determining whether the reading of the prn file has been completed, if the reading of the prn file has been completed, then printing is completed; if the reading of the prn file has not been completed, then continuing to determine whether the reading of the first swath print data has been completed; when the reading of the first swath print data has not been completed, then returning to the step of determining whether the reading of the prn file has been completed; when the reading of the first swath print data has been completed, then converting the first swath print data into swath data.

[0009] Furthermore, when the swath data size exceeds the starting memory size, after the swath data is divided into multiple data slices, it specifically includes: calculating the difference between the current swath data size and the size of the board-side memory; determining the number of swath data to be divided according to the difference; and dividing the swath data into multiple data slices according to the number.

[0010] Furthermore, when the data in the transmission process is too large, the swath data is compressed and then packetized, specifically including: compressing the swath data into a binary stream; dividing the binary stream into multiple data slices, each data slice is accompanied by a serial number; and sending the divided data slices to the embedded system end.

[0011] Furthermore, a large file printing method for an embedded system also includes: a data receiving module in the embedded system receives data slices and performs a queue operation; wherein the data receiving module includes: a data receiving thread and a queue manager thread, the data receiving thread is responsible for obtaining data from a socket and writing the data into a queue, the queue manager thread is responsible for maintaining the queue and sending data slices to a swath data module.

[0012] Furthermore, a large file printing method for an embedded system also includes: when the swath data module detects that the first data slice space in the queue is ready, starting the printing process of the current swath.

[0013] Furthermore, a large file printing method for an embedded system also includes: when a network problem occurs during data transmission, a prediction is immediately made and a prompt is given, and printing is paused if necessary, and printing is continued after waiting for more data to be received.

[0014] Furthermore, when network problems occur during data transmission, a prediction model is built based on statistical analysis and machine learning techniques. By learning the baseline of network performance and using statistical process control methods, deviations are detected and network failures are predicted. When indicators are found to be out of the normal range or the model predicts a high risk, an early warning mechanism is immediately triggered;

[0015] The baseline of the network performance is expressed as: baseline = mean ± k × standard deviation; k represents a constant used to determine the fluctuation range of the baseline;

[0016] The statistical process control method is expressed as: When |Z| exceeds the threshold, an anomaly is considered to be detected.

[0017] A large file printing device for an embedded system comprises a processor, a memory and computer program instructions stored in the memory. When the computer program instructions are executed by the processor, the steps of the large file printing method for an embedded system are implemented.

[0018] A storage medium stores computer program instructions, which implement the steps of the large file printing method for an embedded system when the computer program instructions are executed by a processor.

[0019] The beneficial effects of the present invention are:

[0020] The present invention divides large swath data into multiple smaller data slices, assigns a unique serial number to each data slice, and then sends them to the embedded system end for reorganization and printing. This method effectively solves the problem of memory capacity limitation of the embedded system, improves printing efficiency, reduces waiting time, and reduces requirements and costs for hardware architecture.

[0021] Through compression and packetization technology, the traceability and integrity of data transmission are ensured, the risk of transmission failure caused by network problems is significantly reduced, the continuity of printing tasks and overall system performance are improved, and the implementation of PRN file processing and swath data conversion methods in embedded systems can effectively manage memory usage, avoid memory overflow and printing interruption problems, and provide users with a smoother and more reliable printing experience;

[0022] Statistical analysis and machine learning techniques are used to build predictive models and monitor network performance indicators in real time. Once an abnormality is detected, an early warning mechanism is immediately triggered and preventive measures are taken to ensure data integrity and the continuity of printing tasks. The solution overcomes hardware limitations and does not require redesigning the hardware architecture, which simplifies the system design and maintenance process and also reduces costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] For better understanding and implementation, the technical solution of the present application is described in detail below with reference to the accompanying drawings.

[0024] Figure 1 A flowchart of the steps of a large file printing method for an embedded system provided in Example 1 of the present application. DETAILED DESCRIPTION

[0025] In order to further explain the technical means and effects taken by the present invention to achieve the predetermined invention purpose, exemplary embodiments will be described in detail here, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of methods and systems consistent with some aspects of the present application as detailed in the attached claims.

[0026] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0027] The specific implementation methods, features and effects of the present invention are described in detail below in conjunction with the accompanying drawings and preferred embodiments.

[0028] Example 1

[0029] See also Figure 1 This embodiment provides a large file printing method, device and storage medium for an embedded system, which solves the problem of memory capacity limitation of the embedded system and allows large swath data to be processed and printed in a system with smaller memory.

[0030] The present invention provides a large file printing method for an embedded system, comprising the following steps:

[0031] S1, judging whether the size of the swath data to be sent currently exceeds the size of the memory on the board; wherein the swath data is the total amount of data to be output for a print page;

[0032] S2. When the size of the swath data exceeds the size of the memory on the board, the swath data is divided into multiple data slices, each of which is attached with a sequence number, and the size of the data slice and the total amount of data are notified to the embedded system, and then transmitted and sent in sequence.

[0033] For example, the entire swath data size is 300mbytes, and each piece can be cut into 24mbytes. In this case, a total of ceil(300 / 24)=13 times need to be sent. The host computer needs to set the total number of transmissions to numbers, and cut the entire swath data into corresponding 13 pieces in sequence, attach a data sequence number to each piece of data, and then send them one by one.

[0034] Specifically, a memory detection module is integrated into the embedded system through programming. The module is responsible for monitoring the available memory capacity and comparing it with the size of the swath data to be sent. If it is detected that the swath data exceeds the memory limit, the system will automatically trigger a slicing algorithm, which divides the large swath data into multiple smaller data slices and assigns a unique serial number to each data slice. Then, the system sends these data slices and their related information (such as serial number and total data volume) to the embedded device in sequence through a network communication protocol such as TCP / IP. On the embedded system side, a data receiving module is implemented, which is responsible for receiving these data slices and recombining them into the original swath data for printing. In addition, in order to improve transmission efficiency and reliability, the system may also integrate data compression and error detection mechanisms to ensure the integrity and accuracy of data during transmission. In this way, even in memory-constrained embedded systems, large swath data can be effectively processed and printed to meet the needs of large-format and high-speed printing.

[0035] Furthermore, before determining whether the size of the swath data currently to be sent exceeds the size of the memory on the board, it also includes: inputting a prn file in the embedded system; determining whether the reading of the prn file has been completed, if the reading of the prn file has been completed, then printing is completed; if the reading of the prn file has not been completed, then continuing to determine whether the reading of the first swath print data has been completed; when the reading of the first swath print data has not been completed, then returning to the step of determining whether the reading of the prn file has been completed; when the reading of the first swath print data has been completed, then converting the first swath print data into swath data.

[0036] Among them, in the embedded system, the specific means of processing the PRN file to determine whether the printing operation can be performed include: first, loading the PRN file into the memory of the embedded system; then, periodically checking the reading status of the file through the file reading interface, using a flag or a state variable to track whether the file has been completely read; if the PRN file has been completely read, then the printing task ends, otherwise the system will continue to monitor whether enough data has been read to generate the print data of the first swath; if the data of the first swath is not ready, the system will loop back to check the reading status of the PRN file; once the data of the first swath is ready, the system will perform a conversion operation to convert the data in the PRN file into a swath data format suitable for printing, and then continue the subsequent printing process. This process ensures that the system can effectively process large print files under limited memory resources and print after the data is fully prepared.

[0037] Specifically, by implementing this method of PRN file processing and swath data conversion in an embedded system, memory usage can be effectively managed to ensure that large print files can be processed even with limited resources. The advantage of this method is that it can dynamically monitor the progress of file reading and convert it to the format required for printing in a timely manner when the data is fully prepared, thereby avoiding the problems of memory overflow and printing interruption. In addition, it can also improve printing efficiency because the system does not need to wait for the entire file to be loaded before starting the printing task, reducing waiting time. Ultimately, this method provides users with a smoother and more reliable printing experience, ensuring the continuity and stability of printing even when processing large or complex print jobs.

[0038] Furthermore, when the swath data size exceeds the starting memory size, after the swath data is divided into multiple data slices, it specifically includes: calculating the difference between the current swath data size and the size of the board-side memory; determining the number of swath data to be divided according to the difference; and dividing the swath data into multiple data slices according to the number.

[0039] Specifically, when the size of the swath data exceeds the memory capacity of the embedded system, a precise calculation process is performed to determine how to split the data. First, the difference between the total size of the swath data and the memory capacity on the board side is calculated to determine the amount of excess. Then, based on this difference and the memory capacity, the system dynamically calculates how many data slices need to be split into to ensure that each data slice can be fully accommodated in the memory. Next, using a segmentation algorithm, the swath data is divided into a predetermined number of data slices, each of which is marked with a sequence number and size so that it can be correctly identified and sorted during transmission and subsequent reorganization. This segmentation strategy not only ensures that the data can be effectively transmitted to the embedded system, but also improves transmission efficiency by optimizing the size and number of data slices, reducing possible errors and retransmission requirements during transmission, thereby improving overall printing performance and reliability.

[0040] Furthermore, when the data in the transmission process is too large, the swath data is compressed and then packetized, specifically including: compressing the swath data into a binary stream; dividing the binary stream into multiple data slices, each data slice is accompanied by a serial number; and sending the divided data slices to the embedded system end.

[0041] Specifically, in order to effectively deal with the problem of large data volume during transmission, the implementation means include first using an efficient compression algorithm, such as DEFLATE or LZ4, to compress the swath data into a binary stream to significantly reduce the data volume. Then, according to the memory capacity and network bandwidth of the embedded system, the appropriate data slice size is determined, and the compressed binary stream is divided into multiple data slices according to this size. Each data slice is assigned a unique sequence number for easy reorganization on the embedded system side. The sequence number and size information of the data slice are encapsulated in the header of each data slice, ensuring the traceability and integrity of data transmission. Finally, these data slices are sent to the embedded system side in sequence through a reliable transmission protocol, such as TCP. In this process, flow control and congestion avoidance mechanisms can also be implemented to adapt to changes in network conditions and ensure the stability and reliability of data transmission. This compression and packetization method not only improves the efficiency of data transmission, but also reduces the risk of transmission failure caused by network problems, thereby improving the continuity of printing tasks and overall system performance.

[0042] Furthermore, a large file printing method for an embedded system also includes: S3, a data receiving module in the embedded system receives data slices and performs a queue operation; wherein the data receiving module includes: a data receiving thread and a queue manager thread, the data receiving thread is responsible for obtaining data from the socket and writing the data into the queue, the queue manager thread is responsible for maintaining the queue and sending data slices to the swath data module.

[0043] Specifically, in an embedded system, in order to efficiently process large file printing tasks, a data receiving module is implemented, which consists of two key threads: the data receiving thread and the queue manager thread. The data receiving thread is responsible for monitoring the network connection, receiving data slices from the sender in real time through the socket, and quickly writing these data slices into a pre-set queue, so as to avoid data loss or duplication during transmission. At the same time, the queue manager thread is responsible for maintaining the order and status of the queue to ensure that the data slices are processed in the correct order and time interval. When the data slices in the queue are ready, the queue manager thread will pass the data slices to the swath data module to trigger the printing process. This design not only improves the efficiency of data processing, but also ensures the continuity and stability of printing tasks through collaboration between threads, and maintains high performance even when processing large amounts of data.

[0044] Furthermore, a large file printing method for an embedded system also includes: S4, when the swath data module detects that the first data slice space in the queue is ready, starting the printing process of the current swath.

[0045] Furthermore, a large file printing method for an embedded system also includes: S5. When a network problem occurs during data transmission, such as data transmission delay or packet loss, a prediction is immediately made and a prompt is provided. If necessary, printing is suspended and printing is continued after more data is received.

[0046] Furthermore, when network problems occur during data transmission, a prediction model is built based on statistical analysis and machine learning techniques to predict network failures by learning the baseline of network performance and detecting deviations through statistical process control methods. In real-time data transmission, the algorithm continuously evaluates these indicators and compares them with the results predicted by the model. Once an indicator is found to be out of the normal range or the model predicts a high risk, the early warning mechanism is immediately triggered to notify the user and take corresponding preventive measures, such as suspending data transmission or rerouting network traffic to avoid data loss or printing interruption. This proactive network monitoring and early warning system can significantly improve the reliability of data transmission and the continuity of printing tasks.

[0047] Specifically, the baseline of network performance is expressed as: baseline = mean ± k × standard deviation; where k represents a constant, which is used to determine the fluctuation range of the baseline;

[0048] The statistical process control method is expressed as: When |Z| exceeds the threshold, an anomaly is considered to be detected.

[0049] Specifically, by building a predictive model based on statistical analysis and machine learning techniques, a baseline of network performance is learned and established. The baseline is represented as a central value with a fluctuation range defined by a constant k around it. Statistical process control methods are used to continuously monitor network performance indicators such as latency, packet loss rate, and throughput. When these indicators exceed predefined thresholds, the model will identify anomalies, which may indicate a network failure. This real-time monitoring and prediction capability enables the system to immediately trigger an early warning mechanism when potential problems are detected, thereby taking preventive measures such as suspending data transmission or rerouting network traffic to ensure data integrity and continuity of printing tasks. This approach significantly improves the reliability of data transmission, reduces interruptions caused by network problems, and provides users with a more stable and efficient printing experience.

[0050] When the memory space of the embedded system is not enough to accommodate the entire swath data, printing can be performed without redesigning the hardware architecture. The requirements for the memory capacity of the embedded system are reduced, thereby reducing costs. A solution suitable for large-volume printing devices (such as single-pass printers) is provided to handle continuously changing printing tasks. By printing while transmitting, printing efficiency is improved and waiting time is reduced.

[0051] An embodiment of the present application also provides a large file printing device for an embedded system, including a processor, a memory, and computer program instructions stored in the memory. When the computer program instructions are executed by the processor, the above-mentioned large file printing method steps for an embedded system are implemented.

[0052] An embodiment of the present application further provides a storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the steps of the above-mentioned large file printing method for an embedded system are implemented.

[0053] This embodiment effectively solves the challenges faced by traditional large-format printers and multi-head printers when processing large swath data. The method first determines whether the swath data exceeds the memory limit of the embedded system. If it exceeds, the data is divided into small pieces using a slicing algorithm, and a sequence number is attached to each piece of data, and then sent in sequence. On the embedded system side, these data slices are received by the data receiving module, and the data is written to the queue using the data receiving thread and the queue manager thread, ready for printing. In addition, in order to deal with network problems, the system uses a predictive model based on statistical analysis and machine learning to monitor network performance. Once a potential network failure is discovered, it immediately warns and takes preventive measures. This method not only reduces the requirements for the memory capacity of the embedded system and reduces hardware costs, but also improves printing efficiency, ensures the continuity of printing tasks, and maintains high performance and stability even when processing large data volume devices.

[0054] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technical personnel in this field can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any brief modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.

Claims

1. A large file printing method for an embedded system, characterized in that: The method comprises the following steps: determining whether the size of the swath data to be sent currently exceeds the size of the memory on the board end; wherein the swath data is the total amount of data to be output for a printing page; When the size of the swath data exceeds the size of the board memory, the swath data is divided into multiple data slices, each data slice is attached with a sequence number, the size of the data slice and the total data volume are notified to the embedded system end, and then transmitted and sent in sequence.

2. A large file printing method for an embedded system according to claim 1, characterized in that: Before determining whether the size of the swath data currently to be sent exceeds the size of the board-side memory, it also includes: inputting a prn file in the embedded system; determining whether the reading of the prn file has been completed, if the reading of the prn file has been completed, then printing is completed; if the reading of the prn file has not been completed, then continuing to determine whether the reading of the first swath print data has been completed; when the reading of the first swath print data has not been completed, then returning to the step of determining whether the reading of the prn file has been completed; when the reading of the first swath print data has been completed, then converting the first swath print data into swath data.

3. The large file printing method for embedded system according to claim 1, characterized in that: When the swath data size exceeds the starting memory size, the swath data is divided into multiple data slices, which specifically includes: calculating the difference between the current swath data size and the size of the board-side memory; determining the number of swath data to be divided according to the difference; and dividing the swath data into multiple data slices according to the number.

4. The large file printing method for embedded system according to claim 1, characterized in that: When the data in the transmission process is too large, the swath data is compressed and then packetized, specifically including: compressing the swath data into a binary stream; dividing the binary stream into multiple data slices, each data slice is accompanied by a serial number; and sending the divided data slices to the embedded system end.

5. The large file printing method for embedded system according to claim 1, characterized in that: Also includes: The data receiving module in the embedded system receives data slices and performs queue operations; wherein the data receiving module includes: a data receiving thread and a queue manager thread, the data receiving thread is responsible for obtaining data from the socket and writing the data into the queue, the queue manager thread is responsible for maintaining the queue and sending data slices to the swath data module.

6. The large file printing method for embedded system according to claim 1, characterized in that: Also includes: When the swath data module detects that the space for the first data slice in the queue is ready, the printing process of the current swath is started.

7. The large file printing method for embedded system according to claim 1, characterized in that: Also includes: When a network problem occurs during data transmission, it will be predicted and prompted immediately. If necessary, printing will be paused and printing will continue after more data is received.

8. The large file printing method for embedded system according to claim 1, characterized in that: When network problems occur during data transmission, a prediction model is built based on statistical analysis and machine learning technology. By learning the baseline of network performance and using statistical process control methods, deviations are detected and network failures are predicted. When indicators are found to be out of the normal range or the model predicts high risks, an early warning mechanism is immediately triggered. The baseline of the network performance is expressed as: baseline = mean ± k × standard; k represents a constant used to determine the fluctuation range of the baseline; The statistical process control method is expressed as: When |Z| exceeds the threshold, an anomaly is considered to be detected.

9. A large file printing device for an embedded system, characterized in that: The method comprises a processor, a memory and computer program instructions stored in the memory, and when the computer program instructions are executed by the processor, the method according to any one of claims 1 to 8 is implemented.

10. A storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method described in any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • High-performance file transmission system and method thereof

    CN101982955A

  • Printing method and system under limited capacity of memory

    CN102375704A

  • Picture data compression, transmission and printing method based on BLE technology

    CN110515570A

  • Communication network fault early warning method and system based on artificial intelligence

    CN116506275A

  • Method and device for preventing printing interruption during printing network disconnection speed reduction and storage medium

    CN117453162A