Parallel port communication method of printer, printer and storage medium thereof

By implementing printer parallel communication through a hardware-based parallel port controller, the problems of high resource consumption and unstable timing in traditional methods are solved, achieving efficient and reliable bidirectional data transmission and system resource optimization.

CN121832865APending Publication Date: 2026-04-10JIANGMEN DASCOM COMP PERIPHERAL
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511693869.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-18
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Traditional printer parallel port communication methods rely on microcontroller units (MCUs) to handle interaction with the host in a purely software manner, resulting in high resource consumption, unstable timing, difficulty in adapting to different host hardware configurations, and easy to cause communication timeouts or errors in high-speed communication scenarios.

Method used

It adopts a hardware-based parallel port controller, realizes bidirectional communication through control interface and status interface, and uses hardware logic to complete handshake response, command parsing and mode switching, reducing the real-time signal processing burden of MCU, and efficiently transmits data through forward and reverse modes.

Benefits of technology

The system resources have been significantly optimized, the accuracy and stability of communication timing have been improved, the compatibility and operational stability of the printing system have been enhanced, and high-speed and reliable bidirectional data transmission has been ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121832865A_ABST
    Figure CN121832865A_ABST
Patent Text Reader

Abstract

The invention provides a parallel port communication method of a printer, the printer and a storage medium thereof, and the method comprises the steps: determining the enabling setting of a feedback signal through responding to the feedback signal sent by a host and received from a control interface; when the enabling setting is represented as effective enabling and the data transmission of the state interface is controlled to be in a forward mode, sending a response signal to the host so as to notify the host to transmit a command word signal; in response to the command word signal received from the control interface, determining support setting of the command word signal in the printing processor according to the type of the command word signal; when the support setting is represented as support, data transmission of the state interface is controlled to be in a reverse mode, and a first acquisition signal is sent to the printing processor to acquire a feedback parameter corresponding to the printing processor; and when the feedback parameter is received, the feedback parameter is sent to the host through the state interface, so that bidirectional communication is realized based on the hardware-based parallel port controller, and the stability of a communication time sequence is improved while processing resources are saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of printer communication, and more particularly to a parallel port communication method for a printer, a printer and its storage medium. Background Technology

[0002] Traditional printer parallel port communication methods typically rely on a microcontroller unit (MCU) to handle interaction with the host in a purely software-based manner. Specifically, the MCU needs to continuously monitor signals from the host, and upon recognizing a handshake request, respond by controlling the level of the status lines through programming. This software implementation has significant inherent drawbacks: First, each complete handshake and data transmission process requires deep involvement from the MCU, including signal detection, timing matching, and response generation. This undoubtedly consumes a significant amount of its valuable processing resources, potentially leading to performance bottlenecks when handling concurrent printing tasks. Second, due to unavoidable interruptions and delays in software instruction execution, the consistency and accuracy of response timing are poor, resulting in large fluctuations. In demanding or high-speed communication scenarios, this can easily lead to communication timeouts or errors.

[0003] Furthermore, some older computer mainframes have limitations in their hardware design, lacking the hardware circuitry to receive and return data via the standard eight data lines. This renders the traditional mechanism of status feedback using the forward data channel ineffective. Therefore, a parallel port communication solution is needed that can overcome the aforementioned problems of unstable timing and high resource consumption in software implementations and can adapt to different host hardware configurations. Summary of the Invention

[0004] The purpose of this application is to at least solve one of the technical problems existing in the prior art, and to provide a parallel port communication method for a printer, a printer and its storage medium, which realizes bidirectional communication through a hardware-based parallel port controller, thereby saving printer processor resources and significantly improving the accuracy and stability of communication timing.

[0005] To achieve the above objectives, a first aspect of this application provides a parallel port communication method for a printer, applied to a parallel port controller. The parallel port controller includes a control interface for receiving signals sent by a host and a status interface for sending signals to the host. The parallel port controller is communicatively connected to the printer's print processor. The method includes: In response to receiving a feedback signal from the host in the control interface, determine if the feedback signal is in the print processor's enable setting; When the enable setting is enabled, and the data transmission of the control state interface is in positive mode, a response signal corresponding to the feedback signal is sent to the host to notify the host to transmit the command word signal for executing the printing task. In positive mode, a single bit is transmitted as a semaphore. In response to receiving a command word signal from the control interface, determine the supported settings of the command word signal in the print processor based on the type of the command word signal; When the support setting is enabled, the data transmission of the control state interface is in reverse mode, and a first acquisition signal is sent to the print processor to obtain the feedback parameters generated by the print processor in executing the print task. In reverse mode, multiple bits are combined as data for transmission. When feedback parameters are received, they are sent to the host through the status interface.

[0006] Furthermore, in some embodiments, when feedback parameters are received, the feedback parameters are sent to the host through the status interface, including: When receiving feedback parameters, determine whether the feedback parameters are empty data; If the feedback parameters are not empty data, the feedback parameters are sent to the host within the status interface based on the reverse mode. The feedback parameters include the status parameters and setting parameters of the print processor.

[0007] Furthermore, in some embodiments, when feedback parameters are received, sending the feedback parameters to the host based on the reverse mode further includes: When the received feedback parameter is empty, the peripheral identifier corresponding to the peripheral controlled by the print processor to execute the print task is determined according to the print task. Based on the peripheral identifier, a second acquisition signal is sent to the print processor to obtain the peripheral operating parameters of the peripheral; When receiving peripheral operating parameters, determine whether the peripheral operating parameters are empty data; If the peripheral operating parameters are not empty data, the peripheral operating parameters are used as feedback parameters, and based on the reverse mode, the feedback parameters are sent to the host in the status interface.

