A data transmission method, apparatus, system, storage medium, and program product.

By sending partial scan data and segmenting header data to the control device before the image forming apparatus completes the scanning operation, the problems of connection timeout and network burden are solved, and the stability and efficiency of long-term connections are achieved.

CN120201130BActive Publication Date: 2026-01-30BEIJING PANTUM INFORMATION TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510336622.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-20
Publication Date
2026-01-30
Estimated Expiration
2045-03-20

AI Technical Summary

Technical Problem

During the scanning process before the image forming apparatus completes its scanning operation, connection timeouts may occur, resulting in the inability to transmit scan data or increased network load.

Method used

Before completing the scanning operation, the image forming apparatus sends data from the partially generated scan data message to the control device, and after completing the scanning operation, it sends all the unsent scan data. The header data is divided into multiple sub-data and sent at preset intervals to maintain a long connection.

Benefits of technology

This extends the time that the image forming apparatus and control equipment can maintain a long connection, reducing the risk of connection timeout and lowering the network load.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120201130B_ABST
    Figure CN120201130B_ABST
Patent Text Reader

Abstract

This application provides a data transmission method, apparatus, system, storage medium, and program product. When an image forming apparatus and a control device are in a long-term connection state, the image forming apparatus executes a scanning operation corresponding to the scanning command sent by the control device. During the scanning process, the image forming apparatus sends partial data from the scanning data packet to the control device to ensure information exchange between the two devices. This extends the duration of the long-term connection and reduces the risk of connection timeout. Furthermore, the control device does not need to frequently query the image forming apparatus for scanning progress, reducing network load.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image forming technology, and more specifically to a data transmission method, apparatus, system, storage medium, and program product. Background Technology

[0002] Some image forming apparatuses with scanning capabilities are devices that can convert images into digital formats that can be processed by control devices (such as desktop computers, mobile phones, tablets, etc.). Examples include printers, copiers, fax machines, scanners with scanning capabilities, and multifunction printers that integrate printing, copying, faxing, and scanning functions into one unit.

[0003] In practical applications, some image forming apparatuses with scanning capabilities and control devices can exchange information using communication protocols. Examples include Hypertext Transfer Protocol (HTTP) and File Transfer Protocol (FTP). When the image forming apparatus and control device exchange information using the HTTP protocol, a persistent connection can be maintained between them.

[0004] However, as scanning resolution increases, the time required for the image forming apparatus to complete the scanning operation also increases. Therefore, the control device may need to wait longer to receive the scan data sent by the image forming apparatus. During the period before the image forming apparatus completes the scanning operation, the lack of information exchange between the image forming apparatus and the control device for an extended period may lead to a connection timeout, potentially causing the long-term connection between the image forming apparatus and the control device to break, and the control device to be unable to receive the scan data.

[0005] In related technologies, while the image forming apparatus is not completing the scanning operation, the control device frequently queries the image forming apparatus for scanning progress, and the image forming apparatus responds accordingly. This frequent information exchange between the image forming apparatus and the control device maintains a persistent connection. However, this frequent information exchange increases the network load.

[0006] It should be noted that the information disclosed in the background section of this application is intended only to enhance the understanding of the general background of this application, and should not be construed as an admission or in any way implying that the information constitutes prior art known to those skilled in the art. Summary of the Invention

[0007] This application provides a data transmission method, apparatus, system, storage medium, and program product to address the problem in the prior art that connection timeouts may occur during the scanning operation of an image forming apparatus before it completes, resulting in the inability to transmit scan data or increased network burden.

[0008] In a first aspect, embodiments of this application provide a data transmission method applied to an image forming apparatus, wherein the image forming apparatus and a control device are in a long-term connected state, the method comprising:

[0009] According to the scanning command sent by the control device, perform the scanning operation corresponding to the scanning command;

[0010] Before the scanning operation is completed, send the data from the partially generated scan data message to the control device;

[0011] After completing the scanning operation, send to the control device the data that was not sent to the control device from all the generated scan data messages.

[0012] In one possible implementation, the data in the generated partial scan data packet includes: header data and / or partial scan data obtained during the scanning operation.

[0013] In one possible implementation, sending data from a partially generated scan data packet to the control device before completing the scan operation includes:

[0014] If the scan resolution set by the user is not greater than the preset scan resolution threshold, then before the scan operation is completed, the complete header data of the generated partial scan data packet is sent to the control device.

[0015] The step of sending data that was not sent to the control device from all generated scan data packets after completing the scanning operation includes: sending the complete scan data obtained from all generated scan data packets to the control device after completing the scanning operation.

[0016] In one possible implementation, sending data from a partially generated scan data packet to the control device before completing the scan operation includes:

[0017] If the user-set scan resolution is greater than the preset scan resolution threshold, then before the scan operation is completed, data from the generated partial scan data packets will be sent to the control device at preset time intervals, wherein the data sent in any two sessions do not overlap.

[0018] In one possible implementation, the partial scan data packet includes header data, and the sending of data from the generated partial scan data packet to the control device at preset time intervals includes:

