Cloud printer supporting local data acquisition

By designing a cloud printer that supports local data acquisition, adopting distributed storage and multi-cache mechanisms, combined with polling + state machine strategies, the problem of local print data being unable to be fed back to the cloud platform is solved, the coexistence and real-time response of cloud printing and local printing is realized, and data acquisition efficiency is improved.

CN120371238APending Publication Date: 2025-07-25BEIJING SPIRIT TECH DEV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510403801.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-01
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

In the prior art, local printing data cannot be fed back to the cloud platform, and cloud printing and local printing cannot coexist, which can easily affect each other.

Method used

Design a cloud printer that supports local data acquisition, consisting of a printer, a cloud server and a local cash register. Local printed data is uploaded to the cloud server through two-way communication, and a distributed storage architecture, multi-cache mechanism and polling + state machine strategy are adopted to ensure that the data is stored locally when network abnormalities are not available. The data is combined with a circular queue and an order cache table for traffic control, so as to realize the alternation and real-time nature of cloud printing and local printing.

Benefits of technology

The coexistence of cloud printing and local printing is realized without affecting each other, ensuring real-time printing response and low-latency data acquisition, improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120371238A_ABST
    Figure CN120371238A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a cloud printer supporting local data acquisition, the cloud printer provided by the embodiment of the invention is composed of a printer, a cloud server and a local cash register, and bidirectional communication exists between the printer and the cloud server; when local printing is needed, the printer collects local printing data from the local cash register and uploads the local printing data to the cloud server, so that the cloud platform collects the local printing data. According to the scheme, the local printing data can be collected and uploaded to the cloud platform, the cloud printing function and the local printing function are achieved, meanwhile, cloud printing and local printing can coexist and do not affect each other, printing response is conducted in real time, the local printing data can be fed back to the cloud platform, and the printing efficiency is improved. The cloud platform can collect the printing data of the store, so that the data can be automatically collected, and cloud printing and local printing tasks can be accurately carried out while low time delay is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the technical field of cloud printing, and particularly to a cloud printer supporting local data collection. Background Art

[0002] With the development of the Internet of Things, more and more cloud printing platforms have emerged. Through these platforms, the collection and analysis of customer printing information can be realized, and this information provides data support for industry and enterprise decision-making. At the same time of cloud printing, there will also be a certain number of local prints. These local print data are not sent down through the cloud platform, but are generated by the local host computer. Traditional cloud printing methods cannot collect this information. Summary of the Invention

[0003] Therefore, the embodiments of the present invention provide a cloud printer supporting local data collection to solve the technical problems in the prior art that local print data cannot be fed back to the cloud platform, cloud printing and local printing cannot coexist, and they are easily affected by each other.

[0004] To achieve the above object, the embodiments of the present invention provide the following technical solutions:

[0005] According to the first aspect of the embodiments of the present invention, a cloud printer supporting local data collection is provided. The cloud printer is composed of a printer, a cloud server, and a local cash register, and there is two-way communication between the printer and the cloud server;

[0006] When local printing is required, the printer collects local print data from the local cash register and uploads it to the cloud server to realize the collection of local print data by the cloud platform.

[0007] Further, the storage architecture of the cloud printer is a distributed storage architecture. The printer stores the data in the printer itself while printing, and waits until the printer is idle after printing is completed, and then sends the print data to the cloud server in turn;

[0008] Among them, when a network exception occurs and the printer cannot communicate with the cloud server, the print data is first stored locally, and after the network is restored, the print order from the local cash register is uploaded to the cloud server.

[0009] Further, the data processing system architecture of the printer includes a hardware interrupt system, a real-time operating system, a device abstraction layer, a hardware driver layer, a communication interface, and a printing unit;

[0010] The communication interface directly sends the information to the device abstraction layer, and the device abstraction layer sends the data to the hardware interrupt system for data caching;

[0011] The hardware interrupt system releases a signal to the real-time operating system, which conveys the signal to the printing unit for printing through the device abstraction layer and the hardware driver layer in sequence;

[0012] Among them, the communication interfaces include WIFI, 4G, ETH, USB, and BLE.

[0013] Furthermore, in the data processing system architecture, the data of each interface is directly received and cached through interruption. After the reception is completed, a signal is released to notify the operating system that there is data to be printed, and the printer calls the underlying hardware driver to implement the printing operation.