[0008] Furthermore, in some embodiments, when feedback parameters are received, sending the feedback parameters to the host based on the reverse mode further includes: If the peripheral device's operating parameters are empty, a notification flag indicating that the data transmission is complete is generated. The notification flag is used as a feedback parameter, and based on the reverse mode, the feedback parameter is sent to the host within the status interface.

[0009] Furthermore, in some embodiments, after using the notification identifier as a feedback parameter and sending the feedback parameter to the host within the state interface based on the reverse pattern, the above method further includes: In response to receiving a feedback exit signal from the host in the control interface, the data transmission of the control status interface changes from reverse mode to forward mode; The feedback exit signal indicates that the host requests an interrupt to obtain feedback parameters.

[0010] Furthermore, in some embodiments, the above method further includes: When the enable setting is characterized as invalid enable, based on the positive mode, the first invalid signal is sent to the host within the status interface; The first invalid signal indicates that the printer processor does not support the communication handshake protocol for feedback signals.

[0011] Furthermore, in some embodiments, the above method further includes: When the support setting is indicated as not supported, a second invalid signal is sent to the host within the status interface based on the positive mode. The second invalid signal indicates that the print processor does not support executing the print task according to the command word signal byte.

[0012] Furthermore, in some embodiments, the parallel port controller also includes a data interface for receiving data sent by the host, and the method further includes, prior to receiving a feedback signal from the host from the control interface: The system receives print control signals from the host computer via the control interface and print parameters from the host computer via the data interface. The print control signals and print parameters are sent to the print controller, and the corresponding status feedback signals of the print controller are read. When the data transmission of the control status interface is in positive mode, it sends a status feedback signal to the host.

[0013] To achieve the above objectives, a second aspect of this application provides a printer, comprising: Printer processor; The parallel port controller communicates with the print processor and includes a control interface for receiving signals sent by the host and a status interface for sending signals to the host. The parallel port controller is used to respond to feedback signals received from the host via the control interface and to determine the enable setting of the feedback signal in the print processor. The parallel port controller is also used to send a response signal corresponding to the feedback signal to the host when the enable setting is enabled and the data transmission of the control state interface is in positive mode, so as to notify the host to transmit the command word signal for executing the printing task. In positive mode, a single bit is transmitted as a semaphore. The parallel port controller is also used to, in response to receiving a command word signal from the control interface, determine the supported settings of the command word signal in the print processor based on the type of the command word signal; The parallel port controller is also used to control the data transmission of the state interface in reverse mode when the support setting is enabled, and to send a first acquisition signal to the print processor to acquire the feedback parameters generated by the print processor in executing the print task. The reverse mode combines multiple bits as data for transmission. The parallel port controller is also used to send feedback parameters to the host via the status interface when feedback parameters are received.

[0014] To achieve the above objectives, a third aspect of the present application provides a storage medium, which is a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the parallel port communication method of the printer described in the first aspect embodiment.

[0015] According to an embodiment of this application, a parallel port communication method for a printer, a printer, and a storage medium thereof have at least the following beneficial effects: By reconstructing the communication process using a hardware-based parallel port controller, firstly, system resources and performance can be significantly optimized. By entrusting key processes in the communication protocol, such as handshake response, command parsing, and mode switching, to a dedicated parallel port controller to complete them with hardware logic, the printer processor (MCU) is completely freed from heavy real-time signal processing and bit manipulation tasks. The MCU only needs to respond to the controller's requests in non-real-time tasks, such as providing enable settings, support settings, and feedback parameters, thereby greatly reducing its load and improving the system's response and processing capabilities for core printing tasks. Secondly, it can also ensure the accuracy and stability of communication timing. By using a hardware controller to handle signal responses and mode switching, the timing jitter problems caused by interrupt responses and task scheduling in pure software implementation are fundamentally eliminated, making the timing of key operations such as handshake, response, and reverse data transmission highly accurate and consistent, greatly improving the reliability and anti-interference capability of communication. Furthermore, it achieves efficient and flexible bidirectional data communication. By innovatively defining and controlling the state interface to switch between "forward mode" and "reverse mode," it realizes multi-functional multiplexing on the same set of signal lines. In forward mode, bits are used as control semaphores for rapid interaction, while in reverse mode, multiple bits are combined as data for transmission. This not only overcomes the limitation that some host hardware cannot receive data through standard data lines, but also constructs an efficient and high-speed bidirectional data channel. In addition, the method of this application also incorporates a mechanism for judging the type of command word signals and checking support settings. Unsupported instructions can be processed at the hardware level in advance to avoid invalid commands interfering with the MCU, thereby improving the compatibility and operational stability of the entire printing system.

[0016] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the description and the accompanying drawings. Attached Figure Description

[0017] The accompanying drawings are used to provide a further understanding of the technical solutions of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the technical solutions of this application and do not constitute a limitation on the technical solutions of this application.