[0019] The header data is divided into multiple sub-data;

[0020] At preset intervals, send one or more sub-data points from the header data to the control device.

[0021] In one possible implementation, dividing the header data into multiple sub-data includes:

[0022] Based on the blank line marker, the header data is divided into multiple sub-data, where each sub-data is one or more key-value pairs in the header data.

[0023] Secondly, embodiments of this application provide a data transmission apparatus applied to an image forming apparatus, wherein the image forming apparatus and a control device are in a long-term connected state, and the apparatus includes:

[0024] The scan execution module is used to execute a scan operation corresponding to the scan command sent by the control device.

[0025] The data transmission module is used to send data from a portion of the generated scan data packets to the control device before the scanning operation is completed; and to send data from all generated scan data packets that were not sent to the control device after the scanning operation is completed.

[0026] Thirdly, embodiments of this application provide an image forming system, including:

[0027] Control equipment;

[0028] An image forming apparatus that performs the method described in any one of the first aspects;

[0029] The control device is communicatively connected to the image forming apparatus.

[0030] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in any one of the first aspects.

[0031] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the method described in any one of the first aspects.

[0032] In this embodiment, when the image forming apparatus and the control device are in a persistent connection state, the image forming apparatus executes a scanning operation corresponding to the scanning command sent by the control device. During the scanning process, before the image forming apparatus completes the scanning operation, it sends partial data from the scanning data packet to the control device to ensure information exchange between the two devices. This extends the duration of the persistent connection between the image forming apparatus and the control device to some extent, reducing the risk of connection timeout. Furthermore, the control device does not need to frequently query the image forming apparatus for scanning progress, reducing network load. Attached Figure Description

[0033] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0034] Figure 1 This is a schematic diagram illustrating an application scenario provided in an embodiment of this application.

[0035] Figure 2 This is a flowchart illustrating a related technology provided in an embodiment of this application.

[0036] Figure 3 This is a flowchart illustrating another related technology provided in an embodiment of this application.

[0037] Figure 4 This is a flowchart illustrating a data transmission method provided in an embodiment of this application.

[0038] Figure 5 This is a schematic diagram of a partial scan data packet provided in an embodiment of this application.

[0039] Figure 6 This is a flowchart illustrating another data transmission method provided in an embodiment of this application.

[0040] Figure 7 This is a flowchart illustrating another data transmission method provided in an embodiment of this application.

[0041] Figure 8 This is a schematic diagram of header data provided in an embodiment of this application.

[0042] Figure 9 This is a schematic diagram of another header data provided in an embodiment of this application.

[0043] Figure 10 This is a schematic diagram of data transmission provided in an embodiment of this application.

[0044] Figure 11 This is a flowchart illustrating another data transmission method provided in an embodiment of this application.

[0045] Figure 12 This is a schematic diagram of a data transmission device provided in an embodiment of this application.

[0046] Figure 13 This is a schematic diagram of the structure of an image forming system provided in an embodiment of this application. Detailed Implementation

[0047] To better understand the technical solution of this application, the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0048] It should be understood that the described embodiments are merely some, not all, of the embodiments in this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.

[0049] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. The singular forms “a,” “the,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0050] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0051] See Figure 1 This is a schematic diagram illustrating an application scenario provided by an embodiment of this application. For example... Figure 1 As shown, the image forming apparatus 101 and the control device 102 are interconnected via a wired or wireless communication network for data transmission. Specifically, the image forming apparatus 101 with scanning function typically includes a scanning module, which can scan the document to be scanned, obtain scan data, and then send the scan data to the control device 102.

[0052] It should be pointed out that, Figure 1The image forming apparatus 101 and control device 102 shown are merely exemplary descriptions and should not be construed as limiting the scope of protection of this application. For example, the image forming apparatus 101 can be one of the following product types: a printer, copier, fax machine, scanner with scanning capabilities, and a multifunction printer that integrates printing, copying, faxing, and scanning functions. The control device 102 includes, but is not limited to, desktop computers, laptop computers, networked computers, handheld computers, personal digital assistants (PDAs), internet-enabled mobile phones, smartphones, pagers, digital capture devices (e.g., digital cameras and camcorders), internet devices, e-book readers, information boards, and digital or network boards.

[0053] The communication network connecting the image forming apparatus 101 and the control device 102 can be a local area network (LAN) or a wide area network (WAN) relayed through a relay device. When the communication network is a LAN, for example, it 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 WAN, for example, it can be a 3G network, a 4G network, a 5G network, a future public land mobile network (PLMN), or the Internet.

[0054] In practical applications, image forming apparatuses and control devices with scanning capabilities can exchange information using communication protocols. Examples include Hypertext Transfer Protocol (HTTP) and File Transfer Protocol (FTP). When the image forming apparatus and control device use HTTP for information exchange, a persistent connection can be maintained, and the sent information can be encapsulated into HTTP messages to achieve information exchange. To maintain this persistent connection, the image forming apparatus and control device can establish an information exchange channel (i.e., a TCP connection) using Transmission Control Protocol (TCP). Specifically, a TCP connection is established once during information exchange and maintained for a certain period. With a persistent connection, the two devices can exchange information at any time without repeatedly establishing and closing connections, improving the efficiency of information exchange.

