Timing control method, device, dry chemical scanning equipment and storage medium

By using timers and interrupt mechanisms in the data transmission timing control of the ADC, the processor's idle waiting time is effectively utilized, which solves the problem of wasting time in the ADC data transmission timing control and improves data transmission efficiency.

CN115549811BActive Publication Date: 2024-10-08SHENZHEN REETOO BIOTECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110744088.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-30
Publication Date
2024-10-08
Estimated Expiration
2041-06-30

AI Technical Summary

Technical Problem

In dry chemical scanning applications, the data transmission timing of the ADC is controlled by the processor, resulting in a lot of idle waiting time for the processor, which is a waste of time.

Method used

Using the timing control method, by generating a data transmission execution signal and starting the timer, data transmission is performed within the effective level time of the timer. When a data transmission is completed, the main program task is returned to the remaining time of the current timing cycle of the timer. , generate an interrupt when the timer's timing cycle is reached and restart data transmission until the data transmission operation is completed.

Benefits of technology

This effectively avoids the waste of idle waiting time of the processor between data transmissions, ensures that the operation of the main program task is not affected, and does not wait idlely between two adjacent data transmissions, improving data transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115549811B_ABST
    Figure CN115549811B_ABST
Patent Text Reader

Abstract

The present application relates to a timing control method, device, dry chemical scanning equipment and storage medium. When data transmission is required, the processing device generates a data transmission execution signal and starts the timer to start timing. During the effective level time of the timer, the processing device can implement the data transmission operation according to the data transmission execution signal. After the data transmission is completed, during the remaining time of the current timing cycle of the timer, the processing device will not wait, but return to execute the main program task. After the timer reaches the timing cycle, a timer interrupt will be generated to stop the execution of the main program task, and the timing will be restarted with the timing cycle in the interrupt to execute the next round of data transmission operations until the data transmission operation is completed. In the above scheme, the processing device will not wait idle between two adjacent data transmission operations, which effectively avoids the problem of wasting a lot of idle waiting time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a timing control method, device, dry chemical scanning equipment and storage medium. Background Art

[0002] ADC (Analog to Digital Converter) refers to an electronic component that converts analog signals into digital signals. It is usually used to convert input voltage signals into output digital signals. It has a wide range of applications in data acquisition.

[0003] In application scenarios such as dry chemical scanning, the data acquisition timing of the ADC is controlled by the processor (e.g., MCU, MicroControl Unit). When starting SPI (Serial Peripheral Interface) data transmission, the MCU needs to first give the ADC's CS (chip select signal) pin a high-level signal before the ADC can start SPI data transmission. After that, the MCU pulls down the level of the CS pin, and the ADC starts a single SPI data transmission. When the ADC needs to transmit data again, it needs to wait for a while, that is, there is a certain time interval between two consecutive SPI data transmissions. Since data transmission needs to be performed multiple times, a lot of time will be wasted cumulatively. Summary of the invention

[0004] Based on this, it is necessary to provide a timing control method, device, dry chemical scanning equipment and storage medium to address the problem that the processor wastes a lot of time waiting idle when the ADC performs multiple data transmissions.

[0005] A timing control method comprises: when data transmission is required, generating a data transmission execution signal and starting a timer; performing data transmission according to the data transmission execution signal within the effective level time of the timer; when one data transmission is completed, returning to execute the main program task within the remaining time of the current timing cycle of the timer; when the timing cycle of the timer is reached, generating a timer interrupt and returning to the step of performing data transmission according to the data transmission execution signal within the effective level time of the timer until the data transmission operation is completed.

[0006] In one embodiment, when data transmission is required, before the step of generating a data transmission execution signal and starting a timer, the step further includes: configuring a timer and a pulse width modulation signal generator, and configuring the effective level time and the ineffective level time of the timer.

[0007] In one embodiment, the step of configuring the effective level time and the ineffective level time of the timer includes: configuring the low level time of the pulse width modulation signal generated by the pulse width modulation signal generator as the effective level time of the timer, and configuring the high level time of the pulse width modulation signal as the ineffective level time of the timer.

[0008] In one embodiment, the step of returning to execute the main program task within the remaining time of the current timing cycle of the timer when a data transmission is completed includes: returning to execute the main program task within the remaining time of the valid level time of the current timing cycle of the timer and the invalid level time of the current timing cycle when a data transmission is completed.