[0018] The present application will be further described below with reference to the accompanying drawings and embodiments; Figure 1 This is a schematic diagram of an optional parallel port communication method for a printer provided in an embodiment of this application; Figure 2 This is a schematic diagram of an optional electrical signal for the state interface provided in this application to start transmitting data in reverse mode; Figure 3 This is a schematic diagram of an optional electrical signal for the state interface provided in this application embodiment to end data transmission in reverse mode; Figure 4 This is provided by the embodiments of this application. Figure 1 An optional schematic diagram of step S105; Figure 5 This is provided by the embodiments of this application. Figure 1 Another optional schematic diagram of step S105; Figure 6 This is another optional schematic diagram of the parallel port communication method for the printer provided in the embodiments of this application; Figure 7 This is another optional schematic diagram of the parallel port communication method for the printer provided in the embodiments of this application; Figure 8 This is provided by the embodiments of this application. Figure 1 An optional schematic diagram prior to step S101; Figure 9 This is an optional schematic diagram of the printer provided in an embodiment of this application; Figure 10 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0019] This section will describe in detail the specific embodiments of this application. Preferred embodiments of this application are shown in the accompanying drawings. The purpose of the drawings is to supplement the textual description with graphics, so that people can intuitively and vividly understand each technical feature and the overall technical solution of this application, but they should not be construed as limiting the scope of protection of this application.

[0020] In the description of this application, the use of "first" and "second" is for the purpose of distinguishing technical features only and should not be construed as indicating or implying relative importance or implicitly indicating the number of indicated technical features or the order of the indicated technical features. It should be understood that such use of data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0021] In the description of this application, unless otherwise expressly defined, terms such as "setup," "installation," and "connection" should be interpreted broadly, and those skilled in the art can reasonably determine the specific meaning of the above terms in this application in conjunction with the specific content of the technical solution.

[0022] Traditional printer parallel port communication methods typically rely on a microcontroller unit (MCU) to handle interaction with the host in a purely software-based manner. Specifically, the MCU needs to continuously monitor signals from the host, and upon recognizing a handshake request, respond by controlling the level of the status lines through programming. This software implementation has significant inherent drawbacks: First, each complete handshake and data transmission process requires deep involvement from the MCU, including signal detection, timing matching, and response generation. This undoubtedly consumes a significant amount of its valuable processing resources, potentially leading to performance bottlenecks when handling concurrent printing tasks. Second, due to unavoidable interruptions and delays in software instruction execution, the consistency and accuracy of response timing are poor, resulting in large fluctuations. In demanding or high-speed communication scenarios, this can easily lead to communication timeouts or errors.

[0023] Furthermore, some older computer mainframes have limitations in their hardware design, lacking the hardware circuitry to receive and return data via the standard eight data lines. This renders the traditional mechanism of status feedback using the forward data channel ineffective. Therefore, a parallel port communication solution is needed that can overcome the aforementioned problems of unstable timing and high resource consumption in software implementations and can adapt to different host hardware configurations.

[0024] Based on this, embodiments of this application provide a parallel port communication method for a printer, a printer and its storage medium, which realizes bidirectional communication through a hardware-based parallel port controller, saving printer processor resources while significantly improving the accuracy and stability of communication timing.

[0025] Therefore, the embodiments of this application will be further described below with reference to the accompanying drawings.

[0026] Reference Figure 1 As shown, Figure 1 This is an optional schematic diagram of a parallel port communication method for a printer provided in an embodiment of this application. The parallel port communication method is applied to a parallel port controller, which includes a control interface for receiving signals sent by a host and a status interface for sending signals to the host. The parallel port controller is communicatively connected to the printer's print processor. The method may include, but is not limited to, steps S101 to S103.

[0027] Step S101: In response to receiving a feedback signal from the host in the control interface, determine that the feedback signal is in the enable setting of the print processor.

[0028] The feedback signal is used by the host to request feedback parameters from the print processor during the execution of the print task.

[0029] Specifically, when the parallel port controller detects a specific "feedback signal" initiated by the host through its control interface (such a signal, in the IEEE 1284 standard protocol, could correspond to an initialization or strobe control signal driven by the host, like nInit or nStrobe), it indicates that the host is attempting to initiate a communication session or handshake process. At this point, the parallel port controller does not respond unconditionally immediately, but first acts as an intelligent intermediary, querying or accessing a pre-configured "enable setting" from the print processor (i.e., the MCU). This "enable setting" is a crucial software-configurable parameter that characterizes whether the current overall state of the printing system allows for responding to such host requests—for example, the print processor might be busy processing a previous print job, or need to pause communication with the host due to an error state, in which case the enable setting would be set to "invalid." Only when the parallel port controller confirms that the enable setting is "validally enabled" does it receive "permission" from the print processor, thus triggering subsequent hardware response actions. This mechanism frees the printer processor from the burden of real-time signal response, allowing macroscopic control of communication start and stop simply by setting a flag bit, thus achieving an effective combination of automatic hardware processing and global processor management.

[0030] Step S102: When the enable setting is enabled and the data transmission of the control state interface is in positive mode, send a response signal corresponding to the feedback signal to the host to notify the host to transmit the command word signal for executing the printing task.

[0031] In the forward mode, a single bit is transmitted as a semaphore.

[0032] In the hardware handshake protocol, once the parallel port controller confirms that the enable setting from the print processor is valid, its internal hardware state machine is triggered. First, the parallel port controller ensures its state interface is configured in "positive mode," where each signal line of the state interface (such as nAck, Busy, etc.) is used as an independent semaphore to transmit a single logical state. Next, the parallel port controller drives specific signal lines on the state interface to generate an "acknowledgment signal" that strictly corresponds to the "feedback signal" sent by the host; for example, in the IEEE 1284 communication protocol, this is typically manifested as a high-to-low level transition on the nAck (acknowledgment) signal line. This precise and timing-stable hardware acknowledgement constitutes the confirmation signal for a successful handshake. Its core purpose is to notify the host that the print controller (printer) is ready and the host can safely send the "command word signal" to execute the next printing task via the control lines. This process is entirely driven by hardware logic, ensuring the immediacy and reliability of the response.

