Data processing method and device, equipment, storage medium and program product

By allocating independent memory space for each terminal and processing data according to the connection identification, the problem of unstable data processing under multiple terminal connections is solved, and the reliability and stability of data processing are achieved.

CN120029569APending Publication Date: 2025-05-23WUHAN JINGCHEN INTELLIGENT IDENTIFICATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510079049.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-17
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

In the scenario where multiple terminals are connected at the same time, it is difficult for printing devices to effectively process data from different terminals, which may lead to data confusion and unstable processing.

Method used

By establishing communication connections with multiple terminals respectively and allocating a memory space associated with each terminal, instruction data is stored and processed according to the terminal's connection identification. The specific steps include receiving instruction data sent by the terminal, storing data according to the connection identifier, and performing processing tasks when traversing the memory space of each terminal.

Benefits of technology

This method effectively avoids data confusion, ensures that the data of each terminal is processed independently, and improves the reliability and stability of data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120029569A_ABST
    Figure CN120029569A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and device, equipment, a storage medium and a program product, which are applied to printing equipment. The method comprises the following steps: respectively establishing communication connection with a plurality of terminals, and distributing a first memory space for each terminal after the communication connection with each terminal is established; each first memory space is associated with a connection identifier of each terminal; receiving instruction data sent by each terminal; each instruction data carries a connection identifier of each terminal; according to the connection identifier of each terminal, storing each instruction data to a corresponding first memory space; and under the condition of traversing to the first memory space corresponding to any terminal in the plurality of terminals, executing processing according to the instruction data sent by any terminal. By adopting the scheme, the data received in the multi-connection state can be effectively classified, stored and processed, the problem of data confusion is avoided, and the reliability of data processing is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of printing technology, and in particular to a data processing method, device, equipment, storage medium and program product. Background Art

[0002] Users usually communicate with the printing device through terminals such as mobile phones. During the communication process, the communication module of the printing device receives the command data sent by the user through the terminal, and sends the command data to the MCU (Microcontroller Unit) of the printing device through the serial port. The MCU parses the command data and controls the printer to perform corresponding operations, such as adjusting printing parameters, starting printing tasks, etc.

[0003] When a printing device is connected to multiple terminals at the same time, a more reliable data processing method needs to be provided to avoid data confusion problems that may occur in multi-connection scenarios. Summary of the invention

[0004] The embodiments of the present application provide a data processing method, device, equipment, storage medium and program product, which can improve the reliability of data processing. The above technical solution is as follows:

[0005] In a first aspect, an embodiment of the present application provides a data processing method, which is applied to a printing device, comprising:

[0006] Establishing communication connections with multiple terminals respectively, and allocating a first memory space to each terminal after establishing the communication connection with each terminal; each first memory space is associated with a connection identifier of each terminal;

[0007] Receive instruction data sent by each terminal; each instruction data carries a connection identifier of each terminal;

[0008] According to the connection identifier of each terminal, each instruction data is stored in the corresponding first memory space;

[0009] When traversing to the first memory space corresponding to any one of the multiple terminals, processing is performed according to the instruction data sent by any one of the terminals.

[0010] In a possible implementation, the instruction data sent by any terminal includes start printing instruction data;

[0011] In the case of traversing to a first memory space corresponding to any one of the multiple terminals, executing processing according to instruction data sent by any one of the terminals includes:

[0012] In the case of traversing to a first memory space corresponding to any one of the multiple terminals, reallocating a second memory space for any one of the terminals according to the start printing instruction data; the second memory space is larger than the first memory space, and the second memory space is associated with a connection identifier of any one of the terminals;

[0013] storing the print data sent by any terminal into the second memory space;

[0014] When traversing to the second memory space, executing a corresponding printing task according to the printing data;

[0015] According to the connection identifier of any terminal, the status information of the printing task is fed back to any terminal.

[0016] In a possible implementation, when traversing to the second memory space, after executing a corresponding printing task according to the printing data, the method further includes:

[0017] Determine whether the printing task has been completed;

[0018] When the printing task has been completed, the first memory space is reallocated to any terminal.

[0019] In a possible implementation, when traversing to the first memory space corresponding to any one of the multiple terminals, after reallocating the second memory space for any one of the terminals according to the start printing instruction data, the method further includes:

[0020] In the case of traversing to any one of the first memory spaces, determining whether the instruction data stored in any one of the first memory spaces includes printing instruction data;

[0021] In the case where the instruction data stored in any one of the first memory spaces includes printing instruction data, refusing to respond to the printing instruction data;

[0022] In the case that the instruction data stored in any one of the first memory spaces does not include the printing instruction data, the instruction data stored in any one of the first memory spaces is responded to.

[0023] In a possible implementation, when traversing to the second memory space, after executing a corresponding printing task according to the printing data, the method further includes:

[0024] When it is detected that the communication connection established with any terminal is disconnected, the corresponding printing task continues to be executed according to the printing data.

[0025] In a possible implementation, the method further includes:

[0026] In response to a connection disconnection request sent by any terminal, disconnect the communication connection established with any terminal;

[0027] According to the connection identifier of any terminal, data in the first memory space corresponding to any terminal is cleared.

[0028] In a possible implementation, the method further includes:

[0029] When it is detected that the communication connection with any terminal is unstable, connection status prompt information is sent to any terminal according to the connection identifier of any terminal.

[0030] In a possible implementation, the instruction data sent by any terminal does not include start printing instruction data;

[0031] In the case of traversing to a first memory space corresponding to any one of the multiple terminals, executing processing according to instruction data sent by any one of the terminals includes:

[0032] When traversing to a first memory space corresponding to any one of the multiple terminals, executing a corresponding instruction task according to the instruction data;

[0033] According to the connection identifier of any terminal, the status information of the command task is fed back to any terminal.

[0034] In a possible implementation, the multiple terminals include a mother terminal and multiple sub-terminals, the mother terminal is used to verify the multiple instruction data sent by the multiple sub-terminals, and send the multiple instruction data after verification as multiple target instruction data to the printing device; each target instruction data carries a connection identifier of each sub-terminal;

[0035] The method also includes:

[0036] Establishing a communication connection with a mother terminal;

[0037] receiving a plurality of target instruction data sent by the mother terminal, and after receiving each target instruction data, allocating a first memory space to each child terminal according to a connection identifier carried by each target instruction data; each first memory space is associated with a connection identifier of each child terminal;

[0038] According to the connection identifier of each sub-terminal, each target instruction data is stored in the corresponding first memory space;

[0039] When traversing to the first memory space corresponding to any sub-terminal, processing is performed according to the target instruction data corresponding to any sub-terminal.

[0040] In a second aspect, an embodiment of the present application provides a data processing device, applied to a printing device, comprising:

[0041] A connection module, used to establish communication connections with multiple terminals respectively, and allocate a first memory space to each terminal after establishing a communication connection with each terminal; each first memory space is associated with a connection identifier of each terminal;

[0042] A receiving module, used for receiving instruction data sent by each terminal; each instruction data carries a connection identifier of each terminal;

[0043] A storage module, used for storing each instruction data into a corresponding first memory space according to the connection identifier of each terminal;

[0044] The execution module is used to execute processing according to the instruction data sent by any terminal when traversing to the first memory space corresponding to any terminal among the multiple terminals.

[0045] In a third aspect, an embodiment of the present application provides a printing device, comprising: a processor and a memory; wherein the memory stores a computer program, and when the processor executes the computer program, the method steps provided in the first aspect of the embodiment of the present application are implemented.

[0046] In a fourth aspect, an embodiment of the present application provides a computer storage medium, which stores multiple instructions, and the above instructions are suitable for being loaded by a processor and executing the method steps provided in the first aspect of the embodiment of the present application.

