Method, apparatus, device, medium and product for synchronous data transmission of driver

CN122679221APending Publication Date: 2026-09-01GENERAL TECH GRP MASCH TOOL ENG RES INST CO LTD SHANGHAI BRANCH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610801930.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-04
Publication Date
2026-09-01

AI Technical Summary

Technical Problem

[0005]本发明提供一种驱动器的同步数据传输方法、装置、设备、介质及产品,用以解决现有技术中上位机不具备严格实时性,请求发送间隔容易发生波动,从而造成请求到达时刻不稳定,使驱动器侧难以以统一的内部周期组织上传数据,难以保证传输数据中状态数据与波形数据的时间一致性的缺陷,本发明技术方案相比现有技术不再由上位机主导通讯,而是由驱动器根据预设周期进行统一的数据上传,从而可以保证传输数据中状态数据与波形数据的时间一致性

Benefits of technology

[0018]本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述任一种所述驱动器的同步数据传输方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122679221A_ABST
    Figure CN122679221A_ABST
Patent Text Reader

Abstract

This invention provides a method, apparatus, device, medium, and product for synchronous data transmission of a driver, relating to the field of data transmission technology. The method, applied to a driver, includes: entering a synchronization mode upon receiving a handshake request from a host computer; in the synchronization mode, sending an uplink synchronization frame corresponding to the current first preset period to the host computer every first preset period; the uplink synchronization frame is used to instruct the host computer to return synchronization maintenance control information. Compared to existing technologies, this invention eliminates the host computer's control over communication, instead allowing the driver to uniformly upload data according to a preset period, thereby ensuring the time consistency between status data and waveform data in the transmitted data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data transmission technology, and in particular to a method, apparatus, device, medium and product for synchronous data transmission of a driver. Background Technology

[0002] During the debugging, parameter configuration, status monitoring, dynamic performance analysis and firmware maintenance of high-performance servo drives, the host computer usually needs to establish a data interaction channel with the drive through a serial bus (Universal Serial Bus, USB) interface to complete various functions such as parameter reading and writing, real-time status refresh, internal variable waveform acquisition and firmware upgrade.

[0003] Because the host computer runs on a general-purpose operating system environment, its task scheduling and USB host stack transmission are subject to significant jitter, while the servo driver's internal control, sampling, and protection logic relies on a fixed and strict real-time cycle. Therefore, in existing technologies, USB data transmission typically employs a communication mode driven by host computer polling, whereby the host computer continuously sends requests according to its own software timer and then waits for the driver to return a response.

[0004] Because the host computer does not have strict real-time performance, the request sending interval is prone to fluctuation, resulting in unstable request arrival times. This makes it difficult for the driver side to organize the data upload with a uniform internal cycle, and it is difficult to guarantee the time consistency between status data and waveform data in the transmitted data. Summary of the Invention

[0005] This invention provides a synchronous data transmission method, apparatus, device, medium, and product for a driver, to solve the defects in the prior art where the host computer does not have strict real-time performance, the request sending interval is prone to fluctuation, resulting in unstable request arrival times, making it difficult for the driver to organize data upload with a unified internal cycle, and making it difficult to ensure the time consistency of status data and waveform data in the transmitted data. Compared with the prior art, the technical solution of this invention no longer relies on the host computer to dominate communication, but instead the driver performs unified data upload according to a preset cycle, thereby ensuring the time consistency of status data and waveform data in the transmitted data.

[0006] This invention provides a synchronous data transmission method for a driver, which is applied to a driver and includes the following steps.

[0007] Upon receiving a handshake request from the host computer, it enters synchronization mode. In the synchronization mode, an uplink synchronization frame corresponding to the current first preset period is sent to the host computer every first preset period; the uplink synchronization frame is used to instruct the host computer to return synchronization maintenance control information.