[0033] It should be noted that the command word signal, also known as the opcode or instruction code, refers to the digital signal encapsulating a specific operation instruction sent by the host to the parallel port controller after the handshake phase in the parallel port communication protocol of this application. This signal is transmitted via the control interface, and its level sequence encodes the specific printing task or control function requested by the host, such as initialization, setting the printing mode, or querying the status. Upon receiving this signal, the parallel port controller parses and decodes it, querying its supported settings in the print processor based on its type (e.g., whether it is a data printing command or a device control command) to determine the subsequent operation process. Therefore, the command word signal is the core control instruction driving the entire printing task and is the key communication medium between the host's intent and the printer's behavior.

[0034] Step S103: In response to receiving a command word signal from the control interface, determine the supported settings of the command word signal in the print processor based on the type of the command word signal.

[0035] Specifically, this step describes the core mechanism by which the parallel port controller intelligently parses and filters host commands after a successful connection establishment. When the parallel port controller receives a command word signal sent by the host after a successful handshake through the control interface, the controller's built-in hardware decoding logic immediately parses the binary sequence of the signal to identify its "type" (e.g., whether it is a data transfer command, a device control command, or a status query command). Subsequently, the controller acts as a decision-making intermediary, querying a preset "support setting." This setting, which can be pre-configured by the print processor (MCU) in the parallel port controller's registers or lookup table, explicitly defines which types of command words are supported and can be executed by the current printer firmware or hardware. This judgment process achieves preliminary command filtering at the hardware level: if the command type is identified as "supported," the subsequent data acquisition and transmission process is triggered; if it is not supported, it can be directly ignored or an error is returned at the hardware level, thereby effectively avoiding interference from invalid commands to the print processor and improving the processing efficiency of system resources.

[0036] Step S104: When the support setting is indicated as supported, the data transmission of the control state interface is in reverse mode, and a first acquisition signal is sent to the print processor to acquire the feedback parameters generated by the print processor in executing the print task.

[0037] In reverse mode, multiple bits are combined as data for transmission.

[0038] Specifically, this step describes the hardware operation sequence initiated by the parallel port controller to achieve efficient data return after confirming the command's validity. When the parallel port controller determines that the received command word signal belongs to the "supported" type (such as a status query command), its internal logic first switches the operating mode of the status interface from "forward mode" to "reverse mode." In this mode, multiple status lines that were originally independent handshake signals (such as Busy, nAck, PError, Select) in forward mode are reconfigured into a parallel data channel, where each signal line represents one bit. By combining multiple such bits (e.g., the standard four), a nibble-width data volume is constructed for transmission. After the mode switch is completed, the parallel port controller immediately sends a "first acquire signal" (usually a hardware interrupt or a specific register write operation) to the print processor, notifying it to provide the specific data requested by the host. Upon receiving this signal, the print processor does not need to participate in specific timing control; it only needs to write the "feedback parameters" (such as the current status word, error code, or sensor readings) generated during the execution of the print task into the designated buffer of the parallel port controller. The entire reverse data transmission process is autonomously managed by the parallel port controller hardware, thereby achieving high-speed and stable data return to the host while minimizing the communication burden on the printer processor.

[0039] Step S105: When feedback parameters are received, send the feedback parameters to the host through the status interface.

[0040] Specifically, this step completes the final stage of hardware-controlled reverse data transmission. Once the parallel port controller receives complete "feedback parameters" (such as printer status bytes, ink level information, or error codes) from the print processor and stores them in its internal buffer, its hardware state machine automatically initiates the transmission process in reverse mode. In this mode, multiple signal lines of the status interface (such as the standard nAck, Busy, PError, and Select lines) are used together as a 4-bit parallel data port. (See reference...) Figure 2 and Figure 3 As shown, Figure 2 This is a schematic diagram of an optional electrical signal for the state interface provided in this application to start transmitting data in reverse mode. Figure 3 This is a schematic diagram of an optional electrical signal for ending data transmission in reverse mode of the status interface provided in this application embodiment. The parallel port controller splits the feedback parameter to be sent (usually an 8-bit byte) into two nibbles and drives these nibbles onto the status line group in a time-division, cyclical manner. At the same time, the parallel port controller sends a corresponding data strobe clock to the host through a signal line in the control interface (such as HostClk) to synchronously inform the host that the data is valid. The entire transmission process, including data splitting, signal driving, and timing synchronization, is completely managed independently by the parallel port controller hardware logic. The printer processor does not need to participate after providing the parameters, thereby achieving efficient, accurate, and non-core processing resource-intensive transmission of the printer's internal status parameters back to the host.

[0041] Furthermore, in the embodiments of steps S101 to S105, by reconstructing the communication process using a hardware-based parallel port controller, firstly, system resources and performance can be significantly optimized. By entrusting key processes in the communication protocol, such as handshake response, command parsing, and mode switching, to a dedicated parallel port controller to complete them with hardware logic, the printer processor (MCU) is completely freed from heavy real-time signal processing and bit manipulation tasks. The MCU only needs to respond to the controller's requests in non-real-time tasks, such as providing enable settings, support settings, and feedback parameters, thereby greatly reducing its load and improving the system's response and processing capabilities for core printing tasks. Secondly, it can also ensure the accuracy and stability of communication timing. By using a hardware controller to handle signal responses and mode switching, the timing jitter problems caused by interrupt responses and task scheduling in pure software implementation are fundamentally eliminated, making the timing of key operations such as handshake, response, and reverse data transmission highly accurate and consistent, greatly improving the reliability and anti-interference capability of communication. Furthermore, it achieves efficient and flexible bidirectional data communication. By innovatively defining and controlling the state interface to switch between "forward mode" and "reverse mode," it realizes multi-functional multiplexing on the same set of signal lines. In forward mode, bits are used as control semaphores for rapid interaction, while in reverse mode, multiple bits are combined as data for transmission. This not only overcomes the limitation that some host hardware cannot receive data through standard data lines, but also constructs an efficient and high-speed bidirectional data channel. In addition, the method of this application also incorporates a mechanism for judging the type of command word signals and checking support settings. Unsupported instructions can be processed at the hardware level in advance to avoid invalid commands interfering with the MCU, thereby improving the compatibility and operational stability of the entire printing system.

