Asynchronous communication data sampling method and device, equipment and medium
Patent Information
- Application Number
- CN202111369269.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-15
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2041-11-15
AI Technical Summary
[0005]鉴于以上现有技术中存在的缺点,本发明的目的在于提供一种异步通信数据采样方法、装置、设备及介质,用于解决现有的异步通信过程中由于采用较大分频系数设置来避免偏差累计,进而影响通信传输速度等问题
[0018] As described above, the asynchronous communication data sampling method, apparatus, device, and medium provided by the present invention can directly obtain the baud rate based solely on the count overflow rate, without the need for frequency division processing of the count overflow rate, while ensuring the accuracy of data sampling. This not only avoids the reduction in communication transmission rate caused by a large frequency division coefficient, thereby improving the communication rate in asynchronous transmission, but also improves the flexibility of baud rate parameter configuration during asynchronous communication.
Smart Images

Figure CN116126766B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of electronic communication technology, and more specifically relates to an asynchronous communication data sampling method, apparatus, device and medium. Background Art
[0002] Asynchronous communication, as a common communication mode between devices, can receive and transmit data simultaneously.
[0003] Among them, in the asynchronous communication process based on a single counter, the data sampling method is usually: configuring the counting period T of the counter to determine the counting overflow rate 1 / T according to the counting period T; performing frequency division processing on the counting overflow rate by using a frequency divider with a frequency division number of N, so that the baud rate after frequency division processing is obtained as 1 / (N*T), that is, the duration of each 1-bit data during transmission is N*T, which is the period of the baud rate; for any received communication data, the change time of the data is determined according to the start time T1 of data transmission, and then the sampling time of the communication data is determined as T1+n*T, where n<N and n is approximately equal to N / 2, which means that to ensure the accuracy of data sampling, sampling is required at the middle position of the data each time data sampling is performed.
[0004] Considering that after the receiving end is synchronized to the clock domain of the transmitting end, there is still a certain deviation in the transmission duration of a single communication data, and the deviation between the receiving end and the transmitting end will continuously accumulate as the transmission process proceeds; therefore, to ensure correct sampling of each communication data, a relatively large frequency division coefficient is usually configured, which in turn affects the maximum transmission rate in the asynchronous transmission process, leads to a reduction in communication speed, and thus affects communication efficiency; in addition, the baud rate after the overflow rate frequency division processing is an integer multiple of the overflow rate, and the multiple is relatively large, so that when communication is performed at a baud rate of a specific frequency, a relatively large data sampling deviation will occur, which in turn leads to data transmission errors or failures. Summary of the Invention
[0005] In view of the above disadvantages in the prior art, an object of the present invention is to provide an asynchronous communication data sampling method, apparatus, device and medium, which is used to solve the problems in the existing asynchronous communication process that the communication transmission speed is affected due to the adoption of a large frequency division coefficient setting to avoid deviation accumulation.
[0006] To achieve the above and other related objectives, the present invention provides an asynchronous communication data sampling method in a first aspect, comprising: synchronizing raw communication data to a system clock domain to obtain first communication data; performing successive delay processing on the first communication data to sequentially obtain second communication data, third communication data, and fourth communication data; when a raw change signal is detected in the raw communication data, extracting corresponding first communication data change signals and third communication data change signals from the first communication data and the third communication data, respectively, to construct a change detection signal based on the first communication data change signals and the third communication data change signals; acquiring a data sampling signal; and selecting a data source from the second communication data and the fourth communication data based on the timing relationship between the data sampling signal and the change detection signal, and performing data sampling on the selected data source to obtain information corresponding to the raw change signal.
[0007] In one embodiment of the present invention, the step of performing successive delay processing on the first communication data to sequentially obtain the second communication data, the third communication data, and the fourth communication data includes: delaying the first communication data according to a first clock interval to obtain the second communication data; delaying the second communication data according to a second clock interval to obtain the third communication data; and delaying the third communication data according to a third clock interval to obtain the fourth communication data.
[0008] In one embodiment of the present invention, the first clock interval, the second clock interval, and the third clock interval each include any integer number of clock signals from 2 to 5.
[0009] In one embodiment of the present invention, constructing a change detection signal based on the first communication data change signal and the third communication data change signal includes: setting the first communication data change signal as a start bit signal and setting the third communication data change signal as a stop bit signal to obtain the change detection signal.
[0010] In one embodiment of the present invention, determining the data source from the second communication data and the fourth communication data based on the time distribution characteristics of the data sampling signal and the change detection signal includes: detecting whether the sampling time of the data sampling signal is after the start time of the change detection signal and before the end time of the change detection signal, and whether it is within the duration range of the change detection signal; if so, the fourth communication data is selected as the data source; if not, the second communication data is selected as the data source.
[0011] In one embodiment of the present invention, the asynchronous communication data sampling method further includes: after performing data sampling on the data source, detecting the quality of the sampled data, and adjusting the size of the first clock interval, the second clock interval and the third clock interval according to the detection result.
[0012] The present invention provides an asynchronous communication data sampling method in a second aspect, comprising: a first communication data acquisition unit for synchronizing raw communication data to a system clock domain; a delay processing unit for performing successive delay processing on the first communication data to sequentially obtain second communication data, third communication data, and fourth communication data; an edge detection unit for extracting corresponding first communication data change signals and third communication data change signals from the first communication data and the third communication data, respectively, when the raw communication data detects a raw change signal; a change detection signal construction unit for constructing a change detection signal based on the first communication data change signal and the third communication data change signal; a sampling signal acquisition unit for acquiring a data sampling signal; a data source selection unit for selecting a data source from the second communication data and the fourth communication data based on the timing relationship between the data sampling signal and the change detection signal; and a data sampling unit for performing data sampling on the selected data source to obtain information corresponding to the raw change signal.
[0013] In one embodiment of the present invention, the delay processing unit includes: a clock interval determination submodule, configured to determine a first clock interval, a second clock interval, and a third clock interval respectively; a delay submodule, configured to delay processing the first communication data according to the first clock interval to obtain the second communication data; delay processing the second communication data according to the second clock interval to obtain the third communication data; and delay processing the third communication data according to the third clock interval to obtain the fourth communication data.
[0014] In one embodiment of the present invention, the data source selection unit includes: a detection submodule, configured to detect whether the sampling time of the data sampling signal is located after the start time of the change detection signal and before the end time of the change detection signal, so as to obtain a detection result; and a selection submodule, configured to select the second communication data or the fourth communication data as the data source based on the detection result.
[0015] In one embodiment of the present invention, the asynchronous communication data sampling device includes: the selection submodule includes a level signal output submodule, which is used to output different level signals according to the detection results obtained by the detection submodule, so as to select the second communication data or the fourth communication data as the data source according to the different level signals.
[0016] The present invention provides an electronic device in a third aspect, comprising: a processor, a communication interface, a memory, and a communication bus; wherein the processor, the communication interface, and the memory communicate with each other via the communication bus; the memory is used to store at least one instruction; the instruction causes the processor to execute the asynchronous communication data sampling method as described in any of the preceding claims.
[0017] In a fourth aspect, the present invention provides a computer storage medium storing a computer program, characterized in that the computer program, when executed by a processor, implements any of the asynchronous communication data sampling methods described above.
[0018] As described above, the asynchronous communication data sampling method, apparatus, device, and medium provided by the present invention can directly obtain the baud rate based solely on the count overflow rate, without the need for frequency division processing of the count overflow rate, while ensuring the accuracy of data sampling. This not only avoids the reduction in communication transmission rate caused by a large frequency division coefficient, thereby improving the communication rate in asynchronous transmission, but also improves the flexibility of baud rate parameter configuration during asynchronous communication. Attached Figure Description
[0019] Figure 1 A timing diagram of the asynchronous communication data sampling method described in the prior art for receiving data at the receiving end;
[0020] Figure 2 A flowchart illustrating the asynchronous communication data sampling method provided in this invention in one embodiment;
[0021] Figure 3 A timing diagram of an embodiment of the asynchronous communication data sampling method described in this invention (the sampling time of the sampling signal is located before the start time of the change detection signal);
[0022] Figure 4 A timing diagram of one embodiment of the asynchronous communication data sampling method described in this invention (the sampling time of the sampling signal is located after the termination time of the change detection signal);
[0023] Figure 5 A timing diagram of an embodiment of the asynchronous communication data sampling method described in this invention; (the sampling time of the sampling signal is within the time range of the change detection signal);
[0024] Figure 6 A schematic diagram of the asynchronous communication data sampling device provided in this invention in one embodiment; Detailed Implementation
[0025] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, unless otherwise specified, the following embodiments and features described therein can be combined with each other.
[0026] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0027] Please see Figure 1 The diagram illustrates the timing of an asynchronous communication data sampling method in the prior art. This method is applicable to asynchronous communication processes where the baud rate is acquired based on a single counter.
[0028] Specifically, such as Figure 1 As shown, clk is the system clock, and tovfl is the counter overflow flag. When the receiving end detects the falling edge of the start bit in the communication data rxd, the frequency divider counter is enabled to start working, and the monitor is enabled to monitor the count value rx_cnt in the counter. When the count value rx_cnt reaches a preset value, as shown... Figure 1 When the clock signal reaches the intermediate value of 4, the clock signal rx_clk of the calculator is set high to generate an overflow interrupt. Then the receiving end performs data sampling to capture stable data.
[0029] To address the technical problems existing in the prior art, ensure accurate data sampling during asynchronous communication while avoiding a reduction in the communication rate and improving the flexibility of baud rate and other parameter settings, this invention provides an asynchronous communication data sampling method, apparatus, device, and computer-readable storage medium. By performing multiple delay processing on the original communication data, multiple delayed communication data are obtained. Based on the delayed communication data, a change detection signal is constructed. In the system clock domain, it is detected whether the sampling time of the current sampling point is within the time range of the change detection signal. Based on the detection result, it is determined whether the receiving end performs delayed sampling on the original communication data, thus eliminating the need for frequency division processing of the count overflow rate and achieving accurate sampling of the communication data.
[0030] Example 1
[0031] Please see Figure 2The diagram shows a flowchart of an embodiment of the asynchronous communication data sampling method provided by the present invention; as shown below. Figure 2 The method includes:
[0032] S1, when the working state is idle, the received raw communication data is synchronized to the system clock domain to obtain the first communication data; the first communication data is processed by successive delay to obtain the second to fourth communication data in sequence;
[0033] The second to the fourth communication data are sequentially delayed relative to each other.
[0034] Specifically, when the receiving end is in an idle state, the clock signal of the original communication data arriving at the receiving port is synchronized to the system clock domain to obtain the first communication data;
[0035] Based on a preset first clock interval X1, the first communication data is delayed to obtain the second communication data; that is, in the system clock domain, the clock signal of the second communication data is delayed by X1 clock signals compared with the clock signal of the first communication data.
[0036] Based on a preset second clock interval X2, the second communication data is delayed to obtain the third clock data; that is, in the system clock domain, the clock signal of the third communication data is delayed by X2 clock signals compared to the clock signal of the second communication data.
[0037] Furthermore, based on a preset third clock interval X3, the third communication data is delayed to obtain the fourth clock data; that is, in the system clock domain, the clock signal of the fourth communication data is delayed by X3 clock signals compared to the clock signal of the third communication data.
[0038] Optionally, the number of clock signals included in the first clock interval, the second clock interval, and the third clock interval are all any integer from 2 to 5. That is, the number of clock signals included in the first clock interval is any integer from 2 to 5, the number of clock signals included in the second clock interval is any integer from 2 to 5, and the number of clock signals included in the third clock interval is any integer from 2 to 5, so as to ensure that the clock interval between the sampling point time and the data change time is not less than 2, thereby reducing the bit error rate of the receiver during the communication data reception process.
[0039] Optionally, the number of clock signals included in the first clock interval, the second clock interval, and the third clock interval are all the same, and are any integer from 2 to 5.
[0040] Furthermore, the number of clock signals included in the first clock interval, the second clock interval, and the third clock interval may be different or all of them may be different, so as to improve the sampling effect of the receiving end for communication data with different transmission rates and further expand the applicability of the method.
[0041] S2, detect the original communication data, and when an original change signal is detected in the original communication data, extract the corresponding first communication data change signal and third communication data change signal from the first communication data and the third communication data respectively, so as to construct a change detection signal based on the first communication data change signal and the third communication data change signal;
[0042] Specifically, in the idle state, edge detection is performed on the raw communication data received by the receiving port; when a falling edge signal or a rising edge signal is detected in the raw communication data, the signal change in the first communication data and the third communication data is extracted to obtain the first communication data change signal and the third communication data change signal corresponding to the change signal in the raw communication data; the time for obtaining the change signal in the first communication data and the third communication data is T1 and T3 respectively.
[0043] Based on the change signal of the first communication data and the change signal of the third communication data, a change detection signal is constructed; specifically, the change signal of the first communication data is set as the start bit signal of the change detection signal; and the change signal of the third communication data is set as the end bit signal of the change detection signal to form the change detection signal; then the duration of the change detection signal is T1 to T3.
[0044] Optionally, the change detection signal is a high-level signal.
[0045] It should be noted that after the receiving end detects the first falling edge in the original communication data, the counter starts counting and data sampling begins.
[0046] S3, acquire data sampling signal; based on the sampling time of the sampling signal in the system time domain, and based on the temporal relationship between the sampling time and the change detection signal time, select a data source from the second communication data and the fourth communication data, and perform data sampling on the selected data source to obtain the information corresponding to the original change signal.
[0047] Specifically, such as Figure 3As shown, in the system clock domain, when the sampling time of the detected sampling point is before the start time of the corresponding change detection signal, and the sampling time is not within the duration of the change detection signal, then the time difference between the time of the sampling point and the change signal in the second communication data is greater than the preset time interval X, that is, the time interval between the sampling point and the data change in the second communication data is large, then the second communication data is selected as the sampling data source for subsequent data sampling.
[0048] like Figure 4 As shown, in the system clock domain, when the sampling time of the detected sampling point is after the termination time of the corresponding change detection signal, and the sampling time of the sampling point is not within the duration range of the change detection signal, then the time difference between the sampling point and the change signal in the second communication data is greater than the preset time interval X. Similarly, the second communication data is selected as the sampling data source for subsequent data sampling.
[0049] like Figure 5 As shown, in the system clock domain, when the sampling time of the detected sampling point is within the duration range of the change detection signal, that is, when the sampling point is within the high level range of the change detection signal, the time interval between the sampling point and the data change in the second communication data is small. If data sampling is performed at this time, it may cause errors in the communication data during the synchronization process. In order to avoid errors in the synchronization process, the fourth communication data is selected as the sampling data source for subsequent data sampling to ensure that there is a large time interval between the sampling point and the data change point in the communication data. The data sampling process performed with the fourth communication data as the data source is the same as the data sampling process performed with the second communication data as the data source as described above, and will not be repeated here.
[0050] To better understand the asynchronous communication data sampling method described in this invention, the method is explained in conjunction with the asynchronous communication process below:
[0051] After being reset, the receiving end is in an idle state. When the third communication data becomes low, the operating state is switched to the initial state, forming a change detection signal. In the initial state, if the sampling time of the detected sampling point is outside the duration of the change detection signal, the second communication data is sampled. If the sampled data is 1, it indicates that there is an error in the start bit of the reception. The operating state of the receiving end is then adjusted back to the initial idle state, and the process is repeated, i.e., steps S1 to S3. If the sampled data is 0, it indicates that the start bit 0 has been received. The operating state of the receiving end switches to the data receiving state, receives each data bit in the communication data, and uses a counter to count and determine whether the check bit has been reached. When the check bit is reached, the sampled data on the check bit is detected. If the detection is error-free, the transmission is completed. The operating state of the receiving end is then returned to the idle state, and the process is repeated, i.e., steps S1 to S3, thereby realizing asynchronous transmission of communication data.
[0052] Optionally, the asynchronous communication data sampling method further includes: after performing data sampling on the data source, detecting the quality of the sampled data, and adjusting the size of each clock interval according to the detection result.
[0053] Specifically, after performing several data samplings on the second communication data or the fourth communication data, each sampled data is obtained; based on the original communication data and the sampled data, the sampling error rate of the data sampling process is obtained; it is detected whether the sampling error rate is greater than a preset error rate threshold. If so, the first clock interval, the second clock interval, and the third clock interval are increased to improve the quality of the sampled data.
[0054] In one specific implementation, the method for obtaining the sampling error rate of the data sampling process based on the original communication data and the sampling data includes: comparing each of the sampling data with its corresponding original communication data, extracting the sampling data that is different from the original communication data as error data, and calculating the proportion of the number of error data in the total sampling data to obtain the sampling error rate.
[0055] Example 2
[0056] To address the technical problems existing in the prior art, this invention provides an asynchronous communication data sampling device in this embodiment; please refer to... Figure 6 The diagram shows the structure of the asynchronous communication data sampling device in this embodiment; as shown... Figure 6As shown, the asynchronous communication data sampling device 100 includes: a first communication data acquisition unit 101, a delay processing unit 102, an edge detection unit 103, a change detection signal construction unit 104, a sampling signal acquisition unit 105, a data source selection unit 106, and a data sampling unit 107.
[0057] The first communication data acquisition unit 101 is used to synchronize the original communication data to the clock domain;
[0058] The delay processing unit 102 is used to perform successive delay processing on the first communication data to obtain the second to fourth communication data in sequence;
[0059] Optionally, the delay processing unit 102 includes: a clock interval determination submodule and a delay submodule;
[0060] The clock interval determination submodule is used to determine the size of the first clock interval, the second clock interval, and the third clock interval, respectively.
[0061] The delay submodule is configured to delay the processing of the first communication data according to the first clock interval to obtain the second communication data; delay the processing of the second communication data according to the second clock interval to obtain the third communication data; and delay the processing of the third communication data according to the third clock interval to obtain the fourth communication data.
[0062] The edge detection unit 103 is used to extract the corresponding first communication data change signal and the third communication data change signal from the first communication data and the third communication data respectively when the original communication data detects the original change signal;
[0063] The change detection signal construction unit 104 is used to construct a change detection signal based on the first communication data change signal and the third communication data change signal;
[0064] Specifically, the process by which the change detection signal construction unit 104 constructs the change detection signal is the same as the process in Embodiment 1, and will not be repeated here.
[0065] The sampling signal acquisition unit 105 is used to acquire data sampling signals;
[0066] The data source selection unit 106 is used to select a data source from the second communication data and the fourth communication data according to the timing relationship between the data sampling signal and the change detection signal.
[0067] Furthermore, the data source selection unit 106 includes a detection submodule and a selection submodule;
[0068] The detection submodule is used to detect whether the sampling time of the data sampling signal is within the duration range of the change detection signal, and obtain the detection result; the selection submodule is used to select the second communication data or the fourth communication data as the data source based on the detection result.
[0069] Optionally, the selected submodule includes a level signal output submodule, which is used to output different level signals according to the detection results obtained by the detection submodule, so as to select the second communication data or the fourth communication data as the data source according to the different level signals.
[0070] For example, when the detection result obtained by the detection submodule is that the sampling time of the data sampling signal is within the duration range of the change detection signal, and the level signal output submodule outputs a high level signal, then the fourth communication data is selected as the data source; when the detection result obtained by the detection submodule is that the sampling time of the data sampling signal is outside the duration range of the change detection signal, and the level signal output submodule outputs a level of 0, then the second communication data is selected as the data source; optionally, at the end of a single data acquisition, the level signal output submodule outputs a low level signal, that is, the selected submodule is in an idle state.
[0071] In this embodiment, the data sampling unit 107 is used to perform data sampling on the selected data source to obtain information corresponding to the original change signal.
[0072] Optionally, the asynchronous communication data sampling device further includes:
[0073] The clock interval adjustment unit is used to perform data sampling from the data source, detect the quality of the sampled data, and adjust the size of the first clock interval, the second clock interval, and the third clock interval according to the detection result.
[0074] The method for detecting the quality of the sampled data and adjusting the size of the clock interval based on the detection results is the same as in Embodiment 1, and will not be repeated here.
[0075] Example 3
[0076] To address the technical problems existing in the prior art, the present invention provides an electronic device in Embodiment 3 for implementing data sampling in asynchronous communication processes.
[0077] The electronic device includes a processor, a memory, a communication interface, and a system bus; the memory and the communication interface are connected to the processor via the system bus and communicate with each other; the memory is used to store at least one instruction, which causes the processor to execute each step of the asynchronous communication data sampling method described in Embodiment 1 above.
[0078] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0079] Example 4
[0080] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when invoked by a processor, implements the various steps of the asynchronous communication data sampling method described in Embodiment 1 above. The computer-readable storage medium may include random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device.
[0081] In summary, the asynchronous communication data sampling method, apparatus, device, and medium provided by this invention perform multiple delay processing on the original communication data to obtain multiple communication data after sequential delay; extract the data change signal in the communication data; and detect whether the current sampling point is within a certain time range of the data change signal in the system clock domain. Based on the detection result, the delayed communication data sampled by the receiving end is determined, thereby realizing the data communication process while ensuring the accuracy of data sampling. The method of this invention can directly obtain the baud rate based solely on the count overflow rate without the need for frequency division processing of the count overflow rate. This not only enables flexible configuration of commonly used baud rates in data communication but also avoids the reduction in communication transmission rate caused by a large frequency division coefficient, thereby improving the communication rate in asynchronous transmission.
[0082] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.
Claims
1. An asynchronous communication data sampling method, characterized by, include: Synchronize the raw communication data to the system clock domain to obtain the first communication data; Perform successive delay processing on the first communication data to obtain the second communication data, the third communication data, and the fourth communication data in sequence; When an original change signal is detected in the original communication data, the corresponding first communication data change signal and third communication data change signal are extracted from the first communication data and the third communication data, respectively, so as to construct a change detection signal based on the first communication data change signal and the third communication data change signal; Acquire data sampling signals; Based on the timing relationship between the data sampling signal and the change detection signal, a data source is selected from the second communication data and the fourth communication data, and data sampling is performed on the selected data source to obtain the information corresponding to the original change signal; Specifically, determining the data source from the second and fourth communication data based on the time distribution characteristics of the data sampling signal and the change detection signal includes: If the sampling time of the data sampling signal is detected to be after the start time of the change detection signal and before the end time of the change detection signal, then the fourth communication data is selected as the data source; otherwise, the second communication data is selected as the data source.
2. The method of claim 1, wherein the data samples are asynchronous communications. The step of performing successive delay processing on the first communication data to sequentially obtain the second communication data, the third communication data, and the fourth communication data includes: The first communication data is processed with a delay based on a first clock interval to obtain the second communication data; The second communication data is processed with a delay according to a second clock interval to obtain the third communication data; and... The third communication data is processed with a delay based on a third clock interval to obtain the fourth communication data.
3. The method of claim 2, wherein the data samples are asynchronous communications. The first clock interval, the second clock interval, and the third clock interval each include any integer number of clock signals from 2 to 5.
4. The asynchronous communication data sampling method according to claim 1, characterized in that, The step of constructing a change detection signal based on the first communication data change signal and the third communication data change signal includes: The first communication data change signal is set as the start bit signal, and the third communication data change signal is set as the stop bit signal to obtain the change detection signal.
5. The asynchronous communication data sampling method according to claim 2, characterized in that, Also includes: After performing data sampling on the data source, the quality of the sampled data is detected, and the size of the first clock interval, the second clock interval, and the third clock interval is adjusted according to the detection result.
6. An asynchronous communication data sampling device, characterized in that, include: The first communication data acquisition unit is used to synchronize the original communication data to the system clock domain in order to obtain the first communication data. The delay processing unit is used to perform successive delay processing on the first communication data to obtain the second communication data, the third communication data and the fourth communication data in sequence. An edge detection unit is used to extract the corresponding first communication data change signal and the third communication data change signal from the first communication data and the third communication data, respectively, when an original change signal is detected in the original communication data; A change detection signal construction unit is used to construct a change detection signal based on the first communication data change signal and the third communication data change signal; The sampling signal acquisition unit is used to acquire data sampling signals; A data source selection unit is configured to select a data source from the second communication data and the fourth communication data based on the temporal relationship between the data sampling signal and the change detection signal; wherein, determining the data source from the second communication data and the fourth communication data based on the temporal distribution characteristics of the data sampling signal and the change detection signal includes: If the sampling time of the data sampling signal is after the start time of the change detection signal and before the end time of the change detection signal, then the fourth communication data is selected as the data source; otherwise, the second communication data is selected as the data source. The data sampling unit is used to perform data sampling on the selected data source to obtain information corresponding to the original change signal.
7. The asynchronous communication data sampling device according to claim 6, characterized in that, The delay processing unit includes: The clock interval determination submodule is used to set the size of the first clock interval, the second clock interval, and the third clock interval respectively; The delay submodule is configured to delay the processing of the first communication data according to the first clock interval to obtain the second communication data; delay the processing of the second communication data according to the second clock interval to obtain the third communication data; and delay the processing of the third communication data according to the third clock interval to obtain the fourth communication data.
8. The asynchronous communication data sampling device according to claim 6, characterized in that, The data source selection unit includes: The detection submodule is used to detect whether the sampling time of the data sampling signal is after the start time of the change detection signal and before the end time of the change detection signal, so as to obtain the detection result; A selection submodule is used to select either the second communication data or the fourth communication data as the data source based on the detection results.
9. The asynchronous communication data sampling device according to claim 8, characterized in that, include: The selected submodule includes a level signal output submodule, which is used to output different level signals according to the detection results obtained by the detection submodule, so as to select the second communication data or the fourth communication data as the data source according to the different level signals.
10. An electronic device, characterized in that, include: Processor, communication interface, memory, and communication bus; The processor, the communication interface, and the memory communicate with each other via the communication bus; The memory is used to store at least one instruction; the instruction causes the processor to execute the asynchronous communication data sampling method as described in any one of claims 1 to 5.
11. A computer storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the asynchronous communication data sampling method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Tracking error signal detection apparatus and optical disc apparatus
CN101714366A
System and method for determining a time for safely sampling a signal of a clock domain
CN103812590A