[0055] In some application scenarios, when the image forming apparatus and the control device maintain a persistent connection, there may be no information exchange between them for an extended period. Maintaining this persistent connection in such cases could lead to wasted communication resources. Therefore, a timeout mechanism is implemented for the TCP connection between the image forming apparatus and the control device. Understandably, if the duration of no information exchange between the image forming apparatus and the control device is greater than or equal to the timeout period, the persistent connection between them is terminated.

[0056] See Figure 2 This is a flowchart illustrating a related technology provided in an embodiment of this application. Figure 2 As shown, the related technology includes steps S201 to S203. Specifically, step S201 involves the control device sending a scanning command to the image forming apparatus; step S202 involves the image forming apparatus executing a scanning operation corresponding to the scanning command sent by the control device; and step S203 involves the image forming apparatus sending a scan data message to the control device if the scanning operation is completed. The scan data message can refer to a message used to transmit the scanned data.

[0057] In this related technology, after the image forming apparatus receives a scanning command from the control device, it does not interact with the control device until the scanning operation is completed. In practical applications, as scanning resolution increases, the time required for the control device to wait for the image forming apparatus to complete the scanning operation may become increasingly longer. In this case, the time without information interaction between the image forming apparatus and the control device becomes longer and longer. When the duration of no information interaction between the image forming apparatus and the control device is greater than or equal to the timeout mechanism setting, a connection timeout problem may occur between the image forming apparatus and the control device, causing the long-term connection between them to break, thus preventing the image forming apparatus from sending scanning data to the control device.

[0058] See Figure 3 This is a flowchart illustrating another related technology provided in an embodiment of this application. Figure 3As shown, the image forming apparatus includes a network terminal and a scanning module, and the network terminal and the scanning module are communicatively connected. This related technology includes steps S301 to S310. Specifically, step S301 is that the control device sends a scanning command to the network; step S302 is that when the network receives the scanning command, it sends a start scanning command to the scanning module, and the scanning module performs the corresponding scanning operation; step S303 is that when the scanning module starts performing the scanning operation, it sends a scan creation success message to the network, that is, the scanning module successfully creates the scanning task; step S304 is that when the network receives the scan 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 scan data request to the network to query the scanned scan data from the image forming apparatus; step S3061 is that when the network receives the query scan data request, it sends a query scan status command to the scanning module to query the scan status, which includes: scan completed, scan incomplete; step S3071 is that if the scanning module has not completed the scanning operation, it sends a scan incomplete message to the network; step S3081 is that if... If the network receives a scan incomplete message, it sends a command to the control device to continue querying scan data. Step S3052 involves the control device sending a scan data query request to the network when it receives the command. Step S3062 involves the network sending a scan status query command to the scanning module when it receives the scan data query request. Step S3072 involves the scanning module sending a scan incomplete message to the network if it has not completed the scan operation. Step S3082 involves the network sending a scan incomplete message to the control device if it receives the scan incomplete message. Step S3053 involves the control device sending a scan data query request to the network when it receives the command. Step S3063 involves the network sending a scan status query command to the scanning module when it receives the scan data query request. Step S309 involves the scanning module sending scan data to the network if it has completed the scan operation. Step S310 involves the network sending scan data to the control device when it receives the scan data.

[0059] like Figure 3 As shown, in this related technology, while the image forming apparatus is not completing the scanning operation, the control device frequently queries the image forming apparatus for scanning progress, and the image forming apparatus responds accordingly. Frequent information exchange between the image forming apparatus and the control device maintains a persistent connection. However, this frequent information exchange increases the network load.

[0060] To address the aforementioned issues, in this embodiment, when the image forming apparatus and the control device are in a persistent connection state, the image forming apparatus executes a scanning operation corresponding to the scanning command sent by the control device. During the period before the image forming apparatus completes the scanning operation, it sends partial data from the scanning data packet to the control device to ensure information exchange between the two devices. This extends the duration of the persistent connection between the image forming apparatus and the control device to a certain extent, reducing the risk of connection timeout. Furthermore, the control device does not need to frequently query the image forming apparatus for scanning progress, reducing network load.

[0061] Specifically, the following detailed description is provided in conjunction with the accompanying drawings and specific embodiments.

[0062] See Figure 4 This is a flowchart illustrating a data transmission method provided in an embodiment of this application. This method can be applied to... Figure 1 The control device and image forming apparatus shown, such as Figure 4 As shown, it specifically includes steps S401 to S404.

[0063] Step S401: The control device sends a scanning command to the image forming apparatus.

[0064] In practical applications, when a user needs to perform a scanning operation on a document to be scanned, they can send a scanning command to the image forming apparatus through a control device or image forming apparatus. For example, the user can select the "Scan" option on the display interface of the control device or image forming apparatus. When a user sends a scanning command to the image forming apparatus through the control device, there is a higher probability of connection timeout issues between the control device and the image forming apparatus. Therefore, in this embodiment, the information interaction between the control device and the image forming apparatus is described using the example of a user sending a scanning command to the image forming apparatus through the control device.