[0042] Reference Figure 4 As shown, Figure 4 This is provided by the embodiments of this application. Figure 1 An optional schematic diagram of step S105 is provided, and the method may include, but is not limited to, steps S201 to S202.

[0043] Step S201: When receiving feedback parameters, determine whether the feedback parameters are empty data.

[0044] Step S202: If the feedback parameter is not empty data, based on the reverse mode, send the feedback parameter to the host in the status interface.

[0045] The feedback parameters include the status parameters and setting parameters of the print processor.

[0046] It should be noted that steps S201 to S202 clarify the intelligent data verification and transmission mechanism performed by the parallel port controller before reverse transmission. When the parallel port controller receives the "feedback parameter" from the print processor, its hardware logic does not immediately transmit it. Instead, it first performs a crucial data validity verification step (step S201), determining whether the feedback parameter is "empty data." This ensures that subsequent transmission is only initiated when there is valid information (such as an accurate status code, number of printed pages, or ink volume data). If the verification passes (the feedback parameter is not empty), the controller formally initiates the transmission process in "reverse mode" (step S202). In this mode, several signal lines of the status interface are combined into a parallel data channel; the controller splits the non-empty feedback parameter (such as an 8-bit byte) into two half-bytes and drives them onto the status line group in a time-division, cyclical manner, while simultaneously providing a synchronization clock to the host through the control interface. This hardware-driven "non-empty judgment-splitting-driving" process eliminates invalid communication, thereby ensuring the accuracy of data return while further optimizing communication efficiency and system resource utilization.

[0047] Reference Figure 5 As shown, Figure 5 This is provided by the embodiments of this application. Figure 1 Another optional schematic diagram of step S105, the method may include, but is not limited to, steps S301 to S305.

[0048] Step S301: When the received feedback parameter is empty data, determine the peripheral identifier corresponding to the peripheral controlled by the print processor to execute the print task according to the print task.

[0049] Step S302: Based on the peripheral identifier, send a second acquisition signal to the print processor to acquire the peripheral operating parameters of the peripheral.

[0050] It should be noted that steps S301 to S302 describe a more in-depth status information acquisition mechanism initiated by the parallel port controller when the feedback parameters are empty. Specifically, when the parallel port controller determines that the initial "feedback parameters" obtained from the print processor are empty data (e.g., the specific status queried by the host does not exist), its hardware logic does not simply terminate communication. Instead, it automatically infers the specific peripheral unit (such as the print head, paper feeder, or ink system) that needs to be monitored based on the "print task" being executed, and determines a unique "peripheral identifier" accordingly. Subsequently, the parallel port controller sends a "second acquisition signal" to the print processor (this signal is logically different from the first acquisition signal for obtaining the normal status, for example, a read command pointing to a specific peripheral register). This signal is essentially a precise request, instructing the print processor to provide the "peripheral operating parameters" (e.g., the real-time temperature of the print head, the precise ink level of the ink cartridge, or the stepping position of the paper feed motor) corresponding to the "peripheral identifier". This mechanism enables an intelligent transition from querying general status to proactively acquiring specific, in-depth device parameters, ensuring that the host can obtain comprehensive and detailed printer operation information, thereby improving the observability and interaction depth of the entire system.

[0051] Step S303: When the received peripheral operating parameters are received, determine whether the peripheral operating parameters are empty data.

[0052] Step S304: If the peripheral operating parameters are not empty data, use the peripheral operating parameters as feedback parameters and send the feedback parameters to the host in the status interface based on the reverse mode.

[0053] Steps S303 to S304 form a closed loop for data verification and transmission after acquiring the deep peripheral status. When the parallel port controller receives the "peripheral operating parameters" from the print processor via the second acquisition signal, its hardware logic performs another empty data verification (step S303) as the final checkpoint to ensure the validity of data transmission. If the verification passes (i.e., the peripheral operating parameters are not empty), the controller performs a crucial parameter replacement operation: assigning or mapping this non-empty, specific peripheral operating parameter (such as the printhead temperature value) to the originally empty "feedback parameter" variable. Subsequently, the parallel port controller automatically triggers a reverse transmission mechanism consistent with the aforementioned process (step S304): using this real and valid peripheral operating parameter as the data to be sent, it is transmitted to the host in parallel through a combination of multiple signal lines of the status interface in reverse mode. This automated pipeline operation of "verification-replacement-transmission" ensures that even if the initial status query is empty, the system can intelligently trace and provide deeper device operating parameters, ultimately guaranteeing the integrity and usability of the information obtained by the host.

[0054] Step S305: If the peripheral device operating parameters are empty, generate a notification flag indicating that the data transmission is complete, use the notification flag as a feedback parameter, and send the feedback parameter to the host in the status interface based on the reverse mode.

