A delayed triggering method and device for a sampling device

By setting the second PWM signal with time base synchronization and duty cycle in the PWM signal, the sampling device is directly triggered, which solves the problem of delayed sampling resource occupation and accuracy in the existing technology, and achieves more accurate delayed sampling.

CN116800230BActive Publication Date: 2024-08-27CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310786469.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-29
Publication Date
2024-08-27
Estimated Expiration
2043-06-29

AI Technical Summary

Technical Problem

In the existing technology, delayed sampling occupies resources and the delay is inaccurate. It is impossible to delay triggering the analog-to-digital converter to perform the sampling action after the rising edge or falling edge of the PWM waveform.

Method used

By obtaining the signal frequency of the PWM signal, determining the second PWM signal synchronized with its time base, determining the duty cycle of the second PWM signal based on the sampling delay length, and outputting the first PWM signal and the second PWM signal to the sampling device simultaneously , so that the sampling action is triggered by the edge of the second PWM signal.

Benefits of technology

The effect of delayed sampling after the edge of the PWM signal is achieved, the triggering time is more accurate and does not consume MCU running resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116800230B
    Figure CN116800230B
Patent Text Reader

Abstract

The present application relates to the field of signal processing technology, and provides a delayed triggering method and device for a sampling device. The method includes: obtaining the signal frequency of a first PWM signal; determining a second PWM signal synchronized with the first PWM signal time base according to the signal frequency; determining the duty cycle of the second PWM signal according to the sampling delay time; outputting the first PWM signal and the second PWM signal to the sampling device at the same time, so that the sampling device performs a sampling action when triggered by the edge of the second PWM signal. The present application triggers the sampling device to perform a sampling action by setting a second PWM signal synchronized with the first PWM signal time base and having a duty cycle corresponding to the sampling delay time, thereby achieving the effect of delayed sampling. The sampling device is directly triggered by the second PWM signal generated by hardware, does not involve software interrupts, has a more accurate triggering moment, and does not require consumption of operating resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of signal processing technology, and in particular to a time-delay triggering method and device for a sampling device. Background Art

[0002] In the existing chip settings, a sampling function that can be used directly is pre-configured, and its specific implementation process includes: the rising edge or falling edge of the output PWM (Pulse Width Modulation) waveform triggers the analog-to-digital converter to perform a sampling action. According to this sampling function, the analog-to-digital converter cannot perform a sampling action after a specific period of time after the rising edge or falling edge of the PWM waveform.

[0003] In order to meet the needs of delayed sampling, a solution is proposed to set up another timer for delayed timing. The specific implementation process includes: triggering the timer to start timing at the rising or falling edge of the PWM waveform, and triggering the analog-to-digital converter to perform sampling after a specific time. The triggering of the timer and software involves interrupts and related code calls, which require the participation of the MCU and consume the operating resources of the MCU. In addition, the software execution is time-consuming, which may cause inaccurate delays.

[0004] Therefore, how to provide a solution to the above technical problems is a problem that those skilled in the art need to solve. Summary of the invention

[0005] In view of this, an embodiment of the present application provides a method and device for delayed sampling of a signal to solve the problems of delayed sampling occupying resources and inaccurate delay in the prior art.

[0006] According to a first aspect of an embodiment of the present application, a time-delay triggering method for a sampling device is provided, comprising:

[0007] Acquire a signal frequency of a first PWM signal;

[0008] Determine a second PWM signal synchronized with the first PWM signal time base according to the signal frequency;

[0009] Determining the duty cycle of the second PWM signal according to the sampling delay time;

[0010] The first PWM signal and the second PWM signal are simultaneously output to the sampling device, so that the sampling device performs a sampling action when triggered by an edge of the second PWM signal.

[0011] A second aspect of an embodiment of the present application provides a time delay trigger device for a sampling device, comprising:

[0012] A frequency determination module, used for obtaining the signal frequency of the first PWM signal;

[0013] A signal determination module, used for determining a second PWM signal synchronized with the first PWM signal time base according to the signal frequency;