[0014] Furthermore, the real-time operating system controls each component unit inside the printer by creating threads, sets priorities according to the real-time requirements of each thread, and the threads with higher priorities obtain the control right of the CPU;

[0015] Obtain the correct device driver through the device abstraction layer interface, and perform data interaction or control interaction with the underlying hardware device through the device abstraction layer.

[0016] Furthermore, the hardware interrupt system is used to receive the printing data from each communication interface and cache the printing data.

[0017] Furthermore, the device abstraction layer is used to shield the differences of the underlying hardware and provide a unified interface.

[0018] Furthermore, the hardware interrupt system adopts a multi-buffer mechanism. Each communication interface caches data in the corresponding buffer, and when printing, the basic polling algorithm is used to detect whether there is data to be printed in each buffer.

[0019] Furthermore, the basic polling algorithm includes:

[0020] S101. Judge whether there is printing data cached in the printer both locally and in the cloud. If so, execute S102; otherwise, execute S103;

[0021] S102. Judge whether the last printing data is local data. If so, print the cloud data this time; otherwise, print the local data. After completion, execute S101 again;

[0022] S103. Detect whether there is local data cached in the printer. If so, print the local data. After printing is completed, return to S101; otherwise, continue to judge whether there is cloud data cached. If so, print the cloud data; otherwise, execute S101.

[0023] Furthermore, when there are both local printing and cloud printing requirements at the same time, alternating printing of local and cloud is realized through the multi-buffer mechanism, including:

[0024] S201. Simultaneously send a print data request from the local interface and the cloud;

[0025] S202. The printer caches each print data into the corresponding buffer according to the interface corresponding to each print data request;

[0026] S203. Determine whether there is print data in the double buffer. If there is, execute S204; otherwise, continue to execute S203 and wait for print data to be stored in the buffer;

[0027] S204. Determine whether the data printed in the previous order is cloud data. If it is cloud data, execute S205; otherwise, execute S206;

[0028] S205. Determine whether there is print data in the local data buffer. If there is, print the local data; otherwise, continue to determine whether there is cloud data to be printed. If there is, print the cloud data; if not, execute S203;

[0029] S206. Determine whether there is cloud data to be printed. If there is, print the cloud data; otherwise, continue to determine whether there is local data to be printed. If there is, print the local data; if not, execute S203;

[0030] S207. Wait until all printing is completed, then return to S203 and continue to execute.

[0031] Further, when a network exception occurs, the waiting time of the CPU is reduced by means of polling and state machine, and the maximum amount of CPU resources is released for local printing, including:

[0032] S301. According to the network connection process, split the real-time printing policy during network exception into several steps A to step N;

[0033] S302. Further split the above steps A to step N into several small steps a to small step n;

[0034] S303. Detect whether the network connection is abnormal in a polling manner. If it is abnormal, execute S304; if no abnormality occurs, execute S306;

[0035] S304. Execute small step a under major step A. When encountering a delay or waiting state, jump out of the current step and execute S306; otherwise, execute S305;

[0036] S305: Wait for small step a to be executed, and change the small step number. Determine whether all small steps under major step A have been executed. If so, change the major step number; otherwise, execute S306;

[0037] S306. Execute the printing task, and after completion, continue to return to S303.

[0038] Further, the printing data is stored and synchronized to the cloud through a circular queue, an order cache table, free storage, and flow control, including:

[0039] S401. Determine whether there is data to be printed currently. If so, execute S402; if not, execute S412.

[0040] S402. Determine whether the remaining space is sufficient currently. If so, execute S403; if not, set the device status to busy to perform flow control on the received data, and then execute S403.

[0041] S403. Print the data until a single order of data is printed completely.

[0042] S404. Determine whether the current network connection is abnormal. If abnormal, execute S405; if not, execute S408.

[0043] S405. Send the single order of data printed in S403 to the server.

[0044] S406. Release the printed data in the cache that was printed in S403.

[0045] S407. Determine whether the remaining space in the current cache is sufficient. If sufficient, modify the device status to idle, at which time data can be received continuously, and then execute S401; if not, directly execute S401.

[0046] S408. Determine whether there is still data in the cache that has not been printed. If so, execute S409; if not, execute S413.

[0047] S409. Store the start address and end address of the printed data in S403 in the circular queue in the order cache table.

