Statistical-based fast high-precision AD sampling method and device and storage medium
By using statistical methods to obtain and combine the most frequently sampled AD values, and calculating the total frequency to determine the sampling results at the intermediate position, the problems of large computational load and low accuracy in existing technologies are solved, and AD sampling with stability and resource saving is achieved.
Patent Information
- Application Number
- CN202211375288.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-04
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2042-11-04
AI Technical Summary
The existing AD sampling method for charging piles uses second-order filtering calculation, which results in a large amount of computation and low accuracy, especially when sampling at a medium scale, which leads to a serious waste of computing resources.
A statistical method was used to obtain the N highest frequency AD sample values from the sampled data, combine them into several data groups, calculate the total frequency, and take the AD sample value in the middle position as the result.
It improves the stability and accuracy of AD sampling values, reduces the consumption of computing resources, has good anti-interference ability, and prevents single-point problems from affecting the sampling results.
Smart Images

Figure CN115659125B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the technical field of AD sampling, in particular to a fast high-precision AD sampling method and device based on statistics and a storage medium. BACKGROUND
[0002] Most of the AD sampling methods of existing charging piles adopt a second-order filtering calculation mode to ensure precision, but the current second-order filtering calculation mode not only causes a large amount of calculation, wastes certain calculation resources, but also has a slightly large deviation.
[0003] Among them, Figure 1 and Figure 2 are sampling result statistics charts of 512 times of 10-bit AD sampling, and it can be seen from observation that the AD sampling has a module that tends to 705 frequency. In the calculation mode in the prior art, each point is multiplied by the current number of occurrences, and then divided by the total number of sampling. The average value obtained by this method is designed into a floating-point operation, and the up and down fluctuation deviation is relatively large, and the output result is: Figure 1 The sampling value obtained by the second-order filtering calculation mode is 704.4566; Figure 2 The sampling value obtained by the second-order filtering calculation mode is 705.8636.
[0004] As can be seen from the above output result, the difference between the two calculation results is large, and this is the value after using calculation to reduce error twice. For this phenomenon, only when the sampling data amount is extremely large can the result be constant and accurate. The sampling frequency ratio of the medium-scale sampling amount is easy to change, thereby affecting the sampling output.
[0005] Therefore, when the sampling number is medium, for example, 512 or 1024 times, the second-order filtering calculation mode not only causes a large amount of calculation, wastes certain calculation resources, but also has low output result precision. SUMMARY
[0006] The application aims to overcome the shortcomings of the prior art and provide a fast high-precision AD sampling method and device based on statistics and a storage medium.
[0007] In a first aspect, a fast high-precision AD sampling method based on statistics is provided, comprising:
[0008] Obtaining sampling data, wherein the sampling data comprises an AD sampling value and a sampling frequency;
[0009] Counting N AD sampling values with the highest sampling frequency ranking in the sampling data, wherein N is an integer greater than 2.
[0010] combining X adjacent AD sampling values in the N AD sampling values as a group of data to form a plurality of groups of data, wherein X is an odd number greater than 1;
[0011] accumulating effective sampling frequencies in the plurality of groups of data to obtain a plurality of total frequencies;
[0012] taking an AD sampling value at a middle position in a group with the largest frequency in the plurality of total frequencies as a sampling result.
[0013] Further, the N AD sampling values with the highest sampling frequency ranking in the sampling data are counted, comprising:
[0014] sorting AD sampling values in the sampling data in order of sampling frequency from high to low;
[0015] selecting N AD sampling values at the front of the sorting.
[0016] Further, combining X adjacent AD sampling values in the N AD sampling values as a group of data, comprising:
[0017] extracting a single AD sampling value in the N AD sampling values;
[0018] extracting the top K AD sampling values and the last K AD sampling values of the single AD sampling value; extracting the top K AD sampling values and the last K AD sampling values of the single AD sampling value;
[0019] counting the single AD sampling value, the top K AD sampling values of the single AD sampling value, and the last K AD sampling values of the single AD sampling value, and corresponding sampling frequencies thereof as a group of data.
[0020] Further, accumulating effective sampling frequencies in the plurality of groups of data to obtain a plurality of total frequencies, comprising:
[0021] extracting all AD sampling values in the group of data;
[0022] judging whether the above all AD sampling values are in the N AD sampling values with the highest sampling frequency ranking;
[0023] in response to the AD sampling value being in the N AD sampling values with the highest sampling frequency ranking, counting an effective sampling frequency of the AD sampling value as the corresponding sampling frequency, and in response to the AD sampling value not being in the N AD sampling values with the highest sampling frequency ranking, counting the effective sampling frequency of the AD sampling value as 0;
[0024] The effective sampling frequencies corresponding to all AD sampling values in the group of data are accumulated to obtain a total frequency of the group of data;
[0025] The total frequencies of the groups of data are counted together to obtain a plurality of total frequencies.
[0026] In a second aspect, a fast and high-precision AD sampling device based on statistics is provided, comprising:
[0027] An acquisition module is configured to acquire sampling data, wherein the sampling data comprises AD sampling values and sampling frequencies;
[0028] A statistics module is configured to count N AD sampling values with the highest sampling frequency ranking in the sampling data, wherein N is an integer greater than 2;
[0029] A combination module is configured to combine X adjacent AD sampling values in the N AD sampling values as a group of data to form a plurality of groups of data, wherein X is an odd number greater than 1;
[0030] A calculation module is configured to accumulate the effective sampling frequencies in the plurality of groups of data to obtain a plurality of total frequencies;
[0031] An output module is configured to take an AD sampling value located in the middle position in a group of data with the largest frequency in the plurality of total frequencies as a sampling result.
[0032] Further, the statistics module comprises:
[0033] An ordering sub-module is configured to order the AD sampling values in the sampling data according to the sampling frequencies from high to low;
[0034] A selection sub-module is configured to select the N AD sampling values in the front.
[0035] Further, the combination module comprises:
[0036] A first extraction sub-module is configured to extract a single AD sampling value in the N AD sampling values;
[0037] A second extraction sub-module is configured to extract the top AD sampling values and the bottom AD sampling values of the single AD sampling value;
[0038] A combination sub-module is configured to count the single AD sampling value, the top AD sampling values of the single AD sampling value, and the bottom AD sampling values of the single AD sampling value and their corresponding sampling frequencies as a group of data.
[0039] Further, the calculation module comprises:
[0040] a third extraction sub-module configured to extract all AD sampling values in the group of data;
[0041] a judgment sub-module configured to judge whether all the AD sampling values are in the N AD sampling values with the highest sampling frequency ranking;
[0042] an effective sampling frequency determination sub-module configured to, in response to the AD sampling value being in the N AD sampling values with the highest sampling frequency ranking, count the effective sampling frequency of the AD sampling value as the sampling frequency corresponding to the AD sampling value, and in response to the AD sampling value not being in the N AD sampling values with the highest sampling frequency ranking, count the effective sampling frequency of the AD sampling value as 0;
[0043] an accumulation sub-module configured to accumulate the effective sampling frequencies of all the AD sampling values in the group of data together to obtain the total frequency of the group of data;
[0044] a statistics sub-module configured to accumulate the total frequencies of the groups of data together to obtain the total frequencies.
[0045] In a third aspect, a computer readable storage medium is provided, the computer readable medium storing program codes for execution by a device, the program codes comprising steps for executing the method in any one of the implementation manners of the first aspect.
[0046] In a fourth aspect, an electronic device is provided, the electronic device comprising a processor, a memory, and a program or instructions stored on the memory and executable on the processor, the program or instructions being executed by the processor to implement the steps of the method in any one of the implementation manners of the first aspect.
[0047] The present application has the following beneficial effects: the AD sampling values obtained by the method are relatively stable, in a medium-scale sampling, the use of the calculation method can ensure the stability of the system, and since the method does not involve any multiplication and division calculation, but only involves basic addition and subtraction, the calculation is convenient, and the chip operation only occupies a small resource, in addition, the method has good anti-interference ability for fixed points, when a certain point has a very high single sampling frequency, but if the sampling around this point is very low, it actually does not conform to the characteristics of normal distribution, so by taking the values of the highest N groups and not taking the values of the other groups, the single sampling jitter interference is well filtered, and the single point problem does not easily affect the final sampling result, so that the sampling output result is more accurate. BRIEF DESCRIPTION OF DRAWINGS
[0048] The accompanying drawings, which form a part of the present application, are included to provide a further understanding of the present application, and are incorporated herein for explanation by referring to the figures in conjunction with descriptions of the present application.
[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly introduced. Obviously, the drawings described below only constitute some of the embodiments of the present application, and all other drawings obtained by those of ordinary skill in the art without creative effort based on these drawings also belong to the scope of protection of the present application.
[0050] Figure 1 is a line graph of the sampling result of the first 10-bit AD sampling 512 times;
[0051] Figure 2 is a line graph of the sampling result of the second 10-bit AD sampling 512 times;
[0052] Figure 3 is a flow chart of the statistical-based fast high-precision AD sampling method of the embodiment one of the present application;
[0053] Figure 4 is a flow chart of the calculation of the total frequency in the statistical-based fast high-precision AD sampling method of the embodiment one of the present application;
[0054] Figure 5 is a structural block diagram of the statistical-based fast high-precision AD sampling device of the embodiment two of the present application.
[0055] Reference signs:
[0056] 1, acquisition module; 2, statistical module; 201, sorting sub-module; 202, selection sub-module; 3, combination module; 301, first extraction sub-module; 302, second extraction sub-module; 303, combination sub-module; 4, calculation module; 401, third extraction sub-module; 402, judgment sub-module; 403, effective sampling frequency determination sub-module; 404, accumulation sub-module; 405, statistical sub-module; 5, output module. DETAILED DESCRIPTION
[0057] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments only constitute some of the embodiments of the present application, and not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort also belong to the scope of protection of the present application.
[0058] Embodiment one
[0059] The application embodiment one relates to a kind of based on statistics' fast high-precision AD sampling method, comprising: obtaining sampling data, wherein, sampling data includes AD sampling value and sampling frequency;The N AD sampling values of highest ranking in the sampling frequency in the sampling data are counted out, wherein, N is the integer greater than 2;AD sampling value adjacent X AD sampling value in the N AD sampling value is combined as a group of data, to form several groups of data, wherein, X is the odd number greater than 1;The effective sampling frequency in the several groups of data is accumulated to obtain several total frequencies;The AD sampling value in the middle position in the group with maximum frequency in several total frequencies is taken as sampling result, the AD sampling value obtained by the method is relatively more stable, in the sampling of medium scale, using this calculation mode can guarantee the stability of system, and, since the method does not involve any multiplication and division calculation, only involves basic addition and subtraction, it is convenient to calculate, and only a small amount of resources is occupied to chip operation, in addition, the method is better for the anti-interference ability of fixed point, when a certain point has very high single sampling frequency, but if this sampling is surrounded by other low sampling, it is actually not in line with the characteristics of normal distribution, so by taking the value of the highest N groups, other values are not taken, the single sampling jitter interference is well filtered, and single point problem is not easy to affect the final sampling result, so that the sampling output result is more accurate.
[0060] Specifically, Figure 3 The flow chart of the based on statistics' fast high-precision AD sampling method in the application embodiment one is shown, comprising:
[0061] S101, obtaining sampling data, wherein, sampling data includes AD sampling value and sampling frequency;
[0062] Exemplarily, Figure 1 And Figure 2 The sampling result statistics chart of twice 10-bit AD sampling 512 times, for this, 10-bit AD sampling value and its corresponding sampling frequency in Figure 1 And Figure 2 Can be obtained:
[0063] Figure 1 : 0-700 is 15 times, 701 is 59 times, 702 is 33 times, 703 is 38 times, 704 is 100 times, 705 is 136 times, 706 is 55 times, 707 is 28 times, 708 is 7 times, 709 is 21 times, 710 is 4 times and 711-1023 is 16 times;
[0064] Figure 2: 0-700 is 16 times, 701 is 20 times, 702 is 25 times, 703 is 38 times, 704 is 61 times, 705 is 100 times, 706 is 62 times, 707 is 50 times, 708 is 36 times, 709 is 20 times, 710 is 72 times, and 711-1023 is 12 times.
[0065] S102, count the N AD sampling values with the highest sampling frequency in the sampling data, wherein N is an integer greater than 2;
[0066] Specifically, the counting of the N AD sampling values with the highest sampling frequency in the sampling data comprises:
[0067] Sorting the AD sampling values in the sampling data according to the sampling frequency from high to low;
[0068] Selecting the N AD sampling values at the front of the sorting.
[0069] As a preferred example, N=6, Figure 1 In the example, the six AD sampling values with the highest sampling frequency are: 705 is 136 times, 704 is 100 times, 701 is 59 times, 706 is 55 times, 703 is 38 times, and 702 is 33 times.
[0070] Figure 2 In the example, the six AD sampling values with the highest sampling frequency are: 705 is 100 times, 710 is 72 times, 706 is 62 times, 704 is 61 times, 707 is 50 times, and 703 is 38 times.
[0071] S103, combining X adjacent AD sampling values in the N AD sampling values into a group of data to form a plurality of groups of data, wherein X is an odd number greater than 1;
[0072] Specifically, the combining of X adjacent AD sampling values in the N AD sampling values into a group of data comprises:
[0073] Extracting a single AD sampling value from the N AD sampling values;
[0074] Extracting the top AD sampling values and the last AD sampling values of the single AD sampling value;
[0075] Counting the single AD sampling value, the top AD sampling values of the single AD sampling value, and the last AD sampling values of the single AD sampling value and their corresponding sampling frequencies as a group of data.
[0076] As preferred, taking X=3 as an example, In Figure 1 , 6 groups of data can be formed, which are respectively: the first group is 700-702, the second group is 701-703, the third group is 702-704, the fourth group is 703-705, the fifth group is 704-706, and the sixth group is 705-707;
[0077] It should be noted that the first group is with 701 as the middle value, and takes the AD sampling value 700 before 701 and the AD sampling value 702 after 701; the second group is with 702 as the middle value, and takes the AD sampling value 701 before 702 and the AD sampling value 703 after 702; the selection rules of the third group, the fourth group, the fifth group and the sixth group are the same as those of the first group and the second group, which will not be repeated here;
[0078] Still taking X=3 as an example, In Figure 2 , 6 groups of data can be formed, which are respectively: the first group is 702-704, the second group is 703-705, the third group is 704-706, the fourth group is 705-707, the fifth group is 706-708, and the sixth group is 709-711;
[0079] It should be noted that the first group is with 703 as the middle value, and takes the AD sampling value 702 before 703 and the AD sampling value 704 after 703; the second group is with 704 as the middle value, and takes the AD sampling value 703 before 704 and the AD sampling value 705 after 704; the selection rules of the third group, the fourth group, the fifth group and the sixth group are the same as those of the first group and the second group, which will not be repeated here.
[0080] It should be noted that the above-mentioned middle values are all sampling values in the six AD sampling values with the highest sampling frequency.
[0081] S104, accumulate the effective sampling frequencies in the plurality of groups of data to obtain a plurality of total frequencies;
[0082] Among them, the effective sampling frequency refers to the sampling frequency corresponding to the AD sampling value in the N AD sampling values with the highest sampling frequency ranking, and the effective sampling frequency of the AD sampling value not in the N AD sampling values with the highest sampling frequency ranking is 0.
[0083] Specifically, please refer to Figure 4 The effective sampling frequencies in the several groups of data are accumulated to obtain several total frequencies, including:
[0084] S401, extracting all AD sampling values in the group of data;
[0085] S402, judging whether all AD sampling values are in the N AD sampling values with the highest sampling frequency ranking;
[0086] S403, in response to the AD sampling value being in the N AD sampling values with the highest sampling frequency ranking, counting the effective sampling frequency of the AD sampling value as the corresponding sampling frequency, and in response to the AD sampling value not being in the N AD sampling values with the highest sampling frequency ranking, counting the effective sampling frequency of the AD sampling value as 0;
[0087] S404, accumulating the effective sampling frequencies corresponding to all AD sampling values in the group of data to obtain the total frequency of the group of data;
[0088] S405, counting the total frequencies of several groups of data together to obtain several total frequencies.
[0089] Exemplarily, Figure 1 The calculation process of the several total frequencies is as follows:
[0090] The first group (700-702): total frequency = 0+59+33=92, wherein the frequency corresponding to 700 is not ranked in the top six, so the effective sampling frequency corresponding to the AD sampling value 700 is 0, the frequencies corresponding to 701 and 702 are both ranked in the top six, so the effective sampling frequencies corresponding to 701 and 702 are 59 and 33 respectively;
[0091] The second group (701-703): total frequency = 59+33+38=130;
[0092] The third group (702-704): total frequency = 33+38+100=171;
[0093] The fourth group (703-705): total frequency = 38+100+136=274;
[0094] The fifth group (704-706): total frequency = 100+136+55=291;
[0095] Group 6 (705-707): Total frequency = 136 + 55 + 0 = 191. Among them, the frequency corresponding to 707 is not in the top six, so the effective sampling frequency corresponding to AD sampling value 707 is 0. The frequencies corresponding to 705 and 706 are both in the top six. Therefore, the effective sampling frequencies corresponding to 705 and 706 are 136 and 55 respectively (which can prevent high-frequency discrete interference, that is, prevent certain interference from causing a certain frequency to deviate too high, but the two surrounding frequencies are not high, which is not in line with the normal distribution).
[0096] Figure 2 The calculation process for several total frequencies is as follows:
[0097] Group 1 (702-704): Total frequency = 0 + 38 + 61 = 99. Among them, the frequency corresponding to 702 is not in the top six, so the effective sampling frequency corresponding to AD sample value 702 is 0. The frequencies corresponding to 703 and 704 are both in the top six. Therefore, the effective sampling frequencies corresponding to 703 and 704 are 38 and 61 respectively.
[0098] Group 2 (703-705): Total frequency = 38 + 61 + 100 = 199;
[0099] Group 3 (704-706): Total frequency = 61 + 100 + 62 = 223;
[0100] Group 4 (705-707): Total frequency = 100 + 62 + 50 = 212;
[0101] Group 5 (706-708): Total frequency = 62 + 50 + 0 = 112;
[0102] Group 6 (709-711): Total frequency = 0 + 72 + 0 = 72. Among them, the frequencies corresponding to 709 and 711 are not ranked in the top six, so the effective sampling frequency corresponding to AD sampling values 709 and 711 is 0. The frequency corresponding to 710 is ranked in the top six, so the effective sampling frequency corresponding to 710 is 72.
[0103] S105. Take the AD sample value located in the middle of the group with the highest frequency among several total frequencies as the sampling result.
[0104] For example, in Figure 1 The group with the highest total frequency is the fifth group (704-706), whose AD sampling value in the middle position is 705. Therefore, Figure 1 The AD sample value output after calculation by this method is 705;
[0105] exist Figure 2 The group with the highest total frequency is the third group (704-706), and its AD sample value, which is in the middle, is also 705. Therefore...Figure 2 The AD sampling value output after the calculation of the method is 705;
[0106] When N=6 and X=3, the effect is better, which can ensure the accuracy of the AD sampling value and relatively small operation amount.
[0107] Figure 1 and Figure 2 The AD sampling value obtained after the method is the same, wherein the AD sampling module conforms to the normal distribution rule, so the probability of sampling the result near the true value is relatively large. According to the statistical point of view, after a large number of sampling processes, the distribution will conform to the normal distribution process. Therefore, the true value of the current sampling can be determined by using the statistical method to take the maximum sampling degree. As can be seen, the AD sampling value obtained by the method is relatively stable. In the medium-scale sampling, using this calculation method can ensure the stability of the system. In addition, the method does not involve any multiplication and division calculation, but only involves basic addition and subtraction, which is convenient for calculation and only occupies a small amount of chip operation resources. In addition, the method has good anti-interference ability for fixed points. When a certain point has a very high single sampling frequency, but if the sampling around this point is very low, it does not conform to the characteristics of the normal distribution. Therefore, by taking the value of the highest N groups and not taking the value of the other groups, the single sampling jitter interference is well filtered, and the single point problem does not easily affect the final sampling result, so that the sampling output result is more accurate.
[0108] Embodiment two
[0109] Please refer to Figure 4 The embodiment two of the application relates to a kind of based on statistics' fast high-precision AD sampling device, comprising:
[0110] The acquisition module 1 is used to acquire sampling data, wherein the sampling data includes AD sampling value and sampling frequency.
[0111] The statistical module 2 is used to count the N AD sampling values with the highest sampling frequency in the sampling data, wherein N is an integer greater than 2.
[0112] Specifically, the statistical module 2 comprises:
[0113] The sorting submodule 201 is used to sort the AD sampling values in the sampling data according to the sampling frequency from high to low.
[0114] The selection submodule 202 is used to select the N AD sampling values in the front of the sorting.
[0115] Combination module 3 is used to combine X adjacent AD sampling values from the N AD sampling values into a group of data to form several groups of data, where X is an odd number greater than 1;
[0116] Specifically, the combined module 3 includes:
[0117] The first extraction submodule 301 is used to extract a single AD sample value from N AD sample values;
[0118] The second extraction submodule 302 is used to extract the top-ranking values of the individual AD sample values. Each AD sample value and its ranking One AD sample value;
[0119] Combination submodule 303 is used to combine the individual AD sample values and the top-ranked individual AD sample values. Each AD sample value and the ranking of the individual AD sample values. Each AD sample value and its corresponding sampling frequency constitutes a set of data.
[0120] Calculation module 4 is used to accumulate the effective sampling frequencies in the several sets of data to obtain several total frequencies;
[0121] Specifically, the calculation module 4 includes:
[0122] The third extraction submodule 401 is used to extract all AD sample values from the set of data;
[0123] The judgment submodule 402 is used to determine whether all the above AD sample values are among the N AD sample values with the highest sampling frequency ranking;
[0124] The effective sampling frequency determination submodule 403, in response to the AD sampling value being among the N AD sampling values with the highest sampling frequency ranking, counts the effective sampling frequency of the AD sampling value as its corresponding sampling frequency; in response to the AD sampling value not being among the N AD sampling values with the highest sampling frequency ranking, counts the effective sampling frequency of the AD sampling value as 0.
[0125] The accumulation submodule 404 is used to accumulate the effective sampling frequencies corresponding to all AD sample values in the set of data to obtain the total frequency of the set of data.
[0126] The statistics submodule 405 is used to combine the total frequencies of several sets of data to obtain several total frequencies.
[0127] Output module 5 is used to take the AD sample value located in the middle position of the group with the highest frequency among several total frequencies as the sampling result.
[0128] Embodiment three
[0129] The embodiment three of the present application relates to a computer readable storage medium, the computer readable medium stores program codes for device execution, the program codes include steps for executing the method in any one of the implementation manners in the embodiment one of the present application;
[0130] The computer readable storage medium can be a read only memory (ROM), a static storage device, a dynamic storage device or a random access memory (RAM). The computer readable storage medium can store program codes, and when the program stored in the computer readable storage medium is executed by a processor, the processor is used to execute the steps of the method in any one of the implementation manners in the embodiment one of the present application.
[0131] Embodiment four
[0132] The embodiment four of the present application relates to an electronic device, the electronic device includes a processor, a memory and a program or instructions stored on the memory and executable on the processor, and the program or instructions are executed by the processor to implement the method in any one of the implementation manners in the embodiment one of the present application.
[0133] The processor can be a general central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), a graphics processing unit (GPU) or one or more integrated circuits, and is used to execute related programs to implement the method in any one of the implementation manners in the embodiment one of the present application.
[0134] The processor can also be an integrated circuit electronic device with signal processing capability. In the implementation process, each step of the method in any one of the implementation manners in the embodiment one of the present application can be completed by the integrated logic circuit of hardware or the instruction in the form of software in the processor.
[0135] The above processor can also be a general processor, a digital signal processor, an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can be any conventional processor. The steps of the method disclosed in the embodiments of the present application can be directly embodied as hardware code processor execution or executed by hardware and software module combination in the code processor. The software module can be located in the random access memory, the flash memory, the read only memory, the programmable read only memory or the electrically erasable programmable memory, the register or the mature storage medium in the art. The storage medium is located in the memory, the processor reads the information in the memory, combines the hardware to complete the function required by the unit in the data processing device of the embodiments of the present application, or executes the method in any one of the implementation manners in the embodiments of the present application.
[0136] The above is only the preferred specific embodiment of the present application; however, the protection scope of the present application is not limited to this. Any skilled person in the art can make equivalent replacement or change according to the technical range disclosed in the present application and the improvement concept of the technical solution and the embodiments of the present application, which should be covered in the protection scope of the present application.
Claims
1. A fast and high-precision AD sampling method based on statistics, characterized in that, include: Acquire sampling data, which includes AD sample values and sampling frequency; The N AD sample values with the highest sampling frequency in the sampled data are identified, where N is an integer greater than 2; The X adjacent AD sampling values from the N AD sampling values are combined into a group of data to form several groups of data, where X is an odd number greater than 1; The effective sampling frequencies in the aforementioned data sets are summed to obtain several total frequencies. The effective sampling frequency is the sampling frequency corresponding to the AD sampling value that is among the N AD sampling values with the highest sampling frequency ranking, while the effective sampling frequency of the AD sampling value that is not among the N AD sampling values with the highest sampling frequency ranking is 0. The AD sample value located in the middle of the group with the highest frequency among several total frequencies is taken as the sampling result; Specifically, X adjacent AD sample values from the N AD sample values are combined into a group of data, including: Extract a single AD sample value from N AD sample values; Extract the top-ranked individual AD sample values Each AD sample value and its ranking One AD sample value; The individual AD sample value, and the ranking of the individual AD sample values. Each AD sample value and the ranking of the individual AD sample values. Each AD sample value and its corresponding sampling frequency constitutes a set of data.
2. The fast and high-precision AD sampling method based on statistics according to claim 1, characterized in that, The N AD sample values with the highest sampling frequency ranking in the sampled data are statistically analyzed, including: The AD sampled values are sorted according to their sampling frequency from high to low. Select the top N AD sample values from the sorted list.
3. The fast and high-precision AD sampling method based on statistics according to claim 2, characterized in that, The effective sampling frequencies from the aforementioned data sets are summed to obtain several total frequencies, including: Extract all AD sample values from the aforementioned set of data; Determine whether all of the above AD sample values are among the N AD sample values with the highest sampling frequency; If an AD sample value is among the N AD sample values with the highest sampling frequency, the effective sampling frequency of that AD sample value is counted as its corresponding sampling frequency. If an AD sample value is not among the N AD sample values with the highest sampling frequency, the effective sampling frequency of that AD sample value is counted as 0. The total frequency of the data set is obtained by summing up the effective sampling frequencies corresponding to all AD sample values in the set of data. The total frequency of several sets of data is counted together to obtain several total frequencies.
4. A fast and high-precision AD sampling device based on statistics, characterized in that, include: The acquisition module is used to acquire sampled data, which includes AD sampled values and sampling frequency; The statistics module is used to identify the N AD sample values with the highest sampling frequency in the sampled data, where N is an integer greater than 2; The combination module is used to combine X adjacent AD sampling values from the N AD sampling values into a group of data to form several groups of data, where X is an odd number greater than 1; The calculation module is used to accumulate the effective sampling frequencies in the several sets of data to obtain several total frequencies. The effective sampling frequency is the sampling frequency corresponding to the AD sampling value in the N AD sampling values with the highest sampling frequency ranking, while the effective sampling frequency of the AD sampling value that is not in the N AD sampling values with the highest sampling frequency ranking is 0. The output module is used to take the AD sample value located in the middle position of the group with the highest frequency among several total frequencies as the sampling result; The combined module includes: The first extraction submodule is used to extract a single AD sample value from N AD sample values; The second extraction submodule is used to extract the top-ranked values of the individual AD sample values. Each AD sample value and its ranking One AD sample value; The combination submodule is used to combine the individual AD sample values and the top-ranked individual AD sample values. Each AD sample value and the ranking of the individual AD sample values. Each AD sample value and its corresponding sampling frequency constitutes a set of data.
5. The statistically based fast and high-precision AD sampling device according to claim 4, characterized in that, The statistics module includes: The sorting submodule is used to sort the AD sampled values according to the sampling frequency from high to low. The selection submodule is used to select the top N AD sample values in the sorting.
6. The statistically based fast and high-precision AD sampling device according to claim 5, characterized in that, The computing module includes: The third extraction submodule is used to extract all AD sample values from the set of data; The judgment submodule is used to determine whether all the above AD sample values are among the N AD sample values with the highest sampling frequency. The effective sampling frequency determination submodule, in response to the AD sample value being among the N AD sample values with the highest sampling frequency ranking, counts the effective sampling frequency of the AD sample value as its corresponding sampling frequency; in response to the AD sample value not being among the N AD sample values with the highest sampling frequency ranking, counts the effective sampling frequency of the AD sample value as 0. The accumulation submodule is used to sum up the effective sampling frequencies corresponding to all AD sample values in the set of data to obtain the total frequency of the set of data. The statistics submodule is used to combine the total frequencies of several sets of data to obtain several total frequencies.
7. A computer-readable storage medium, characterized in that, The computer-readable medium stores program code for execution by the device, the program code including steps for performing the method as described in any one of claims 1-3.
8. An electronic device, characterized in that, The electronic device includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method as described in any one of claims 1-3.
Citation Information
Patent Citations
Filtering method and device of AD sampling
CN107565930A
Target sampling value determination method and device, electronic equipment and storage medium
CN113114252A