[0009] In one embodiment, the step of generating a data transmission execution signal and starting a timer when data transmission is required includes: generating a pulse width modulation signal and starting a timer when data transmission is required.

[0010] In one embodiment, the step of performing data transmission according to the data transmission execution signal includes: sending data to the SPI module and storing the data read by the SPI module; controlling the SPI module to send data to a data collector, and controlling the SPI module to read the data returned by the data collector.

[0011] A timing control device comprises: a signal generating module, which is used to generate a data transmission execution signal and start a timer when data transmission is required; a data transmission module, which is used to perform data transmission according to the data transmission execution signal within the effective level time of the timer; a main program execution module, which is used to return to execute the main program task within the remaining time of the current timing cycle of the timer when a data transmission is completed; and an interrupt control module, which generates a timer interrupt when the timing cycle of the timer is reached and controls the data transmission module to perform the data transmission operation according to the data transmission execution signal within the effective level time of the timer until the data transmission operation is completed.

[0012] A dry chemical scanning device comprises a memory and a processing device, wherein the memory stores a computer program, and the processing device implements the steps of the above method when executing the computer program.

[0013] In one embodiment, the dry chemical scanning device further comprises a data collector, and the data collector is connected to the processing device.

[0014] A computer-readable storage medium stores a computer program, which implements the steps of the above method when executed by a processing device.

[0015] In the above-mentioned timing control method, device, dry chemical scanning equipment and storage medium, when data transmission is required, the processing device generates a data transmission execution signal and starts the timer to start timing. During the effective level time of the timer, the processing device can implement the data transmission operation according to the data transmission execution signal. After the data transmission is completed, during the remaining time of the current timing cycle of the timer, the processing device will not wait, but return to execute the main program task. After the timer reaches the timing cycle, a timer interrupt will be generated to stop the execution of the main program task, and the timing will be restarted with the timing cycle in the interrupt to execute the next round of data transmission operations until the data transmission operation is completed. In the above scheme, the processing device can perform the data transmission operation in the interruption of executing the main program task, and can immediately return to the main program task when the data transmission operation is completed. The operation of the main program task is basically not affected, and the processing device will not wait idle between two adjacent data transmission operations, effectively avoiding the problem of a lot of idle waiting time being wasted. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A schematic diagram of a timing control method flow in an embodiment;

[0017] Figure 2 A schematic diagram of a timing control method flow in another embodiment;

[0018] Figure 3 A schematic diagram of a timing control method flow in another embodiment;

[0019] Figure 4 A schematic diagram of a timing control method flow in yet another embodiment;

[0020] Figure 5 This is a schematic diagram of the structure of a timing control device in an embodiment;

[0021] Figure 6 It is a schematic diagram of the structure of a timing control device in another embodiment;

[0022] Figure 7 This is a schematic diagram of the internal structure of a dry chemical scanning device in one embodiment;

[0023] Figure 8 Schematic diagram of the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0024] In order to facilitate the understanding of the present application, the present application will be described more fully below with reference to the relevant drawings. The preferred embodiments of the present application are provided in the drawings. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive.

[0025] See also Figure 1 , a timing control method, including step S100, step S200, step S300 and step S400.

[0026] Step S200: When data transmission is required, a data transmission execution signal is generated and a timer is started.

[0027] Specifically, a timer is a device that can set a time (timing cycle) for timing, and after the timing reaches the set time, it immediately restarts the next round of timing operation with the set time. It can be understood that in this embodiment, the data transmission operation is specifically a data transmission task that requires a certain waiting time between two data transmissions. The solution of this embodiment is applied to a processing device. During the operation of the processing device, the processing device monitors whether data transmission is required. Specifically, the processing device itself can make a judgment based on the attributes of the task to be executed, or directly implement it based on the relevant instructions for data transmission sent by the user.

[0028] In order to facilitate understanding of the various embodiments of the present application, the following explanation is given by taking data transmission as an example of data interaction between a processing device and a data collector. When the processing device detects that there is a need to perform data transmission, the processing device generates a data transmission execution signal and sends it to the data collector, so that the data collector can receive the data sent by the processing device, or the data collector returns the collected data to the processing device, so as to realize data interaction between the two, thereby collaboratively performing data transmission.

[0029] Step S300: performing data transmission according to a data transmission execution signal within the effective level time of the timer.