[0047] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program; when the above-mentioned computer program is executed by a processor, the method steps provided in the first aspect of the embodiment of the present application are implemented.

[0048] In the above data processing method, the printing device establishes communication connections with multiple terminals respectively, and after establishing communication connections with each terminal, allocates a first memory space associated with its connection identifier to each terminal, which can ensure that each terminal can have a different independent memory space to save the subsequent sent data after establishing a communication connection with the printing device; after receiving the instruction data sent by each terminal, according to the connection identifier of each terminal carried by each instruction data, each instruction data is stored in the corresponding first memory space, which helps to distinguish the instruction data from different terminals through partitioned storage management; by performing processing according to the instruction data sent by any terminal when traversing to the first memory space corresponding to any terminal among the multiple terminals, it can ensure that in the scenario where multiple terminals are connected at the same time, the data from different terminals are correctly processed to provide stable services for users. The above method can effectively classify, store and process the data received in the multi-connection state, avoid data confusion problems, and improve the reliability of data processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0050] Figure 1 A schematic diagram of an application environment of a data processing method provided by an exemplary embodiment of the present application;

[0051] Figure 2 A flowchart of a data processing method provided for an exemplary embodiment of the present application;

[0052] Figure 3 A flowchart of another data processing method provided for an exemplary embodiment of the present application;

[0053] Figure 4 A flowchart of another data processing method provided for an exemplary embodiment of the present application;

[0054] Figure 5 A flowchart of another data processing method provided for an exemplary embodiment of the present application;

[0055] Figure 6 A flowchart of another data processing method provided for an exemplary embodiment of the present application;

[0056] Figure 7 A schematic diagram of the structure of a data processing device provided for an exemplary embodiment of the present application;

[0057] Figure 8 A schematic structural diagram of a printing device provided as an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0059] In the description of the present application, it should be understood that the terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances. In addition, in the description of the present application, unless otherwise specified, "plurality" refers to two or more. "And" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previously associated objects are in an "or" relationship.

[0060] The data processing method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the printing device 10 establishes communication connections with multiple terminals (terminal 21, terminal 22, terminal 23... in the figure) through a communication network, and after establishing a communication connection with each terminal, allocates a first memory space associated with its connection identifier to each terminal. After establishing a communication connection with each terminal, the printing device 10 can receive the instruction data sent by each terminal in real time through an external wireless communication module, and store each instruction data in the corresponding first memory space according to the connection identifier of each terminal carried by each instruction data. Subsequently, the printing device 10 will periodically traverse each block of the first memory space. When traversing to the first memory space corresponding to any terminal, the printing device performs processing according to the instruction data sent by the terminal.

[0061] It is worth noting that the terminal that establishes a communication connection with the printing device 10 may be, but is not limited to, various smart phones, tablet computers, personal computers, laptop computers, Internet of Things devices and portable wearable devices. The Internet of Things devices may be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The connection identifier may be, but is not limited to, a handle, etc. The wireless communication module may be, but is not limited to, a Bluetooth communication module, a WiFi communication module, etc. The printing device 10 is hardware-connected to the wireless communication module via a serial port, so as to receive the command data sent by each terminal in real time.

[0062] In one embodiment, Figure 2 As shown, a data processing method is provided, which is applied to Figure 1 The printing device 10 in the embodiment is taken as an example to illustrate, and the following steps are included:

[0063] S201: establishing communication connections with a plurality of terminals respectively, and allocating a first memory space to each terminal after establishing the communication connection with each terminal; each first memory space is associated with a connection identifier of each terminal.

[0064] The first memory space may be, but is not limited to, a ring buffer in the memory. The connection identifier of each terminal may be, but is not limited to, a handle identifier of each terminal.

[0065] Optionally, the printing device 10 establishes communication connections with multiple terminals respectively through the wireless communication module, and after establishing the communication connection with each terminal, allocates a different ring buffer to each terminal for storing data subsequently sent by the terminal.

[0066] Specifically, after the printing device 10 establishes a communication connection with any terminal through the wireless communication module, the wireless communication module immediately reports a connection event including the terminal handle identifier to the MCU of the printing device 10. After receiving the connection event, the MCU of the printing device 10 allocates an independent ring buffer for the corresponding terminal according to the handle identifier in the connection event, and the ring buffer is associated with the handle identifier in the connection event.

[0067] It is understandable that in the early stage of establishing a communication connection between the terminal and the printing device 10, the communication interaction between the two is mainly to confirm the connection status or set printing-related parameters, rather than to transmit a large amount of actual data (such as printing data). Therefore, in the early stage of establishing a communication connection between the terminal and the printing device 10, the amount of data exchanged between the two is relatively small, and the first memory space (such as a ring buffer) allocated to each terminal can also be set to be small, which can effectively save its memory resources without affecting the data processing performance of the printing device 10, thereby improving the data processing speed.

[0068] In this embodiment, the printing device establishes communication connections with multiple terminals respectively, and after establishing communication connections with each terminal, allocates a first memory space associated with the connection identifier to each terminal (such as each ring buffer in the memory), which can ensure that each terminal has a different independent memory space to store the data sent subsequently after establishing a communication connection with the printing device, ensuring that the data streams of different terminals are independent of each other and will not be confused. In addition, by reasonably allocating the size of the first memory space, the printing device effectively saves the memory resources of the printing device and improves the data processing speed of the printing device while ensuring that the first memory space can meet the actual data processing needs.

[0069] S202: Receive instruction data sent by each terminal; each instruction data carries a connection identifier of each terminal.

[0070] Optionally, the printing device 10 receives the instruction data sent by each terminal through the wireless communication module, and after receiving each instruction data, reports each instruction data and the connection identifier of each terminal carried by it to the MCU. It can be understood that the instruction data sent by each terminal carries the unique handle identifier corresponding to each terminal to ensure that the printing device 10 can distinguish and process instructions from different terminals.

[0071] Specifically, the instruction data may include, but is not limited to: start printing instruction data, print instruction data, status query instruction data, connection control instruction data, etc. The start printing instruction data is used to control the printing device to perform printing initialization. The print instruction data is used to set relevant parameters of the print task and control the start and stop of the print task. The status query instruction data is used to query the progress status of the print task. The connection control instruction is used to control the connection or disconnection of communication.

[0072] S203: storing each instruction data into a corresponding first memory space according to the connection identifier of each terminal.

[0073] Optionally, after receiving each instruction data, the MCU of the printing device 10 searches for the ring buffer of the corresponding terminal in the mapping table maintained internally according to the handle identifier carried by each instruction data, and then stores each instruction data in the corresponding found ring buffer.

[0074] In this embodiment, the printing device receives the command data sent by each terminal, and after receiving the command data sent by each terminal, stores each command data in the corresponding first memory space according to the connection identifier of each terminal carried by each command data, which helps to distinguish the command data from different terminals through partitioned storage management.

[0075] S204: When traversing to a first memory space corresponding to any one of the multiple terminals, execute processing according to instruction data sent by any one of the terminals.

[0076] Optionally, the MCU of the printing device 10 traverses the ring buffer allocated to each terminal in the memory (i.e., the ring buffer associated with the handle identifier of each terminal), and each time it traverses to a ring buffer, it determines whether the ring buffer stores data to be parsed. If the ring buffer stores data to be parsed, the corresponding data is taken out for parsing, and the handle identifier corresponding to the ring buffer is recorded. After the complete instruction data is parsed, the corresponding processing is performed according to the parsed instruction data and the recorded handle identifier.