[0048] S410. Determine whether the device status is in a busy state. If so, execute S411; if not, execute S401.

[0049] S411. Find the oldest entry in the order cache table, retrieve the data in its corresponding buffer, store it in the storage medium, and after storage, delete the entry from the order cache table and execute S407.

[0050] S412. Determine whether the order cache table is empty. If empty, execute S401; if not, execute S411.

[0051] S413. Store the printed data in a storage medium, and execute S407 after the storage is completed.

[0052] The embodiments of the present invention have the following advantages:

[0053] The cloud printer proposed by the embodiments of the present invention consists of a printer, a cloud server, and a local cash register. There is two-way communication between the printer and the cloud server. When local printing is required, the printer collects local printing data from the local cash register and uploads it to the cloud server to realize the collection of local printing data by the cloud platform. The embodiments of the present invention provide a solution that can collect local printing data and upload it to the cloud platform. While having the functions of cloud printing and local printing, cloud printing and local printing can coexist without affecting each other, and real-time printing responses are performed. Local printing data can be fed back to the cloud platform, and the cloud platform can collect the printing data of the store, thereby facilitating the automatic collection of data, achieving low latency while accurately performing cloud printing and local printing tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only exemplary, and for those of ordinary skill in the art, without creative efforts, other implementation drawings can be obtained according to the provided drawings.

[0055] The structures, ratios, sizes, etc. depicted in this specification are only used to cooperate with the content disclosed in the specification for those familiar with this technology to understand and read, and are not used to limit the limiting conditions under which the present invention can be implemented. Therefore, they do not have technical substantive significance. Any modification of the structure, change of the proportional relationship, or adjustment of the size, without affecting the effects that the present invention can produce and the purposes that can be achieved, should still fall within the scope that can be covered by the technical content disclosed in the present invention.

[0056] Figure 1 It is a data flow diagram of a cloud printer supporting local data collection provided by an embodiment of the present invention;

[0057] Figure 2 It is a schematic diagram of a distributed storage architecture of a cloud printer supporting local data collection provided by an embodiment of the present invention;

[0058] Figure 3 It is a schematic diagram of a data processing system architecture of a cloud printer supporting local data collection provided by an embodiment of the present invention;

[0059] Figure 4A double-buffering schematic diagram of local printing and associated printing in a cloud printer supporting local data collection provided by an embodiment of the present invention;

[0060] Figure 5 A schematic diagram of the basic polling algorithm process in a cloud printer supporting local data collection provided by an embodiment of the present invention;

[0061] Figure 6 A schematic diagram of an alternating printing mechanism in a cloud printer supporting local data collection provided by an embodiment of the present invention;

[0062] Figure 7 A schematic diagram of the process of an alternating printing mechanism in a cloud printer supporting local data collection provided by an embodiment of the present invention;

[0063] Figure 8 A schematic diagram of the real-time printing strategy process when there is a network anomaly in a cloud printer supporting local data collection provided by an embodiment of the present invention;

[0064] Figure 9 A schematic diagram of the real-time printing strategy when storing an order in a cloud printer supporting local data collection provided by an embodiment of the present invention;

[0065] Figure 10 A schematic diagram of the real-time printing strategy process when storing an order in a cloud printer supporting local data collection provided by an embodiment of the present invention. Detailed implementation manners

[0066] The following specific embodiments illustrate the implementation manners of the present invention. Those skilled in the art can easily understand the other advantages and effects of the present invention from the content disclosed in this specification. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.

[0067] With the development of the Internet of Things, more and more cloud printing platforms have emerged. Through these platforms, the collection and analysis of customer printing information can be realized, and this information provides data support for industry and enterprise decision-making. At the same time as cloud printing, there will also be a certain number of local printings. These local printing data are not sent down through the cloud platform, but are generated by the local host computer. Traditional cloud printing methods cannot collect this information.

[0068] To solve the above technical problems that local printing data cannot be fed back to the cloud platform, cloud printing and local printing cannot coexist, and they are easily affected by each other.

[0069] Reference Figure 1, embodiments of the present invention disclose a cloud printer supporting local data collection. The cloud printer consists of a printer, a cloud server, and a local cash register. There is two-way communication between the printer and the cloud server. When local printing is required, the printer collects local printing data from the local cash register and uploads it to the cloud server to achieve the collection of local printing data by the cloud platform.

[0070] ① represents the data flow from the local cash register to the printer, ② represents the data flow from the cloud server to the printer, and ③ represents the data flow from the printer to the cloud server.

[0071] The storage architecture of the cloud printer is a distributed storage architecture. Please refer to Figure 2 , while printing data, the printer stores the data inside the printer and waits until the printer is idle, then sequentially sends the printing data to the cloud server.

[0072] The printer in this architecture stores the data inside the printer while printing and pushes the printing data of each order to the cloud when the printer is idle, realizing the distributed storage of printing data in the cloud and locally. At the same time, when the network is abnormal and communication with the server cannot be established, the printing data is stored locally, and after the network is restored, the local orders are pushed to the server to prevent incomplete or lost orders on the server.

[0073] Among them, when a network exception occurs and the printer cannot communicate with the cloud server, the printing data is first stored locally and uploaded to the cloud server after the network is restored.

[0074] Furthermore, referring to Figure 3 , the data processing system architecture of the printer includes a hardware interrupt system, a real-time operating system, a device abstraction layer, a hardware driver layer, a communication interface, and a printing unit. The communication interface directly sends information to the device abstraction layer, and the device abstraction layer sends the data to the hardware interrupt system for data caching. The hardware interrupt system releases a signal to the real-time operating system, and the real-time operating system conveys this signal to the printing unit through the device abstraction layer and the hardware driver layer in sequence for printing.

[0075] Among them, the communication interface includes WIFI, 4G, ETH, USB, and BLE.

[0076] To meet the requirements of both real-time performance and reliability, the present invention adopts a solution that combines hardware interrupts with a real-time operating system. The data of each interface is directly received and cached through interrupts. After the reception is completed, a signal is released to notify the operating system that there is data to be printed, and then the printer calls the underlying hardware driver to implement the printing operation. This entire process minimizes the interference of other threads to the cached data and the printed data to the greatest extent, achieving zero latency in data transmission, processing, and final delivery for printing, thereby ensuring the real-time performance and reliability of the system. At the same time, to consider portability, a device abstraction layer is added to the overall architecture to shield the differences of the underlying hardware.

[0077] Furthermore, in the data processing system architecture, the data of each interface is directly received and cached through interrupts. After the reception is completed, a signal is released to notify the operating system that there is data to be printed, and the printer calls the underlying hardware driver to implement the printing operation; the device abstraction layer is used to shield the differences of the underlying hardware and provide a unified interface, greatly improving the compatibility and portability of multiple platforms.

[0078] Furthermore, the real-time operating system controls each component unit inside the printer by creating threads, sets priorities according to the real-time requirements of each thread, and the threads with high priorities obtain the control right of the CPU; it obtains the correct device driver through the device abstraction layer interface and conducts data interaction or control interaction with the underlying hardware device through the device abstraction layer.

[0079] The real-time operating system controls each module inside the printer by creating threads, including the control of data printing, and sets priorities according to the real-time requirements of each thread. The threads with high priorities obtain the control right of the CPU. It obtains the correct device driver through the device abstraction layer interface and then conducts data (or control) interaction with the underlying hardware device through this device abstraction layer.

[0080] Furthermore, the hardware interrupt system is used to receive the printing data from each communication interface and cache the printing data.

[0081] The hardware interrupt is responsible for receiving the printing data sent by each communication interface and caching the data to optimize the real-time performance.

[0082] Furthermore, please refer to Figure 4 , the hardware interrupt system adopts a multi-buffer mechanism. Each communication interface caches data in the corresponding buffer, and when printing, the basic polling algorithm is used to detect whether there is data to be printed in each buffer.

[0083] Regardless of the communication interface used (USB for local printing, network interface for cloud printing, or 4G module), the data transmission speed is very fast, while the printing speed of the printer is relatively slow, resulting in a speed mismatch between the two. To solve the speed matching problem, it is necessary to cache the data received from the communication interface and then print it when the printer is idle. However, the traditional single-buffer mechanism cannot solve the problem of crossed or garbled printed content caused by the crossing of cached content when multiple interfaces print simultaneously. Therefore, for multi-interface printing, we need to abandon this single-buffer mechanism and adopt a multi-buffer mechanism. Each communication interface caches data in the corresponding buffer, and when printing, the basic polling algorithm is used to detect whether there is data to be printed in each buffer, thus solving the problem of crossed and garbled content.

[0084] Further, referring to Figure 5 , the basic polling algorithm includes:

[0085] S101. Determine whether there is print data cached in the printer both locally and in the cloud. If so, execute S102; otherwise, execute S103.

[0086] S102. Determine whether the last printed data was local data. If so, print the cloud data this time; otherwise, print the local data. After completion, execute S101 again.

[0087] S103. Detect whether there is local data cached in the printer. If so, print the local data. After printing, return to S101. Otherwise, continue to determine whether there is cloud data cached. If so, print the cloud data; otherwise, execute S101.

[0088] Referring to Figure 6 and Figure 7 , when there are both local printing and cloud printing requirements simultaneously, through the multi-buffer mechanism, alternating printing between local and cloud is achieved. The alternating printing between local and cloud improves the user experience. This architecture, combined with the multi-buffer mechanism, realizes a unique alternating printing mechanism to solve this problem. When there is data to be printed both in the cloud and locally, the effect of printing one local job and then one cloud job will be achieved:

[0089] S201. The local interface and the cloud simultaneously send print data requests.

[0090] S202. The printer caches each print data into the corresponding buffer according to the interface corresponding to each print data request.

[0091] S203. Determine whether there is print data in the double buffer. If so, execute S204; otherwise, continue to execute S203 and wait for print data to be stored in the buffer.

[0092] S204. Determine whether the data printed in the previous order is cloud data. If it is cloud data, execute S205; otherwise, execute S206.

[0093] S205. Determine whether there is print data in the local data buffer. If so, print the local data. If not, continue to determine whether there is cloud data to be printed. If so, print the cloud data. If not, execute S203.

[0094] S206. Determine whether there is cloud data to be printed. If so, print the cloud data. If not, continue to determine whether there is local data to be printed. If so, print the local data. If not, execute S203.

[0095] S207. Wait until all printing is completed, then return to S203 and continue to execute.

[0096] When the printer communicates with the cloud, it is necessary to require the printer device to have an Internet connection function. Especially for some portable printers, they often connect to the Internet in the form of 4G or WIFI. However, these Internet connection methods are affected by signal base stations and other factors, and network anomalies often occur. Once the network is abnormal, reconnecting to the network is a long process. In many cases, it will cause the CPU to wait for the corresponding state and block local printing, resulting in local printing lag or delay. By adopting the polling + state machine method, the waiting time of the CPU can be reduced, and as many CPU resources as possible can be released for local printing, making local printing more real-time and efficient.

[0097] Furthermore, when a network anomaly occurs, the waiting time of the CPU is reduced by means of polling and state machine, and the maximum amount of CPU resources is released for local printing. Refer to Figure 8 , including:

[0098] S301. According to the Internet connection process, split the real-time printing strategy during network anomalies into several steps from step A to step N.

[0099] S302. Further split the above steps from step A to step N into several small steps from small step a to small step n.

[0100] S303. Detect whether the network connection is abnormal in a polling manner. If it is abnormal, execute S304; if no abnormality occurs, execute S306.

[0101] S304. Execute small step a under the large step A. When encountering a delay or waiting state, jump out of the current step and execute S306; otherwise, execute S305.

[0102] S305: Wait until small step a is executed, and change the small step number. Determine whether all small steps under the large step A have been executed. If so, change the large step number; otherwise, execute S306.

[0103] S306. Execute the printing task, and after completion, continue to return to S303.

[0104] When the server has cloud order management, please refer to Figure 9 , the printer needs to synchronize the printed data content to the server. However, in the case of no network, the printed data needs to be stored so that the data can be synchronized to the server when the network is normal. But file storage is often a time-consuming thing. Frequent erasing and writing of the storage space during printing often causes printing lags and poor real-time printing. The method of using a circular queue + order cache table + free storage + flow control is adopted to solve this problem.

[0105] Refer to Figure 10 , store and synchronize the printed data to the cloud through a circular queue, order cache table, free storage, and flow control, including:

[0106] S401. Determine whether there is data to be printed currently. If so, execute S402; if not, execute S412;

[0107] S402. Determine whether the remaining space is sufficient currently. If so, execute S403; if not, set the device status to busy to perform flow control on the received data, and then execute S403;

[0108] S403. Print the data until a single order of data is printed completely;

[0109] S404. Determine whether the current network connection is abnormal. If abnormal, execute S405; if not abnormal, execute S408;

[0110] S405. Send the single order of data printed in S403 to the server;

[0111] S406. Release the printed data printed in S403 in the cache;

[0112] S407. Determine whether the remaining space in the current cache is sufficient. If sufficient, modify the device status to idle, at which time data can continue to be received, and then execute S401; if insufficient, directly execute S401;

[0113] S408. Determine whether there is still data in the cache that has not been printed. If so, execute S409; if not, execute S413;

[0114] S409. Store the start address and end address of the printed data printed in S403 in the circular queue in the order cache table;

[0115] S410. Determine whether the device status is in the busy state. If so, execute S411; if not, execute S401;

[0116] S411. Find the oldest entry from the order cache table, retrieve the data in its corresponding buffer, store it in the storage medium, and after the storage is completed, delete the entry from the order cache table and execute S407;

[0117] S412. Determine whether the order cache table is empty. If it is empty, execute S401; if it is not empty, execute S411;

[0118] S413. Store the printed data in the storage medium, and execute S407 after the storage is completed.

[0119] In the embodiments of the present invention, the storage medium may be a memory, for example, it may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories.

[0120] Among them, the non-volatile memory may be a read-only memory (ROM for short), a programmable read-only memory (PROM for short), an erasable programmable read-only memory (EPROM for short), an electrically erasable programmable read-only memory (EEPROM for short), or a flash memory.

[0121] The volatile memory may be a random access memory (RAM for short), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM for short), dynamic random access memory (DRAM for short), synchronous dynamic random access memory (SDRAM for short), double data rate synchronous dynamic random access memory (DDR SDRAM for short), enhanced synchronous dynamic random access memory (ESDRAM for short), synchronous link dynamic random access memory (SLDRAM for short), and direct rambus random access memory (DRRAM for short).

[0122] The storage medium described in the embodiments of the present invention is intended to include but not limited to these and any other suitable types of memories.

[0123] Although the present invention has been described in detail above with general descriptions and specific embodiments, on the basis of the present invention, some modifications or improvements can be made, which are obvious to those skilled in the art. Therefore, these modifications or improvements made without departing from the spirit of the present invention all fall within the scope of the present invention claimed.

Claims

1. A cloud printer supporting local data collection, characterized in that, The cloud printer consists of a printer, a cloud server, and a local cash register, and there is two-way communication between the printer and the cloud server. When local printing is required, the printer collects local printing data from the local cash register and uploads it to the cloud server to achieve the collection of local printing data by the cloud platform.

2. The cloud printer supporting local data collection according to claim 1, wherein, The storage architecture of the cloud printer is a distributed storage architecture. While printing data, the printer stores the data inside the printer and, when the printer is idle after printing is completed, sequentially sends the printing data to the cloud server. Among them, when a network exception occurs and the printer cannot communicate with the cloud server, the printing data is first stored locally, and after the network is restored, the printing order from the local cash register is uploaded to the cloud server.

3. The cloud printer supporting local data collection according to claim 2, wherein, The data processing system architecture of the printer includes a hardware interrupt system, a real-time operating system, a device abstraction layer, a hardware driver layer, a communication interface, and a printing unit. The communication interface directly sends information to the device abstraction layer, and the device abstraction layer sends the data to the hardware interrupt system for data caching. The hardware interrupt system releases a signal to the real-time operating system, and the real-time operating system conveys the signal to the printing unit for printing after passing it through the device abstraction layer and the hardware driver layer in sequence. Among them, the communication interface includes WIFI, 4G, ETH, USB, and BLE.

4. The cloud printer supporting local data collection according to claim 3, wherein In the data processing system architecture, data of each interface is directly received and cached by means of interruption. After the reception is completed, the operating system is notified that there is data to be printed by releasing a signal, and the printer calls the underlying hardware driver to implement the printing operation.

5. The cloud printer supporting local data collection according to claim 4, characterized in that, The real-time operating system controls each component unit inside the printer by creating threads, sets priorities according to the real-time requirements of each thread, and the thread with a higher priority obtains the control right of the CPU. Obtain the correct device driver through the device abstraction layer interface, and perform data interaction or control interaction with the underlying hardware device through the device abstraction layer.

6. The cloud printer supporting local data collection according to claim 5, characterized in that, The hardware interrupt system is used to receive printing data from each communication interface and cache the printing data.

7. A cloud printer supporting local data collection according to claim 6, wherein the device abstraction layer is used to shield the differences of the underlying hardware and provide a unified interface.

8. The cloud printer supporting local data acquisition according to claim 7, wherein, The hardware interrupt system adopts a multi-cache mechanism. Each communication interface caches data in the corresponding cache, and when printing, the basic polling algorithm is used to detect whether there is data to be printed in each cache.

9. The cloud printer supporting local data collection according to claim 8, wherein, The basic polling algorithm includes: S101. Judge whether there is printing data cached inside the printer both locally and in the cloud. If so, execute S102; otherwise, execute S103. S102. Judge whether the previous printing data was local data. If so, print the cloud data this time; otherwise, print the local data. After completion, execute S101 again. S103. Detect whether local data is cached in the printer. If so, print the local data. After printing is completed, return to S101. Otherwise, continue to judge whether cloud data is cached. If so, print the cloud data. Otherwise, execute S101.

10. A cloud printer supporting local data collection as claimed in claim 9, wherein, When there are both local printing and cloud printing requirements, alternate printing between the local and the cloud is achieved through a multi-buffering mechanism, including: S201. The local interface and the cloud simultaneously send printing data requests; S202. The printer caches each printing data into the corresponding buffer according to the interface corresponding to each printing data request; S203. Determine whether there is printing data in the double buffer. If there is, execute S204; otherwise, continue to execute S203 and wait for the printing data to be stored in the buffer; S204. Determine whether the data of the previous print is cloud data. If it is cloud data, execute S205; otherwise, execute S206; S205. Determine whether there is printing data in the local data buffer. If there is, print the local data. If not, continue to determine whether there is cloud data to be printed. If there is, print the cloud data. If not, execute S203; S206. Determine whether there is cloud data to be printed. If there is, print the cloud data. If not, continue to determine whether there is local data to be printed. If there is, print the local data. If not, execute S203; S207. Wait until all printing is completed and then return to S203 to continue execution.

11. A cloud printer supporting local data acquisition according to claim 10, characterized in that, When a network exception occurs, the waiting time of the CPU is reduced and the maximum amount of CPU resources is released for local printing through polling and a state machine, including: S301. According to the networking process, split the real-time printing policy during network exceptions into several steps from step A to step N; S302. Further split the above steps A to N into several small steps from small step a to small step n; S303. Detect whether the network connection is abnormal in a polling manner. If it is abnormal, execute S304; if no abnormality occurs, execute S306; S304. Execute small step a under the large step A. When encountering a delay or waiting state, jump out of the current step and execute S306; otherwise, execute S305; S305: Wait for small step a to be executed and change the small step number. Determine whether all small steps under the large step A have been executed. If so, change the large step number; otherwise, execute S306; S306. Execute the printing task, and continue to return to S303 after execution.

12. The cloud printer supporting local data collection according to claim 11, wherein The printing data is stored and synchronized to the cloud through a circular queue, an order cache table, free storage, and flow control, including: S401. Determine whether there is data to be printed currently. If so, execute S402; if not, execute S412; S402. Determine whether the remaining space currently is sufficient. If so, execute S403; if not, set the device status to busy to perform flow control on the received data, and then execute S403; S403. Print the data until a single order of data is printed; S404. Determine whether the current network connection is abnormal. If it is abnormal, execute S405; if no abnormality occurs, execute S408; S405. Send a single order of data printed in S403 to the server; S406. Release the printing data printed in S403 that has been completed in the cache; S407. Determine whether the remaining space in the current cache is sufficient. If it is sufficient, modify the device status to idle. At this time, data can continue to be received, and then S401 is executed; if it is insufficient, directly execute S401; S408. Determine whether there is still data in the cache that has not been printed. If there is, execute S409; if not, execute S413; S409. Store the start address and end address of the print data printed in S403 in the loop queue into the order cache table; S410. Determine whether the device status is busy. If it is, execute S411; if not, execute S401; S411. Find the oldest entry in the order cache table, retrieve the data in its corresponding buffer, store it in the storage medium. After the storage is completed, delete the entry from the order cache table and execute S407; S412. Determine whether the order cache table is empty. If it is empty, execute S401; if not, execute S411; S413. Store the printed data in the storage medium. After the storage is completed, execute S407.