Dual-Serial-Port-Based Data Transmission System, Method and Electronic Device
By introducing a dual serial port design in the communication between the upper and lower computers, the real-time tracking problem caused by sharing one serial port by file transfer and debugging information is solved, and real-time monitoring and abnormal analysis and positioning of the file transfer process are realized.
Patent Information
- Application Number
- CN202211056061.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-31
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2042-08-31
AI Technical Summary
In the embedded design of upper and lower computer communication, in the prior art, file transmission and debugging information share a serial port, which makes it impossible to track the data transmission process in real time, and it is difficult to locate the problem when transmission abnormalities are not.
It adopts a dual serial port design, one serial port is used for file transmission, and the other serial port is used for real-time return of debugging information, and the data transmission and debugging information are respectively achieved through the first serial bus and the second serial bus.
Real-time monitoring and exception analysis of the file transfer process are realized, and black box debugging is avoided, ensuring that debuggers can obtain exception information in a timely manner for problem location.
Smart Images

Figure CN115633027B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data transmission, and particularly relates to a data transmission system, method, and electronic device based on dual serial ports. Background Art
[0002] Currently, in the communication scenario between the host computer and the slave computer in embedded design, the host computer and the slave computer usually need to transfer files, and the slave computer needs to send debugging information to the host computer through the serial port for software debugging and development.
[0003] In the prior art, the host computer and the slave computer share a single serial port for file transfer and debugging information transfer. When the host computer and the slave computer use the serial port to transfer files, since the serial port is already occupied at this time, it is impossible to output debugging information simultaneously. As a result, the data transmission process is a black box for developers of the embedded serial port transmission protocol, and it is impossible to track the data transmission process in real time. Once a transmission anomaly or error occurs during the file transfer process, it is very difficult to locate the problem with the transmission anomaly. Summary of the Invention
[0004] In view of the above, this application provides a data transmission system, method, and electronic device based on dual serial ports, aiming to solve the above technical problems.
[0005] To achieve the above object, the present invention provides a data transmission system based on dual serial ports. The system includes a host computer and a slave computer. The host computer includes a first serial port module of the host computer and a second serial port module of the host computer. The slave computer includes a first serial port module of the slave computer and a second serial port module of the slave computer.
[0006] The first serial port module of the host computer is communicatively connected to the first serial port module of the slave computer through a first serial bus. The first serial bus is used to transmit first data to be transmitted from the host computer to the slave computer, so that the slave computer obtains second data to be transmitted.
[0007] The second serial port module of the host computer is communicatively connected to the second serial port module of the slave computer through a second serial bus. The second serial bus is used to send the debugging information pre-generated by the slave computer to the host computer, and at the same time, to transmit the second data to be transmitted back to the host computer in real time, so that the host computer can verify whether the first data to be transmitted is the same as the second data to be transmitted.
[0008] To achieve the above object, the present invention provides a data transmission method based on dual serial ports applied to the above system. The method is applied to the host computer and includes:
[0009] Transmit the first data to be transmitted stored in the file buffer of the host computer to the first serial port module of the host computer.
[0010] Send the first data to be transmitted of the first serial port module of the host computer to the first serial port module of the slave computer through the first serial bus, so that the second serial port module of the slave computer can obtain the second data to be transmitted;
[0011] Receive the second data to be transmitted and the debugging information pre-generated by the slave computer that are simultaneously sent to the second serial port module of the host computer by the second serial port module of the slave computer.
[0012] To achieve the above object, the present invention provides a dual-serial-port-based data transmission method applied to the above system. The method is applied to the slave computer and includes:
[0013] Receive the first data to be transmitted sent by the first serial port module of the host computer to the first serial port module of the slave computer through the first serial bus;
[0014] Send the first data to be transmitted received by the first serial port module of the slave computer to the second serial port module of the slave computer to obtain the second data to be transmitted;
[0015] Send the second data to be transmitted of the second serial port module of the slave computer and the pre-generated debugging information to the second serial port module of the host computer through the second serial bus.
[0016] To achieve the above object, the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus;
[0017] The memory is used to store computer programs;
[0018] When the processor is used to execute the program stored in the memory, it implements the steps of the above dual-serial-port-based data transmission method.
[0019] To achieve the above object, the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus;
[0020] The memory is used to store computer programs;
[0021] When the processor is used to execute the program stored in the memory, it implements the steps of the above dual-serial-port-based data transmission method.
[0022] The above technical solutions provided by the embodiments of the present application have the following advantages compared with the prior art:
[0023] Compared with the single-serial-port data transmission solution in the prior art, in this application, by adding a new serial port, the lower computer can use the new serial port to send back the data sent by the upper computer to the upper computer, and at the same time send the debugging information to the upper computer. The debugging personnel can use the upper computer to monitor in real time the file data stream transmitted between the first serial port module of the upper computer and the first serial port module of the lower computer, as well as the current debugging information of the lower computer. When data transmission anomalies occur, more anomaly information can be obtained for problem analysis and location, so as to monitor the data transmission process, avoid the black-box debugging situation of the single serial port in the prior art, and the upper computer can also synchronously receive the debugging information of the lower computer during the debugging process. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The accompanying drawings herein are incorporated into and constitute a part of this specification, showing embodiments consistent with the present invention and, together with the specification, are used to explain the principles of the present invention.
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0026] Figure 1 It is a schematic diagram of the data transmission system based on dual serial ports for this application;
[0027] Figure 2 It is a schematic flowchart of a preferred embodiment of the data transmission method based on dual serial ports for this application;
[0028] Figure 3 It is a schematic flowchart of another preferred embodiment of the data transmission method based on dual serial ports for this application;
[0029] Figure 4 It is a schematic diagram of a preferred embodiment of the electronic device for this application;
[0030] The implementation, functional features and advantages of the objectives of this application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0031] In order to make the objectives, technical solutions and advantages of this application clearer, the following will further describe this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not used to limit this application. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of this application.
[0032] It should be noted that the technical solutions between the embodiments of the present application can be combined with each other, but it must be based on the ability of those of ordinary skill in the art to implement. When the combination of technical solutions results in contradictions or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0033] Referring to Figure 1 As shown, it is a schematic diagram of a data transmission system based on dual serial ports of the present application. The system includes a host computer and a slave computer. Specifically, the host computer includes a first serial port module of the host computer and a second serial port module of the host computer, and the slave computer includes a first serial port module of the slave computer and a second serial port module of the slave computer;
[0034] The first serial port module of the host computer is communicatively connected to the first serial port module of the slave computer through a first serial bus, and the first serial bus is used to transmit first data to be transmitted from the host computer to the slave computer for the slave computer to obtain second data to be transmitted;
[0035] The second serial port module of the host computer is communicatively connected to the second serial port module of the slave computer through a second serial bus. The second serial bus is used to send the debugging information pre-generated by the slave computer to the host computer, and at the same time, the second data to be transmitted is transmitted back to the host computer in real time for the host computer to verify whether the first data to be transmitted is the same as the second data to be transmitted.
[0036] In an actual communication scenario between the host computer and the slave computer, since the host computer and the slave computer usually need to transfer files, and the slave computer needs to send debugging information to the host computer through the serial port module for software debugging and development. In the existing technical solutions, file transfer and debugging information transfer share a serial port module. When the host computer and the slave computer use the serial port module to transfer files, at this time, since the serial port module is already occupied, it is impossible to output debugging information anymore, resulting in the file transfer process being equivalent to a black box. Once a transmission anomaly occurs during the file transfer process, it is very difficult to locate the problem.
[0037] In this embodiment, the first serial bus and the second serial bus can be a universal serial data bus (for example, UART) for asynchronous communication, and the two-way communication of this bus can achieve full-duplex transmission and reception. The first serial port module of the host computer and the first serial port module of the slave computer communicatively connected through the first serial bus are used to transfer files. It should be noted that when the first serial port module of the host computer and the first serial port module of the slave computer transfer files, they need to follow the corresponding transfer protocol. For example, the commonly used protocols include xmodem, ymodem, zmodem protocols, etc. When using the serial port module to transfer files, corresponding driver software is required to control the serial port module to conform to the protocol standard.
[0038] The upper computer second serial port module and the lower computer second serial port module connected by the second serial bus communication are used to transmit debugging information, and are also used to copy the file transmitted from the upper computer to the lower computer and re-transmit it back to the upper computer, so that the upper computer can verify whether the file sent to the lower computer is the same as the file returned by the lower computer, so as to judge whether the transmitted file is inconsistent. Since the file transmitted from the upper computer to the lower computer will be transmitted back to the upper computer in real time, the upper computer can monitor the file data stream received by the lower computer in real time. For example, if it is detected that there is a loss of data bytes in the file data stream received by the lower computer, it may be that the CPU of the lower computer is too late to obtain the data in the FIFO memory of the lower computer first serial port module, resulting in FIFO memory overflow. At this time, this problem can be solved by reducing the baud rate and slowing down the transmission speed.
[0039] By adding a new serial port, the lower computer can use the new serial port to transmit the file sent by the upper computer back to the upper computer, and at the same time send the debugging information to the upper computer. The debugging personnel can monitor the file data stream transmitted between the upper computer first serial port module and the lower computer first serial port module in real time through the upper computer, as well as the current debugging information of the lower computer. When the file transmission is abnormal, more abnormal information can be obtained for problem analysis and location, so as to monitor the file transmission process, and the upper computer can also receive the debugging information of the lower computer synchronously during the debugging process.
[0040] Refer to Figure 2 As shown, this application provides a method flow diagram of an embodiment of a data transmission method based on dual serial ports. This method can be executed by the upper computer of the data transmission system based on dual serial ports. The upper computer can be an electronic device such as a computer, and the upper computer can be implemented by software and / or hardware. The data transmission method based on dual serial ports includes:
[0041] Step S110: Transmit the first data to be transmitted stored in the upper computer file buffer to the upper computer first serial port module;
[0042] Step S120: Use the first serial bus to send the first data to be transmitted of the upper computer first serial port module to the lower computer first serial port module, so that the lower computer second serial port module can obtain the second data to be transmitted;
[0043] Step S130: Receive the second data to be transmitted and the debugging information pre-generated by the lower computer that are simultaneously sent by the lower computer second serial port module to the upper computer second serial port module through the second serial bus.
[0044] In this embodiment, when the host computer sends data to be transmitted (e.g., a file) to the slave computer, the data to be transmitted stored in the file buffer of the host computer (e.g., the Buffer buffer) is copied and transmitted to the FIFO memory in the first serial port module of the host computer. The FIFO memory is a buffer link in the system and is a first-in, first-out dual-port buffer, that is, the first data entering the FIFO memory will be the first to be removed.
[0045] The file in the first serial port module of the host computer is sent to the FIFO memory in the first serial port module of the slave computer by using the first serial bus. The slave computer can copy the file received in its FIFO memory to the file buffer of the slave computer (e.g., the Buffer buffer). The slave computer sends the file in its file buffer to the second serial port module of the slave computer, and the second serial port module of the slave computer can send the file to the second serial port module of the host computer. Since the second serial port module of the host computer and the second serial port module of the slave computer are not used as file transfer serial ports but as debug serial ports, this serial port can not comply with the requirements of the file transfer protocol. Therefore, the second serial port module of the slave computer can send debug information to the second serial port module of the host computer at the same time.
[0046] The data to be transmitted and the debug information pre-generated by the slave computer that are simultaneously sent by the second serial port module of the slave computer to the second serial port module of the host computer are received in real time. Since the slave computer transmits the file sent by the host computer back to the host computer in real time through the second serial port module of the slave computer, the host computer can compare and verify the sent file with the file sent back by the slave computer, so as to monitor in real time whether there is a transmission error in the file received by the slave computer. It can be understood that the first data to be transmitted refers to the file data sent by the host computer to the slave computer, and the second data to be transmitted refers to the file data that the slave computer transmits back to the host computer through the second serial bus after receiving the file data sent by the host computer.
[0047] Compared with the single-serial-port data transmission scheme in the prior art, in this application, by adding a new serial port, the file data stream transmitted between the first serial port module of the host computer and the first serial port module of the slave computer, as well as the current debug information of the slave computer, can be monitored in real time. When a transmission anomaly occurs in the file data, more anomaly information is obtained for problem analysis and location, so as to monitor the file transmission process, avoid the black-box debugging situation of a single serial port in the prior art, and the host computer can also receive the debug information of the slave computer synchronously during the debugging process.
[0048] In one embodiment, before transmitting the first data to be transmitted stored in the file buffer of the host computer to the first serial port module of the host computer, the method further includes:
[0049] Transfer the first data to be transmitted from the external storage space to the file buffer of the host computer.
[0050] The host computer CPU can pre-copy the file to be transmitted to the lower computer from the corresponding external storage space of the host computer to the file buffer of the host computer, which can effectively reduce the waiting time when the host computer transmits the file to the lower computer.
[0051] In one embodiment, after transferring the first data to be transmitted stored in the file buffer of the host computer to the first serial port module of the host computer, the method further includes:
[0052] Use the data acquisition module pre-configured in the FIFO memory of the first serial port module of the host computer to acquire the first data to be transmitted sent by the first serial port module of the host computer.
[0053] By configuring the data acquisition module in the FIFO memory of the first serial port module of the host computer, the file sent out from the FIFO memory of the first serial port module of the host computer can be acquired in real time.
[0054] Further, the method further includes:
[0055] Verify whether the second data to be transmitted sent by the second serial port module of the lower computer is the same as the first data to be transmitted acquired by the data acquisition module.
[0056] When the host computer receives the file returned by the second serial port module of the lower computer, it can check whether the returned file is consistent with the file sent by the host computer acquired by the acquisition module, that is, the host computer can verify whether the file sent out is the same as the file returned by the lower computer. If they are not the same, it means that the transmission is abnormal. At this time, an alarm message can be generated to remind the relevant debugging personnel.
[0057] In one embodiment, the method further includes:
[0058] Display the second data to be transmitted and the debugging information simultaneously sent by the second serial port module of the lower computer on the preset interface of the host computer. By displaying the file and debugging information simultaneously sent by the second serial port module of the lower computer on the screen of the host computer, the debugging personnel can timely know the debugging information and the file transmission situation.
[0059] Refer to Figure 3 As shown, it is a flowchart schematic diagram of another preferred embodiment of the data transmission method based on dual serial ports of the present application. This method can be executed by the lower computer of the data transmission system based on dual serial ports. The lower computer can be an industrial control electronic device, and the lower computer can be implemented by software and / or hardware. The data transmission method based on dual serial ports includes:
[0060] Step S210: Receive the first data to be transmitted sent by the first serial port module of the host computer to the first serial port module of the slave computer via the first serial bus;
[0061] Step S220: Transmit the first data to be transmitted received by the first serial port module of the slave computer to the second serial port module of the slave computer to obtain the second data to be transmitted;
[0062] Step S230: Transmit the second data to be transmitted of the second serial port module of the slave computer and the pre-generated debugging information to the second serial port module of the host computer via the second serial bus.
[0063] In this embodiment, the first serial port module of the host computer uses the first serial bus to send data to be transmitted (e.g., a file) to the FIFO memory of the first serial port module of the slave computer. After the slave computer receives the file, it sends the file received by the first serial port module of the slave computer to the second serial port module of the slave computer, and then uses the second serial bus to send the file of the second serial port module of the slave computer and the pre-generated debugging information to the second serial port module of the host computer. Since the second serial port module of the host computer and the second serial port module of the slave computer are not used as a file transfer serial port but as a debugging serial port, this serial port can not comply with the requirements of the file transfer protocol. Therefore, the second serial port module of the slave computer can send debugging information to the second serial port module of the host computer at the same time.
[0064] Since the slave computer transmits the file sent by the host computer back to the host computer in real time through the second serial port module of the slave computer, the host computer can compare and verify the file sent out with the file transmitted back by the slave computer, so as to monitor in real time whether there is a transmission error in the file received by the slave computer.
[0065] Compared with the single-serial-port data transmission scheme in the prior art, the present application can, by adding a new serial port, monitor in real time the file data stream transmitted between the first serial port module of the host computer and the first serial port module of the slave computer, as well as the current debugging information of the slave computer. When there is an abnormal situation in the file data transmission, more abnormal information can be obtained for problem analysis and location, so as to monitor the file transmission process, avoid the black-box debugging of a single serial port in the prior art, and the host computer can also receive the debugging information of the slave computer synchronously during the debugging process.
[0066] Further, the transmitting the first data to be transmitted received by the first serial port module of the slave computer to the second serial port module of the slave computer includes:
[0067] Transmit the first data to be transmitted received by the first serial port module of the slave computer to the file buffer of the slave computer;
[0068] Send the first data to be transmitted in the lower computer file buffer to the second serial port module of the lower computer.
[0069] Transmit the file received by the first serial port module of the lower computer to the lower computer file buffer, and send the file in the lower computer file buffer to the second serial port module of the lower computer, which can effectively reduce the waiting time when the first serial port module of the lower computer transmits the file to the second serial port module of the lower computer.
[0070] Refer to Figure 4 As shown, it is a schematic diagram of a preferred embodiment of the electronic device of the present application.
[0071] Both the upper computer and the lower computer of the data transmission system based on dual serial ports can be electronic devices. For example, the upper computer can be an electronic device such as a computer, and the lower computer can be an industrial control computer. The electronic device includes but is not limited to: a memory, a processor, a display, and a communication interface. The electronic device is connected to the network through the communication interface. Among them, the network can be a wireless or wired network such as an enterprise internal network (Intranet), the Internet, Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth, Wi-Fi, a call network, etc.
[0072] Among them, the memory includes at least one type of readable storage medium, and the readable storage medium includes flash memory, a hard disk, a multimedia card, a card-type memory (such as an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory can be an internal storage unit of the electronic device, such as the hard disk or memory of the electronic device. In other embodiments, the memory can also be an external storage device of the electronic device, such as a plug-in hard disk, a SmartMedia Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. equipped with the electronic device. Of course, the memory can also include both the internal storage unit and the external storage device of the electronic device. In this embodiment, the memory is generally used to store the operating system and various application software installed in the electronic device, such as the program code of the data transmission program based on dual serial ports. In addition, the memory can also be used to temporarily store various data that have been output or will be output.
[0073] In some embodiments, the processor may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips. The processor is generally used to control the overall operation of the electronic device, such as performing control and processing related to data interaction or communication. In this embodiment, the processor is used to run the program code stored in the memory or process data, such as running the program code of a data transmission program based on a dual serial port.
[0074] The display can be referred to as a display screen or a display unit. In some embodiments, the display can be an LED display, a liquid crystal display, a touch liquid crystal display, and an organic light-emitting diode (OLED) touch device, etc. The display is used to display the information processed in the electronic device and to display a visual working interface.
[0075] The communication interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), which is generally used to establish a communication connection between the electronic device and other electronic devices.
[0076] Optionally, the electronic device may further include a user interface. The user interface may include a display, and the optional user interface may further include a standard wired interface and a wireless interface. Optionally, in some embodiments, the display can be an LED display, a liquid crystal display, a touch liquid crystal display, and an organic light-emitting diode (OLED) touch device, etc. Among them, the display can also be appropriately referred to as a display screen or a display unit, which is used to display the information processed in the electronic device and to display a visual interface.
[0077] The electronic device may further include a radio frequency (RF) circuit, a sensor, an audio circuit, etc., which will not be elaborated here.
[0078] In the above embodiment, when the processor executes the data transmission program based on a dual serial port stored in the memory, the following steps may be implemented:
[0079] Transmit the first data to be transmitted stored in the host computer file buffer to the host computer first serial port module;
[0080] Use the first serial bus to send the first data to be transmitted of the host computer first serial port module to the lower computer first serial port module, so that the lower computer second serial port module can obtain the second data to be transmitted;
[0081] Receive the second data to be transmitted and the debugging information pre-generated by the lower computer that are simultaneously sent to the second serial port module of the upper computer by the second serial port module of the lower computer through the second serial bus.
[0082] For the detailed introduction of the above steps, please refer to the above Figure 2 Description of the flowchart of the embodiment of the data transmission method based on dual serial ports.
[0083] In another embodiment, when the processor executes the data transmission program based on dual serial ports stored in the memory, the following steps can be implemented:
[0084] Receive the first data to be transmitted sent from the first serial port module of the upper computer to the first serial port module of the lower computer through the first serial bus;
[0085] Send the first data to be transmitted received by the first serial port module of the lower computer to the second serial port module of the lower computer to obtain the second data to be transmitted;
[0086] Use the second serial bus to send the second data to be transmitted and the pre-generated debugging information of the lower computer in the second serial port module of the lower computer to the second serial port module of the upper computer.
[0087] For the detailed introduction of the above steps, please refer to the above Figure 3 Description of the flowchart of the embodiment of the data transmission method based on dual serial ports.
[0088] In addition, the present invention also provides a computer-readable storage medium, on which a data transmission program based on dual serial ports is stored. When the data transmission program based on dual serial ports is executed by a processor, the following steps are implemented:
[0089] Transmit the first data to be transmitted stored in the file buffer of the upper computer to the first serial port module of the upper computer;
[0090] Use the first serial bus to send the first data to be transmitted in the first serial port module of the upper computer to the first serial port module of the lower computer for the second serial port module of the lower computer to obtain the second data to be transmitted;
[0091] Receive the second data to be transmitted and the debugging information pre-generated by the lower computer that are simultaneously sent to the second serial port module of the upper computer by the second serial port module of the lower computer through the second serial bus.
[0092] The specific implementation manner of this computer-readable storage medium is the same as the above Figure 2The specific implementation manners of the data transmission method based on dual serial ports shown above are substantially the same and will not be elaborated here.
[0093] The present invention further provides a computer-readable storage medium, on which a data transmission program based on dual serial ports is stored. When the data transmission program based on dual serial ports is executed by a processor, the following steps are implemented:
[0094] Receive the first data to be transmitted sent from the first serial port module of the host computer to the first serial port module of the slave computer by using the first serial bus;
[0095] Send the first data to be transmitted received by the first serial port module of the slave computer to the second serial port module of the slave computer to obtain second data to be transmitted;
[0096] Use the second serial bus to send the second data to be transmitted of the second serial port module of the slave computer and the pre-generated debugging information to the second serial port module of the host computer.
[0097] The specific implementation manner of this computer-readable storage medium is substantially the same as that of the Figure 3 data transmission method based on dual serial ports shown above and will not be elaborated here.
[0098] It should be noted that the serial numbers of the embodiments of the present application above are only for description and do not represent the advantages and disadvantages of the embodiments. And the term "including" or "comprising" or any other variant thereof in this article is intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, device, article or method. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the process, device, article or method including the element.
[0099] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-described embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation manner. Based on such an understanding, the technical solution of the present application, in essence, or the part that makes a contribution to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc) as described above and includes several instructions for causing a terminal device (which may be a mobile phone, a computer, an electronic device, or a network device, etc.) to execute the methods described in the embodiments of the present application.
[0100] The above are only the preferred embodiments of the present application, and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be similarly included in the patent protection scope of the present application.
Claims
1. A data transmission system based on dual serial ports, characterized in that The system includes a host computer and a slave computer. The host computer includes a first serial port module of the host computer and a second serial port module of the host computer. The slave computer includes a first serial port module of the slave computer and a second serial port module of the slave computer; The first serial port module of the host computer is communicatively connected to the first serial port module of the slave computer through a first serial bus. The first serial bus is used to transmit first data to be transmitted from the host computer to the slave computer, so that the slave computer can obtain second data to be transmitted; The second serial port module of the host computer is communicatively connected to the second serial port module of the slave computer through a second serial bus. The second serial bus is used to send the debugging information pre-generated by the slave computer to the host computer, and at the same time, to transmit the second data to be transmitted back to the host computer in real time, so that the host computer can verify whether the first data to be transmitted is the same as the second data to be transmitted.
2. A data transmission method based on dual serial ports applied to the system as described in claim 1, characterized in that, The method is applied to a host computer and includes: Transmit the first data to be transmitted stored in the host computer file buffer to the first serial port module of the host computer; Use the first serial bus to send the first data to be transmitted of the first serial port module of the host computer to the first serial port module of the slave computer, so that the second serial port module of the slave computer can obtain the second data to be transmitted; Receive the second data to be transmitted and the debugging information pre-generated by the slave computer that are simultaneously sent by the second serial port module of the slave computer to the second serial port module of the host computer through the second serial bus.
3. The data transmission method based on dual serial ports according to claim 2, wherein Before transmitting the first data to be transmitted stored in the host computer file buffer to the first serial port module of the host computer, the method further includes: Transmit the first data to be transmitted from an external storage space to the file buffer of the host computer.
4. The data transmission method based on dual serial ports according to claim 2, wherein After transmitting the first data to be transmitted stored in the host computer file buffer to the first serial port module of the host computer, the method further includes: Use the data acquisition module pre-configured in the FIFO memory of the first serial port module of the host computer to acquire the first data to be transmitted sent by the first serial port module of the host computer.
5. The data transmission method based on dual serial ports according to claim 4, wherein The method further includes: Verify whether the second data to be transmitted sent by the second serial port module of the slave computer is the same as the first data to be transmitted acquired by the data acquisition module.
6. The data transmission method based on dual serial ports according to claim 2, wherein The method further includes: Display the second data to be transmitted and the debugging information simultaneously sent by the second serial port module of the slave computer on a preset interface of the host computer.
7. A data transmission method based on dual serial ports applied to the system as described in claim 1, characterized in that, The method is applied to a slave computer and includes: Receive the first data to be transmitted sent by the first serial port module of the host computer to the first serial port module of the slave computer through the first serial bus; Send the first data to be transmitted received by the first serial port module of the slave computer to the second serial port module of the slave computer to obtain the second data to be transmitted; Use the second serial bus to send the second data to be transmitted and the pre-generated debugging information of the second serial port module of the slave computer to the second serial port module of the host computer.
8. The data transmission method based on dual serial ports according to claim 7, wherein The step of sending the first data to be transmitted received by the first serial port module of the slave computer to the second serial port module of the slave computer includes: Transmit the first data to be transmitted received by the first serial port module of the slave computer to the file buffer of the slave computer; Send the first data to be transmitted in the file buffer of the slave computer to the second serial port module of the slave computer.
9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus; The memory is used to store computer programs; When the processor executes the programs stored on the memory, it realizes the steps of the data transmission method based on dual serial ports described in any one of claims 2-6.
10. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus; The memory is used to store computer programs; When the processor executes the programs stored on the memory, it realizes the steps of the data transmission method based on dual serial ports described in claim 7 or 8.
Citation Information
Patent Citations
Debugging link and debugging method for embedded TAP interface of FPGA
CN107608846A
Equipment debugging method and electronic equipment
CN113535494A