[0014] A duty cycle determination module, used to determine the duty cycle of the second PWM signal according to the sampling delay time;

[0015] The signal generating module is used to output the first PWM signal and the second PWM signal to the sampling device simultaneously, so that the sampling device performs a sampling action when triggered by the edge of the second PWM signal.

[0016] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0017] According to a fourth aspect of an embodiment of the present application, a readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0018] Compared with the prior art, the embodiments of the present application have at least the following beneficial effects: the embodiments of the present application set a second PWM signal that is synchronized with the first PWM signal time base and has a duty cycle corresponding to the sampling delay time, so that the sampling device is triggered by the edge of the second PWM signal to perform a sampling action, thereby achieving the effect of delayed sampling after the edge of the first PWM signal is triggered. In this solution, the sampling device is directly triggered by the second PWM signal generated by hardware, does not involve software interrupts, has a more accurate triggering time, and does not require consuming MCU operating resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0020] Figure 1 It is a schematic diagram of an application scenario of an embodiment of the present application;

[0021] Figure 2 It is a flowchart of a delayed triggering method of a sampling device provided in an embodiment of the present application;

[0022] Figure 3 is a waveform diagram of a first PWM signal and a second PWM signal provided in an embodiment of the present application;

[0023] Figure 4is another waveform diagram of a first PWM signal and a second PWM signal provided in an embodiment of the present application;

[0024] Figure 5 It is a structural schematic diagram of a time delay trigger device of a sampling device provided in an embodiment of the present application;

[0025] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0027] A delayed triggering method and device for a sampling device according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.

[0028] Figure 1 1 is a schematic diagram of an application scenario of an embodiment of the present application. The application scenario may include a first terminal device 101, a second terminal device 102, a sampling device 103, a server 104 and a network 105.

[0029] The first terminal device 101 can be hardware or software. When the first terminal device 101 is hardware, it can be an electronic device including a processor, a memory, a computer program stored in the memory and executable on the processor, including but not limited to a smart phone, a tablet computer, a laptop computer, and a desktop computer; when the first terminal device 101 is software, it can be installed in the electronic device described above. The first terminal device 101 can be implemented as multiple software or software modules, or as a single software or software module, and the embodiment of the present application does not limit this. Furthermore, various applications can be installed on the first terminal device 101, such as data processing applications, instant messaging tools, social platform software, search applications, shopping applications, etc.

[0030] The second terminal device 102 can be hardware or software. When the second terminal device 102 is hardware, it can be an electronic device including a processor, a memory, and a computer program stored in the memory and executable on the processor, including but not limited to a smart phone, a tablet computer, a laptop computer, and a desktop computer; when the second terminal device 102 is software, it can be installed in the electronic device described above. The second terminal device 102 can be implemented as multiple software or software modules, or as a single software or software module, which is not limited in the embodiment of the present application. Furthermore, various applications can be installed on the second terminal device 102, such as data processing applications, instant messaging tools, social platform software, search applications, shopping applications, etc.

[0031] The sampling device 103 can be hardware or software. When the sampling device 103 is hardware, it can be various electronic devices with a display screen and supporting communication with the server 104, including but not limited to smart phones, tablet computers, laptop portable computers and desktop computers, etc.; when the sampling device 103 is software, it can be installed in the electronic device as described above. The sampling device 103 can be implemented as multiple software or software modules, or as a single software or software module, and the embodiment of the present application does not limit this. Furthermore, various applications can be installed on the sampling device 103, such as data processing applications, instant messaging tools, social platform software, search applications, shopping applications, etc.

[0032] The server 104 may be a server that provides various services, for example, a background server that receives a request sent by a terminal device that establishes a communication connection with the server, and the background server may receive and analyze the request sent by the terminal device, and generate a processing result. The server 104 may be a single server, or a server cluster composed of several servers, or a cloud computing service center, which is not limited in the present embodiment of the application.

