Sine value output method and device based on intelligent test terminal, equipment and medium
By pre-constructing a general reference SIN base table and generating a target SIN lookup table based on the target sampling rate, the problem of high time consumption when the intelligent test terminal calculates the sine wave signal is solved, and the testing efficiency is improved.
Patent Information
- Application Number
- CN202411603019.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-02-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When the intelligent test terminal calculates the sine wave signal, frequent trigonometric function calculations lead to large time consumption and waste of computing power, and the generation speed of SIN lookup tables is slow and inefficient.
By pre-constructing a general reference SIN base table, the target SIN lookup table is quickly generated based on the target sampling rate of the target test terminal, reducing the calculation burden and improving the generation speed.
This greatly improves the generation speed of the target SIN lookup table, improves the sine value output efficiency of the intelligent test terminal, and thus improves the testing efficiency.
Smart Images

Figure CN119440167A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent testing technology, and in particular to a sine value output method, device, equipment and medium based on an intelligent testing terminal. Background Art
[0002] The sine wave signal in the intelligent testing field is composed of sampling points. When the power amplifier of the intelligent testing terminal outputs a sine wave signal, it will calculate the specific sine value of each point one by one, which means that the time packet thread in the CPU of the intelligent testing terminal needs to calculate {number of channels * sampling rate} SIN values per second.
[0003] Although the logic of using the package thread is simple, as the frequency of use increases, if it is calculated only through trigonometric functions according to the current usage habits, it will take a lot of time and waste a lot of computing power, which will be very inconvenient to use. Therefore, a method of calculating some predetermined SIN values in advance and storing them has emerged, which is the SIN lookup table.
[0004] The SIN lookup table can directly access the results of the SIN value as needed, so you only need to spend some time calculating the sine value of the sampling point to construct the SIN lookup table before starting to send the measurement. However, the number of sampling points is usually large, and each time the sampling rate of the smart test terminal power amplifier output is switched, the SIN lookup table needs to be recalculated and generated. At this time, you need to wait for a long time, which can be as short as 6-7 seconds or as long as nearly half a minute, resulting in slow generation of the SIN lookup table and low efficiency. Summary of the invention
[0005] The present invention provides a sine value output method, device, equipment and medium based on an intelligent test terminal, which can quickly generate a target SIN query table according to the target sampling rate of the target test terminal and a pre-built universal reference SIN base table, greatly improving the generation speed of the target SIN query table and helping to improve the sine value output efficiency of the target test terminal.
[0006] According to one aspect of the present invention, a method for outputting a sine value based on an intelligent test terminal is provided, the method comprising:
[0007] Obtain a target sampling rate and a reference SIN base table of a target test terminal; wherein the reference SIN base table is used to describe the sine values corresponding to each reference phase at a reference sampling rate, and the reference sampling rate is the maximum sampling rate supported by the target test terminal;
[0008] Determine a target SIN lookup table according to the target sampling rate and the reference SIN base table; wherein the target SIN lookup table is used to store the sine values corresponding to each target phase at the target sampling rate;
[0009] The output sine value of the target test terminal is determined according to the target SIN lookup table.
[0010] According to another aspect of the present invention, a sine value output device based on an intelligent test terminal is provided, the device comprising:
[0011] A reference SIN base table acquisition module is used to acquire a target sampling rate and a reference SIN base table of a target test terminal; wherein the reference SIN base table is used to describe the sine values corresponding to each reference phase at a reference sampling rate, and the reference sampling rate is the maximum sampling rate supported by the target test terminal;
[0012] A target SIN lookup table determination module is used to determine a target SIN lookup table according to the target sampling rate and the reference SIN base table; wherein the target SIN lookup table is used to store the sine values corresponding to each target phase at the target sampling rate;
[0013] The terminal output sine value determination module is used to determine the output sine value of the target test terminal according to the target SIN query table.
[0014] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0015] at least one processor; and,
[0016] a memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the sine value output method based on the intelligent test terminal described in any embodiment of the present invention.
[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the sine value output method based on an intelligent test terminal described in any embodiment of the present invention when executed.
[0019] The technical solution of the embodiment of the present invention obtains the target sampling rate and reference SIN base table of the target test terminal; wherein the reference SIN base table is used to describe the sine value corresponding to each reference phase at the reference sampling rate, and the reference sampling rate is the maximum sampling rate supported by the target test terminal; a target SIN query table is determined according to the target sampling rate and the reference SIN base table; wherein the target SIN query table is used to store the sine values corresponding to each target phase at the target sampling rate; and the output sine value of the target test terminal is determined according to the target SIN query table. This technical solution can quickly generate a target SIN query table according to the target sampling rate of the target test terminal and a pre-constructed universal reference SIN base table, greatly improving the generation speed of the target SIN query table, and helping to improve the sine value output efficiency of the target test terminal, thereby improving the test efficiency of the target test terminal.
[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 is a flow chart of a sine value output method based on an intelligent test terminal provided according to Embodiment 1 of the present invention;
[0023] Figure 2 is a schematic diagram of a process for determining a target sine value provided according to Embodiment 1 of the present invention;
[0024] Figure 3 is a schematic diagram of a sine wave curve provided according to Embodiment 1 of the present invention;
[0025] Figure 4 is a flow chart of a sine value output method based on an intelligent test terminal provided according to Embodiment 2 of the present invention;
[0026] Figure 5 This is a schematic diagram of optimizing the storage space of a reference SIN base table provided according to Embodiment 2 of the present invention;
[0027] Figure 6 is a structural schematic diagram of a sine value output device based on an intelligent test terminal provided according to Embodiment 3 of the present invention;
[0028] Figure 7 The invention is a structural schematic diagram of an electronic device for implementing a sine value output method based on an intelligent test terminal according to an embodiment of the present invention. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0030] It should be noted that the terms "first", "second", "target", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0031] Embodiment 1
[0032] Figure 1 This is a flow chart of a method for outputting sine values based on an intelligent test terminal provided in the first embodiment of the present invention. This embodiment is applicable to the case where the speed of outputting sine values of an intelligent test terminal is optimized. This method can be executed by a sine value output device based on an intelligent test terminal. The sine value output device based on an intelligent test terminal can be implemented in the form of hardware and / or software. The sine value output device based on an intelligent test terminal can be configured in an electronic device with data processing capabilities. Figure 1 As shown, the method includes:
[0033] S110, obtaining a target sampling rate of a target test terminal and a reference SIN base table.
[0034] Among them, the target test terminal may refer to an intelligent test terminal that needs to perform signal testing, which can be used to receive control program commands and output voltage and current values used for testing as required, and the voltage and current waveforms here are both AC sine waves. Exemplarily, the target test terminal is a relay protection tester. The target sampling rate can be understood as the frequency of the output voltage and current values of the target test terminal. The reference SIN base table is used to describe the sine values corresponding to each reference phase at the reference sampling rate, and the reference sampling rate is the maximum sampling rate supported by the target test terminal. Among them, the reference phase may refer to the sampling point at the reference sampling rate. The sine value corresponding to the reference phase can be directly characterized by the sine value of the reference phase, or it can be characterized by other methods, which are not specifically limited here.
[0035] In this embodiment, optionally, the process of determining the reference SIN base table includes: determining a reference phase according to a reference sampling rate; determining a reference sine value corresponding to the reference phase; wherein the data type of the reference sine value is a double precision type; and determining the reference SIN base table according to the reference sine value corresponding to the reference phase.
[0036] In this embodiment, only one calculation is required to construct a reference SIN base table according to the maximum sampling rate (i.e., reference sampling rate) supported by the software system when the software system of the target test terminal is started (i.e., only one reference SIN base table needs to be constructed). Each subsequent test only requires sampling from the reference SIN base table to generate a SIN subtable (i.e., target SIN query table) according to different target sampling rates, so that the package construction task uses the SIN subtable to perform package construction calculations. This method loses extremely small (negligible) accuracy and additional storage space (for storing the reference SIN base table), but can greatly reduce the waiting time required when the target sampling rate is switched.
[0037] Specifically, when constructing the reference SIN base table, first determine each sampling point (i.e., reference phase) according to the reference sampling rate, then calculate the sine value corresponding to each reference phase as the reference sine value, and then store the reference sine value corresponding to each reference phase in the first empty table according to the double precision (double) data type to obtain the reference SIN base table. The reference sine value uses a double precision data type, which can make the reference sine value as accurate as possible, thereby improving the accuracy of the reference sine value.
[0038] S120, determining a target SIN lookup table according to the target sampling rate and the reference SIN base table.
[0039] The target SIN query table is used to store the sine values corresponding to each target phase at the target sampling rate. The target phase may refer to the sampling point at the target sampling rate.
[0040] In this embodiment, after obtaining the target sampling rate and the reference SIN base table of the target test terminal, the target SIN query table can be determined according to the target sampling rate and the reference SIN base table, so that the target SIN query table can be used as an important basis for the output sine value of the target test terminal. Optionally, determining the target SIN query table according to the target sampling rate and the reference SIN base table includes: obtaining the reference sampling rate of the reference SIN base table, determining the sampling rate ratio according to the ratio of the reference sampling rate to the target sampling rate; extracting reference sine values at equal intervals from the reference SIN base table based on the sampling rate ratio to obtain the target sine value corresponding to the target phase; and determining the target SIN query table according to the target sine value corresponding to the target phase.
[0041] Specifically, first calculate the ratio of the reference sampling rate of the reference SIN base table to the target sampling rate as the sampling rate ratio, and then use the difference between the sampling rate ratio and 1 as the target interval. Then, starting from the reference sine value corresponding to the first reference phase in the reference SIN base table, extract multiple reference sine values at equal intervals from the reference SIN base table in turn according to the target interval, thereby obtaining the target sine value corresponding to the target phase. It can be understood that the reference sine value obtained by taking points at equal intervals is the target sine value, and the reference phase corresponding to the target sine value is the target phase. Finally, the target sine values corresponding to each target phase are stored in the second empty table in the order of extraction, and the target SIN query table can be obtained. In particular, when the target interval is 0, that is, the reference sampling rate is equal to the target sampling rate, there is no need to take points at equal intervals at this time, and all reference sine values in the reference SIN base table can be directly copied to the second empty table in the original order to obtain the target SIN query table.
[0042] Figure 2 A schematic diagram of a target sine value determination process provided in Example 1 of the present invention. 100M and 20M represent the resolution of the reference SIN base table and the target SIN query table, respectively. It should be noted that resolution, as a basic attribute of the SIN table, can be used to characterize the amount of data contained in the SIN table, and the resolution is a multiple of the sampling rate, so the ratio of resolutions is equal to the ratio of sampling rates. Figure 2 As shown in , the ratio of the reference sampling rate to the target sampling rate can be expressed as 100M / 20M=5, that is, the reference sampling rate is 5 times the target sampling rate, that is, the target interval is 5-1=4. Figure 2 It can be seen that starting from the first reference sine value V1 in the reference SIN base table, data is extracted every 4 points from V1, V2, V3, ..., V100M, and the target reference values V1, V5, V10, ..., V20M can be quickly obtained.
[0043] Through actual testing, it only takes about 1-2 seconds to generate a target SIN lookup table based on the reference SIN base table. This means that even when testing at different target sampling rates, it usually only takes 1-2 seconds of switching waiting time, so the generation speed of the target SIN lookup table can be greatly improved.
[0044] S130, determining the output sine value of the target test terminal according to the target SIN lookup table.
[0045] In this embodiment, after the target SIN lookup table is determined, each target reference sine value stored in the target SIN lookup table is output in sequence, so that a plurality of output sine values required by the target test terminal can be obtained.
[0046] The technical solution of the embodiment of the present invention obtains the target sampling rate and reference SIN base table of the target test terminal; wherein the reference SIN base table is used to describe the sine value corresponding to each reference phase at the reference sampling rate, and the reference sampling rate is the maximum sampling rate supported by the target test terminal; a target SIN query table is determined according to the target sampling rate and the reference SIN base table; wherein the target SIN query table is used to store the sine values corresponding to each target phase at the target sampling rate; and the output sine value of the target test terminal is determined according to the target SIN query table. This technical solution can quickly generate a target SIN query table according to the target sampling rate of the target test terminal and a pre-constructed universal reference SIN base table, greatly improving the generation speed of the target SIN query table, and helping to improve the sine value output efficiency of the target test terminal, thereby improving the test efficiency of the target test terminal.
[0047] In this embodiment, optionally, the process of determining the reference SIN base table includes: determining a reference phase based on a reference sampling rate; wherein the reference phase includes a candidate phase located in the first quadrant and other phases located in other quadrants, and the other quadrants include the second quadrant, the third quadrant, and the fourth quadrant; determining a candidate sine value corresponding to the candidate phase, and determining other sine values corresponding to the other phases based on the relationship between the other phases and the candidate phase and the candidate sine value; determining a reference sine value based on the candidate sine value and the other sine values, and determining the reference SIN base table based on the reference sine value corresponding to the reference phase.
[0048] It should be noted that when constructing the reference SIN base table, if the reference sine value corresponding to each reference phase is directly calculated, when the reference sampling rate is large, the calculation time will be too long, making the initialization time of the reference SIN base table longer. For example, for a reference SIN base table with a resolution of 100M, the initialization time takes about 36 seconds, which makes the software system startup speed of the target test terminal slow. Since the target SIN query table cannot be modified, in order to improve the performance and speed of the SIN query, it is possible to consider further optimizing the initialization speed of the reference SIN base table.
[0049] Figure 3 A schematic diagram of a sine wave curve provided in Embodiment 1 of the present invention. Figure 3 As shown, according to the symmetry of the sine wave curve, it can be determined that the sine wave curve is a centrally symmetrical figure as a whole, and the peaks and troughs on the left and right sides of the center point are both left-right symmetrical figures. According to its symmetric characteristics, as long as the SIN value of [0°, 90°] is known, the SIN value of (90°, 360°) can be calculated. Here, a cycle of the sine wave curve is 360°, and every 90° is called a quadrant, so four quadrants can be obtained, which are represented as P1, P2, P3 and P4 respectively.
[0050] Specifically, assuming that the current reference phase is Pos, and the SIN table value of the first quadrant is known, then: if Pos∈P1, directly take the SIN table value of the first quadrant; if Pos∈P2, then Pos1=π-Pos, use Pos1 to take the SIN table value of the first quadrant; if Pos∈P3, then Pos1=Pos-π, use Pos1 to take the SIN table value of the first quadrant, and take a negative number; if Pos∈P4, then Pos1=2π–Pos, use Pos1 to take the SIN table value of the first quadrant, and take a negative number. Based on the above process, the reference sine value corresponding to each reference phase can be quickly obtained, thereby further determining the reference SIN base table.
[0051] After actual testing, the above initialization method can reduce the initialization time of the reference SIN base table with a resolution of 100M from the original 36 seconds to about 7 seconds, thereby greatly improving the initialization speed of the reference SIN base table and helping to further improve the generation speed of the target SIN query table. In addition, the storage space of the reference SIN base table is further reduced (reduced to 1 / 4 of the original), so the memory space is effectively saved.
[0052] Embodiment 2
[0053] Figure 4 This is a flow chart of a sine value output method based on an intelligent test terminal provided in the second embodiment of the present invention. This embodiment is optimized based on the above embodiment.
[0054] like Figure 4 As shown, the method of this embodiment specifically includes the following steps:
[0055] S210, obtaining a target sampling rate and a reference SIN base table of a target test terminal.
[0056] The reference SIN base table is used to describe the sine values corresponding to each reference phase at a reference sampling rate, and the reference sampling rate is the maximum sampling rate supported by the target test terminal.
[0057] In this embodiment, optionally, the process of determining the reference SIN base table also includes: evenly dividing the reference sine values in the reference SIN base table based on a preset number of segments to obtain multiple reference segments; determining the basic sine value and offset unit of each reference segment, and determining the offset quantity corresponding to each reference sine value in the reference segment based on the basic sine value and the offset unit of the reference segment; wherein the data types of the basic sine value and the offset unit are double precision types, and the data type of the offset quantity is an unsigned short integer type; and updating the reference SIN base table based on the basic sine value and the offset unit of the reference segment and the offset quantity corresponding to each reference sine value in the reference segment.
[0058] It should be noted that although the use of double-precision data types to represent reference sine values can improve the accuracy of reference sine values, it will take up a large storage space, especially when the reference sampling rate is high. For example, taking the generation of a reference SIN base table with a resolution of 100M and a target SIN query table with a maximum resolution of 100M as an example, the storage space occupied by the reference SIN base table and the target SIN query table is 100M*sizeof(double)=800Mbyte, that is, the total storage space occupied by the two tables is approximately 1.6G. Among them, double represents a double-precision data type, and sizeof is used to determine the size of a data type or variable (that is, the number of bytes occupied in memory). A double type of data occupies 8 bytes of memory space, that is, sizeof(double)=8byte.
[0059] In order to maintain the high-speed access and performance requirements of the package construction task, it is possible to consider compressing the sine wave curve data based on the reference SIN base table, thereby reducing the storage space of the reference SIN base table. Since the sine wave curve has the characteristics of continuous and differentiable and small fluctuation, for this type of curve, data compression can be used in a segmented compression manner.
[0060] Specifically, first, the reference sine values in the reference SIN base table are evenly divided into multiple reference segments based on a preset number of segments. Among them, the preset number of segments may refer to the number of segments preset according to actual needs. Exemplarily, taking the reference SIN base table with a resolution of 100M as an example, the reference SIN base table can be divided into 100K parts, and each reference segment includes 1000 point values. Then determine the basic sine value and offset unit (data type is double precision) of each reference segment, and determine the offset quantity (data type is unsigned short integer) corresponding to each reference sine value in the reference segment based on the basic sine value and offset unit of the reference segment. Among them, the basic sine value can be used as the baseline for all reference sine values in the reference segment, and the offset unit can be used to represent the change in sine value corresponding to an offset quantity.
[0061] In this embodiment, optionally, a base sine value and an offset unit of each reference segment are determined, and the offset quantity corresponding to each reference sine value in the reference segment is determined based on the base sine value and the offset unit of the reference segment, including: for each reference segment, taking the minimum reference sine value in the reference segment as the base sine value of the reference segment; determining the difference between the maximum reference sine value and the minimum reference sine value in the reference segment as the first difference; determining the offset unit of the reference segment based on the ratio of the first difference to the reference value; wherein the reference value is the maximum value represented by an unsigned short integer; for each reference sine value in the reference segment, determining a second difference based on the difference between the reference sine value and the base sine value of the reference segment; and determining the offset quantity corresponding to the reference sine value based on the ratio of the second difference to the offset unit of the reference segment.
[0062] Figure 5 A schematic diagram of storage space optimization of a reference SIN base table provided in Embodiment 2 of the present invention.
[0063] Among them, Max and Min represent the maximum reference sine value and the minimum reference sine value in a reference segment, respectively. Specifically, after obtaining multiple reference segments, the base sine value BaseValue and the offset unit OffsetUnit of each reference segment are calculated respectively, and the offset quantity OffsetValue corresponding to each reference sine value is calculated according to the two values of BaseValue and OffsetUnit, which can be expressed as follows:
[0064] double BaseValue = Min;
[0065] double OffsetUnit=(Max-Min) / 65535;
[0066] u_short OffsetValue=(Cur-Min) / OffsetUnit.
[0067] Among them, u_short represents the data type of unsigned short integer, 65535 represents the maximum value that can be expressed by unsigned short integer (i.e. reference value), a data of u_short type occupies 2 bytes of memory space, Cur represents the reference sine value; Max-Min represents the first difference, and Cur-Min represents the second difference.
[0068] After obtaining the basic sine value and offset unit of each reference segment and the offset quantity corresponding to each reference sine value in each reference segment, the offset quantity corresponding to each reference sine value in each reference segment can be stored in the reference SIN base table, and the offset quantity corresponding to each reference sine value can be associated with the basic sine value and offset unit of the corresponding reference segment to achieve the update of the reference SIN base table. As a result, the reference sine value of the double precision type previously stored in the reference SIN base table is changed to the offset quantity corresponding to the reference sine value of the unsigned short integer type currently stored. In this way, with a certain loss of accuracy (still far from meeting the DA resolution), the memory space occupied by the reference SIN base table is changed from the previous 800MB to about 200MB (the storage space is reduced to 1 / 4 of the original), which greatly reduces the storage space of the reference SIN base table, thereby effectively saving memory space.
[0069] S220, obtaining a reference sampling rate of a reference SIN base table, and determining a sampling rate ratio according to a ratio of the reference sampling rate to a target sampling rate.
[0070] S230, extracting the offset numbers corresponding to the reference sine values at equal intervals from the reference SIN base table based on the sampling rate ratio, to obtain the offset numbers corresponding to each target phase at the target sampling rate.
[0071] Specifically, after determining the sampling rate ratio, the difference between the sampling rate ratio and 1 can be determined as the target interval. Then, starting from the offset number corresponding to the first reference sine value in the reference SIN base table, multiple offset numbers are extracted from the reference SIN base table at equal intervals according to the target interval, thereby obtaining the offset number corresponding to the target phase. It can be understood that the offset number corresponding to the reference sine value obtained by taking points at equal intervals is the offset number corresponding to the target phase. In particular, when the target interval is 0, that is, the reference sampling rate is equal to the target sampling rate, there is no need to take points at equal intervals at this time, and the offset numbers corresponding to all reference sine values in the reference SIN base table can be directly determined as the offset number corresponding to the target phase.
[0072] S240: For each target phase at the target sampling rate, determine a reference segment corresponding to the target phase as the target segment.
[0073] S250, determining the offset sine value corresponding to the target phase according to the product of the offset unit of the target segment and the offset quantity corresponding to the target phase.
[0074] S260, determining a target sine value corresponding to the target phase according to the sum of the basic sine value of the target segment and the offset sine value corresponding to the target phase.
[0075] Exemplarily, the target sine value corresponding to the target phase may be determined by the following formula:
[0076] double Val=BaseValue+OffsetUnit*OffsetValue.
[0077] Among them, OffsetUnit*OffsetValue represents the offset sine value corresponding to the target phase, and Val represents the target sine value corresponding to the target phase.
[0078] S270, determining a target SIN lookup table according to a target sine value corresponding to the target phase.
[0079] The target SIN lookup table is used to store the sine values corresponding to each target phase at the target sampling rate.
[0080] S280, determining the output sine value of the target test terminal according to the target SIN lookup table.
[0081] The technical solution of the embodiment of the present invention performs segmented data compression on the constructed reference SIN base table, thereby reducing the storage space of the reference SIN base table and effectively saving memory space.
[0082] Embodiment 3
[0083] Figure 6 This is a schematic diagram of the structure of a sine value output device based on an intelligent test terminal provided in the third embodiment of the present invention. The device can execute the sine value output method based on an intelligent test terminal provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. Figure 6 As shown, the device comprises:
[0084] A reference SIN base table acquisition module 310 is used to acquire a target sampling rate and a reference SIN base table of a target test terminal; wherein the reference SIN base table is used to describe the sine values corresponding to each reference phase at a reference sampling rate, and the reference sampling rate is the maximum sampling rate supported by the target test terminal;
[0085] A target SIN lookup table determination module 320 is used to determine a target SIN lookup table according to the target sampling rate and the reference SIN base table; wherein the target SIN lookup table is used to store the sine values corresponding to each target phase at the target sampling rate;
[0086] The terminal output sine value determination module 330 is used to determine the output sine value of the target test terminal according to the target SIN query table.
[0087] Optionally, the device further comprises: a reference SIN base table determination module, configured to:
[0088] Determining a reference phase according to the reference sampling rate;
[0089] Determine a reference sine value corresponding to the reference phase; wherein the data type of the reference sine value is double precision;
[0090] A reference SIN base table is determined according to the reference sine value corresponding to the reference phase.
[0091] Optionally, the reference SIN base table determination module is further used to:
[0092] Determine a reference phase according to the reference sampling rate; wherein the reference phase includes a candidate phase located in the first quadrant and other phases located in other quadrants, and the other quadrants include the second quadrant, the third quadrant and the fourth quadrant;
[0093] Determine a candidate sine value corresponding to the candidate phase, and determine other sine values corresponding to the other phases according to a relationship between the other phases and the candidate phase and the candidate sine value;
[0094] A reference sine value is determined according to the candidate sine value and the other sine values, and a reference SIN base table is determined according to the reference sine value corresponding to the reference phase.
[0095] Optionally, the target SIN query table determination module 320 is used to:
[0096] Obtaining a reference sampling rate of the reference SIN base table, and determining a sampling rate ratio according to a ratio of the reference sampling rate to the target sampling rate;
[0097] Based on the sampling rate ratio, the reference sine values are extracted at equal intervals from the reference SIN base table to obtain the target sine value corresponding to the target phase;
[0098] A target SIN lookup table is determined according to the target sine value corresponding to the target phase.
[0099] Optionally, the reference SIN base table determination module is further used to:
[0100] The reference sine values in the reference SIN base table are evenly divided based on a preset number of segments to obtain a plurality of reference segments;
[0101] Determine a basic sine value and an offset unit for each reference segment, and determine an offset quantity corresponding to each reference sine value in the reference segment according to the basic sine value and the offset unit; wherein the data types of the basic sine value and the offset unit are double precision types, and the data type of the offset quantity is an unsigned short integer type;
[0102] The reference SIN base table is updated according to the base sine value and the offset unit of the reference segment and the offset quantity corresponding to each reference sine value in the reference segment.
[0103] Optionally, the reference SIN base table determination module is further used to:
[0104] For each reference segment, taking the minimum reference sine value in the reference segment as the basic sine value of the reference segment;
[0105] Determine a difference between a maximum reference sine value and a minimum reference sine value in the reference segment as a first difference;
[0106] Determine the offset unit of the reference segment according to the ratio of the first difference value to a reference value; wherein the reference value is the maximum value represented by an unsigned short integer;
[0107] For each reference sine value in the reference segment, determining a second difference value according to a difference between the reference sine value and a base sine value of the reference segment;
[0108] The offset quantity corresponding to the reference sine value is determined according to the ratio of the second difference value to the offset unit of the reference segment.
[0109] Optionally, the target SIN query table determination module 320 is further configured to:
[0110] Obtaining a reference sampling rate of the reference SIN base table, and determining a sampling rate ratio according to a ratio of the reference sampling rate to the target sampling rate;
[0111] Based on the sampling rate ratio, the offset number corresponding to the reference sine value is extracted from the reference SIN base table at equal intervals to obtain the offset number corresponding to each target phase at the target sampling rate;
[0112] For each target phase at the target sampling rate, determining a reference segment corresponding to the target phase as a target segment;
[0113] Determine the offset sine value corresponding to the target phase according to the product of the offset unit of the target segment and the offset quantity corresponding to the target phase;
[0114] Determine a target sine value corresponding to the target phase according to the sum of a base sine value of the target segment and an offset sine value corresponding to the target phase;
[0115] A target SIN lookup table is determined according to the target sine value corresponding to the target phase.
[0116] A sine value output device based on an intelligent test terminal provided in an embodiment of the present invention can execute a sine value output method based on an intelligent test terminal provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.
[0117] Embodiment 4
[0118] Figure 7 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0119] like Figure 7 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0120] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0121] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a sine value output method based on an intelligent test terminal.
[0122] In some embodiments, the sinusoidal value output method based on the intelligent test terminal can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the sinusoidal value output method based on the intelligent test terminal described above can be executed. Alternatively, in other embodiments, the processor 11 can be configured to execute the sinusoidal value output method based on the intelligent test terminal in any other appropriate manner (for example, by means of firmware).
[0123] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0124] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0125] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0126] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0127] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0128] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0129] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0130] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A sine value output method based on an intelligent test terminal, characterized in that: The method comprises: Obtain a target sampling rate and a reference SIN base table of a target test terminal; wherein the reference SIN base table is used to describe the sine values corresponding to each reference phase at a reference sampling rate, and the reference sampling rate is the maximum sampling rate supported by the target test terminal; Determine a target SIN lookup table according to the target sampling rate and the reference SIN base table; wherein the target SIN lookup table is used to store the sine values corresponding to each target phase at the target sampling rate; The output sine value of the target test terminal is determined according to the target SIN lookup table.
2. The method according to claim 1, characterized in that The determination process of the reference SIN base table includes: Determining a reference phase according to the reference sampling rate; Determine a reference sine value corresponding to the reference phase; wherein the data type of the reference sine value is double precision; A reference SIN base table is determined according to the reference sine value corresponding to the reference phase.
3. The method according to claim 1, characterized in that The determination process of the reference SIN base table includes: Determine a reference phase according to the reference sampling rate; wherein the reference phase includes a candidate phase located in the first quadrant and other phases located in other quadrants, and the other quadrants include the second quadrant, the third quadrant and the fourth quadrant; Determine a candidate sine value corresponding to the candidate phase, and determine other sine values corresponding to the other phases according to a relationship between the other phases and the candidate phase and the candidate sine value; A reference sine value is determined according to the candidate sine value and the other sine values, and a reference SIN base table is determined according to the reference sine value corresponding to the reference phase.
4. The method according to claim 2 or 3, characterized in that: Determining a target SIN lookup table according to the target sampling rate and the reference SIN base table includes: Obtaining a reference sampling rate of the reference SIN base table, and determining a sampling rate ratio according to a ratio of the reference sampling rate to the target sampling rate; Extracting the reference sine values at equal intervals from the reference SIN base table based on the sampling rate ratio, and obtaining the target sine value corresponding to the target phase; A target SIN lookup table is determined according to the target sine value corresponding to the target phase.
5. The method according to claim 2 or 3, characterized in that: The determination process of the reference SIN base table further includes: The reference sine values in the reference SIN base table are evenly divided based on a preset number of segments to obtain a plurality of reference segments; Determine a basic sine value and an offset unit for each reference segment, and determine an offset quantity corresponding to each reference sine value in the reference segment according to the basic sine value and the offset unit; wherein the data types of the basic sine value and the offset unit are double precision types, and the data type of the offset quantity is an unsigned short integer type; The reference SIN base table is updated according to the base sine value and the offset unit of the reference segment and the offset quantity corresponding to each reference sine value in the reference segment.
6. The method according to claim 5, characterized in that Determining a base sine value and an offset unit of each reference segment, and determining an offset quantity corresponding to each reference sine value in the reference segment according to the base sine value and the offset unit of the reference segment, including: For each reference segment, taking the minimum reference sine value in the reference segment as the basic sine value of the reference segment; Determine a difference between a maximum reference sine value and a minimum reference sine value in the reference segment as a first difference; Determine the offset unit of the reference segment according to the ratio of the first difference value to a reference value; wherein the reference value is the maximum value represented by an unsigned short integer; For each reference sine value in the reference segment, determining a second difference value according to a difference between the reference sine value and a base sine value of the reference segment; The offset quantity corresponding to the reference sine value is determined according to the ratio of the second difference value to the offset unit of the reference segment.
7. The method according to claim 6, characterized in that Determining a target SIN lookup table according to the target sampling rate and the reference SIN base table includes: Obtaining a reference sampling rate of the reference SIN base table, and determining a sampling rate ratio according to a ratio of the reference sampling rate to the target sampling rate; Based on the sampling rate ratio, the offset number corresponding to the reference sine value is extracted from the reference SIN base table at equal intervals to obtain the offset number corresponding to each target phase at the target sampling rate; For each target phase at the target sampling rate, determining a reference segment corresponding to the target phase as a target segment; Determine the offset sine value corresponding to the target phase according to the product of the offset unit of the target segment and the offset quantity corresponding to the target phase; Determine a target sine value corresponding to the target phase according to the sum of a base sine value of the target segment and an offset sine value corresponding to the target phase; A target SIN lookup table is determined according to the target sine value corresponding to the target phase.
8. A sine value output device based on an intelligent test terminal, characterized in that: The device comprises: A reference SIN base table acquisition module is used to acquire a target sampling rate and a reference SIN base table of a target test terminal; wherein the reference SIN base table is used to describe the sine values corresponding to each reference phase at a reference sampling rate, and the reference sampling rate is the maximum sampling rate supported by the target test terminal; A target SIN lookup table determination module is used to determine a target SIN lookup table according to the target sampling rate and the reference SIN base table; wherein the target SIN lookup table is used to store the sine values corresponding to each target phase at the target sampling rate; The terminal output sine value determination module is used to determine the output sine value of the target test terminal according to the target SIN query table.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the sinusoidal value output method based on the intelligent test terminal according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the sine value output method based on an intelligent test terminal according to any one of claims 1 to 7 when executed.
Citation Information
Patent Citations
Method for generating programming simulated signal source in electric power equipment
CN102520762A
Digital down-converting system for implementing frequency-agility metrewave radar
CN104201991A
GFSK modulation method, device and terminal equipment
CN107995137A
Signal processing method and device, electronic equipment and storage medium
CN111134637A