[0077] Specifically, if the instruction data parsed from the ring buffer by the MCU of the printing device 10 includes the start printing instruction data, the MCU allocates a larger ring buffer to the corresponding terminal according to the handle identifier corresponding to the ring buffer to store the printing data to be sent by the terminal later; after the printing is completed, the status information of the printing task is fed back to the corresponding terminal, and a smaller ring buffer is reallocated to the terminal. The smaller ring buffer can be consistent with the ring buffer size set when it was initially allocated to save memory space. If the instruction data parsed from the ring buffer by the MCU of the printing device 10 does not include the start printing instruction data, the MCU executes the corresponding instruction task according to the instruction data, and feeds back the status information of the instruction task to the corresponding terminal according to the handle identifier corresponding to the ring buffer.

[0078] In this embodiment, the printing device traverses the circular buffer allocated to multiple terminals in the memory, and when traversing to the first memory space corresponding to any one of the multiple terminals, performs processing according to the data to be parsed stored in the first memory space (that is, the instruction data most recently sent by any terminal). This can ensure that in a scenario where multiple terminals are connected at the same time, data from different devices can be correctly processed to provide users with stable services.

[0079] In the above data processing method, the printing device establishes communication connections with multiple terminals respectively, and after establishing communication connections with each terminal, allocates a first memory space associated with the connection identifier to each terminal, which can ensure that each terminal can have a different independent memory space to store the subsequently sent data after establishing communication connection with the printing device, ensuring that the data streams of different terminals are independent of each other and will not be confused; by reasonably allocating the size of the first memory space, while ensuring that the first memory space can meet the actual data processing needs, the memory resources of the printing device are effectively saved, and the data processing speed of the printing device is improved; by receiving the instruction data sent by each terminal, and after receiving the instruction data sent by each terminal, storing each instruction data in the corresponding first memory space according to the connection identifier of each terminal carried by each instruction data, it is helpful to distinguish the instruction data from different terminals through the partitioned storage management method; by traversing the ring buffer allocated to multiple terminals in the memory, when traversing to the first memory space corresponding to any one of the multiple terminals, executing processing according to the data to be parsed stored in the first memory space, it can ensure that in the scenario where multiple terminals are connected at the same time, the data from different devices are correctly processed, and stable services are provided to users. The above method can effectively classify, store and process the data received in the multi-connection state, avoid data confusion problems and improve the reliability of data processing.

[0080] In one embodiment, Figure 3 As shown, another data processing method is provided, which is applied to Figure 1 The printing device 10 in the embodiment is taken as an example to illustrate, and the following steps are included:

[0081] S301: establishing communication connections with a plurality of terminals respectively, and allocating a first memory space to each terminal after establishing the communication connection with each terminal.

[0082] Optionally, the printing device 10 establishes communication connections with multiple terminals respectively through the wireless communication module, and after establishing the communication connection with each terminal, allocates an independent first memory space to each terminal for storing data subsequently sent by the terminal. The first memory space may be, but is not limited to, a ring buffer in the memory. Each first memory space is associated with a connection identifier of each terminal. The connection identifier of each terminal may be, but is not limited to, a handle identifier of each terminal.

[0083] Specifically, after the printing device 10 establishes a communication connection with any terminal through the wireless communication module, the wireless communication module immediately reports a connection event including the terminal connection identifier (such as a handle identifier) ​​to the MCU of the printing device 10. After receiving the connection event, the MCU of the printing device 10 allocates a first memory space (such as a ring buffer) that is independent and associated with the connection identifier in the connection event to the corresponding terminal according to the connection identifier in the connection event.

[0084] It is understandable that in the early stage of establishing a communication connection between the terminal and the printing device 10, the communication interaction between the two is mainly to confirm the connection status or set printing-related parameters, rather than to transmit a large amount of printing data. Therefore, in the early stage of establishing a communication connection between the terminal and the printing device 10, the amount of data exchanged between the two is relatively small, and the first memory space allocated to each terminal can also be set to be small, which can effectively save its memory resources without affecting the data processing performance of the printing device 10, thereby improving the data processing speed.

[0085] S302: Receive instruction data sent by each terminal; each instruction data carries a connection identifier of each terminal.

[0086] Optionally, the printing device 10 receives the instruction data sent by each terminal through the wireless communication module, and after receiving each instruction data, reports each instruction data and the connection identifier of each terminal carried by it to the MCU. It can be understood that the instruction data sent by each terminal carries the unique connection identifier corresponding to each terminal to ensure that the printing device 10 can distinguish and process instructions from different terminals.

[0087] The command data may include, but is not limited to, start printing command data, print command data, status query command data, connection control command data, etc. The start printing command data is used to control the printing device to initialize printing. The print command data is used to set the relevant parameters of the print task and control the start and stop of the print task; the print command data may include, but is not limited to, print task setting command data, print task stop command data, etc. The print task setting command data is used to configure and set various parameters of the print task, such as paper size, print quality, double-sided printing, etc. The status query command data is used to query the progress status of the print task. The connection control command is used to control the connection or disconnection of communication.

[0088] S303: storing each instruction data into a corresponding first memory space according to the connection identifier of each terminal.

[0089] Optionally, after the MCU of the printing device 10 receives each instruction data, it searches the first memory space of the corresponding terminal in the mapping table maintained internally according to the connection identifier carried by each instruction data, and then stores each instruction data in the corresponding first memory space found, so that the instruction data from different terminals can be distinguished through partitioned storage management.

[0090] S304: When traversing to the first memory space corresponding to any terminal, determine whether the first memory space stores instruction data to be parsed. If yes, execute S305; if no, execute S317.

[0091] Optionally, when the MCU of the printing device 10 traverses to the first memory space corresponding to any one of the multiple terminals, it combines the read / write pointer and the status flag and other mechanisms to determine whether there is instruction data to be parsed in the first memory space. Specifically, the MCU can check the positions of the read pointer and the write pointer of the first memory space (such as the ring buffer). If they are not equal, it means that the instruction data to be parsed is stored in the first memory space; if they are equal, it means that the instruction data to be parsed is not stored in the first memory space. In addition, the MCU will also refer to the status flag to ensure that the same data is not processed repeatedly.

[0092] S305: parse the instruction data, and record the connection identifier corresponding to the first memory space.

[0093] Optionally, the printing device 10 parses the instruction data, and records the connection identifier corresponding to the first memory space based on a mapping table maintained internally.

[0094] S306: Determine whether the instruction data includes the start printing instruction data. If yes, execute S307; if no, execute S314.

[0095] It can be understood that the instruction data to be parsed stored in the first memory space includes the start printing instruction data, which means that after the printing device 10 performs printing initialization in response to the start printing instruction data, it will receive a large amount of printing data from the corresponding terminal. Therefore, in this case, the printing device 10 needs to reallocate a larger memory space (i.e., the second memory space hereinafter) to the terminal during the printing initialization process. The instruction data to be parsed stored in the first memory space does not include the start printing instruction data, which means that the printing device 10 will not transmit a large amount of printing data subsequently. Therefore, in this case, the printing device 10 can directly perform the corresponding printing task according to the instruction data.

[0096] Specifically, if the instruction data parsed from the first memory space by the MCU of the printing device 10 includes the start printing instruction data, the MCU allocates a larger second memory space to the corresponding terminal according to the connection identifier corresponding to the first memory space, so as to store the printing data to be sent by the terminal later; after the printing is completed, the status information of the printing task is fed back to the corresponding terminal, and a smaller memory space is reallocated to the terminal, and the smaller memory space can be the same size as the first memory space set when it was initially allocated, so as to save memory space. If the instruction data parsed from the first memory space by the MCU of the printing device 10 does not include the start printing instruction data, the MCU executes the corresponding instruction task according to the instruction data, and feeds back the status information of the instruction task to the corresponding terminal according to the connection identifier corresponding to the first memory space.