[0065] It should be noted that, in order to enable information exchange between the control device and the image forming apparatus, a TCP connection is established between them before the control device sends a scanning command to the image forming apparatus, and information exchange is conducted using the HTTP protocol. At this time, the image forming apparatus and the control device are in a persistent connection state, and the control device can send scanning commands to the image forming apparatus through the TCP connection.

[0066] In this embodiment, the scanning instruction typically includes the scanning resolution and scanning type (e.g., color, grayscale, and black and white) set by the user for the document to be scanned. Of course, the scanning instruction may also include other information such as the scanning range and the number of copies to be scanned, which will not be elaborated upon here.

[0067] Step S402: The image forming apparatus executes a scanning operation corresponding to the scanning command sent by the control device.

[0068] It is understandable that when the image forming apparatus receives a scanning command sent by the control device, it parses the information in the scanning command and performs a scanning operation on the document to be scanned according to the information in the scanning command.

[0069] Step S403: Before the scanning operation is completed, the image forming apparatus sends the data in the generated partial scan data message to the control device.

[0070] As mentioned above, when the image forming apparatus and the control device exchange information using the HTTP protocol, the sent information can be encapsulated into HTTP messages according to the HTTP protocol. In practical applications, before the scanning operation is completed (i.e., during the scanning operation performed by the image forming apparatus), the image forming apparatus can send arbitrary HTTP messages to the control device, maintaining a persistent connection between the two. However, when the control device parses the received HTTP messages, if it finds that the parsed information is unrelated to the information in the scanning command, the control device may report an error. Therefore, before the scanning operation is completed, the image forming apparatus can send the data from the scan data message corresponding to the scanning command to the control device. A complete scan data message typically includes a header and a body; the header transmits header data, and the body transmits the scanned data.

[0071] It should be noted that because the image forming apparatus continuously performs scanning operations on the document to be scanned, it cannot obtain all scan data packets until the scanning operation is completed. To maintain a persistent connection between the image forming apparatus and the control device, data from the partially generated scan data packets can be sent to the control device.

[0072] It is understood that some scan data packets may include header data and / or some scan data that has been scanned during the scan operation.

[0073] See Figure 5 This is a schematic diagram of a partial scan data packet provided in an embodiment of this application. Figure 5 As shown in (a), some scan data packets only include header data; as Figure 5 As shown in (b), some scan data packets only include the scan data already obtained during the scan operation; such as Figure 5 As shown in (c), a partial scan data message includes header data and partial scan data obtained during the scan operation.

[0074] In practical applications, the scanning resolution affects the time required for the image forming apparatus to complete the scanning operation. It is understood that, given the same document to be scanned, a higher scanning resolution results in a longer time for the image forming apparatus to complete the scanning operation. In other words, a higher scanning resolution may increase the probability of a break in the long-term connection between the image forming apparatus and the control device. Therefore, in this embodiment, the probability of a break in the long-term connection between the image forming apparatus and the control device can be determined based on the scanning resolution, thereby further determining the data sent by the image forming apparatus to the control device.

[0075] See Figure 6 This is a flowchart illustrating another data transmission method provided in an embodiment of this application. Figure 6 As shown, the embodiments of this application are in Figure 4 Based on the illustrated embodiment, step S403 specifically includes step S4031, and step S404 specifically includes step S4041.

[0076] Step S4031: If the scan resolution set by the user is not greater than the preset scan resolution threshold, then before the scan operation is completed, send the complete header data of the generated partial scan data message to the control device.

[0077] As described above, the scanning command sent by the control device to the user includes the scanning resolution set by the user for performing the scanning operation on the document to be scanned. In this embodiment, after the image forming apparatus receives the scanning command, it can obtain the scanning resolution set by the user from the scanning command.

[0078] 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 lower the probability of the long connection between the image forming apparatus and the control device being broken. However, connection timeouts may still occur.

[0079] In this embodiment, a scanning resolution threshold (hereinafter also referred to as the "first scanning resolution threshold") 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 a connection timeout may still occur. In this case, data from a partially generated scan data packet can be sent to the control device.

[0080] Understandably, when the scanning resolution set by the user is not greater than the first scanning resolution threshold, the image forming apparatus and the control device exchange information once, which to some extent prolongs the time that the image forming apparatus and the control device maintain a long connection state and reduces the risk of connection timeout.

[0081] In practical applications, the generation of header data and scan data are independent of each other. Typically, header data includes information such as the image forming apparatus's response status to scanning commands and the type of scan data. Therefore, in this embodiment, when the user-set scan resolution is not greater than a first scan resolution threshold, complete header data can be sent to the control device, which helps the control device to correctly parse the scan data.

[0082] 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 this application do not impose specific limitations on this.

[0083] Step S4041: After completing the scanning operation, send the complete scan data obtained from the generated full scan data message to the control device.

