A method and apparatus for processing sampled data
Patent Information
- Application Number
- CN202311816745.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-25
- Publication Date
- 2026-09-04
- Estimated Expiration
- 2043-12-25
AI Technical Summary
但是,当数据传输周期超过预设的动态延时调整范围时则无法得到完整的左右边界点
[0041]本发明公开了一种采样数据处理方法及装置,该方法包括:对动态延时范围内的扫描数据进行校准;其中,所述扫描数据为对端持续发送的第一设定训练码或第二设定训练码通过调整动态延时参数值扫描得到的数据;在本端校准完成时,将向对端发送第一设定训练码改为向对端发送第二设定训练码,且持续接收所述对端返回的训练码;当确定所述训练码为第二设定训练码时,确定所述对端校准完成,则握手成功。利用该方法,通过扫描边界点以及结合训练码的握手方式,在握手的过程中,进行校准,能够得到准确的采样中心点,避免在采样时存在亚稳态或误码的情况,提高校准过程中采样的效率,保证通信的稳定性。
Smart Images

Figure CN117707827B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of basic electronic circuits, and in particular to a sampling data processing method and apparatus. Background Technology
[0002] In board-to-board communication, due to noise and jitter, digital signals within a cycle have stable and unstable regions. When acquiring digital signals, it is necessary not only to meet the setup and hold times of the triggers, but also to keep the sampling time of the digital signals within the stable region in order to acquire accurate data. Otherwise, metastability or errors may occur.
[0003] Currently, most FPGA (Field Programmable Gate Array) manufacturers have released technologies and hardware resources related to dynamic delay to allow users to adjust sampling points to avoid metastability. For example, several FPGA manufacturers can implement dynamic delay adjustments within different ranges. However, when the data transmission cycle exceeds the preset dynamic delay adjustment range, complete left and right boundary points cannot be obtained. Furthermore, currently, users continuously calibrate the phase relationship between data and clock using initialization training and calibration methods, trying to obtain the center point of the stable region in the data transmission cycle through repeated trials. Over time, changes in influencing factors such as voltage or temperature may cause the delay value obtained from initial training to shift, no longer satisfying the current sampling point, leading to bit errors or performance degradation, and unstable communication. Summary of the Invention
[0004] This invention provides a sampling data processing method and apparatus. By scanning boundary points and combining a handshake with training codes, calibration calculations are performed during the handshake process to obtain an accurate sampling center point. This avoids metastability or bit errors during sampling, improves sampling efficiency during calibration, and ensures communication stability.
[0005] In a first aspect, embodiments of the present invention provide a sampling data processing method, the method comprising:
[0006] The scanning data within the dynamic delay range is calibrated; wherein, the scanning data is data obtained by scanning the first or second preset training code continuously sent by the peer by adjusting the dynamic delay parameter value;
[0007] When the calibration is completed at the local end, the sending of the first set training code to the peer end will be changed to sending the second set training code to the peer end, and the training code returned by the peer end will be continuously received.
[0008] When the training code is determined to be the second set training code, the calibration of the peer end is determined to be completed, and the handshake is successful.
[0009] Furthermore, according to the sampling data processing method provided by the present invention, the scanning data within the dynamic delay range is calibrated, including:
[0010] Determine the data transmission period;
[0011] When the data transmission period is greater than a set proportion of the dynamic delay range but less than the dynamic delay range, the sampling center point is determined based on the scan data;
[0012] When the data transmission period is less than or equal to a set proportion of the dynamic delay range, the sampling center point is determined based on the boundary values in the scan data.
[0013] Further, according to the sampling data processing method provided by the present invention, when the data transmission period is greater than a set proportion of the dynamic delay range and less than the dynamic delay range, determining the sampling center point based on the scanning data includes:
[0014] The first stable region and the second stable region are determined based on the scan data;
[0015] Virtual scan data is determined based on the first stable region and the second stable region; wherein, the virtual scan data includes scan data for one complete data transmission cycle;
[0016] The sampling center point is determined based on the virtual scan data.
[0017] Furthermore, according to the sampling data processing method provided by the present invention, determining virtual scan data based on the first stable region and the second stable region includes:
[0018] Compare the number of sampling points contained in the first stable region and the second stable region;
[0019] When the number of sampling points in the first stable region is less than the number of sampling points in the second stable region, the data in the first stable region is moved to the second stable region to form a virtual scan data.
[0020] When the number of sampling points in the first stable region is greater than or equal to the number of sampling points in the second stable region, the data in the second stable region is moved before the first stable region to form a virtual scan data.
[0021] Furthermore, according to the sampling data processing method provided by the present invention, determining the sampling center point based on the virtual scan data includes:
[0022] If the data within the first stable region is moved to the second stable region to form a virtual scan data, the calculation formula for determining the sampling center point based on the virtual scan data is as follows:
[0023] z = y1 + y0 / 2 + (x0 - (T1 - T0)) / 2
[0024] If the data within the second stable region is moved before the first stable region to form a virtual scan data, the calculation formula for determining the sampling center point based on the virtual scan data is as follows:
[0025] z = x0 / 2 - (y0 - (T1 - T0)) / 2
[0026] Where z is the sampling center point; x0 is the length of the first stable region; y0 is the length of the second stable region; T0 is the data transmission period; T1 is the dynamic delay range; and y1 is the value of the left boundary point of the second stable region.
[0027] Furthermore, according to the sampling data processing method provided by the present invention, determining the sampling center point based on the boundary values in the scan data includes:
[0028] Based on the scan data, the left boundary and third stable region of the scan data within a complete data transmission cycle are determined;
[0029] The sampling center point is obtained by adding the value of the left boundary and the value of the center point of the third stable region.
[0030] Furthermore, according to the sampling data processing method provided by the present invention, the method further includes:
[0031] When the training code is determined to be the first set training code, it is determined that the peer calibration is not completed, and a wait is initiated until the peer calibration is completed.
[0032] Furthermore, according to the sampling data processing method provided by the present invention, the method further includes:
[0033] While the calibration is not completed at this end, the system continues to receive the training code returned by the other end.
[0034] When the training code is the first set training code, it is determined that the peer has not completed calibration, and the handshake is re-established.
[0035] Furthermore, according to the sampling data processing method provided by the present invention, the method further includes:
[0036] When a set condition is triggered, this end returns to the above method; wherein the set condition is at least one of the following: the peer end is not powered on; the calibration of this end fails; the local end or the peer end is disconnected; the peer end completes calibration and the calibration of this end is not completed.
[0037] Secondly, embodiments of the present invention also provide a sampling data processing apparatus, the apparatus comprising:
[0038] The first calibration module is used to calibrate the scan data within the dynamic delay range; wherein, the scan data is data obtained by adjusting the dynamic delay parameter value through scanning the first or second preset training code continuously sent by the other end.
[0039] The second calibration module is used to change the sending of the first set training code to the sending of the second set training code to the sending of ...
[0040] The handshake module is used to determine that the peer calibration is complete when the training code is determined to be the second preset training code, and the handshake is successful.
[0041] This invention discloses a sampling data processing method and apparatus. The method includes: calibrating scan data within a dynamic delay range; wherein the scan data is data obtained by adjusting the dynamic delay parameter value through scanning a first or second preset training code continuously sent by the peer; when the calibration is completed at the local end, sending the first preset training code to the peer is changed to sending the second preset training code, and the local end continuously receives the training code returned by the peer; when the training code is determined to be the second preset training code, the calibration at the peer is determined to be complete, and the handshake is successful. Using this method, by scanning boundary points and combining a handshake with training codes, calibration is performed during the handshake process, which can obtain an accurate sampling center point, avoid metastability or bit errors during sampling, improve the sampling efficiency during calibration, and ensure communication stability.
[0042] It should be understood that the description in this section is not intended to identify key or essential features of the invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0043] The above and other features, advantages, and aspects of the various embodiments of the present invention will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0044] Figure 1A flowchart of a sampling data processing method provided in an embodiment of the present invention;
[0045] Figure 2 This is a schematic diagram of the virtual period splicing compensation calculation method in a sampling data processing method provided in an embodiment of the present invention;
[0046] Figure 3 This is an example diagram of state feedback in a handshake protocol provided in an embodiment of the present invention;
[0047] Figure 4 This is an example diagram illustrating the state machine implementation in a handshake protocol provided in an embodiment of the present invention;
[0048] Figure 5 This is a flowchart of a handshake protocol combined with reset training provided in an embodiment of the present invention;
[0049] Figure 6 This is a schematic diagram of a sampling data processing device provided in an embodiment of the present invention. Detailed Implementation
[0050] Embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. While some embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the invention. It should be understood that the accompanying drawings and embodiments are for illustrative purposes only and are not intended to limit the scope of protection of the invention.
[0051] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0052] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0053] It should be noted that the concepts of "first" and "second" mentioned in this invention are only used to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0054] It should be noted that the terms "a" and "a plurality of" used in this invention are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0055] The names of the messages or information exchanged between the multiple devices in the embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of these messages or information.
[0056] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means.
[0057] To provide a better understanding of the sampling data processing method provided by this invention, the relevant technologies involved are briefly introduced below.
[0058] 8B10B encoding is an encoding method proposed by IBM in 1983. This encoding encodes an 8-bit codeword into 10 bits for transmission according to the corresponding mapping code table and polarity value rules, so that the number of 0s and 1s in the encoded binary sequence is basically balanced. The purpose of using 8B10B encoding is to solve the problem of clock drift or synchronization loss at the receiving end when there are multiple consecutive 0s or 1s in high-speed serial data transmission.
[0059] Example 1
[0060] Figure 1 This is a flowchart of a sampling data processing method provided in an embodiment of the present invention. The embodiment of the present invention is applicable to the use case of calibration during handshake training. The method can be executed by a sampling data processing device, which can be implemented in the form of software and / or hardware, or optionally by an electronic device, such as a mobile terminal, a PC, or a server.
[0061] like Figure 1 As shown in the figure, a sampling data processing method provided by an embodiment of the present invention may specifically include the following steps:
[0062] S110. Calibrate the scan data within the dynamic delay range.
[0063] The scanned data is data obtained by scanning the first or second preset training code continuously sent by the other end by adjusting the dynamic delay parameter value.
[0064] It's important to understand that the calibration method is implemented within the calibration modules of the FPGAs on each device side. The overall hardware circuit modules for inter-board communication include: a transmitter encoding module, a transmitter rate conversion module, a transmitter serial-to-parallel conversion module, a receiver serial-to-parallel conversion module, a receiver calibration module, a receiver decoding module, and a receiver alignment module. Specifically, the transmitter encoding module performs 8B10B encoding on the data to be transmitted and outputs the parallel data after 8B10B encoding to the rate conversion module; the transmitter rate conversion module and the transmitter serial-to-parallel conversion module convert the parallel data into serial data and output it to the pin; the input serial-to-parallel conversion module converts the sampled serial data into parallel data and outputs it to the next stage; the receiver calibration module changes the dynamic delay to obtain the sampling center point and also performs logical shift operations on the serial-to-parallel conversion module to obtain the final valid data. The receiver decoding module performs 8B10B decoding on the received data; the receiver alignment module, when processing multi-channel parallel data, inputs the data from each channel into a synchronous FIFO for data reading operations to ensure data alignment across multiple channels. It is evident that the calibration method in this application is implemented based on the receiving end calibration module.
[0065] In this embodiment, the dynamic delay range refers to the adjustable range of dynamic delay provided by the device itself. The device can be an FPGA instrument. The scan data can be the data of all boundary points within the dynamic delay range. Both the first and second training codes use K23.7 from 8B10B encoding as the training code. When the receiving end of the device is disconnected or in calibration mode, the receiving end sends K23.7 + (10'h3A8) of the first training code; when the receiving end of the device is in link mode, the sending end sends K23.7 - (10'h057) of the second training code. Whether the first and second training codes correspond to positive or negative values of K23.7 is not specifically limited here and can be selected according to specific needs.
[0066] In this embodiment, data scanning is performed in the receiving end calibration module. During the scanning process, the step size of the dynamic delay parameter value is determined. According to the step size, the dynamic delay tap value is gradually adjusted from 0 to the maximum value to achieve scanning and obtain scanning data. In this embodiment, it is necessary to determine the sampling center point based on the scanning data. If the sampling center point is determined, the calibration is completed.
[0067] Based on the above embodiments, the calibration of scan data within the dynamic delay range specifically adopts the following steps:
[0068] a1) Determine the data transmission period.
[0069] In this embodiment, it is necessary to determine the data transmission period. By comparing the data transmission period with the dynamic delay range, the calibration method corresponding to the sampling center point is determined based on the comparison result. The specific processing method is described below and will not be detailed here. Specifically, the data transmission period is determined by the time required for one change in the signal waveform, based on the agreed data transmission rate. The data transmission period is determined according to the data transmission rate and the waveform change.
[0070] b1) When the data transmission period is greater than a set proportion of the dynamic delay range but less than the dynamic delay range, the sampling center point is determined based on the scan data.
[0071] In this embodiment, the sampling center point can be the center point of a stable region in the data transmission cycle.
[0072] Specifically, when the data transmission cycle is greater than a set proportion of the dynamic delay range but less than the dynamic delay range, the scanned data will not display the left and right boundary points of a complete data transmission cycle within the dynamic delay range. Instead, it may display the left boundary of a stable region for one data transmission cycle and the right boundary of a stable region for another data transmission cycle. In this case, it is necessary to determine each stable region within the dynamic delay range based on the scanned data, and determine the sampling center point by performing a virtual data transfer based on the relationship between the number of sampling points in the stable regions. Detailed processing steps are described in the following embodiment. In this embodiment, the set proportion is determined to be one-half, which is a parameter value less than 1. In other embodiments, it can be other values less than 1, which are not specifically limited here.
[0073] c1) When the data transmission period is less than or equal to a set proportion of the dynamic delay range, the sampling center point is determined based on the boundary values in the scan data.
[0074] Specifically, when the data transmission period is less than or equal to the set proportion of the dynamic delay range, that is, when a scan data within a complete data transmission period can appear within the dynamic delay range, and the scan result can show the left and right boundaries of a complete data transmission period, the sampling center point is determined directly based on the boundary values in the scan data.
[0075] Using this method, in this embodiment, based on the comparison results of different data transmission periods and dynamic delay ranges, the theoretical sampling center point is calculated by scanning boundary points or splicing virtual periods. This avoids metastability or acquisition errors during sampling. The virtual period splicing method ensures the accuracy of data acquisition and improves the accuracy of digital signal sampling center point calculation.
[0076] Based on the above embodiments, when the data transmission period is greater than a set proportion of the dynamic delay range but less than the dynamic delay range, determining the sampling center point based on the scan data specifically involves the following steps:
[0077] b11) Determine the first and second stable regions based on the scan data.
[0078] In this embodiment, it is necessary to determine the first stable region and the second stable region within the dynamic delay range based on the scan data. In this embodiment, the stable region refers to the region where the level of the digital signal is always high or low. The first stable region and the second stable region are stable regions on different data transmission cycles in this embodiment, that is, there is no complete data transmission cycle within the dynamic delay range.
[0079] In this embodiment, the steps are used to obtain the first stable region and the second stable region at different data transmission cycles within the dynamic delay range.
[0080] b12) Determine virtual scan data based on the first stable region and the second stable region.
[0081] The virtual scan data includes scan data from a complete data transmission cycle.
[0082] Specifically, the number of sampling points contained in the first stable region and the second stable region are compared. The larger the area occupied, the more sampling points there are, or the larger the length of the stable region, the more sampling points there are. Based on the comparison result, the data in the first stable region or the second stable region is moved to another stable region to form a virtual scan data.
[0083] b13) Determine the sampling center point based on the virtual scan data.
[0084] Based on the above embodiments, determining the virtual scan data based on the first stable region and the second stable region specifically involves the following steps:
[0085] b121) Compare the number of sampling points contained in the first stable region and the second stable region.
[0086] b122) If the number of sampling points in the first stable region is less than the number of sampling points in the second stable region, then the data in the first stable region is moved to the second stable region to form a virtual scan data.
[0087] (b123) If the number of sampling points in the first stable region is greater than the number of sampling points in the second stable region, then the data in the second stable region is moved before the first stable region to form a virtual scan data.
[0088] Specifically, the areas occupied by the number of sampling points in the first stable region and the second stable region are compared. If the number of sampling points in the first stable region is less than the number of sampling points in the second stable region, the data in the first stable region is moved after the second stable region to form a virtual scan data. If the number of sampling points in the first stable region is greater than the number of sampling points in the second stable region, the data in the second stable region is moved before the first stable region to form a virtual scan data.
[0089] According to the sampling data processing method provided in this embodiment, by using virtual period splicing, a stable region with fewer sampling points is moved before or after a stable region with more sampling points to obtain virtual scan data. The sampling center point is calculated based on the virtual scan data in the complete data transmission cycle, which can ensure the accuracy of data acquisition and improve the accuracy of digital signal sampling center point calculation.
[0090] Based on the above embodiments, determining the sampling center point according to the boundary values in the scan data involves the following steps:
[0091] c11) Determine the left boundary and third stable region of the scan data within a complete data transmission cycle based on the scan data.
[0092] c12) Add the value of the left boundary to the value of the center point of the third stable region to obtain the sampling center point.
[0093] In this embodiment, the method for determining the sampling center point is based on the case where a complete data transmission cycle occurs within the dynamic delay range. The third stable region can be a region where the number of sampling points is stable within a complete data transmission cycle. Based on the scan data, a third stable region within a complete data transmission cycle and its left boundary are determined. The value of the left boundary and the value of the center point of the third stable region can be directly added together to obtain the sampling center point. For example, if the left boundary value within a complete data transmission cycle is A, then the length of the third stable region is B. Using the method provided in this embodiment, the sampling center point A+B / 2 can be obtained.
[0094] According to the sampling data processing method provided in this embodiment, the sampling center point is calculated using the center point of the stable region, making the obtained sampling center point more accurate.
[0095] Based on the above embodiments, determining the virtual scan data based on the first stable region and the second stable region specifically involves the following steps:
[0096] If the data within the first stable region is moved to the second stable region to form a virtual scan data, the formula for determining the sampling center point based on the virtual scan data is as follows:
[0097] z = y1 + y0 / 2 + (x0 - (T1 - T0)) / 2
[0098] If the data within the second stable region is moved before the first stable region to form a virtual scan data, the formula for determining the sampling center point based on the virtual scan data is as follows:
[0099] z = x0 / 2 - (y0 - (T1 - T0)) / 2
[0100] Where z is the sampling center point; x0 is the length of the first stable region; y0 is the length of the second stable region; T0 is the data transmission period; T1 is the dynamic delay range; and y1 is the value of the left boundary point of the second stable region.
[0101] For example, Figure 2 This is a schematic diagram illustrating the virtual period splicing compensation calculation method in a sampling data processing method provided by an embodiment of the present invention. Figure 2 As shown, assuming the data transmission cycle is 2000ps and the dynamic delay range provided by the FPGA device is 2500ps, in the coordinate region, the x region shows the right boundary (denoted as x0+ERR0) of a data transmission cycle including the unstable region, and the y region shows the left boundary (denoted as y0+ERR1) of a data transmission cycle including the unstable region. Since the signal is periodic, if the scan result on the left side of y, i.e. the second stable region, is transferred to the left side of x and "pieced together" with the right side of the first stable region x to form a virtual complete data transmission cycle, the part to be compensated is 2000ps-x. To achieve the piecing together of the complete cycle, it is necessary to extract the data from the rightmost coordinate of x to the point x+(2000ps-x) in the y region for compensation. Since the x region contains the unstable region, it cannot be directly extracted from the scan result, while the y region contains the left boundary and a part that overlaps with the x region. The repetitive region can be represented as: y - (2000ps - x) = (2500ps - x) - (2000ps - x) = 2500ps - 2000ps = 500ps. Furthermore, the stable portion of the compensated region can be obtained as y0 - 500ps.
[0102] After considering compensation, assuming the data transmission cycle is T0 and the device's dynamic delay range is T1, when x0 is greater than or equal to y0 (i.e., the number of sampling points in the first stable region is greater than the number of sampling points in the second stable region), a portion of the y region (second stable region) needs to be compensated and moved to the x region to form a complete virtual scan cycle data. Its sampling center point is: x0 / 2 - (y0 - (T1 - T0)) / 2. When x0 is less than y0 (i.e., the number of sampling points in the first stable region is less than or equal to the number of sampling points in the second stable region), the data in the x region (first stable region) needs to be moved to the y region (second stable region) to form a complete scan cycle data. Its sampling center point is: the left boundary of y0 + y0 / 2 + (x0 - (T1 - T0)) / 2.
[0103] According to the sampling data processing method provided in this embodiment, by transferring and splicing data within a stable region, virtual scan data within a complete data transmission cycle is obtained. This solves the problem that some rates cannot obtain the complete left and right boundaries of the data transmission cycle due to the small dynamic delay range, thus making it impossible to accurately determine the sampling center point, and ensures the accuracy of data sampling processing.
[0104] S120. When the calibration is completed at the local end, the sending of the first set training code to the peer end is changed to sending the second set training code to the peer end, and the training code returned by the peer end is continuously received.
[0105] The first set training code indicates that the local or remote end has not completed calibration; the second set training code indicates that the local or remote end has completed calibration.
[0106] In this embodiment, both the first and second training codes use K23.7 from the 8B10B encoding as the training code. Since the number of 0 / 1 bits in K23.7 is equal, it will not cause unbalanced accumulation. Furthermore, this embodiment has been experimentally proven that forcibly setting the polarity of RD to 0 or 1 will not affect the system stability.
[0107] like Figure 3 As shown, when the line is idle, the link is maintained by continuously sending training codes. When the receiving end of the device is disconnected or in calibration state, the sending end sends the first set training code, namely K23.7+(10'h3A8) training code; when the receiving end of the device is in link state, the sending end sends the second set training code, namely K23.7-(10'h057) training code.
[0108] This method allows the user's status to be transmitted to the peer without bandwidth loss. In summary, the user can determine whether calibration is complete and a connection is successful by checking if the received data is K23.7, and can also determine the peer's connection by checking the polarity of the received data K23.7.
[0109] When the calibration is completed at the local end, the sending of the first set training code to the peer end will be changed to sending the second set training code to the peer end, and the local end will continue to receive the training code returned by the peer end.
[0110] S130. When the training code is determined to be the second set training code, and the calibration of the other end is completed, the handshake is successful.
[0111] Specifically, once the local calibration is complete, by changing the method of sending the first set training code to the peer to sending the second set training code, and continuously receiving the training code returned by the peer, when it is determined that the training code returned by the peer is the second set training code, it is determined that the peer has also completed calibration, and then the local end and the peer are successfully connected, and the handshake is successful.
[0112] In this embodiment, it further includes: when the training code is determined to be the first set training code, if it is determined that the peer calibration is not completed, the local end will wait until the peer calibration is completed.
[0113] According to the sampling data processing method provided in this embodiment, by scanning boundary points, splicing virtual periods, and combining the handshake method with 8B10B training codes, the device can reconnect after disconnection during the calibration process, and send out its own status without consuming bandwidth, thus ensuring the efficiency of sampling during the calibration process and ensuring stable communication.
[0114] Based on the above embodiments, in this embodiment, during the calibration and handshake process, each state machine goes through the processes of preparation, local calibration, peer calibration, and calibration completion. Figure 4 This is an example diagram illustrating the state machine implementation in a handshake protocol provided by an embodiment of the present invention. Figure 4 As shown, during the handshake process, both the local and remote sending modules need to undergo a calibration process: preparation > local calibration > remote calibration > calibration completion and successful link establishment. After power-on, the process proceeds from the preparation phase to step 1 for local calibration, providing feedback based on the local calibration results. After local calibration is completed, the process proceeds to step 2 for remote calibration, awaiting the remote calibration results. The remote calibration results are determined based on the training code data received by the local end. After remote calibration is completed, the process enters the link establishment completion state, begins sending messages, and monitors the link establishment status between the local and remote ends in real time.
[0115] In this embodiment, it further includes: when the calibration at the local end is not completed, continuously receiving the training code returned by the peer end; when the training code is the first set training code, determining that the peer end has not completed the calibration, and re-establishing the connection and handshaking.
[0116] In this embodiment, when a set condition is triggered, the local end returns to execute the above method; wherein the set condition is at least one of the following: the peer end is not powered on; the local end calibration fails; the local end or the peer end is disconnected; the peer end calibration is completed and the local end calibration is not completed.
[0117] Specifically, when a set condition is triggered, the local end returns to execute the above method. When implementing the technical solution of this invention, a situation may arise where the local end is calibrating but the calibration status of the remote end changes, causing a calibration error on the local end. In this case, a reset calibration operation is required. In this embodiment, the reset calibration operation is performed by triggering a set condition, wherein the set condition is at least one of the following:
[0118] When the other end is not powered on, this end will always be in calibration state unless otherwise controlled. When the other end is powered on, this end will reset the calibration state. If the other end completes calibration but this end has not, the other end will change the training code to indicate that the calibration is complete. At this time, the calibration result of this end is incorrect and should be recalibrated. Recalibration after this end fails. If one of the two ends disconnects after calibration is completed, both this end and the other end will check the calibration status. If the calibration of either end fails, rescanning and training will be performed.
[0119] For example, Figure 5 This is a flowchart illustrating a handshake protocol coordination reset training method provided in an embodiment of the present invention. Figure 5 As shown, if device A is the local end, when the local end fails to detect calibration, it re-calibrates. This involves adjusting the dynamic delay value to its minimum and gradually increasing it step-by-step according to the calibration method described above to obtain the scan result. After obtaining the scan result, the final calibration result is obtained using the formula described above, thus completing the calibration. Then, the positive or negative value of the K-code in the handshake protocol is used to check whether the peer end (device B) has completed calibration. If not, it waits until completion, ultimately establishing a connection. When the peer end fails to detect calibration under the set conditions, the local end sends a training code to support the peer end's calibration. After the peer end completes calibration, the connection is established. During calibration, the peer device also sends a corresponding training code based on its own calibration status and the handshake protocol. In this embodiment, monitoring data errors is combined with the handshake to obtain a real-time monitoring and reconnection handshake protocol. This means that the calibration status of both the local and peer ends can be monitored in real time using the training code. Without consuming bandwidth, the device promptly sends its own status and can automatically reconnect after disconnection, ensuring stable communication between devices.
[0120] This invention discloses a sampling data processing method, which includes: calibrating scanned data within a dynamic delay range; wherein the scanned data is data obtained by adjusting the dynamic delay parameter value through scanning a first or second preset training code continuously sent by the peer; when the calibration is completed at the local end, the sending of the first preset training code to the peer is changed to sending the second preset training code, and the receiving of the training code returned by the peer is continuous; when the training code is determined to be the second preset training code, the calibration at the peer is determined to be complete, and the handshake is successful. Using this method, by scanning boundary points and combining the handshake with the training code, calibration is performed during the handshake process, which can obtain an accurate sampling center point, avoid metastability or bit errors during sampling, improve the sampling efficiency during calibration, and ensure communication stability.
[0121] Example 2
[0122] Figure 6 A schematic diagram of a sampling data processing device is also provided as an embodiment of the present invention, such as... Figure 6 As shown, the device includes: a first calibration module 210, a second calibration module 220, and a handshake module 230.
[0123] The first calibration module 210 is used to calibrate the scan data within the dynamic delay range; wherein, the scan data is data obtained by adjusting the dynamic delay parameter value through scanning the first or second preset training code continuously sent by the other end.
[0124] The second calibration module 220 is used to change the sending of the first set training code to the sending of the second set training code to the sending of ...
[0125] The handshake module 230 is used to determine that the peer calibration is complete when the training code is determined to be the second set training code, and then the handshake is successful.
[0126] The technical solution provided by this invention utilizes the device to perform calibration during the handshake process by scanning boundary points and combining training codes. This allows for the acquisition of an accurate sampling center point, avoiding metastability or bit errors during sampling, improving sampling efficiency during calibration, and ensuring communication stability.
[0127] Furthermore, the first calibration module 210 can be used for:
[0128] Determine the data transmission period;
[0129] When the data transmission period is greater than a set proportion of the dynamic delay range but less than the dynamic delay range, the sampling center point is determined based on the scan data;
[0130] When the data transmission period is less than or equal to a set proportion of the dynamic delay range, the sampling center point is determined based on the boundary values in the scan data.
[0131] Furthermore, the first calibration module 210 can be used for:
[0132] The first stable region and the second stable region are determined based on the scan data;
[0133] Virtual scan data is determined based on the first stable region and the second stable region; wherein, the virtual scan data includes scan data for one complete data transmission cycle;
[0134] The sampling center point is determined based on the virtual scan data.
[0135] Furthermore, the first calibration module 210 can be used for:
[0136] Compare the number of sampling points contained in the first stable region and the second stable region;
[0137] If the number of sampling points in the first stable region is less than the number of sampling points in the second stable region, then the data in the first stable region is moved to the second stable region to form a virtual scan data.
[0138] If the number of sampling points in the first stable region is greater than the number of sampling points in the second stable region, then the data in the second stable region is moved before the first stable region to form a virtual scan data.
[0139] Furthermore, the first calibration module 210 can be used for:
[0140] If the data within the first stable region is moved to the second stable region to form a virtual scan data, the calculation formula for determining the sampling center point based on the virtual scan data is as follows:
[0141] z = y1 + y0 / 2 + (x0 - (T1 - T0)) / 2
[0142] If the data within the second stable region is moved before the first stable region to form a virtual scan data, the calculation formula for determining the sampling center point based on the virtual scan data is as follows:
[0143] z = x0 / 2 - (y0 - (T1 - T0)) / 2
[0144] Where z is the sampling center point; x0 is the length of the first stable region; y0 is the length of the second stable region; T0 is the data transmission period; T1 is the dynamic delay range; and y1 is the value of the left boundary point of the second stable region.
[0145] Furthermore, the first calibration module 210 can be used for:
[0146] Based on the scan data, the left boundary and third stable region of the scan data within a complete data transmission cycle are determined;
[0147] The sampling center point is obtained by adding the value of the left boundary and the value of the center point of the third stable region.
[0148] Furthermore, the device is also used for:
[0149] When the training code is determined to be the first set training code, it is determined that the peer calibration is not completed, and a wait is initiated until the peer calibration is completed.
[0150] Furthermore, the device is also used for:
[0151] While the calibration at this end is not complete, continue to receive the training code returned by the other end:
[0152] When the training code is the first set training code, it is determined that the peer has not completed calibration, and the handshake is re-established.
[0153] Furthermore, the device is also used for:
[0154] When a set condition is triggered, the local system returns to the method described above; wherein the set condition is at least one of the following: the peer is not powered on; the local calibration fails; the local or peer is disconnected; the peer calibration is completed but the local calibration is not completed.
[0155] The above-described apparatus can execute the methods provided in all the foregoing embodiments of the present invention, and has the corresponding functional modules and beneficial effects for executing the above methods. Technical details not described in detail in this embodiment can be found in the methods provided in all the foregoing embodiments of the present invention.
[0156] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0157] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A sampling data processing method, characterized in that, include: The scanning data within the dynamic delay range is calibrated; wherein, the scanning data is data obtained by scanning the first or second preset training code continuously sent by the peer by adjusting the dynamic delay parameter value; When the calibration is completed at the local end, the sending of the first set training code to the peer end will be changed to sending the second set training code to the peer end, and the training code returned by the peer end will be continuously received. When the training code is determined to be the second preset training code, the peer calibration is determined to be complete, and the handshake is successful. The calibration of the scan data within the dynamic delay range includes: Determine the data transmission period; When the data transmission period is greater than a set proportion of the dynamic delay range but less than the dynamic delay range, the sampling center point is determined based on the scan data; When the data transmission period is less than or equal to a set proportion of the dynamic delay range, the sampling center point is determined based on the boundary values in the scan data.
2. The method according to claim 1, characterized in that, When the data transmission period is greater than a set proportion of the dynamic delay range but less than the dynamic delay range, determining the sampling center point based on the scan data includes: The first stable region and the second stable region are determined based on the scan data; Virtual scan data is determined based on the first stable region and the second stable region; wherein, the virtual scan data includes scan data for one complete data transmission cycle; The sampling center point is determined based on the virtual scan data.
3. The method according to claim 2, characterized in that, The process of determining virtual scan data based on the first stable region and the second stable region includes: Compare the number of sampling points contained in the first stable region and the second stable region; When the number of sampling points in the first stable region is less than the number of sampling points in the second stable region, the data in the first stable region is moved to the second stable region to form a virtual scan data. When the number of sampling points in the first stable region is greater than or equal to the number of sampling points in the second stable region, the data in the second stable region is moved before the first stable region to form a virtual scan data.
4. The method according to claim 3, characterized in that, Determining the sampling center point based on the virtual scan data includes: If the data within the first stable region is moved to the second stable region to form a virtual scan data, the calculation formula for determining the sampling center point based on the virtual scan data is as follows: If the data within the second stable region is moved before the first stable region to form a virtual scan data, the calculation formula for determining the sampling center point based on the virtual scan data is as follows: Where z is the sampling center point; This represents the length of the first stable region. This represents the length of the second stable region. For data transmission cycle; The dynamic delay range; This is the value of the left boundary point of the second stable region.
5. The method according to claim 1, characterized in that, Determining the sampling center point based on the boundary values in the scan data includes: Based on the scan data, the left boundary and third stable region of the scan data within a complete data transmission cycle are determined; The sampling center point is obtained by adding the value of the left boundary and the value of the center point of the third stable region.
6. The method according to claim 1, characterized in that, The method further includes: When the training code is determined to be the first set training code, it is determined that the peer calibration is not completed, and a wait is initiated until the peer calibration is completed.
7. The method according to claim 1, characterized in that, The method further includes: While the calibration is not completed at this end, the system continues to receive the training code returned by the other end. When the training code is the first set training code, it is determined that the peer has not completed calibration, and the handshake is re-established.
8. The method according to any one of claims 1-6, characterized in that, Also includes: When a set condition is triggered, the local end returns to execute the sampling data processing method; wherein the set condition is at least one of the following: the peer end is not powered on; the local end calibration fails; the local end or the peer end is disconnected; the peer end calibration is completed and the local end calibration is not completed.
9. A sampling data processing device, characterized in that, include: The first calibration module is used to calibrate the scan data within the dynamic delay range; wherein, the scan data is data obtained by adjusting the dynamic delay parameter value through scanning the first or second preset training code continuously sent by the other end. The second calibration module is used to change the sending of the first set training code to the sending of the second set training code to the sending of ... The handshake module is used to determine that the peer calibration is complete when the training code is determined to be the second preset training code, and the handshake is successful. Specifically, the first calibration module is used for: Determine the data transmission period; When the data transmission period is greater than a set proportion of the dynamic delay range but less than the dynamic delay range, the sampling center point is determined based on the scan data; When the data transmission period is less than or equal to a set proportion of the dynamic delay range, the sampling center point is determined based on the boundary values in the scan data.
Citation Information
Patent Citations
Method and system for automatically correcting digital BPM sampling data multi-channel phase
CN108449084A
Data eye training method and device for high-speed interconnection interface of silicon dielectric layer
CN116049048A