[0030] Specifically, the effective level time is the duration corresponding to the level state that can trigger the execution of the data transmission operation. In the scheme of this embodiment, a timing cycle of the timer is configured as an effective level time and a non-effective level time. During the effective level time of the timer, the processing device implements the execution control of the data transmission according to the data transmission execution signal generated by its own timer. Similarly, taking data transmission as data interaction as an example, when the processing device generates and sends a data transmission execution signal to the data collector, the timer of the processing device starts to count, and during the effective level time period of the timing, the processing device combines the characteristics of the data transmission execution signal, and executes and completes the data transmission together with the data collector.

[0031] Step S400, when one data transmission is completed, return to execute the main program task within the remaining time of the current timing cycle of the timer.

[0032] Specifically, after the processing device completes the data transmission by itself, or the processing device completes the data transmission together with an external device or equipment (such as a data collector), in order to avoid wasting a lot of time in the waiting time between the two data transmissions, the processing device will immediately jump to execute the main program task, effectively avoiding the idle waiting of the processing device. Since the time occupied by data transmission is relatively short, when one data transmission is completed, it will immediately jump to execute the main program task, which will basically not affect the main program. It can be understood that the specific type of the main program task is not unique, and it can be any task that the processing device can implement in addition to the data transmission that needs to be executed continuously.

[0033] It can be understood that, depending on the different data transmission execution signals, the corresponding operations of executing data transmission according to the data transmission execution signal will also be different. For example, in one embodiment, when the data transmission execution signal has two different states, valid and invalid, executing data transmission according to the data transmission execution signal can specifically be to execute data transmission when the data transmission execution signal is in the valid state, and execute the main program task within the time after the data transmission is completed (specifically, it may include the invalid level time, or also include the remaining time after the data transmission is executed in the valid level time), so as to avoid idle waiting.

[0034] Step S500, when the timing cycle of the timer is reached, a timer interrupt is generated, and the step of performing data transmission according to the data transmission execution signal within the effective level time of the timer is returned until the data transmission operation is completed.

[0035] Specifically, in the process of the processing device executing data transmission and main program tasks, the timing operation of the timer is performed in real time, and the processing device determines in real time whether the current timer has reached the timing cycle. When the timing reaches the timing cycle, the processing device will generate a processor interrupt to interrupt the currently executed main program task, and the timer will restart the next round of timing operation. At this time, when the processing device returns to execute within the effective level time of the timer, the data transmission operation is performed according to the data transmission execution signal, and the next round of data transmission is started, that is, the next round of data transmission is executed in the timer interrupt. This cycle is repeated until the continuous execution of the data transmission operation ends, that is, the exit continuous execution of the data transmission instruction sent by the user is received, or the number of consecutive executions of the data transmission reaches the requirement, etc.

[0036] That is, in this embodiment, data transmission can be executed within one timing cycle, and when data transmission is completed, it can also jump to execute the main program task, thereby not occupying the idle delay of the processing device and avoiding the processing device from wasting a lot of time waiting.

[0037] See also Figure 2In one embodiment, before step S200, the method further includes step S100.

[0038] Step S100, configuring a timer and a pulse width modulation signal generator, and configuring an effective level time and an ineffective level time of the timer.

[0039] Specifically, in the solution of this embodiment, in addition to the processor for processing the execution timing control method, the processing device also includes a timer for timing and a pulse width modulation signal generator for generating a pulse width modulation signal (PWM). Configuring the timer and the pulse width modulation signal generator means configuring a timing cycle for the timer in the processing device, and configuring the pulse width modulation signal generator means configuring a pulse width modulation signal of a certain frequency and amplitude for the pulse width modulation signal generator in the processing device. At the same time, the timing cycle of the timer is further configured through the processing device, and the timing cycle is configured as an effective level time and an ineffective level time, so that when subsequent tasks are executed, corresponding tasks are executed in different time periods.

[0040] Furthermore, in one embodiment, the step of configuring the effective level time and the ineffective level time of the timer includes: configuring the low level time of the pulse width modulation signal generated by the pulse width modulation signal generator as the effective level time of the timer, and configuring the high level time of the pulse width modulation signal as the ineffective level time of the timer.