[0033] It should be noted that the server 104 can be hardware or software. When the server 104 is hardware, it can be various electronic devices that provide various services for the first terminal device 101, the second terminal device 102, and the sampling device 103. When the server 104 is software, it can be multiple software or software modules that provide various services for the first terminal device 101, the second terminal device 102, and the sampling device 103, or it can be a single software or software module that provides various services for the first terminal device 101, the second terminal device 102, and the sampling device 103, and the embodiment of the present application does not limit this.

[0034] The network 105 can be a wired network connected by coaxial cable, twisted pair and optical fiber, or it can be a wireless network that can interconnect various communication devices without wiring, such as Bluetooth, Near Field Communication (NFC), infrared, etc., which is not limited in the embodiments of the present application.

[0035] It should be noted that the specific types, quantities and combinations of the first terminal device 101, the second terminal device 102, the sampling device 103, the server 104 and the network 105 can be adjusted according to the actual needs of the application scenario, and the embodiments of the present application do not limit this.

[0036] It should be noted that the specific types, quantities and combinations of the first terminal device 101, the second terminal device 102, the sampling device 103, the server 104 and the network 105 can be adjusted according to the actual needs of the application scenario, and the embodiments of the present application do not limit this.

[0037] Figure 2 It is a flowchart of a delayed triggering method for a sampling device provided in an embodiment of the present application.

[0038] like Figure 2 As shown, the delayed sampling method includes:

[0039] S201: Acquire the signal frequency of the first PWM signal;

[0040] S202: Determine a second PWM signal synchronized with the first PWM signal time base according to the signal frequency;

[0041] S203: Determine the duty cycle of the second PWM signal according to the sampling delay time;

[0042] S204: Output the first PWM signal and the second PWM signal to the sampling device simultaneously, so that the sampling device performs a sampling action when triggered by an edge of the second PWM signal.

[0043] Figure 2 The delayed sampling method can be obtained by Figure 1 The first terminal device or the second terminal device is executed, and the first terminal device or the second terminal device is connected to the sampling device to achieve the purpose of performing the sampling action when triggered by the edge of the second PWM signal.

[0044] It can be understood that the first PWM signal can be regarded as a delayed trigger signal, which triggers the delay timing. After waiting for the sampling delay time, the edge of the second PWM signal will trigger the sampling device, causing the sampling device to perform the sampling action, thereby achieving the effect of delaying the triggering of the sampling device after the edge of the first PWM signal.

[0045] The sampling object of the sampling device when performing the sampling action can be selected according to actual needs, and is not limited in this embodiment. The purpose of this embodiment is to set the triggering moment for the sampling device to perform the sampling action.

[0046] The embodiment of the present application sets a second PWM signal that is synchronized with the first PWM signal time base and has a duty cycle corresponding to the sampling delay time, so that the sampling device is triggered by the edge of the second PWM signal to perform the sampling action, thereby achieving the effect of delayed sampling after the edge of the first PWM signal is triggered. In this solution, the sampling device is directly triggered by the second PWM signal generated by hardware, does not involve software interrupts, has a more accurate triggering time, and does not consume the operating resources of the MCU.

[0047] In some specific embodiments, the process of determining the second PWM signal synchronized with the first PWM signal time base according to the signal frequency in step S102 includes:

[0048] Determine the start time of the first PWM signal;

[0049] According to the start time and the signal frequency, a second PWM signal having the same start time and the same signal frequency as the first PWM signal is determined.

[0050] It can be understood that the first PWM signal is a periodic pulse signal, and the period is inversely proportional to the signal frequency. When the second PWM signal has the same signal frequency as the first PWM signal, the first PWM signal of each period can delay the sampling delay time and then trigger the sampling device to perform the sampling action. In addition to the same signal frequency, the time base synchronization also requires the same starting time, where the starting time is the starting time of each period. The pre-configured sampling function triggers the sampling at the starting time of the first PWM signal. In this embodiment, the edge of the second PWM signal is required to trigger the sampling action. In order to make the difference between the edge of the second PWM signal and the original triggering edge of the second PWM signal by the sampling delay time, the starting edge of the second PWM signal and the starting edge of the first PWM signal (i.e., the original triggering edge) can be set to the same time, that is, the same starting time, and the pulse length after the starting edge is determined by the duty cycle as the sampling delay time of the period. The second PWM signal uses the ending edge of the pulse of the period as the triggering edge, which can ensure that the delayed sampling is carried out accurately.

