CN116466638A - Pulse number acquisition equipment and system, pulse signal processing method and device - Google Patents

Pulse number acquisition equipment and system, pulse signal processing method and device Download PDF

Info

Publication number
CN116466638A
CN116466638A CN202310450947.1A CN202310450947A CN116466638A CN 116466638 A CN116466638 A CN 116466638A CN 202310450947 A CN202310450947 A CN 202310450947A CN 116466638 A CN116466638 A CN 116466638A
Authority
CN
China
Prior art keywords
pulse
pulse signal
pulse number
number acquisition
external
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310450947.1A
Other languages
Chinese (zh)
Inventor
李闯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Anting Horizon Intelligent Transportation Technology Co ltd
Original Assignee
Shanghai Anting Horizon Intelligent Transportation Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Anting Horizon Intelligent Transportation Technology Co ltd filed Critical Shanghai Anting Horizon Intelligent Transportation Technology Co ltd
Priority to CN202310450947.1A priority Critical patent/CN116466638A/en
Publication of CN116466638A publication Critical patent/CN116466638A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0423Input/output
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/21Pc I-O input output
    • G05B2219/21137Analog to digital conversion, ADC, DAC

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Manipulation Of Pulses (AREA)

Abstract

The pulse number acquisition equipment comprises a receiving device and a processing device; the receiving device is used for being coupled with external equipment and receiving a first pulse signal generated by the external equipment; the processing device is coupled with the receiving device and is used for counting the first pulse signals to obtain the pulse number of the first pulse signals. In the technical scheme of the disclosure, the time precision of the pulse number acquired by the processing device is higher than that of the pulse signal generated by the external equipment, so that the pulse number of the pulse signal generated by the external equipment can be acquired more accurately.

Description