[0041] Specifically, the solution of this embodiment configures the time corresponding to the low level of the PWM signal as the effective level time of the timer, and configures the time corresponding to the high level of the PWM signal as the ineffective level time of the timer, so that when the PWM signal is in a low level state, the trigger execution control of the data transmission task can be realized. That is, the solution of this embodiment is suitable for data transmission of low level signal trigger type.

[0042] It should be noted that in other embodiments, according to the type of data transmission task actually performed, the effective level time and the ineffective level time can also be configured differently. For example, the high level time of the pulse width modulation signal is configured as the effective level time of the timer, and the low level time of the pulse width modulation signal is configured as the ineffective level time of the timer, so as to realize the data transmission operation of the high level trigger type.

[0043] In one embodiment, see Figure 3 , step S200 includes step S210.

[0044] Step S210: When data transmission is required, a pulse width modulation signal is generated and a timer is started.

[0045] Specifically, the pulse width modulation signal is also called PWM signal. Pulse width modulation is to control the on and off of the switching device of the inverter circuit so that a series of pulses with equal amplitude are obtained at the output end, and these pulses are used to replace the sine wave or the required waveform. That is, multiple pulses are generated in half a cycle of the output waveform, so that the equivalent voltage of each pulse is a sine wave, and the obtained output is smooth and has few low-order harmonics. By modulating the width of each pulse according to certain rules, the output voltage of the inverter circuit can be changed, and the output frequency can also be changed.

[0046] A cycle of a pulse width modulated signal includes both low-level signals and high-level signals. Depending on the device or apparatus receiving the pulse width modulated signal, the effective level state of the pulse width modulated signal is also different. For example, when the device receiving the pulse width modulated signal for action triggering is a low-level effective type device, the effective level state of the corresponding pulse width modulated signal is a low-level state, that is, when the pulse width modulated signal is in a low-level state, it triggers the execution of data transmission, which can be specifically to trigger the processing device to execute data transmission, or to trigger the processing device and the external device to cooperate in executing data transmission at the same time. When the device receiving the pulse width modulated signal for action triggering is a high-level effective type device, the effective level state of the corresponding pulse width modulated signal is a high-level state, that is, when the pulse width modulated signal is in a high-level state, it triggers the execution of data transmission, which can be specifically to trigger the processing device to execute data transmission, or to trigger the processing device and the external device to cooperate in executing data transmission at the same time. Therefore, when data transmission is required, the processing device can generate a pulse width modulated signal to directly trigger the execution of data transmission operation.

[0047] In one embodiment, see Figure 4 , step S400 includes step S410.

[0048] Step S410, when one data transmission is completed, the main program task is returned to be executed within the remaining time of the valid level time of the current timing cycle of the timer and the non-valid level time of the current timing cycle.

[0049] Specifically, a timing cycle of the timer is configured as an effective level time and a non-effective level time, and when data transmission is performed during the effective level time of the timer, the data transmission does not occupy the entire effective level time. That is, when the data transmission operation is completed during the effective level time, there is still effective level time remaining. In order to avoid wasting waiting time, the processing device will directly return to execute the main program task during the remaining time of the effective level time. When the effective level time ends and enters the non-effective level time, the processing device maintains the execution of the main program task until the non-effective level time ends. That is, until the timing cycle of the timer is reached, a timer interrupt is generated, and the data transmission operation is started again in the interrupt.

[0050] In order to facilitate understanding of the solution of this embodiment, a detailed explanation is given by taking SPI data transmission in a dry chemical scanning scenario as an example. Since a period of time, such as 4 (us), is required between two adjacent data transmissions, this waiting time is configured within the effective level time in this embodiment, that is, data transmission is performed at the beginning of the effective level time Y (us), and data transmission only takes up Y-4 (us), and the remaining 4 (us) of the effective level time corresponds to the original 4 (us) required to wait between two adjacent data transmissions. At this time, in order to avoid wasting waiting time, these 4 (us) plus the non-effective level time, the processing device returns to execute the main program task.

[0051] It can be understood that in other embodiments, the remaining time of the current timing cycle of the timer can also be a non-valid level time, that is, only data transmission operations are performed during the entire valid level time, and when the valid level time ends, the data transmission operation also ends accordingly, and the main program task will be returned to execution during the remaining non-valid level time. This situation can be that there is no waiting requirement between two adjacent data transmissions; or the waiting between two adjacent data transmissions can be configured into the non-valid level time. If the waiting between two adjacent data transmissions is configured into the non-valid level time, the non-valid level time should be greater than or equal to the waiting time required for data transmission. Taking SPI data transmission as an example, the non-valid level time should be greater than or equal to 4 (us).