[0051] Furthermore, before determining the second PWM signal having the same start time and the same signal frequency as the first PWM signal according to the start time and the signal frequency, the method further includes:

[0052] Determine a starting edge of the first PWM signal; the starting edge is a rising edge or a falling edge;

[0053] Correspondingly, the process of determining a second PWM signal having the same start time and the same signal frequency as the first PWM signal according to the start time and the signal frequency includes:

[0054] According to the start time, the start edge and the signal frequency, a second PWM signal having the same start time, the same start edge and the same signal frequency as the first PWM signal is determined.

[0055] It can be understood that, for a PWM signal of one cycle, its starting edge can be a rising edge or a falling edge. Further, in order to ensure the time base synchronization of the first PWM signal and the second PWM signal and improve the convenience of analysis and processing, in addition to the same starting time, the starting edge of the second PWM signal can be set to the same starting edge as the first PWM signal, that is, if the starting edge of the first PWM signal is a rising edge, the starting edge of the second PWM signal is also a rising edge, and if the starting edge of the first PWM signal is a falling edge, the starting edge of the second PWM signal is also a falling edge.

[0056] In some specific embodiments, after determining that the time bases of the second PWM signal and the first PWM signal are synchronized, the duty cycle of the second PWM signal will be determined according to the sampling delay time. It can be understood that the physical meaning of the duty cycle is the percentage of the duration of the pulse length in each cycle in the cycle, and the sampling delay time corresponds to the pulse length in each cycle. Therefore, the process of determining the duty cycle of the second PWM signal according to the sampling delay time in step S103 includes:

[0057] Determine the signal period corresponding to the signal frequency;

[0058] Based on the signal cycle, the ratio of the sampling delay time length to the signal cycle is determined as the duty cycle of the second PWM signal.

[0059] It can be understood that the signal period=1 / signal frequency, and the duty cycle of the second PWM signal=sampling delay time / signal period.

[0060] Furthermore, both the first PWM signal and the second PWM signal can be generated by a master clock signal, and the master clock signal needs to be processed by a frequency divider to output a PWM signal corresponding to the signal frequency and duty cycle, and the signal frequency of the PWM signal is lower than the master clock frequency. Therefore, outputting the first PWM signal and the second PWM signal to the sampling device at the same time includes: passing the master clock signal through the frequency divider to generate the first PWM signal and the second PWM signal respectively, and outputting the first PWM signal and the second PWM signal to the sampling device at the same time.

[0061] In a specific embodiment, a method for implementing a PWM signal is to trigger a counter at the rising edge of the main clock signal, generate an output pulse when the counter value reaches the set value, and reset the counter to count again. This pulse is a cycle of the PWM signal. In order to achieve different duty cycles, the counter value can be compared with the parameters of the corresponding duty cycle by a comparator to determine the duration of the high level and low level of the PWM signal.

[0062] According to the above description of the second PWM signal, the process of performing the sampling action when the sampling device is triggered by the edge of the second PWM signal includes:

[0063] The sampling device performs a sampling action when triggered by the ending edge of the second PWM signal, where the ending edge is a rising edge or a falling edge.

[0064] It can be understood that the duty cycle of the second PWM signal corresponds to a pulse, the starting time of the pulse is the starting edge, and the ending time is the ending edge. The starting edge is opposite to the ending edge, which is specifically determined by whether the pulse is a high level or a low level. When the pulse is a high level, the starting edge is a rising edge and the ending edge is a falling edge. When the pulse is a low level, the starting edge is a falling edge and the ending edge is a rising edge.

[0065] Further, in this embodiment, the sampling delay time is an adjustable parameter. The execution subject of this embodiment can directly accept the setting instruction about the sampling delay time and obtain the sampling delay time by internal analysis. The execution subject can also be connected with other terminal devices such as the second terminal device or the first terminal device, and the server, and accept the setting instruction about the sampling delay time of other terminal devices. Therefore, the process of determining the duty cycle of the second PWM signal according to the sampling delay time includes:

