Driver on-line method, target driver and system based on multi-protocol communication
Patent Information
- Application Number
- CN202510818888.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-18
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2045-06-18
AI Technical Summary
[0003]但是,驱动器只能独立处理USB数据或485数据,且受上位机的通信接口数量的限制,上位机每次只能与有限数量的驱动器连接并对其进行监控,无法对总线上未连接的其他驱动器进行监控,也即上位机无法同时确定多个驱动器的工作状态,那么可能会导致无法及时识别到驱动器异常工作导致驱动器损坏
[0055] This application provides a driver online method, target driver, and system based on multi-protocol communication. After the target driver enters the corresponding target operating mode according to the operating mode switching command, it communicates with the host computer through a first data transceiver path, and with the bus device and each driver to be monitored through a second data transceiver path. Data is forwarded between the host computer, the bus device, and each driver to be monitored through a data forwarding path, thereby realizing mutual data transmission between the host computer, the bus device, and each driver to be monitored. Therefore, the target driver in this application can serve as a transmission medium for data transmission between the host computer, the bus device, and each driver to be monitored, enabling data communication between the host computer, the bus device, and each driver to be monitored, allowing the host computer to simultaneously control and monitor the bus device and multiple drivers to be monitored.
Smart Images

Figure CN120407456B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data communication, and in particular to a driver online method, target driver, and system based on multi-protocol communication. Background Technology
[0002] In the present technology, drivers are usually equipped with communication interfaces of multiple communication protocols, such as the 485 protocol bus interface and the USB (Universal Serial Bus) communication interface. Multiple drivers are connected to the bus device through the bus and are uniformly scheduled by the bus device. If the bus device is pre-configured with the corresponding control program, the bus device controls each driver through the bus according to the control program, such as exchanging data with each driver through the bus. The host computer can connect to one of the drivers through the USB communication interface to monitor the working status of the driver.
[0003] However, the driver can only process USB data or 485 data independently, and is limited by the number of communication interfaces of the host computer. The host computer can only connect to and monitor a limited number of drivers at a time, and cannot monitor other drivers that are not connected on the bus. In other words, the host computer cannot determine the working status of multiple drivers at the same time, which may lead to failure to identify abnormal driver operation in time, resulting in driver damage. Summary of the Invention
[0004] The purpose of this invention is to provide a driver online method, target driver, and system based on multi-protocol communication. The target driver can serve as a transmission medium for data transmission between the host computer, bus devices, and each driver to be monitored, so as to realize data communication between the host computer, bus devices, and each driver to be monitored, enabling the host computer to control and monitor the bus devices and multiple drivers to be monitored simultaneously.
[0005] To solve the above technical problems, the present invention provides a driver online method based on multi-protocol communication, applied to a target driver, wherein the target driver is connected to a host computer through a first communication interface, and the target driver is connected to a bus device and each driver to be monitored through a second communication interface.
[0006] The method includes:
[0007] Upon receiving a working mode switching instruction, the system enters the target working mode corresponding to the working mode switching instruction.
[0008] In the target working mode, a first data transmission and reception path is established between the first communication interface and the host computer, and a second data transmission and reception path is established between the second communication interface and the bus device and each driver to be monitored; after communication is established between the first communication interface and the second communication interface, a data forwarding path is established between the first communication interface and the second communication interface.
[0009] Preferably, after establishing communication between the first communication interface and the second communication interface, establishing a data forwarding path between the first communication interface and the second communication interface includes:
[0010] After establishing communication between the first communication interface and the second communication interface, a first data forwarding path and a second data forwarding path are established between the first communication interface and the second communication interface. The first data forwarding path is used to forward the data received by the first communication interface to the second communication interface, and the second data forwarding path is used to forward the data received by the second communication interface to the first communication interface.
[0011] Preferably, the target driver includes a protocol processing module, and the method further includes:
[0012] After establishing communication between the first communication interface and the second communication interface, a first protocol processing sending path and a first protocol processing feedback path are also established between the protocol processing module and the first communication interface, and a second protocol processing sending path and a second protocol processing feedback path are also established between the protocol processing module and the second communication interface.
[0013] Preferably, the target operating mode is a host computer debugging mode;
[0014] In the host computer debugging mode:
[0015] The first target data is obtained from the host computer through the first data transceiver path; the first target data is forwarded to the second communication interface through the first data forwarding path; and the first target data is sent to the bus device and each driver to be monitored through the second data transceiver path.
[0016] The second target data is obtained from each monitored driver through the second data transceiver path; the second target data is forwarded to the first communication interface through the second data forwarding path; and the second target data is sent to the host computer through the first data transceiver path.
[0017] The first target data is sent to the protocol processing module through the first protocol processing sending path, so that the protocol processing module performs protocol processing on the first target data and generates first protocol processing feedback data. The first protocol processing feedback data is sent to the first communication interface through the first protocol processing feedback path, and then sent to the host computer through the first data transmission and reception path.
[0018] The second target data is sent to the protocol processing module through the second protocol processing transmission path, so that the protocol processing module performs protocol processing on the second target data and generates second protocol processing feedback data. The second protocol processing feedback data is sent to the second communication interface through the second protocol processing feedback path, and then sent to the bus device and each of the drivers to be monitored through the second data transceiver path.
[0019] Preferably, after establishing communication between the first communication interface and the second communication interface, establishing a data forwarding path between the first communication interface and the second communication interface includes:
[0020] After establishing communication between the first communication interface and the second communication interface, a first data forwarding path is established between the first communication interface and the second communication interface. The first data forwarding path is used to forward the data received by the first communication interface to the second communication interface.
[0021] Preferably, the target driver includes a protocol processing module, and the method further includes:
[0022] After establishing communication between the first communication interface and the second communication interface, a first protocol processing sending path and a first protocol processing feedback path are also established between the protocol processing module and the first communication interface.
[0023] Preferably, the target operating mode is a host computer control mode;
[0024] In the host computer control mode:
[0025] The first target data is obtained from the host computer through the first data transceiver path; the first target data is forwarded to the second communication interface through the first data forwarding path; and the first target data is sent to the bus device and each driver to be monitored through the second data transceiver path.
[0026] The first target data is sent to the protocol processing module through the first protocol processing sending path, so that the protocol processing module performs protocol processing on the first target data and generates first protocol processing feedback data. The first protocol processing feedback data is sent to the first communication interface through the first protocol processing feedback path, and then sent to the host computer through the first data forwarding path.
[0027] Preferably, after establishing communication between the first communication interface and the second communication interface, establishing a data forwarding path between the first communication interface and the second communication interface includes:
[0028] After establishing communication between the first communication interface and the second communication interface, a second data forwarding path is established between the first communication interface and the second communication interface. The second data forwarding path is used to forward the data received by the second communication interface to the first communication interface.
[0029] Preferably, the target driver includes a protocol processing module, and the method further includes:
[0030] After establishing communication between the first communication interface and the second communication interface, a second protocol processing sending path and a second protocol processing feedback path are also established between the protocol processing module and the second communication interface.
[0031] Preferably, the target operating mode is a host computer monitoring mode;
[0032] In the host computer monitoring mode:
[0033] The second target data is obtained from the bus device or one of the monitored drivers through the second data transceiver path; the second target data is forwarded to the first communication interface through the second data forwarding path; and the second target data is sent to the host computer through the first data transceiver path.
[0034] Furthermore, the second target data is sent to the protocol processing module through the second protocol processing transmission path, so that the protocol processing module performs protocol processing on the second target data and generates second protocol processing feedback data. The second protocol processing feedback data is then sent to the second communication interface through the second protocol processing feedback path, and finally sent to the bus device through the second data forwarding path.
[0035] Preferably, the target operating mode is a serial port conversion mode;
[0036] In the serial port conversion mode:
[0037] The first target data is obtained from the host computer through the first data transceiver path; the first target data is forwarded to the second communication interface through the first data forwarding path; and the first target data is sent to the bus device and each driver to be monitored through the second data transceiver path.
[0038] The second target data is obtained from each driver to be monitored through the second data transceiver path; the second target data is forwarded to the first communication interface through the second data forwarding path; and the second target data is sent to the host computer through the first data transceiver path.
[0039] Preferably, after entering the target working mode corresponding to the working mode switching instruction upon receiving it, the method further includes:
[0040] The system receives the master station switching instruction sent by the host computer through the first data transceiver path, and forwards the master station switching instruction to the second communication interface through the data forwarding path, so as to send the master station switching instruction to the bus device through the second data transceiver path and suspend the control of the bus device on each of the drivers to be monitored.
[0041] To address the aforementioned technical problems, the present invention provides a target driver, comprising:
[0042] Memory, used to store computer programs;
[0043] A processor, used to implement the steps of the driver online method based on multiprotocol communication as described above when executing a computer program.
[0044] To solve the above-mentioned technical problems, the present invention provides a driver online system based on multi-protocol communication, including the target driver as described above, and also including a host computer, a bus device and a target bus;
[0045] The target driver is connected to the host computer via a first communication interface and to the bus device and each driver to be monitored via a second communication interface.
[0046] The host computer is used for:
[0047] When the target driver is operating in host computer debugging mode or serial port conversion mode, at least one virtual driver to be monitored is virtualized;
[0048] While sending the host computer debugging data or host computer communication data to each of the monitored drivers and the bus device through the target driver, the host computer debugging data or host computer communication data is also input to each of the virtual monitored drivers.
[0049] While acquiring the first host computer debugging feedback data or host computer communication feedback data sent by each of the monitored drivers through the target driver, the debugging virtual feedback data or communication virtual feedback data generated by each of the virtual monitored drivers based on the host computer debugging data or host computer communication data is also acquired.
[0050] The host computer debugging feedback data is the data generated by each of the monitored drivers based on the host computer debugging data; the host computer communication feedback data is the data generated by each of the monitored drivers based on the host computer communication data.
[0051] Preferably, the host computer is further used for:
[0052] When the target driver is operating in host computer control mode or host computer monitoring mode, each of the monitored drivers is virtualized;
[0053] The target driver receives bus control data and inputs the bus control data to each of the virtual drivers to be monitored, and determines the virtual bus control feedback data generated by each of the virtual drivers to be monitored based on the bus control data.
[0054] Alternatively, while sending host computer control data to each of the monitored drivers through the target driver, the host computer control data is also input to each of the virtual monitored drivers, and virtual host computer control feedback data generated by each of the virtual monitored drivers based on the host computer control data is received.
[0055] This application provides a driver online method, target driver, and system based on multi-protocol communication. After the target driver enters the corresponding target operating mode according to the operating mode switching command, it communicates with the host computer through a first data transceiver path, and with the bus device and each driver to be monitored through a second data transceiver path. Data is forwarded between the host computer, the bus device, and each driver to be monitored through a data forwarding path, thereby realizing mutual data transmission between the host computer, the bus device, and each driver to be monitored. Therefore, the target driver in this application can serve as a transmission medium for data transmission between the host computer, the bus device, and each driver to be monitored, enabling data communication between the host computer, the bus device, and each driver to be monitored, allowing the host computer to simultaneously control and monitor the bus device and multiple drivers to be monitored. Attached Figure Description
[0056] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0057] Figure 1 A flowchart illustrating a driver online method based on multi-protocol communication provided in this application;
[0058] Figure 2 This is a schematic diagram of a driver connection in the prior art;
[0059] Figure 3 This is a schematic diagram of data transmission in a driver in the prior art;
[0060] Figure 4 This application provides a schematic diagram of data transmission in a first type of driver.
[0061] Figure 5 This application provides a schematic diagram of the first type of driver connection.
[0062] Figure 6 This is a schematic diagram of data transmission in the second type of driver provided in this application;
[0063] Figure 7 This application provides a second type of driver connection diagram;
[0064] Figure 8 A schematic diagram of data transmission in the third type of driver provided in this application;
[0065] Figure 9 A schematic diagram of a third type of driver connection provided in this application;
[0066] Figure 10 This application provides a schematic diagram of data transmission in a fourth type of driver.
[0067] Figure 11 This application provides a fourth type of driver connection diagram;
[0068] Figure 12 A schematic diagram of the structure of a target driver provided in this application;
[0069] Figure 13 This is a schematic diagram of a computer-readable storage medium provided in this application. Detailed Implementation
[0070] The core of this invention is to provide a driver connection method, target driver, and system based on multi-protocol communication. The target driver can serve as a transmission medium for data transmission between the host computer, bus devices, and each driver to be monitored, so as to realize data communication between the host computer, bus devices, and each driver to be monitored, enabling the host computer to control and monitor the bus devices and multiple drivers to be monitored simultaneously.
[0071] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0072] Please refer to Figure 1 , Figure 1 The flowchart of a driver online method based on multi-protocol communication provided in this application is applied to a target driver. The target driver communicates with the host computer through a first communication interface and communicates with the bus device and each driver to be monitored through a second communication interface.
[0073] The methods include:
[0074] S11: Upon receiving a working mode switching instruction, enter the target working mode corresponding to the working mode switching instruction;
[0075] Please refer to Figure 2 , Figure 2 This is a schematic diagram of a driver connection in the prior art. In the prior art, multiple drivers are usually connected to the same bus and controlled uniformly by a bus device, such as... Figure 2 The n+1 drivers ID(1) to ID(n+1) shown are connected on the same 485 bus. The bus device acts as the master station to control each driver through the 485 bus. Please refer to [link / reference]. Figure 3 , Figure 3This diagram illustrates data transmission in a driver in the prior art. Driver n's A and B are 485 communication interfaces connected to a 485 bus. The Rx terminal, connected to the 485 communication interface, receives bus control data sent by bus devices. The CPU (Central Processing Unit) processes the bus control data using a first protocol, generates bus control feedback data, and transmits it to the 485 communication interface via the Tx terminal. The 485 communication interface then sends the bus control feedback data to the 485 bus. Bus devices retrieve the bus control feedback data generated by each driver from the 485 bus to monitor each driver. If a user wants to debug driver n or monitor its operating data via a host computer, they can connect to driver n through the communication interface to send host computer control data to or receive driver n's operating data. For example, the host computer can connect to the nth driver n via a USB communication interface. Control data and host computer control feedback data are transmitted between the host computer and driver n via a USB communication interface. The Rx terminal of driver n, which is connected to the USB communication interface, receives the host computer control data sent by the host computer. The CPU processes the host computer control data according to the second protocol to generate host computer control feedback data, which is then sent to the host computer via the Tx terminal connected to the USB communication interface. However, the number of communication interfaces on the host computer is limited, and the host computer cannot connect to multiple drivers at the same time. That is, the host computer cannot debug multiple drivers at the same time and determine the working status of each driver. If a driver malfunctions and the host computer cannot immediately recognize the malfunction, it may cause damage to the driver.
[0076] To address the aforementioned technical issues, this application uses a target driver as a conversion device between different communication interfaces. The target driver communicates with the host computer via a first communication interface and with the bus devices and each monitored driver via a second communication interface. In other words, the host computer indirectly communicates with the bus devices and each monitored driver through the target driver to transmit data between the host computer and the bus devices and each monitored driver. Specifically, the first communication interface connecting the target driver and the host computer can be a USB communication interface, and the second communication interface connecting the target driver with each monitored driver and the bus device can be a 485 communication interface. Therefore, the bus connecting the bus device and each monitored driver is a 485 communication protocol bus, and the 485 communication protocol can be the Modbus protocol. After receiving data from the host computer via the USB communication interface, the target driver converts it into USB serial port data, with the communication protocol being Modbus. Similarly, after receiving data from the bus device or each monitored driver via the 485 communication interface, the target driver converts it into 485 serial port data, with the communication protocol being Modbus.
[0077] In addition, multiple drivers to be monitored are configured on a bus. Each driver to be monitored is connected to the bus through a second communication interface. That is, each driver to be monitored can obtain data from the bus or transmit data to the bus. The host computer interacts with the bus, which is actually interacting with each driver to be monitored, so as to realize the host computer's control and monitoring of each driver to be monitored.
[0078] It should be noted that when determining the target driver, the driver closest to the host computer can be selected as the target driver. Alternatively, multiple target drivers can be selected, such as by generating multiple random numbers based on the number of drivers and selecting the drivers corresponding to each random number as target drivers. This application does not limit this. The target driver can be a driver on the same bus as the bus devices and the drivers to be monitored, or it can be a driver on a different bus than the drivers to be monitored and the bus devices. For example, if the target driver, the drivers to be monitored, and the bus devices are all on the first bus and controlled by the control data on the first bus, then the target driver can directly transmit the data sent by the host computer to the first bus. Online, and transmit data from the first bus to the host computer; or, the target driver is a driver on the first bus, controlled by the control data on the first bus, but can also be connected to the second bus through another second communication interface, and the bus devices and each driver to be monitored are devices on the second bus. Although the target driver is not controlled by the control data on the second bus, it can receive data from the second bus and transmit it to the host computer, and can also transmit data sent by the host computer to the second bus, so as to realize data transmission between the host computer, the bus devices and each driver to be monitored; based on this, the host computer can control and monitor the drivers to be monitored on different buses and the bus devices through only one target driver.
[0079] Specifically, according to different data communication needs, corresponding working mode switching instructions can be sent to the target driver to switch the working mode of the target driver. The target driver enables the host computer, bus devices and each driver to be monitored to interact with each other in different working modes.
[0080] The working mode switching command can be issued by the host computer, or a human-computer interaction device, such as a keyboard or touch screen, can be configured for the target driver. The operator can input the working mode switching command through the human-computer interaction device.
[0081] S12: In the target working mode, a first data transmission and reception path is established between the first communication interface and the host computer, and a second data transmission and reception path is established between the second communication interface and the bus device and each driver to be monitored; after establishing communication between the first communication interface and the second communication interface, a data forwarding path is established between the first communication interface and the second communication interface.
[0082] A first data transceiver path is established between the first communication interface and the host computer, enabling the target driver to transmit data with the host computer through the first data transceiver path. A second data transceiver path is established between the first communication interface, the bus device, and each driver to be monitored, enabling the target driver to transmit data with the bus device and each driver to be monitored through the second data transceiver path. In addition, a data forwarding path is established between the first and second communication interfaces, so that data received by the first communication interface through the first data transceiver path can be forwarded to the second communication interface through the data forwarding path, or data received by the second communication interface can be forwarded to the first communication interface through the data forwarding path, thereby realizing data transmission between the host computer, the bus device, and each driver to be monitored.
[0083] Depending on the target operating mode, data received from the host computer via the first data transceiver path can be forwarded to the second communication interface via the data forwarding path, and then sent to the bus device and each monitored driver via the second data transceiver path. In this way, the bus device and each monitored driver can receive the data sent by the host computer, and each monitored driver can operate according to the data sent by the host computer, so as to realize the host computer's simultaneous control of each monitored driver and the bus device's monitoring of the host computer's control of each monitored driver.
[0084] Depending on the target operating mode, only the data sent by the bus device and each monitored driver through the second data transceiver path can be forwarded to the first communication interface, and then transmitted to the host computer through the first data transceiver path. The data sent by the bus device and each monitored driver can be the operating data output by each monitored driver, such as operating voltage or power, or it can be the control data when the bus device controls each monitored driver. Based on this, the host computer can monitor the operating data and operating status of each monitored driver to determine whether each monitored driver is working normally.
[0085] Furthermore, depending on the target operating mode, data sent by the host computer through the first data transceiver path can be forwarded to the second communication interface, then through the second data transceiver path bus device and each monitored driver, and then received through the second data transceiver path. Data generated by each monitored driver is then sent to the first communication interface through the data forwarding path, and finally transmitted to the host computer through the first data transceiver path. This allows the host computer to both control and monitor each monitored driver, and the bus device can also monitor both the monitored drivers and the host computer. It should be noted that the data sent by the host computer can be for controlling or debugging the monitored drivers, while the data sent by each monitored driver can be feedback data generated after the monitored driver operates according to the data sent by the host computer.
[0086] If other devices are connected to the driver to be monitored, these other devices can also obtain data from the target driver during its operation through the driver to monitor the operation of the target driver.
[0087] It should also be noted that the data transmitted between the host computer and the bus device and each monitored driver in this application is not necessarily only data for controlling the driver. It can also be non-control data such as access request data, feedback data after the driver runs based on the control data, or log data naturally generated in its working state. This application does not limit this.
[0088] In summary, the target driver can serve as a transmission medium for data transmission between the host computer, bus devices, and each driver to be monitored, thereby enabling data communication between the host computer, bus devices, and each driver to be monitored, allowing the host computer to simultaneously control and monitor the bus devices and multiple drivers to be monitored.
[0089] Based on the above embodiments:
[0090] As a preferred embodiment, after communication is established between the first communication interface and the second communication interface, a data forwarding path is established between the first communication interface and the second communication interface, including:
[0091] After establishing communication between the first communication interface and the second communication interface, a first data forwarding path and a second data forwarding path are established between the first communication interface and the second communication interface. The first data forwarding path is used to forward the data received by the first communication interface to the second communication interface, and the second data forwarding path is used to forward the data received by the second communication interface to the first communication interface.
[0092] The first communication interface can receive data sent by the host computer through the first data transceiver path, and then forward it to the second communication interface through the first data forwarding path, and then transmit it to the bus device and each monitored driver through the second data transceiver path; the second communication interface can receive data sent by the bus device and each monitored driver through the second data transceiver path, and then forward it to the first communication interface through the second data forwarding path, and then transmit it to the host computer through the first data transceiver path, so as to realize the transmission of data output by the host computer to the bus device and each monitored driver, and the transmission of data output by the bus device and each monitored driver to the host computer.
[0093] In a preferred embodiment, the target driver includes a protocol processing module, and the method further includes:
[0094] After establishing communication between the first communication interface and the second communication interface, a first protocol processing sending path and a first protocol processing feedback path are also established between the protocol processing module and the first communication interface, and a second protocol processing sending path and a second protocol processing feedback path are also established between the protocol processing module and the second communication interface.
[0095] Since the target driver is also a driver, the host computer can control and monitor not only the individual drivers to be monitored but also the target driver. Therefore, the target driver is equipped with a protocol processing module. After receiving data from the host computer through the first data transceiver path, the target driver sends it to the protocol processing module through the first protocol processing transmission path. The protocol processing module processes the data and then feeds it back to the host computer through the first protocol processing feedback path, thus enabling the host computer to control and monitor the target driver. Similarly, the bus device can control and monitor not only the individual drivers to be monitored but also the target driver. Therefore, after receiving data from the bus device through the second data transceiver path, the target driver sends it to the protocol processing module through the second protocol processing transmission path. The protocol processing module processes the data and then feeds it back to the bus device through the second protocol processing feedback path, thus enabling the bus device to control and monitor the target driver to determine whether the individual drivers to be monitored and the target driver are working properly. The target driver's internal protocol processing module can be a Modbus protocol processing module. The CPU can process USB serial port data and / or 485 serial port data according to the Modbus protocol, and generate corresponding bus control feedback data and host computer control feedback data. It should be noted that the feedback data includes host computer control feedback data or bus control feedback data. Based on this, the target driver can be controlled by data sent from the host computer or by data output from the bus device; that is, the target driver can respond to both host computer control and bus device control.
[0096] As a preferred embodiment, the target operating mode is the host computer debugging mode;
[0097] In host computer debugging mode:
[0098] The first target data is obtained from the host computer through the first data transceiver path; the first target data is forwarded to the second communication interface through the first data forwarding path; and the first target data is sent to the bus device and each driver to be monitored through the second data transceiver path.
[0099] The second target data is obtained from each monitored driver through the second data transceiver path; the second target data is forwarded to the first communication interface through the second data forwarding path; and the second target data is sent to the host computer through the first data transceiver path.
[0100] The first target data is sent to the protocol processing module through the first protocol processing sending path, so that the protocol processing module performs protocol processing on the first target data and generates first protocol processing feedback data. The first protocol processing feedback data is sent to the first communication interface through the first protocol processing feedback path, and then sent to the host computer through the first data transmission and reception path.
[0101] The second target data is sent to the protocol processing module through the second protocol processing transmission path, so that the protocol processing module performs protocol processing on the second target data and generates second protocol processing feedback data. The second protocol processing feedback data is sent to the second communication interface through the second protocol processing feedback path, and then sent to the bus device and each driver to be monitored through the second data forwarding path.
[0102] Before the driver is officially put into use, it can be debugged. When the target working mode is host computer debugging mode, the target driver can receive the first target data, including host computer debugging data, output by the host computer through the first data transceiver path. Then, it forwards the first target data to the second communication interface through the first data forwarding path. Then, it transmits the first target data to the bus device and each driver to be monitored through the second data transceiver path. The bus device and all drivers to be monitored can receive the first target data and analyze or run based on the first target data, thereby generating second target data, including host computer debugging feedback data, and sending it to the target driver through the second data transceiver path. The second data forwarding path in the target driver forwards the second target data to the first communication interface, and then feeds the second target data back to the host computer through the first data transceiver path. This allows the host computer to not only control each driver to be monitored, but also to determine the control results or effects of controlling each driver to be monitored, so as to realize the host computer's debugging of each driver to be monitored. The bus device can also monitor the host computer's debugging process and results for each driver to be monitored.
[0103] In addition, the first target data output by the host computer also includes host computer debugging data for debugging the target driver. The first protocol processing transmission path in the target driver transmits the first target data to the protocol processing module. After the protocol processing module runs based on the host computer debugging data, it generates the corresponding first protocol processing feedback data and transmits it to the first communication interface through the first protocol processing feedback path. Then, it feeds back to the host computer through the first data transmission and reception path, so that the host computer can control and monitor the target driver to realize the host computer's debugging of the target driver. The bus device can also monitor the host computer's debugging process and debugging results for each driver to be monitored and the target driver.
[0104] Of course, the target driver can also send the second target data output by the driver to be monitored to the protocol processing module through the second protocol processing transmission path, so that the protocol processing module can perform protocol processing on the second target data and generate second protocol processing feedback data, and then feed it back to the second communication interface through the second protocol processing feedback path, and feed it back to each monitored device and bus device through the second data transmission and reception path. The second target data may include communication data between different drivers to realize data interaction between different drivers.
[0105] The host computer debugging data in the first target data includes host computer debugging data corresponding to the IDs (Identity Documents) of each monitored driver and target driver, so that each monitored driver and target driver can obtain and run the host computer debugging data corresponding to itself. The first host computer debugging feedback data output by each monitored driver also includes its corresponding ID, so that the host computer and bus devices can distinguish the first host computer debugging feedback data output by different monitored drivers.
[0106] Please refer to Figure 4 , Figure 4 This is a schematic diagram of data transmission in the first type of driver provided in this application. Taking driver n as the target driver as an example, the host computer sends the first target data, including host computer debugging data, to driver n through the Rx terminal connected to the first communication interface. Driver n directly forwards the first target data to the Tx terminal connected to the second communication interface, so that the Tx terminal connected to the second communication interface transmits the first target data to the bus device and each driver to be monitored. This allows each driver to be monitored to run based on the first target data and generate second target data including host computer control feedback data, and to feed back the host computer control feedback data to the host computer and the bus device, thereby realizing the control and monitoring of each driver by the host computer and the bus device. On the other hand, the CPU in driver n determines from the first target data... The host computer debugs the data corresponding to ID(n) and performs protocol processing to generate the first protocol processing feedback data. The first protocol processing feedback data is transmitted to the host computer by the Tx terminal connected to the first communication interface, realizing the host computer's direct control and monitoring of the driver n. The CPU of driver n also transmits the first protocol processing feedback data to the bus device and each driver to be monitored. The bus device can also monitor the host computer's debugging process of the target driver. Driver n directly transmits the second target data received through the Rx terminal connected to the second communication port to the host computer, or performs protocol processing on the second target data to generate the corresponding second protocol processing feedback data and then feeds it back to the host computer or bus device and each driver to be monitored. For example, the CPU in driver n can perform operations such as integration and processing of the second target data before transmitting it to the host computer.
[0107] Please refer to Figure 5 , Figure 5The diagram illustrates the first type of driver connection provided in this application. In the host computer debugging mode, the target driver, i.e., driver n, is equivalent to driver n itself and a bidirectional USB-485 conversion device. Through this USB-485 conversion device, the host computer is connected to the bus device and each driver to be monitored. That is, the first target data output by the host computer can be transmitted to the bus device and each driver to be monitored through the USB-485 conversion device, and the second target data output by the bus device and each driver to be monitored can also be transmitted to the host computer through the USB-485 conversion device.
[0108] In this embodiment, the first target data includes host computer debugging data output by the host computer to control each monitored driver and the target driver. Different monitored drivers and target drivers can obtain the host computer debugging data corresponding to their own ID from the first target data for operation. The host computer debugging data corresponding to different monitored drivers and target drivers can be the same or different, and can be set or adjusted according to actual needs.
[0109] The second target data is the first host computer control feedback data after each monitored driver runs based on the first target data. That is, the running data after running based on the first target data. After receiving the second target data, the host computer can determine the running status of each monitored driver and determine whether each monitored driver has an abnormality.
[0110] Based on this, the host computer can not only transmit data with the target driver, but also transmit data with each driver to be monitored through the target driver and the target bus, so as to realize the simultaneous debugging of each driver to be monitored by the host computer.
[0111] Therefore, the host computer debugging mode enables the host computer to debug each monitored driver before the master station equipment controls each monitored driver to work in the actual production line, in order to determine whether each monitored driver can work normally and whether it can be put into the actual production line.
[0112] As a preferred embodiment, after communication is established between the first communication interface and the second communication interface, a data forwarding path is established between the first communication interface and the second communication interface, including:
[0113] After establishing communication between the first communication interface and the second communication interface, a first data forwarding path is established between the first communication interface and the second communication interface. The first data forwarding path is used to forward the data received by the first communication interface to the second communication interface.
[0114] The first communication interface can receive data sent by the host computer through the first data transceiver path, and then forward it to the second communication interface through the first data forwarding path, and then transmit it to the bus device and each driver to be monitored through the second data transceiver path, so as to realize the transmission of data output by the host computer to the bus device and each driver to be monitored.
[0115] In a preferred embodiment, the target driver includes a protocol processing module, and the method further includes:
[0116] After establishing communication between the first communication interface and the second communication interface, a first protocol processing sending path and a first protocol processing feedback path are also established between the protocol processing module and the first communication interface.
[0117] The host computer can not only control and monitor each driver to be monitored, but also control and monitor the target driver. Therefore, the target driver is equipped with a protocol processing module. After receiving the data sent by the host computer through the first data transceiver path, the target driver sends it to the protocol processing module through the first protocol processing transmission path. The protocol processing module processes the data and then sends it back to the host computer through the first protocol processing feedback path, so as to realize the host computer's control and monitoring of the target driver, so that the host computer can determine whether each driver to be monitored and the target driver are working properly.
[0118] As a preferred embodiment, the target operating mode is the host computer control mode;
[0119] In host computer control mode:
[0120] The first target data is obtained from the host computer through the first data transceiver path; the first target data is forwarded to the second communication interface through the first data forwarding path; and the first target data is sent to the bus device and each driver to be monitored through the second data transceiver path.
[0121] The first target data is sent to the protocol processing module through the first protocol processing sending path, so that the protocol processing module performs protocol processing on the first target data and generates first protocol processing feedback data. The first protocol processing feedback data is sent to the first communication interface through the first protocol processing feedback path, and then sent to the host computer through the first data forwarding path.
[0122] When the target operating mode is host computer control mode, the host computer only controls the target driver and only controls each driver to be monitored through the target driver. It only receives the first protocol processing feedback data output by the target driver and does not receive the host computer control feedback data generated by each driver to be monitored. That is, it only controls each driver to be monitored without monitoring it.
[0123] Specifically, when the target operating mode is host computer control mode, the target driver can receive the first target data, including host computer control data, output by the host computer through the first data transceiver path, and then forward the first target data to the second communication interface through the first data forwarding path. Then, the first target data is transmitted to the bus device and each driver to be monitored through the second data transceiver path. In this way, the bus device and all drivers to be monitored can receive the first target data and operate based on the first target data, so that the host computer can control each driver to be monitored through the host computer control data, and the bus device can also monitor the host computer's control process and control results for each driver to be monitored.
[0124] The first target data includes host computer control data output by the host computer to control each driver to be monitored and the target driver.
[0125] In addition, the first target data output by the host computer also includes host computer control data for controlling the target driver. The first protocol processing transmission path in the target driver transmits the first target data to the protocol processing module. The protocol processing module generates corresponding first protocol processing feedback data after performing protocol processing based on the host computer debugging data and transmits it to the first communication interface through the first protocol processing feedback path. Then, it feeds back to the host computer through the first data transmission and reception path, so that the host computer can control and monitor the target driver to realize the debugging of the target driver by the host computer.
[0126] Please refer to Figure 6 , Figure 6 This is a schematic diagram of data transmission in the second type of driver provided in this application. Taking driver n as the target driver as an example, the host computer sends the first target data, including host computer control data, to driver n through the Rx terminal connected to the first communication interface. Driver n directly forwards the first target data to the Tx terminal connected to the second communication interface, so that the Tx terminal connected to the second communication interface transmits the first target data to the bus device and each driver to be monitored, so that each driver to be monitored can run based on the first target data, realize the host computer's control over each driver to be monitored, and the bus device can also monitor each driver to be monitored. On the other hand, the CPU in driver n performs protocol processing on the first target data and generates first protocol processing feedback data, which is fed back to the host computer through the Tx terminal, so that the host computer can control and monitor driver n.
[0127] Please refer to Figure 7 , Figure 7The diagram illustrates the second type of driver connection provided in this application. In the host computer control mode, the target driver, i.e., driver n, is equivalent to driver n and a unidirectional USB-485 conversion device. Through this USB-485 conversion device, the host computer is unidirectionally connected to the bus device and each driver to be monitored. That is, the first target data output by the host computer can be transmitted to the bus device and each driver to be monitored through the USB-485 conversion device. However, large data output by each driver to be monitored cannot be transmitted to the host computer through the USB-485 conversion device. The host computer is only used to control the drivers to be monitored, not to monitor them.
[0128] Based on this, the host computer control mode enables the host computer to control the target driver and each driver to be monitored. In other words, the user can actively output different control data through the host computer, thereby flexibly and variablely controlling the target driver and each driver to be monitored.
[0129] As a preferred embodiment, after communication is established between the first communication interface and the second communication interface, a data forwarding path is established between the first communication interface and the second communication interface, including:
[0130] After establishing communication between the first communication interface and the second communication interface, a second data forwarding path is established between the first communication interface and the second communication interface. The second data forwarding path is used to forward the data received by the second communication interface to the first communication interface.
[0131] The second communication interface can receive data from the bus device and each monitored driver through the second data transceiver path, and then forward it to the first communication interface through the second data forwarding path, and then transmit it to the host computer through the first data transceiver path, so as to realize the transmission of data output from the bus device and each monitored driver to the host computer.
[0132] In a preferred embodiment, the target driver includes a protocol processing module, and the method further includes:
[0133] After establishing communication between the first communication interface and the second communication interface, a second protocol processing sending path and a second protocol processing feedback path are also established between the protocol processing module and the second communication interface.
[0134] The bus device can control and monitor not only individual drivers but also the target driver. Therefore, the target driver incorporates a protocol processing module. After receiving data from the bus device via a second data transceiver path, the target driver sends it to the protocol processing module via a second protocol processing transmission path. The protocol processing module processes the data and then feeds it back to the second communication interface via a second protocol processing feedback path. Finally, it feeds back to the bus device via the second data transceiver path, thus enabling the bus device to control and monitor the target driver. The protocol processing module within the target driver can be a Modbus protocol processing module. The CPU can process USB serial port data and / or 485 serial port data according to the Modbus protocol and generate corresponding feedback data, i.e., bus control feedback data. Based on this, the target driver can be controlled by the data output from the bus device; that is, the target driver can respond to the control of the bus device.
[0135] As a preferred embodiment, the target operating mode is the host computer monitoring mode;
[0136] In host computer monitoring mode:
[0137] The second target data is acquired from the bus device or one of the monitored drivers through the second data transceiver path; the second target data is forwarded to the first communication interface through the second data forwarding path; and the second target data is sent to the host computer through the first data transceiver path.
[0138] Furthermore, the second target data is sent to the protocol processing module via the second protocol processing transmission path, so that the protocol processing module performs protocol processing on the second target data and generates second protocol processing feedback data. The second protocol processing feedback data is then sent to the second communication interface via the second protocol processing feedback path, and the second protocol processing feedback data is sent to the bus device via the second data forwarding path.
[0139] When the target operating mode is host computer monitoring mode, the bus device acts as the master station to control each driver to be monitored and the target driver. Therefore, the target driver can also be one of the drivers to be monitored controlled by the bus device. The target driver can receive the second target data output by the bus device, which includes bus device control data and bus control feedback data output by each driver to be monitored, through the second data transceiver path. Then, it forwards the second target data to the first communication interface through the second data forwarding path, and then transmits the second target data to the host computer through the first data transceiver path. The host computer can then receive the second target data and monitor the bus device and all drivers to be monitored based on the second target data.
[0140] In addition, the second target data output by the bus device and all the drivers to be monitored also includes bus device debugging data for debugging the target driver. The second protocol processing transmission path in the target driver transmits the target data to the protocol processing module. The protocol processing module performs protocol processing based on the bus device debugging data, generates corresponding second protocol processing feedback data, and transmits it to the second communication interface through the second protocol processing feedback path. Then, it feeds back to the bus device through the second data transmission and reception path, so that the bus device can control and monitor the target driver, thereby realizing the debugging of the target driver by the host computer.
[0141] After the bus device outputs the second target data, each driver to be monitored extracts the bus control data corresponding to its own ID from the second target data, runs it, and generates the corresponding second protocol processing feedback data to the target bus. The target driver also transmits the second target data to the host computer so that the host computer can determine how the bus device controls each driver to be monitored and the target driver based on the bus control data in the second target data. In other words, the host computer can monitor the control process of the bus device on each driver to be monitored and the target driver.
[0142] In addition, after each monitored driver extracts the bus control data corresponding to its own ID from the second target data and runs it, it can also generate corresponding bus control feedback data to the bus device. Of course, the bus control feedback data generated by each monitored driver and the target driver includes their respective IDs, so that the bus device can distinguish the bus control feedback data corresponding to each monitored driver and the target driver respectively, thereby monitoring each monitored driver and the target driver.
[0143] Please refer to Figure 8 , Figure 8 This is a schematic diagram of data transmission in the third type of driver provided in this application. Taking driver n as the target driver as an example, the bus device transmits the second target data to the target driver and each driver to be monitored. The second target data includes bus control data that corresponds to the IDs of all drivers to control different drivers. Figure 8In the diagram, A and B are the second communication ports connecting the target driver to the target bus. After receiving the second target data, the Rx terminal in the target driver, connected to the second communication interface, directly transmits the second target data to the Tx terminal connected to the first communication interface. This allows the Tx terminal to transmit the second target data to the host computer via the first data transmission path, enabling the host computer to monitor the bus device's control over each driver to be monitored and the target driver. On the other hand, the protocol processing module in the target driver determines the bus control data corresponding to ID(n) from the second target data, performs protocol processing, and generates second protocol processing feedback data. This second protocol processing feedback data is transmitted to the bus device by the Tx terminal connected to the second communication interface, enabling the bus device to monitor the target driver. Of course, the CPU in each driver to be monitored on the target bus can also determine the bus control data corresponding to the ID of the driver to be monitored from the bus control data, perform protocol processing, and generate bus control feedback data. This bus control feedback data is transmitted to the bus device by the Tx terminal connected to the second communication interface, enabling the bus device to monitor each driver to be monitored.
[0144] Please refer to Figure 9 , Figure 9 The diagram illustrates the third type of driver connection provided in this application. In the host computer monitoring mode, the target driver, i.e., driver n, is equivalent to driver n itself and a unidirectional USB-485 conversion device. Through this USB-485 conversion device, the host computer is unidirectionally connected to the bus device and each driver to be monitored. That is, the second target data output by the bus device and the driver to be monitored can be transmitted to the host computer through the USB-485 conversion device.
[0145] Furthermore, the target driver can, according to settings, transmit the bus control feedback data generated by each monitored driver and the second protocol processing feedback data generated by the target driver to the host computer. This allows not only the bus device to acquire the bus control feedback data and the second protocol processing feedback data from each monitored driver and the target driver for monitoring, but also the host computer to process the received bus control data, the bus control feedback data generated by each monitored driver and the target driver, and the second protocol processing feedback data to determine how the bus device controls the target driver and each monitored driver, and how the target driver and each monitored driver operate according to the bus control data in the second target data. In other words, this enables the host computer to monitor the operation of the target driver and each monitored driver. Of course, whether the host computer needs to acquire the bus control feedback data generated by each monitored driver and the target driver depends on actual needs, and this application does not impose any limitations on this.
[0146] In this embodiment, the second target data includes bus control data of the bus device controlling each driver to be monitored and the target driver. It may also include driver monitoring result data sent by the bus device to the host computer, so that the host computer can know the working status of each driver through the driver monitoring result data.
[0147] Based on this, the host computer monitoring mode can ensure that the master station device of the target bus is the bus device. That is, when the master station device controls each driver to be monitored to work in the actual production line, the host computer can also monitor the process of the bus device controlling each driver to be monitored.
[0148] In a preferred embodiment, a bus device is also configured on the target bus, the bus device is connected to the target bus, and the target working mode is serial port conversion mode;
[0149] In serial port conversion mode:
[0150] The first target data is obtained from the host computer through the first data transceiver path; the first target data is forwarded to the second communication interface through the first data forwarding path; and the first target data is sent to the bus device and each driver to be monitored through the second data transceiver path.
[0151] The second target data is obtained from each monitored driver through the second data transceiver path; the second target data is forwarded to the first communication interface through the second data forwarding path; and the second target data is sent to the host computer through the first data transceiver path.
[0152] When the target operating mode is serial port conversion mode, the target driver can receive the first target data output by the host computer through the first data transceiver path, then forward the first target data to the second communication interface through the first data forwarding path, and then transmit the first target data to the bus device and each driver to be monitored through the second data transceiver path. Then, the bus device and all drivers to be monitored can receive the first target data and operate based on the first target data, thereby generating second target data and sending it to the target driver through the second data transceiver path. The second data forwarding path in the target driver forwards the second target data to the first communication interface, and then feeds the second target data back to the host computer through the first data transceiver path. This allows the host computer to not only control each driver to be monitored through the first target data, but also determine the control result or control effect of controlling each driver to be monitored based on the second target data, so as to realize the host computer's debugging of each driver to be monitored. The bus device can also monitor the debugging process and results of the host computer on each driver to be monitored.
[0153] Please refer to Figure 10 , Figure 10This is a schematic diagram of data transmission in the fourth type of driver provided in this application. Taking driver n as the target driver as an example, the host computer sends the first target data, including host computer control data, to driver n through the Rx terminal connected to the first communication interface. Driver n directly transmits the first target data to the Tx terminal connected to the second communication interface, so that the Tx terminal connected to the second communication interface transmits the first target data to the bus device and each driver to be monitored. This allows each driver to be monitored to operate based on the first target data and generate second target data, enabling the host computer to control each driver to be monitored. The Rx terminal connected to the second communication interface in driver n obtains the second target data and directly transmits the second target data to the Tx terminal connected to the first communication interface, so that the Tx terminal connected to the first communication interface transmits the second target data to the host computer, enabling the host computer to monitor the operation of each driver to be monitored. Of course, the bus device can also receive the first target data and the second target data to monitor each driver to be monitored.
[0154] Please refer to Figure 11 , Figure 11 This is a schematic diagram of the fourth type of driver connection provided in this application. In serial port conversion mode, the target driver, i.e., driver n, is equivalent to only one bidirectional USB-485 conversion device. Through this USB-485 conversion device, the host computer is connected to the bus device and each driver to be monitored. That is, the first target data output by the host computer can be transmitted to the bus device and each driver to be monitored through the USB-485 conversion device, and the second target data output by each driver to be monitored can also be transmitted to the host computer through the USB-485 conversion device. Furthermore, at this time, the target driver does not perform protocol processing on the first and second target data; it only serves as a medium for data transmission.
[0155] The first target data includes the host computer control data of the host computer controlling each driver to be monitored, while the second target data includes the first host computer control feedback data generated by each driver to be monitored after running based on the first target data, that is, the running data or working data. Based on this, the host computer can control and monitor each driver to be monitored, but cannot control or monitor the target driver.
[0156] The target driver and all monitored drivers can be configured on the same bus, while the host computer only controls and monitors all monitored drivers on the bus except the target driver. Alternatively, the target driver and monitored drivers can be configured on different buses. The monitored drivers can be configured on the first bus, while the target driver is only connected to the first bus and is not controlled by the control data on the first bus, but rather by the host computer or bus devices on the second bus. Based on this, the serial port conversion mode allows the target driver to remain under the control of its corresponding bus device while simultaneously transferring data between the host computer and the target bus. This means that without affecting the normal operation of the target driver, the host computer can monitor, control, or debug all monitored drivers on the target bus. Furthermore, the host computer can monitor, control, or debug various monitored drivers on different buses through a single target driver, saving costs.
[0157] In a preferred embodiment, after receiving the working mode switching instruction and entering the target working mode corresponding to the working mode switching instruction, the method further includes:
[0158] The master station switching command sent by the host computer is received through the first data transceiver path, and the master station switching command is forwarded to the second communication interface through the data forwarding path. The master station switching command is then sent to the bus device through the second data transceiver path, suspending the bus device's control over each driver to be monitored on the target bus.
[0159] Considering that each bus can only have one master device, under normal operating conditions, the bus device typically controls and monitors the various drivers on the target bus. When the host computer controls or debugs the drivers to be monitored and the target drivers, the host computer acts as the master device on the target bus. To ensure the host computer's control over the target drivers and the drivers to be monitored, the target drivers can receive the master switch command sent by the host computer through the first data transceiver path, and forward the master switch command to the second communication interface through the data forwarding path, and then transmit it to the bus device through the second data transceiver path. After receiving the master switch command, the bus device suspends control over the drivers to be monitored. Of course, when the host computer acts as the master, the bus device can also act as a slave, controlled by the host computer, or monitor the host computer's control and monitoring process.
[0160] The master station switching command can be a manually input switching command or a command output by the target driver when it reads the control data of the driver to be monitored from the first target data.
[0161] In addition, whether the host computer or the bus device is the master station of the target bus, a redundant host computer can be selected to connect to the monitoring driver. The redundant host computer can connect to the bus device and each driver to be monitored through the monitoring driver. Although the redundant host computer does not control each driver, it can obtain and monitor the data output by the host computer, the driver to be monitored, and the bus device.
[0162] Please refer to Figure 12 , Figure 12 A schematic diagram of a target driver provided in this application includes:
[0163] Memory 121 is used to store computer programs;
[0164] The processor 122 is configured to implement the steps of the driver online method based on multi-protocol communication as described above when executing a computer program.
[0165] For a description of the target driver provided by this invention, please refer to the above method embodiments; the invention itself will not be described in detail here.
[0166] To solve the above technical problems, the present invention provides a driver online device based on multi-protocol communication, wherein the target driver communicates with the host computer through a first communication interface and communicates with the bus device and each driver to be monitored through a second communication interface.
[0167] The host computer is used for:
[0168] When the target driver is working in host computer debugging mode or serial port conversion mode, at least one virtual driver to be monitored is virtualized.
[0169] While sending the host computer debugging data or host computer communication data to each monitored driver and bus device through the target driver, the host computer debugging data or host computer communication data is input to each virtual monitored driver.
[0170] While acquiring the first host computer debugging feedback data or host computer communication feedback data sent by each monitored driver through the target driver, the debugging virtual feedback data or communication virtual feedback data generated by each virtual monitored driver based on the host computer debugging data or host computer communication data is also acquired.
[0171] The host computer debugging feedback data is the data generated by each driver to be monitored based on the host computer debugging data; the host computer communication feedback data is the data generated by each driver to be monitored based on the host computer communication data.
[0172] Considering that when the host computer is debugging the individual monitored drivers, if some drivers go offline due to malfunction or other reasons, the actual number of monitored drivers in the scenario may be less than the target number. Therefore, the host computer cannot debug all monitored drivers simultaneously. If the monitored drivers operate in a collaborative mode, the absence of some drivers may cause the monitored drivers in the actual scenario to malfunction as well. Based on this, the host computer can also simulate at least one virtual monitored driver, which is a virtual model of a monitored driver that is not present in the actual scenario.
[0173] While outputting host computer debugging data to debug each driver to be monitored, the host computer also inputs host computer debugging data to the virtual drivers to be monitored. The host computer controls each driver to be monitored and each virtual driver to be monitored at the same time. While receiving the first host computer control feedback data output by each driver to be monitored through the target driver, it also obtains the debugging virtual feedback data output by each virtual driver to be monitored, so as to monitor the debugging process and debugging results of each driver to be monitored and each virtual driver to be monitored, and determine whether multiple drivers to be monitored and multiple virtual drivers to be monitored can work together.
[0174] The host computer communicates with each monitored driver by outputting host computer communication data to control the monitored drivers. Simultaneously, the host computer also inputs host computer communication data to the virtual monitored drivers. The host computer controls both the monitored drivers and the virtual monitored drivers. It receives communication feedback data from the host computer through the target drivers and also acquires virtual communication feedback data from the virtual monitored drivers. This allows for control and monitoring of both the monitored drivers and the virtual monitored drivers, determining whether they can work collaboratively.
[0175] For example, in a real-world scenario, driver 1, driver 2, and driver 3 are configured on the target bus, and virtual driver 4 and virtual driver 5 are simulated in the host computer. The host computer not only controls and monitors driver 1, driver 2, and driver 3, but also controls and monitors virtual driver 4 and virtual driver 5 to determine whether driver 1, driver 2, driver 3, virtual driver 4, and virtual driver 5 can work together.
[0176] In a preferred embodiment, the host computer is also used for:
[0177] Virtualize each monitored driver when the target driver is operating in host computer control mode or host computer monitoring mode;
[0178] The system receives bus control data from the target driver and inputs the bus control data to each virtual driver to be monitored, and determines the virtual bus control feedback data generated by each virtual driver to be monitored based on the bus control data.
[0179] Alternatively, while sending host computer control data to each monitored driver through the target driver, host computer control data is also input to each virtual monitored driver, and virtual feedback data of host computer control generated by each virtual monitored driver based on the host computer control data is received.
[0180] When the host computer only receives bus control data output from the bus devices to control each monitored driver, but does not receive bus control feedback data from each monitored driver based on the bus control data, the host computer cannot determine whether each monitored driver can execute the bus control data normally. When the host computer only sends host computer control data to each monitored driver through the target driver, but does not receive host computer control feedback data generated by each monitored driver after running based on the host computer control data, the host computer cannot determine whether each monitored driver can execute the host computer control data normally.
[0181] Based on this, the host computer virtualizes each driver to be monitored, that is, it uses software algorithms to create a one-to-one virtual representation of each driver to be monitored. When the bus device sends bus control data to each actual driver to be monitored, the target driver also transmits a second target data, including the bus control data, to the host computer. The host computer then inputs the bus control data to each virtual driver to be monitored. Each virtual driver to be monitored operates based on the bus control data and generates virtual bus control feedback data. The host computer can then infer the bus control feedback of each actual driver to be monitored based on the virtual bus control feedback data output by each virtual driver to be monitored. The data is used to determine whether each monitored driver can execute the bus control data normally. The host computer sends the host computer control data to each actual monitored driver through the target driver, and at the same time, it inputs the host computer control data to each virtual monitored driver. The virtual monitored drivers run based on the host computer control data and generate host computer control virtual feedback data. The host computer can infer the host computer control feedback data of each actual monitored driver based on the host computer control virtual feedback data output by each virtual monitored driver, so as to determine whether each monitored driver can execute the host computer control data normally.
[0182] For example, in a real-world scenario, driver 1, driver 2, and driver 3 are configured on the target bus. The host computer then virtualizes each driver on a one-to-one basis, including virtual driver 1, virtual driver 2, and virtual driver 3. When the first target data sent by the host computer is the host computer control data that enables driver 1 to start, this host computer control data is transmitted not only to driver 1 in the real-world scenario but also to virtual driver 1. If virtual driver 1 starts normally, it can be determined that driver 1 in the real-world scenario has also started, thereby enabling the monitoring of the real driver 1.
[0183] It should be noted that an additional redundant host computer can be set up to virtualize the driver to be monitored and the virtual driver to be monitored. That is, the host computer is only responsible for outputting host computer control data or receiving bus control data. The redundant host computer uses software algorithms to virtualize the driver to be monitored and the virtual driver to be monitored, thereby reducing the workload of the host computer and improving its working efficiency.
[0184] Of course, the redundant host computer can also be used only as a device to monitor the process of data interaction between the host computer and each driver to be monitored. This application does not limit this. Under the premise that there is at most one master station for control on a bus, each driver can be connected to a host computer for monitoring.
[0185] Please refer to Figure 13 , Figure 13 This is a schematic diagram of a computer-readable storage medium provided in this application. The computer-readable storage medium 131 of this invention stores a computer program 132. When the computer program 132 is executed by the processor 122, it implements the steps of the driver method based on multi-protocol communication as described above.
[0186] For a description of the computer-readable storage medium provided by the present invention, please refer to the above method embodiments; the present invention will not be described again here.
[0187] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0188] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for driver on-line based on multi-protocol communication, characterized in that, Applied to a target driver, the target driver is connected to a host computer via a first communication interface, and the target driver is connected to a bus device and each driver to be monitored via a second communication interface; The method includes: Upon receiving a working mode switching instruction, the system enters the target working mode corresponding to the working mode switching instruction. In the target working mode, a first data transmission and reception path is established between the first communication interface and the host computer, and a second data transmission and reception path is established between the second communication interface and the bus device and each driver to be monitored; after communication is established between the first communication interface and the second communication interface, a data forwarding path is established between the first communication interface and the second communication interface. The host computer is configured to: when the target driver is operating in the target working mode, simulating at least one virtual driver to be monitored; simultaneously sending host computer data to each of the drivers to be monitored and the bus device through the target driver, and inputting the host computer data to each of the virtual drivers to be monitored; simultaneously acquiring feedback data from each of the drivers to be monitored through the target driver, and acquiring feedback data generated by each of the virtual drivers to be monitored based on the host computer data.
2. The multi-protocol communication based driver onlining method of claim 1, wherein, After establishing communication between the first communication interface and the second communication interface, a data forwarding path is established between the first communication interface and the second communication interface, including: After establishing communication between the first communication interface and the second communication interface, a first data forwarding path and a second data forwarding path are established between the first communication interface and the second communication interface. The first data forwarding path is used to forward the data received by the first communication interface to the second communication interface, and the second data forwarding path is used to forward the data received by the second communication interface to the first communication interface.
3. The multi-protocol communication based driver on-line method of claim 2, wherein, The target driver includes a protocol processing module, and the method further includes: After establishing communication between the first communication interface and the second communication interface, a first protocol processing sending path and a first protocol processing feedback path are also established between the protocol processing module and the first communication interface, and a second protocol processing sending path and a second protocol processing feedback path are also established between the protocol processing module and the second communication interface.
4. The multi-protocol communication based driver on-line method of claim 3, wherein, The target operating mode is the host computer debugging mode; In the host computer debugging mode: The first target data is obtained from the host computer through the first data transmission and reception path; The first target data is forwarded to the second communication interface via the first data forwarding path; The first target data is sent to the bus device and each driver to be monitored via the second data transceiver path; The second target data is obtained from each driver to be monitored through the second data transmission and reception path; The second target data is forwarded to the first communication interface via the second data forwarding path; the second target data is sent to the host computer via the first data transmission and reception path. The first target data is sent to the protocol processing module through the first protocol processing sending path, so that the protocol processing module performs protocol processing on the first target data and generates first protocol processing feedback data. The first protocol processing feedback data is sent to the first communication interface through the first protocol processing feedback path, and then sent to the host computer through the first data transmission and reception path. The second target data is sent to the protocol processing module through the second protocol processing transmission path, so that the protocol processing module performs protocol processing on the second target data and generates second protocol processing feedback data. The second protocol processing feedback data is sent to the second communication interface through the second protocol processing feedback path, and then sent to the bus device and each of the drivers to be monitored through the second data transceiver path.
5. The multi-protocol communication based driver on-line method of claim 1, wherein, After establishing communication between the first communication interface and the second communication interface, a data forwarding path is established between the first communication interface and the second communication interface, including: After establishing communication between the first communication interface and the second communication interface, a first data forwarding path is established between the first communication interface and the second communication interface. The first data forwarding path is used to forward the data received by the first communication interface to the second communication interface.
6. The multi-protocol communication based driver on-line method of claim 5, wherein, The target driver includes a protocol processing module, and the method further includes: After establishing communication between the first communication interface and the second communication interface, a first protocol processing sending path and a first protocol processing feedback path are also established between the protocol processing module and the first communication interface.
7. The multi-protocol communication based driver on-line method of claim 6, wherein, The target operating mode is a host computer control mode; In the host computer control mode: The first target data is obtained from the host computer through the first data transmission and reception path; the first target data is forwarded to the second communication interface through the first data forwarding path; The first target data is sent to the bus device and each driver to be monitored via the second data transceiver path; The first target data is sent to the protocol processing module through the first protocol processing sending path, so that the protocol processing module performs protocol processing on the first target data and generates first protocol processing feedback data. The first protocol processing feedback data is sent to the first communication interface through the first protocol processing feedback path, and then sent to the host computer through the first data transmission and reception path.
8. The multi-protocol communication based driver onlining method of claim 1, wherein, After establishing communication between the first communication interface and the second communication interface, a data forwarding path is established between the first communication interface and the second communication interface, including: After establishing communication between the first communication interface and the second communication interface, a second data forwarding path is established between the first communication interface and the second communication interface. The second data forwarding path is used to forward the data received by the second communication interface to the first communication interface.
9. The multi-protocol communication based driver on-line method of claim 8, wherein, The target driver includes a protocol processing module, and the method further includes: After establishing communication between the first communication interface and the second communication interface, a second protocol processing sending path and a second protocol processing feedback path are also established between the protocol processing module and the second communication interface.
10. The multi-protocol communication based driver on-line method of claim 9, wherein, The target operating mode is the host computer monitoring mode; In the host computer monitoring mode: The second target data is obtained from the bus device or one of the monitored drivers through the second data transceiver path; the second target data is forwarded to the first communication interface through the second data forwarding path; and the second target data is sent to the host computer through the first data transceiver path. Furthermore, the second target data is sent to the protocol processing module through the second protocol processing transmission path, so that the protocol processing module performs protocol processing on the second target data and generates second protocol processing feedback data. The second protocol processing feedback data is then sent to the second communication interface through the second protocol processing feedback path, and the second protocol processing feedback data is sent to the bus device through the second data transceiver path.
11. The multi-protocol communication based driver onlining method of claim 1, wherein, The target operating mode is serial port conversion mode; In the serial port conversion mode: The first target data is obtained from the host computer through the first data transmission and reception path; the first target data is forwarded to the second communication interface through the first data forwarding path; The first target data is sent to the bus device and each driver to be monitored via the second data transceiver path; The second target data is obtained from each driver to be monitored through the second data transmission and reception path; The second target data is forwarded to the first communication interface via the second data forwarding path; the second target data is sent to the host computer via the first data transmission and reception path.
12. The multi-protocol communication based driver on-line method according to any one of claims 4, 7 and 11, wherein, After receiving a working mode switching instruction and entering the target working mode corresponding to the instruction, the process further includes: The system receives the master station switching command sent by the host computer through the first data transceiver path, and forwards the master station switching command to the second communication interface through the first data forwarding path, so as to send the master station switching command to the bus device through the second data transceiver path, thereby suspending the bus device's control over each of the monitored drivers.
13. A target driver, comprising: include: Memory, used to store computer programs; A processor, configured to, when executing a computer program, implement the steps of the driver online method based on multiprotocol communication as described in any one of claims 1-12.
14. A driver on-line system based on multi-protocol communication, characterized by, Including the target driver as described in claim 13, it also includes a host computer, a bus device, and a target bus; The target driver is connected to the host computer via a first communication interface and to the bus device and each driver to be monitored via a second communication interface. The host computer is used for: When the target driver is operating in host computer debugging mode or serial port conversion mode, at least one virtual driver to be monitored is virtualized; While sending the host computer debugging data or host computer communication data to each of the monitored drivers and the bus device through the target driver, the host computer debugging data or host computer communication data is also input to each of the virtual monitored drivers. While acquiring the first host computer debugging feedback data or host computer communication feedback data sent by each of the monitored drivers through the target driver, the debugging virtual feedback data or communication virtual feedback data generated by each of the virtual monitored drivers based on the host computer debugging data or host computer communication data is also acquired. The host computer debugging feedback data is the data generated by each of the monitored drivers based on the host computer debugging data; The host computer communication feedback data is data generated by each of the monitored drivers based on the host computer communication data.
15. The multi-protocol communications based drive online system of claim 14, wherein, The host computer is also used for: When the target driver is operating in host computer control mode or host computer monitoring mode, each of the monitored drivers is virtualized; The target driver receives bus control data and inputs the bus control data to each of the virtual drivers to be monitored, and determines the virtual bus control feedback data generated by each of the virtual drivers to be monitored based on the bus control data. Alternatively, while sending host computer control data to each of the monitored drivers through the target driver, the host computer control data is also input to each of the virtual monitored drivers, and virtual host computer control feedback data generated by each of the virtual monitored drivers based on the host computer control data is received.
Citation Information
Patent Citations
Network card monitoring method, device, system and equipment of baseboard management controller
CN116881072A
Power distribution area energy optimization system
CN119093350A