[0052] Furthermore, the specific type of data transmission is not unique, and any data interaction task that requires a time interval between two adjacent data transmissions is acceptable. For example, in one embodiment, the data transmission is at least one of an SPI data interaction task and an I2C data interaction task.

[0053] Specifically, in this embodiment, data transmission is a task of data interaction between the processing device and an external data collector. Take the SPI data interaction task as an example for explanation. At this time, the processing device is also additionally connected to a data collector. For ease of understanding, in this embodiment, the analog-to-digital converter is used as the data collector. The pulse width modulation pin of the processing device is connected to the chip select signal pin of the analog-to-digital converter, and the SPI pin of the processing device is connected to the SPI pin of the analog-to-digital converter. When continuous SPI data transmission is required, the timer inside the processing device is turned on for timing, and the timing period of the timer is X (us), wherein the effective level time of the configuration PWM signal is set to Y (us), and the ineffective level time is XY (us).

[0054] In one embodiment, the step of performing data transmission according to the data transmission execution signal includes: sending data to the SPI module and storing the data read by the SPI module; controlling the SPI module to send data to the data collector, and controlling the SPI module to read the data returned by the data collector.

[0055] Specifically, when data transmission is required, the pulse width modulation signal generator of the processing device generates a PWM signal, which is a low-level effective signal, that is, the PWM signal is first low-level and then high-level. While the PWM signal is generated, the timing operation of the timer starts. During the effective level time Y (us) at the beginning, due to the effect of the low level, the processing device sends data to its internal SPI module and stores the data read by the SPI module last time, that is, the data read by the SPI module to the analog-to-digital converter through the SPI pin. If necessary, the data can be pre-processed, which takes up very little time for the processing device. Afterwards, the SPI module will directly send the data to the analog-to-digital converter to control the analog-to-digital converter to collect data, and receive the collected data returned by the analog-to-digital converter, without the intervention of the processing device.

[0056] When the SPI data transmission is completed, the processing device directly jumps to execute the main program task, and generates a timer interrupt when the timer reaches the timing cycle, ends the main program task, and the timer starts the next round of timing operation and performs the SPI data transmission consistent with the above again in the interrupt until the user manually ends the SPI data transmission operation, or the number of SPI data transmissions reaches the requirement.

[0057] In this embodiment, due to the timing requirements of the chip select signal pin of the analog-to-digital converter, the PWM signal is configured to be low level valid, that is, after the timer is triggered, the level will automatically enter the Y (us) low level time, and then the XY (us) high level time, and so on. In this way, continuous CS pin timing can be achieved under the pulse width modulation of PWM without the need for the modulation timing of the processing device.

[0058] In the above timing control method, when data transmission is required, the processing device generates a data transmission execution signal and starts the timer to start timing. During the effective level time of the timer, the processing device can implement the data transmission operation according to the data transmission execution signal. After the data transmission is completed, the processing device will not wait during the remaining time of the current timing cycle of the timer, but will return to execute the main program task. After the timer reaches the timing cycle, a timer interrupt will be generated to stop the execution of the main program task, and the timing will be restarted with the timing cycle in the interrupt to execute the next round of data transmission operations until the data transmission operation is completed. In the above scheme, the processing device can perform the data transmission operation in the interruption of the execution of the main program task, and can immediately return to the main program task when the data transmission operation is completed. The operation of the main program task is basically not affected, and the processing device will not wait idle between two adjacent data transmission operations, effectively avoiding the problem of a lot of idle waiting time being wasted.

[0059] See also Figure 5 , a timing control device includes: a signal generating module 200, a data transmission module 300, a main program execution module 400 and an interrupt control module 500.

[0060] The signal generation module 200 is used to generate a data transmission execution signal and start the timer when data transmission is required; the data transmission module 300 is used to perform data transmission according to the data transmission execution signal within the effective level time of the timer; the main program execution module 400 is used to return to execute the main program task within the remaining time of the current timing cycle of the timer when a data transmission is completed; the interrupt control module 500 is used to generate a timer interrupt when the timing cycle of the timer is reached, and control the signal generation module 200 to execute data transmission according to the data transmission execution signal within the effective level time of the timer until the continuous execution of the data transmission is completed.