Pulse number acquisition equipment and system, pulse signal processing method and device
Technical Field
The disclosure relates to the technical field of integrated circuits, and in particular relates to a pulse number acquisition device and system, and a pulse signal processing method and device.
Background
In an industrial control system (e.g., an automotive intelligent control system), fans can be provided to cool other electronic components in the system to improve the life and operating efficiency of the electronic components. If the fan fails, the heat generated on the electronic component will be high, which will affect the life of the electronic component, so it is important to accurately determine whether the fan fails or not.
In general, the number of rotations of a fan may be determined by collecting the number of pulse signals of the fan, and whether the fan malfunctions may be determined according to the number of rotations of the fan.
Disclosure of Invention
In the related art, when the number of pulse signals of the fan is collected through the collection device, the problem of inaccurate collected pulse number exists.
The present disclosure has been made in order to solve the above technical problems. The embodiment of the disclosure provides a pulse number acquisition device and system, and a pulse signal processing method and device, which can accurately acquire the pulse number of a pulse signal generated by external equipment.
According to a first aspect of the present disclosure, there is provided a pulse number acquisition apparatus comprising: receiving means and processing means. The receiving device is used for being coupled with external equipment and receiving a first pulse signal generated by the external equipment. The processing device is coupled with the receiving device and is used for counting the first pulse signals to obtain the pulse number of the first pulse signals; the time precision of the pulse number acquired by the processing device is higher than that of a pulse signal generated by external equipment.
Based on the scheme, the pulse number acquisition equipment is used for acquiring the pulse number of the first pulse signal generated by the external equipment (such as a fan), and because the time precision of the pulse number acquired by the processing device in the pulse number acquisition equipment is higher than that of the pulse signal generated by the external equipment, the pulse number acquisition equipment can accurately acquire the pulse number of the pulse signal generated by the external equipment.
According to a second aspect of the present disclosure, there is provided a pulse signal processing method including: firstly, controlling a pulse number acquisition device to count the pulse number of a first pulse signal generated by an external device; the time precision of the pulse number acquisition equipment for acquiring the pulse signals is higher than that of the external equipment for generating the pulse signals. Then, according to the read instruction, the pulse number of the first pulse signal is read in a register of the pulse number acquisition device.
According to a third aspect of the present disclosure, there is provided a pulse signal processing apparatus comprising: the control module is used for controlling the pulse number acquisition equipment to count the pulse number of the first pulse signal generated by the external equipment; the time precision of the pulse number acquisition equipment for acquiring the pulse signals is higher than that of the external equipment for generating the pulse signals; the reading module is used for reading the pulse number of the first pulse signal in a register of the pulse number acquisition equipment according to the reading instruction.
According to a fourth aspect of the present disclosure, there is provided a pulse number acquisition system comprising: the pulse number acquisition apparatus according to the first aspect described above, and an external apparatus coupled to the pulse number acquisition apparatus.
According to a fifth aspect of the present disclosure, there is provided a computer readable storage medium storing a computer program for performing the method as described above in the second aspect.
According to a sixth aspect of the present disclosure, there is provided an electronic device comprising: a processor; a memory for storing processor-executable instructions; a processor for reading the executable instructions from the memory and executing the instructions to implement the method as described in the second aspect.
Drawings
FIG. 1 is a schematic diagram of a pulse number acquisition system provided by some embodiments of the present disclosure;
FIG. 2 is a schematic diagram of a pulse number acquisition apparatus provided by some embodiments of the present disclosure;
FIG. 3 is a schematic diagram of another pulse number acquisition apparatus provided by some embodiments of the present disclosure;
FIG. 4 is a schematic diagram of yet another pulse number acquisition apparatus provided by some embodiments of the present disclosure;
FIG. 5 is a flow chart of a method of processing a pulse signal provided by some embodiments of the present disclosure;
FIG. 6 is a flow chart of another pulse signal processing method provided by some embodiments of the present disclosure;
FIG. 7 is a flow chart of yet another pulse signal processing method provided by some embodiments of the present disclosure;
FIG. 8 is a schematic diagram of a pulse signal processing apparatus provided by some embodiments of the present disclosure;
fig. 9 is a block diagram of an electronic device provided by some embodiments of the present disclosure.
Detailed Description
For the purpose of illustrating the present disclosure, exemplary embodiments of the present disclosure will be described in detail below with reference to the drawings, it being apparent that the described embodiments are only some, but not all embodiments of the present disclosure, and it is to be understood that the present disclosure is not limited by the exemplary embodiments.
It should be noted that: the relative arrangement of the components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless it is specifically stated otherwise.
Summary of the application
Generally, the intelligent control system includes a large number of electronic components, and the electronic components generate a large amount of heat during operation, and the heat may cause damage to the electronic components or reduce the working efficiency of the electronic components, thereby affecting the performance of the intelligent control system.
Fans are often deployed in intelligent control systems (e.g., intelligent computing platforms) to reduce the amount of heat generated by electronic components in the intelligent computing platform to ensure that the electronic components are not damaged or degraded by excessive temperatures. For example, the fan can take away heat generated around the electronic components by rotating to cause air flow, thereby achieving the cooling effect and ensuring that the service life and the working efficiency of each electronic component are not affected by overhigh temperature. That is, the normal operation of the fan and the fan is important for the normal operation of each electronic component in the intelligent control system, so that it is required to accurately determine whether the fan in the intelligent control system fails.
In some examples, the operation state of the fan may be determined by the number of revolutions of the fan (hereinafter, simply referred to as the number of revolutions of the fan) within a preset period of time to determine whether the fan has failed. For example, when the number of revolutions of the fan is less than a threshold number of revolutions, indicating that the fan may fail, the operating state of the fan may need to be checked to ensure that the life and operating efficiency of the various electronic components in the system are not affected.
Illustratively, there is a proportional relationship between the number of revolutions of the fan and the number of pulses of the pulse signal generated by the fan. Therefore, the number of revolutions of the fan can be determined according to the number of pulses of the pulse signal generated by the fan, and the running state of the fan (such as whether the fan has a fault) can be determined according to the number of revolutions of the fan.
In some examples, the time that the fan generates one pulse signal is very short, i.e., the period of the pulse signal generated by the fan is very short. In the related art, the number of pulses of the pulse signal generated by the fan can be collected by the collection device, however, the collection precision of most collection devices is low, and the number of pulses of the pulse signal generated by the fan cannot be accurately collected. For example, if the collection precision of the collection device is low, when the fan generates a pulse signal, the collection device cannot collect the pulse signal in time, which results in inaccurate pulse number collected by the collection device. Therefore, the number of fan revolutions determined from the number of pulses collected by the collection device may also be inaccurate, resulting in an error in the determined operation state of the fan.
For example, taking a fan rotating 3000 revolutions in 1 second, a fan rotating 1 revolution may generate 4 pulse signals, and the period of the fan generating one pulse signal may be approximately 80 microseconds (μs). In the related art, the acquisition device is usually a timer/counter, and the acquisition accuracy of most timers/counters can only reach the millisecond level, but cannot reach the microsecond level. Therefore, the timer/counter cannot accurately collect the pulse number of the pulse signal generated by the fan. It should be noted that, the period of the pulse signal generated by the fan is not limited in this disclosure, for example, the period of the pulse signal generated by the fan may be less than 80 microseconds (μs).
In some examples, to improve the accuracy of the number of pulses acquired, the number of pulses may be acquired by adding additional hardware components. For example, the pulse number of the pulse signal generated by the fan can be acquired by adding a micro control unit (MicroController Unit, MCU) in combination with a timer/counter. Alternatively, two electronic components (e.g., two MCUs) may be used to collect the number of pulses of the pulse signal generated by the fan.
For example, a timer/counter and an external interrupt component (e.g., an analog comparator) may be used to collect the number of pulses of the fan-generated pulse signal. The timer/counter is used for timing, and the external interrupt component detects the rising edge or the falling edge of the pulse signal according to an interrupt triggering mode. When the interrupt triggering mode of the external interrupt component is falling edge triggering, if the level input by the external interrupt component is detected to be changed from high level to low level, the interrupt is triggered, and the timer/counter counts the pulse number.
However, the manner of collecting the number of pulses by using the timer/counter and the external interrupt unit requires additional hardware equipment, resulting in higher cost of the collecting equipment.
In order to solve the problems of inaccurate pulse number acquisition and high acquisition cost in the related art, the embodiment of the disclosure provides a pulse number acquisition device, which can accurately acquire the pulse number of a pulse signal generated by external equipment, does not need to additionally increase hardware equipment, and can reduce the pulse acquisition cost.
Exemplary System
Fig. 1 is a pulse number acquisition system according to an embodiment of the present disclosure, and as shown in fig. 1, the pulse number acquisition system 1 includes a pulse number acquisition device 10 and an external device 20. An external device 20 is coupled to the pulse acquisition apparatus 10.
In some embodiments, the external device 20 is used to generate a pulsed signal. The external device 20 includes a fan 21. It should be noted that, the external device 20 may further include other devices that may generate a pulse signal, which is not limited in this disclosure, and the embodiment of the disclosure is schematically illustrated by taking the external device 20 as the fan 21.
In some examples, M pulse signals may be generated per revolution of the fan 21, where M is an integer greater than 1. The embodiment of the present disclosure is not limited to the number of pulse signals generated by one rotation of the fan 21, and the number of pulse signals generated by one rotation of the fan 21 is related to the model of the fan 21.
The number of pulse signals generated by one rotation of the fan 21 may be 2, 4, or 8, which is not limited by the present disclosure, and the following embodiments will be exemplified by taking the number of pulse signals generated by one rotation of the fan 21 as 4.
The pulse number acquisition device 10 is used for acquiring the pulse number of a pulse signal generated by the external device 20. The time precision of the pulse number acquisition device 10 for acquiring the pulse number is higher than that of the pulse signal generated by the external device 20, so that the pulse number acquisition device 10 can acquire the pulse number of the pulse signal generated by the external device 20 more accurately.
For example, taking the period of the fan 21 generating one pulse signal as 10 microseconds as an example, the time precision of the pulse number acquisition device 10 for acquiring the pulse signal is higher than 10 microseconds, for example, the time precision of the pulse number acquisition device 10 for acquiring the pulse signal may be 1 microsecond, 0.1 microsecond, etc. Therefore, when the fan 21 generates one pulse signal, the pulse number acquisition apparatus 10 can accurately count the pulse signal generated by the fan 21.
Fig. 2 is a schematic diagram of a pulse number acquisition apparatus according to some embodiments of the present disclosure, and as shown in fig. 2, the pulse number acquisition apparatus 10 includes a receiving device 11 and a processing device 12.
In some embodiments, the receiving means 11 may be an external clock port of the pulse number acquisition device 10, the pulse number acquisition device 10 is coupled to the external device 20 through the receiving means 11, and the pulse number acquisition device 10 receives the first pulse signal generated by the external device 20 through the receiving means 11.
The processing device 12 is coupled to the receiving device 11, and the processing device 12 is configured to count the first pulse signal received by the receiving device 11 to obtain the pulse number of the first pulse signal.
For example, the processing device 12 may collect the number of pulses of the first pulse signal generated by the external device 20 (such as the fan 21) within the preset collection period. Based on the number of pulses acquired by the processing device 12 during the preset acquisition period, it is possible to determine whether the external apparatus 20 has failed. The embodiment of the disclosure does not limit the size of the preset acquisition time, and the preset acquisition time can be set as required in practical application.
Illustratively, the processing device 12 in the pulse number acquisition apparatus 10 acquires the pulse number with a higher time accuracy than the time accuracy of the pulse signal generated by the external apparatus 20, so that the processing device 12 can count the pulse signal generated by the external apparatus 20 more accurately.
In some embodiments, the pulse number acquisition device 10 includes a general purpose timer (General Purpose Timer, GPT).
The GPT timer has a higher acquisition precision, which can reach microsecond level or even be higher than microsecond level (e.g. 0.1 microsecond), that is, the acquisition precision of the GPT timer is greater than the time precision of the pulse signal generated by the fan 21, so that the GPT timer can accurately acquire the pulse number of the pulse signal generated by the fan 21. Moreover, the GPT timer can collect the pulse number of the pulse signal generated by the fan 21 in the external clock mode, and can realize a timing or delay function in other clock modes (e.g., crystal oscillator clock mode, peripheral clock mode, low frequency clock mode, and high frequency clock mode). That is, the GPT timer has different functions in different clock modes, and the pulse number acquisition device 10 provided in the embodiment of the present disclosure may multiplex the counting function of the GPT timer, so as to realize the acquisition of the pulse number of the pulse signal generated by the fan 21, so that the acquired pulse number is accurate, and no additional hardware device is required to be added, so that the acquisition cost can be saved.
In some examples, the GPT timer may be a device in a chip, e.g., the GPT timer may be a timer in an IMX8 family of chips (e.g., IMX8 MM).
Illustratively, the GPT timer has a clock source selection function, i.e., the GPT timer may select one clock signal from a plurality of clock signals as a clock source. Therefore, when the first pulse signal generated by the external device 20 serves as a clock source of the GPT timer, the GPT timer can count the first pulse signal.
Fig. 3 is a schematic diagram of another pulse number acquisition apparatus according to some embodiments of the present disclosure, and as shown in fig. 3, the receiving device 11 may include a first selector 31 and a second selector 32.
As shown in fig. 3, the pulse number acquisition device 10 may select one clock signal from the first clock signal 301, the second clock signal 302, the third clock signal 303, the fourth clock signal 304, and the fifth clock signal 305 as a clock source of the pulse number acquisition device 10 (e.g., a GPT timer).
For example, the processing device 12 may select one clock signal output from the first clock signal 301 and the second clock signal 302 through the first selector 31. Then, one clock signal is selected as a clock source of the pulse number acquisition device 10 from the clock signal (such as the first clock signal 301 or the second clock signal 302) output by the first selector 31, and the third clock signal 303, the fourth clock signal 304, and the fifth clock signal 305 through the second selector 32.
For example, the first clock signal 301 may be a crystal oscillator clock signal generated by a crystal oscillator, such as a 24M crystal oscillator clock signal (which may be denoted as ipg _clk_24M), which is in crystal oscillator clock mode when the GPT selects the crystal oscillator clock signal as the clock source of the GPT timer. The second clock signal 302 may be an external clock signal (may be denoted as gpt_clk), which may be, for example, a first pulse signal generated by the external device 20, which is in the external clock mode when the GPT selects the external clock signal as the clock source of the GPT timer. The third clock signal 303 may be a peripheral clock signal (which may be denoted as ipg _clk) which is in the peripheral clock mode when the GPT selects the peripheral clock signal as the clock source for the GPT timer. The fourth clock signal 304 may be a low frequency reference clock (which may be denoted as ipg _clk_32k) that is in a low frequency clock mode when the GPT selects the low frequency reference clock as the clock source for the GPT timer. The fifth clock signal 305 may be a high frequency reference clock (which may be denoted as ipg _clk_highfreq) that is in the high frequency clock mode when the GPT selects the high frequency reference clock as the clock source for the GPT timer.
In some examples, when the clock sources selected by the pulse number acquisition device 10 are different, the pulse number acquisition device 10 (e.g., a GPT timer) may be in different clock modes to implement different functions.
Illustratively, when the second clock signal 302 is the first pulse signal generated by the fan 21, the clock mode of the pulse number acquisition device 10 may be set to the external clock mode to cause the pulse number acquisition device 10 to count the first pulse signal generated by the fan 21.
In some examples, processing device 12 may detect a rising or falling edge of the first pulse signal as it is counted. For example, if the trigger mode is a rising edge trigger, when the processing device 12 detects that the level of the first pulse signal changes from low to high, the processing device 12 counts the first pulse signal. For another example, if the trigger mode is set to the falling edge trigger, when the processing device 12 detects that the level of the first pulse signal changes from the high level to the low level, the processing device 12 counts the first pulse signal.
Fig. 4 is a schematic diagram of still another pulse number acquisition apparatus according to an embodiment of the present disclosure, as shown in fig. 4, the processing device 12 includes: a signal generator 121 and an acquisition module 122. The signal generator 121 is coupled to the acquisition module 122, the acquisition module 122 is coupled to the receiving device 11, and the acquisition module 122 is configured to acquire the number of pulses of the first pulse signal received by the receiving device 11.
In some embodiments, the signal generator 121 is configured to generate a second pulse signal. The acquisition module 122 is configured to compare the first pulse signal received by the receiving device 11 with the second pulse signal generated by the signal generator 121, so as to obtain the pulse number of the first pulse signal.
In some examples, the period of the second pulse signal is shorter, and by comparing the second pulse signal with the first pulse signal, the number of pulses of the first pulse signal can be counted more accurately. The comparison principle of the second pulse signal and the first pulse signal is not limited in the embodiments of the present disclosure, and the counting principle of the first pulse signal realized by comparing the second pulse signal and the first pulse signal is related to the counting principle of the GPT timer, which is not described herein.
For example, the acquisition module 122 can detect a rising edge or a falling edge of the first pulse signal by comparing the second pulse signal with the first pulse signal, and then acquire the pulse number of the first pulse signal according to the rising edge or the falling edge of the first pulse signal.
In some embodiments, as shown in fig. 4, the pulse number acquisition device 10 further includes a register 13, the register 13 being couplable to the acquisition module 122. The register 13 is used for storing the pulse number of the first pulse signal acquired by the acquisition module 122.
Illustratively, the operating modes of the GPT timer include a free run mode (free run mode) and a restart mode (restart mode). In the restarting mode, when the count value of the GPT timer reaches a preset value (e.g., a value preset by a user), the count value of the GPT counter is automatically cleared. In the free running mode, the GPT timer may count up until the count value of the GPT timer reaches a maximum value, and the count value of the GPT counter may not be cleared.
In order to accurately obtain the number of pulses of the first pulse signal generated by the fan 21, the operation mode of the GPT timer may be set to a free running mode in which the GPT timer counts up the number of pulses of the first pulse signal generated by the fan 21. When the GPT timer is required to be recounted, the count value of the GPT timer may be cleared by a clear instruction, and recommence of counting.
The pulse number acquisition device 10 provided in the embodiment of the present disclosure may acquire the pulse number of the first pulse signal generated by the external device 20 (such as the fan 21), and since the time precision of the pulse number acquired by the processing apparatus 122 in the pulse number acquisition device 10 is higher than the time precision of the pulse signal generated by the external device 10, the pulse number acquisition device 10 can accurately acquire the pulse number of the first pulse signal generated by the external device 20, so as to accurately determine the operation state of the external device 20 (such as whether the external device 20 fails), and ensure the service life and the working efficiency of each electronic component in the industrial control system. Meanwhile, when the pulse number acquisition device 10 provided in the embodiment of the present disclosure acquires the pulse number of the first pulse signal generated by the external device 20, no additional hardware device is required, so that the cost of pulse number acquisition can be reduced.
Exemplary method
Fig. 5 is a schematic diagram of a pulse signal processing method according to some embodiments of the present disclosure, where the pulse signal processing method may be applied to the pulse number acquisition system 1 in the foregoing embodiments, and the pulse number acquisition system 1 may further include a pulse signal processing device, and the pulse signal processing device may be a central processing unit (Central Processing Unit, CPU). As shown in fig. 5, the pulse signal processing method may be performed by a pulse signal processing apparatus, and the method includes the steps of:
in step 501, the control pulse number acquisition device 10 counts the number of pulses of the first pulse signal generated by the external device 20.
Illustratively, the time accuracy of the pulse number acquisition device 10 to acquire the pulse signal is higher than the time accuracy of the external device 20 to generate the pulse signal. The specific structure of the pulse number acquisition apparatus 10 can refer to the foregoing embodiment, and will not be described herein.
In some embodiments, the pulse signal processing apparatus controls the pulse number acquisition device 10 to count the number of pulses of the first pulse signal generated by the external device 20, including: first, the pulse signal processing apparatus controls the pulse number acquisition device 10 to start up, and configures the operation mode of the pulse number acquisition device 10 to the accumulation count mode. Then, the pulse signal processing apparatus controls the pulse number acquisition device 10 to receive the first pulse signal generated by the external device 20 so that the pulse number acquisition device 10 acquires the pulse number of the first pulse signal.
In some embodiments, the pulse number acquisition device 10 includes a GPT timer. When the pulse number acquisition apparatus 10 is a GPT timer, the operation mode of the pulse number acquisition apparatus 10 is configured to be an accumulation count mode, including: the operation mode of the GPT timer is configured to a free run mode (free run mode) such that the GPT timer counts up the number of pulses of the first pulse signal generated by the external device 20.
In some examples, when the operation mode of the GPT timer is the free-running mode, the GPT timer counts the number of pulses of the first pulse signal in an accumulated count. For example, the GPT timer may count up from 0X00000000 until the count value is 0xfffffff, and the GPT timer clears the count value and restarts counting.
Illustratively, the pulse signal processing apparatus controls the pulse number acquisition device 10 to count the number of pulses of the first pulse signal generated by the external device 20, and further includes: the pulse signal processing means controls the clock mode of the pulse number acquisition device 10 to an external clock mode. When the pulse signal processing apparatus changes the clock mode of the pulse number acquisition device 10 to the external clock mode, the pulse number acquisition device 10 may receive the first pulse signal generated by the external device 20 and count the number of pulses of the first pulse signal.
In some examples, the register 13 in the pulse number acquisition device 10 is used to store the pulse number of the first pulse signal acquired by the acquisition module 122.
Step 502, according to the read instruction, the pulse number of the first pulse signal is read in the register 13 of the pulse number acquisition device 10.
In some examples, when the number of pulses needs to be read, the upper application may call a read instruction in the kernel to read the number of pulses of the first pulse signal and return the number of pulses of the first pulse signal to the upper application.
For example, the kernel may provide API functions such as gpt_read to be invoked by an upper layer application, which returns the count value of the GPT timer when the upper layer application invokes the gpt_read function.
The above-mentioned reading instruction may be triggered by a user, or may be triggered automatically. For example, the count value of the GPT timer may be read every preset acquisition duration. For another example, the user may trigger a read instruction to read the number of pulses of the first pulse signal from the register 13 according to the need.
According to the pulse signal processing method provided by the embodiment of the disclosure, the pulse number acquisition device 10 is controlled by the pulse signal processing device to acquire the pulse number of the first pulse signal generated by the external device 20 (such as the fan 21), and because the time precision of the pulse number acquired by the processing device 122 in the pulse number acquisition device 10 is higher than the time precision of the pulse signal generated by the external device 10, the acquired pulse number of the first pulse signal is more accurate.
Referring to fig. 5, as shown in fig. 6, another pulse signal processing method provided in some embodiments of the present disclosure may further include the following steps in addition to the steps 501 to 502 shown in fig. 5:
in step 601, the number of revolutions of the external device 20 is determined according to the number of pulses of the first pulse signal.
Since there is a proportional relationship between the number of pulses of the first pulse signal generated by the external device 20 (e.g., the fan 21) and the number of revolutions of the external device 20, after the number of pulses of the first pulse signal generated by the external device 20 is collected by the pulse number collection device 10, the number of revolutions of the external device 20 can be determined according to the number of pulses of the first pulse signal and the proportional relationship.
Taking the example that the fan 21 generates 4 pulse signals in one rotation, the above ratio is 1:4, and the number of rotations of the fan 21 can be determined according to the number of pulses read in step 502 and the ratio. For example, the number of pulses read in step 502 is divided by 4 to obtain the number of revolutions of the fan 21.
In some examples, after determining the number of revolutions of the external device 20 according to the proportional relationship and the number of pulses, it may be determined whether the operation state of the external device 20 is malfunctioning according to the acquisition duration of the number of pulses and the number of revolutions of the external device 20. For example, when the number of revolutions of the external device 20 in the collection period is smaller than a preset threshold number of revolutions, it may be determined that the external device 20 is malfunctioning.
In some examples, an alarm system may be linked to alert a user when an external device 20 fails. For example, when it is determined that the number of rotations of the fan 21 within the collection period is less than the preset threshold number of rotations, an alarm message may be issued to prompt the user that the fan 21 is malfunctioning.
Because the pulse number of the first pulse signal acquired by the pulse number acquisition device 10 in the embodiment of the present disclosure is more accurate, the number of revolutions of the external device 20 determined according to the pulse number of the first pulse signal is also more accurate, so that the operation state of the external device 20 can be accurately determined by the pulse signal processing method provided by the embodiment of the present disclosure, so as to ensure the working efficiency and the service life of each electronic component in the industrial control system.
Referring to fig. 5, as shown in fig. 7, another pulse signal processing method provided in some embodiments of the present disclosure may further include the following steps in addition to the steps 501 to 502 shown in fig. 5:
in step 701, the pulse number of the first pulse signal stored in the register 13 is cleared according to the clear command.
In some examples, when the count value of the GPT timer needs to be cleared, the upper layer application may call a clear instruction in the kernel to clear the pulse number of the first pulse signal stored in the register 13.
For example, the kernel may provide API functions such as gpt_write to be invoked by an upper application, and when the upper application invokes the gpt_write function, the number of pulses stored in register 13 is cleared.
In some examples, the clear instruction may be triggered after the number of pulses is read, may be triggered when the GPT timer is required to re-count, and may also be triggered by a user.
According to the embodiment of the disclosure, by the clearing instruction, the pulse number of the first pulse signal stored in the register 13 in the pulse number acquisition device 10 can be cleared, so that the pulse number acquisition device 10 can re-acquire the pulse number of the pulse signal generated by the external device 10 in the next preset acquisition time period, and the register 13 stores the re-acquired pulse number.
Exemplary apparatus
Fig. 8 is a pulse signal processing apparatus according to an embodiment of the present disclosure, and as shown in fig. 8, a pulse signal processing apparatus 80 includes a control module 81 and a reading module 82.
A control module 81, configured to control the pulse number acquisition device to count the number of pulses of the first pulse signal generated by the external device; the time precision of the pulse number acquisition equipment for acquiring the pulse signals is higher than that of the external equipment for generating the pulse signals. The reading module 82 is configured to read the pulse number of the first pulse signal in a register of the pulse number acquisition device according to the reading instruction.
In some embodiments, the control module 81 is specifically configured to control the start of the pulse number acquisition device, and configure the operation mode of the pulse number acquisition device to be an accumulation counting mode; the pulse number acquisition device is controlled to receive a first pulse signal generated by an external device.
In some embodiments, the pulse number acquisition device comprises a general purpose timer GPT, and the accumulated count mode comprises a free running mode.
In some embodiments, the pulse signal processing apparatus 80 further includes a determining module for determining the number of revolutions of the external device according to the number of pulses of the first pulse signal.
In some embodiments, the pulse signal processing apparatus 80 further includes a zero module for zero-resetting the pulse number of the first pulse signal stored in the register according to the zero-resetting instruction.
Exemplary electronic device
Fig. 9 is a block diagram of an electronic device according to an embodiment of the disclosure, and as shown in fig. 9, the electronic device 90 includes one or more processors 91 and a memory 92.
Processor 91 may be a Central Processing Unit (CPU) or other form of processing unit having data processing and/or instruction execution capabilities, and may control other components in electronic device 90 to perform desired functions.
Memory 92 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, random access memory (Random Access Memory, RAM) and/or cache memory (cache), etc. The nonvolatile Memory may include, for example, read-Only Memory (ROM), hard disk, flash Memory, and the like. One or more computer program instructions may be stored on the computer readable storage medium that can be executed by the processor 91 to implement the pulse signal processing methods and/or other desired functions of the various embodiments of the present disclosure described above.
In one example, the electronic device 90 may further include: an input device 93 and an output device 94, which are interconnected by a bus system and/or other form of connection mechanism (not shown).
Of course, only some of the components of the electronic device 90 that are relevant to the present disclosure are shown in fig. 9 for simplicity, components such as buses, input/output interfaces, etc. are omitted. In addition, the electronic device 90 may include any other suitable components depending on the particular application.
In addition, the input device 93 may also include, for example, a keyboard, a mouse, and the like.
The output device 94 may output various information to the outside, including the determined distance information, direction information, and the like. The output devices 94 may include, for example, a display, speakers, a printer, and a communication network and remote output devices connected thereto, etc.
Of course, only some of the components of the electronic device 90 that are relevant to the present disclosure are shown in fig. 9 for simplicity, components such as buses, input/output interfaces, etc. are omitted. In addition, the electronic device 90 may include any other suitable components depending on the particular application.
Exemplary computer program product and computer readable storage Medium
In addition to the methods and apparatus described above, embodiments of the present disclosure may also be a computer program product comprising computer program instructions which, when executed by a processor, cause the processor to perform steps in a pulse signal processing method according to various embodiments of the present disclosure described in the above "exemplary methods" section of this specification.
The computer program product may write program code for performing the operations of embodiments of the present disclosure in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server.
Furthermore, embodiments of the present disclosure may also be a computer-readable storage medium, having stored thereon computer program instructions, which when executed by a processor, cause the processor to perform steps in a pulse signal processing method according to various embodiments of the present disclosure described in the above "exemplary method" section of the present disclosure.
A computer readable storage medium may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may include, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The basic principles of the present disclosure have been described above in connection with specific embodiments, however, it should be noted that the advantages, benefits, effects, etc. mentioned in the present disclosure are merely examples and not limiting, and these advantages, benefits, effects, etc. are not to be considered as necessarily possessed by the various embodiments of the present disclosure. Furthermore, the specific details disclosed herein are for purposes of illustration and understanding only, and are not intended to be limiting, since the disclosure is not necessarily limited to practice with the specific details described.
Various modifications and alterations to this disclosure may be made by those skilled in the art without departing from the spirit and scope of this application. Thus, the present disclosure is intended to include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (13)