[0066] Receive the setting instruction of the corresponding sampling delay time;

[0067] The setting instruction is parsed to obtain the sampling delay time length, and the duty cycle of the second PWM signal is determined according to the sampling delay time length.

[0068] It can be understood that the signal frequency, signal period, and duty cycle of the first PWM signal should be determined quantities, that is, when there is a need for delayed sampling of the first PWM signal, the signal period, signal frequency, and duty cycle of the first PWM signal are all known states. In addition, the starting edge of the first PWM signal can be selected or set; the duty cycle, starting edge, and ending edge of the second PWM signal can all be selected or set: the duty cycle of the second PWM signal is determined by the sampling delay time; the moment of the starting edge of the second PWM signal is consistent with the moment of the starting edge of the first PWM signal, but the starting edge of the second PWM signal can be different from the starting edge of the first PWM signal, for example, the starting edge of the first PWM signal is a rising edge, and the starting edge of the second PWM signal is a falling edge. The starting edge and the ending edge of the second PWM signal should be opposite, and the ending edge is used to trigger the sampling device, so it is necessary to set the starting edge and the ending edge of the second PWM signal according to the trigger setting conditions of the sampling device, or adjust the trigger setting conditions of the sampling device according to the starting edge or the ending edge of the second PWM signal.

[0069] See also Figure 3 In the embodiment shown, the first PWM signal is PWM 1, the starting edge is the rising edge, the signal frequency is 20kHz, and according to the rule that the signal frequency is inversely proportional to the signal period, the signal period can be determined to be 50us, and the expected sampling delay time is 5us. According to the description of the first PWM signal, the second PWM signal is determined to be PWM2, the signal frequency of PWM2 is 20kHz, the starting edge is the rising edge, the starting time of the rising edge is the same as the starting time of the rising edge of PWM1, the pulse width of the second PWM signal PWM2 is the sampling delay time of 5us, the duty cycle of the second PWM signal PWM2 is calculated to be 5us / 50us×100%=10%, and the sampling device is set to be triggered by the falling edge of the second PWM signal. The first PWM signal PWM1 and the second PWM signal PWM2 are output to the sampling device at the same time, so as to achieve the purpose of triggering the sampling device to perform the sampling action 5us after the first PWM signal PWM1 outputs the rising edge.

[0070] Similarly, see Figure 4In the embodiment shown, the first PWM signal is PWM 3, the starting edge is the falling edge, and the signal frequency is 20kHz. According to the rule that the signal frequency is inversely proportional to the signal period, the signal period can be determined to be 50us, and the expected sampling delay time is 10us. According to the description of the first PWM signal, the second PWM signal is determined to be PWM4, the signal frequency of PWM4 is 20kHz, the starting edge is the falling edge, the starting time of the falling edge is the same as the starting time of the falling edge of PWM3, the pulse width of the second PWM signal PWM4 is the sampling delay time of 10us, the duty cycle of the second PWM signal PWM4 is calculated to be 10us / 50us×100%=20%, and the sampling device is set to be triggered by the rising edge of the second PWM signal. The first PWM signal PWM3 and the second PWM signal PWM4 are output to the sampling device at the same time, so as to achieve the purpose of triggering the sampling device to perform the sampling action 10us after the first PWM signal PWM3 outputs the rising edge.

[0071] It is understandable that the sampling device here is usually an ADC module, that is, an analog-to-digital converter, which can convert a continuous analog signal into a discrete digital signal. The delayed sampling method in this embodiment can be widely used in various scenarios to achieve more complex functional applications, such as motor control, electrical sampling, power electronics control, and scenarios where various signals take some time to stabilize.

[0072] All the above optional technical solutions can be combined in any way to form optional embodiments of the present application, and will not be described in detail here. It should be understood that the size of the sequence number of each step in the above embodiment does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.

[0073] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0074] Figure 5 Schematic diagram of a time delay trigger device of a sampling device provided in an embodiment of the present application. Figure 5 As shown, the delayed sampling device comprises:

[0075] A frequency determination module 501, used to obtain the signal frequency of the first PWM signal;

[0076] A signal determination module 502, configured to determine a second PWM signal synchronized with a time base of the first PWM signal according to a signal frequency;

[0077] A duty cycle determination module 503, used to determine the duty cycle of the second PWM signal according to the sampling delay time;

[0078] The signal generating module 504 is used to output the first PWM signal and the second PWM signal to the sampling device simultaneously, so that the sampling device performs a sampling action when triggered by the edge of the second PWM signal.

[0079] The embodiment of the present application sets a second PWM signal that is synchronized with the first PWM signal time base and has a duty cycle corresponding to the sampling delay time, so that the sampling device is triggered by the edge of the second PWM signal to perform the sampling action, thereby achieving the effect of delayed sampling after the edge of the first PWM signal is triggered. In this solution, the sampling device is directly triggered by the second PWM signal generated by hardware, does not involve software interrupts, has a more accurate triggering time, and does not consume the operating resources of the MCU.

[0080] In some specific embodiments, the duty cycle determination module 503 is specifically used to:

[0081] Determine the signal period corresponding to the signal frequency;

[0082] Based on the signal cycle, the ratio of the sampling delay time length to the signal cycle is determined as the duty cycle of the second PWM signal.

[0083] In some specific embodiments, the signal determination module 502 is specifically used to:

[0084] Determine the start time of the first PWM signal;

[0085] According to the start time and the signal frequency, a second PWM signal having the same start time and the same signal frequency as the first PWM signal is determined.

[0086] In some specific embodiments, before the signal determination module 502 determines the second PWM signal with the same start time and signal frequency as the first PWM signal according to the start time and signal frequency, it is further configured to:

[0087] Determine a starting edge of the first PWM signal; the starting edge is a rising edge or a falling edge;

[0088] Correspondingly, the process of determining a second PWM signal having the same start time and the same signal frequency as the first PWM signal according to the start time and the signal frequency includes:

[0089] According to the start time, the start edge and the signal frequency, a second PWM signal having the same start time, the same start edge and the same signal frequency as the first PWM signal is determined.

[0090] In some specific embodiments, the process of performing a sampling action when the sampling device is triggered by an edge of the second PWM signal includes:

[0091] The sampling device performs a sampling action when triggered by the ending edge of the second PWM signal, and the ending edge is a rising edge or a falling edge.

[0092] In some specific embodiments, the signal output module 504 outputs the first PWM signal and the second PWM signal to the sampling device simultaneously, including:

[0093] The main clock signal is passed through a frequency divider to generate a first PWM signal and a second PWM signal respectively, and the first PWM signal and the second PWM signal are simultaneously output to the sampling device.

[0094] In some specific embodiments, the duty cycle determination module 503 is specifically used to:

[0095] Receive the setting instruction of the corresponding sampling delay time;

[0096] The setting instruction is parsed to obtain the sampling delay time length, and the duty cycle of the second PWM signal is determined according to the sampling delay time length.

[0097] Figure 6 Schematic diagram of an electronic device 6 provided in an embodiment of the present application. Figure 6 As shown, the electronic device 6 of this embodiment includes: a processor 601, a memory 602, and a computer program 603 stored in the memory 602 and executable on the processor 601. When the processor 601 executes the computer program 603, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 601 executes the computer program 603, the functions of the modules / units in the above-mentioned device embodiments are implemented.

[0098] The electronic device 6 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 6 may include, but is not limited to, a processor 601 and a memory 602. Those skilled in the art will appreciate that Figure 6 The electronic device 6 is merely an example and does not limit the electronic device 6 . The electronic device 6 may include more or less components than those shown in the figure, or different components.

[0099] The processor 601 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0100] The memory 602 may be an internal storage unit of the electronic device 6, for example, a hard disk or memory of the electronic device 6. The memory 602 may also be an external storage device of the electronic device 6, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 6. The memory 602 may also include both an internal storage unit of the electronic device 6 and an external storage device. The memory 602 is used to store computer programs and other programs and data required by the electronic device.