[0061] See also Figure 6 In one embodiment, before the signal generating module 200, the timing control device further includes a configuration module 100. The configuration module 100 is used to configure the timer and the pulse width modulation signal generator, and configure the effective level time and the ineffective level time of the timer.

[0062] In one embodiment, the configuration module 100 is further used to configure the low level time of the pulse width modulation signal generated by the pulse width modulation signal generator as the effective level time of the timer, and configure the high level time of the pulse width modulation signal as the ineffective level time of the timer.

[0063] In one embodiment, the signal generating module 200 is further configured to generate a pulse width modulation signal and start a timer when data transmission is required.

[0064] In one embodiment, the main program execution module 400 is also used to return to execute the main program task within the remaining time of the valid level time of the current timing cycle of the timer and the invalid level time of the current timing cycle when a data transmission is completed.

[0065] In one embodiment, the data transmission module 300 is also used to send data to the SPI module and store the data read by the SPI module; control the SPI module to send data to the data collector, and control the SPI module to read the data returned by the data collector.

[0066] For the specific definition of the timing control device, please refer to the definition of the timing control method above, which will not be repeated here. Each module in the above-mentioned timing control device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processing device in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processing device can call and execute the operations corresponding to the above modules.

[0067] In the timing control device, when data transmission is required, the processing device generates a data transmission execution signal and starts the timer to start timing. During the effective level time of the timer, the processing device can implement the data transmission operation according to the data transmission execution signal. After the data transmission is completed, the processing device will not wait during the remaining time of the current timing cycle of the timer, but will return to execute the main program task. After the timer reaches the timing cycle, a timer interrupt will be generated to stop the execution of the main program task, and the timing will be restarted with the timing cycle in the interrupt to execute the next round of data transmission operation until the data transmission operation is completed. In the above scheme, the processing device can perform the data transmission operation in the interruption of executing the main program task, and can immediately return to the main program task when the data transmission operation is completed. The operation of the main program task is basically not affected, and the processing device will not wait idle between two adjacent data transmission operations, effectively avoiding the problem of a lot of idle waiting time being wasted.

[0068] In one embodiment, a dry chemical scanning device is also provided, including a memory and a processing device, wherein the memory stores a computer program, and the processing device implements the steps of the above method when executing the computer program.

[0069] Specifically, during operation, the processing device monitors whether data transmission is required, which can be determined by the processing device itself according to the attributes of the task to be executed, or directly implemented according to the relevant instructions for data transmission sent by the user. When continuous data transmission is required, a data transmission execution signal is generated and timing is started.

[0070] During the timing phase, the processing device implements the execution control of data transmission according to the data transmission execution signal generated by its own timer. Similarly, taking data transmission as data interaction as an example, when the processing device generates and sends a data transmission execution signal to the data collector, the processing device starts timing. During the timing phase, the processing device combines the characteristics of the data transmission execution signal and executes and completes the data transmission together with the data collector.

[0071] After the processing device completes data transmission by itself, or the processing device completes data transmission together with an external device or equipment (such as a data collector), in order to avoid a large amount of time wasted in the waiting time between the two data transmissions, the processing device will immediately jump to execute the main program task, effectively avoiding the idle waiting of the processing device. It can be understood that the specific type of the main program task is not unique, and it can be any task that the processing device can implement in addition to the data transmission that needs to be continuously executed.

[0072] During the process of the processing device executing data transmission and main program tasks, the timing operation is performed in real time. The processing device determines in real time whether the current timing has reached the preset timing cycle. When the timing reaches the preset timing cycle, the processing device will interrupt the currently executed main program task, re-execute the operation of generating a data transmission execution signal and starting timing, and start the next round of data transmission execution operation. This cycle continues until the continuous execution of the data transmission operation ends, that is, the exit continuous execution of data transmission instruction sent by the user is received, or the number of consecutive executions of data transmission reaches the requirement.

[0073] Furthermore, in one embodiment, the dry chemical scanning device may be a terminal, and its internal structure diagram may be as follows: Figure 7As shown. The dry chemical scanning device includes a processing device, a memory, a network interface, a display screen and an input device connected via a system bus. Among them, the processing device of the dry chemical scanning device is used to provide computing and control capabilities. The memory of the dry chemical scanning device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the dry chemical scanning device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processing device, a timing control method is implemented. The display screen of the dry chemical scanning device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the dry chemical scanning device can be a touch layer covering the display screen, or a button, trackball or touchpad provided on the housing of the dry chemical scanning device, or an external keyboard, touchpad or mouse, etc.

[0074] Those skilled in the art will understand that Figure 7 The structure shown in the figure is merely a block diagram of a portion of the structure related to the present application scheme, and does not constitute a limitation on the dry chemical scanning device to which the present application scheme is applied. The specific dry chemical scanning device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0075] Furthermore, in one embodiment, the processing device of the dry chemical scanning equipment includes a central processing unit, a timer, a pulse width modulation signal generator and an SPI module, and the timer, the pulse width modulation signal generator and the SPI module are respectively connected to the central processing unit.

[0076] In one embodiment, the dry chemical scanning device further comprises an analog-to-digital converter connected to the processing device.

[0077] Specifically, the pulse width modulation pin of the processing device is connected to the chip select signal pin of the analog-to-digital converter, and the SPI pin of the processing device is connected to the SPI pin of the analog-to-digital converter. When SPI data transmission is required, the central processing unit controls the timer to start timing and controls the pulse width modulation signal generator to generate a PWM signal. The timing cycle of the timer is X (us), wherein the effective level time of the PWM signal is configured to be Y (us) and the ineffective level time is XY (us).

[0078] In the initial effective level time Y (us), the central processor sends data to the SPI module and stores the data read by the SPI module last time, that is, the data read by the SPI module from the analog-to-digital converter through the SPI pin. If necessary, the data can be pre-processed, which takes up very little time in the processing device. After that, the SPI module will directly send the data to the analog-to-digital converter to control the analog-to-digital converter to collect data, and receive the collected data returned by the analog-to-digital converter, without the intervention of the central processor.

[0079] When the SPI data transmission is completed, the CPU directly jumps to execute the main program task, and generates a timer interrupt at the end of the timing cycle. In the interrupt, the SPI data transmission consistent with the above is performed again until the user manually ends the SPI data transmission operation, or the number of SPI data transmissions reaches the requirement.

[0080] In the above-mentioned dry chemical scanning equipment, when data transmission is required, the processing device generates a data transmission execution signal and starts the timer to start timing. During the effective level time of the timer, the processing device can implement the data transmission operation according to the data transmission execution signal. After the data transmission is completed, during the remaining time of the current timing cycle of the timer, the processing device will not wait, but return to execute the main program task. After the timer reaches the timing cycle, a timer interrupt will be generated to stop the execution of the main program task. In the interrupt, the timing will be restarted with the timing cycle to execute the next round of data transmission operations until the data transmission operation is completed. In the above scheme, the processing device can perform the data transmission operation in the interruption of executing the main program task, and can immediately return to the main program task when the data transmission operation is completed. The operation of the main program task is basically not affected, and the processing device will not wait idle between two adjacent data transmission operations, which effectively avoids the problem of wasting a lot of idle waiting time.

[0081] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processing device, a memory, a network interface and a database connected through a system bus. Among them, the processing device of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data related to data transmission and main program tasks. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processing device, a timing method is implemented.

[0082] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processing device, the following steps are implemented: when data transmission is required, a data transmission execution signal is generated and a timer is started; data transmission is performed according to the data transmission execution signal within the effective level time of the timer; when one data transmission is completed, the execution of the main program task is returned within the remaining time of the current timing cycle of the timer; when the timing cycle of the timer is reached, a timer interrupt is generated, and the steps of performing data transmission according to the data transmission execution signal within the effective level time of the timer are returned until the continuous execution of the data transmission is completed.

[0083] In one embodiment, when the computer program is executed by the processing device, the following steps are further implemented: configuring a timer and a pulse width modulation signal generator, and configuring the effective level time and the ineffective level time of the timer.

[0084] In one embodiment, when the computer program is executed by the processing device, the following steps are also implemented: the low level time of the pulse width modulation signal generated by the pulse width modulation signal generator is configured as the effective level time of the timer, and the high level time of the pulse width modulation signal is configured as the ineffective level time of the timer.

[0085] In one embodiment, when the computer program is executed by the processing device, the following steps are further implemented: when data transmission is required, a pulse width modulation signal is generated and a timer is started.

[0086] In one embodiment, when the computer program is executed by the processing device, the following steps are also implemented: when a data transmission is completed, return to execute the main program task within the remaining time of the valid level time of the current timing cycle of the timer and the invalid level time of the current timing cycle.

[0087] In one embodiment, when the computer program is executed by the processing device, the following steps are also implemented: sending data to the SPI module and storing the data read by the SPI module; controlling the SPI module to send data to the data collector, and controlling the SPI module to read the data returned by the data collector.

[0088] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0089] In the above-mentioned computer device and storage medium, when data transmission is required, the processing device generates a data transmission execution signal and starts the timer to start timing. During the effective level time of the timer, the processing device can implement the data transmission operation according to the data transmission execution signal. After the data transmission is completed, during the remaining time of the current timing cycle of the timer, the processing device will not wait, but return to execute the main program task. After the timer reaches the timing cycle, a timer interrupt will be generated to stop the execution of the main program task, and the timing will be restarted with the timing cycle in the interrupt to execute the next round of data transmission operation until the data transmission operation is completed. In the above-mentioned scheme, the processing device can perform the data transmission operation in the interruption of executing the main program task, and can immediately return to the main program task when the data transmission operation is completed. The operation of the main program task is basically not affected, and the processing device will not wait idle between two adjacent data transmission operations, effectively avoiding the problem of a lot of idle waiting time being wasted.

[0090] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0091] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the patent application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent application shall be subject to the attached claims.

Claims

1. A timing control method, It is characterized in that include: When data transmission is required, a data transmission execution signal is generated and a timer is started; wherein a data transmission operation is a data transmission task that requires a certain waiting time between two data transmissions; performing data transmission according to the data transmission execution signal within the effective level time of the timer; When one data transmission is completed, the execution of the main program task is returned within the remaining time of the current timing cycle of the timer; When the timing cycle of the timer is reached, a timer interrupt is generated and the step of performing data transmission according to the data transmission execution signal within the effective level time of the timer is returned until the data transmission operation is completed.

2. The timing control method according to claim 1, It is characterized in that Before the step of generating a data transmission execution signal and starting a timer when data transmission is required, the method further includes: A timer and a pulse width modulation signal generator are configured, and an effective level time and an ineffective level time of the timer are configured.

3. The timing control method according to claim 2, It is characterized in that The step of configuring the effective level time and the ineffective level time of the timer comprises: The low level time of the pulse width modulation signal generated by the pulse width modulation signal generator is configured as the effective level time of the timer, and the high level time of the pulse width modulation signal is configured as the ineffective level time of the timer.

4. The timing control method according to claim 1, It is characterized in that The step of returning to execute the main program task within the remaining time of the current timing cycle of the timer when one data transmission is completed includes: When one data transmission is completed, the main program task is returned to be executed within the remaining time of the valid level time of the current timing cycle of the timer and the invalid level time of the current timing cycle.

5. The timing control method according to claim 1, It is characterized in that The step of generating a data transmission execution signal and starting a timer when data transmission is required comprises: When data transfer is required, a pulse width modulated signal is generated and a timer is started.

6. The timing control method according to any one of claims 1 to 5, It is characterized in that The step of performing data transmission according to the data transmission execution signal comprises: Send data to the SPI module and store the data read by the SPI module; The SPI module is controlled to send data to a data collector, and the SPI module is controlled to read data returned by the data collector.

7. A timing control device, It is characterized in that include: A signal generation module is used to generate a data transmission execution signal and start a timer when data transmission is required; wherein a data transmission operation is a data transmission task that requires a certain waiting time between two data transmissions; A data transmission module, used for performing data transmission according to the data transmission execution signal within the effective level time of the timer; A main program execution module, used for returning to execute the main program task within the remaining time of the current timing cycle of the timer when one data transmission is completed; The interrupt control module generates a timer interrupt when the timing cycle of the timer is reached and controls the data transmission module to execute the data transmission operation according to the data transmission execution signal within the effective level time of the timer until the data transmission operation is completed.

8. A dry chemical scanning device, comprising a memory and a processing device, wherein the memory stores a computer program, It is characterized in that When the processing device executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. The dry chemical scanning device according to claim 8, It is characterized in that It also includes a data collector, which is connected to the processing device.

10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processing device, the steps of the method according to any one of claims 1 to 6 are implemented.