Driver online method based on multi-protocol communication, target driver and system
By establishing data transmission and reception and protocol processing paths under the multi-protocol communication interface by the target driver, the problem of inability to monitor multiple drivers at the same time in the prior art is solved, and the simultaneous control and monitoring of bus devices and multiple drivers by the upper computer is realized, thereby improving the reliability and flexibility of the system.
Patent Information
- Application Number
- CN202510818888.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-18
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-06-18
AI Technical Summary
Existing drives cannot monitor multiple devices at the same time, resulting in the inability to identify abnormal operations in time, which may lead to equipment damage and is limited by the number of communication interfaces of the upper computer, so it is impossible to connect with multiple drives at the same time for monitoring.
The target driver is used to connect to the upper computer and the bus device and the driver to be monitored through a multi-protocol communication interface, establish data transmission and reception and protocol processing paths, and realize data transmission and monitoring between the upper computer, the bus device and each driver to be monitored.
The upper computer controls and monitors multiple drivers to be monitored simultaneously, avoiding damage caused by equipment abnormalities and improving the reliability and flexibility of the system.
Smart Images

Figure CN120407456A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data communication, and particularly to a driver online connection method, a target driver, and a system based on multi-protocol communication. Background Art
[0002] Drivers in the prior art are usually equipped with communication interfaces of multiple communication protocols, such as a bus interface of the 485 protocol and a USB (Universal Serial Bus) communication interface, etc. Multiple drivers are connected to a bus device through the bus, and the bus device performs unified scheduling. For example, if a corresponding control program is pre-configured in the bus device, the bus device controls each driver through the bus according to the control program, such as performing data interaction with each driver through the bus. The host computer can be connected to one of the drivers through a USB communication interface, etc., to monitor the working state of the driver.
[0003] However, the driver can only independently process USB data or 485 data, and is limited by the number of communication interfaces of the host computer. The host computer can only be connected to a limited number of drivers and monitor them each time, and cannot monitor other drivers not connected to the bus. That is, the host computer cannot determine the working states of multiple drivers at the same time, which may lead to the inability to timely identify abnormal operation of the driver and cause damage to the driver. Summary of the Invention
[0004] The purpose of the present invention is to provide a driver online connection method, a target driver, and a system based on multi-protocol communication. The target driver can be used as a transmission medium for data transmission between the host computer, the bus device, and each driver to be monitored, so as to realize data communication between the host computer, the bus device, and each driver to be monitored, and enable the host computer to control and monitor the bus device and multiple drivers to be monitored at the same time.
[0005] To solve the above technical problems, the present invention provides a driver online connection method based on multi-protocol communication, which is applied to a target driver. The target driver is communicatively connected to a host computer through a first communication interface, and the target driver is communicatively connected to a bus device and each driver to be monitored through a second communication interface;
[0006] The method includes:
[0007] After receiving a working mode switching instruction, enter a target working mode corresponding to the working mode switching instruction;
[0008] In the target working mode, a first data transceiver path is established between the first communication interface and the host computer, and a second data transceiver path is established between the second communication interface and the bus device and each drive 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 communication is established 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 communication is established 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, a protocol processing module is provided in the target drive, and the method further includes:
[0012] After communication is established between the first communication interface and the second communication interface, a first protocol processing transmission path and a first protocol processing feedback path are established between the protocol processing module and the first communication interface, and a second protocol processing transmission path and a second protocol processing feedback path are established between the protocol processing module and the second communication interface.
[0013] Preferably, the target working mode is the host computer debugging mode;
[0014] In the host computer debugging mode:
[0015] Obtain first target data from the host computer through the first data transceiver path; forward the first target data to the second communication interface through the first data forwarding path; send the first target data to the bus device and each drive to be monitored through the second data transceiver path;
[0016] Obtain second target data from each drive to be monitored through the second data transceiver path; forward the second target data to the first communication interface through the second data forwarding path; send the second target data to the host computer through the first data transceiver path;
[0017] Send the first target data to the protocol processing module through the first protocol processing transmission path, so that the protocol processing module performs protocol processing on the first target data and generates first protocol processing feedback data. Send the first protocol processing feedback data to the first communication interface through the first protocol processing feedback path, and then send the first protocol processing feedback data to the host computer through the first data transceiver path;
[0018] Send the second target data 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. Send the second protocol processing feedback data to the second communication interface through the second protocol processing feedback path, and then send the second protocol processing feedback data to the bus device and each of the monitored drivers through the second data transceiver path.
[0019] Preferably, after establishing communication between the first communication interface and the second communication interface, establish a data forwarding path between the first communication interface and the second communication interface, including:
[0020] After establishing communication between the first communication interface and the second communication interface, establish a first data forwarding path 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, a protocol processing module is provided in the target driver, and the method further includes:
[0022] After establishing communication between the first communication interface and the second communication interface, also establish a first protocol processing transmission path and a first protocol processing feedback path between the protocol processing module and the first communication interface.
[0023] Preferably, the target working mode is the host computer control mode;
[0024] In the host computer control mode:
[0025] Obtain the first target data from the host computer through the first data transceiver path; forward the first target data to the second communication interface through the first data forwarding path; send the first target data to the bus device and each of the monitored drivers through the second data transceiver path;
[0026] Send the first target data to the protocol processing module through the sending path processed by the first protocol, so that the protocol processing module processes the first target data and generates first protocol processing feedback data, send the first protocol processing feedback data to the first communication interface through the first protocol processing feedback path, and then send the first protocol processing feedback data 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, establish a second data forwarding path between the first communication interface and 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.
[0029] Preferably, a protocol processing module is provided in the target driver, and the method further includes:
[0030] After establishing communication between the first communication interface and the second communication interface, also establish a second protocol processing sending path and a second protocol processing feedback path between the protocol processing module and the second communication interface.
[0031] Preferably, the target working mode is the host computer monitoring mode;
[0032] In the host computer monitoring mode:
[0033] Obtain second target data from the bus device or one of the drives to be monitored through the second data transceiver path; forward the second target data to the first communication interface through the second data forwarding path; send the second target data to the host computer through the first data transceiver path;
[0034] And, send the second target data to the protocol processing module through the second protocol processing sending path, so that the protocol processing module processes the second target data and generates second protocol processing feedback data, send the second protocol processing feedback data to the second communication interface through the second protocol processing feedback path, and send the second protocol processing feedback data to the bus device through the second data forwarding path.
[0035] Preferably, the target working mode is the serial port conversion mode;
[0036] In the serial port conversion mode:
[0037] Obtain first target data from the host computer through the first data transceiver path; forward the first target data to the second communication interface through the first data forwarding path; send the first target data to the bus device and each monitored driver through the second data transceiver path.
[0038] Obtain second target data from each monitored driver through the second data transceiver path; forward the second target data to the first communication interface through the second data forwarding path; send the second target data 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 after receiving the working mode switching instruction, it further includes:
[0040] Receive the master station switching instruction sent by the host computer through the first data transceiver path, and forward 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 pause the control of each monitored driver by the bus device.
[0041] To solve the above technical problems, the present invention provides a target driver, including:
[0042] A memory for storing a computer program;
[0043] A processor for implementing the steps of the driver online connection method based on multi-protocol communication as described above when executing the computer program.
[0044] To solve the above technical problems, the present invention provides a driver online connection system based on multi-protocol communication, including the target driver as described above, and further including a host computer, a bus device and a target bus;
[0045] The target driver is communicatively connected to the host computer through a first communication interface, and is communicatively connected to the bus device and each monitored driver through a second communication interface;
[0046] The host computer is used for:
[0047] Virtualize at least one virtual monitored driver when the target driver is working in the host computer debugging mode or the serial port conversion mode;
[0048] While sending the host computer debugging data or the host computer communication data to each monitored driver and the bus device through the target driver, input the host computer debugging data or the host computer communication data into each virtual monitored driver;
[0049] While obtaining the first host computer debugging feedback data or host computer communication feedback data sent by each of the to-be-monitored drivers through the target driver, obtain the debugging virtual feedback data or communication virtual feedback data generated by each of the virtual to-be-monitored drivers based on the host computer debugging data or host computer communication data;
[0050] The host computer debugging feedback data is data generated by each of the to-be-monitored drivers based on the host computer debugging data; the host computer communication feedback data is data generated by each of the to-be-monitored drivers based on the host computer communication data.
[0051] Preferably, the host computer is further configured to:
[0052] Virtualize each of the to-be-monitored drivers when the target driver operates in the host computer control mode or the host computer monitoring mode;
[0053] Receive bus control data through the target driver and input the bus control data into each of the virtual to-be-monitored drivers, and determine the bus control virtual feedback data generated by each of the virtual to-be-monitored drivers based on the bus control data;
[0054] Or, while sending the host computer control data to each of the to-be-monitored drivers through the target driver, input the host computer control data into each of the virtual to-be-monitored drivers, and receive the host computer control virtual feedback data generated by each of the virtual to-be-monitored drivers based on the host computer control data.
[0055] The present application provides a driver online connection method, a target driver and a system based on multi-protocol communication. After the target driver enters the corresponding target working mode according to the working mode switching instruction, it communicates with the host computer through the first data transceiver path, communicates with the bus device and each to-be-monitored driver through the second data transceiver path, and forwards data between the host computer, the bus device and each to-be-monitored driver through the data forwarding path, so as to realize the mutual transmission of data between the host computer, the bus device and each to-be-monitored driver. It can be seen that the target driver in the present application can be used as a transmission medium for data transmission between the host computer, the bus device and each to-be-monitored driver, so as to realize data communication between the host computer, the bus device and each to-be-monitored driver, and enable the host computer to control and monitor the bus device and multiple to-be-monitored drivers at the same time. Description of the Drawings
[0056] To more clearly illustrate the embodiments of the present invention, the following will briefly introduce the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0057] Figure 1 Schematic flow chart of a driver online connection method based on multi - protocol communication provided by this application;
[0058] Figure 2 Schematic diagram of a driver connection in the prior art;
[0059] Figure 3 Schematic diagram of data transmission in a driver in the prior art;
[0060] Figure 4 First schematic diagram of data transmission in a driver provided by this application;
[0061] Figure 5 First schematic diagram of a driver connection provided by this application;
[0062] Figure 6 Second schematic diagram of data transmission in a driver provided by this application;
[0063] Figure 7 Second schematic diagram of a driver connection provided by this application;
[0064] Figure 8 Third schematic diagram of data transmission in a driver provided by this application;
[0065] Figure 9 Third schematic diagram of a driver connection provided by this application;
[0066] Figure 10 Fourth schematic diagram of data transmission in a driver provided by this application;
[0067] Figure 11 Fourth schematic diagram of a driver connection provided by this application;
[0068] Figure 12 Schematic diagram of the structure of a target driver provided by this application;
[0069] Figure 13 Schematic diagram of a computer - readable storage medium provided by this application. Detailed implementation manners
[0070] The core of the present invention is to provide a method for connecting a drive online based on multi - protocol communication, a target drive, and a system. The target drive can serve as a transmission medium for data transmission between the host computer, the bus device, and each drive to be monitored, so as to realize data communication between the host computer, the bus device, and each drive to be monitored, enabling the host computer to control and monitor the bus device and multiple drives to be monitored simultaneously.
[0071] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0072] Please refer to Figure 1 , Figure 1 which is a schematic flowchart of a method for connecting a drive online based on multi - protocol communication provided by this application, applied to a target drive. The target drive is communicatively connected to the host computer through a first communication interface, and is communicatively connected to the bus device and each drive to be monitored through a second communication interface;
[0073] The method includes:
[0074] S11: Enter the target working mode corresponding to the working mode switching instruction after receiving the working mode switching instruction;
[0075] Please refer to Figure 2 , Figure 2 which is a schematic diagram of drive connection in the prior art. In the prior art, multiple drives are usually connected to the same bus and are uniformly controlled by the bus device. For example, Figure 2 as shown in Figure 3 , Figure 3It is a schematic diagram of data transmission in a driver in the prior art. In driver n, A and B are 485 communication interfaces connected to the 485 bus. The Rx end connected to the 485 communication interface receives the bus control data sent by the bus device. After the CPU (Central Processing Unit) performs the first protocol processing on the bus control data, it generates bus control feedback data and transmits it to the 485 communication interface through the Tx end. The 485 communication interface sends the bus control feedback data to the 485 bus, and the bus device obtains the bus control feedback data generated by each driver from the 485 bus to monitor each driver. If the user wants to debug driver n or monitor the working data of driver n through the host computer, they can connect to driver n through the communication interface to send host computer control data to driver n or receive the working data of driver n. For example, the host computer is connected to the nth driver n through the USB communication interface, and the host computer control data and the host computer control feedback data are transmitted between the host computer and driver n through the USB communication interface. The Rx end of driver n connected to the USB communication interface receives the host computer control data sent by the host computer. After the CPU performs the second protocol processing on the host computer control data, it generates the host computer control feedback data and then sends it to the host computer through the Tx end connected to the USB communication interface. However, the number of communication interfaces on the host computer is limited, and the host computer cannot be connected to multiple drivers simultaneously, that is, the host computer cannot debug multiple drivers simultaneously and determine the working status of each driver. If a driver has an abnormality and the host computer cannot immediately recognize the abnormality, it may cause damage to the driver.
[0076] To solve the above technical problems, in this application, the target driver is used as a conversion device between different communication interfaces. The target driver is communicatively connected to the host computer through the first communication interface and communicatively connected to the bus device and each driver to be monitored through the second communication interface. That is, the host computer is indirectly communicatively connected to the bus device and each driver to be monitored through the target driver to transmit data between the host computer and the bus device and each driver to be monitored. Among them, the first communication interface connected between the target driver and the host computer can be a USB communication interface, and the second communication interface connected between the target driver and each driver to be monitored and the bus device can be a 485 communication interface. Then the bus connected between the bus device and each driver to be monitored is a 485 communication protocol bus, and the 485 communication protocol can be the Modbus protocol. After receiving the data sent by the host computer through the USB communication interface, the target driver converts it into USB serial port data, and the communication protocol of the USB serial port data is the Modbus protocol. After receiving the data sent by the bus device or each driver to be monitored through the 485 communication interface, the target driver converts it into 485 serial port data, and the communication protocol of the 485 serial port data is the Modbus protocol.
[0077] In addition, multiple drivers to be monitored are configured on one bus. The drivers to be monitored are all connected to the bus through the second communication interface. That is, each driver to be monitored can obtain data from the bus and can also transmit data to the bus. The host computer actually interacts with each driver to be monitored by interacting with the bus, so as to realize the control and monitoring of each driver to be monitored by the host computer.
[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. Of course, multiple target drivers can also be selected. For example, multiple random numbers are generated based on the number of drivers, and the respective drivers corresponding to the random numbers are selected as the target drivers. This application does not make any restrictions in this regard. The target driver can be a driver on the same bus as the bus device and each driver to be monitored, or the target driver can also be a driver not on the same bus as each driver to be monitored and the bus device. For example, the target driver, the driver to be monitored, and the bus device are all drivers on the first bus and are 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 and transmit the data on the first bus to the host computer; or, the target driver is a driver on the first bus and is controlled by the control data on the first bus, but it can also be connected to the second bus through another second communication interface, and the bus device 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 the data on the second bus and transmit it to the host computer, and can also transmit the data sent by the host computer to the second bus to realize the data transmission between the host computer, the bus device, and each driver to be monitored; based on this, the host computer can realize the control and monitoring of the drivers to be monitored and the bus device on different buses only through one target driver.
[0079] Specifically, corresponding working mode switching instructions can be sent to the target driver according to different data communication requirements to switch the working mode of the target driver. The target driver enables data interaction between the host computer, the bus device, and each driver to be monitored in different working modes.
[0080] Among them, the working mode switching instruction can be issued by the host computer, or a human-machine interaction device, such as a keyboard or a touch screen, can be configured for the target driver, and the staff inputs the working mode switching instruction through the human-machine interaction device.
[0081] S12: In the target working mode, establish a first data transceiver path between the first communication interface and the host computer, and establish a second data transceiver path between the second communication interface, the bus device, and each drive to be monitored; after establishing communication between the first communication interface and the second communication interface, establish a data forwarding path between the first communication interface and the second communication interface.
[0082] Establish a first data transceiver path between the first communication interface and the host computer so that the target drive can transmit data to and from the host computer through the first data transceiver path. Establish a second data transceiver path between the first communication interface, the bus device, and each drive to be monitored so that the target drive can transmit data to and from the bus device and each drive to be monitored through the second data transceiver path. In addition, establish a data forwarding path between the first communication interface and the second communication interface to forward the data received by the first communication interface through the first data transceiver path to the second communication interface through the data forwarding path, or forward the data received by the second communication interface to the first communication interface through the data forwarding path, so as to realize data transmission between the host computer, the bus device, and each drive to be monitored.
[0083] According to the different target working modes, it is possible to only forward the data sent by the host computer received through the first data transceiver path to the second communication interface through the data forwarding path, and then send it to the bus device and each drive to be monitored through the second data transceiver path. Then, the bus device and each drive to be monitored can receive the data sent by the host computer, and each drive to be monitored can operate according to the data sent by the host computer, so as to realize the control of each drive to be monitored by the host computer at the same time, and realize the monitoring of the host computer's control of each drive to be monitored by the bus device.
[0084] It is also possible to, according to the different target working modes, only forward the data sent by the bus device and each drive to be monitored through the second data transceiver path to the first communication interface, and then transmit it to the host computer through the first data transceiver path. The data sent by the bus device and each drive to be monitored can be the working data output by each drive to be monitored, such as working voltage or power data, or the control data when the bus device controls each drive to be monitored. Based on this, the host computer can monitor the working data and working status of each drive to be monitored to determine whether each drive to be monitored is working properly.
[0085] In addition, according to different target working modes, after forwarding the data sent by the host computer through the first data transceiver path to the second communication interface, and then through the second data transceiver path to the bus device and each drive to be monitored, the data generated by each drive to be monitored can be received through the second data transceiver path and sent to the first communication interface through the data forwarding path, and then transmitted to the host computer through the first data transceiver path, so that the host computer can not only control each drive to be monitored, but also monitor each drive to be monitored, and the bus device can also monitor each drive to be monitored and the host computer. It should be noted that the data sent by the host computer can be data for controlling or debugging the drive to be monitored, and the data sent by each drive to be monitored can be feedback data generated after the drive to be monitored works according to the data sent by the host computer.
[0086] If there are other devices connected to the drive to be monitored, the other devices can also obtain the data of the target drive during operation through the drive to be monitored to monitor the operation of the target drive.
[0087] It should also be noted that the data transmitted between the host computer, the bus device and each drive to be monitored in this application is not necessarily only data for controlling the drive, but can also be non-control data such as access request data, or feedback data after the drive runs based on the control data, or log data naturally generated during its working state. This application does not make any restrictions on this.
[0088] In summary, the target drive can be used as a transmission medium for data transmission between the host computer, the bus device and each drive to be monitored, so as to realize data communication between the host computer, the bus device and each drive to be monitored, and enable the host computer to control and monitor the bus device and multiple drives to be monitored at the same time.
[0089] Based on the above embodiments:
[0090] As a preferred embodiment, 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:
[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 forward the data sent by the host computer received through the first data transceiver path to the second communication interface through the first data forwarding path, and then transmit it to the bus device and each drive to be monitored through the second data transceiver path; the second communication interface can forward the data sent by the bus device and each drive to be monitored received through the second data transceiver path 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 transmitting the data output by the host computer to the bus device and each drive to be monitored, and transmitting the data output by the bus device and each drive to be monitored to the host computer.
[0093] As a preferred embodiment, a protocol processing module is provided in the target drive, and the method further includes:
[0094] After establishing communication between the first communication interface and the second communication interface, a first protocol processing transmission path and a first protocol processing feedback path are further established between the protocol processing module and the first communication interface, and a second protocol processing transmission path and a second protocol processing feedback path are established between the protocol processing module and the second communication interface.
[0095] Since the target drive is actually also a drive, the host computer can not only control and monitor each drive to be monitored, but also control and monitor the target drive. Therefore, a protocol processing module is provided in the target drive. After receiving the data sent by the host computer through the first data transceiver path, the target drive sends it to the protocol processing module through the first protocol processing transmission path. After the protocol processing module processes the above data, it feeds back to the host computer through the first protocol processing feedback path, realizing the control and monitoring of the target drive by the host computer; the bus device can not only control and monitor each drive to be monitored, but also control and monitor the target drive. Therefore, after receiving the data sent by the bus device through the second data transceiver path, the target drive sends it to the protocol processing module through the second protocol processing transmission path. After the protocol processing module processes the above data, it feeds back to the bus device through the second protocol processing feedback path, realizing the control and monitoring of the target drive by the bus device, so as to determine whether each drive to be monitored and the target drive are working properly. The protocol processing module inside the target drive 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 drive can be controlled by the data sent by the host computer or the data output by the bus device, that is, the target drive can respond to the control of the host computer and the control of the bus device.
[0096] As a preferred embodiment, the target working mode is the host computer debugging mode;
[0097] In the host computer debugging mode:
[0098] Obtain the first target data from the host computer through the first data transceiver path; forward the first target data to the second communication interface through the first data forwarding path; send the first target data to the bus device and each monitored driver through the second data transceiver path;
[0099] Obtain the second target data from each monitored driver through the second data transceiver path; forward the second target data to the first communication interface through the second data forwarding path; send the second target data to the host computer through the first data transceiver path;
[0100] Send the first target data to the protocol processing module through the first protocol processing sending path, so that the protocol processing module processes the first target data and generates the first protocol processing feedback data, send the first protocol processing feedback data to the first communication interface through the first protocol processing feedback path, and then send the first protocol processing feedback data to the host computer through the first data transceiver path;
[0101] Send the second target data to the protocol processing module through the second protocol processing sending path, so that the protocol processing module processes the second target data and generates the second protocol processing feedback data, send the second protocol processing feedback data to the second communication interface through the second protocol processing feedback path, and then send the second protocol processing feedback data to the bus device and each monitored driver through the second data forwarding path.
[0102] Before the drive is officially put into use, the drive can be debugged first. When the target working mode is the host computer debugging mode, the target drive can receive the first target data including the host computer debugging 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 drive to be monitored through the second data transceiver path. Then, the bus device and all drives to be monitored can receive the first target data and perform analysis or operation based on the first target data, so as to generate the second target data including the host computer debugging feedback data and send it to the target drive through the second data transceiver path. The second data forwarding path in the target drive forwards the second target data to the first communication interface, and then feeds back the second target data to the host computer through the first data transceiver path, so that the host computer can not only control each drive to be monitored, but also determine the control result or control effect of controlling each drive to be monitored, so as to realize the debugging of each drive to be monitored by the host computer, and the bus device can also monitor the debugging process and results of the host computer on each drive to be monitored.
[0103] In addition, the first target data output by the host computer also includes the host computer debugging data for debugging the target drive. The first protocol processing sending path in the target drive transmits the first target data to the protocol processing module. After running based on the host computer debugging data, the protocol processing module generates the corresponding first protocol processing feedback data and transmits it to the first communication interface through the first protocol processing feedback path, and then feeds it back to the host computer through the first data transceiver path, so that the host computer can control and monitor the target drive, so as to realize the debugging of the target drive by the host computer, and the bus device can also monitor the debugging process and results of the host computer on each drive to be monitored and the target drive.
[0104] Of course, the target drive can also send the second target data output by the drive to be monitored to the protocol processing module through the second protocol processing sending path, so that the protocol processing module processes the second target data and generates the second protocol processing feedback data, and then feeds it back to the second communication interface through the second protocol processing feedback path, and feeds it back to each drive to be monitored and the bus device through the second data transceiver path. Among them, the second target data can include the communication data between different drives, so as to realize the data interaction between different drives.
[0105] The host computer debugging data in the first target data includes host computer debugging data corresponding to the IDs (Identity document) of each drive to be monitored and the target drive respectively, so that each drive to be monitored and the target drive can respectively obtain the host computer debugging data corresponding to themselves and run. The first host computer debugging feedback data output by each drive to be monitored also includes its respective corresponding ID, so that the host computer and the bus device can distinguish the first host computer debugging feedback data output by different drives to be monitored.
[0106] Please refer to Figure 4 , Figure 4 , which is the schematic diagram of data transmission in the first drive provided by this application. Taking drive n as the target drive as an example, the host computer sends the first target data including the host computer debugging data to drive n through the Rx end connected to the first communication interface in drive n. On the one hand, drive n directly forwards the first target data to the Tx end connected to the second communication interface, so that the Tx end connected to the second communication interface transmits the first target data to the bus device and each drive to be monitored, so that each drive to be monitored runs based on the first target data and generates the second target data including the host computer control feedback data, and feeds back the host computer control feedback data to the host computer and the bus device to realize the control and monitoring of each drive to be monitored by the host computer and the bus device; on the other hand, the CPU in drive n determines the host computer debugging data corresponding to ID(n) from the first target data, generates the first protocol processing feedback data after protocol processing, and the first protocol processing feedback data is transmitted to the host computer by the Tx end connected to the first communication interface, realizing the direct control and monitoring of drive n by the host computer. The CPU of drive n also transmits the first protocol processing feedback data to the bus device and each drive to be monitored, and the bus device can also monitor the debugging process of the host computer for the target drive; drive n directly transmits the second target data received through the Rx end connected to the second communication port to the host computer, or generates the corresponding second protocol processing feedback data after protocol processing of the second target data and then feeds it back to the host computer or the bus device and each drive to be monitored. For example, the CPU in drive n can perform operations such as integrating and processing the second target data and then transmit it to the host computer.
[0107] Please refer to Figure 5 , Figure 5The first schematic diagram of driver connection provided by this application. In the host computer debugging mode, at this time, the target driver, that is, 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 drive to be monitored. That is, the first target data output by the host computer can be transmitted to the bus device and each drive to be monitored through the USB-485 conversion device, and the second target data output by the bus device and each drive to be monitored can also be transmitted to the host computer through the USB-485 conversion device.
[0108] The first target data in this embodiment includes the host computer debugging data output by the host computer for controlling each drive to be monitored and the target drive respectively. Different drives to be monitored and the target drive can obtain the host computer debugging data corresponding to their own IDs from the first target data for operation, and the host computer debugging data corresponding to different drives to be monitored and the target drive can be the same or different, which can be specifically set or adjusted according to actual requirements.
[0109] The second target data is the first host computer control feedback data after each drive to be monitored operates based on the first target data, that is, the operation data after operating based on the first target data. After receiving the second target data, the host computer can determine the operation status of each drive to be monitored and determine whether each drive to be monitored has an abnormality.
[0110] Based on this, the host computer can not only perform mutual data transmission with the target drive, but also perform mutual data transmission with each drive to be monitored through the target drive and the target bus, so as to realize the simultaneous debugging of each drive to be monitored by the host computer.
[0111] Therefore, the host computer debugging mode can enable the host computer to debug each drive to be monitored before the master device controls each drive to be monitored to work in the actual production line, so as to determine whether each drive to be monitored can work normally and whether it can be put into the actual production line.
[0112] As a preferred embodiment, 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:
[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 forward the data sent by the host computer received through the first data transceiver path to the second communication interface through the first data forwarding path, and then transmit it to the bus device and each drive to be monitored through the second data transceiver path, so as to realize the transmission of the data output by the host computer to the bus device and each drive to be monitored.
[0115] As a preferred embodiment, a protocol processing module is provided in the target drive, and the method further includes:
[0116] After establishing communication between the first communication interface and the second communication interface, a first protocol processing transmission 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 drive to be monitored, but also control and monitor the target drive. Therefore, a protocol processing module is provided in the target drive. After receiving the data sent by the host computer through the first data transceiver path, the target drive sends it to the protocol processing module through the first protocol processing transmission path. After the protocol processing module processes the above data, it feeds back to the host computer through the first protocol processing feedback path, realizing the control and monitoring of the target drive by the host computer, so that the host computer can determine whether each drive to be monitored and the target drive are working properly.
[0118] As a preferred embodiment, the target working mode is the host computer control mode;
[0119] In the host computer control mode:
[0120] Obtain the first target data from the host computer through the first data transceiver path; forward the first target data to the second communication interface through the first data forwarding path; send the first target data to the bus device and each drive to be monitored through the second data transceiver path;
[0121] Send the first target data to the protocol processing module through the first protocol processing transmission path, so that the protocol processing module processes the first target data and generates the first protocol processing feedback data, and sends the first protocol processing feedback data to the first communication interface through the first protocol processing feedback path, and then sends the first protocol processing feedback data to the host computer through the first data forwarding path.
[0122] When the target working mode is the host computer control mode, the host computer only controls the target drive and each drive to be monitored only through the target drive, and only receives the first protocol processing feedback data output by the target drive, and does not receive the host computer control feedback data generated by each drive to be monitored, that is, only controls each drive to be monitored without monitoring.
[0123] Specifically, when the target working mode is the host computer control mode, the target driver can receive the first target data including the host computer control 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 monitored driver through the second data transceiver path. In this way, both the bus device and all the monitored drivers can receive the first target data and operate based on the first target data, so that the host computer can control each monitored driver through the host computer control data, and the bus device can also monitor the control process and results of the host computer on each monitored driver.
[0124] Among them, the first target data includes the host computer control data output by the host computer for controlling each monitored driver and the target driver.
[0125] In addition, the first target data output by the host computer also includes the 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. After the protocol processing module performs protocol processing 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, and then feedbacks it to the host computer through the first data transceiver 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 For the second schematic diagram of data transmission in the driver provided in this application, taking driver n as the target driver as an example, the host computer sends the first target data including the host computer control data to driver n through the Rx end connected to the first communication interface in driver n. On the one hand, driver n directly forwards the first target data to the Tx end connected to the second communication interface, so that the Tx end connected to the second communication interface transmits the first target data to the bus device and each monitored driver, so that each monitored driver operates based on the first target data to realize the control of each monitored driver by the host computer, and the bus device can also monitor each monitored driver; on the other hand, the CPU in driver n performs protocol processing on the first target data to generate the first protocol processing feedback data and feedbacks it to the host computer through the Tx end, so that the host computer can control and monitor driver n.
[0127] Please refer to Figure 7 , Figure 7This is the second schematic diagram of driver connection provided by this application. In the host control mode, at this time, the target driver, that is, driver n, is equivalent to driver n and a single-direction USB-485 conversion device. Through this USB-485 conversion device, the host is unidirectionally connected to the bus device and each drive to be monitored. That is, the first target data output by the host can be transmitted to the bus device and each drive to be monitored through the USB-485 conversion device, but the large data output by each drive to be monitored cannot be transmitted to the host through the USB-485 conversion device. The host is only used to control rather than monitor the drives to be monitored.
[0128] Based on this, the host control mode enables the host to control the target driver and each drive to be monitored. That is, the user can actively output different control data through the host, so as to flexibly and variably control the target driver and each drive to be monitored.
[0129] As a preferred embodiment, 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:
[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 forward the data sent by the bus device and each drive to be monitored received through the second data transceiver path to the first communication interface through the second data forwarding path, and then transmit it to the host through the first data transceiver path, so as to realize the transmission of the data output by the bus device and each drive to be monitored to the host.
[0132] As a preferred embodiment, a protocol processing module is provided in the target driver, 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 not only control and monitor each drive to be monitored, but also control and monitor the target drive. Therefore, a protocol processing module is provided in the target drive. After receiving the data sent by the bus device through the second data transceiver path, the target drive sends it to the protocol processing module through the second protocol processing and sending path. After the protocol processing module processes the above data, it feeds back to the second communication interface through the second protocol processing and feedback path, and then feeds back to the bus device through the second data transceiver path, realizing the control and monitoring of the target drive by the bus device. The protocol processing module inside the target drive can be a Modbus protocol processing module. The CPU can process USB serial data and / or 485 serial data according to the Modbus protocol and generate corresponding feedback data, that is, bus control feedback data. Based on this, the target drive can be controlled by the data output by the bus device, that is, the target drive can respond to the control of the bus device.
[0135] As a preferred embodiment, the target working mode is the host computer monitoring mode;
[0136] In the host computer monitoring mode:
[0137] Obtain the second target data from the bus device or one of the drives to be monitored through the second data transceiver path; forward the second target data to the first communication interface through the second data forwarding path; send the second target data to the host computer through the first data transceiver path;
[0138] And, send the second target data to the protocol processing module through the second protocol processing and sending path, so that the protocol processing module processes the second target data and generates second protocol processing feedback data, send the second protocol processing feedback data to the second communication interface through the second protocol processing and feedback path, and send the second protocol processing feedback data to the bus device through the second data forwarding path.
[0139] When the target working mode is the host computer monitoring mode, the bus device acts as the master station to control each drive to be monitored and the target drive. Therefore, the target drive can also be one of the drives to be monitored controlled by the bus device. The target drive can receive the second target data including the bus device control data and the bus control feedback data output by each drive to be monitored sent by the bus device through the second data transceiver path, then forward the second target data to the first communication interface through the second data forwarding path, and then transmit the second target data to the host computer through the first data transceiver path. Then the host computer can receive the second target data and monitor the bus device and all the drives to be monitored based on the second target data.
[0140] In addition, the second target data output by the bus device and all the drives to be monitored also includes the bus device debugging data for debugging the target drive. The second protocol processing transmission path in the target drive transmits the target data to the protocol processing module. The protocol processing module generates corresponding second protocol processing feedback data based on the bus device debugging data after protocol processing and transmits it to the second communication interface through the second protocol processing feedback path, and then feeds it back to the bus device through the second data transceiver path, so that the bus device can control and monitor the target drive to realize the debugging of the target drive by the host computer.
[0141] After the bus device outputs the second target data, each drive to be monitored extracts the bus control data corresponding to its own ID from the second target data for operation and generates; the target drive extracts the bus control data corresponding to its own ID from the second target data for operation, and generates corresponding second protocol processing feedback data to the target bus; the target drive also transmits the second target data to the host computer, so that the host computer can determine how the bus device controls each drive to be monitored and the target drive according to the bus control data in the second target data, that is, the host computer can monitor the control process of the bus device for each drive to be monitored and the target drive.
[0142] In addition, after each drive to be monitored extracts the bus control data corresponding to its own ID from the second target data for operation, it can also generate corresponding bus control feedback data to the bus device. Of course, the bus control feedback data generated by each drive to be monitored and the target drive respectively includes their own IDs, so that the bus device can distinguish the bus control feedback data corresponding to each drive to be monitored and the target drive respectively, so as to monitor each drive to be monitored and the target drive.
[0143] Please refer to Figure 8 , Figure 8 FIG. 3 is a schematic diagram of data transmission in the third drive provided by the present application. Taking the drive n as the target drive as an example, the bus device transmits the second target data to the target drive and each drive to be monitored. The second target data includes bus control data corresponding to the IDs of all drives respectively for controlling different drives. Figure 8A and B in it are the second communication ports where the target driver is connected to the target bus. After the Rx end connected to the second communication interface in the target driver receives the second target data, on the one hand, it directly transmits the second target data to the Tx end connected to the first communication interface, so that the Tx end connected to the first communication interface transmits the second target data to the host computer through the first data transceiver path, enabling the host computer to monitor the control of the bus device over each drive 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. The second protocol processing feedback data is transmitted by the Tx end connected to the second communication interface to the bus device, enabling the bus device to monitor the target driver. Of course, the CPU in each drive to be monitored on the target bus can determine the bus control data corresponding to the ID of the drive to be monitored from the bus control data, perform protocol processing, and generate bus control feedback data. The bus control feedback data is transmitted by the Tx end connected to the second communication interface to the bus device, enabling the bus device to monitor each drive to be monitored.
[0144] Please refer to Figure 9 , Figure 9 which is the third drive connection schematic diagram provided by this application. In the host computer monitoring mode, at this time, the target driver, that is, driver n, is equivalent to driver n itself and a single USB-485 conversion device. Through this USB-485 conversion device, the host computer is unidirectionally connected to the bus device and each drive to be monitored, that is, the second target data output by the bus device and the drives to be monitored can be transmitted to the host computer through the USB-485 conversion device.
[0145] In addition, the target driver can, according to the setting, transmit the bus control feedback data generated by each drive to be monitored and the second protocol processing feedback data generated by the target driver to the host computer. Then, not only can the bus device obtain the bus control feedback data and the second protocol processing feedback data of each drive to be monitored and the target driver to monitor each drive to be monitored and the target driver, but the host computer can also perform data processing based on the received bus control data, the bus control feedback data and the second protocol processing feedback data generated by each drive to be monitored and the target driver to determine how the bus device controls the target driver and each drive to be monitored, and how the target driver and each drive to be monitored operate according to the bus control data in the second target data, that is, to realize the monitoring of the operation of the target driver and each drive to be monitored by the host computer. Of course, whether the host computer needs to obtain the bus control feedback data generated by each drive to be monitored and the target driver needs to be set according to actual requirements, and this application does not limit this.
[0146] In this embodiment, the second target data includes the bus control data for the bus device to control each drive to be monitored and the target drive. Of course, it may also include the drive monitoring result data sent by the bus device to the host computer, so that the host computer can know the working status of each drive through the drive monitoring result data.
[0147] Based on this, the host computer monitoring mode can ensure that the master device of the target bus is the bus device. That is, when the master device controls each drive to be monitored to work in the actual production line, the host computer can also monitor the process of the bus device controlling each drive to be monitored.
[0148] As 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 the serial port conversion mode;
[0149] In the serial port conversion mode:
[0150] Obtain the first target data from the host computer through the first data transceiver path; forward the first target data to the second communication interface through the first data forwarding path; send the first target data to the bus device and each drive to be monitored through the second data transceiver path;
[0151] Obtain the second target data from each drive to be monitored through the second data transceiver path; forward the second target data to the first communication interface through the second data forwarding path; send the second target data to the host computer through the first data transceiver path.
[0152] When the target working mode is the serial port conversion mode, the target drive 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 drive to be monitored through the second data transceiver path. Then, the bus device and all drives to be monitored can receive the first target data and run based on the first target data, thereby generating the second target data and sending it to the target drive through the second data transceiver path. The second data forwarding path in the target drive forwards the second target data to the first communication interface, and then feeds back the second target data to the host computer through the first data transceiver path, so that the host computer can not only control each drive to be monitored through the first target data, but also determine the control result or control effect of controlling each drive to be monitored according to the second target data, so as to realize the debugging of each drive to be monitored by the host computer, and the bus device can also monitor the debugging process and debugging results of the host computer for each drive to be monitored.
[0153] Please refer to Figure 10 , Figure 10Schematic diagram of data transmission in the fourth driver provided for this application. Taking driver n as the target driver as an example, the host computer sends the first target data including the host computer control data to driver n through the Rx end connected to the first communication interface in driver n. Driver n directly transmits the first target data to the Tx end connected to the second communication interface, so that the Tx end connected to the second communication interface transmits the first target data to the bus device and each monitored driver, so that each monitored driver runs based on the first target data and generates the second target data, realizing the control of each monitored driver by the host computer; the Rx end connected to the second communication interface in driver n obtains the second target data and directly transmits the second target data to the Tx end connected to the first communication interface, so that the Tx end connected to the first communication interface transmits the second target data to the host computer, so that the host computer monitors the operation of each monitored driver. Of course, the bus device can also receive the first target data and the second target data to monitor each monitored driver.
[0154] Please refer to Figure 11 , Figure 11 Schematic diagram of the connection of the fourth driver provided for this application. In the serial port conversion mode, at this time, the target driver, that is, driver n, is only equivalent to 1 bidirectional USB-485 conversion device. Through this USB-485 conversion device, the host computer is connected to the bus device and each monitored driver. That is, the first target data output by the host computer can be transmitted to the bus device and each monitored driver through the USB-485 conversion device, and the second target data output by each monitored driver can also be transmitted to the host computer through the USB-485 conversion device. And at this time, the target driver does not perform protocol processing on the first target data and the second target data, but only serves as a medium for data transmission.
[0155] Among them, the first target data includes the host computer control data for the host computer to control each monitored driver, and the second target data includes the first host computer control feedback data generated after each monitored driver runs 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 monitored driver, but cannot control or monitor the target driver.
[0156] The target drive and each drive to be monitored can also be drives configured on the same bus, and the host computer only controls and monitors all the drives to be monitored on the bus except the target drive. Of course, the target drive and each drive to be monitored may not be drives configured on the same bus. Each drive to be monitored is configured on the first bus, while the target drive is only connected to the first bus and is not controlled by the control data on the first bus, but is controlled by the host computer or the bus device on the second bus. Based on this, the serial port conversion mode can transfer the data between the host computer and the target bus while enabling the target drive to still be controlled by its corresponding bus device, that is, it can enable the host computer to monitor and control, or debug, each drive to be monitored on the target bus without affecting the normal operation of the target drive. Moreover, the host computer can monitor and control, or debug, each drive to be monitored on different buses through a target drive, saving costs.
[0157] As a preferred embodiment, after entering the target working mode corresponding to the working mode switching instruction after receiving the working mode switching instruction, it further includes:
[0158] Receiving the master station switching instruction sent by the host computer through the first data transceiver path, and forwarding 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 suspending the control of each drive to be monitored on the target bus by the bus device.
[0159] Considering that there can be at most one master station device on each bus, usually the bus device controls and monitors each drive on the target bus in the normal working state. When the host computer controls or debugs the drive to be monitored and the target drive, the host computer serves as the master station device on the target bus. To ensure the control of the target drive and each drive to be monitored by the host computer, the target drive can receive the master station switching instruction sent by the host computer through the first data transceiver path, forward the master station switching instruction 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 station switching instruction, the bus device suspends the control of each drive to be monitored. Of course, when the host computer serves as the master station, the bus device can also serve as a slave station and be controlled by the host computer, or monitor the control and monitoring process of the host computer.
[0160] Among them, the master station switching instruction can be a switching instruction input manually, or an instruction output by the target drive when reading the control data for controlling the drive to be monitored from the first target data.
[0161] In addition, whether the host computer or the bus device serves as the master station of the target bus, it can reselect a redundant host computer to connect to the monitoring driver. The redundant host computer can be connected to the bus device and each drive to be monitored through the monitoring driver. Although the redundant host computer does not control each drive, it can obtain the data output by the host computer, the drives to be monitored, and the bus device and perform monitoring.
[0162] Please refer to Figure 12 , Figure 12 which is a schematic structural diagram of a target drive provided by the present application, including:
[0163] A memory 121 for storing computer programs;
[0164] A processor 122 for implementing the steps of the drive online connection method based on multi-protocol communication as described above when executing the computer program.
[0165] For the introduction of the target drive provided by the present invention, please refer to the above method embodiments, and the present invention will not be elaborated herein.
[0166] To solve the above technical problems, the present invention provides a drive online connection device based on multi-protocol communication. The target drive is communicatively connected to the host computer through a first communication interface, and is communicatively connected to the bus device and each drive to be monitored through a second communication interface;
[0167] The host computer is used for:
[0168] Virtualizing at least one virtual drive to be monitored when the target drive operates in the host computer debugging mode or the serial port conversion mode;
[0169] While sending the host computer debugging data or the host computer communication data to each drive to be monitored and the bus device through the target drive, inputting the host computer debugging data or the host computer communication data into each virtual drive to be monitored;
[0170] While obtaining the first host computer debugging feedback data or the host computer communication feedback data sent by each drive to be monitored through the target drive, obtaining the debugging virtual feedback data or the communication virtual feedback data generated by each virtual drive to be monitored based on the host computer debugging data or the host computer communication data;
[0171] The host computer debugging feedback data is the data generated by each drive to be monitored based on the host computer debugging data; the host computer communication feedback data is the data generated by each drive to be monitored based on the host computer communication data.
[0172] When the host computer debugs each monitored drive, if some monitored drives go offline due to faults or other reasons, the number of monitored drives in the actual scenario may be less than the target number. When the host computer debugs each monitored drive, it cannot debug all the monitored drives. If each monitored drive is in a collaborative working mode, the fact that some monitored drives are offline may cause the monitored drives in the actual scenario to malfunction as well. Based on this, the host computer can also virtualize at least one virtual monitored drive, and the virtual monitored drive is a model of a monitored drive that is virtually not in the actual scenario.
[0173] When the host computer outputs host computer debugging data to debug each monitored drive, it also inputs the host computer debugging data into the virtual monitored drive. The host computer controls each monitored drive and each virtual monitored drive simultaneously, and while receiving the first host computer control feedback data output by each monitored drive through the target drive, it obtains the debugging virtual feedback data output by each virtual monitored drive to monitor the debugging process and results of each monitored drive and each virtual monitored drive, and determines whether multiple monitored drives and multiple virtual monitored drives can work together.
[0174] When the host computer outputs host computer communication data to communicate with each monitored drive to control each monitored drive, it also inputs the host computer communication data into the virtual monitored drive. The host computer controls each monitored drive and each virtual monitored drive simultaneously, and while receiving the host computer communication feedback data output by each monitored drive through the target drive, it obtains the communication virtual feedback data output by each virtual monitored drive to control and monitor each monitored drive and each virtual monitored drive, and determines whether multiple monitored drives and multiple virtual monitored drives can work together
[0175] For example, in the actual scenario, drive 1, drive 2, and drive 3 are configured on the target bus, and virtual drive 4 and virtual drive 5 are simulated in the host computer. The host computer not only controls and monitors drive 1, drive 2, and drive 3, but also controls and monitors virtual drive 4 and virtual drive 5 to determine whether drive 1, drive 2, drive 3, virtual drive 4, and virtual drive 5 can work together.
[0176] As a preferred embodiment, the host computer is further configured to:
[0177] Virtualize each monitored drive when the target drive is operating in the host computer control mode or the host computer monitoring mode;
[0178] Receiving bus control data through a target driver and inputting the bus control data into each virtual monitored driver to determine bus control virtual feedback data generated by each virtual monitored driver based on the bus control data;
[0179] Alternatively, when sending host computer control data to each monitored driver through the target driver, inputting the host computer control data into each virtual monitored driver, and receiving host computer control virtual feedback data generated by each virtual monitored driver based on the host computer control data.
[0180] When the host computer only receives bus control data for controlling each monitored driver output by the bus device and does not receive bus control feedback data fed back by 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 and does not receive host computer control feedback data generated after each monitored driver runs 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 monitored driver, that is, virtualizes each monitored driver one by one through software algorithms. When the bus device sends bus control data to each actual monitored driver, the target driver also transmits second target data including the bus control data to the host computer. The host computer inputs the bus control data into each virtual monitored driver. Each virtual monitored driver runs based on the bus control data and generates bus control virtual feedback data. The host computer can reverse-infer the bus control feedback data of each actual monitored driver according to the bus control virtual feedback data output by each virtual monitored driver to determine whether each monitored driver can execute the bus control data normally; when the host computer sends host computer control data to each actual monitored driver through the target driver, it inputs the host computer control data into each virtual monitored driver. Each virtual monitored driver runs based on the host computer control data and generates host computer control virtual feedback data. The host computer can reverse-infer the host computer control feedback data of each actual monitored driver according to the host computer control virtual feedback data output by each virtual monitored driver to determine whether each monitored driver can execute the host computer control data normally.
[0182] For example, in an actual scenario, drivers 1, 2, and 3 are configured on the target bus. Then, the host computer virtually replicates each driver one-to-one, that is, it includes 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 for starting driver 1, this host computer control data is not only transmitted to driver 1 in the actual scenario but also to virtual driver 1. If virtual driver 1 starts normally, it can be determined that driver 1 in the actual scenario has also started, thus realizing the monitoring of the actual driver 1.
[0183] It should be noted that a redundant host computer can also be additionally set up to virtualize the drivers to be monitored and the virtual drivers to be monitored. That is, the host computer is only responsible for outputting the host computer control data or receiving the bus control data, and the redundant host computer virtualizes the drivers to be monitored and the virtual drivers to be monitored through software algorithms, reducing the workload of the host computer and improving the work efficiency of the host computer.
[0184] Of course, the redundant host computer can also be only a device for monitoring the process of data interaction between the host computer and each driver to be monitored. This application does not make any limitations in this regard. On the premise that there is at most one master station for control on a single bus, a host computer can be connected to each driver for monitoring.
[0185] Please refer to Figure 13 , Figure 13 which is a schematic diagram of a computer-readable storage medium provided by this application. A computer program 132 is stored on the computer-readable storage medium 131 in the present invention. When the computer program 132 is executed by the processor 122, it realizes the steps of the above-mentioned driver method based on multi-protocol communication.
[0186] For the introduction of the computer-readable storage medium provided by the present invention, please refer to the above method embodiments, and the present invention will not be elaborated here.
[0187] It should also be noted that in this specification, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.
[0188] The foregoing description of the disclosed embodiments enables those skilled in the art to practice or use the present 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 present invention. Thus, the present invention is not intended 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 driver online connection method based on multi-protocol communication, characterized in that Applied to a target driver, the target driver is communicatively connected to a host computer through a first communication interface, and the target driver is communicatively connected to a bus device and each monitored driver through a second communication interface; The method includes: Entering a target working mode corresponding to the working mode switching instruction after receiving the working mode switching instruction; In the target working mode, establishing a first data transceiver path between the first communication interface and the host computer, and establishing a second data transceiver path between the second communication interface and the bus device and each monitored driver; 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.
2. The method for driving online based on multi-protocol communication according to claim 1, characterized in that, 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, including: After establishing communication between the first communication interface and the second communication interface, establishing a first data forwarding path and a second data forwarding path between the first communication interface and the second communication interface, the first data forwarding path being used to forward the data received by the first communication interface to the second communication interface, and the second data forwarding path being used to forward the data received by the second communication interface to the first communication interface.
3. The driver online method based on multi-protocol communication according to claim 2, wherein A protocol processing module is provided in the target driver, and the method further includes: After establishing communication between the first communication interface and the second communication interface, further establishing a first protocol processing transmission path and a first protocol processing feedback path between the protocol processing module and the first communication interface, and establishing a second protocol processing transmission path and a second protocol processing feedback path between the protocol processing module and the second communication interface.
4. The drive online method based on multi-protocol communication according to claim 3, wherein, The target working mode is the host computer debugging mode; In the host computer debugging mode: Obtaining first target data from the host computer through the first data transceiver path; Forwarding the first target data to the second communication interface through the first data forwarding path; Sending the first target data to the bus device and each monitored driver through the second data transceiver path; Obtaining second target data from each monitored driver through the second data transceiver path; Forwarding the second target data to the first communication interface through the second data forwarding path; sending the second target data to the host computer through the first data transceiver path; Sending the first target data to the protocol processing module through the first protocol processing transmission path, so that the protocol processing module performs protocol processing on the first target data and generates first protocol processing feedback data, sending the first protocol processing feedback data to the first communication interface through the first protocol processing feedback path, and then sending the first protocol processing feedback data to the host computer through the first data transceiver path; Send the second target data to the protocol processing module through the sending path of the second protocol processing, so that the protocol processing module performs protocol processing on the second target data and generates second protocol processing feedback data, send the second protocol processing feedback data to the second communication interface through the second protocol processing feedback path, and then send the second protocol processing feedback data to the bus device and each of the monitored drivers through the second data transceiver path.
5. The method for online connection of a driver based on multi-protocol communication according to claim 1, wherein After establishing communication between the first communication interface and the second communication interface, establish a data forwarding path between the first communication interface and the second communication interface, including: After establishing communication between the first communication interface and the second communication interface, establish a first data forwarding path between the first communication interface and the second communication interface, and the first data forwarding path is used to forward the data received by the first communication interface to the second communication interface.
6. The method for connecting a driver online based on multi-protocol communication according to claim 5, wherein, A protocol processing module is provided in the target driver, and the method further includes: After establishing communication between the first communication interface and the second communication interface, also establish a first protocol processing sending path and a first protocol processing feedback path between the protocol processing module and the first communication interface.
7. The online method of the driver based on multi-protocol communication according to claim 6, characterized in that, The target working mode is the host computer control mode; In the host computer control mode: Obtain the first target data from the host computer through the first data transceiver path; forward the first target data to the second communication interface through the first data forwarding path; Send the first target data to the bus device and each monitored driver through the second data transceiver path; Send the first target data 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, send the first protocol processing feedback data to the first communication interface through the first protocol processing feedback path, and then send the first protocol processing feedback data to the host computer through the first data forwarding path.
8. The method for driving online based on multi-protocol communication according to claim 1, wherein After establishing communication between the first communication interface and the second communication interface, establish a data forwarding path between the first communication interface and the second communication interface, including: After establishing communication between the first communication interface and the second communication interface, establish a second data forwarding path between the first communication interface and 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.
9. The method for connecting a driver online based on multi-protocol communication according to claim 8, wherein A protocol processing module is provided in the target driver, and the method further includes: After establishing communication between the first communication interface and the second communication interface, also establish a second protocol processing sending path and a second protocol processing feedback path between the protocol processing module and the second communication interface.
10. The method for connecting a driver online based on multi-protocol communication according to claim 9, wherein, The target working mode is the host computer monitoring mode; In the host computer monitoring mode: Obtain second target data from the bus device or one of the drives to be monitored through the second data transceiver path; forward the second target data to the first communication interface through the second data forwarding path; send the second target data to the host computer through the first data transceiver path; And, send the second target data to the protocol processing module through the second protocol processing sending path, so that the protocol processing module performs protocol processing on the second target data and generates second protocol processing feedback data, send the second protocol processing feedback data to the second communication interface through the second protocol processing feedback path, and send the second protocol processing feedback data to the bus device through the second data forwarding path.
11. The method for connecting a driver based on multi-protocol communication according to claim 1, wherein, The target working mode is the serial port conversion mode; In the serial port conversion mode: Obtain first target data from the host computer through the first data transceiver path; forward the first target data to the second communication interface through the first data forwarding path; Send the first target data to the bus device and each drive to be monitored through the second data transceiver path; Obtain second target data from each drive to be monitored through the second data transceiver path; Forward the second target data to the first communication interface through the second data forwarding path; send the second target data to the host computer through the first data transceiver path.
12. The method for driving the on-line of a multi-protocol communication-based driver according to any one of claims 4, 7, and 11, characterized in that After entering the target working mode corresponding to the working mode switching instruction after receiving the working mode switching instruction, it further includes: Receive the master station switching instruction sent by the host computer through the first data transceiver path, and forward 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 pause the control of each drive to be monitored by the bus device.
13. A target driver, characterized in that, It includes: A memory for storing a computer program; A processor for, when executing the computer program, implementing the steps of the method for online connection of drives based on multi-protocol communication according to any one of claims 1-12.
14. A driver online system based on multi-protocol communication, characterized in that, It includes the target drive as described in claim 13, and also includes a host computer, a bus device and a target bus; The target drive is communicatively connected to the host computer through a first communication interface, and is communicatively connected to the bus device and each drive to be monitored through a second communication interface; The host computer is used for: Virtualize at least one virtual drive to be monitored when the target drive is operating in the host computer debugging mode or the serial port conversion mode; While sending the host computer debugging data or host computer communication data to each drive to be monitored and the bus device through the target drive, input the host computer debugging data or host computer communication data to each virtual drive to be monitored; While obtaining the first host computer debugging feedback data or host computer communication feedback data sent by each of the monitored drivers through the target driver, obtain 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; The host computer debugging feedback data is 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 driver online system based on multi-protocol communication according to claim 14, characterized in that, The host computer is further configured to: Virtualize each of the monitored drivers when the target driver is operating in the host computer control mode or the host computer monitoring mode; Receive bus control data through the target driver and input the bus control data into each of the virtual monitored drivers to determine the bus control virtual feedback data generated by each of the virtual monitored drivers based on the bus control data; Or, while sending the host computer control data to each of the monitored drivers through the target driver, input the host computer control data into each of the virtual monitored drivers and receive the host computer control virtual feedback data generated by each of the virtual monitored drivers based on the host computer control data.
Citation Information
Patent Citations
Network card monitoring method, device, system and equipment of baseboard management controller
CN116881072A
Power distribution area energy optimization system
CN119093350A
Equipment data processing method and device, equipment and computer readable storage medium
CN120034590A