[0008] According to a method for synchronous data transmission of a driver provided by the present invention, the uplink synchronization frame includes first real-time status data; the first real-time status data is oscilloscope data of the driver.

[0009] According to a synchronous data transmission method for a driver provided by the present invention, the step of sending an uplink synchronization frame corresponding to the current first preset period to the host computer every first preset period includes: For the current first preset period, a target request message is obtained from the request message queue, and a first request message response is generated based on the target request message and the first real-time status data; the periodic status area of ​​the first request message response is filled and a check code corresponding to the first request message response is generated; the uplink synchronization frame corresponding to the target request message is determined based on the filled first request message response and the check code; and the uplink synchronization frame is sent to the host computer.

[0010] According to a method for synchronous data transmission of a driver provided by the present invention, the request message queue includes a plurality of first request messages; the first request messages are obtained from the synchronization holding control information.

[0011] According to a synchronous data transmission method for a driver provided by the present invention, the method further includes: Upon receiving an asynchronous mode switching request from the host computer, the system enters asynchronous mode.

[0012] According to a synchronous data transmission method for a driver provided by the present invention, the method further includes: In the asynchronous mode, and upon receiving a second request message sent by the host computer, a second request message response corresponding to the second request message is generated; The second request message response is sent to the host computer.

[0013] According to a synchronous data transmission method for a driver provided by the present invention, the handshake request and the asynchronous mode switching request are control word data; the method further includes: Upon receiving the handshake request, a handshake response corresponding to the handshake request is sent to the host computer; Upon receiving the asynchronous mode switching request, an asynchronous mode switching response corresponding to the asynchronous mode switching request is sent to the host computer. The handshake response and the asynchronous mode switching response are status word data.

[0014] According to a synchronous data transmission method for a driver provided by the present invention, the first preset period includes a plurality of second preset periods; the method further includes: In the synchronization mode, for each second preset period, the second real-time status data corresponding to the second preset period is obtained based on the preset sampling mapping relationship, and the second real-time status data corresponding to the second preset period is stored in the local sampling cache. When the first preset period is reached, multiple second real-time status data are obtained from the local sampling cache; based on the multiple second real-time status data, the first real-time status data corresponding to the first preset period is determined.

[0015] According to a synchronous data transmission method for a driver provided by the present invention, the first preset period is determined based on the second preset period and the target number of sampling points; the target number of sampling points is the number of sampling points of each channel of a single serial bus within a communication period.

[0016] The present invention also provides a synchronous data transmission device for a driver, applied to a driver, comprising the following modules: The receiving module is used to enter the synchronization mode state upon receiving a handshake request from the host computer. The sending module is used to send an uplink synchronization frame corresponding to the current first preset period to the host computer every first preset period in the synchronization mode state; the uplink synchronization frame is used to instruct the host computer to return synchronization maintenance control information.

[0017] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement a synchronous data transmission method of any of the drivers described above.

[0018] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the synchronous data transmission method of the driver as described above.

[0019] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements a synchronous data transmission method for a driver as described above.

[0020] The present invention provides a synchronous data transmission method, apparatus, device, medium, and product for a driver. Upon receiving a handshake request from a host computer, the driver enters a synchronous mode. In synchronous mode, it sends an uplink synchronization frame corresponding to the current first preset period to the host computer every first preset period. The uplink synchronization frame is used to instruct the host computer to return synchronization maintenance control information. Compared with the prior art, the technical solution of the present invention no longer relies on the host computer to dominate communication, but instead, the driver performs unified data upload according to a preset period, thereby ensuring the time consistency between status data and waveform data in the transmitted data. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0022] Figure 1 This is one of the flowcharts illustrating the synchronous data transmission method for the driver provided by the present invention.

[0023] Figure 2 This is a communication timing diagram of the synchronous mode state provided by the present invention.

[0024] Figure 3 This is the second flowchart illustrating the synchronous data transmission method for the driver provided by the present invention.