1. A pulse number acquisition apparatus comprising:
receiving means for coupling with an external device and receiving a first pulse signal generated by the external device;
the processing device is coupled with the receiving device and is used for counting the first pulse signals to obtain the pulse number of the first pulse signals; the time precision of the pulse number acquired by the processing device is higher than that of the pulse signal generated by the external equipment.
2. The pulse number acquisition apparatus according to claim 1, wherein the processing means includes:
a signal generator for generating a second pulse signal;
and the acquisition module is coupled with the signal generator and is used for comparing the first pulse signal with the second pulse signal to obtain the pulse number of the first pulse signal.
3. The pulse number acquisition apparatus according to claim 2, further comprising: a register coupled to the acquisition module;
the register is used for storing the pulse number of the first pulse signal.
4. A pulse number acquisition device according to any one of claims 1-3, wherein the pulse number acquisition device comprises a general timer GPT.
5. A pulse signal processing method, comprising:
controlling the pulse number acquisition equipment to count the pulse number of a first pulse signal generated by the external equipment; the time precision of the pulse number acquisition equipment for acquiring the pulse signals is higher than that of the external equipment for generating the pulse signals;
and reading the pulse number of the first pulse signal in a register of the pulse number acquisition device according to the reading instruction.
6. The pulse signal processing method according to claim 5, wherein the control pulse number acquisition device counts the number of pulses of the first pulse signal generated by the external device, comprising:
controlling the pulse number acquisition equipment to start, and configuring the working mode of the pulse number acquisition equipment into an accumulated counting mode;
and controlling the pulse number acquisition equipment to receive the first pulse signal generated by the external equipment.
7. The pulse signal processing method according to claim 6, wherein the pulse number acquisition device includes a general timer GPT, and the accumulation count mode includes a free-running mode.
8. The pulse signal processing method according to any one of claims 5 to 7, further comprising:
and determining the revolution number of the external equipment according to the pulse number of the first pulse signal.
9. The pulse signal processing method according to any one of claims 5 to 7, further comprising:
and according to a clear instruction, clearing the pulse number of the first pulse signal stored in the register.
10. A pulse signal processing apparatus comprising:
the control module is used for controlling the pulse number acquisition equipment to count the pulse number of the first pulse signal generated by the external equipment; the time precision of the pulse number acquisition equipment for acquiring the pulse signals is higher than that of the external equipment for generating the pulse signals;
and the reading module is used for reading the pulse number of the first pulse signal in a register of the pulse number acquisition equipment according to the reading instruction.
11. A pulse number acquisition system comprising: a pulse number acquisition device as claimed in any one of claims 1-4 and the external device, the external device being coupled with the pulse number acquisition device.
12. A computer-readable storage medium storing a computer program for executing the pulse signal processing method according to any one of the preceding claims 5-9.
13. An electronic device, the electronic device comprising:
a processor;
a memory for storing the processor-executable instructions;
the processor is configured to read the executable instructions from the memory and execute the instructions to implement the pulse signal processing method according to any one of the preceding claims 5-9.
CN202310450947.1A 2023-04-24 2023-04-24 Pulse number acquisition equipment and system, pulse signal processing method and device Pending CN116466638A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310450947.1A CN116466638A (en) 2023-04-24 2023-04-24 Pulse number acquisition equipment and system, pulse signal processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310450947.1A CN116466638A (en) 2023-04-24 2023-04-24 Pulse number acquisition equipment and system, pulse signal processing method and device