[0101] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.

[0102] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, and the computer program code may be in source code form, object code form, executable file or some intermediate form. The readable storage medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the readable storage medium does not include electric carrier signals and telecommunication signals.

[0103] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A delayed triggering method for a sampling device, characterized in that: include: Acquire a signal frequency of a first PWM signal; Determine a second PWM signal synchronized with the first PWM signal time base according to the signal frequency; Determining a duty cycle of the second PWM signal according to a sampling delay time; Outputting the first PWM signal and the second PWM signal to a sampling device simultaneously, so that the sampling device performs a sampling action when triggered by an edge of the second PWM signal; The length of the pulse in each signal period corresponding to the duty cycle of the second PWM signal is the sampling delay time length, the pulse in each signal period is from the starting edge to the ending edge of the second PWM signal, the starting edge of the second PWM signal corresponds to the same time as the starting edge of the first PWM signal, and the ending edge of the second PWM signal serves as the triggering edge for triggering the sampling device to perform a sampling action; The process of determining a second PWM signal synchronized with the first PWM signal time base according to the signal frequency includes: Determining a start time of the first PWM signal; A second PWM signal having the same start time and the same signal frequency as the first PWM signal is determined according to the start time and the signal frequency.

2. The method according to claim 1, characterized in that The process of determining the duty cycle of the second PWM signal according to the sampling delay time includes: Determine a signal period corresponding to the signal frequency; Based on the signal period, a ratio of the sampling delay time to the signal period is determined as the duty cycle of the second PWM signal.

3. The method according to claim 1, characterized in that Before determining, according to the start time and the signal frequency, a second PWM signal having the same start time and the same signal frequency as the first PWM signal, the method further includes: Determine a starting edge of the first PWM signal; the starting edge is a rising edge or a falling edge; Correspondingly, the process of determining, according to the start time and the signal frequency, a second PWM signal having the same start time and the same signal frequency as the first PWM signal includes: A second PWM signal having the same start time, the same start edge, and the same signal frequency as the first PWM signal is determined according to the start time, the start edge, and the signal frequency.

4. The method according to claim 1, characterized in that: The process of the sampling device performing a sampling action when being triggered by the edge of the second PWM signal includes: The sampling device performs a sampling action when triggered by the ending edge of the second PWM signal, and the ending edge is a rising edge or a falling edge.

5. The method according to claim 1, characterized in that Outputting the first PWM signal and the second PWM signal to a sampling device simultaneously includes: The main clock signal is passed through a frequency divider to generate the first PWM signal and the second PWM signal respectively, and the first PWM signal and the second PWM signal are simultaneously output to the sampling device.

6. The method according to any one of claims 1 to 5, characterized in that The process of determining the duty cycle of the second PWM signal according to the sampling delay time includes: Receive the setting instruction of the corresponding sampling delay time; The setting instruction is parsed to obtain the sampling delay time length, and the duty cycle of the second PWM signal is determined according to the sampling delay time length.

7. A time-delay trigger device for a sampling device, characterized in that: include: A frequency determination module, used for obtaining the signal frequency of the first PWM signal; a signal determination module, configured to determine, according to the signal frequency, a second PWM signal synchronized with a time base of the first PWM signal; A duty cycle determination module, used to determine the duty cycle of the second PWM signal according to the sampling delay time; A signal generating module, configured to output the first PWM signal and the second PWM signal to a sampling device simultaneously, so that the sampling device performs a sampling action when the sampling device is triggered by an edge of the second PWM signal; The length of the pulse in each signal period corresponding to the duty cycle of the second PWM signal is the sampling delay time length, the pulse in each signal period is from the starting edge to the ending edge of the second PWM signal, the starting edge of the second PWM signal corresponds to the same time as the starting edge of the first PWM signal, and the ending edge of the second PWM signal serves as the triggering edge for triggering the sampling device to perform a sampling action; The signal determination module is specifically used for: Determining a start time of the first PWM signal; A second PWM signal having the same start time and the same signal frequency as the first PWM signal is determined according to the start time and the signal frequency.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.