[0055] Specifically, when the parallel port controller determines that the "peripheral operating parameters" are empty in the final stage of acquiring the deep state, it indicates that the requested specific state information is indeed unavailable or does not exist. To prevent the host from getting stuck in unnecessary waiting and to explicitly end the interaction, the parallel port controller's hardware logic will automatically generate a predefined "notification identifier" (e.g., a specific, protocol-defined end code or empty response flag byte) to indicate that data transmission is complete. Subsequently, the parallel port controller performs parameter replacement, using this "notification identifier" as the final "feedback parameter," and sends it to the host via the status interface in reverse mode. Upon receiving this specific identifier, the host can clearly understand that the slave has no more valid data to upload, thereby terminating the current query process and potentially initiating a new communication transaction. This mechanism ensures that even without actual data returned, the communication session can end in a controlled and standardized manner, maintaining the reliability of the communication protocol.

[0056] In one possible embodiment, refer again Figure 5 As shown, after sending the feedback parameter to the host within the status interface based on the reverse mode, the above method may include, but is not limited to, the following step S106: In response to receiving a feedback exit signal sent by the host from the control interface, the data transmission of the control status interface is switched from the reverse mode to the forward mode.

[0057] The feedback exit signal indicates that the host requests an interrupt to obtain feedback parameters.

[0058] It is worth noting that step S106 marks the end of a complete reverse data transmission cycle, and the host actively initiates a communication mode reset. When the parallel port controller detects the feedback exit signal sent by the host through its control interface, this signal is interpreted by the hardware logic as an explicit instruction from the host that it has successfully received the reverse data and requests to end the current session. The parallel port controller immediately responds to this instruction, and its internal state machine automatically performs a mode switching operation, controlling the data transmission of the state interface from reverse mode to forward mode. Specifically, the parallel port controller stops combining state lines into parallel data channels and restores them to independent forward modes for transmitting single state signals such as "busy" and "acknowledge". This hardware-driven synchronous switching process ensures that the communication link can quickly and reliably return to the initial standby state, preparing for the next new print command or query request from the host, thereby maintaining the rigor and periodicity of the entire communication process.

[0059] In one possible embodiment, reference is made to... Figure 6 As shown, Figure 6 This is another optional schematic diagram of the parallel port communication method for a printer provided in the embodiments of this application. The method may include, but is not limited to, step S401.

[0060] Step S401: When the enable setting is characterized as invalid enable, based on the positive mode, a first invalid signal is sent to the host in the status interface.

[0061] The first invalid signal indicates that the printer processor does not support or allows feedback signals in the communication handshake protocol.

[0062] Specifically, this step constitutes the exception handling mechanism in the communication handshake phase, ensuring a clear response from the system in a non-ready state. When the parallel port controller receives a feedback signal from the host, queries the printer processor's enable settings, and finds that it is characterized as "invalid enable" (e.g., because the printer processor is busy, faulty, or software disabled), the parallel port controller will not perform a normal handshake response. Instead, its hardware logic ensures that the status interface remains in positive mode, and in this mode, drives a specific status line (e.g., sets the Busy signal high, or keeps nAck in an invalid state), thereby sending a predefined first invalid signal to the host. By automatically sending this signal through hardware, the abnormal state can be reported to the host in a timely and accurate manner, allowing the host to promptly suspend the current request process, avoiding communication timeouts caused by waiting for a valid response for a long time, while ensuring that the printer processor is not interfered with by communication tasks when its own load is too high or abnormal.

[0063] In one possible embodiment, reference is made to... Figure 7 As shown, Figure 7 This is another optional schematic diagram of the parallel port communication method for a printer provided in the embodiments of this application. The method may include, but is not limited to, step S501.

[0064] Step S501: When the support setting is indicated as not supported, a second invalid signal is sent to the host within the status interface based on the positive mode.

[0065] The second invalid signal indicates that the print processor does not support executing the print task according to the command word signal byte.

[0066] Specifically, this step constitutes an exception handling and protocol compatibility guarantee mechanism during the command execution phase. When the parallel port controller determines, based on its internal decoding logic or a preset lookup table, that the "supported setting" corresponding to the "command word signal" sent by the host is "not supported" (i.e., the printer processor's firmware or hardware cannot recognize or execute the specific instruction), the parallel port controller's hardware state machine will not initiate the reverse data transmission process. Instead, the parallel port controller will ensure that the state interface remains in positive mode and drive a specific combination of state lines in this mode (e.g., setting both the Busy and nFault signals to active levels simultaneously) to send a predefined second invalid signal to the host. By automatically completing this "command not supported" response in hardware, the system can efficiently filter out invalid or unprocessable instructions, preventing the printer processor from being interrupted by such requests, while ensuring that the host can quickly obtain clear status feedback, thereby maintaining the smoothness and robustness of the communication process.

[0067] Furthermore, in some embodiments, the parallel port controller also includes a data interface for receiving data sent by the host, see reference 1. Figure 8 As shown, Figure 8 This is provided by the embodiments of this application. Figure 1 An optional schematic diagram before step S101, the parallel port communication method may include, but is not limited to, steps S601 to S603.

[0068] Step S601: Receive the print control signal sent by the host through the control interface, and receive the print parameters sent by the host through the data interface.

[0069] Specifically, print control signals are received by the parallel port controller via a control interface (such as HostClk, nStrobe, etc., conforming to the IEEE 1284 standard). These signals are timing and operation commands driven by the host, such as strobe pulses for latching data or reset signals for initializing the printer. Their function is to coordinate the communication rhythm and trigger specific operations of the controller. Meanwhile, print parameters sent by the host (i.e., the raw data to be printed, graphic instructions, or page description information) are transmitted through a separate data interface (usually a standard eight-bit data line AD1…AD8). The parallel port controller samples, latches, and stores the print parameters appearing in parallel on the data interface according to the timing specified by the control signals. This architecture, which separates the control flow from the data flow and transmits them in parallel through a dedicated interface, is the foundation for achieving high-speed, reliable print data reception. It enables the controller to accurately synchronize signals and data, preparing the hardware for sending the data to the print processor to execute the actual printing task.

[0070] Step S602: Send the print control signal and print parameters to the print controller, and read the corresponding status feedback signal of the print controller.

[0071] Step S603: When the data transmission of the control status interface is in positive mode, send a status feedback signal to the host.

[0072] In steps S602 to S603, the parallel port controller packages the received "print control signal" and the buffered "print parameters" together and sends them to the print controller (i.e., the core processing unit responsible for the actual print engine). Then, it synchronously reads the "status feedback signal" returned by the print controller, which reflects in real time whether the print task has been successfully received, is being processed, or has encountered an error. Next, the parallel port controller ensures its status interface is in positive mode, and in this mode, it immediately sends the read real-time status feedback signal (such as "busy," "out of paper," or "ready") to the host via the corresponding status line. This "forward-read-response" hardware automation pipeline ensures that the host receives the most direct and timely execution status feedback on the print commands it sends, thereby achieving precise monitoring of the entire print task process and freeing the print processor from tedious status reporting tasks.

[0073] Reference Figure 9 As shown, Figure 9 This is an optional schematic diagram of a printer provided in an embodiment of this application. The printer 900 includes a print processor 910 and a parallel port controller 920. The parallel port controller 920 is communicatively connected to the print processor 910. The parallel port controller 920 includes a control interface 921 for receiving signals sent by a host, a status interface 922 for sending signals to the host, and a data interface 923 for receiving data sent by the host.

[0074] The parallel port controller 920 is used to receive print control signals sent by the host through the control interface 921, receive print parameters sent by the host through the data interface 923, send the print control signals and print parameters to the print controller, and read the corresponding status feedback signals of the print controller.

[0075] The parallel port controller 920 is also used to send a status feedback signal to the host when the data transmission of the control status interface 922 is in positive mode.

[0076] The parallel port controller 920 is also used to determine the enable setting of the print processor in response to a feedback signal received from the host in the control interface 921.

[0077] The parallel port controller 920 is also used to send a response signal corresponding to the feedback signal to the host when the enable setting is enabled and the data transmission of the control state interface 922 is in positive mode, so as to notify the host to transmit the command word signal for performing the printing task. In positive mode, a single bit is transmitted as a semaphore.

[0078] The parallel port controller 920 is also configured to, in response to receiving a command word signal from the control interface 921, determine the supported settings of the command word signal in the print processor based on the type of the command word signal.

[0079] The parallel port controller 920 is also used to control the data transmission of the state interface 922 in reverse mode when the support setting characterizes it as supported, and to send a first acquisition signal to the print processor to acquire feedback parameters generated by the print processor in executing the print task. The reverse mode combines multiple bits as data for transmission.

[0080] The parallel port controller 920 is also used to send feedback parameters to the host via the status interface 922 when feedback parameters are received.

[0081] The parallel port communication method between the printer 900 and the printer is based on the same inventive concept. By reconstructing the communication process using a hardware-based parallel port controller, it firstly significantly optimizes system resources and performance. By delegating key processes in the communication protocol, such as handshake response, command parsing, and mode switching, to a dedicated parallel port controller to complete these processes with hardware logic, the printer processor (MCU) is completely freed from heavy real-time signal processing and bit manipulation tasks. The MCU only needs to respond to the controller's requests in non-real-time tasks, such as providing enable settings, support settings, and feedback parameters, thereby greatly reducing its load and improving the system's responsiveness and processing capabilities for core printing tasks. Secondly, it also ensures the accuracy and stability of communication timing. By using a hardware controller to handle signal responses and mode switching, it fundamentally eliminates the timing jitter problems caused by interrupt responses and task scheduling in pure software implementations. This results in highly accurate and consistent timing for key operations such as handshake, response, and reverse data transmission, greatly improving communication reliability and anti-interference capabilities. Furthermore, it achieves efficient and flexible bidirectional data communication. By innovatively defining and controlling the state interface to switch between "forward mode" and "reverse mode," it realizes multi-functional multiplexing on the same set of signal lines. In forward mode, bits are used as control semaphores for rapid interaction, while in reverse mode, multiple bits are combined as data for transmission. This not only overcomes the limitation that some host hardware cannot receive data through standard data lines, but also constructs an efficient and high-speed bidirectional data channel. In addition, the method of this application also incorporates a mechanism for judging the type of command word signals and checking support settings. Unsupported instructions can be processed at the hardware level in advance to avoid invalid commands interfering with the MCU, thereby improving the compatibility and operational stability of the entire printing system.

[0082] Please see Figure 10 , Figure 10 This is a schematic diagram of a hardware structure of an electronic device provided in an embodiment of this application. The electronic device includes: The processor 1001 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the blood pressure regulation method based on stimulation of the carotid sinus provided in the embodiments of this application. The memory 1002 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 1002 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1002 and is called and executed by the processor 1001. Input / output interface 1003 is used to implement information input and output; The communication interface 1004 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 10010 transmits information between various components of the device (e.g., processor 1001, memory 1002, input / output interface 1003, and communication interface 1004); The processor 1001, memory 1002, input / output interface 1003 and communication interface 1004 are connected to each other within the device via bus 10010.

[0083] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, provides a blood pressure regulation method based on stimulation of the carotid sinus.

[0084] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0085] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0086] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0087] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0088] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or appropriate combinations thereof.

[0089] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0090] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0091] In the embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0092] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0093] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0094] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-accessible storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or 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 multiple 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 of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0095] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.

Claims

1. A parallel port communication method for a printer, characterized in that, The method is applied to a parallel port controller, the parallel port controller including a control interface for receiving signals sent by a host and a status interface for sending signals to the host, the parallel port controller being communicatively connected to the printer processor of the printer, the method comprising: In response to receiving a feedback signal from the host from the control interface, the enable setting of the feedback signal in the print processor is determined; When the enable setting is enabled, and the data transmission of the state interface is in positive mode, a response signal corresponding to the feedback signal is sent to the host to notify the host to transmit a command word signal for executing a printing task. The positive mode is to transmit a single bit as a semaphore. In response to receiving the command word signal from the control interface, the supported settings of the command word signal in the print processor are determined based on the type of the command word signal; When the support setting is indicated as support, the data transmission of the control state interface is in reverse mode, and a first acquisition signal is sent to the print processor to obtain the feedback parameters generated by the print processor in executing the print task. The reverse mode is to combine multiple bits as data for transmission. When the feedback parameter is received, it is sent to the host through the status interface.

2. The parallel port communication method according to claim 1, characterized in that, The step of sending the feedback parameter to the host through the status interface upon receiving the feedback parameter includes: Upon receiving the feedback parameter, determine whether the feedback parameter is empty data; If the feedback parameter is not empty data, based on the reverse mode, the feedback parameter is sent to the host in the status interface, wherein the feedback parameter includes the status parameter and setting parameter of the print processor.

3. The parallel port communication method according to claim 2, characterized in that, The step of sending the feedback parameter to the host based on the reverse mode upon receiving the feedback parameter further includes: When the received feedback parameter is empty data, the peripheral identifier corresponding to the peripheral controlled by the print processor to execute the print task is determined according to the print task. Based on the peripheral identifier, a second acquisition signal is sent to the print processor to obtain the peripheral operating parameters of the peripheral; When the peripheral operating parameters are received, determine whether the peripheral operating parameters are empty data; If the peripheral operating parameters are not empty data, the peripheral operating parameters are used as the feedback parameters, and based on the reverse mode, the feedback parameters are sent to the host in the status interface.

4. The parallel port communication method according to claim 3, characterized in that, The step of sending the feedback parameter to the host based on the reverse mode upon receiving the feedback parameter further includes: If the peripheral device operating parameters are empty, a notification identifier indicating that the data transmission is complete is generated. The notification identifier is used as the feedback parameter, and based on the reverse mode, the feedback parameter is sent to the host within the status interface.

5. The parallel port communication method according to claim 4, characterized in that, After using the notification identifier as the feedback parameter and sending the feedback parameter to the host within the state interface based on the reverse pattern, the method further includes: In response to receiving a feedback exit signal from the host from the control interface, the data transmission of the status interface is switched from the reverse mode to the forward mode. The feedback exit signal indicates that the host requests an interruption to obtain the feedback parameters.

6. The parallel port communication method according to claim 1, characterized in that, The method further includes: When the enable setting is characterized as invalid enable, based on the positive mode, a first invalid signal is sent to the host within the status interface; The first invalid signal indicates that the printing processor does not support the communication handshake protocol of the feedback signal.

7. The parallel port communication method according to claim 1, characterized in that, The method further includes: When the support setting is characterized as not supported, a second invalid signal is sent to the host within the status interface based on the positive mode; The second invalid signal indicates that the print processor does not support executing the print task according to the command word signal.

8. The parallel port communication method according to claim 1, characterized in that, The parallel port controller further includes a data interface for receiving data sent by the host, and prior to receiving a feedback signal sent by the host from the control interface, the method further includes: The system receives print control signals sent by the host through the control interface and print parameters sent by the host through the data interface. The print control signal and the print parameters are sent to the print controller, and the corresponding status feedback signal of the print controller is read. When the data transmission of the control status interface is in the positive mode, the status feedback signal is sent to the host.

9. A printer, characterized in that, include: Printer processor; A parallel port controller, which is communicatively connected to the print processor, includes a control interface for receiving signals sent by the host and a status interface for sending signals to the host. The parallel port controller is used to respond to a feedback signal received from the host from the control interface and determine the enable setting of the feedback signal in the print processor; The parallel port controller is also used to send a response signal corresponding to the feedback signal to the host when the enable setting is enabled and the data transmission of the status interface is in positive mode, so as to notify the host to transmit a command word signal for executing a printing task. The positive mode is to transmit a single bit as a semaphore. The parallel port controller is further configured to, in response to receiving the command word signal from the control interface, determine the supported settings of the command word signal in the print processor based on the type of the command word signal; The parallel port controller is also used to, when the support setting characterizes as support, control the data transmission of the status interface to be in reverse mode, and send a first acquisition signal to the print processor to acquire the feedback parameters generated by the print processor in executing the print task, wherein the reverse mode is to combine multiple bits as data for transmission; The parallel port controller is also used to send the feedback parameters to the host through the status interface when the feedback parameters are received.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a processor-executable program, which, when executed by a processor, is used to implement the parallel port communication method of the printer as described in any one of claims 1 to 8.