[0084] Understandably, the complete header data of the scan data packet has already been sent to the control device before the scan operation is completed. In order for the control device to obtain all the generated scan data packets, the complete scan data, excluding the complete header data, also needs to be sent to the control device after the scan operation is completed.

[0085] In this embodiment, when the time required for the image forming apparatus to complete the scanning operation is short, sending a complete header data to the control device can reduce the amount of data processing and save performance overhead while maintaining a long connection between the image forming apparatus and the control device.

[0086] However, if the image forming apparatus takes a long time to complete the scanning operation, there is still a risk that the long-term connection may be broken if only one header data is sent to the control device, resulting in the inability to transmit scan data. For example, after the image forming apparatus sends one header data to the control device, if the duration of no information exchange between the image forming apparatus and the control device from the moment the header data is sent is greater than or equal to the duration set by the timeout mechanism, the long-term connection between the image forming apparatus and the control device will be broken, resulting in the inability to transmit scan data.

[0087] See Figure 7 This is a flowchart illustrating another data transmission method provided in an embodiment of this application. Figure 7 As shown, the embodiments of this application are in Figure 4 Based on the illustrated embodiment, step S403 specifically includes step S4032.

[0088] Step S4032: If the scan resolution set by the user is greater than the preset scan resolution threshold, then before the scan operation is completed, the data in the generated partial scan data message is sent to the control device at preset time intervals.

[0089] It is understandable that when the scan resolution set by the user is greater than the first scan resolution threshold, the time required for the image forming apparatus to complete the scan operation is considered to be longer. In order to maintain a long-term connection between the image forming apparatus and the control device, data from the generated partial scan data packets can be sent to the control device multiple times.

[0090] However, when identical data exists in any two transmitted data sets, the image forming apparatus and control device may need to process that data multiple times, increasing the amount of data processing and thus increasing performance overhead. Therefore, in one possible implementation, the data transmitted in any two transmissions should not overlap. It is understood that the data in the generated partial scan data packet is only sent to the control device once.

[0091] In practical applications, partial scan data from a generated partial scan data message can be sent to the control device multiple times. Similarly, partial data from the header data can be sent to the control device multiple times. Specifically, the header data is divided into multiple sub-data; one or more sub-data from the header data are sent to the control device at preset intervals.

[0092] See Figure 8 This is a schematic diagram of header data provided in an embodiment of this application. Figure 8 As shown, the header data is divided into three sub-data points: sub-data A, sub-data B, and sub-data C, with no overlap between any two sub-data points. Of course, the header data can also be divided into other numbers of sub-data points, such as two, four, or five, etc., and this embodiment does not impose any limitations on this.

[0093] The header data includes multiple key-value pairs, each describing specific information, and each key-value pair is separated by a blank line. Separation.

[0094] See Figure 9 This is a schematic diagram of another header data provided in an embodiment of this application. Figure 9 As 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}, with a blank line following each key-value pair. It should be noted that the header data shown in the embodiments of this application is only an exemplary illustration. In practical applications, the header data may also include other numbers of key-value pairs, such as two, three, or five, etc., and the embodiments of this application do not limit this.

[0095] In practical applications, the information in the header data is stored as key-value pairs. If the header data is divided into multiple sub-data according to an arbitrary segmentation method (e.g., a preset byte length), the control device may fail to correctly identify the information corresponding to the key-value pairs when parsing and assembling the received sub-data, potentially leading to errors. Preferably, the header data can be divided into multiple sub-data based on blank line markers. Each sub-data is one or more key-value pairs within the header data.

[0096] In this embodiment, the sub-data sent to the control device consists of one or more complete key-value pairs, which helps the control device to correctly identify the information corresponding to the key-value pairs and reduces the risk of errors to a certain extent.

[0097] As described above, after dividing the header data into multiple sub-data, one or a portion of the header data can be sent to the control device at preset time intervals. The start time of the preset time interval is the moment when information exchange between the image forming apparatus and the control device ceases. This can be understood as the moment when information exchange ceases is the moment when the image forming apparatus and the control device send the last HTTP message.

[0098] In this embodiment, since the scanning progress of the image forming apparatus is not fixed, the estimated time to complete scanning of the document can be predicted periodically based on the scanning progress and content of the document. Then, based on each predicted estimated time, the number of sub-data points in the header data sent to the control device at preset time intervals is dynamically determined. Finally, a predetermined number of sub-data points in the header data can be sent to the control device at preset time intervals. The predetermined number can be one or more. Generally, the longer the estimated time, the fewer sub-data points in the header data are sent to the control device; the shorter the estimated time, the more sub-data points in the header data are sent to the control device. That is, during the scanning operation performed by the image forming apparatus, initially one sub-data point in the header data can be sent to the control device at preset time intervals, and towards the end of the scanning process, a portion of the sub-data points in the header data can be sent to the control device at preset time intervals.