Publications (1)

Publication Number Publication Date
CN116466638A true CN116466638A (en) 2023-07-21

Family

ID=87173250

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310450947.1A Pending CN116466638A (en) 2023-04-24 2023-04-24 Pulse number acquisition equipment and system, pulse signal processing method and device

Country Status (1)

Country Link
CN (1) CN116466638A (en)

Similar Documents

Publication Publication Date Title
EP3660681B1 (en) Memory fault detection method and device, and server
US9081676B2 (en) Operating computer memory
CN106527249B (en) Timer for peripheral watchdog
US20090102514A1 (en) Duty cycle detecting circuit for pulse width modulation
US8677182B2 (en) Computer system capable of generating an internal error reset signal according to a catastrophic error signal
US10789148B2 (en) Electronic device and method for event logging
US8185772B2 (en) Determining execution times of commands
US8762792B2 (en) Event monitor having switch matrix, separate counter, and compare circuitry
CN114489801A (en) Method, system and medium for measuring interrupt duration of embedded system with high precision
US7278063B2 (en) Method and system for performing a hardware trace
CN116466638A (en) Pulse number acquisition equipment and system, pulse signal processing method and device
CN112947841A (en) Method, device, equipment and storage medium for reading embedded flash memory data
CN107179911B (en) Method and equipment for restarting management engine
TWI802951B (en) Method, computer system and computer program product for storing state data of finite state machine
US11762033B2 (en) Power failure monitoring device and power failure monitoring method
JPH11259340A (en) Reactivation control circuit for computer
US20190086451A1 (en) Method and system for measuring power-on reset time
US9515907B2 (en) Monitoring method of monitoring module
US7475237B2 (en) Timer with periodic channel service
CN116431377B (en) Watchdog circuit
US20220414269A1 (en) Microcontroller, protection circuit, and protection method capable of avoiding interference from sudden events
JPS6051141B2 (en) Program runaway detection method
CN115328267A (en) Dynamic clock adjusting method and device based on-chip clock comparison
KR20230089448A (en) Method for determining reset cause of embedded controller for vehicle and embedded controller for vehicle to which the method is applied
CN118033391A (en) Method, device and equipment for monitoring clock network in integrated circuit

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination