Data transmission method, device and system, storage medium and program product
By sending part of the scan data to the control device when the image forming device does not complete the scanning operation, and sending all the data after the scanning is completed, the problems of connection timeout and network burden are solved, and more stable data transmission is achieved.
Patent Information
- Application Number
- CN202510336622.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-20
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2045-03-20
AI Technical Summary
During the process when the image forming device fails to complete the scanning operation, the connection may be timed out, resulting in the inability to transmit scan data, or the network burden may be increased.
Before completing the scanning operation, the image forming apparatus transmits data in the generated partial scan data packet to the control device, and after completing the scanning operation, the image forming apparatus transmits data in all generated scan data packets that are not sent to the control device.
The time to maintain a long connection state between the image forming device and the control device is extended, the risk of connection timeout is reduced, and the network burden is reduced.
Smart Images

Figure CN120201130A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of image formation, and particularly to a data transmission method, apparatus, system, storage medium, and program product. Background Art
[0002] Some image forming apparatuses with scanning functions are devices that can convert images into digital formats processable by control devices (such as desktop computers, mobile phones, tablet computers, etc.). For example, printers, copiers, fax machines, scanners with scanning functions, and multifunctional all-in-one machines integrating functions such as printing, copying, faxing, and scanning.
[0003] In practical applications, information interaction can be carried out between some image forming apparatuses with scanning functions and control devices by using communication protocols. For example, Hyper Text Transfer Protocol (HTTP) and File Transfer Protocol (FTP), etc. When the image forming apparatus and the control device perform information interaction using the HTTP protocol, the image forming apparatus and the control device can maintain a long connection state.
[0004] However, as the scanning resolution becomes higher and higher, the time required for the image forming apparatus to complete the scanning operation becomes longer and longer. Therefore, the control device may need to wait longer to receive the scanning data sent by the image forming apparatus. During the process that the image forming apparatus has not completed the scanning operation, since there is no information interaction between the image forming apparatus and the control device for a long time, it may cause a connection timeout, and further may cause the long connection state between the image forming apparatus and the control device to be disconnected, and the control device cannot receive the scanning data.
[0005] In the related art, during the process that the image forming apparatus has not completed the scanning operation, the control device frequently asks the image forming apparatus about the scanning progress, and the image forming apparatus correspondingly responds to the control device's inquiries. The image forming apparatus and the control device frequently perform information interaction to keep the long connection state between the image forming apparatus and the control device. However, the frequent information interaction between the image forming apparatus and the control device increases the network burden.
[0006] It should be noted that the information disclosed in the background art part of the present application is only intended to deepen the understanding of the general background technology of the present application, and should not be regarded as an admission or any form of implication that this information constitutes the prior art known to those skilled in the art. Summary of the Invention
[0007] The present application provides a data transmission method, apparatus, system, storage medium and program product, which helps to solve the problem in the prior art that during the process of the image forming apparatus not completing the scanning operation, connection timeout may occur, resulting in the inability to transmit scanning data or increasing the network burden.
[0008] In a first aspect, an embodiment of the present application provides a data transmission method applied to an image forming apparatus. The image forming apparatus is in a long connection state with a control device. The method includes: Performing a scanning operation corresponding to the scanning instruction according to the scanning instruction sent by the control device; Before the scanning operation is completed, sending the data in the generated partial scanning data packet to the control device; After the scanning operation is completed, sending the data in the generated complete scanning data packet that has not been sent to the control device to the control device.
[0009] In a possible implementation manner, the data in the generated partial scanning data packet includes: header data and / or partial scanning data scanned during the scanning operation.
[0010] In a possible implementation manner, the step of, before the scanning operation is completed, sending the data in the generated partial scanning data packet to the control device includes: If the scanning resolution set by the user is not greater than a preset scanning resolution threshold, then before the scanning operation is completed, sending the complete header data in the generated partial scanning data packet to the control device; The step of, after the scanning operation is completed, sending the data in the generated complete scanning data packet that has not been sent to the control device to the control device includes: after the scanning operation is completed, sending the complete scanned data in the generated complete scanning data packet to the control device.
[0011] In a possible implementation manner, the step of, before the scanning operation is completed, sending the data in the generated partial scanning data packet to the control device includes: If the scanning resolution set by the user is greater than a preset scanning resolution threshold, then before the scanning operation is completed, sending the data in the generated partial scanning data packet to the control device at intervals of a preset duration, where the data sent in any two times has no intersection.
[0012] In a possible implementation manner, the partial scanning data packet includes header data. The step of sending the data in the generated partial scanning data packet to the control device at intervals of a preset duration includes: Split the header data into multiple sub - data; Send one sub - data or part of the sub - data in the header data to the control device at preset time intervals.
[0013] In a possible implementation, the splitting of the header data into multiple sub - data includes: According to the blank - line flag, split the header data into multiple sub - data, where the sub - data is one or more key - value pairs in the header data.
[0014] In a second aspect, an embodiment of the present application provides a data transmission device applied to an image forming device. The image forming device is in a long - connection state with a control device. The device includes: A scanning execution module for performing a scanning operation corresponding to the scanning instruction according to the scanning instruction sent by the control device; A data transmission module for sending the data in the generated partial scanning data packet to the control device before the scanning operation is completed; and sending the data that has not been sent to the control device in the generated complete scanning data packet to the control device after the scanning operation is completed.
[0015] In a third aspect, an embodiment of the present application provides an image forming system, including: A control device; An image forming device that executes the method described in any item of the first aspect; Wherein, the control device is communicatively connected to the image forming device.
[0016] In a fourth aspect, an embodiment of the present application provides a computer - readable storage medium storing a computer program, which when executed by a processor, implements the method described in any item of the first aspect.
[0017] In a fifth aspect, an embodiment of the present application provides a computer program product including a computer program, which when executed by a processor, implements the method described in any item of the first aspect.
[0018] In the embodiment of the present application, when the image forming device and the control device are in a long - connection state, the image forming device performs a scanning operation corresponding to the scanning instruction sent by the control device. During the process that the image forming device has not completed the scanning operation, part of the data in the scanning data packet is sent to the control device to ensure that there is information interaction between the image forming device and the control device, which extends the time of maintaining the long - connection state between the image forming device and the control device to a certain extent and reduces the risk of connection timeout. In addition, the control device does not need to frequently ask the image forming device about the scanning progress, reducing the network burden. Brief Description of the Drawings
[0019] To more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0020] Figure 1 It is a schematic diagram of an application scenario provided by an embodiment of the present application.
[0021] Figure 2 It is a schematic flowchart of a related technology provided by an embodiment of the present application.
[0022] Figure 3 It is a schematic flowchart of another related technology provided by an embodiment of the present application.
[0023] Figure 4 It is a schematic flowchart of a data transmission method provided by an embodiment of the present application.
[0024] Figure 5 It is a schematic diagram of a partial scan data message provided by an embodiment of the present application.
[0025] Figure 6 It is a schematic flowchart of another data transmission method provided by an embodiment of the present application.
[0026] Figure 7 It is a schematic flowchart of another data transmission method provided by an embodiment of the present application.
[0027] Figure 8 It is a schematic diagram of a header data provided by an embodiment of the present application.
[0028] Figure 9 It is a schematic diagram of another header data provided by an embodiment of the present application.
[0029] Figure 10 It is a schematic diagram of a data transmission provided by an embodiment of the present application.
[0030] Figure 11 It is a schematic flowchart of another data transmission method provided by an embodiment of the present application.
[0031] Figure 12 It is a schematic structural diagram of a data transmission device provided by an embodiment of the present application.
[0032] Figure 13 It is a schematic structural diagram of an image forming system provided by an embodiment of the present application. Detailed Description of the Embodiments
[0033] For a better understanding of the technical solution of the present application, the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0034] It should be clear that the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application.
[0035] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms of "a", "the" and "said" used in the embodiments of the present application and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise.
[0036] It should be understood that the term " / and" used herein is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, a / or b may represent: a exists alone, a and b exist simultaneously, and b exists alone. In addition, the character " / " herein generally represents an "or" relationship between the associated objects before and after.
[0037] See Figure 1 , which is a schematic diagram of an application scenario provided for the embodiments of the present application. As Figure 1 shown, the image forming apparatus 101 and the control device 102 are interconnected through a wired or wireless communication network for data transmission. Specifically, the image forming apparatus 101 having a scanning function usually includes a scanning module. Through the scanning module, a document to be scanned can be scanned to obtain scanning data, and then the scanning data is sent to the control device 102.
[0038] It should be noted that Figure 1 the image forming apparatus 101 and the control device 102 shown in
[0039] The communication network connecting the image forming apparatus 101 and the control device 102 can be a local area network or a wide area network relayed by a relay device. When the communication network is a local area network, for example, the communication network can be a short-range communication network such as a Wi-Fi hotspot network, a Wi-Fi P2P network, a Bluetooth network, a ZigBee network, or a near field communication (NFC) network. When the communication network is a wide area network, for example, the communication network can be a 3rd-generation wireless telephone technology (3G) network, the 4th generation mobile communication technology (4G) network, the 5th-generation mobile communication technology (5G) network, a future evolved public land mobile network (PLMN), or the Internet, etc.
[0040] In practical applications, some image forming apparatuses with scanning functions and control devices can use communication protocols for information interaction. For example, the Hyper Text Transfer Protocol (HTTP) and the File Transfer Protocol (FTP), etc. When the image forming apparatus and the control device use the HTTP protocol for information interaction, the image forming apparatus and the control device can maintain a long connection state, and the information sent can be encapsulated into an HTTP message according to the HTTP protocol to achieve information interaction. In order for the image forming apparatus and the control device to maintain a long connection state, the image forming apparatus and the control device can establish a channel for information interaction (i.e., a TCP connection) through the Transmission Control Protocol (TCP) to achieve information interaction between the two. Specifically, a TCP connection is established once during the information interaction process between the image forming apparatus and the control device, and the connection state is maintained for a certain period of time. When the image forming apparatus and the control device maintain a long connection state, the two can perform information interaction at any time without repeatedly establishing and disconnecting the connection, improving the efficiency of information interaction.
[0041] In some application scenarios, when the image forming apparatus and the control device maintain a long connection state, there may be no information interaction between the image forming apparatus and the control device for a long time. At this time, if the long connection state is still maintained between the image forming apparatus and the control device, it may cause waste of communication resources. Therefore, a timeout mechanism is set for the TCP connection between the image forming apparatus and the control device. It can be understood that if the duration without information interaction between the image forming apparatus and the control device is greater than or equal to the duration set by the timeout mechanism, the long connection state between the image forming apparatus and the control device is disconnected.
[0042] See Figure 2 , which is a schematic flowchart of a related art provided by an embodiment of the present application. As Figure 2 shown, the related art includes steps S201 to S203. Specifically, step S201 is that the control device sends a scanning instruction to the image forming apparatus; step S202 is that the image forming apparatus performs a scanning operation corresponding to the scanning instruction according to the scanning instruction sent by the control device; step S203 is that if the scanning operation is completed, the image forming apparatus sends a scanning data packet to the control device. Among them, the scanning data packet may refer to a packet used to transmit the scanned scanning data.
[0043] In this related art, after the image forming apparatus receives the scanning instruction sent by the control device, during the process of not completing the scanning operation, it does not interact with the control device. In actual applications, as the scanning resolution gets higher and higher, the time required for the control device to wait for the image forming apparatus to complete the scanning operation may be longer and longer. In this case, the time without information interaction between the image forming apparatus and the control device is getting longer and longer. When the duration without information interaction between the image forming apparatus and the control device is greater than or equal to the duration set by the timeout mechanism, a connection timeout problem may occur between the image forming apparatus and the control device, causing the long connection state between the two to be disconnected, and then resulting in the image forming apparatus being unable to send scanning data to the control device.
[0044] See Figure 3 , which is a schematic flowchart of another related art provided by an embodiment of the present application. As Figure 3As shown, the image forming apparatus includes a network terminal and a scanning module, which are communicatively connected to each other. This related art includes steps S301 to S310. Specifically, step S301 is that the control device sends a scanning instruction to the network terminal; step S302 is that when the network terminal receives the scanning instruction, it sends a start scanning instruction to the scanning module, and the scanning module performs a corresponding scanning operation; step S303 is that when the scanning module starts to perform the scanning operation, it sends a scanning creation success message to the network terminal, that is, the scanning module successfully creates a scanning task; step S304 is that when the network terminal receives the scanning creation success message, it sends a creation success message to the control device; step S3051 is that after the control device receives the creation success message, it sends a query scanning data request to the network terminal for querying the scanned scanning data from the image forming apparatus; step S3061 is that when the network terminal receives the query scanning data request, it sends a query scanning status instruction to the scanning module for querying the scanning status of the scanning module, and the scanning status includes: scanning completed, scanning not completed; step S3071 is that if the scanning module has not completed the scanning operation, it sends a scanning not completed message to the network terminal; step S3081 is that if the network terminal receives the scanning not completed message, it sends a continue query scanning data instruction to the control device; step S3052 is that when the control device receives the continue query scanning data instruction, it sends a query scanning data request to the network terminal; step S3062 is that when the network terminal receives the query scanning data request, it sends a query scanning status instruction to the scanning module; step S3072 is that if the scanning module has not completed the scanning operation, it sends a scanning not completed message to the network terminal; step S3082 is that if the network terminal receives the scanning not completed message, it sends a continue query scanning data instruction to the control device; step S3053 is that when the control device receives the continue query scanning data instruction, it sends a query scanning data request to the network terminal; step S3063 is that when the network terminal receives the query scanning data request, it sends a query scanning status instruction to the scanning module; step S309 is that if the scanning module has completed the scanning operation, it sends the scanning data to the network terminal; step S310 is that when the network terminal receives the scanning data, it sends the scanning data to the control device.
[0045] As Figure 3 shown, in this related art, during the process that the image forming apparatus has not completed the scanning operation, the control device frequently asks the image forming apparatus about the scanning progress, and the image forming apparatus correspondingly responds to the inquiries of the control device. The image forming apparatus and the control device frequently perform information interaction so that the image forming apparatus and the control device maintain a long connection state. However, the frequent information interaction between the image forming apparatus and the control device increases the network burden.
[0046] In view of the above problems, in the embodiments of the present application, when the image forming apparatus and the control device are in a long connection state, the image forming apparatus executes a scanning operation corresponding to the scanning instruction according to the scanning instruction sent by the control device. During the process that the image forming apparatus has not completed the scanning operation, partial data in the scanning data packet is sent to the control device to ensure that there is information interaction between the image forming apparatus and the control device, which extends the time for maintaining the long connection state between the image forming apparatus and the control device to a certain extent and reduces the risk of connection timeout. In addition, the control device does not need to frequently query the scanning progress of the image forming apparatus, reducing the network burden.
[0047] Specifically, it will be described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0048] See Figure 4 , which is a schematic flowchart of a data transmission method provided by the embodiments of the present application. This method can be applied to Figure 1 the control device and the image forming apparatus shown in Figure 4 , as shown in
[0049] Step S401: The control device sends a scanning instruction to the image forming apparatus.
[0050] In practical applications, when a user needs to perform a scanning operation on a file to be scanned, a scanning instruction can be sent to the image forming apparatus through the control device or the image forming apparatus. For example, the user can select the "Scan" option on the display interface of the control device or the image forming apparatus. In the case where the user sends a scanning instruction to the image forming apparatus through the control device, the possibility of a connection timeout problem between the control device and the image forming apparatus is relatively high. Therefore, in the embodiments of the present application, taking the case where the user sends a scanning instruction to the image forming apparatus through the control device as an example, the information interaction between the control device and the image forming apparatus will be described.
[0051] It should be noted that, in order to enable information interaction between the control device and the image forming apparatus, before the control device sends a scanning instruction to the image forming apparatus, a TCP connection is established between the two through the TCP protocol, and the HTTP protocol is used for information interaction. At this time, the image forming apparatus and the control device are in a long connection state, and the control device can send a scanning instruction to the image forming apparatus through the TCP connection.
[0052] In the embodiments of the present application, the scanning instruction usually includes the scanning resolution and scanning type (such as color, grayscale, and black and white, etc.) set by the user for performing a scanning operation on the file to be scanned. Of course, the scanning instruction may also include other information such as the scanning range and the number of scanning copies, which will not be elaborated in the embodiments of the present application.
[0053] Step S402: The image forming apparatus performs a scanning operation corresponding to the scanning instruction according to the scanning instruction sent by the control device.
[0054] It can be understood that when the image forming apparatus receives the scanning instruction sent by the control device, it analyzes the information in the scanning instruction and performs a scanning operation on the document to be scanned according to the information in the scanning instruction.
[0055] Step S403: Before the scanning operation is completed, the image forming apparatus sends the data in the generated partial scanning data packet to the control device.
[0056] As described above, when the image forming apparatus and the control device perform information interaction using the HTTP protocol, the information sent can be encapsulated into an HTTP packet according to the HTTP protocol. In practical applications, before the scanning operation is completed (i.e., during the process of the image forming apparatus performing the scanning operation), the image forming apparatus can send any HTTP packet to the control device to keep the long connection state between the image forming apparatus and the control device. However, when the control device analyzes the received HTTP packet, if it is found that the analyzed information has nothing to do with the information in the scanning instruction, the control device may report an error. Therefore, before the scanning operation is completed, the image forming apparatus can send the data in the scanning data packet corresponding to the scanning instruction to the control device. A complete scanning data packet usually includes a packet header and a packet body. The packet header is used to transmit header data, and the packet body is used to transmit the scanned data obtained by scanning.
[0057] It should be noted that since the image forming apparatus continuously performs a scanning operation on the document to be scanned, before the image forming apparatus completes the scanning operation, it is impossible to obtain all the scanning data packets. In order to maintain the long connection state between the image forming apparatus and the control device, the data in the generated partial scanning data packet can be sent to the control device.
[0058] It can be understood that the partial scanning data packet can include header data and / or partial scanning data obtained by scanning during the scanning operation.
[0059] See Figure 5 , which is a schematic diagram of a partial scanning data packet provided by an embodiment of the present application. As Figure 5 shown in (a) therein, the partial scanning data packet only includes header data; as Figure 5 shown in (b) therein, the partial scanning data packet only includes partial scanning data obtained by scanning during the scanning operation; as Figure 5 shown in (c) therein, the partial scanning data packet includes header data and partial scanning data obtained by scanning during the scanning operation.
[0060] In practical applications, the size of the scanning resolution affects the time required for an image forming apparatus to complete a scanning operation. It can be understood that, when the file to be scanned is the same, the higher the scanning resolution, the longer the time required for the image forming apparatus to complete the scanning operation. In other words, the higher the scanning resolution, the greater the probability that the long connection state between the image forming apparatus and the control device is disconnected. Therefore, in the embodiments of the present application, the probability that the long connection state between the image forming apparatus and the control device is disconnected can be determined according to the size of the scanning resolution, so as to further determine the data sent by the image forming apparatus to the control device.
[0061] See Figure 6 , which is a schematic flowchart of another data transmission method provided by the embodiments of the present application. As Figure 6 shown, on the basis of the embodiment shown in Figure 4 , step S403 specifically includes step S4031, and step S404 specifically includes step S4041.
[0062] Step S4031: If the scanning resolution set by the user is not greater than a preset scanning resolution threshold, then before the scanning operation is completed, send the complete header data in the generated partial scan data packet to the control device.
[0063] As described above, the scanning instruction sent by the control device to the user includes the scanning resolution set by the user for performing a scanning operation on the file to be scanned. In the embodiments of the present application, when the image forming apparatus receives the scanning instruction, the scanning resolution set by the user can be obtained from the scanning instruction.
[0064] In practical applications, the lower the scanning resolution, the shorter the time required for the image forming apparatus to complete the scanning operation, and the smaller the probability that the long connection state between the image forming apparatus and the control device is disconnected, but the problem of connection timeout may still occur.
[0065] In the embodiments of the present application, a scanning resolution threshold (also referred to as the "first scanning resolution threshold" hereinafter) can be preset. When the scanning resolution set by the user is not greater than the first scanning resolution threshold, it can be considered that the time required for the image forming apparatus to complete the scanning operation is relatively short, but the connection timeout may still occur. At this time, the data in the generated partial scan data packet can be sent to the control device once.
[0066] It can be understood that when the scanning resolution set by the user is not greater than the first scanning resolution threshold, an information interaction occurs between the image forming apparatus and the control device, which extends the time for maintaining the long connection state between the image forming apparatus and the control device to a certain extent and reduces the risk of connection timeout.
[0067] In practical applications, the generation of header data and scan data is independent of each other. Usually, the header data includes information such as the response status of the image forming apparatus to the scan instruction and the scan data type. Therefore, in the embodiments of the present application, when the scan resolution set by the user is not greater than the first scan resolution threshold, the complete header data can be sent to the control device, which is beneficial for the control device to correctly parse the scan data.
[0068] It should be noted that the first scan resolution threshold can be 300 dpi, 600 dpi, 900 dpi, etc. Those skilled in the art can set other first scan resolution thresholds according to actual needs, and the embodiments of the present application do not make specific limitations on this.
[0069] Step S4041: After completing the scan operation, send the complete scanned data obtained in all the generated scan data packets to the control device.
[0070] It can be understood that during the process of the scan operation not being completed, the complete header data in the scan data packet has been sent to the control device. In order for the control device to obtain all the generated scan data packets, after completing the scan operation, it is also necessary to send the complete scan data other than the complete header data to the control device.
[0071] In the embodiments of the present application, when the time required for the image forming apparatus to complete the scan operation is short, sending the complete header data to the control device once can reduce the data processing volume and save performance overhead while maintaining the long connection state between the image forming apparatus and the control device.
[0072] However, when the time for the image forming apparatus to complete the scan operation is long, if only one header data is sent to the control device, there may still be a risk of the long connection state being disconnected, which may lead to the inability to transmit scan data. For example, after the image forming apparatus sends one header data to the control device, starting from the moment when the header data is sent, if the duration of no information interaction between the image forming apparatus and the control device is greater than or equal to the duration set by the timeout mechanism, the long connection state between the image forming apparatus and the control device is disconnected, which may lead to the inability to transmit scan data.
[0073] See Figure 7 , which is a schematic flowchart of another data transmission method provided by the embodiments of the present application. As Figure 7 shown, on the basis of the embodiment shown in Figure 4 , step S403 specifically includes step S4032.
[0074] Step S4032: If the scanning resolution set by the user is greater than a preset scanning resolution threshold, before the scanning operation is completed, the data in the generated partial scanning data packet is sent to the control device at intervals of a preset duration.
[0075] It can be understood that when the scanning resolution set by the user is greater than the first scanning resolution threshold, it can be considered that the time required for the image forming apparatus to complete the scanning operation is relatively long. In order to keep the long connection state between the image forming apparatus and the control device for a long time, the data in the generated partial scanning data packet can be sent to the control device multiple times.
[0076] However, when there is the same data in any two transmissions, the image forming apparatus and the control device may need to process this data multiple times, increasing the data processing volume and thus increasing the performance overhead. Therefore, in a possible implementation, there is no intersection between any two transmissions. It can be understood that the data in the generated partial scanning data packet is only sent to the control device once.
[0077] In practical applications, the partial scanning data in the generated partial scanning data packet can be sent to the control device multiple times. In practical applications, partial data in the header data can also be sent to the control device multiple times. Specifically, the header data is divided into multiple sub-data; one sub-data or part of the sub-data in the header data is sent to the control device at intervals of a preset duration.
[0078] See Figure 8 , which is a schematic diagram of a kind of header data provided by an embodiment of the present application. As Figure 8 shown, the header data is divided into three sub-data: sub-data A, sub-data B, and sub-data C, and there is no intersection between any two sub-data. Of course, the header data can also be divided into other numbers of sub-data, for example, two, four, five, etc., and the embodiments of the present application do not limit this.
[0079] Among them, the header data includes multiple key-value pairs, each key-value pair is used to describe specific information, and each key-value pair is separated by a blank line. separation.
[0080] See Figure 9 , which is another schematic diagram of a kind of header data provided by an embodiment of the present application. As Figure 9 shown, the header data includes four key-value pairs: {key A: value A}, {key B: value B}, {key C: value C}, and {key D: value D}, and there is a blank line flag after each key-value pair. . It should be noted that the header data shown in the embodiments of the present application is only an exemplary illustration. In practical applications, the header data may also include other numbers of key-value pairs, for example, two, three, or five, etc., and the embodiments of the present application do not limit this.
[0081] In practical applications, the information in the header data exists in the form of key-value pairs. If the header data is split into multiple sub-data according to any splitting method (for example, a preset byte length, etc.), when the control device parses and assembles the multiple received sub-data, it may not be able to correctly identify the information corresponding to the key-value pairs. Further, there may be a risk of reporting an error. Preferably, the header data can be split into multiple sub-data according to the blank line flag. Among them, the sub-data is one or more key-value pairs in the header data.
[0082] In the embodiment of the present application, the sub-data sent to the control device is one or more complete key-value pairs, which is beneficial for the control device to correctly identify the information corresponding to the key-value pairs, and reduces the risk of reporting an error to a certain extent.
[0083] As described above, after splitting the header data into multiple sub-data, one sub-data or part of the sub-data in the header data can be sent to the control device every preset time interval. Among them, the starting moment of the preset time interval is the moment when the information interaction between the image forming device and the control device stops. It can be understood that the moment when the information interaction stops is the moment when the last HTTP message is sent between the image forming device and the control device.
[0084] In the embodiment of the present application, since the scanning progress of the file scanned by the image forming device is not fixed, the estimated time required to scan the file to be scanned can be predicted periodically according to the scanning progress of the file to be scanned and the file content of the file to be scanned. Then, according to the predicted estimated time each time, the number of sub-data in the header data sent to the control device every preset time interval is dynamically determined. Finally, the determined number of sub-data in the header data can be sent to the control device every preset time interval. The determined number can be one or multiple. Generally, the longer the estimated time, the fewer the number of sub-data in the header data sent to the control device, and the shorter the estimated time, the more the number of sub-data in the header data sent to the control device. That is, during the scanning operation of the image forming device, at the beginning, one sub-data in the header data can be sent to the control device every preset time interval, and when the scanning is almost completed, part of the sub-data in the header data can be sent to the control device every preset time interval.
[0085] Exemplarily, the image forming apparatus sends an HTTP message A to the control device. If the HTTP message A is the last HTTP message sent between the image forming apparatus and the control device, the moment when the information interaction between them stops is the moment when the image forming apparatus sends the HTTP message A to the control device; the control device sends an HTTP message B to the image forming apparatus. If the HTTP message B is the last HTTP message sent between the image forming apparatus and the control device, the moment when the information interaction between them stops is the moment when the control device sends the HTTP message B to the image forming apparatus.
[0086] See Figure 10 , a schematic diagram of data transmission provided by an embodiment of the present application. As Figure 10 shown, the moment when the information interaction between the image forming apparatus and the control device stops is the moment t1. Starting from the moment t1, after a preset time interval, the image forming apparatus sends sub-data A to the control device at the moment t2. At this time, the moment when the information interaction between the image forming apparatus and the control device stops is the moment t2. Starting from the moment t2, after a preset time interval, the image forming apparatus sends sub-data B to the control device at the moment t3. At this time, the moment when the information interaction between the image forming apparatus and the control device stops is the moment t3. Starting from the moment t3, after a preset time interval, the image forming apparatus sends sub-data C to the control device at the moment t4. At this time, the moment when the information interaction between the image forming apparatus and the control device stops is the moment t4. In addition, the time interval is a preset value, which can be 10 seconds, 20 seconds, 30 seconds, 1 minute, 3 minutes, 5 minutes, etc. Of course, those skilled in the art can set other time intervals according to actual needs, and the embodiments of the present application do not make specific limitations thereto.
[0087] However, when the time interval is greater than or equal to the time length set by the timeout mechanism, the long connection state between the image forming apparatus and the control device will be disconnected. At this time, information interaction between them cannot be performed.
[0088] In a possible implementation manner, the time interval is less than the time length set by the timeout mechanism. It can be understood that sending sub-data to the control device before the long connection state between the image forming apparatus and the control device is disconnected can reduce the risk of connection timeout.
[0089] In the embodiment of the present application, when the time required for the image forming apparatus to complete the scanning operation is relatively long, sending some of the header data to the control device multiple times can keep the long connection state between the image forming apparatus and the control device for a long time, reducing the risk of connection timeout.
[0090] In a possible implementation, if the scanning resolution set by the user is not greater than a preset second scanning resolution threshold, after the scanning operation is completed, all scanned data packets are sent to the control device. Herein, the second scanning resolution threshold is less than the first scanning resolution threshold.
[0091] It can be understood that when the scanning resolution set by the user is less than the second scanning resolution threshold, it can be considered that the time required for the image forming apparatus to complete the scanning operation is less than the duration set by the timeout mechanism. Therefore, there is no risk of disconnection in the long connection state between the image forming apparatus and the control device. In this case, after the image forming apparatus completes the scanning operation, the complete header data and the scanned data can be sent to the control device simultaneously.
[0092] It should be noted that the second scanning resolution threshold can be 100 dpi, 300 dpi, 600 dpi, etc. Those skilled in the art can set other second scanning resolution thresholds according to actual needs, and the embodiments of the present application do not make specific limitations thereto.
[0093] In the embodiments of the present application, when the time required for the image forming apparatus to complete the scanning operation is less than the duration set by the timeout mechanism, there is no need to first send the data in the partial scanned data packets to the control device, which reduces the network burden. In addition, there is no need to perform additional data processing on the scanned data packets, which reduces the data processing amount to a certain extent and saves the performance overhead.
[0094] Step S404: After the scanning operation is completed, the image forming apparatus sends the data in the generated all scanned data packets that has not been sent to the control device to the control device.
[0095] It can be understood that during the process of the scanning operation not being completed, the image forming apparatus has already sent partial data in the scanned data packets to the control device. In order to enable the control device to obtain all the scanned data packets, after the scanning operation is completed, it is also necessary to send the data in the scanned data packets that has not been sent to the control device to the control device.
[0096] Exemplarily, during the process of the scanning operation not being completed, if the complete header data has been sent to the control device, after the scanning operation is completed, it is also necessary to send the complete scanned data to the control device; during the process of the scanning operation not being completed, if partial data in the header data has been sent to the control device, after the scanning operation is completed, it is also necessary to send the remaining data in the header data except the partial data and the complete scanned data to the control device.
[0097] In an embodiment of the present application, when the image forming apparatus and the control device are in a long connection state, the image forming apparatus executes a scanning operation corresponding to the scanning instruction according to the scanning instruction sent by the control device. During the process that the image forming apparatus has not completed the scanning operation, partial data in the scanning data packet is sent to the control device to ensure information interaction between the image forming apparatus and the control device, which extends to a certain extent the time for maintaining the long connection state between the image forming apparatus and the control device and reduces the risk of connection timeout. In addition, the control device does not need to frequently query the scanning progress of the image forming apparatus, reducing the network burden.
[0098] In practical applications, the functions of information interaction between the image forming apparatus and the control device and the function of executing the scanning operation can be respectively integrated into two structures of the image forming apparatus. The two structures cooperate with each other and are logically separated, making the structural function positioning in the image forming apparatus clear and the logic simple. In a possible implementation manner, the image forming apparatus includes a network end and a scanning module, and the network end and the scanning module are communicatively connected. Among them, the network end and the control device perform information interaction using the HTTP protocol and the TCP protocol; the scanning module is used to execute the scanning operation.
[0099] It should be noted that the network end and the scanning module can establish a communication connection in various ways, for example, wired connection, wireless connection, network protocol connection, etc. Those skilled in the art can set the communication method between the network end and the scanning module according to actual needs, and the embodiments of the present application do not make specific limitations thereto.
[0100] See Figure 11 , which is a schematic flowchart of another data transmission method provided by the embodiment of the present application. As Figure 11 shown, on the basis of the embodiment shown in Figure 4 , step S401 specifically includes step S501, step S402 specifically includes steps S502 and S503, step S403 specifically includes steps S5091 and S5092, step S404 includes step S511. In addition to the above steps, there are other steps, which will be described in detail below.
[0101] Step S501: The control device sends a scanning instruction to the network end.
[0102] In an embodiment of the present application, when a user expects to execute a scanning operation on a file to be scanned through the image forming apparatus to obtain scanning data, a scanning instruction can be sent to the network through the control device. It should be noted that before sending the scanning instruction to the network, the control device and the network end are in a long connection state. The specific content involved in the present application can refer to the description in step S401 of the above embodiment. For the sake of brevity of description, it will not be repeated here.
[0103] Step S502: The network side sends a start scanning instruction to the scanning module.
[0104] It can be understood that after the network side receives the scanning instruction sent by the control device, it needs to send a start scanning instruction to the scanning module so that the scanning module performs a scanning operation on the file to be scanned.
[0105] Step S503: The scanning module performs a scanning operation corresponding to the start scanning instruction according to the start scanning instruction sent by the network side.
[0106] It can be understood that the start scanning instruction usually includes the scanning resolution and scanning type (such as color, grayscale, and black and white, etc.) for performing a scanning operation on the file to be scanned set by the user. Of course, the start scanning instruction may also include other information, which will not be elaborated in the embodiments of the present application.
[0107] In the embodiments of the present application, after the scanning module receives the start scanning instruction sent by the network side, it can perform a corresponding scanning operation according to the information in the start scanning instruction.
[0108] Step S504: The scanning module sends a scanning creation success message to the network side.
[0109] It can be understood that when the scanning module can perform a scanning operation according to the start scanning instruction, it can send a scanning creation success message to the network side. Further, the network side can send a creation success message to the control device so that the control device can receive the information that the task of performing a scanning operation on the file to be scanned is successfully created.
[0110] Step S505: The network side sends a creation success message to the control device.
[0111] In the embodiments of the present application, after the network side receives the scanning creation success message sent by the scanning module, it can send a creation success message to the control device, thereby enabling the user to know whether the scanning instruction is successfully sent and whether the scanning operation can be performed, improving the user experience.
[0112] Step S506: The control device sends a query scanning data request to the network side.
[0113] In the embodiments of the present application, after the control device receives the creation success message sent by the network side, it can send a scanning data request to the network side so that the network side sends scanning data.
[0114] Step S5071: The network side sends a query scanning status instruction to the scanning module.
[0115] It is understandable that the scanning module performs a scanning operation on the file to be scanned. Therefore, the scanning module can detect whether the scanning operation is completed. When it is necessary to obtain the scanning status, the network side can send a query scanning status instruction to the scanning module to query the scanning status from the scanning module.
[0116] Step S5081: The scanning module sends scanning incomplete information to the network side.
[0117] In the embodiment of the present application, after the scanning module receives the query scanning status instruction sent by the network side, it detects whether the scanning operation is completed. If the scanning operation is not completed, it sends scanning incomplete information to the network side; if the scanning operation is completed, it sends scanning data to the network side.
[0118] Step S5091: Before the scanning operation is not completed, the network side sends sub-data in the header data to the control device at preset time intervals.
[0119] As described above, before the scanning operation is not completed, the long connection state between the network side and the control device may be disconnected, resulting in connection timeout and thus unable to send scanning data. In the embodiment of the present application, when the network side receives the scanning incomplete information sent by the scanning module, the network side sends sub-data in the header data to the control device at preset time intervals, which extends the time for maintaining the long connection state between the network side and the control device to a certain extent.
[0120] The specific content involved in the implementation of the present application can be referred to the description in step S403 of the above embodiment. For the sake of brevity of expression, it will not be elaborated here.
[0121] In the embodiment of the present application, steps S5071, S5081, and S5091 can be repeatedly executed. For the sake of easy understanding, the repeatedly executed steps are represented as steps S5072, S5082, and S5092. The specific content involved can be referred to the descriptions in steps S5071, S5081, and S5091, and will not be elaborated here.
[0122] Step S5073: The network side sends a query scanning status instruction to the scanning module.
[0123] The specific content involved in the implementation of the present application can be referred to the description in step S5071 above. For the sake of brevity of expression, it will not be elaborated here.
[0124] Step S510: The scanning module sends scanning data to the network side.
[0125] As described above, after the scanning module receives the query scanning status instruction sent by the network side, it can detect whether the scanning operation is completed. If it detects that the scanning operation is completed, it sends scanning data to the network side.
[0126] Step S511: After the scanning operation is completed, the network side sends to the control device the data in all the generated scan data packets that has not been sent to the control device.
[0127] In the embodiment of the present application, during the process of the uncompleted scanning operation, the network side has sent some data in the header data to the control device. In order to enable the control device to obtain all the scan data packets, after the scanning operation is completed, it is also necessary to send to the control device the data in the scan data packets that has not been sent to the control device. The specific content involved in the embodiment of the present application can refer to the description in step S404 of the above embodiment. For the sake of brevity of description, it will not be elaborated here.
[0128] In the embodiment of the present application, during the process of the uncompleted scanning operation, sending some data in the header data to the control device multiple times can keep the long connection state between the image forming device and the control device for a long time, reducing the risk of connection timeout.
[0129] Corresponding to the above embodiment, the embodiment of the present application also provides a data transmission device.
[0130] See Figure 12 , which is a schematic structural diagram of a data transmission device provided by the embodiment of the present application. As Figure 12 shown, the data transmission device 600 is applied to an image forming device, and the image forming device and the control device are in a long connection state. The data transmission device 600 includes a scanning execution module 601 and a data transmission module 602. Specifically, the scanning execution module 601 is configured to execute a scanning operation corresponding to the scanning instruction according to the scanning instruction sent by the control device; the data transmission module 602 is configured to send, before the scanning operation is completed, the data in some of the generated scan data packets to the control device; and after the scanning operation is completed, send to the control device the data in all the generated scan data packets that has not been sent to the control device.
[0131] The specific content involved in the embodiment of the present application can refer to the description of the above method embodiment. For the sake of brevity of description, it will not be elaborated here.
[0132] Corresponding to the above embodiment, the embodiment of the present application also provides an image forming system.
[0133] See Figure 13 , which is a schematic structural diagram of an image forming system provided by the embodiment of the present application. As Figure 13 shown, the image forming system 700 includes: a control device 701 and an image forming device 702. Among them, the control device 701 is communicatively connected to the image forming device 702. The image forming device 702 is configured to execute the method embodiment described above. For the sake of brevity of description, it will not be elaborated here.
[0134] Corresponding to the above embodiments, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium can store a program, and when the program runs, it can control the device where the computer-readable storage medium is located to execute some or all of the steps in the above method embodiments. In a specific implementation, the computer-readable storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM for short), a random access memory (RAM for short), etc.
[0135] Corresponding to the above embodiments, an embodiment of the present application further provides a computer program product, which includes executable instructions. When the executable instructions are executed on a computer, the computer is caused to execute some or all of the steps in the above method embodiments.
[0136] In the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent the situation where A exists alone, A and B exist simultaneously, and B exists alone. Among them, A and B can be singular or plural. The character " / " generally means that the associated objects before and after are in an "or" relationship. "At least one of the following" and its similar expressions refer to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, and c can represent: a, b, c, a - b, a - c, b - c, or a - b - c, where a, b, and c can be single or multiple.
[0137] Those of ordinary skill in the art can realize that the units and algorithm steps described in the embodiments disclosed herein can be implemented by a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. A professional technician can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0138] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be described herein again.
[0139] In several embodiments provided by the present application, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or a part of this technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.
[0140] The above are only specific implementation manners of the present application. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should all be covered by the protection scope of the present application. The protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A data transmission method, characterized in that: Applied to an image forming apparatus, the image forming apparatus is in a long connection state with a control device, and the method includes: According to the scanning instruction sent by the control device, executing a scanning operation corresponding to the scanning instruction; Before the scanning operation is completed, sending the data in the generated partial scanning data message to the control device; After the scanning operation is completed, the data that has not been sent to the control device in all the generated scanning data messages is sent to the control device.
2. The method according to claim 1, characterized in that The data in the generated partial scan data message includes: header data and / or partial scan data scanned and obtained during the scanning operation.
3. The method according to claim 1, characterized in that The step of sending the generated data in the partial scan data message to the control device before the scan operation is completed includes: If the scanning resolution set by the user is not greater than the preset scanning resolution threshold, before the scanning operation is completed, the complete header data in the generated partial scanning data message is sent to the control device; After completing the scanning operation, sending to the control device the data in all the generated scanning data messages that have not been sent to the control device, comprises: After the scanning operation is completed, the complete scanning data obtained by scanning in the generated all scanning data messages are sent to the control device.
4. The method according to claim 1, characterized in that: The step of sending the generated data in the partial scan data message to the control device before the scan operation is completed includes: If the scanning resolution set by the user is greater than the preset scanning resolution threshold, the data in the generated partial scanning data message is sent to the control device at every preset time interval before the scanning operation is completed, wherein there is no intersection between any two sent data.
5. The method according to claim 4, characterized in that The partial scan data message includes header data, and the sending of the data in the generated partial scan data message to the control device at each preset time interval includes: Splitting the header data into a plurality of sub-data; One sub-data or part of the sub-data in the header data is sent to the control device at intervals of a preset duration.
6. The method according to claim 5, characterized in that The step of dividing the header data into a plurality of sub-data comprises: According to the blank line mark, the header data is divided into a plurality of sub-data, where the sub-data is one or more key-value pairs in the header data.
7. A data transmission device, characterized in that: Applied to an image forming apparatus, the image forming apparatus is in a long connection state with a control device, and the apparatus comprises: A scanning execution module, configured to execute a scanning operation corresponding to the scanning instruction according to the scanning instruction sent by the control device; The data transmission module is used to send the data in the generated partial scanning data message to the control device before the scanning operation is completed; after the scanning operation is completed, send the data in the generated full scanning data message that has not been sent to the control device to the control device.
8. An image forming system, characterized in that: include: Control equipment; An image forming device for executing the method according to any one of claims 1 to 6; Wherein, the control device is communicatively connected with the image forming apparatus.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Remote management system, system / Device for image formation, management device, remote management method and information recording medium
JP2002259312A
Reading device, control method of reading device, and program
JP2019176364A
Scanner apparatus, method for controlling scanner apparatus and multifuntion apparatus
US20050134941A1
Scan data transmitter and a scan data transmission system
US20050174606A1