[0099] For example, if the image forming apparatus sends an HTTP message A to the control device, and if HTTP message A is the last HTTP message sent between the image forming apparatus and the control device, then the moment when the information exchange between the two ends is the moment when the image forming apparatus sends HTTP message A to the control device; if the control device sends an HTTP message B to the image forming apparatus, and if HTTP message B is the last HTTP message sent between the image forming apparatus and the control device, then the moment when the information exchange between the two ends is the moment when the control device sends HTTP message B to the image forming apparatus.

[0100] See Figure 10 This is a schematic diagram illustrating data transmission according to an embodiment of this application. Figure 10 As shown, the moment when information interaction between the image forming apparatus and the control device ceases is time t1. Starting from time t1, after a preset interval, the image forming apparatus sends sub-data A to the control device at time t2. At this time, the moment when information interaction between the image forming apparatus and the control device ceases is time t2. Starting from time t2, after a preset interval, the image forming apparatus sends sub-data B to the control device at time t3. At this time, the moment when information interaction between the image forming apparatus and the control device ceases is time t3. Starting from time t3, after a preset interval, the image forming apparatus sends sub-data C to the control device at time t4. At this time, the moment when information interaction between the image forming apparatus and the control device ceases is time t4. Furthermore, the interval duration is a preset value, which can be 10 seconds, 20 seconds, 30 seconds, 1 minute, 3 minutes, and 5 minutes, etc. Of course, those skilled in the art can set other interval durations according to actual needs, and this embodiment does not impose specific limitations on this.

[0101] However, when the interval is longer than or equal to the timeout mechanism setting, the long connection between the image forming apparatus and the control device will be broken, and at this time, the two cannot exchange information.

[0102] In one possible implementation, the interval is shorter than the timeout mechanism setting. It is understood that sending sub-data to the control device before the long-term connection between the image forming apparatus and the control device is broken can reduce the risk of connection timeout.

[0103] In this embodiment, when the time required for the image forming apparatus to complete the scanning operation is long, sending partial data from the header data to the control device multiple times can maintain a long connection between the image forming apparatus and the control device for an extended period, reducing the risk of connection timeout.

[0104] In one possible implementation, if the user-set scan resolution is not greater than a preset second scan resolution threshold, then after completing the scan operation, all scan data packets are sent to the control device. The second scan resolution threshold is less than the first scan resolution threshold.

[0105] It is understandable that when the user-set scan resolution is less than the second scan resolution threshold, the time required for the image forming apparatus to complete the scan operation can be considered less than the timeout period set by the timeout mechanism. Therefore, there is no risk of disconnection in the long-term connection between the image forming apparatus and the control device. In this case, after the image forming apparatus completes the scan operation, the complete header data and scan data can be sent to the control device simultaneously.

[0106] It should be noted that the second scan resolution threshold can be 100 dpi, 300 dpi, 600 dpi, etc. Those skilled in the art can set other second scan resolution thresholds according to actual needs, and this application embodiment does not impose specific limitations in this regard.

[0107] In this embodiment, when the time required for the image forming apparatus to complete the scanning operation is less than the timeout period set by the timeout mechanism, it is not necessary to send part of the data in the scan data packet to the control device first, thus reducing the network load. Furthermore, no additional data processing is required for the scan data packet, which reduces the amount of data processing and saves performance overhead to some extent.

[0108] Step S404: After completing the scanning operation, the image forming apparatus sends the data that was not sent to the control device from all the generated scan data messages to the control device.

[0109] Understandably, during the scanning process, the image forming apparatus has already sent some data from the scan data message to the control device. In order for the control device to obtain the complete scan data message, after the scanning operation is completed, it is also necessary to send the data from the scan data message that was not sent to the control device.

[0110] For example, if the complete header data has been sent to the control device before the scanning operation is completed, the complete scan data also needs to be sent to the control device after the scanning operation is completed; if part of the header data has been sent to the control device before the scanning operation is completed, the remaining data (excluding the partial data) and the complete scan data also need to be sent to the control device after the scanning operation is completed.

[0111] In this embodiment, when the image forming apparatus and the control device are in a persistent connection state, the image forming apparatus executes a scanning operation corresponding to the scanning command sent by the control device. During the scanning process, before the image forming apparatus completes the scanning operation, it sends partial data from the scanning data packet to the control device to ensure information exchange between the two devices. This extends the duration of the persistent connection between the image forming apparatus and the control device to some extent, reducing the risk of connection timeout. Furthermore, the control device does not need to frequently query the image forming apparatus for scanning progress, reducing network load.

[0112] In practical applications, the functions of information interaction between the image forming apparatus and the control device, and the functions of performing scanning operations, can be integrated into two separate structures within the image forming apparatus. These two structures cooperate with each other while maintaining logical separation, resulting in clear functional positioning and simple logic within the image forming apparatus. In one possible implementation, the image forming apparatus includes a network terminal and a scanning module, which are connected for communication. The network terminal and the control device exchange information using HTTP and TCP protocols; the scanning module performs the scanning operations.

[0113] It should be noted that communication between the network terminal and the scanning module can be established in various ways, such as wired connection, wireless connection, network protocol connection, etc. Those skilled in the art can configure the communication method between the network terminal and the scanning module according to actual needs, and this application embodiment does not impose specific limitations in this regard.

