CN116122975A - Rotation speed acquisition method, rotation speed acquisition device, rotation speed acquisition equipment and storage medium based on single chip microcomputer - Google Patents
Rotation speed acquisition method, rotation speed acquisition device, rotation speed acquisition equipment and storage medium based on single chip microcomputer Download PDFInfo
- Publication number
- CN116122975A CN116122975A CN202211708285.5A CN202211708285A CN116122975A CN 116122975 A CN116122975 A CN 116122975A CN 202211708285 A CN202211708285 A CN 202211708285A CN 116122975 A CN116122975 A CN 116122975A
- Authority
- CN
- China
- Prior art keywords
- time
- tooth
- rotational speed
- interface function
- moment
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 32
- 230000001133 acceleration Effects 0.000 claims abstract description 51
- 230000008859 change Effects 0.000 claims abstract description 43
- 238000004590 computer program Methods 0.000 claims description 7
- 238000004364 calculation method Methods 0.000 claims description 6
- 230000006870 function Effects 0.000 description 55
- 238000004891 communication Methods 0.000 description 9
- 239000000243 solution Substances 0.000 description 6
- 238000012545 processing Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 230000005674 electromagnetic induction Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000001960 triggered effect Effects 0.000 description 3
- 230000009471 action Effects 0.000 description 2
- 230000008878 coupling Effects 0.000 description 2
- 238000010168 coupling process Methods 0.000 description 2
- 238000005859 coupling reaction Methods 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000000630 rising effect Effects 0.000 description 2
- 230000005355 Hall effect Effects 0.000 description 1
- 230000006978 adaptation Effects 0.000 description 1
- 238000011217 control strategy Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006698 induction Effects 0.000 description 1
- 238000002347 injection Methods 0.000 description 1
- 239000007924 injection Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01P—MEASURING LINEAR OR ANGULAR SPEED, ACCELERATION, DECELERATION, OR SHOCK; INDICATING PRESENCE, ABSENCE, OR DIRECTION, OF MOVEMENT
- G01P3/00—Measuring linear or angular speed; Measuring differences of linear or angular speeds
-
- F—MECHANICAL ENGINEERING; LIGHTING; HEATING; WEAPONS; BLASTING
- F02—COMBUSTION ENGINES; HOT-GAS OR COMBUSTION-PRODUCT ENGINE PLANTS
- F02D—CONTROLLING COMBUSTION ENGINES
- F02D41/00—Electrical control of supply of combustible mixture or its constituents
- F02D41/0097—Electrical control of supply of combustible mixture or its constituents using means for generating speed signals
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Chemical & Material Sciences (AREA)
- Combustion & Propulsion (AREA)
- Mechanical Engineering (AREA)
- General Engineering & Computer Science (AREA)
- Control Of Electric Motors In General (AREA)
Abstract
The application discloses a rotational speed acquisition method, device, equipment and storage medium based on a singlechip, wherein the rotational speed acquisition method comprises the following steps: collecting tooth signals and transmitting the tooth signals to a destination address in a DMA mode; acquiring the time difference between the interface function call time and the latest tooth signal at the destination address updating time; calculating at least two times of tooth signal rotating speed change information closest to the calling moment in the destination address; and determining the rotating speed value of the interface function call moment based on the rotating speed change information and the time difference, and obtaining the rotating speed value of any moment in the tooth period after calculating the acceleration in the current tooth period, so that the rotating speed value of the current moment (interface function call moment) can be calculated based on the acceleration after obtaining the time difference. The problem of a platform which occurs when the rotating speed is low and the period is large is avoided, and the rotating speed value between two teeth can be obtained in time, so that a gear shifting point is found.
Description
Technical Field
The invention relates to the field of engines, in particular to a rotating speed acquisition method, device, equipment and storage medium based on a single chip microcomputer.
Background
In the prior art, the rotation speed acquisition is mainly performed in a polling mode, namely, the current PWM signal is acquired in a fixed period scheduling, and the rotation speed is calculated. Another way of using interrupts is to generate an interrupt once per tooth, read the rotational speed value in the interrupt, and calculate the rotational speed. In the prior art, a polling mode is adopted, the latest rotating speed value cannot be obtained in time, especially when the rotating speed is low and the period is long, the rotating speed of the last tooth can be kept for a long time by adopting the polling mode, so that the problem of a platform is caused, and in addition, the problem that a gear shifting point cannot be found due to a large blank period caused by the change of the rotating speed from one tooth to the next tooth due to the long period is caused. The interruption mode can cause load increase and operation efficiency becomes low.
Therefore, how to collect the rotation speed efficiently and timely is a technical problem to be solved.
Disclosure of Invention
The application provides a rotating speed acquisition method, device, equipment and storage medium based on a singlechip, which at least solve the technical problem of how to acquire rotating speed efficiently and timely in the related technology.
According to an aspect of the embodiments of the present application, there is provided a rotation speed collection method based on a single chip microcomputer, including: collecting tooth signals and transmitting the tooth signals to a destination address in a DMA mode; acquiring the time difference between the interface function call time and the latest tooth signal at the destination address updating time; calculating at least two times of tooth signal rotating speed change information closest to the calling moment in the destination address; and determining the rotation speed value of the interface function call moment based on the rotation speed change information and the time difference.
Optionally, the obtaining the time difference between the interface function call time and the latest tooth signal at the destination address updating time includes: recording the updating time of each tooth signal at the destination address by using a counting register of a timer, wherein the updating time is the tooth period starting time of the tooth signal; recording a calling time when the interface function is called; and calculating the time interval between the calling time and the updating time of the tooth signal at the calling time as the time difference.
Optionally, the obtaining the time difference between the interface function call time and the latest tooth signal at the destination address updating time includes: recording a calling time when the interface function is called; when each tooth signal is transmitted to the destination address, entering interruption, and recording each interruption moment, wherein the interruption moment is the tooth period starting moment of the tooth signal; and calculating the time interval of the calling time and the interruption time corresponding to the tooth signal at the calling time as the time difference.
Optionally, the calculating the information of at least two tooth signal rotation speed changes closest to the calling time in the destination address includes: sequentially storing at least two tooth signals in the destination address according to time sequence; acquiring at least two tooth signals closest to the calling moment in the destination address; respectively calculating a rotating speed value corresponding to each tooth signal; and calculating a first rotational speed acceleration based on the rotational speed value as the rotational speed change information.
Optionally, the determining the rotation speed value of the interface function call time based on the rotation speed change information and the time difference includes: acquiring the latest rotating speed value corresponding to the tooth signal at the calling moment; and calculating the rotation speed value of the interface function call moment based on the latest rotation speed value, the first rotation speed acceleration and the time difference.
Optionally, the determining the rotation speed value of the interface function call time based on the rotation speed change information and the time difference further includes: calculating a plurality of first rotational speeds, wherein each first rotational speed is a first rotational speed between at least two tooth signals; determining the rotational speed acceleration variation trend based on a plurality of the first rotational speed accelerations; and predicting the rotating speed value of the interface function call moment in the future based on the acceleration change trend.
Optionally, the predicting the rotation speed value of the interface function call time in the future based on the acceleration change trend includes: acquiring the interface function calling period; determining a second rotational speed acceleration of the interface function call moment to be predicted based on the call period and the acceleration change trend; and calculating the rotational speed value of the interface function call moment to be predicted based on the rotational speed value of the call moment or the rotational speed value corresponding to the tooth signal at the call moment and the second rotational speed acceleration of the interface function call moment to be predicted.
In another aspect of the present application, a rotation speed acquisition device based on a single chip microcomputer is provided, including: the acquisition unit is used for acquiring tooth signals and transmitting the tooth signals to a destination address in a DMA mode; a first obtaining unit, configured to obtain a time difference between an interface function call time and a latest tooth signal at the destination address update time; the first calculation unit is used for calculating at least two times of tooth signal rotating speed change information closest to the calling moment in the destination address; and the second calculation unit is used for determining the rotating speed value of the interface function call moment based on the rotating speed change information and the time difference.
According to another aspect of the embodiments of the present application, there is provided a rotation speed collection device, including a processor, a memory, and a program stored in the memory and capable of running on the processor, where the processor implements the rotation speed collection method based on a single chip microcomputer described in any one of the above first aspects when executing the program.
According to another aspect of the present application, there is provided a computer readable storage medium storing a computer program, which when executed by a processor, implements the method for acquiring a rotational speed based on a single chip microcomputer described in any one of the above first aspects.
In the embodiment of the application, a tooth signal is collected and transmitted to a destination address in a DMA mode; acquiring the time difference between the interface function call time and the latest tooth signal at the destination address updating time; calculating at least two times of tooth signal rotating speed change information closest to the calling moment in the destination address; and determining the rotating speed value of the interface function call moment based on the rotating speed change information and the time difference, and obtaining the rotating speed value of any moment in the tooth period after calculating the acceleration in the current tooth period, so that the rotating speed value of the current moment (interface function call moment) can be calculated based on the acceleration after obtaining the time difference. The problem of a platform which occurs when the rotating speed is low and the period is large is avoided, and the rotating speed value between two teeth can be obtained in time, so that a gear shifting point is found.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the invention or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, and it will be obvious to a person skilled in the art that other drawings can be obtained from these drawings without inventive effort.
Fig. 1 is a schematic flow chart of a rotation speed acquisition method based on a single chip microcomputer according to an embodiment of the application;
FIG. 2 is a schematic diagram of another interface function call according to an embodiment of the present application;
FIG. 3 is a schematic diagram of another SCM-based rotational speed acquisition device according to an embodiment of the present application;
fig. 4 is a block diagram of an alternative rotational speed acquisition device according to an embodiment of the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The application provides a rotation speed acquisition method based on a singlechip, as shown in fig. 1, the flow of the method can comprise the following steps:
s10, collecting tooth signals and transmitting the tooth signals to a destination address in a DMA mode. As an exemplary embodiment, the general architecture of the engine control system is to collect signals of a crankshaft and a cam shaft for processing, calculate the acceleration and the speed of the engine, and finally complete control of oil injection, ignition, gear shifting and the like. The time that the crankshaft rotates one tooth is called the tooth period of that tooth. The crankshaft signal is typically a signal acquired by a crankshaft sensor. When one tooth passes through the crank sensor, the crank sensor is triggered to generate a high level, and after the tooth completely passes through the crank sensor, the crank sensor outputs a low level before the next tooth arrives, so that a tooth period of one tooth signal is formed.
Of course, the low level may also be triggered when the tooth passes the crank sensor, and after the passing, the high level is triggered, which in the present embodiment is described by taking the example that the tooth passes the crank sensor.
The mounting positions of the different crank sensors are different. The currently commonly used crank shaft sensors are mainly three types, namely a magneto-electric induction type crank shaft sensor, a Hall effect type crank shaft sensor and a photoelectric type crank shaft sensor. The electromagnetic induction type crankshaft sensor is divided into an electromagnetic induction type rotating speed sensor and a crankshaft position sensor, and the electromagnetic induction type rotating speed sensor and the crankshaft position sensor are divided into an upper layer and a lower layer to be installed in the distributor.
In this embodiment, the tooth signal is collected by a general purpose timer module (Generic Timer Module, GTM), and in initialization, the interrupt mode of the channel of the GTM is set to direct memory access (Direct Memory Access, DMA) and this function is enabled. When the GTM collects the tooth signals, the tooth signals are directly conveyed to the destination address through DMA. In this embodiment, the tooth signal may store a plurality of in the destination address in sequence in time series. For example, the last acquired tooth signal may be stored in the parameter array icu_buffer, where 0 is the latest value, 1 is the next latest value, and so on, and the icu_buffer array is byte aligned according to the number of dimensions.
The acquisition value is acquired by a DMA mode, a mode of acquiring the period value in a polling mode is replaced, the latest period values of a plurality of teeth can be stored conveniently, and the instantaneity is improved through certain calculation.
S20, obtaining the time difference between the interface function call time and the latest tooth signal at the destination address updating time.
As an exemplary embodiment, when the tooth signals are stored in the destination address, the update timing of each tooth signal in the destination address may be acquired. I.e. the acquisition instant of each tooth signal is recorded. Waiting for an interface function call. In this embodiment, the interface function is used to call the tooth signal to obtain the current engine speed, so as to implement the next control strategy of the engine. In this embodiment, the interface function may have a fixed calling period, or may dynamically adjust the calling period according to the engine operating condition.
As shown in fig. 2, since the engine speed is varied, the tooth period of the tooth signal is also varied, and thus, the interface function call period is not synchronized with the tooth period. Recording the interface function call time, and calculating the time difference delta t between the interface function call time and the updating time of the tooth period where the interface function call time is located.
S30, calculating at least two times of tooth signal rotating speed change information closest to the calling moment in the destination address. As an exemplary embodiment, the latest two-tooth period value T is obtained from the parameter array icu_buffer 0 And T 1 Calculating the rotation speed n corresponding to the period of two teeth according to the relation n=60/(T) number of teeth 0 And n 1 Further, a first rotational speed acceleration a= (n) of the rotational speed change is calculated 0 -n 1 )/T 0 。
S40, determining the rotation speed value of the interface function call moment based on the rotation speed change information and the time difference. As an exemplary embodiment, when the rotation speed is low, the tooth period is large, and when the rotation speed is called, the rotation speed corresponding to the current tooth period can only be used as the rotation speed at the current moment, however, if the rotation speed changes from one tooth to the next tooth, the rotation speed obtained by calling is inaccurate.
Therefore, after the first rotational speed acceleration in the current tooth period is calculated, the rotational speed value at any time in the tooth period can be obtained, and therefore, after the time difference is obtained, the rotational speed value at the current time (interface function call time) can be calculated based on the first rotational speed acceleration. The problem of a platform which occurs when the rotating speed is low and the period is large is avoided, and the rotating speed value between two teeth can be obtained in time, so that a gear shifting point is found.
As an exemplary embodiment, in order to reduce the load of the CPU and the code complexity and improve the data processing efficiency and the development efficiency, in this embodiment, when the time difference is obtained, the time interval between the calling time of the interface function iohwab_getdmatim () and the update time of the latest frequency acquisition value may be obtained as the time difference by using the principle that the counting is restarted by using a rising edge of the count register timch CNT of the timer. Illustratively, a count register of a timer records an update time of each of the tooth signals at the destination address, the update time being a tooth period start time of the tooth signal; recording a calling time when the interface function is called; and calculating the time interval between the calling time and the updating time of the tooth signal at the calling time as a time difference.
In this embodiment, each tooth signal is collected, and the rising edge of the tooth signal triggers the counting register of the timer to count again, so that the collection time of each tooth signal or the update time in the destination address can be obtained. The counting time is only assigned in the code. Code complexity can be saved considerably.
As another alternative embodiment, the time difference between the calling time of the interface function and the latest tooth signal collection value updating time is obtained, besides the working principle of the tim_ch_cnt register, an interrupt mode may be adopted, that is, an interrupt is entered when each tooth is called, the time stamp at the moment is recorded, the time stamp at the moment is also recorded when the interface function is called, and the time interval between the two time stamps is taken as the time difference.
Specifically, when the interface function is called, the calling time is recorded; when each tooth signal is transmitted to the destination address, entering interruption, and recording each interruption moment, wherein the interruption moment is the tooth period starting moment of the tooth signal; and calculating the time interval of the calling time and the interruption time corresponding to the tooth signal at the calling time as a time difference.
As an exemplary embodiment, the rotational speed change information may be rotational speed acceleration, the rotational speed value at any time in the current tooth period may be calculated by using the first rotational speed acceleration in the current tooth period and the rotational speed value calculated by using the current tooth period, and if there is an interface function call in the current tooth period, the actual rotational speed value at the time of the call may be calculated. Specific:
sequentially storing at least two tooth signals in the destination address according to time sequence; acquiring at least two tooth signals closest to the calling moment in the destination address; respectively calculating a rotating speed value corresponding to each tooth signal; and calculating a first rotational speed acceleration based on the rotational speed value as the rotational speed change information.
And determining the rotation speed value of the interface function at the calling time based on the rotation speed change information and the time difference, wherein the rotation speed value can be the rotation speed value at the calling time, and obtaining a real-time rotation speed value. In this embodiment, the latest rotation speed value corresponding to the tooth signal at the calling time is obtained; and calculating the rotation speed value of the interface function call moment based on the latest rotation speed value, the first rotation speed acceleration and the time difference.
A plurality of tooth signals are stored in a parameter array ICU_buffer according to time sequence, and the latest twice tooth period value T is obtained 0 And T 1 Calculating the rotation speed n corresponding to the period of two teeth according to the relation n=60/(T) number of teeth 0 And n 1 Further, a first rotational speed acceleration a= (n) of the rotational speed change is calculated 0 -n 1 )/T 0 The current rotational speed value n=n can be calculated in combination with the obtained time difference Δt 0 And +Deltat is a, so that the problem of a platform when the rotating speed is low and the period is large is avoided, and the rotating speed value between two teeth can be obtained in time, thereby finding a gear shifting point.
In an alternative embodiment, the first rotational speed acceleration may also be used to predict the rotational speed at the next interface function call time or at the next N interface function call times, so that the operational space is greatly increased.
For example, the first rotational speed acceleration in at least two tooth periods may be continuously calculated, so as to obtain a rotational speed acceleration variation trend, and then the second rotational speed acceleration of the tooth period at a certain future calling time is predicted based on the rotational speed acceleration variation trend. The first rotational speed acceleration is rotational speed acceleration obtained through real-time calculation, and the second rotational speed acceleration is rotational speed acceleration corresponding to a predicted calling period to be predicted. And the rotation speed at a certain future calling moment can be obtained based on the predicted second rotation speed acceleration.
In this embodiment, a plurality of the first rotational speeds are calculated, wherein each first rotational speed is a first rotational speed between at least two tooth signals; determining the rotational speed acceleration variation trend based on a plurality of the first rotational speed accelerations; and predicting the rotating speed value of the interface function call moment in the future based on the acceleration change trend.
Wherein predicting the rotational speed value at the interface function call time in the future based on the acceleration change trend includes: acquiring the interface function calling period; determining a second rotational speed acceleration of the interface function call moment to be predicted based on the call period and the acceleration change trend; and calculating the rotational speed value of the interface function call moment to be predicted based on the rotational speed value of the call moment or the rotational speed value corresponding to the tooth signal at the call moment and the second rotational speed acceleration of the interface function call moment to be predicted.
It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of action combinations, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required in the present application.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM (Read-Only Memory)/RAM (Random Access Memory ), magnetic disk, optical disc), including instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method described in the embodiments of the present application.
According to still another aspect of the embodiments of the present application, as shown in fig. 3, there is further provided a rotation speed acquisition device based on a single chip microcomputer, including:
the acquisition unit 301 is configured to acquire a tooth signal, and transmit the tooth signal to a destination address in a DMA manner;
an obtaining unit 302, configured to obtain a time difference between an interface function call time and the latest tooth signal at the destination address update time;
a first calculating unit 303, configured to calculate at least two tooth signal rotation speed change information in the destination address, where the two tooth signal rotation speed change information is closest to the calling time;
a second calculating unit 304, configured to determine a rotation speed value at the interface function call time based on the rotation speed change information and the time difference.
Fig. 4 is a block diagram of an alternative electronic device, according to an embodiment of the present application, including a processor 402, a communication interface 404, a memory 406, and a communication bus 408, as shown in fig. 4, wherein the processor 402, the communication interface 404, and the memory 406 communicate with each other via the communication bus 408, wherein,
a memory 406 for storing a computer program;
collecting tooth signals and transmitting the tooth signals to a destination address in a DMA mode;
acquiring the time difference between the interface function call time and the latest tooth signal at the destination address updating time;
calculating at least two times of tooth signal rotating speed change information closest to the calling moment in the destination address;
and determining the rotation speed value of the interface function call moment based on the rotation speed change information and the time difference.
Alternatively, in the present embodiment, the above-described communication bus may be a PCI (Peripheral Component Interconnect, peripheral component interconnect standard) bus, or an EISA (Extended Industry Standard Architecture ) bus, or the like. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, only one thick line is shown in fig. 4, but not only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The memory may include RAM or may include non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general purpose processor and may include, but is not limited to: CPU (Central Processing Unit ), NP (Network Processor, network processor), etc.; but also DSP (Digital Signal Processing, digital signal processor), ASIC (Application Specific Integrated Circuit ), FPGA (Field-Programmable Gate Array, field programmable gate array) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments, and this embodiment is not described herein.
It will be understood by those skilled in the art that the structure shown in fig. 4 is only schematic, and the device implementing the above-mentioned rotation speed collection method based on the single chip microcomputer may be a terminal device, and the terminal device may be a smart phone (such as an Android mobile phone, an iOS mobile phone, etc.), a tablet computer, a palm computer, a mobile internet device (Mobile Internet Devices, MID), a PAD, etc. Fig. 4 is not limited to the structure of the electronic device. For example, the terminal device may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in fig. 4, or have a different configuration than shown in fig. 4.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be implemented by a program for instructing a terminal device to execute in association with hardware, the program may be stored in a computer readable storage medium, and the storage medium may include: flash disk, ROM, RAM, magnetic or optical disk, etc.
According to yet another aspect of embodiments of the present application, there is also provided a storage medium. Alternatively, in this embodiment, the storage medium may be used to execute a program code of a rotational speed acquisition method based on a single chip microcomputer.
Alternatively, in this embodiment, the storage medium may be located on at least one network device of the plurality of network devices in the network shown in the above embodiment.
Alternatively, in the present embodiment, the storage medium is configured to store program code for performing the steps of:
collecting tooth signals and transmitting the tooth signals to a destination address in a DMA mode;
acquiring the time difference between the interface function call time and the latest tooth signal at the destination address updating time;
calculating at least two times of tooth signal rotating speed change information closest to the calling moment in the destination address;
and determining the rotation speed value of the interface function call moment based on the rotation speed change information and the time difference.
Alternatively, specific examples in the present embodiment may refer to examples described in the above embodiments, which are not described in detail in the present embodiment.
Alternatively, in the present embodiment, the storage medium may include, but is not limited to: various media capable of storing program codes, such as a U disk, ROM, RAM, a mobile hard disk, a magnetic disk or an optical disk.
The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
The integrated units in the above embodiments may be stored in the above-described computer-readable storage medium if implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions to cause one or more computer devices (which may be personal computers, servers or network devices, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, such as the division of the units, is merely a logical function division, and may be implemented in another manner, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution provided in the present embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application and are intended to be comprehended within the scope of the present application.
Claims (10)
1. The rotating speed acquisition method based on the singlechip is characterized by comprising the following steps of:
collecting tooth signals and transmitting the tooth signals to a destination address in a DMA mode;
acquiring the time difference between the interface function call time and the latest tooth signal at the destination address updating time;
calculating at least two times of tooth signal rotating speed change information closest to the calling moment in the destination address;
and determining the rotation speed value of the interface function call moment based on the rotation speed change information and the time difference.
2. The method for acquiring the rotation speed based on the single-chip microcomputer according to claim 1, wherein the step of obtaining the time difference between the time of calling the interface function and the time of updating the destination address of the latest tooth signal comprises the steps of:
recording the updating time of each tooth signal at the destination address by using a counting register of a timer, wherein the updating time is the tooth period starting time of the tooth signal;
recording the calling time when the interface function is called;
and calculating the time interval between the calling time and the updating time of the tooth signal at the calling time as the time difference.
3. The method for acquiring the rotation speed based on the single-chip microcomputer according to claim 1, wherein the step of obtaining the time difference between the time of calling the interface function and the time of updating the destination address of the latest tooth signal comprises the steps of:
recording the calling time when the interface function is called;
when each tooth signal is transmitted to the destination address, entering interruption, and recording each interruption moment, wherein the interruption moment is the tooth period starting moment of the tooth signal;
and calculating the time interval of the calling time and the interruption time corresponding to the tooth signal at the calling time as the time difference.
4. The method for acquiring the rotation speed based on the single chip microcomputer according to claim 1, wherein the calculating the rotation speed change information of at least two tooth signals closest to the calling time in the destination address comprises:
sequentially storing at least two tooth signals in the destination address according to time sequence;
acquiring at least two tooth signals closest to the calling moment in the destination address;
respectively calculating a rotating speed value corresponding to each tooth signal;
and calculating a first rotational speed acceleration based on the rotational speed value as the rotational speed change information.
5. The method for collecting rotational speed based on a single-chip microcomputer according to claim 4, wherein determining the rotational speed value at the interface function call time based on the rotational speed change information and the time difference comprises:
acquiring the latest rotating speed value corresponding to the tooth signal at the calling moment;
and calculating the rotation speed value of the interface function call moment based on the latest rotation speed value, the first rotation speed acceleration and the time difference.
6. The method for collecting rotational speed based on a single-chip microcomputer according to claim 4, wherein determining the rotational speed value at the interface function call time based on the rotational speed change information and the time difference further comprises:
calculating a plurality of first rotational speeds and accelerations, wherein each first rotational speed and acceleration is a rotational speed and acceleration between at least two tooth signals;
determining the first rotational speed acceleration variation trend based on a plurality of the first rotational speed accelerations;
and predicting the rotating speed value of the interface function call moment in the future based on the acceleration change trend.
7. The method for collecting rotational speed based on a single-chip microcomputer according to claim 6, wherein predicting the rotational speed value of the interface function call time in the future based on the acceleration change trend comprises:
acquiring the interface function calling period;
determining a second rotational speed acceleration of the interface function call moment to be predicted based on the call period and the acceleration change trend;
and calculating the rotational speed value of the interface function call moment to be predicted based on the rotational speed value of the call moment or the rotational speed value corresponding to the tooth signal at the call moment and the second rotational speed acceleration of the interface function call moment to be predicted.
8. Rotation speed collection system based on singlechip, its characterized in that includes:
the acquisition unit is used for acquiring tooth signals and transmitting the tooth signals to a destination address in a DMA mode;
the acquisition unit is used for acquiring the time difference between the interface function call time and the latest tooth signal at the destination address updating time;
the first calculation unit is used for calculating at least two times of tooth signal rotating speed change information closest to the calling moment in the destination address;
and the second calculation unit is used for determining the rotating speed value of the interface function call moment based on the rotating speed change information and the time difference.
9. A rotational speed acquisition device, comprising:
one or more processors;
a storage device having one or more computer programs stored thereon;
the one or more computer programs, when executed by the one or more processors, cause the one or more processors to implement the single chip microcomputer based rotational speed acquisition method of any one of claims 1 to 7.
10. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the rotation speed acquisition method based on a single chip microcomputer according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211708285.5A CN116122975A (en) | 2022-12-29 | 2022-12-29 | Rotation speed acquisition method, rotation speed acquisition device, rotation speed acquisition equipment and storage medium based on single chip microcomputer |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211708285.5A CN116122975A (en) | 2022-12-29 | 2022-12-29 | Rotation speed acquisition method, rotation speed acquisition device, rotation speed acquisition equipment and storage medium based on single chip microcomputer |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116122975A true CN116122975A (en) | 2023-05-16 |
Family
ID=86305844
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211708285.5A Pending CN116122975A (en) | 2022-12-29 | 2022-12-29 | Rotation speed acquisition method, rotation speed acquisition device, rotation speed acquisition equipment and storage medium based on single chip microcomputer |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116122975A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH09158755A (en) * | 1995-12-12 | 1997-06-17 | Nissan Motor Co Ltd | Fuel supply control device for internal combustion engine |
DE10151678A1 (en) * | 2000-12-23 | 2002-06-27 | Bosch Gmbh Robert | Determining current engine revolution rates involves sensing gear wheel, using first method for revolution rates greater than definable threshold, second method for rates less then threshold |
CN101074634A (en) * | 2006-05-15 | 2007-11-21 | 陈柏全 | Method for estimating engine crank corner and rotation speed |
US20200049078A1 (en) * | 2018-08-08 | 2020-02-13 | Hyundai Motor Company | Method for engine control based on control timing prediction and vehicle thereof |
-
2022
- 2022-12-29 CN CN202211708285.5A patent/CN116122975A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH09158755A (en) * | 1995-12-12 | 1997-06-17 | Nissan Motor Co Ltd | Fuel supply control device for internal combustion engine |
DE10151678A1 (en) * | 2000-12-23 | 2002-06-27 | Bosch Gmbh Robert | Determining current engine revolution rates involves sensing gear wheel, using first method for revolution rates greater than definable threshold, second method for rates less then threshold |
CN101074634A (en) * | 2006-05-15 | 2007-11-21 | 陈柏全 | Method for estimating engine crank corner and rotation speed |
US20200049078A1 (en) * | 2018-08-08 | 2020-02-13 | Hyundai Motor Company | Method for engine control based on control timing prediction and vehicle thereof |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN100460652C (en) | Bumpless crankshaft position sensing | |
KR102206529B1 (en) | Method for providing a generic interface and microcontroller with generic interface | |
KR102205776B1 (en) | Method for providing a generic interface and microcontroller with generic interface | |
CN101238383A (en) | GPS processing arrangement | |
WO2016090421A1 (en) | Notifications on mobile devices | |
RU2320017C2 (en) | Method for recognizing manipulations with a sensor | |
CN106468560B (en) | Data output method and device based on pedometer message | |
WO2014009213A1 (en) | Method for executing, within a multitasking onboard system, an application timed according to a plurality of different time domains including interruption management | |
CN116122975A (en) | Rotation speed acquisition method, rotation speed acquisition device, rotation speed acquisition equipment and storage medium based on single chip microcomputer | |
CN114138499B (en) | GPU resource utilization rate monitoring method and device, computer equipment and medium | |
CN110990229B (en) | System information acquisition method and device | |
CN109658082B (en) | Method and equipment for identifying abnormal charging | |
US9720751B2 (en) | Analysis method, analysis apparatus and computer-readable recording medium having stored therein analysis program | |
CN111881153A (en) | Data processing method and device, electronic equipment and machine-readable storage medium | |
CN115142975B (en) | Method for determining oil injection advance angle, controller and computer readable storage medium | |
CN116974870A (en) | Performance data monitoring method and device, storage medium and electronic equipment | |
CN115391011A (en) | Method, device, apparatus, medium, and program for scheduling timing task | |
CN117056059B (en) | Timer realizing method and device, storage medium and electronic equipment | |
CN111159244B (en) | Data query method and device | |
CN111367832A (en) | Statistical method and device based on memory and storage equipment | |
CN114157662A (en) | Cloud platform parameter adaptation method and device, terminal equipment and storage medium | |
CN113064807A (en) | Log diagnosis method and device | |
CN114579314A (en) | Processing method and device for equipment data acquisition configuration and electronic equipment | |
CN109471663B (en) | Method and device for executing single chip microcomputer program | |
CN112463125B (en) | Timing method and equipment of virtual timer |
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 |