[0097] S307: reallocate the second memory space for the terminal according to the start printing instruction data.

[0098] Optionally, when the parsed instruction data includes start printing instruction data, the MCU of the printing device 10 reallocates the second memory space for the terminal according to the start printing instruction data. It can be understood that the second memory space is larger than the first memory space, and the second memory space can be but is not limited to a ring buffer in the memory, and the second memory space is associated with the connection identifier of any terminal.

[0099] S308: storing the print data sent by the terminal into the second memory space.

[0100] Optionally, after the MCU of the printing device 10 receives the print data sent by the terminal, it searches for the second memory space of the corresponding terminal in the mapping table maintained internally according to the connection identifier carried by the print data (such as the handle identifier of the terminal), and then stores the print data in the corresponding second memory space found, thereby preventing print data overflow.

[0101] S309: When traversing to the second memory space, executing a corresponding printing task according to the printing data.

[0102] Optionally, the MCU of the printing device 10 traverses the first memory space and the second memory space allocated to multiple terminals in the memory, and when traversing to the second memory space, parses the print data stored in the second memory space, and generates specific control instructions for the printing components or line-by-line print data based on the parsing results, and then executes the corresponding printing task according to the control instructions for the printing components or the print line data.

[0103] In one embodiment, after executing the corresponding printing task according to the printing data when traversing to the second memory space, the method further includes: when detecting that the communication connection established with any terminal is disconnected, continuing to execute the corresponding printing task according to the printing data.

[0104] Optionally, once the MCU of the printing device 10 generates specific printing component control instructions or line-by-line printing data according to the analysis result of the printing data, no matter how the connection status between the terminal sending the printing data and the printing device 10 is, it will not affect the printing device 10 from executing the corresponding printing task.

[0105] In this embodiment, after the printing device executes the corresponding printing task according to the printing data, even if the terminal sending the printing data is disconnected from it, it will not affect its continued execution of the corresponding printing task, thereby ensuring the continuity and integrity of the execution of the printing task and improving the reliability of data processing and the user experience.

[0106] S310: Feedback status information of the printing task to the terminal according to the connection identifier of the terminal.

[0107] Optionally, the MCU of the printing device 10 continuously monitors the execution progress of the printing task, generates status information of the printing task, and feeds back the status information of the printing task to the corresponding terminal according to the connection identifier associated with the second memory space.

[0108] Among them, the status information of the printing task may include but is not limited to: progress information, error information, time information, resource usage information, etc. The above-mentioned task progress information is used to feedback the completion status of the printing task to the user, which may include but is not limited to: the current number of printed pages, the total number of pages, the number of completed pages, and the task completion ratio, etc. The above-mentioned error information is used to record abnormal conditions during the printing process, which may include but is not limited to: blockage of the printing medium transmission channel, insufficient paper or ink depletion, etc. The above-mentioned time information is used to estimate the completion time of the printing task, which may include but is not limited to the estimated time to print the remaining pages, etc. The above-mentioned resource usage information is used to monitor and record the memory space size occupied by the printing task, CPU usage rate and other resource consumption, which may include but is not limited to: the memory space size occupied by the printing task, CPU usage rate and other resource consumption, etc.

[0109] In this embodiment, the printing device reallocates a second memory space larger than the first memory space for the corresponding terminal based on the start printing instruction data, stores the print data sent by the terminal in the second memory space, and executes the corresponding printing task according to the print data when traversing to the second memory space. According to the connection identifier of the second memory space, the status information of the print task is fed back to the terminal. This not only prevents the print data from overflowing the pre-allocated smaller memory space (the first memory space), thereby improving the reliability of data processing; it also can timely and accurately feed back the status information of the print task to the corresponding terminal, thereby improving the user experience.

[0110] S311: Determine whether the printing task has been completed. If yes, execute S312; if no, execute S309 again.

[0111] Optionally, after executing the corresponding printing task according to the printing data, the MCU of the printing device 10 determines in real time whether the printing data in the second memory space has been parsed and processed. If the printing data has been parsed and processed, it means that the MCU of the printing device 10 has generated specific control instructions for the printing components or line-by-line printing data according to the parsing results, and can continue to traverse the first memory space. If the printing data has not been fully parsed and processed, it means that the MCU of the printing device 10 needs to continue to parse the printing data stored in the second memory space, and generate specific control instructions for the printing components or line-by-line printing data according to the parsing results, and then execute the corresponding printing task according to the control instructions for the printing components or the printing line data.

[0112] S312: Reallocate the first memory space for the terminal.

[0113] Optionally, the completion of the printing task means that the terminal will send a large amount of printing data to the terminal only after issuing the start printing instruction data again. Therefore, a smaller first memory space can be reallocated to the terminal.

[0114] In this embodiment, the MCU of the printing device 10 reallocates the first memory space to the corresponding terminal when the printing task has been completed, which can effectively save its memory resources without affecting the data processing performance of the printing device, thereby improving the data processing speed.

[0115] S313: Continue to traverse the first memory space and execute S304 again.

[0116] Optionally, after determining that the print task corresponding to the second memory space has been completed, the MCU of the printing device 10 continues to traverse the first memory space, and when traversing to any first memory space, determines whether the first memory space stores instruction data to be parsed.

[0117] S314: Execute corresponding instruction tasks according to the instruction data.

[0118] It can be understood that if the instruction data parsed by the MCU of the printing device 10 from the first memory space does not include the start printing instruction data, the MCU directly executes the corresponding instruction task according to the instruction data. Specifically, the MCU takes out the corresponding data from the first memory space for parsing, and records the handle identifier corresponding to the first memory space. After parsing the complete instruction data, the control instruction of the printing component is generated according to the parsed instruction data, and then the corresponding instruction task is executed according to the control instruction of the printing component.

[0119] S315: Feedback the status information of the command task to the terminal according to the connection identifier of the terminal.

[0120] Optionally, after the MCU of the printing device 10 executes the corresponding instruction task according to the instruction data, it feeds back the completion status information of the instruction task to the corresponding terminal according to the connection identifier corresponding to the pre-recorded first memory space (ie, the connection identifier of the terminal).

[0121] In this embodiment, the printing device executes the corresponding instruction task according to the instruction data, and feeds back the status information of the instruction task to any terminal according to the connection identifier corresponding to the pre-recorded first memory space. It can not only accurately feed back information to the corresponding terminal according to the pre-recorded connection identifier, thereby improving the reliability of data processing; it can also improve the user experience by timely feeding back status information to the user.

[0122] S316: Continue traversing the first memory space and execute S304 again.

[0123] Optionally, after determining that the print task corresponding to the second memory space has been completed, the MCU of the printing device 10 continues to traverse the first memory space, and when traversing to any first memory space, determines whether the first memory space stores instruction data to be parsed.

[0124] S317: Continue to traverse the first memory space and execute S304 again.

[0125] Optionally, if the traversed first memory space does not store the instruction data to be parsed, the MCU of the printing device 10 continues to traverse the first memory space, and when traversing to any first memory space, determines whether the first memory space stores the instruction data to be parsed.

[0126] In the above data processing method, when the instruction data includes the start printing instruction data, the printing device reallocates a second memory space larger than the first memory space for the corresponding terminal based on the start printing instruction data, stores the printing data sent by the terminal in the second memory space, and when traversing to the second memory space, executes the corresponding printing task according to the printing data, and feeds back the status information of the printing task to the terminal according to the connection identifier of the second memory space, and reallocates the first memory space for the corresponding terminal when the printing task has been completed. Not only can the printing data be effectively prevented from overflowing the pre-allocated smaller memory space (first memory space), but also the status information of the printing task can be fed back to the corresponding terminal in a timely and accurate manner; in addition, it can also effectively save its memory resources without affecting the data processing performance of the printing device. When the instruction data includes the start printing instruction data, the printing device executes the corresponding instruction task according to the instruction data, and feeds back the status information of the instruction task to any terminal according to the connection identifier corresponding to the pre-recorded first memory space, and can not only accurately feed back the information to the corresponding terminal according to the pre-recorded connection identifier, but also feed back the status information of the instruction task to the user in a timely manner. The above method can improve the reliability of data processing of the printing device, ensure the data processing performance of the printing device, effectively save the memory resources of the printing device, and improve the user experience.

[0127] In one embodiment, Figure 4 As shown, another data processing method is provided, which is applied to Figure 1 The printing device 10 in the embodiment is taken as an example to illustrate, and the following steps are included:

[0128] S401: establishing communication connections with a plurality of terminals respectively, and allocating a first memory space to each terminal after establishing the communication connection with each terminal.

[0129] Specifically, S401 is consistent with S301 and will not be described in detail here.

[0130] S402: receiving instruction data sent by each terminal; each instruction data carries a connection identifier of each terminal.

[0131] Specifically, S402 is consistent with S302 and will not be described in detail here.

[0132] S403: storing each instruction data into a corresponding first memory space according to the connection identifier of each terminal.

[0133] Specifically, S403 is consistent with S303 and will not be described in detail here.

[0134] S404: When traversing to the first memory space corresponding to any terminal, determine whether the first memory space stores instruction data to be parsed. If yes, execute S405; if no, execute S420.

[0135] Specifically, S404 is consistent with S304 and will not be described in detail here.

[0136] S405: parse the instruction data, and record the connection identifier corresponding to the first memory space.

[0137] Specifically, S405 is consistent with S305 and will not be described in detail here.

[0138] S406: Determine whether the instruction data includes the start printing instruction data. If yes, execute S407; if no, execute S417.

[0139] Specifically, S406 is consistent with S306 and will not be described in detail here.

[0140] S407: reallocate the second memory space for the terminal according to the start printing instruction data.

[0141] Specifically, S407 is consistent with S307 and will not be described in detail here.

[0142] S408: storing the print data sent by the terminal into the second memory space.

[0143] Specifically, S408 is consistent with S308 and will not be described in detail here.

[0144] S409: When traversing to any first memory space, determine whether the instruction data stored in the first memory space includes printing instruction data. If yes, execute S410; if no, execute S411.

[0145] It is understandable that if the MCU of the printing device traverses other first memory spaces after reallocating the second memory space for the terminal that sends the start printing instruction data, it is necessary to determine whether the instruction data in the first memory space includes printing instruction data related to printing after parsing the instruction data in the first memory space. If the first memory space contains printing instruction data related to printing, the printing instruction data is rejected to avoid conflicts caused by different printing settings when executing the printing task; if the first memory space does not contain printing instruction data related to printing, the instruction data stored in the first memory space is responded normally.

[0146] The printing instruction data may include but is not limited to: printing task setting instruction data, printing task stop instruction data, etc.; the printing task setting instruction data is used to configure and set various parameters of the printing task, such as paper size, print quality, double-sided printing, etc.

[0147] S410: Reject the response to the printing instruction data.

[0148] It is understandable that if the first memory space contains printing instruction data related to printing, the printing instruction data is rejected to avoid conflicts caused by different printing settings when executing the printing task.

[0149] S411: Respond to the instruction data stored in the first memory space.

[0150] It can be understood that if the first memory space does not contain printing instruction data related to printing, the instruction data stored in the first memory space is responded normally.

[0151] In this embodiment, after the printing device reallocates the second memory space for the terminal that sends the start printing instruction data, if it traverses to any of the first memory spaces, it determines whether the instruction data stored in any of the first memory spaces includes printing instruction data based on the parsed data. If the instruction data stored in the first memory space includes printing instruction data, it refuses to respond to the printing instruction data to avoid conflicts caused by different printing settings when executing the printing task; if the instruction data stored in the first memory space does not include printing instruction data, it responds normally to the instruction data stored in the first memory space, which can effectively improve the stability and reliability of data processing.

[0152] S412: When traversing to the second memory space, executing a corresponding printing task according to the printing data.

[0153] Specifically, S412 is consistent with S309 and will not be repeated here.

[0154] S413: Feedback the status information of the printing task to the corresponding terminal according to the connection identifier of the terminal.

[0155] Specifically, S413 is consistent with S310 and will not be repeated here.

[0156] S414: Determine whether the printing task has been completed. If yes, execute S415; if no, execute S412 again.

[0157] Specifically, S414 is consistent with S311 and will not be repeated here.

[0158] S415: Reallocate the first memory space for the terminal.

[0159] Specifically, S415 is consistent with S312 and will not be repeated here.

[0160] S416: Continue traversing the first memory space and execute S404 again.

[0161] Specifically, S416 is consistent with S313 and will not be repeated here.

[0162] S417: Execute corresponding instruction tasks according to the instruction data.

[0163] Specifically, S417 is consistent with S314 and will not be repeated here.

[0164] S418: Feedback the status information of the command task to the terminal according to the connection identifier of the terminal.

[0165] Specifically, S418 is consistent with S315 and will not be repeated here.

[0166] S419: Continue traversing the first memory space and execute S404 again.

[0167] Specifically, S419 is consistent with S316 and will not be repeated here.

[0168] S420: Continue to traverse the first memory space, and execute S404 again.

[0169] Specifically, S420 is consistent with S317 and will not be repeated here.

[0170] In the above data processing method, after the printing device reallocates the second memory space for the terminal that sends the start printing instruction data, if it traverses to any first memory space, it determines whether the instruction data stored in any first memory space includes printing instruction data based on the parsed data. In the case where the instruction data stored in the first memory space includes printing instruction data, the printing instruction data is refused to be responded to, so as to avoid conflicts caused by different printing settings when executing the printing task; in the case where the instruction data stored in the first memory space does not include printing instruction data, the instruction data stored in the first memory space is responded to normally. The above method improves the stability and reliability of data processing, thereby effectively improving the user experience.

[0171] In one embodiment, Figure 5 As shown, a data processing method is provided, which is applied to Figure 1 The printing device 10 in the embodiment is taken as an example to illustrate, and the following steps are included:

[0172] S501: establishing communication connections with a plurality of terminals respectively, and allocating a first memory space to each terminal after establishing the communication connection with each terminal; each first memory space is associated with a connection identifier of each terminal.

[0173] Specifically, S501 is consistent with S301 and will not be described in detail here.

[0174] S502: When it is detected that the communication connection with any terminal is unstable, a connection status prompt message is sent to any terminal according to a connection identifier of any terminal.

[0175] Optionally, when the MCU of the printing device 10 detects that the communication connection with any terminal is unstable, it sends a connection status prompt message to any terminal according to the connection identifier (such as handle identifier) ​​of any terminal, thereby prompting the user to adjust the network environment in time. Exemplarily, the connection status prompt message may be, but is not limited to, "The current network environment is poor, please adjust the network environment in time."

[0176] In this embodiment, the printing device notifies the user in time when detecting that the communication connection is unstable and sends connection transition prompt information, thereby prompting the user to take necessary measures to improve the network environment and ensure the smooth progress of the printing task.

[0177] S503: In response to a connection disconnection request sent by any terminal, disconnect the communication connection established with any terminal.

[0178] Optionally, after the printing device 10 receives a connection disconnection request sent by any terminal through the wireless communication module, the wireless communication module immediately disconnects the communication connection with the terminal and reports a connection disconnection event including the terminal connection identifier (such as a handle identifier) ​​to the MCU of the printing device 10.

[0179] S504: Clear data in a first memory space corresponding to any terminal according to the connection identifier of any terminal.

[0180] Optionally, after the MCU of the printing device 10 receives a connection disconnection event, it clears the data in the first memory space corresponding to the corresponding terminal according to the connection identifier in the connection disconnection event, thereby immediately releasing the no longer needed memory space so that these resources can be allocated to other terminals, thereby improving resource utilization and memory allocation efficiency.

[0181] In this embodiment, the printing device disconnects the communication connection established with any terminal in response to a connection disconnection request sent by any terminal, and clears the data in the first memory space corresponding to any terminal according to the connection identifier of any terminal, thereby effectively improving resource utilization and memory allocation efficiency.

[0182] In the above data processing method, the printing device can prompt the user to take necessary measures to improve the network environment and ensure the smooth progress of the printing task by notifying the user in time when detecting that the communication connection is unstable and sending a connection transition prompt message; by responding to a connection disconnection request sent by any terminal, disconnecting the communication connection established with any terminal, and clearing the data in the first memory space corresponding to any terminal according to the connection identifier of any terminal, it can effectively improve resource utilization and memory allocation efficiency. The above method can improve the reliability of data processing of the printing device, ensure the data processing performance of the printing device, effectively save the memory resources of the printing device, and enhance the user experience.

[0183] In one embodiment, Figure 6 As shown, a data processing method is provided, which is applied to a printing device and includes the following steps:

[0184] S601: Establish a communication connection with a mother terminal.

[0185] The mother terminal is used to verify the instruction data sent by multiple sub-terminals, and send the verified target instruction data to the printing device. Each target instruction data carries the connection identifier of each sub-terminal. The connection identifier of each sub-terminal can be but is not limited to the handle identifier of each sub-terminal.

[0186] Optionally, the printing device can establish a communication connection with a mother terminal that manages multiple sub-terminals through a communication module. Specifically, each of the multiple sub-terminals can send instruction data carrying its connection identifier to the mother terminal for verification, and the mother terminal sends the multiple instruction data that have passed the verification as multiple target instruction data to the printing device, so that the MCU of the printing device allocates memory space to each sub-terminal according to the connection identifier (such as handle identifier) ​​of each sub-terminal carried by each instruction data.

[0187] S602: receiving a plurality of target instruction data sent by the mother terminal, and after receiving each target instruction data, allocating a first memory space to each child terminal according to a connection identifier carried by each target instruction data.

[0188] The first memory space may be, but is not limited to, a ring buffer in the memory. Each first memory space is associated with a connection identifier of each sub-terminal.

[0189] Optionally, the MCU of the printing device receives multiple target instruction data sent by the mother terminal, and allocates an independent first memory space (such as a ring buffer) to each sub-terminal based on each target instruction data sent by the mother terminal. It can be understood that since the multiple target instruction data initially sent by the mother terminal to the printing device is to confirm the connection status or set printing-related parameters, rather than to transmit a large amount of printing data. Therefore, after the printing device receives the multiple target instruction data sent by the mother terminal, it first allocates a smaller first memory space to each target instruction data according to the connection identifier of each target instruction data, thereby effectively saving its memory resources and improving the data processing speed without affecting the data processing performance of the printing device 10.

[0190] S603: storing each target instruction data into a corresponding first memory space according to the connection identifier of each sub-terminal.

[0191] Optionally, after the MCU of the printing device receives each target command data, it searches for the first memory space of the corresponding terminal in the mapping table maintained internally according to the connection identifier carried by each target command data, and then stores each target command data in the corresponding first memory space found, so that the target command data corresponding to different sub-terminals can be distinguished through partitioned storage management.

[0192] S604: When traversing to the first memory space corresponding to any sub-terminal, execute processing according to the target instruction data corresponding to any sub-terminal.

[0193] Optionally, when the MCU of the printing device 10 traverses to the first memory space corresponding to any sub-terminal, it combines the read / write pointer and the status flag and other mechanisms to determine whether there is instruction data to be parsed in the first memory space. Specifically, the MCU can check the positions of the read pointer and the write pointer of the first memory space (such as the ring buffer). If they are not equal, it means that the instruction data to be parsed is stored in the first memory space; if they are equal, it means that the instruction data to be parsed is not stored in the first memory space. In addition, the MCU will also refer to the status flag to ensure that the same data is not processed repeatedly.

[0194] In the above data processing method, after establishing a communication connection with the mother terminal, the printing device receives multiple target instruction data sent by the mother terminal, and after receiving each target instruction data, allocates a first memory space to each sub-terminal according to the connection identifier carried by each target instruction data, which can ensure that each sub-terminal can have a different independent memory space to save the data sent subsequently; by storing each target instruction data in the corresponding first memory space according to the connection identifier of each sub-terminal, it is helpful to distinguish the instruction data from different terminals through the partition storage management method; by executing the processing according to the target instruction data corresponding to any sub-terminal when traversing to the first memory space corresponding to any sub-terminal, it can correctly process the data from different sub-terminals and provide stable services for users. The above method can simplify the data verification and management process and improve the stability and security of the system by specifying a mother terminal to uniformly manage and confirm the instructions of all sub-terminals; by allocating the first memory space to each sub-terminal according to the connection identifier carried by each target instruction data, it can effectively improve the reliability of data processing of the printing device, ensure the data processing performance of the printing device, effectively save the memory resources of the printing device, and improve the user experience.

[0195] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0196] Based on the inventive concept of the above penetration testing method, Figure 7As shown, the embodiment of the present application further provides a data processing device 700 for implementing the above-mentioned data processing method. The data processing device 700 is applied to a printing device, and the data processing device 700 includes:

[0197] The connection module 701 is used to establish communication connections with multiple terminals respectively, and allocate a first memory space to each terminal after establishing a communication connection with each terminal; each first memory space is associated with a connection identifier of each terminal;

[0198] The receiving module 702 is used to receive instruction data sent by each terminal; each instruction data carries a connection identifier of each terminal;

[0199] The storage module 703 is used to store each instruction data into the corresponding first memory space according to the connection identifier of each terminal;

[0200] The execution module 704 is used to execute processing according to the instruction data sent by any terminal when traversing to the first memory space corresponding to any terminal among the multiple terminals.

[0201] In one embodiment, the instruction data sent by any terminal includes start printing instruction data; the execution module 704 is specifically used to reallocate a second memory space for any terminal according to the start printing instruction data when traversing to the first memory space corresponding to any terminal among multiple terminals; the second memory space is larger than the first memory space, and the second memory space is associated with the connection identifier of any terminal; the print data sent by any terminal is stored in the second memory space; when traversing to the second memory space, the corresponding print task is executed according to the print data; and the status information of the print task is fed back to any terminal according to the connection identifier of any terminal.

[0202] In one embodiment, the execution module 704 is further configured to determine whether the printing task has been completed; if the printing task has been completed, reallocate the first memory space for any terminal.

[0203] In one embodiment, the execution module 704 is further used to determine whether the instruction data stored in any of the first memory spaces includes printing instruction data when traversing to any of the first memory spaces; if the instruction data stored in any of the first memory spaces includes printing instruction data, refuse to respond to the printing instruction data; if the instruction data stored in any of the first memory spaces does not include printing instruction data, respond to the instruction data stored in any of the first memory spaces.

[0204] In one embodiment, the execution module 704 is further configured to continue executing the corresponding printing task according to the printing data when it is detected that the communication connection established with any terminal is disconnected.

[0205] In one embodiment, the execution module 704 is further used to disconnect the communication connection established with any terminal in response to a connection disconnection request sent by any terminal; and clear the data in the first memory space corresponding to any terminal according to the connection identifier of any terminal.

[0206] In one embodiment, the execution module 704 is further configured to send connection status prompt information to any terminal according to a connection identifier of any terminal when detecting that the communication connection with any terminal is unstable.

[0207] In one embodiment, the instruction data sent by any terminal does not include start printing instruction data; the execution module 704 is specifically used to execute the corresponding instruction task according to the instruction data when traversing to the first memory space corresponding to any terminal among multiple terminals; according to the connection identifier of any terminal, the status information of the instruction task is fed back to any terminal.

[0208] In one embodiment, the multiple terminals include a mother terminal and multiple child terminals, the mother terminal is used to verify multiple instruction data sent by the multiple child terminals, and send the multiple instruction data after verification as multiple target instruction data to the printing device; each target instruction data carries a connection identifier of each child terminal; the connection module 701 is also used to establish a communication connection with the mother terminal; the receiving module 702 is also used to receive the multiple target instruction data sent by the mother terminal, and after receiving each target instruction data, allocate a first memory space to each child terminal according to the connection identifier carried by each target instruction data; each first memory space is associated with the connection identifier of each child terminal; the storage module 703 is also used to store each target instruction data in the corresponding first memory space according to the connection identifier of each child terminal; the execution module 704 is also used to perform processing according to the target instruction data corresponding to any child terminal when traversing to the first memory space corresponding to any child terminal.

[0209] The present application also provides a printing device, whose internal structure diagram can be shown as follows: Figure 8As shown in the figure. The printing device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the printing device is used to provide computing and control capabilities. The memory of the printing device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the printing device is used to exchange information between the processor and external devices. The communication interface of the printing device is used to communicate with an external user terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it realizes a data processing method. The display unit of the printing device is used to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the printing device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the housing of the printing device, or an external keyboard, touchpad, or mouse, etc.

[0210] Those skilled in the art can understand that Figure 8 the structure shown in the figure is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the printing device to which the solution of this application is applied. The specific printing device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0211] In a possible implementation manner, a printing device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented:

[0212] Establish communication connections with multiple terminals respectively, and allocate a first memory space for each terminal after establishing a communication connection with each terminal; each first memory space is associated with the connection identifier of each terminal;

[0213] Receive instruction data sent by each terminal; each instruction data carries the connection identifier of each terminal;

[0214] According to the connection identifier of each terminal, store each instruction data into the corresponding first memory space;

[0215] In the case of traversing to the first memory space corresponding to any one of the multiple terminals, execute processing according to the instruction data sent by any one of the terminals.

[0216] In one possible implementation, the instruction data sent by any terminal includes start printing instruction data; when the processor executes the computer program, the following steps are also implemented: when traversing to the first memory space corresponding to any terminal among multiple terminals, the second memory space is reallocated for any terminal according to the start printing instruction data; the second memory space is larger than the first memory space, and the second memory space is associated with the connection identifier of any terminal; the print data sent by any terminal is stored in the second memory space; when traversing to the second memory space, the corresponding print task is executed according to the print data; according to the connection identifier of any terminal, the status information of the print task is fed back to any terminal.

[0217] In a possible implementation, the processor further implements the following steps when executing the computer program: determining whether the printing task has been completed; and reallocating the first memory space for any terminal if the printing task has been completed.

[0218] In one possible implementation, the processor further implements the following steps when executing the computer program: when traversing to any first memory space, determining whether the instruction data stored in any first memory space includes printing instruction data; when the instruction data stored in any first memory space includes printing instruction data, refusing to respond to the printing instruction data; when the instruction data stored in any first memory space does not include printing instruction data, responding to the instruction data stored in any first memory space.

[0219] In a possible implementation, the processor further implements the following steps when executing the computer program: when detecting that the communication connection established with any terminal is disconnected, continue to execute the corresponding printing task according to the printing data.

[0220] In a possible implementation, the processor further implements the following steps when executing the computer program: disconnecting the communication connection established with any terminal in response to a connection disconnection request sent by any terminal; and clearing data in a first memory space corresponding to any terminal according to a connection identifier of any terminal.

[0221] In a possible implementation, when the processor executes the computer program, the processor further implements the following steps: when it is detected that the communication connection with any terminal is unstable, connection status prompt information is sent to any terminal according to the connection identifier of any terminal.

[0222] In one possible implementation, the instruction data sent by any terminal does not include start printing instruction data; when the processor executes the computer program, it also implements the following steps: when traversing to the first memory space corresponding to any one of the multiple terminals, performing processing according to the instruction data sent by any one of the terminals, including: when traversing to the first memory space corresponding to any one of the multiple terminals, executing the corresponding instruction task according to the instruction data; according to the connection identifier of any one of the terminals, feeding back the status information of the instruction task to any one of the terminals.

[0223] In a possible implementation, the multiple terminals include a mother terminal and multiple sub-terminals, the mother terminal is used to verify multiple instruction data sent by the multiple sub-terminals, and send the multiple instruction data after verification as multiple target instruction data to the printing device; each target instruction data carries a connection identifier of each sub-terminal; when the processor executes the computer program, it also implements the following steps: establish a communication connection with the mother terminal; receive the multiple target instruction data sent by the mother terminal, and after receiving each target instruction data, allocate a first memory space to each sub-terminal according to the connection identifier carried by each target instruction data; each first memory space is associated with the connection identifier of each sub-terminal; according to the connection identifier of each sub-terminal, store each target instruction data in the corresponding first memory space; when traversing to the first memory space corresponding to any sub-terminal, perform processing according to the target instruction data corresponding to any sub-terminal.

[0224] The present application also provides a computer storage medium, which stores instructions, and when the instructions are executed on a computer or a processor, the computer or the processor executes one or more steps in the above embodiment. If the components of the above printing device are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer readable storage medium.

[0225] In one embodiment, a computer storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0226] Establishing communication connections with multiple terminals respectively, and allocating a first memory space to each terminal after establishing the communication connection with each terminal; each first memory space is associated with a connection identifier of each terminal;

[0227] Receive instruction data sent by each terminal; each instruction data carries a connection identifier of each terminal;

[0228] According to the connection identifier of each terminal, each instruction data is stored in the corresponding first memory space;

[0229] When traversing to the first memory space corresponding to any one of the multiple terminals, processing is performed according to the instruction data sent by any one of the terminals.

[0230] In one possible implementation, the instruction data sent by any terminal includes start printing instruction data; when the computer program is executed by the processor, the following steps are implemented: when traversing to the first memory space corresponding to any terminal among multiple terminals, reallocating the second memory space for any terminal according to the start printing instruction data; the second memory space is larger than the first memory space, and the second memory space is associated with the connection identifier of any terminal; storing the print data sent by any terminal in the second memory space; when traversing to the second memory space, executing the corresponding print task according to the print data; and feeding back the status information of the print task to any terminal according to the connection identifier of any terminal.

[0231] In a possible implementation, when the computer program is executed by a processor, the following steps are implemented: determining whether the printing task has been completed; and reallocating the first memory space for any terminal if the printing task has been completed.

[0232] In one possible implementation, the computer program implements the following steps when executed by a processor: when traversing to any first memory space, determine whether the instruction data stored in any first memory space includes printing instruction data; when the instruction data stored in any first memory space includes printing instruction data, refuse to respond to the printing instruction data; when the instruction data stored in any first memory space does not include printing instruction data, respond to the instruction data stored in any first memory space.

[0233] In a possible implementation, when the computer program is executed by a processor, the following steps are implemented: when it is detected that the communication connection established with any terminal is disconnected, the corresponding printing task is continued to be executed according to the printing data.

[0234] In one possible implementation, when the computer program is executed by a processor, the following steps are implemented: in response to a connection disconnection request sent by any terminal, the communication connection established with any terminal is disconnected; and according to a connection identifier of any terminal, data in a first memory space corresponding to any terminal is cleared.

[0235] In a possible implementation, the computer program implements the following steps when executed by a processor: when it is detected that the communication connection with any terminal is unstable, sending connection status prompt information to any terminal according to the connection identifier of any terminal.

[0236] In one possible implementation, the instruction data sent by any terminal does not include start printing instruction data; when the computer program is executed by the processor, the following steps are implemented: when traversing to the first memory space corresponding to any one of the multiple terminals, processing is performed according to the instruction data sent by any one of the terminals, including: when traversing to the first memory space corresponding to any one of the multiple terminals, executing the corresponding instruction task according to the instruction data; according to the connection identifier of any one of the terminals, feeding back the status information of the instruction task to any one of the terminals.

[0237] In a possible implementation, the multiple terminals include a mother terminal and multiple sub-terminals, the mother terminal is used to verify multiple instruction data sent by the multiple sub-terminals, and send the multiple instruction data after verification as multiple target instruction data to the printing device; each target instruction data carries a connection identifier of each sub-terminal; when the computer program is executed by the processor, the following steps are implemented: establishing a communication connection with the mother terminal; receiving multiple target instruction data sent by the mother terminal, and after receiving each target instruction data, allocating a first memory space to each sub-terminal according to the connection identifier carried by each target instruction data; each first memory space is associated with the connection identifier of each sub-terminal; according to the connection identifier of each sub-terminal, each target instruction data is stored in the corresponding first memory space; when traversing to the first memory space corresponding to any sub-terminal, processing is performed according to the target instruction data corresponding to any sub-terminal.

[0238] The embodiments of the present application also provide a computer program product, including a computer program, which implements the steps in the above-mentioned method embodiments when executed by a processor.

[0239] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted by the computer-readable storage medium. The computer instructions can be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).

[0240] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes. In the absence of conflict, the technical features in this embodiment and the implementation scheme can be combined arbitrarily.

[0241] The embodiments described above are merely preferred embodiments of the present application and are not intended to limit the scope of the present application. Without departing from the design spirit of the present application, various modifications and improvements made to the technical solutions of the present application by ordinary technicians in this field should fall within the protection scope determined by the claims.

[0242] The above describes a specific embodiment of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

Claims

1. A data processing method, characterized in that: Applied to a printing device, the method comprises: respectively establish communication connections with a plurality of terminals, and allocate a first memory space to each terminal after establishing the communication connection with each terminal; each of the first memory spaces is associated with a connection identifier of each terminal; Receiving instruction data sent by each of the terminals; each of the instruction data carries a connection identifier of each of the terminals; According to the connection identifier of each terminal, storing each instruction data into the corresponding first memory space; When traversing to the first memory space corresponding to any one of the multiple terminals, processing is performed according to the instruction data sent by the any one terminal.

2. The method according to claim 1, characterized in that The instruction data sent by any one of the terminals includes start printing instruction data; In the case of traversing to the first memory space corresponding to any one of the multiple terminals, executing processing according to the instruction data sent by the any one terminal includes: In the case of traversing to the first memory space corresponding to any one of the multiple terminals, reallocating a second memory space for the any one terminal according to the start printing instruction data; the second memory space is larger than the first memory space, and the second memory space is associated with a connection identifier of the any one terminal; storing the print data sent by any one of the terminals into the second memory space; When traversing to the second memory space, executing a corresponding printing task according to the printing data; According to the connection identifier of any one of the terminals, the status information of the printing task is fed back to the any one of the terminals.

3. The method according to claim 2, characterized in that In the case of traversing to the second memory space, after executing a corresponding printing task according to the printing data, the method further includes: Determining whether the printing task has been completed; When the printing task has been completed, the first memory space is reallocated to any one of the terminals.

4. The method according to claim 2, characterized in that In the case of traversing to the first memory space corresponding to any one of the multiple terminals, after reallocating the second memory space for the any one terminal according to the start printing instruction data, the method further includes: In case of traversing to any one of the first memory spaces, determining whether the instruction data stored in the any one of the first memory spaces includes printing instruction data; In the case where the instruction data stored in any one of the first memory spaces includes the printing instruction data, refusing to respond to the printing instruction data; In a case where the instruction data stored in any one of the first memory spaces does not include the printing instruction data, responding to the instruction data stored in any one of the first memory spaces.

5. The method according to claim 2, characterized in that In the case of traversing to the second memory space, after executing a corresponding printing task according to the printing data, the method further includes: When it is detected that the communication connection established with any one of the terminals is disconnected, the corresponding printing task continues to be executed according to the printing data.

6. The method according to claim 1, characterized in that The method further comprises: In response to a connection disconnection request sent by any one of the terminals, disconnecting the communication connection established with the any one of the terminals; According to the connection identifier of any one of the terminals, data in a first memory space corresponding to the any one of the terminals is cleared.

7. The method according to claim 1, characterized in that The method further comprises: When it is detected that the communication connection with the any one terminal is unstable, connection status prompt information is sent to the any one terminal according to the connection identifier of the any one terminal.

8. The method according to claim 1, characterized in that The instruction data sent by any one of the terminals does not include start printing instruction data; In the case of traversing to the first memory space corresponding to any one of the multiple terminals, executing processing according to the instruction data sent by the any one terminal includes: When traversing to a first memory space corresponding to any one of the multiple terminals, executing a corresponding instruction task according to the instruction data; According to the connection identifier of any one of the terminals, the status information of the instruction task is fed back to the any one of the terminals.

9. The method according to claim 1, characterized in that The multiple terminals include a mother terminal and multiple sub-terminals, the mother terminal is used to verify the multiple instruction data sent by the multiple sub-terminals, and send the multiple instruction data after verification as multiple target instruction data to the printing device; each of the target instruction data carries a connection identifier of each of the sub-terminals; The method further comprises: Establishing a communication connection with the mother terminal; receiving a plurality of target instruction data sent by the mother terminal, and after receiving each of the target instruction data, allocating a first memory space to each of the sub-terminals according to a connection identifier carried by each of the target instruction data; each of the first memory spaces is associated with a connection identifier of each of the sub-terminals; According to the connection identifier of each sub-terminal, storing each target instruction data into the corresponding first memory space; When traversing to the first memory space corresponding to any one of the sub-terminals, processing is performed according to the target instruction data corresponding to any one of the sub-terminals.

10. A data processing device, characterized in that: Applied to a printing device, the device comprises: A connection module, used to establish communication connections with multiple terminals respectively, and allocate a first memory space to each terminal after establishing a communication connection with each terminal; each first memory space is associated with a connection identifier of each terminal; A receiving module, used for receiving instruction data sent by each terminal; each instruction data carries a connection identifier of each terminal; A storage module, configured to store each of the instruction data into a corresponding first memory space according to a connection identifier of each of the terminals; The execution module is used to execute processing according to the instruction data sent by any one of the multiple terminals when traversing to the first memory space corresponding to the any one of the multiple terminals.

11. A printing device, characterized in that: include: Processor and memory; The memory stores a computer program, and when the processor executes the computer program, the method steps of any one of claims 1 to 9 are implemented.

12. A computer storage medium, characterized in that: The computer storage medium stores a plurality of instructions, which are suitable for being loaded by a processor and executing the method steps according to any one of claims 1 to 9.

13. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 9.