[0114] See Figure 11 This is a flowchart illustrating another data transmission method provided in an embodiment of this application. Figure 11 As shown, the embodiments of this application are in Figure 4 Based on the illustrated embodiment, 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, and in addition to the above steps, other steps are also included, which will be described in detail below.

[0115] Step S501: The control device sends a scanning command to the network end.

[0116] In this embodiment, when a user wishes to perform a scanning operation on a document to be scanned using an image forming apparatus to obtain scanned data, a scanning command can be sent to the network via a control device. It should be noted that the control device and the network are in a persistent connection state before the scanning command is sent to the network. Specific details involved in this implementation can be found in the description of step S401 in the above embodiments; for the sake of brevity, these details will not be repeated here.

[0117] Step S502: The network end sends a start scanning command to the scanning module.

[0118] Understandably, after the network receives the scanning command sent by the control device, it needs to send a start scanning command to the scanning module so that the scanning module can perform the scanning operation on the file to be scanned.

[0119] Step S503: The scanning module executes the scanning operation corresponding to the start scanning command sent by the network.

[0120] It is understood that the start scan command typically includes the scan resolution and scan type (e.g., color, grayscale, and black and white) set by the user for the file to be scanned. Of course, the start scan command may also include other information, which will not be elaborated here in this embodiment.

[0121] In this embodiment of the application, after the scanning module receives the start scanning command sent by the network, it can perform the corresponding scanning operation according to the information in the start scanning command.

[0122] Step S504: The scanning module sends a scan creation success message to the network.

[0123] Understandably, when the scanning module is ready to perform the scanning operation according to the start scanning command, it can send a scan creation success message to the network. Furthermore, the network can send a creation success message to the control device, allowing the control device to receive information that the task of performing the scanning operation on the file to be scanned has been successfully created.

[0124] Step S505: The network device sends a creation success message to the control device.

[0125] In this embodiment of the application, after the network end receives the scan creation success information sent by the scanning module, it can send the creation success information to the control device, thereby enabling the user to know whether the scan command has been sent successfully and whether the scan operation can be performed, thus improving the user experience.

[0126] Step S506: The control device sends a query scan data request to the network.

[0127] In this embodiment of the application, after the control device receives the creation success information sent by the network terminal, it can send a scan data request to the network terminal, so that the network terminal sends scan data.

[0128] Step S5071: The network end sends a query scan status command to the scanning module.

[0129] As is understandable, the scanning module performs a scanning operation on the file to be scanned; therefore, the scanning module can detect whether the scanning operation is complete. When it is necessary to obtain the scan status, the network end can send a query scan status command to the scanning module to query the scan status.

[0130] Step S5081: The scanning module sends a scan incomplete message to the network.

[0131] In this embodiment, after the scanning module receives a query scan status command sent by the network, it checks whether the scanning operation has been completed. If the scanning operation has not been completed, it sends a scan incomplete message to the network; if the scanning operation has been completed, it sends scan data to the network.

[0132] Step S5091: Before the scanning operation is completed, the network end sends sub-data from the header data to the control device at preset intervals.

[0133] As mentioned above, the long-term connection between the network and the control device may be interrupted before the scanning operation is completed, resulting in a connection timeout and thus preventing the transmission of scan data. In this embodiment, when the network receives a scan incomplete message from the scanning module, the network sends sub-data from the header data to the control device at preset intervals, which to some extent prolongs the time during which the long-term connection between the network and the control device is maintained.

[0134] For details regarding the implementation of this application, please refer to the description of step S403 in the above embodiments. For the sake of brevity, these details will not be repeated here.

[0135] In the embodiments of this application, steps S5071, S5081 and S5091 can be repeatedly executed. For ease of understanding, the repeatedly executed steps are referred to as steps S5072, S5082 and S5092. The specific content involved can be found in the description of steps S5071, S5081 and S5091, and will not be repeated here.

[0136] Step S5073: The network end sends a query scan status command to the scanning module.

[0137] For details regarding the implementation of this application, please refer to the description in step S5071 above. For the sake of brevity, these details will not be repeated here.

[0138] Step S510: The scanning module sends the scanning data to the network.

[0139] As mentioned above, after the scanning module receives the query scan status command sent by the network, it can detect whether the scanning operation has been completed. If the scanning operation is detected as complete, it sends the scan data to the network.

[0140] Step S511: After completing the scanning operation, the network end sends the data that was not sent to the control device from all the generated scan data packets to the control device.

[0141] In this embodiment, during the scanning process, the network has already sent part of the header data to the control device. To ensure the control device receives the complete scan data packet, after the scanning operation is completed, it is also necessary to send the data not previously sent to the control device from the scan data packet. Specific details involved in this implementation can be found in the description of step S404 in the above embodiment; for brevity, these details will not be repeated here.

[0142] In this embodiment of the application, sending partial data from the header data to the control device multiple times during the scanning process can maintain a long-term connection between the image forming apparatus and the control device, reducing the risk of connection timeout.

[0143] Corresponding to the above embodiments, this application also provides a data transmission device.

