TW202141055A - Sampling rate correction method, system, apparatus and storage medium - Google Patents

Sampling rate correction method, system, apparatus and storage medium Download PDF

Info

Publication number
TW202141055A
TW202141055A TW109118730A TW109118730A TW202141055A TW 202141055 A TW202141055 A TW 202141055A TW 109118730 A TW109118730 A TW 109118730A TW 109118730 A TW109118730 A TW 109118730A TW 202141055 A TW202141055 A TW 202141055A
Authority
TW
Taiwan
Prior art keywords
sampling
correction
period
deviation
rate
Prior art date
Application number
TW109118730A
Other languages
Chinese (zh)
Other versions
TWI747311B (en
Inventor
王鵬
伍致榮
Original Assignee
英華達股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 英華達股份有限公司 filed Critical 英華達股份有限公司
Publication of TW202141055A publication Critical patent/TW202141055A/en
Application granted granted Critical
Publication of TWI747311B publication Critical patent/TWI747311B/en

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0423Input/output
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/24Detecting, measuring or recording bioelectric or biomagnetic signals of the body or parts thereof
    • A61B5/316Modalities, i.e. specific diagnostic methods
    • A61B5/318Heart-related electrical modalities, e.g. electrocardiography [ECG]
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/72Signal processing specially adapted for physiological signals or for diagnostic purposes

Landscapes

  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Public Health (AREA)
  • Surgery (AREA)
  • Veterinary Medicine (AREA)
  • General Health & Medical Sciences (AREA)
  • Animal Behavior & Ethology (AREA)
  • Biophysics (AREA)
  • Pathology (AREA)
  • Biomedical Technology (AREA)
  • Heart & Thoracic Surgery (AREA)
  • Medical Informatics (AREA)
  • Molecular Biology (AREA)
  • Psychiatry (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physiology (AREA)
  • Artificial Intelligence (AREA)
  • Signal Processing (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Cardiology (AREA)
  • Other Investigation Or Analysis Of Materials By Electrical Means (AREA)
  • Analogue/Digital Conversion (AREA)

Abstract

A sampling rate correction method, system, apparatus and storage medium are provided. The method includes the following steps. The sampling points within a correction period are counted and the sampling time within a correction period is calculated. The correction time is determined according to the timing of a correction timer at the beginning and the end of the correction period. The sampling deviation within the correction period is determined according to the sampling time and the correction time. The sampling data is corrected according to the sampling deviation. The invention does not need to modify or increase the hardware circuit. After sampling rate correction, the time deviation generated during sampling is improved, and the sampling accuracy is improved. Experiments show that the accuracy of the sampling rate can be greatly improved and stable without drift. The method may apply to the different wafers, it can ensure the accuracy of the sampling data and the accuracy of the data.

Description

採樣率校正方法、系統、設備及儲存媒介Sampling rate correction method, system, equipment and storage medium

本發明涉及採樣技術領域,尤其涉及一種採樣率校正方法、系統、設備及儲存媒介。The present invention relates to the technical field of sampling, in particular to a sampling rate correction method, system, equipment and storage medium.

採樣率,指的是每秒從連續信號中提取並組成離散信號的採樣個數,用赫茲(Hz)來表示。通常採樣晶片是通過內置時鐘或者外接晶振來提供其採樣基準的,其都會受到器件差異性、溫度、時間老化等影響造成時間漂移。例如,對於心電儀設備,其中的心率採集晶片存在偏差,MCU(Microcontroller Unit,微控制單元) 運行也存在偏差,導致同樣數量的採樣資料時長不一致,從而會因為計時不準確而影響資料獲取效果。Sampling rate refers to the number of samples extracted from a continuous signal per second to form a discrete signal, expressed in Hertz (Hz). Generally, the sampling chip provides its sampling reference through a built-in clock or an external crystal oscillator, which will be affected by device differences, temperature, time aging, etc., which will cause time drift. For example, for the electrocardiogram equipment, the heart rate acquisition chip in it has deviations, and the MCU (Microcontroller Unit) operation also has deviations, resulting in inconsistent time lengths for the same amount of sampling data, which will affect data acquisition due to inaccurate timing. Effect.

現有技術中的採樣率校正方式主要有兩種,一種方式是提供一種電路,通過時域差值的方式校正採樣率,具體地,該電路包括:第一電路回路,具有上/下計數器,配置其以接收輸入信號和回饋信號;以及加法器,配置其以接收來自上/下計數器的輸出信號,並且向上/下計數器輸出進位元輸出作為回饋信號;以及第二電路回路,配置其以傳輸來自加法器的和輸出到調製器,並且回饋來自調製器的輸出信號到加法器的輸入。然而該種方式需要增加硬體電路來校正採樣率,比較繁瑣。There are mainly two sampling rate correction methods in the prior art. One method is to provide a circuit to correct the sampling rate by means of time-domain difference. Specifically, the circuit includes: a first circuit loop with an up/down counter and a configuration It receives the input signal and the feedback signal; and the adder is configured to receive the output signal from the up/down counter, and the up/down counter outputs the carry output as the feedback signal; and the second circuit loop is configured to transmit the output signal from the The sum of the adder is output to the modulator, and the output signal from the modulator is fed back to the input of the adder. However, this method needs to increase the hardware circuit to correct the sampling rate, which is more complicated.

另一種方式是採用一種自動頻率校正方法,包括如下步驟: S1、對接收到的經過採樣的頻點為15.36MHZ,資料速率為61.44MHZ的數位信號進行下變頻抽取濾波,得到269.473K的GSM信號;S2、對GSM信號進行FCCH檢測獲取FCCH信號;S3、將FCCH資料擬合成直線的斜率並解調出輸出斜率;S4、將輸出斜率與理想斜率進行比較計算出斜率偏差值相應得到頻率偏差值;然後根據斜率偏差值通過查閱資料表得到同步控制電路的輸入資料並將輸入資料配置給同步控制電路;S5、同步控制電路根據輸入資料產生輸出電壓控制晶振時鐘脈衝CP實現頻率校正。該種方式先通過演算法計算出偏差,然後再控制電壓來控制晶振的時鐘進行校正,同樣也比較複雜,需要修改硬體電路。Another way is to use an automatic frequency correction method, which includes the following steps: S1. Perform down-conversion decimation filtering on the received digital signal with a sampled frequency of 15.36MHZ and a data rate of 61.44MHZ to obtain a 269.473K GSM signal ; S2, perform FCCH detection on the GSM signal to obtain the FCCH signal; S3, fit the FCCH data to the slope of the straight line and demodulate the output slope; S4, compare the output slope with the ideal slope, calculate the slope deviation value and obtain the corresponding frequency deviation value ; Then according to the slope deviation value, the input data of the synchronous control circuit is obtained by looking up the data table and the input data is configured to the synchronous control circuit; S5, the synchronous control circuit generates an output voltage according to the input data to control the crystal oscillator clock pulse CP to realize frequency correction. This method first calculates the deviation through an algorithm, and then controls the voltage to control the clock of the crystal oscillator for correction. It is also more complicated and requires modification of the hardware circuit.

針對現有技術中的問題,本發明的目的在於提供一種採樣率校正方法、系統、設備及儲存媒介,無需對硬體電路進行修改或增加,經過預測與校正,改善採樣時所產生的時間偏差,提高採樣精度。In view of the problems in the prior art, the purpose of the present invention is to provide a sampling rate correction method, system, equipment and storage medium, without modifying or adding hardware circuits, and after prediction and correction, to improve the time deviation generated during sampling, Improve sampling accuracy.

本發明實施例提供一種採樣率校正方法,包括如下步驟:統計一個校正週期內的採樣點數量,計算一個校正週期內的採樣時間;根據該校正週期開始時和結束時校正計時器的計時確定校正時間;根據所述採樣時間和校正時間確定該校正週期內的採樣偏差;根據所述採樣偏差的值對採樣資料進行校正。The embodiment of the present invention provides a sampling rate correction method, including the following steps: counting the number of sampling points in a correction period, calculating the sampling time in a correction period; determining the correction according to the timing of the correction timer at the beginning and end of the correction period Time; Determine the sampling deviation in the correction period according to the sampling time and the correction time; Correct the sampling data according to the value of the sampling deviation.

可選地,所述計算一個校正週期內的採樣時間,包括如下步驟:根據當前採樣率計算採樣週期的時間長度;將一個校正週期內的採樣點數量乘以一個採樣週期的時間長度,得到一個校正週期內的採樣時間。Optionally, the calculation of the sampling time in a calibration period includes the following steps: calculating the time length of the sampling period according to the current sampling rate; multiplying the number of sampling points in a calibration period by the time length of a sampling period to obtain a Sampling time within the calibration period.

可選地,所述統計一個校正週期內的採樣點數量之前,還包括如下步驟:于量測開始時,採集歷史偏差率和極限偏差率;根據歷史偏差率和極限偏差率預測校正週期。Optionally, before counting the number of sampling points in a calibration period, the method further includes the following steps: at the beginning of the measurement, collecting the historical deviation rate and the limit deviation rate; and predicting the correction period based on the historical deviation rate and the limit deviation rate.

可選地,所述根據歷史偏差率和極限偏差率預測校正週期,包括如下步驟:根據如下公式計算極限校正週期:極限校正週期=採樣週期/極限偏差值;根據如下公式計算預測校正週期:預測校正週期=極限校正週期*(極限偏差率/歷史偏差率)。Optionally, the prediction of the correction period based on the historical deviation rate and the limit deviation rate includes the following steps: calculate the limit correction period according to the following formula: limit correction period=sampling period/limit deviation value; calculate the predicted correction period according to the following formula: prediction Calibration period = limit calibration period * (limit deviation rate/historical deviation rate).

可選地,所述根據所述採樣時間和校正時間確定該校正週期內的採樣偏差之後,還包括如下步驟:判斷所述採樣偏差的絕對值是否大於等於第一預設閾值,如果是,則重新調整校正週期。Optionally, after the sampling deviation in the correction period is determined according to the sampling time and the correction time, the method further includes the following step: judging whether the absolute value of the sampling deviation is greater than or equal to a first preset threshold, and if so, then Re-adjust the calibration cycle.

可選地,所述重新調整校正週期,包括如下步驟:採用如下公式計算當前校正週期的偏差率:當前校正週期的偏差率=當前校正週期的偏差值/校正週期時長;採用如下公式重新計算調整後的校正週期:調整後的校正週期=1/(當前校正週期的採樣率*當前校正週期的偏差率),單位為秒。Optionally, the readjustment of the correction period includes the following steps: calculate the deviation rate of the current correction period using the following formula: deviation rate of the current correction period = deviation value of the current correction period/correction period duration; recalculate using the following formula Adjusted correction cycle: adjusted correction cycle = 1/(sampling rate of current correction cycle * deviation rate of current correction cycle), the unit is seconds.

可選地,根據所述採樣偏差的值對採樣資料進行校正,包括如下步驟:如果所述採樣時間大於所述校正時間,且所述採樣時間與所述校正時間的差值大於等於第二預設閾值,則從採樣資料中去除一個採樣點的資料;如果所述採樣時間小於所述校正時間,且所述校正時間與所述採樣時間的差值大於等於第二預設閾值,則在採樣資料中增加一個採樣點的資料。Optionally, correcting the sampling data according to the value of the sampling deviation includes the following steps: if the sampling time is greater than the correction time, and the difference between the sampling time and the correction time is greater than or equal to the second preset If the threshold is set, the data of one sampling point is removed from the sampling data; if the sampling time is less than the correction time, and the difference between the correction time and the sampling time is greater than or equal to the second preset threshold, then the sampling Add a sampling point to the data.

可選地,所述第二預設閾值為一個採樣週期。Optionally, the second preset threshold is one sampling period.

可選地,所述從採樣資料中去除一個採樣點的資料,包括去除該採樣週期中最後採集的一個採樣點的資料。Optionally, the removing the data of a sampling point from the sampling data includes removing the data of the last sampling point collected in the sampling period.

本發明實施例還提供一種採樣率校正系統,用於實現所述的採樣率校正方法,所述系統包括:偏差統計模組,用於統計一個校正週期內的採樣點數量,計算一個校正週期內的採樣時間,根據該校正週期開始時和結束時校正計時器的計時確定校正時間,以及根據所述採樣時間和校正時間確定該校正週期內的採樣偏差;偏差校正模組,用於根據所述採樣偏差的值對採樣資料進行校正。An embodiment of the present invention also provides a sampling rate correction system, which is used to implement the sampling rate correction method. The system includes: a deviation statistics module, used to count the number of sampling points in a correction period, and calculate the number of sampling points in a correction period. According to the sampling time of the calibration period, the calibration time is determined according to the timing of the calibration timer at the beginning and the end of the calibration period, and the sampling deviation in the calibration period is determined according to the sampling time and the calibration time; the deviation correction module is used to determine the sampling deviation in the calibration period according to the The value of the sampling deviation corrects the sampling data.

可選地,所述系統還包括:歷史記錄模組,用於記錄歷史偏差率;校正週期預測模組,用於在量測開始時,採集歷史偏差率和極限偏差率,並根據歷史偏差率和極限偏差率預測校正週期;校正週期調整模組,用於在採樣偏差的絕對值大於等於第一預設閾值時,重新調整校正週期。Optionally, the system further includes: a historical record module for recording historical deviation rates; a correction cycle prediction module for collecting historical deviation rates and limit deviation rates at the beginning of the measurement, and based on the historical deviation rates And the limit deviation rate prediction correction period; the correction period adjustment module is used to readjust the correction period when the absolute value of the sampling deviation is greater than or equal to the first preset threshold.

本發明實施例還提供一種採樣率校正設備,包括:處理器;記憶體,其中儲存有所述處理器的可執行指令;其中,所述處理器配置為經由執行所述可執行指令來執行所述的採樣率校正方法的步驟。An embodiment of the present invention also provides a sampling rate correction device, including: a processor; a memory, in which executable instructions of the processor are stored; wherein, the processor is configured to execute all of the executable instructions by executing the executable instructions. The steps of the sampling rate correction method described.

本發明實施例還提供一種電腦可讀儲存媒介,用於儲存程式,所述程式被執行時實現所述的採樣率校正方法的步驟。The embodiment of the present invention also provides a computer-readable storage medium for storing a program, which implements the steps of the sampling rate correction method when the program is executed.

應當理解的是,以上的一般描述和後文的細節描述僅是示例性和解釋性的,並不能限制本公開。It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure.

本發明所提供的採樣率校正方法、系統、設備及儲存媒介具有下列優點:The sampling rate correction method, system, equipment and storage medium provided by the present invention have the following advantages:

本發明無需修改或增加硬體電路,經過採樣率校正,改善了採樣時所產生的時間偏差,提高了採樣精度,經過實驗證明可以大大提升採樣率的準確性並且穩定無漂移,該方法可以適應於不同晶片的差異性,能夠在保證採樣資料的精度的同時也保證資料的準確性。進一步地,本發明可以通過動態調整校正週期,優化校正操作對微控制單元的資源的消耗。The invention does not need to modify or increase the hardware circuit. After sampling rate correction, the time deviation generated during sampling is improved, and the sampling accuracy is improved. The experiment proves that the accuracy of the sampling rate can be greatly improved, and the method is stable without drift. Due to the difference of different chips, it can ensure the accuracy of the sampling data while also ensuring the accuracy of the data. Further, the present invention can dynamically adjust the correction period to optimize the consumption of the resources of the micro-control unit by the correction operation.

為了對本發明之上述及其他方面有更佳的瞭解,下文特舉實施例,並配合所附圖式詳細說明如下:In order to have a better understanding of the above and other aspects of the present invention, the following specific examples are given in conjunction with the accompanying drawings to describe in detail as follows:

現在將參考附圖更全面地描述示例實施方式。然而,示例實施方式能夠以多種形式實施,且不應被理解為限於在此闡述的範例;相反,提供這些實施方式使得本公開將更加全面和完整,並將示例實施方式的構思全面地傳達給本領域的技術人員。所描述的特徵、結構或特性可以以任何合適的方式結合在一個或更多實施方式中。Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various forms, and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concept of the example embodiments will be fully conveyed to Those skilled in the art. The described features, structures or characteristics can be combined in one or more embodiments in any suitable way.

此外,附圖僅為本公開的示意性圖解,並非一定是按比例繪製。圖中相同的附圖標記表示相同或類似的部分,因而將省略對它們的重複描述。附圖中所示的一些方框圖是功能實體,不一定必須與物理或邏輯上獨立的實體相對應。可以採用軟體形式來實現這些功能實體,或在一個或多個硬體模組或積體電路中實現這些功能實體,或在不同網路和/或處理器裝置和/或微控制器裝置中實現這些功能實體。In addition, the drawings are only schematic illustrations of the present disclosure, and are not necessarily drawn to scale. The same reference numerals in the figures denote the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in the form of software, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and/or processor devices and/or microcontroller devices These functional entities.

如第1圖所示,在本發明一實施例中,本發明提出了一種採樣率校正方法,包括如下步驟:As shown in Figure 1, in an embodiment of the present invention, the present invention proposes a sampling rate correction method, which includes the following steps:

S100:統計一個校正週期內的採樣點數量,計算一個校正週期內的採樣時間;S100: Count the number of sampling points in a calibration period, and calculate the sampling time in a calibration period;

S200:根據該校正週期開始時和結束時校正計時器的計時確定校正時間,所述校正計時器可以為微控制單元內部的RTC(即時時鐘),也可以是微控制單元外接的時鐘;S200: Determine the correction time according to the timing of the correction timer at the start and end of the correction period. The correction timer may be an RTC (real-time clock) inside the micro-control unit or a clock external to the micro-control unit;

S300:根據所述採樣時間和校正時間確定該校正週期內的採樣偏差,具體地,採樣偏差=採樣時間-校正時間,由於採樣模組在採樣時,偏差也會存在波動,本發明根據當前校正週期中的累計偏差值及時修正偏差,並且在下一校正週期中重新對偏差值進行累計,避免偏差重複累計;S300: Determine the sampling deviation in the correction period according to the sampling time and the correction time. Specifically, the sampling deviation=sampling time-correction time. Since the sampling module is sampling, the deviation will also fluctuate. The present invention is based on the current correction The cumulative deviation value in the cycle corrects the deviation in time, and re-accumulates the deviation value in the next calibration period to avoid repeated accumulation of the deviation;

S400:根據所述採樣偏差的值對採樣資料進行校正。S400: Correct the sampling data according to the value of the sampling deviation.

現有技術中的採樣資料處理的流程一般為:採樣模組根據採樣率採集資料,將採集的原始採樣資料發送給採樣處理器模組,採樣處理器模組接收到採樣處理模組後,進行採樣資料儲存。The sampling data processing process in the prior art is generally: the sampling module collects data according to the sampling rate, sends the collected original sampling data to the sampling processor module, and the sampling processor module performs sampling after receiving the sampling processing module Data storage.

而本發明在現有技術的基礎上,增加了採樣率校正方法,在基於微控制單元的採樣處理器模組接收到原始採樣資料之後,按照校正週期和採樣偏差對原始採樣資料進行校正,得到校正後採樣資料,然後再進行儲存。On the basis of the prior art, the present invention adds a sampling rate correction method. After the sampling processor module based on the micro-control unit receives the original sampling data, the original sampling data is corrected according to the correction period and the sampling deviation to obtain the correction. After sampling the data, then save it.

具體地,本發明通過步驟S100~S300計算採樣偏差,並通過步驟S400對採樣資料進行校正,在計算採樣偏差時,可以採用採樣處理器模組自帶或外接的計時器作為校正計時器,作為計時參考,從而無需修改或增加硬體電路,經過採樣率校正,改善了採樣時所產生的時間偏差,提高了採樣精度,該方法可以適應於不同晶片的差異性,能夠在保證採樣資料的精度的同時也保證資料的準確性。Specifically, the present invention calculates the sampling deviation through steps S100 to S300, and corrects the sampling data through step S400. When calculating the sampling deviation, a timer built in or connected to the sampling processor module can be used as the correction timer. Timing reference, so there is no need to modify or add hardware circuits. After sampling rate correction, the time deviation generated during sampling is improved, and the sampling accuracy is improved. This method can adapt to the differences of different chips and can ensure the accuracy of sampling data. At the same time, it also guarantees the accuracy of the information.

如第2圖所示,在該實施例中,所述步驟S100:計算一個校正週期內的採樣時間,包括如下步驟:As shown in Figure 2, in this embodiment, the step S100: calculating the sampling time in a calibration period includes the following steps:

S110:根據當前採樣率計算採樣週期的時間長度,採樣週期=1/採樣率,單位為s,例如,當前採樣率為500,則採樣週期為0.002s,即2ms;S110: Calculate the time length of the sampling period according to the current sampling rate, the sampling period=1/sampling rate, the unit is s, for example, if the current sampling rate is 500, the sampling period is 0.002s, that is, 2ms;

S120:將一個校正週期內的採樣點數量乘以一個採樣週期的時間長度,得到一個校正週期內的採樣時間,例如,一個校正週期內的採樣點數量為330個,採樣週期為2ms,一個校正週期內的採樣時間為330*2ms=660ms。S120: Multiply the number of sampling points in a calibration period by the length of a sampling period to obtain the sampling time in a calibration period. For example, the number of sampling points in a calibration period is 330, the sampling period is 2ms, and one calibration period is The sampling time in the cycle is 330*2ms=660ms.

如果在當前校正週期開始前,校正計時器的計時為0,當前校正週期結束時,校正計時器的計時為652ms,則校正時間為652ms,則採樣時間和校正時間的差值為660ms-652ms=8ms。If the calibration timer counts as 0 before the current calibration cycle starts, and when the current calibration cycle ends, the calibration timer counts as 652ms, then the calibration time is 652ms, and the difference between the sampling time and the calibration time is 660ms-652ms= 8ms.

在實際應用中,採樣偏差可能會發生變化,需要累計偏差來修正預測的校正週期,並將累計偏差進行記錄,以及根據累計偏差預測後續測量的校正週期。具體地,如第2圖所示,在該實施例中,所述步驟S100:統計一個校正週期內的採樣點數量之前,還包括預測校正週期,具體地,包括如下步驟:In practical applications, the sampling deviation may change, the cumulative deviation is required to correct the predicted correction period, the cumulative deviation is recorded, and the correction period for subsequent measurements is predicted based on the cumulative deviation. Specifically, as shown in Figure 2, in this embodiment, the step S100: before counting the number of sampling points in a correction period, it further includes predicting the correction period, specifically including the following steps:

于量測開始時,採集歷史偏差率和極限偏差率,其中歷史偏差率指的是根據歷史記錄資料計算得到的同一採樣模組的歷史偏差率,例如,可以採用前一次量測時每個校正週期的偏差率的平均值,極限偏差率可以通過採樣模組的產品說明或者實驗資料得到,指的是在最差情況下採樣模組的偏差率,偏差率的定義為一定時間t內的偏差值與該一定時間t的比值;At the beginning of the measurement, the historical deviation rate and the limit deviation rate are collected. The historical deviation rate refers to the historical deviation rate of the same sampling module calculated based on the historical record data. For example, each calibration in the previous measurement can be used The average value of the cycle deviation rate. The limit deviation rate can be obtained from the product description or experimental data of the sampling module. It refers to the deviation rate of the sampling module in the worst case. The deviation rate is defined as the deviation within a certain time t The ratio of the value to the certain time t;

根據歷史偏差率和極限偏差率預測校正週期。The correction period is predicted based on the historical deviation rate and the limit deviation rate.

在該實施例中,所述根據歷史偏差率和極限偏差率預測校正週期,包括如下步驟:In this embodiment, predicting the correction period based on the historical deviation rate and the limit deviation rate includes the following steps:

根據如下公式計算極限校正週期:Calculate the limit correction period according to the following formula:

極限校正週期=採樣週期/極限偏差值;Limit correction period=sampling period/limit deviation value;

根據如下公式計算預測校正週期:Calculate the forecast correction period according to the following formula:

預測校正週期=極限校正週期*(極限偏差率/歷史偏差率)。Forecast correction period = limit correction period * (limit deviation rate/historical deviation rate).

例如,在一實例中,採樣率為每秒鐘500次採樣,採樣週期為2ms,極限偏差率為3%,根據前一次量測記錄的歷史資料所得到的歷史偏差率為0.3%。計算得到極限校正週期為2/0.03=66ms,而預測校正週期為66ms*(3%/0.3%)=660ms。則當前次量測第一個校正週期的時間長度即為660ms。在設備初次使用而沒有歷史偏差率時,採用極限校正週期作為預測校正週期。For example, in an example, the sampling rate is 500 samples per second, the sampling period is 2 ms, and the limit deviation rate is 3%. The historical deviation rate obtained from the historical data recorded in the previous measurement is 0.3%. The calculated limit correction period is 2/0.03=66ms, and the predicted correction period is 66ms*(3%/0.3%)=660ms. Then the time length of the first calibration cycle of the current measurement is 660ms. When the device is used for the first time and there is no historical deviation rate, the limit correction period is used as the predicted correction period.

在採用採樣率校正方法時,採樣偏差也會存在波動,根據當前校正週期內的偏差值,需要動態調整校正週期,及時校正採樣資料偏差。具體地,如第2圖所示,在該實施例中,所述步驟S300:根據所述採樣時間和校正時間確定該校正週期內的採樣偏差之後,還包括如下步驟:When the sampling rate correction method is adopted, the sampling deviation will also fluctuate. According to the deviation value in the current correction period, the correction period needs to be dynamically adjusted to correct the deviation of the sampling data in time. Specifically, as shown in Figure 2, in this embodiment, the step S300: after determining the sampling deviation in the correction period according to the sampling time and the correction time, the method further includes the following steps:

判斷所述採樣偏差的絕對值是否大於等於第一預設閾值,如果是,則重新調整校正週期。此處第一預設閾值為預設的一個容許偏差閾值,具體數值可以根據需要設定,例如,設定第一預設閾值的數值為兩個採樣週期,即4ms。Determine whether the absolute value of the sampling deviation is greater than or equal to the first preset threshold, and if so, readjust the correction period. Here, the first preset threshold is a preset allowable deviation threshold, and the specific value can be set as required. For example, the value of the first preset threshold is set to two sampling periods, that is, 4 ms.

而在上面的例子中,採樣時間為660ms,校正時間為652ms,差值為8ms>4ms,則需要重新調整校正週期。在其他的實施例中,如果採樣時間小於校正時間,且採樣偏差的絕對值大於等於第一預設閾值,也需要重新調整校正週期。如果採樣時間和校正時間的差值的絕對值小於第一預設閾值,則當前不對校正週期進行調整。In the above example, the sampling time is 660ms, the correction time is 652ms, and the difference is 8ms>4ms, and the correction period needs to be re-adjusted. In other embodiments, if the sampling time is less than the correction time and the absolute value of the sampling deviation is greater than or equal to the first preset threshold, the correction period also needs to be re-adjusted. If the absolute value of the difference between the sampling time and the correction time is less than the first preset threshold, the correction period is not currently adjusted.

在該實施例中,所述重新調整校正週期,包括如下步驟:In this embodiment, the readjustment of the correction period includes the following steps:

採用如下公式計算當前校正週期的偏差率:Use the following formula to calculate the deviation rate of the current calibration cycle:

當前校正週期的偏差率=當前校正週期的偏差值/校正週期時長;The deviation rate of the current calibration period = the deviation value of the current calibration period/the length of the calibration period;

採用如下公式重新計算調整後的校正週期:Use the following formula to recalculate the adjusted correction period:

調整後的校正週期=1/(當前校正週期的採樣率*當前校正週期的偏差率),單位為秒。例如,當前校正週期的採樣率為500,當前校正週期的偏差率為8ms/660ms,則計算得到的調整後的校正週期為1/(500*(8/660)=0.165s,即165ms。The adjusted correction period = 1/(sampling rate of the current correction period * deviation rate of the current correction period), in seconds. For example, if the sampling rate of the current calibration cycle is 500, and the deviation rate of the current calibration cycle is 8ms/660ms, the adjusted calibration cycle obtained by calculation is 1/(500*(8/660)=0.165s, that is, 165ms.

因此,本發明的採樣率校正方法通過預測校正週期,並在每個校正週期校正採樣資料,改善採樣時所產生的時間偏差,提高採樣精度,同時通過動態調整校正週期,優化校正操作帶來的微控制單元資源開支。Therefore, the sampling rate correction method of the present invention predicts the correction period and corrects the sampling data in each correction period to improve the time deviation generated during sampling and improve the sampling accuracy. At the same time, the correction period is dynamically adjusted to optimize the correction operation. Micro control unit resource expenditure.

如第3圖所示,在該實施例中,所述步驟S400:根據所述採樣偏差的值對採樣資料進行校正,包括如下步驟:As shown in Figure 3, in this embodiment, the step S400: correcting the sampling data according to the value of the sampling deviation includes the following steps:

S410:判斷所述採樣時間是否大於所述校正時間,如果是,則繼續步驟S420,否則繼續步驟S440;S410: Determine whether the sampling time is greater than the correction time, if yes, proceed to step S420, otherwise proceed to step S440;

S420:判斷所述採樣時間與所述校正時間的差值是否大於等於第二預設閾值,如果是,則繼續步驟S430,否則繼續步驟S460;S420: Determine whether the difference between the sampling time and the correction time is greater than or equal to a second preset threshold, if yes, proceed to step S430, otherwise proceed to step S460;

S430:即採樣時間大於校正時間,且採樣時間與校正時間的差值大於第二預設閾值,採用去值法校正採樣資料,即從採樣資料中去除一個採樣點的資料;S430: That is, the sampling time is greater than the correction time, and the difference between the sampling time and the correction time is greater than the second preset threshold, the sampling data is corrected by the de-value method, that is, the data of one sampling point is removed from the sampling data;

S440:判斷所述校正時間與所述採樣時間的差值是否大於等於第二閾值,如果是,則繼續步驟S450,否則繼續步驟S460;S440: Determine whether the difference between the correction time and the sampling time is greater than or equal to a second threshold, if yes, proceed to step S450, otherwise proceed to step S460;

S450:即採樣時間小於校正時間,且校正時間與採樣時間的差值大於第二預設閾值,採用插值法校正採樣資料,即在採樣資料中增加一個採樣點的資料;S450: That is, the sampling time is less than the correction time, and the difference between the correction time and the sampling time is greater than the second preset threshold, the sampling data is corrected by interpolation, that is, the data of a sampling point is added to the sampling data;

S460:不對所述採樣資料進行校正。S460: Do not correct the sampling data.

如第4圖和第5圖示出了採用去值法和插值法校正採樣資料的示意圖。第4圖和第5圖中,曲線A表示心電圖採樣資料波形,時間軸B表示校正時間。第4圖中,時間軸C表示採樣資料1,時間軸D表示採樣資料2,其中時間軸C中採樣過快,採用去值法將第11個採樣點去除,得到第5圖中的時間軸C’, 第4圖中的時間軸D採樣過慢,採用插值法,新增第10個採樣點,得到第5圖中的時間軸D’。Figures 4 and 5 show the schematic diagrams of correcting sampled data by de-value method and interpolation method. In Figures 4 and 5, curve A represents the waveform of the ECG sampled data, and the time axis B represents the correction time. In Figure 4, the time axis C represents sampling data 1, and the time axis D represents sampling data 2. The sampling in time axis C is too fast, and the 11th sampling point is removed by the de-value method to obtain the time axis in Figure 5. C', the time axis D in Figure 4 is too slow to sample. Interpolation is used and the 10th sampling point is added to obtain the time axis D'in Figure 5.

此處,第二預設閾值的數值可以根據需要選擇,例如可以選擇為一個採樣週期的時間長度等。Here, the value of the second preset threshold can be selected as required, for example, can be selected as the time length of a sampling period.

在該實施例中,所述步驟S430中,從採樣資料中去除一個採樣點的資料,包括去除該採樣週期中最後採集的一個採樣點的資料,即優先保留在先採集的採樣資料,將最後採集的採樣資料去除。In this embodiment, in the step S430, removing the data of a sampling point from the sampling data includes removing the data of the last sampling point collected in the sampling period, that is, the sampling data collected first is preferentially retained, and the last sampling data The collected sampling data is removed.

如第6圖所示,本發明實施例還提供一種採樣率校正系統,用於實現所述的採樣率校正方法,所述系統包括:As shown in Figure 6, an embodiment of the present invention also provides a sampling rate correction system for implementing the sampling rate correction method, the system includes:

偏差統計模組M100,用於統計一個校正週期內的採樣點數量,計算一個校正週期內的採樣時間,根據該校正週期開始時和結束時校正計時器的計時確定校正時間,以及根據所述採樣時間和校正時間確定該校正週期內的採樣偏差;The deviation statistics module M100 is used to count the number of sampling points in a correction period, calculate the sampling time in a correction period, determine the correction time according to the timing of the correction timer at the beginning and end of the correction period, and according to the sampling Time and calibration time determine the sampling deviation within the calibration period;

偏差校正模組M200,用於根據所述採樣偏差的值對採樣資料進行校正。The deviation correction module M200 is used to correct the sampling data according to the value of the sampling deviation.

因此,本發明的採樣率校正系統通過偏差統計模組M100計算採樣偏差,並通過偏差校正模組M200對採樣資料進行校正,在計算採樣偏差時,可以採用採樣處理器模組自帶或外接的計時器作為校正計時器,作為計時參考,從而無需修改或增加硬體電路,經過採樣率校正,改善了採樣時所產生的時間偏差,提高了採樣精度,該方法可以適應於不同晶片的差異性,能夠在保證採樣資料的精度的同時也保證資料的準確性。Therefore, the sampling rate correction system of the present invention calculates the sampling deviation through the deviation statistics module M100, and corrects the sampling data through the deviation correction module M200. When calculating the sampling deviation, the sampling processor module itself or an external device can be used. The timer is used as a correction timer and as a timing reference, so there is no need to modify or add hardware circuits. After sampling rate correction, the time deviation generated during sampling is improved, and the sampling accuracy is improved. This method can be adapted to the differences of different chips. , To ensure the accuracy of the sampling data while also ensuring the accuracy of the data.

在該實施例中,所述採樣率校正系統還用於在每次量測開始時對校正週期進行預測,因此,所述系統還包括:In this embodiment, the sampling rate correction system is also used to predict the correction period at the beginning of each measurement. Therefore, the system further includes:

歷史記錄模組M300,用於記錄歷史偏差率,例如記錄前一次量測時的各個校正週期的偏差率,然後計算平均值,作為歷史偏差率;The historical record module M300 is used to record the historical deviation rate, for example, record the deviation rate of each calibration period in the previous measurement, and then calculate the average value as the historical deviation rate;

校正週期預測模組M400,用於在量測開始時,採集歷史偏差率和極限偏差率,並根據歷史偏差率和極限偏差率預測校正週期,具體地,可以採用上述採樣率校正方法的具體實施例中校正週期的預測方法來實現。The correction period prediction module M400 is used to collect the historical deviation rate and the limit deviation rate at the beginning of the measurement, and predict the correction period according to the historical deviation rate and the limit deviation rate. Specifically, the specific implementation of the above sampling rate correction method can be used In the example, the prediction method of the correction period is realized.

進一步地,所述採樣率校正系統還用於在每個校正週期之後判斷是否需要調整校正週期。具體地,所述系統還包括校正週期調整模組M500,用於在採樣偏差的絕對值大於等於第一預設閾值時,重新調整校正週期,重新調整方式可以採用上述採樣率校正方法的具體實施例中調整方法來實現。Further, the sampling rate correction system is also used for judging whether the correction period needs to be adjusted after each correction period. Specifically, the system further includes a correction period adjustment module M500, which is used to readjust the correction period when the absolute value of the sampling deviation is greater than or equal to the first preset threshold. The re-adjustment method can adopt the specific implementation of the above-mentioned sampling rate correction method. In the example, adjust the method to achieve.

因此,本發明的採樣率校正系統通過預測校正週期,並在每個校正週期校正採樣資料,改善採樣時所產生的時間偏差,提高採樣精度,同時通過動態調整校正週期,優化校正操作帶來的微控制單元資源開支。Therefore, the sampling rate correction system of the present invention predicts the correction period and corrects the sampling data in each correction period to improve the time deviation generated during sampling and improve the sampling accuracy. At the same time, it dynamically adjusts the correction period to optimize the correction operation. Micro control unit resource expenditure.

本發明實施例還提供一種採樣率校正設備,包括處理器;記憶體,其中儲存有所述處理器的可執行指令;其中,所述處理器配置為經由執行所述可執行指令來執行所述的採樣率校正方法的步驟。An embodiment of the present invention also provides a sampling rate correction device, including a processor; a memory, in which executable instructions of the processor are stored; wherein, the processor is configured to execute the executable instructions by executing the executable instructions. The steps of the sampling rate correction method.

所屬技術領域的技術人員能夠理解,本發明的各個方面可以實現為系統、方法或程式產品。因此,本發明的各個方面可以具體實現為以下形式,即:完全的硬體實施方式、完全的軟體實施方式(包括固件、微代碼等),或硬體和軟體方面結合的實施方式,這裡可以統稱為“電路”、“模組”或“平臺”。Those skilled in the art can understand that various aspects of the present invention can be implemented as a system, a method, or a program product. Therefore, various aspects of the present invention can be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software. Collectively referred to as "circuits", "modules" or "platforms".

下面參照第7圖來描述根據本發明的這種實施方式的電子設備600。第7圖顯示的電子設備600僅僅是一個示例,不應對本發明實施例的功能和使用範圍帶來任何限制。The electronic device 600 according to this embodiment of the present invention will be described below with reference to FIG. 7. The electronic device 600 shown in FIG. 7 is only an example, and should not bring any limitation to the function and application scope of the embodiment of the present invention.

如第7圖所示,電子設備600以通用計算設備的形式表現。電子設備600的元件可以包括但不限於:至少一個處理單元610、至少一個儲存單元620、連接不同平臺元件(包括儲存單元620和處理單元610)的匯流排630、顯示單元640等。As shown in Figure 7, the electronic device 600 is represented in the form of a general-purpose computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus bar 630 connecting different platform components (including the storage unit 620 and the processing unit 610), a display unit 640, and the like.

其中,所述儲存單元儲存有程式碼,所述程式碼可以被所述處理單元610執行,使得所述處理單元610執行本說明書上述電子處方流轉處理方法部分中描述的根據本發明各種示例性實施方式的步驟。例如,所述處理單元610可以執行如第1圖中所示的步驟。Wherein, the storage unit stores program codes, and the program codes can be executed by the processing unit 610, so that the processing unit 610 executes the various exemplary implementations of the present invention described in the above-mentioned electronic prescription circulation processing method section of this specification. Way steps. For example, the processing unit 610 may execute the steps shown in Figure 1.

所述儲存單元620可以包括易失性儲存單元形式的可讀介質,例如隨機存取儲存單元(RAM)6201和/或快取記憶體儲存單元6202,還可以進一步包括唯讀儲存單元(ROM)6203。The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 6201 and/or a cache storage unit 6202, and may further include a read-only storage unit (ROM) 6203.

所述儲存單元620還可以包括具有一組(至少一個)程式模組6205的程式/實用工具6204,這樣的程式模組6205包括但不限於:作業系統、一個或者多個應用程式、其它程式模組以及程式資料,這些示例中的每一個或某種組合中可能包括網路環境的實現。The storage unit 620 may also include a program/utility tool 6204 having a set (at least one) program module 6205. Such program module 6205 includes but is not limited to: an operating system, one or more application programs, and other program modules. Groups and program data, each of these examples or some combination may include the realization of the network environment.

匯流排630可以為表示幾類匯流排結構中的一種或多種,包括儲存單元匯流排或者儲存單元控制器、週邊匯流排、圖形加速埠、處理單元或者使用多種匯流排結構中的任意匯流排結構的局域匯流排。The bus 630 can represent one or more of several types of bus structures, including a storage unit bus or a storage unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or any bus structure using multiple bus structures Local bus.

電子設備600也可以與一個或多個外部設備700(例如鍵盤、指向設備、藍牙設備等)通信,還可與一個或者多個使得使用者能與該電子設備600交互的設備通信,和/或與使得該電子設備600能與一個或多個其它計算設備進行通信的任何設備(例如路由器、數據機等等)通信。這種通信可以通過輸入/輸出(I/O)介面650進行。並且,電子設備600還可以通過網路介面卡660與一個或者多個網路(例如局域網(LAN),廣域網路(WAN)和/或公共網路,例如網際網路)通信。網路介面卡660可以通過匯流排630與電子設備600的其它模組通信。應當明白,儘管圖中未示出,可以結合電子設備600使用其它硬體和/或軟體模組,包括但不限於:微代碼、裝置驅動程式、冗餘處理單元、外部磁片驅動陣列、RAID系統、磁帶驅動器以及資料備份儲存平臺等。The electronic device 600 can also communicate with one or more external devices 700 (such as keyboards, pointing devices, Bluetooth devices, etc.), and can also communicate with one or more devices that enable a user to interact with the electronic device 600, and/or Communicate with any device (eg, router, modem, etc.) that enables the electronic device 600 to communicate with one or more other computing devices. This communication can be performed through an input/output (I/O) interface 650. In addition, the electronic device 600 may also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through a network interface card 660. The network interface card 660 can communicate with other modules of the electronic device 600 through the bus 630. It should be understood that although not shown in the figure, other hardware and/or software modules can be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID System, tape drive and data backup storage platform, etc.

本發明實施例還提供一種電腦可讀儲存媒介,用於儲存程式,所述程式被執行時實現所述的採樣率校正方法的步驟。在一些可能的實施方式中,本發明的各個方面還可以實現為一種程式產品的形式,其包括程式碼,當所述程式產品在終端設備上運行時,所述程式碼用於使所述終端設備執行本說明書上述電子處方流轉處理方法部分中描述的根據本發明各種示例性實施方式的步驟。The embodiment of the present invention also provides a computer-readable storage medium for storing a program, which implements the steps of the sampling rate correction method when the program is executed. In some possible implementation manners, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code. When the program product runs on a terminal device, the program code is used to make the terminal The device executes the steps according to various exemplary embodiments of the present invention described in the above-mentioned electronic prescription circulation processing method section of this specification.

參考第8圖所示,描述了根據本發明的實施方式的用於實現上述方法的程式產品800,其可以採用可擕式緊湊盤唯讀記憶體(CD-ROM)並包括程式碼,並可以在終端設備,例如個人電腦上運行。然而,本發明的程式產品不限於此,在本檔中,可讀儲存媒介可以是任何包含或儲存程式的有形介質,該程式可以被指令執行系統、裝置或者器件使用或者與其結合使用。With reference to Figure 8, a program product 800 for implementing the above method according to an embodiment of the present invention is described. It can use a portable compact disk read-only memory (CD-ROM) and include program codes, and can Run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited to this. In this document, the readable storage medium can be any tangible medium that contains or stores a program. The program can be used by or combined with an instruction execution system, device, or device.

所述程式產品可以採用一個或多個可讀介質的任意組合。可讀介質可以是可讀信號介質或者可讀儲存媒介。可讀儲存媒介例如可以為但不限於電、磁、光、電磁、紅外線、或半導體的系統、裝置或器件,或者任意以上的組合。可讀儲存媒介的更具體的例子(非窮舉的列表)包括:具有一個或多個導線的電連接、可擕式盤、硬碟、隨機存取記憶體(RAM)、唯讀記憶體(ROM)、可擦式可程式設計唯讀記憶體(EPROM或快閃記憶體)、光纖、可擕式緊湊盤唯讀記憶體(CD-ROM)、光記憶體件、磁記憶體件、或者上述的任意合適的組合。The program product can use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination of any of the above. More specific examples (non-exhaustive list) of readable storage media include: electrical connections with one or more wires, portable disks, hard drives, random access memory (RAM), read-only memory ( ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical memory, magnetic memory, or Any suitable combination of the above.

所述電腦可讀儲存媒介可以包括在基帶中或者作為載波一部分傳播的資料信號,其中承載了可讀程式碼。這種傳播的資料信號可以採用多種形式,包括但不限於電磁信號、光信號或上述的任意合適的組合。可讀儲存媒介還可以是可讀儲存媒介以外的任何可讀介質,該可讀介質可以發送、傳播或者傳輸用於由指令執行系統、裝置或者器件使用或者與其結合使用的程式。可讀儲存媒介上包含的程式碼可以用任何適當的介質傳輸,包括但不限於無線、有線、光纜、RF等等,或者上述的任意合適的組合。The computer-readable storage medium may include a data signal propagated in baseband or as a part of a carrier wave, which carries readable program codes. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. The readable storage medium may also be any readable medium other than the readable storage medium, and the readable medium can send, propagate, or transmit a program for use by or in combination with the instruction execution system, apparatus, or device. The program code contained on the readable storage medium can be transmitted by any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.

可以以一種或多種程式設計語言的任意組合來編寫用於執行本發明操作的程式碼,所述程式設計語言包括物件導向的程式設計語言—諸如Java、C++等,還包括常規的過程式程式設計語言—諸如“C”語言或類似的程式設計語言。程式碼可以完全地在使用者計算設備上執行、部分地在使用者設備上執行、作為一個獨立的套裝軟體執行、部分在使用者計算設備上部分在遠端計算設備上執行、或者完全在遠端計算設備或伺服器上執行。在涉及遠端計算設備的情形中,遠端計算設備可以通過任意種類的網路,包括局域網(LAN)或廣域網路(WAN),連接到使用者計算設備,或者,可以連接到外部計算設備(例如利用網際網路服務提供者來通過網際網路連接)。The programming code used to perform the operations of the present invention can be written in any combination of one or more programming languages. The programming languages include object-oriented programming languages—such as Java, C++, etc., as well as conventional procedural programming. Language-such as "C" language or similar programming language. The code can be executed entirely on the user's computing device, partly on the user's device, executed as a stand-alone software package, partly on the user's computing device and partly executed on the remote computing device, or completely remotely executed. On the end computing device or server. In the case of a remote computing device, the remote computing device can be connected to a user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device ( For example, use an Internet service provider to connect via the Internet).

本發明所提供的採樣率校正方法、系統、設備及儲存媒介具有下列優點:The sampling rate correction method, system, equipment and storage medium provided by the present invention have the following advantages:

本發明無需修改或增加硬體電路,經過採樣率校正,改善了採樣時所產生的時間偏差,提高了採樣精度,經過實驗證明可以大大提升採樣率的準確性並且穩定無漂移,該方法可以適應於不同晶片的差異性,能夠在保證採樣資料的精度的同時也保證資料的準確性。進一步地,本發明可以通過動態調整校正週期,優化校正操作對微控制單元的資源的消耗。The invention does not need to modify or increase the hardware circuit. After sampling rate correction, the time deviation generated during sampling is improved, and the sampling accuracy is improved. The experiment proves that the accuracy of the sampling rate can be greatly improved, and the method is stable without drift. Due to the difference of different chips, it can ensure the accuracy of the sampling data while also ensuring the accuracy of the data. Further, the present invention can dynamically adjust the correction period to optimize the consumption of the resources of the micro-control unit by the correction operation.

以上內容是結合具體的優選實施方式對本發明所作的進一步詳細說明,不能認定本發明的具體實施只局限於這些說明。對於本發明所屬技術領域的普通技術人員來說,在不脫離本發明構思的前提下,還可以做出若干簡單推演或替換,都應當視為屬於本發明的保護範圍。The above content is a further detailed description of the present invention in conjunction with specific preferred embodiments, and it cannot be considered that the specific implementation of the present invention is limited to these descriptions. For those of ordinary skill in the technical field to which the present invention belongs, a number of simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.

綜上所述,雖然本發明已以實施例揭露如上,然其並非用以限定本發明。本發明所屬技術領域中具有通常知識者,在不脫離本發明之精神和範圍內,當可作各種之更動與潤飾。因此,本發明之保護範圍當視後附之申請專利範圍所界定者為準。In summary, although the present invention has been disclosed in the above embodiments, it is not intended to limit the present invention. Those with ordinary knowledge in the technical field of the present invention can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention shall be subject to those defined by the attached patent scope.

S100,S110,S120,S200,S300,S400,S410,S420,S430,S440,S450,S460:步驟 A:曲線 B,C,D,C’,D’:時間軸 M100:偏差統計模組 M200:偏差校正模組 M300:歷史紀錄模組 M400:校正週期預測模組 M500:校正週期調整模組 600:電子設備 610:處理單元 620:儲存單元 6201:RAM 6202:快速暫存 6203:ROM 6204:程式/實用工具 6205:程式模組 630:匯流排 640:顯示單元 650:I/O介面 660:網路介面卡 700:外部設備 800:程式產品S100, S110, S120, S200, S300, S400, S410, S420, S430, S440, S450, S460: steps A: Curve B,C,D,C’,D’: Timeline M100: Deviation Statistics Module M200: Deviation correction module M300: History module M400: Calibration cycle prediction module M500: Calibration cycle adjustment module 600: electronic equipment 610: Processing Unit 620: storage unit 6201: RAM 6202: Fast temporary storage 6203: ROM 6204: Programs/Utilities 6205: program module 630: Bus 640: display unit 650: I/O interface 660: network interface card 700: External device 800: program products

通過閱讀參照以下附圖對非限制性實施例所作的詳細描述,本發明的其它特徵、目的和優點將會變得更明顯。 第1圖是本發明一實施例的採樣率校正方法的流程圖; 第2圖是本發明一具體實例的採樣率校正方法的流程圖; 第3圖是本發明一實施例的採樣資料校正的流程圖; 第4圖和第5圖是本發明一實施例的去值法和插值法校正的示意圖; 第6圖是本發明一實施例的採樣率校正系統的結構示意圖; 第7圖是本發明一實施例的採樣率校正設備的結構示意圖; 第8圖是本發明一實施例的電腦可讀儲存媒介的結構示意圖。By reading the detailed description of the non-limiting embodiments with reference to the following drawings, other features, purposes and advantages of the present invention will become more apparent. Figure 1 is a flowchart of a sampling rate correction method according to an embodiment of the present invention; Figure 2 is a flowchart of a sampling rate correction method of a specific example of the present invention; Figure 3 is a flowchart of sampling data correction according to an embodiment of the present invention; Figures 4 and 5 are schematic diagrams of correction by de-value method and interpolation method according to an embodiment of the present invention; Figure 6 is a schematic structural diagram of a sampling rate correction system according to an embodiment of the present invention; Figure 7 is a schematic structural diagram of a sampling rate correction device according to an embodiment of the present invention; FIG. 8 is a schematic diagram of the structure of a computer-readable storage medium according to an embodiment of the present invention.

S100,S200,S300,S400:步驟S100, S200, S300, S400: steps

Claims (13)

一種採樣率校正方法,包括: 統計一個校正週期內的採樣點數量,計算一個校正週期內的採樣時間; 根據該校正週期開始時和結束時校正計時器的計時確定校正時間; 根據所述採樣時間和校正時間確定該校正週期內的採樣偏差; 根據所述採樣偏差的值對採樣資料進行校正。A sampling rate correction method, including: Count the number of sampling points in a calibration period and calculate the sampling time in a calibration period; Determine the correction time according to the timing of the correction timer at the beginning and end of the correction period; Determine the sampling deviation in the correction period according to the sampling time and the correction time; The sampling data is corrected according to the value of the sampling deviation. 如請求項1所述之採樣率校正方法,所述計算一個校正週期內的採樣時間,包括: 根據當前採樣率計算採樣週期的時間長度; 將一個校正週期內的採樣點數量乘以一個採樣週期的時間長度,得到一個校正週期內的採樣時間。According to the sampling rate correction method described in claim 1, the calculation of the sampling time in one correction period includes: Calculate the time length of the sampling period according to the current sampling rate; Multiply the number of sampling points in a calibration period by the time length of a sampling period to obtain the sampling time in a calibration period. 如請求項1所述之採樣率校正方法,所述統計一個校正週期內的採樣點數量之前,還包括: 于量測開始時,採集歷史偏差率和極限偏差率; 根據歷史偏差率和極限偏差率預測校正週期。As the sampling rate correction method described in claim 1, before counting the number of sampling points in a correction period, the method further includes: At the beginning of the measurement, the historical deviation rate and the limit deviation rate are collected; The correction period is predicted based on the historical deviation rate and the limit deviation rate. 如請求項3所述之採樣率校正方法,所述根據歷史偏差率和極限偏差率預測校正週期,包括: 根據如下公式計算極限校正週期: 極限校正週期=採樣週期/極限偏差值; 根據如下公式計算預測校正週期: 預測校正週期=極限校正週期*(極限偏差率/歷史偏差率)。According to the sampling rate correction method described in claim 3, the prediction of the correction period based on the historical deviation rate and the limit deviation rate includes: Calculate the limit correction period according to the following formula: Limit correction period=sampling period/limit deviation value; Calculate the forecast correction period according to the following formula: Forecast correction period = limit correction period * (limit deviation rate/historical deviation rate). 如請求項3所述之採樣率校正方法,所述根據所述採樣時間和校正時間確定該校正週期內的採樣偏差之後,還包括: 判斷所述採樣偏差的絕對值是否大於等於第一預設閾值,如果是,則重新調整校正週期。According to the sampling rate correction method of claim 3, after the sampling deviation in the correction period is determined according to the sampling time and the correction time, the method further includes: Determine whether the absolute value of the sampling deviation is greater than or equal to the first preset threshold, and if so, readjust the correction period. 如請求項4所述之採樣率校正方法,所述重新調整校正週期,包括: 採用如下公式計算當前校正週期的偏差率: 當前校正週期的偏差率=當前校正週期的偏差值/校正週期時長; 採用如下公式重新計算調整後的校正週期: 調整後的校正週期=1/(當前校正週期的採樣率*當前校正週期的偏差率),單位為秒。According to the sampling rate correction method described in claim 4, the re-adjustment of the correction period includes: Use the following formula to calculate the deviation rate of the current calibration cycle: The deviation rate of the current calibration period = the deviation value of the current calibration period/the length of the calibration period; Use the following formula to recalculate the adjusted correction period: The adjusted correction period = 1/(sampling rate of the current correction period * deviation rate of the current correction period), in seconds. 如請求項1所述之採樣率校正方法,根據所述採樣偏差的值對採樣資料進行校正,包括: 如果所述採樣時間大於所述校正時間,且所述採樣時間與所述校正時間的差值大於等於第二預設閾值,則從採樣資料中去除一個採樣點的資料; 如果所述採樣時間小於所述校正時間,且所述校正時間與所述採樣時間的差值大於等於第二預設閾值,則在採樣資料中增加一個採樣點的資料。According to the sampling rate correction method described in claim 1, correcting the sampling data according to the value of the sampling deviation, including: If the sampling time is greater than the correction time, and the difference between the sampling time and the correction time is greater than or equal to a second preset threshold, removing data at one sampling point from the sampling data; If the sampling time is less than the correction time, and the difference between the correction time and the sampling time is greater than or equal to a second preset threshold, then one sampling point data is added to the sampling data. 如請求項7所述之採樣率校正方法,所述第二預設閾值為一個採樣週期。According to the sampling rate correction method described in claim 7, the second preset threshold is one sampling period. 如請求項7所述之採樣率校正方法,所述從採樣資料中去除一個採樣點的資料,包括去除該採樣週期中最後採集的一個採樣點的資料。According to the sampling rate correction method described in claim 7, the removing the data of a sampling point from the sampling data includes removing the data of the last sampling point collected in the sampling period. 一種採樣率校正系統,用於實現請求項1至9中任一項所述的採樣率校正方法,所述系統包括: 偏差統計模組,用於統計一個校正週期內的採樣點數量,計算一個校正週期內的採樣時間,根據該校正週期開始時和結束時校正計時器的計時確定校正時間,以及根據所述採樣時間和校正時間確定該校正週期內的採樣偏差; 偏差校正模組,用於根據所述採樣偏差的值對採樣資料進行校正。A sampling rate correction system, which is used to implement the sampling rate correction method described in any one of request items 1 to 9, the system comprising: The deviation statistics module is used to count the number of sampling points in a correction period, calculate the sampling time in a correction period, determine the correction time according to the timing of the correction timer at the beginning and end of the correction period, and according to the sampling time And the calibration time to determine the sampling deviation in the calibration period; The deviation correction module is used to correct the sampling data according to the value of the sampling deviation. 如請求項10所述之採樣率校正系統,所述系統還包括: 歷史記錄模組,用於記錄歷史偏差率; 校正週期預測模組,用於在量測開始時,採集歷史偏差率和極限偏差率,並根據歷史偏差率和極限偏差率預測校正週期; 校正週期調整模組,用於在採樣偏差的絕對值大於等於第一預設閾值時,重新調整校正週期。According to the sampling rate correction system of claim 10, the system further includes: Historical record module, used to record historical deviation rate; The correction cycle prediction module is used to collect the historical deviation rate and the limit deviation rate at the beginning of the measurement, and predict the correction period based on the historical deviation rate and the limit deviation rate; The correction period adjustment module is used to readjust the correction period when the absolute value of the sampling deviation is greater than or equal to the first preset threshold. 一種採樣率校正設備,包括: 處理器; 記憶體,其中儲存有所述處理器的可執行指令; 其中,所述處理器配置為經由執行所述可執行指令來執行請求項1至9中任一項所述的採樣率校正方法的步驟。A sampling rate correction device, including: processor; A memory in which executable instructions of the processor are stored; Wherein, the processor is configured to execute the steps of the sampling rate correction method according to any one of request items 1 to 9 by executing the executable instructions. 一種電腦可讀儲存媒介,用於儲存程式,所述程式被執行時實現請求項1至9中任一項所述的採樣率校正方法的步驟。A computer-readable storage medium is used to store a program, and when the program is executed, the steps of the sampling rate correction method described in any one of request items 1 to 9 are realized.
TW109118730A 2020-04-20 2020-06-04 Sampling rate correction method, system, apparatus and storage medium TWI747311B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010313012.5 2020-04-20
CN202010313012.5A CN111443641B (en) 2020-04-20 2020-04-20 Sampling rate correction method, system, device and storage medium

Publications (2)

Publication Number Publication Date
TW202141055A true TW202141055A (en) 2021-11-01
TWI747311B TWI747311B (en) 2021-11-21

Family

ID=71653409

Family Applications (1)

Application Number Title Priority Date Filing Date
TW109118730A TWI747311B (en) 2020-04-20 2020-06-04 Sampling rate correction method, system, apparatus and storage medium

Country Status (2)

Country Link
CN (1) CN111443641B (en)
TW (1) TWI747311B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115793988B (en) * 2023-01-30 2023-06-16 苏州识光芯科技术有限公司 Dynamic adjustment method, device and equipment for storage space and storage medium
CN116820014B (en) * 2023-08-24 2023-11-14 山西交通科学研究院集团有限公司 Intelligent monitoring and early warning method and system for traffic electromechanical equipment

Family Cites Families (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7369637B1 (en) * 2004-06-04 2008-05-06 Altera Corporation Adaptive sampling rate converter
US7479912B1 (en) * 2007-09-13 2009-01-20 Texas Instruments Incorporated Low-power high-performance audio DAC system including internal oscillator, FIFO memory, and ASRC
CN101286969B (en) * 2008-06-05 2012-10-17 复旦大学 Timing error correcting device for orthogonal frequency division multiplexing based on changeable delay
US10213164B2 (en) * 2008-09-26 2019-02-26 Qualcomm Incorporated Method and apparatus for under-sampled acquisition and transmission of photoplethysmograph (PPG) data and reconstruction of full band PPG data at the receiver
CN101645611B (en) * 2009-07-22 2012-10-03 天津市电力公司 Self-adaptive re-sampling method for digital relay protection device
CN101718562B (en) * 2009-11-20 2011-04-20 电子科技大学 Method for real-time correcting error of multi-channel high-speed parallel alternative acquisition system
CN101924577B (en) * 2010-09-02 2013-05-01 上海交通大学 Time slot synchronization method for resisting sampling clock frequency deviation in WCDMA (Wideband Code Division Multiple Access) system
CN102255864B (en) * 2011-08-30 2013-05-29 豪威科技(上海)有限公司 Low-complexity general sampling recovery method and device
CN103197108B (en) * 2013-03-25 2015-11-25 大连理工常州研究院有限公司 The equivalent sampling method of data collecting card
US9172454B2 (en) * 2013-11-01 2015-10-27 Magnolia Broadband Inc. Method and system for calibrating a transceiver array
CN103901292A (en) * 2013-12-04 2014-07-02 国家电网公司 Data sampling interpolation method
CN104393872B (en) * 2014-11-17 2018-01-16 大唐微电子技术有限公司 A kind of sampling time error bearing calibration of multi-channel parallel ADC system
CN105281860B (en) * 2015-06-16 2018-01-16 南京智汇电力技术有限公司 A kind of synchronous data sampling method based on ethernet passive optical network
CN106209103B (en) * 2016-07-29 2019-09-24 电子科技大学 The bearing calibration of TIADC gain and time error based on spectrum analysis
US10215555B2 (en) * 2016-09-16 2019-02-26 Apple Inc. Motion sensing by monitoring intensity of light redirected by an intensity pattern
CN107181583A (en) * 2017-04-25 2017-09-19 国电南瑞科技股份有限公司 The method that sampling value synchronization is realized based on Sampling interrupt event
CN109150180B (en) * 2018-05-11 2022-06-28 天津大学 Correction method for sampling time mismatch of dual-channel time-interleaved ADC (analog to digital converter)
CN110460337A (en) * 2019-08-13 2019-11-15 刘涛 A kind of high-speed sampling and reconstructing method
CN110730147B (en) * 2019-09-26 2021-05-04 南京东科优信网络安全技术研究院有限公司 Physical layer equipment feature extraction method and device based on sampling rate deviation estimation
CN111024554A (en) * 2019-12-11 2020-04-17 中国科学院苏州生物医学工程技术研究所 Measuring circuit, measuring equipment and measuring method of vibrating viscoelastic sensor

Also Published As

Publication number Publication date
TWI747311B (en) 2021-11-21
CN111443641A (en) 2020-07-24
CN111443641B (en) 2021-03-02

Similar Documents

Publication Publication Date Title
TWI747311B (en) Sampling rate correction method, system, apparatus and storage medium
JP6169547B2 (en) Method and apparatus for managing global chip power of multi-core system on chip
US9430444B2 (en) Iteratively calculating standard deviation for streamed data
WO2007073632A1 (en) Method for reducing power consumption of processor
WO2018103391A1 (en) Clock skew correction method, device and system
WO2022021650A1 (en) Step counting method, step counting device, and computer readable storage medium
US20090182534A1 (en) Accurate measurement and monitoring of computer systems
US9207738B2 (en) Data processing device with adjustable performance level and method of operating such device
CN110928229B (en) Wire feeder control method, controller and storage medium
CN114708987A (en) Method, device, equipment and medium for predicting epidemic situation morbidity based on period
JP5372315B2 (en) Telemeter system slave station equipment
WO2017192342A1 (en) Initial and periodic slowdowns for background connections
EP2730133B1 (en) Technique for maintaining a radio time base
WO2021238272A1 (en) Data retention time calculation method, apparatus, and device
TWI573018B (en) Information processing device and information processing method
CN110908486B (en) Control method, system and equipment for server multi-phase power supply
JP5356343B2 (en) Crawl device and method
JP2013031239A (en) Charging completion time estimation method
CN108990137B (en) Access control method of NTP server and wearable device
CN103227707A (en) Synchronization processing apparatus, synchronization processing method and program
Wardi et al. On-line optimization of switched-mode systems: Algorithms and convergence properties
CN117201364A (en) Network link delay reporting method and device, storage medium and electronic equipment
CN115442244B (en) Method and device for calibrating communication interval in power real-time simulation and related equipment
EP3934175B1 (en) Anomaly detection method and anomaly detection program
JP5661806B2 (en) Digital clock regenerator