[0025] Figure 4 This is a schematic diagram of the synchronous data transmission device for the driver provided by the present invention.

[0026] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0028] To address the aforementioned problems in the prior art, this invention provides a method for synchronous data transmission of a driver. Figure 1 This is one of the flowcharts illustrating the synchronous data transmission method for the driver provided by the present invention, such as... Figure 1 As shown, the method is applied to a driver and includes the following steps 110 to 120.

[0029] Step 110: Upon receiving a handshake request from the host computer, enter the synchronization mode.

[0030] Specifically, the driver's initial state can be a communication-off state. Upon receiving a handshake request from the host computer, the driver enters a synchronization mode state. This handshake request is used to establish a communication link between the driver and the host computer.

[0031] Optionally, after the corresponding data transmission task is completed, canceled, or exits abnormally, the system can exit from the synchronization state mode and re-enter the communication shutdown state.

[0032] Step 120: In the synchronization mode, an uplink synchronization frame corresponding to the current first preset period is sent to the host computer every first preset period; the uplink synchronization frame is used to instruct the host computer to return synchronization maintenance control information.

[0033] Specifically, in synchronization mode, the driver sends an uplink synchronization frame corresponding to the current first preset period to the host computer every first preset period. For example, the driver sends the corresponding uplink synchronization frames to the host computer at 1 millisecond, 21 milliseconds, and 31 milliseconds respectively. The driver can set an internal stable clock to determine time variations, and the first preset period can be represented as Tusb.

[0034] Upon receiving an uplink synchronization frame, the host computer can return synchronization hold control information to the driver. It should be noted that the synchronization hold control information can be considered a heartbeat frame, used to ensure the connection between the host computer and the driver. The synchronization hold control information may also include request information. Therefore, the host computer no longer undertakes the task of maintaining the main communication cycle, but instead completes the synchronization hold control according to the driver's first preset cycle, thus forming a synchronous communication mode of "driver sets the cycle, host computer follows and holds." It can be seen that this application switches the synchronization reference for USB communication from the host computer software polling cycle to the driver's internal stable clock. After a successful communication handshake, the driver no longer relies on the host computer software timer to maintain subsequent communication cycles, but instead sends uplink synchronization frames according to its own clock's fixed cycle; the host computer completes the synchronization hold control according to this cycle, enabling USB communication behavior to stably follow the driver's internal control cycle.

[0035] In one embodiment, the uplink synchronization frame includes first real-time status data; the first real-time status data is oscilloscope data of the driver.

[0036] Specifically, the uplink synchronization frame includes first real-time status data, which is the driver's oscilloscope data. It's easy to understand that the oscilloscope data is in the form of the first real-time status data, which essentially represents the driver's own real-time status parameters.

[0037] In the above embodiments, the uplink synchronization frame sent to the host computer includes first real-time status data, enabling the host computer to know the status of the driver in real time. This is suitable for debugging and monitoring scenarios and further meets the requirements for continuity and time consistency during the debugging process of the servo driver.

[0038] In one embodiment, sending the uplink synchronization frame corresponding to the current first preset period to the host computer every first preset period includes: For the current first preset period, a target request message is obtained from the request message queue, and a first request message response is generated based on the target request message and the first real-time status data; the periodic status area of ​​the first request message response is filled and a check code corresponding to the first request message response is generated; the uplink synchronization frame corresponding to the target request message is determined based on the filled first request message response and the check code; and the uplink synchronization frame is sent to the host computer.