[0144] See Figure 12 This is a schematic diagram of the structure of a data transmission device provided in an embodiment of this application. Figure 12 As shown, the data transmission device 600 is applied to the image forming apparatus, which is in a state of continuous connection with the control device. The data transmission device 600 includes a scan execution module 601 and a data transmission module 602. Specifically, the scan execution module 601 is used to execute a scan operation corresponding to a scan command sent by the control device; the data transmission module 602 is used to send data from a portion of the generated scan data packets to the control device before the scan operation is completed; and to send data from all generated scan data packets that were not sent to the control device after the scan operation is completed.

[0145] For details regarding the specific content involved in the embodiments of this application, please refer to the description of the above method embodiments. For the sake of brevity, these details will not be repeated here.

[0146] Corresponding to the above embodiments, this application also provides an image forming system.

[0147] See Figure 13 This is a schematic diagram of the structure of an image forming system provided in an embodiment of this application. Figure 13 As shown, the image forming system 700 includes a control device 701 and an image forming apparatus 702. The control device 701 is communicatively connected to the image forming apparatus 702. The image forming apparatus 702 is configured to perform the method embodiments described above; for the sake of brevity, further details are omitted.

[0148] Corresponding to the above embodiments, this application also provides a computer-readable storage medium, wherein the computer-readable storage medium may store a program, wherein 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 specific implementation, the computer-readable storage medium may be a magnetic disk, an optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0149] Corresponding to the above embodiments, this application also provides a computer program product containing executable instructions that, when executed on a computer, cause the computer to perform some or all of the steps in the above method embodiments.

[0150] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, the simultaneous existence of A and B, or the existence of B alone. A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects have an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, and c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0151] Those skilled in the art will recognize that the units and algorithm steps described in the embodiments disclosed herein can be implemented using electronic hardware, computer software, or a combination of electronic hardware and software. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0152] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0153] In the several embodiments provided in this application, any function, if implemented as a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the 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 to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0154] The above description is merely a specific embodiment of this application. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the protection scope of this application. The protection scope of this application should be determined by the protection scope of the claims.

Claims

1. A data transmission method, characterized by, The method is applied to an image forming device in a long connection state with a control device, and comprises the following steps: According to a scan instruction sent by the control device, a scan operation corresponding to the scan instruction is performed; Before the scan operation is completed, data in a generated partial scan data message is sent to the control device; After the scan operation is completed, data not sent to the control device in a generated complete scan data message is sent to the control device; The step of sending the data in the generated partial scan data message to the control device before the scan operation is completed comprises the following steps: If a scan resolution set by a user is not greater than a preset scan resolution threshold, complete header data in the generated partial scan data message is sent to the control device before the scan operation is completed; 2. The method of claim 1, wherein, The step of sending the data not sent to the control device in the generated complete scan data message to the control device after the scan operation is completed comprises the following step:

3. The method of claim 1, wherein, After the scan operation is completed, complete scan data obtained by scanning is sent to the control device. The data in the generated partial scan data message comprises header data and / or partial scan data obtained by scanning in the scan operation.

4. The method of claim 3, wherein, The step of sending the data in the generated partial scan data message to the control device before the scan operation is completed comprises the following steps: If the scan resolution set by the user is greater than the preset scan resolution threshold, the data in the generated partial scan data message is sent to the control device every preset time interval before the scan operation is completed, and any two pieces of data sent at different times do not have an intersection. The partial scan data message comprises header data, and the step of sending the data in the generated partial scan data message to the control device every preset time interval comprises the following steps:

5. The method of claim 4, wherein, The header data is divided 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 every preset time interval.

6. A data transmission apparatus characterized by comprising: The step of dividing the header data into a plurality of sub-data comprises the following step: The header data is divided into a plurality of sub-data according to a blank line flag, and the sub-data is one or more key-value pairs in the header data. The method is applied to an image forming device in a long connection state with a control device, and comprises the following steps: According to a scan instruction sent by the control device, a scan operation corresponding to the scan instruction is performed; Before the scan operation is completed, data in a generated partial scan data message is sent to the control device; and after the scan operation is completed, data not sent to the control device in a generated complete scan data message is sent to the control device. The sending of the data in the generated partial scan data packet to the control device before the scan operation is completed comprises: if the scan resolution set by the user is not greater than a preset scan resolution threshold, sending complete header data in the generated partial scan data packet to the control device before the scan operation is completed. The sending of the data in the generated complete scan data packet to the control device after the scan operation is completed comprises: sending complete scan data scanned in the generated complete scan data packet to the control device after the scan operation is completed.

7. An image forming system characterized by comprising: The method comprises: a control device; an image forming apparatus that executes the method according to any one of claims 1 to 5; wherein the control device is communicatively connected to the image forming apparatus.

8. 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 the processor, the method according to any one of claims 1 to 5 is implemented.

9. A computer program product, characterised in that, The computer program, when executed by the processor, implements the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Scanner apparatus, method for controlling scanner apparatus and multifuntion apparatus

    US20050134941A1