[0039] Specifically, for the current first preset period, a target request message can be obtained from the request message queue. The target request message can be, for example, the first request message at the top of the request message queue. Then, a first request message response can be generated based on the target request message and the first real-time status data. This first request message response can include response data for the target request message and the first real-time status data. Further, the periodic status area of ​​the first request message response can be filled to obtain the filled first request message response, and a checksum can be generated. Then, based on the filled first request message response and the checksum, the uplink synchronization frame corresponding to the target request message can be determined, and the uplink synchronization frame can be sent to the host computer. The checksum can be at the end of the uplink synchronization frame. When the host computer receives the uplink synchronization frame, it can verify the uplink synchronization frame based on the checksum. It is easy to understand that, in synchronous mode, the uplink synchronization frame sent by the driver can also include response data for the target request message (i.e., the specific service data requested by the host computer). The content, payload definition, and implementation details of this specific service data can be configured according to application requirements, and this application embodiment does not impose specific limitations.

[0040] In the above embodiments, a first request message response can be generated based on the target request message and the first real-time status data, thereby determining the uplink synchronization frame, so that the host computer can obtain both the response corresponding to the request message and the real-time status information of the driver.

[0041] In one embodiment, the request message queue includes a plurality of first request messages; the first request messages are obtained from the synchronization maintenance control information.

[0042] Specifically, the request message queue includes multiple first request messages, which can be obtained from the synchronization and maintenance control information fed back by the host computer and then stored in the request message queue.

[0043] In the above embodiments, by utilizing the essence of the request message queue, the requests from the host computer can be processed step by step when multiple synchronization control messages all include the first request information, and it is ensured that no request information is omitted.

[0044] In one embodiment, the method further includes: Upon receiving an asynchronous mode switching request from the host computer, the system enters asynchronous mode.

[0045] Specifically, when the driver receives an asynchronous mode switching request from the host computer, it can enter asynchronous mode from the communication off state, or switch from synchronous mode to asynchronous mode.

[0046] The communication requirements for large data transmission scenarios such as firmware upgrades and real-time monitoring scenarios differ. The former is more suitable for a continuous transmission method with one request and one response in an asynchronous mode to improve link bandwidth utilization; the latter requires the technical solutions in steps 110 to 120 of this application. Therefore, in the above embodiments, by switching between asynchronous modes, both types of service requirements can be optimally met.

[0047] In one embodiment, the method further includes: In the asynchronous mode, and upon receiving a second request message sent by the host computer, a second request message response corresponding to the second request message is generated; The second request message response is sent to the host computer.

[0048] Specifically, when the driver is in asynchronous mode and receives a second request message from the host computer, it can generate a second request message response corresponding to the second request message, and further send the second request message response to the host computer. It's easy to understand that the synchronous mode is dominated by the driver's internal stable clock and is suitable for periodic synchronous data transmission from the driver to the host computer. When performing large-scale data transmission tasks such as firmware burning, it can switch to asynchronous mode.

[0049] Optionally, after the corresponding data transmission task is completed, canceled, or exits abnormally, the system can exit from the asynchronous state mode and re-enter the communication closed state or the synchronous state mode.

[0050] In the above embodiments, in asynchronous mode, the link operates on a request-response basis to improve bandwidth utilization. Asynchronous request-response mode can serve scenarios with large data transmission volumes, broadening its adaptability. For example, in firmware upgrade scenarios, after mode switching is completed via control words and status words, the host computer continuously sends upgrade request frames, and the driver continuously returns corresponding response frames to increase the effective data ratio of the link.

[0051] In one embodiment, the handshake request and the asynchronous mode switching request are control word data; the method further includes: Upon receiving the handshake request, a handshake response corresponding to the handshake request is sent to the host computer; Upon receiving the asynchronous mode switching request, an asynchronous mode switching response corresponding to the asynchronous mode switching request is sent to the host computer. The handshake response and the asynchronous mode switching response are status word data.

[0052] Specifically, both handshake requests and asynchronous mode switching requests are control word (CtrlID) data. Upon receiving a handshake request, the driver can send a corresponding handshake response to the host computer. Upon receiving an asynchronous mode switching request, the driver can send a corresponding asynchronous mode switching response to the host computer. Both the handshake response and the asynchronous mode switching response are status word (StsID) data. It's easy to understand that the control word is used to initiate communication control such as handshakes, synchronization maintenance, and mode switching; the status word is used to return the current communication status, mode result, and status confirmation.

[0053] In the above embodiments, the communication control process, such as handshake connection establishment, mode entry, mode switching and mode exit, can be completed by the cooperation of control words and status words.

[0054] In one embodiment, the first preset period includes a plurality of second preset periods; the method further includes: In the synchronization mode, for each second preset period, the second real-time status data corresponding to the second preset period is obtained based on the preset sampling mapping relationship, and the second real-time status data corresponding to the second preset period is stored in the local sampling cache. When the first preset period is reached, multiple second real-time status data are obtained from the local sampling cache; based on the multiple second real-time status data, the first real-time status data corresponding to the first preset period is determined.

[0055] Specifically, each first preset period may further include multiple second preset periods. For example, if the first preset period Tusb is 20 milliseconds and the second preset period Ts is 250 microseconds, then each first preset period includes 80 second preset periods. It is easy to understand that the second preset period Ts is necessarily less than the first preset period Tusb. The second preset period can be set as needed, and this embodiment of the invention does not impose specific limitations on it.

[0056] In synchronous mode, for each second preset period, the second real-time status data corresponding to that second preset period is obtained based on a preset sampling mapping relationship, and the second real-time status data corresponding to the second preset period is stored in the local sampling cache. The preset sampling mapping relationship indicates the real-time status of the driver to be sampled and can be preset as needed.

[0057] Furthermore, upon reaching the first preset period, multiple second real-time state data are retrieved from the local sampling cache, and the first real-time state data corresponding to the first preset period can be determined based on these multiple second real-time state data. It is easy to understand that the first real-time state data can be a combination of multiple second real-time state data.

[0058] For example, Figure 2 This is a communication timing diagram of the synchronization mode state provided by the present invention, as shown below. Figure 2 As shown, after the host computer sends a handshake request to the driver, it enters the communication handshake stage, and the driver switches to the synchronous mode state. In the synchronous mode state, it enters the communication control stage. After sending an uplink synchronization frame every first preset cycle, it receives the synchronization maintenance control information returned by the host computer. Figure 2 The 't' in the text represents the timeline marker, and the arrow next to 't' indicates the direction of time progression. The direction the arrow points is the positive direction of the timeline.

[0059] In the above embodiments, the driver collects real-time status and stores it in local sampling storage within a shorter period, and completes data processing and uplink transmission uniformly within a longer period, reducing the impact of USB non-strict real-time communication.

[0060] In one embodiment, the first preset period is determined based on the second preset period and the target number of sampling points; the target number of sampling points is the number of sampling points of each channel of a single serial bus within a communication period.

[0061] Specifically, the first preset period Tusb is determined based on the second preset period Ts and the target number of sampling points N, where the target number of sampling points is the number of sampling points of each channel of a single serial bus within a communication period.

[0062] Preferably, Tusb = N multiplied by Ts, for example, Ts is 250 microseconds, Tusb is 20 milliseconds, and N is 80. Furthermore, it is preferable to satisfy the integer synchronization relationship that N Ts equal 1 Tusb.

[0063] In the above embodiments, the USB communication clock can be aligned with the driver's internal control and sampling period within the device, thereby reducing the interference of communication processing on the sampling clock.

[0064] The technical solution of the present invention is illustrated below through a complete example: Figure 3This is a second schematic flowchart of the synchronous data transmission method for the driver provided by the present invention, as shown below. Figure 3 As shown, when the driver receives a handshake request, it enters a synchronization mode and acquires second real-time status data every second preset period, storing the second real-time status data in a local sampling buffer. When a first preset period is reached, the driver determines the first real-time status data, retrieves the target request message from the request message queue, and generates a first request message response based on the target request message and the first real-time status data. After filling the periodic status area of ​​the first request message response and generating a checksum, an uplink synchronization frame is obtained and sent to the host computer. Furthermore, if there are no new requests in the request message queue, the driver sends a heartbeat hold frame to the host computer; if consecutive timeouts occur when generating a first request message response, communication is terminated.

[0065] The synchronous data transmission device for the driver provided by the present invention will be described below. The synchronous data transmission device for the driver described below can be referred to in correspondence with the synchronous data transmission method for the driver described above.

[0066] Figure 4 This is a schematic diagram of the synchronous data transmission device for the driver provided by the present invention, as shown below. Figure 4 As shown, the synchronous data transmission device 400 of the drive is applied to the drive and includes the following modules: The receiving module 410 is used to enter the synchronization mode state when it receives a handshake request sent by the host computer. The sending module 420 is used to send an uplink synchronization frame corresponding to the current first preset period to the host computer every first preset period in the synchronization mode state; the uplink synchronization frame is used to instruct the host computer to return synchronization maintenance control information.

[0067] In one embodiment, the uplink synchronization frame includes first real-time status data; the first real-time status data is oscilloscope data of the driver.

[0068] In one embodiment, the sending module 420 is specifically used for: For the current first preset period, a target request message is obtained from the request message queue, and a first request message response is generated based on the target request message and the first real-time status data; the periodic status area of ​​the first request message response is filled and a check code corresponding to the first request message response is generated; the uplink synchronization frame corresponding to the target request message is determined based on the filled first request message response and the check code; and the uplink synchronization frame is sent to the host computer.

[0069] In one embodiment, the request message queue includes a plurality of first request messages; the first request messages are obtained from the synchronization maintenance control information.

[0070] In one embodiment, the synchronous data transmission device 400 of the driver further includes an asynchronous module, which is specifically used for: Upon receiving an asynchronous mode switching request from the host computer, the system enters asynchronous mode.

[0071] In one embodiment, the asynchronous module is further configured to: In the asynchronous mode, and upon receiving a second request message sent by the host computer, a second request message response corresponding to the second request message is generated; The second request message response is sent to the host computer.

[0072] In one embodiment, the handshake request and the asynchronous mode switching request are control word data; the synchronous data transmission device 400 of the driver further includes a response module, which is specifically used for: Upon receiving the handshake request, a handshake response corresponding to the handshake request is sent to the host computer; Upon receiving the asynchronous mode switching request, an asynchronous mode switching response corresponding to the asynchronous mode switching request is sent to the host computer. The handshake response and the asynchronous mode switching response are status word data.

[0073] In one embodiment, the first preset period includes a plurality of second preset periods; the synchronous data transmission device 400 of the driver further includes an acquisition module, which is specifically used for: In the synchronization mode, for each second preset period, the second real-time status data corresponding to the second preset period is obtained based on the preset sampling mapping relationship, and the second real-time status data corresponding to the second preset period is stored in the local sampling cache. When the first preset period is reached, multiple second real-time status data are obtained from the local sampling cache; based on the multiple second real-time status data, the first real-time status data corresponding to the first preset period is determined.

[0074] In one embodiment, the first preset period is determined based on the second preset period and the target number of sampling points; the target number of sampling points is the number of sampling points of each channel of a single serial bus within a communication period.

[0075] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 5 As shown, the electronic device may include: a processor 510, a communications interface 520, a memory 530, and a communication bus 540, wherein the processor 510, the communications interface 520, and the memory 530 communicate with each other via the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute a synchronous data transmission method for a driver, the method including: Upon receiving a handshake request from the host computer, it enters synchronization mode. In the synchronization mode, an uplink synchronization frame corresponding to the current first preset period is sent to the host computer every first preset period; the uplink synchronization frame is used to instruct the host computer to return synchronization maintenance control information.

[0076] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0077] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program that can be stored on a non-transitory computer-readable storage medium, wherein when the computer program is executed by a processor, the computer is able to execute the synchronous data transmission method for the driver provided by the above methods, the method comprising: Upon receiving a handshake request from the host computer, it enters synchronization mode. In the synchronization mode, an uplink synchronization frame corresponding to the current first preset period is sent to the host computer every first preset period; the uplink synchronization frame is used to instruct the host computer to return synchronization maintenance control information.

[0078] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a synchronous data transmission method for a driver provided by the methods described above, the method comprising: Upon receiving a handshake request from the host computer, it enters synchronization mode. In the synchronization mode, an uplink synchronization frame corresponding to the current first preset period is sent to the host computer every first preset period; the uplink synchronization frame is used to instruct the host computer to return synchronization maintenance control information.

[0079] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0080] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0081] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for synchronous data transmission of a driver, characterized in that, Applied to drives, including: Upon receiving a handshake request from the host computer, it enters synchronization mode. In the synchronization mode, an uplink synchronization frame corresponding to the current first preset period is sent to the host computer every first preset period; the uplink synchronization frame is used to instruct the host computer to return synchronization maintenance control information.

2. The synchronous data transmission method for the driver according to claim 1, characterized in that, The uplink synchronization frame includes first real-time status data; the first real-time status data is oscilloscope data of the driver.

3. The synchronous data transmission method for the driver according to claim 2, characterized in that, Sending the uplink synchronization frame corresponding to the current first preset period to the host computer every first preset period includes: For the current first preset period, a target request message is obtained from the request message queue, and a first request message response is generated based on the target request message and the first real-time status data; the periodic status area of ​​the first request message response is filled and a check code corresponding to the first request message response is generated; the uplink synchronization frame corresponding to the target request message is determined based on the filled first request message response and the check code; and the uplink synchronization frame is sent to the host computer.

4. The synchronous data transmission method for the driver according to claim 3, characterized in that, The request message queue includes multiple first request messages; the first request messages are obtained from the synchronization and maintenance control information.

5. The synchronous data transmission method for the driver according to claim 1, characterized in that, The method further includes: Upon receiving an asynchronous mode switching request from the host computer, the system enters asynchronous mode.

6. The synchronous data transmission method for the driver according to claim 5, characterized in that, The method further includes: In the asynchronous mode, and upon receiving a second request message sent by the host computer, a second request message response corresponding to the second request message is generated; The second request message response is sent to the host computer.

7. The synchronous data transmission method for the driver according to claim 5, characterized in that, The handshake request and the asynchronous mode switching request are control word data; The method further includes: Upon receiving the handshake request, a handshake response corresponding to the handshake request is sent to the host computer; Upon receiving the asynchronous mode switching request, an asynchronous mode switching response corresponding to the asynchronous mode switching request is sent to the host computer. The handshake response and the asynchronous mode switching response are status word data.

8. The synchronous data transmission method for the driver according to any one of claims 2 to 7, characterized in that, The first preset period includes multiple second preset periods; the method further includes: In the synchronization mode, for each second preset period, the second real-time status data corresponding to the second preset period is obtained based on the preset sampling mapping relationship, and the second real-time status data corresponding to the second preset period is stored in the local sampling cache. When the first preset period is reached, multiple second real-time status data are obtained from the local sampling cache; based on the multiple second real-time status data, the first real-time status data corresponding to the first preset period is determined.

9. The synchronous data transmission method for the driver according to claim 8, characterized in that, The first preset period is determined based on the second preset period and the target number of sampling points; the target number of sampling points is the number of sampling points of each channel of a single serial bus within a communication period.

10. A synchronous data transmission device for a driver, characterized in that, Applied to drives, including: The receiving module is used to enter the synchronization mode state upon receiving a handshake request from the host computer. The sending module is used to send an uplink synchronization frame corresponding to the current first preset period to the host computer every first preset period in the synchronization mode state; the uplink synchronization frame is used to instruct the host computer to return synchronization maintenance control information.