Disclosure of Invention
The invention mainly solves the technical problem of how to better observe the variation trend of the corresponding waveform of the recorded data.
According to a first aspect, there is provided in one embodiment an oscilloscope having a data recording function, comprising:
the data acquisition module is used for carrying out data acquisition on the input signals;
a memory for storing the collected data;
the data processing and mapping module is used for converting the data stored in the memory into waveform image data for displaying a waveform display window in the display interface according to the snapshot stepping value;
the control processing module is used for acquiring the total pixel value of a waveform display window in the display interface and detecting the quantity of data stored in the memory in real time; and when the data volume of the data stored in the memory is detected to be integral multiple of the total pixel value, updating the snapshot stepping value, and sending the updated snapshot stepping value to a data processing mapping module so as to update the waveform image data displayed in the waveform display window.
In an embodiment, the updating the snapshot step value upon detecting that the amount of data of the data stored in the memory is an integer multiple of the total pixel value includes:
and when detecting that the data volume of the data stored in the memory is integral multiple of the total pixel value, updating the snapshot stepping value to be the ratio of the data volume of the data stored in the memory to the total pixel value.
In one embodiment, the control processing module is further configured to:
setting the snapshot step value to 1 when detecting that the amount of data of the data stored in the memory is less than the total pixel value.
In one embodiment, the control processing module is further configured to:
and when the data volume of the data stored in the memory is detected to be larger than the preset data volume, stopping storing the data into the memory, or removing the data firstly stored into the memory.
According to a second aspect, an embodiment provides a waveform display method based on an oscilloscope with a data recording function, which comprises the following steps:
acquiring a total pixel value of a waveform display window in a display interface of the oscilloscope, and detecting the quantity of data stored in a memory in real time; the memory is used for storing signal data acquired by the oscilloscope;
when detecting that the data amount of the data stored in the memory is integral multiple of the total pixel value, updating the snapshot step value to update the waveform image data for display in the waveform display window; the snapshot step value is used for converting the data stored in the memory into waveform image data for displaying a waveform display window in the display interface.
In an embodiment, the updating the snapshot step value upon detecting that the amount of data of the data stored in the memory is an integer multiple of the total pixel value includes:
and when detecting that the data volume of the data stored in the memory is integral multiple of the total pixel value, updating the snapshot stepping value to be the ratio of the data volume of the data stored in the memory to the total pixel value.
In one embodiment, the method further comprises:
setting the snapshot step value to 1 when detecting that the amount of data of the data stored in the memory is less than the total pixel value.
In one embodiment, the method further comprises:
and when the data volume of the data stored in the memory is detected to be larger than the preset data volume, stopping storing the data into the memory, or removing the data firstly stored into the memory.
According to a third aspect, an embodiment provides a computer-readable storage medium having a program stored thereon, the program being executable by a processor to implement the method of the above-described embodiment.
According to the oscilloscope with the data recording function and the waveform display method thereof of the embodiment, the total pixel value of the waveform display window in the display interface is obtained, the data volume of the data stored in the memory is detected in real time, when the data volume of the data stored in the memory of the oscilloscope is detected to be integral multiple of the total pixel value of the waveform display window, the snapshot step value is updated, and the updated snapshot step value is sent to the data processing mapping module so as to update the waveform image data displayed in the waveform display window; therefore, when the data amount stored in the memory increases by one total pixel value of the waveform display window, the waveform image data is updated once, so that the updating frequency of the waveform image data is always fixed and does not change along with the change of the data amount of the oscilloscope recorded data.
Detailed Description
The present invention will be described in further detail with reference to the following detailed description and accompanying drawings. Wherein like elements in different embodiments are numbered with like associated elements. In the following description, numerous details are set forth in order to provide a better understanding of the present application. However, those skilled in the art will readily recognize that some of the features may be omitted or replaced with other elements, materials, methods in different instances. In some instances, certain operations related to the present application have not been shown or described in detail in order to avoid obscuring the core of the present application from excessive description, and it is not necessary for those skilled in the art to describe these operations in detail, so that they may be fully understood from the description in the specification and the general knowledge in the art.
Furthermore, the features, operations, or characteristics described in the specification may be combined in any suitable manner to form various embodiments. Also, the various steps or actions in the method descriptions may be transposed or transposed in order, as will be apparent to one of ordinary skill in the art. Thus, the various sequences in the specification and drawings are for the purpose of describing certain embodiments only and are not intended to imply a required sequence unless otherwise indicated where such sequence must be followed.
The numbering of the components as such, e.g., "first", "second", etc., is used herein only to distinguish the objects as described, and does not have any sequential or technical meaning. The term "connected" and "coupled" when used in this application, unless otherwise indicated, includes both direct and indirect connections (couplings).
The abscissa in a waveform display window of a display interface of the oscilloscope is used for representing time, and the ordinate is used for representing amplitude, wherein the whole span of the abscissa is a total pixel value of the waveform display window, the total pixel value is a pixel value corresponding to a longest waveform that can be displayed by the waveform display window, that is, the total pixel value is the number of data points corresponding to the largest number of data points that can be displayed by the waveform display window.
The data recorded by the oscilloscope is data acquired by the oscilloscope collecting the input signal and stored in the memory, and generally speaking, the memory in the oscilloscope has a large storage depth and can continuously store the acquired data for a long period of time.
In some oscilloscopes, when waveform display is performed on data recorded by the oscilloscopes, as the data volume n of the recorded data is increased, when the data volume n is larger than the total pixel value m of a waveform display window, the snapshot step value s (the initial value is 1) is doubled; after recording data for a long time, s is 2xWhere x is the ratio of the data quantity n to the total pixel value m, i.e. 2 has to be recordedxAfter the data point is detected, the waveform image is updated once, so that the data volume n of the recorded data is increased along with the increase of the data recording time, and the ratio x of the data volume n of the recorded data to the total pixel value m is also continuously increased, so that a user cannot see the change of the waveform within a long time, the change of the waveform within the long time cannot be better observed, and the user experience is poor.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an oscilloscope with a data recording function according to an embodiment, which is hereinafter referred to as an oscilloscope for short, and the oscilloscope includes adata acquisition module 101, amemory 102, a data processing andmapping module 103, acontrol processing module 104, and adisplay module 105.
Thedata acquisition module 101 is used for performing data acquisition on the input signal. It should be noted that, when the oscilloscope records data, only one channel is usually adopted to perform data acquisition on an input signal. In one embodiment, the oscilloscope switches to a data recording function in response to an externally input command, such as: the oscilloscope can be switched to a data recording function by triggering a button on the oscilloscope, and the like.
Thememory 102 is used to store the acquired data.
In this embodiment, the data acquired by thedata acquisition module 101 can be continuously stored in thememory 102 until the storage space in thememory 102 is completely occupied, so that the data amount of the data stored in thememory 102 is the data amount of the data recorded by the oscilloscope.
The data processing andmapping module 103 is configured to convert the data stored in thememory 102 into waveform image data for displaying a waveform display window in the display interface according to the snapshot step value, and output the waveform image data to thedisplay module 105 for displaying. Thedisplay module 105 in this embodiment may be a display screen, a display interface is displayed in the display screen, and at least one waveform display window is distributed in the display interface according to an actual situation, for example: the display interface comprises a waveform display window which is used for displaying the waveform corresponding to the data recorded by the oscilloscope.
In the present embodiment, signal data necessary for waveform image data is taken as first signal data, which is theoretically all stored data read from thememory 102; however, when the data amount of the first signal data is larger than the maximum data amount that can be displayed in the waveform display window, it is impossible to convert all the data stored in thememory 102 into waveform image data for display, and therefore, it is necessary to compress the data stored in thememory 102, that is, to extract a part of the data stored in thememory 102 as the first signal data. The extraction step value is a step value for extracting the first signal data from the data stored in thememory 102 in many ways, such as equal interval extraction, maximum-minimum extraction, and the like, wherein the equal interval extraction is data extraction in which one data point is extracted per step value data point of the extraction point in the stored data to acquire the first signal data.
For example: when the snapshot step value is 1, all data in the stored data are extracted as first signal data. For another example: when the snapshot step value is 2, every other data point in the stored data is extracted as the first signal data. And in the same way, the stored data can be extracted according to the snapshot stepping value so as to obtain the first signal data.
Thecontrol processing module 104 is configured to obtain a total pixel value of a waveform display window in the display interface, and detect the amount of data stored in thememory 102 in real time; when detecting that the data amount of the data stored in thememory 102 is an integral multiple of the total pixel value, updating the snapshot step value, and sending the updated snapshot step value to the data processing mapping module to update the waveform image data for display in the waveform display window.
In the present embodiment, the total pixel value of the waveform display window is one of a plurality of display parameters of the oscilloscope, which are defined by thecontrol processing module 104 according to an externally input command. In addition, thecontrol processing module 104 and thememory 102 can interact with each other to detect the data amount of the data stored in thememory 102 in real time, i.e., detect the data amount of the data recorded by the oscilloscope in real time.
Since the oscilloscope collects and stores data at a constant rate, the increase in the amount of data stored in thememory 102 is constant, i.e., the rate at which the oscilloscope records the data is constant. Therefore, when the amount of data stored in thememory 102 increases to an integral multiple of the total pixel value, the snapshot step value is updated, that is, the waveform image data displayed in the waveform display window is updated, so that the update rate of the waveform image data is constant, that is, the waveform image data is updated at a fixed time, and the waveform image data is updated every time the data point of the total pixel value is recorded, the update time is short, the observation efficiency of the data recording change trend is improved, and the user experience is enhanced.
In this embodiment, thecontrol processing module 104 updates the snapshot step value to a ratio of the data amount of the data stored in the memory to the total pixel value when detecting that the data amount of the data stored in thememory 102 is an integer multiple of the total pixel value.
Further, the initial value of the snapshot step value is 1. When it is detected that the data amount of the data stored in thememory 102 is smaller than the total pixel value, the snapshot step value is set to 1.
When the memory of the oscilloscope is full of recorded data, that is, when it is detected that the data amount of the data stored in the memory is greater than the preset data amount (the depth value of the memory), in an embodiment, the oscilloscope may be controlled to stop storing the data into thememory 102, that is, the oscilloscope stops recording the data, and at this time, the waveform displayed in the waveform display window does not change any more. In addition, in another embodiment, the data stored first in thememory 102 may be removed, so that a new storage space can be added in thememory 102 to store the newly acquired data in thememory 102, and thus, in the case that the depth value stored in thememory 102 is completely occupied, the data stored first in thememory 102 is removed and the new data is stored in thememory 102 each time the new data needs to be stored.
In one embodiment, the data amount of the data stored in the oscilloscope memory is n, the total pixel value (the maximum data amount that can be displayed by the waveform display window) is m, and the data amount of the data stored in the memory n is 0 when the oscilloscope is just started. When n is less than m, the snapshot step value s is 1, the waveforms corresponding to all the data currently stored in the memory are displayed in the waveform display window, and the width of the displayed waveforms is less than that of the waveform display window; when n = m, the snapshot step value s is 1, and at this time, the waveform corresponding to all the data currently stored in the memory is displayed in the waveform display window, and the width of the displayed waveform is equal to the width of the waveform display window; when m < n < 2m, the snapshot step value s is 1, and the waveform displayed when n = m is displayed in the waveform display window; when n =2m, the snapshot step value s is 2, and at this time, a waveform corresponding to data extracted from the memory with the snapshot step value of 2 is displayed in the waveform display window; and so on, when (x-1) × m < n < x × m, the snapshot step value s is x-1, and at this time, the waveform displayed when n = (x-1) × m is displayed in the waveform display window, namely, the waveform corresponding to the data extracted from the memory by the snapshot step value x-1; when n = x × m, the snapshot step value is x, and the waveform corresponding to the data extracted from the memory by the snapshot step value x is displayed in the waveform display window at this time. Table 1 shows a table of the relationship of the data amount n, the total pixel value m, and the snapshot step value s of the data stored in the memory.
TABLE 1
As can be seen from table 1, the time interval of updating the snapshot step value is fixed, that is, the time interval of updating the waveform image data in the waveform display window is fixed, and the time interval is the time of recording (acquiring and storing) m data points, so that the updating of the waveform image data does not slow down with the increase of the data amount of the recorded data, and the waveform image data can be displayed on the full screen, thereby improving the efficiency of observing the data recorded by the oscilloscope, and enhancing the user experience.
Referring to fig. 2, fig. 2 is a flowchart of a waveform display method based on the oscilloscope with the data recording function according to an embodiment, and the waveform display method is hereinafter referred to as a waveform display method, and is applied to a control processing module, and the waveform display method includes the following steps:
step 201: thecontrol processing module 104 acquires the total pixel value of a waveform display window in a display interface of the oscilloscope and detects the quantity of data stored in the memory in real time; wherein thememory 102 is used for storing signal data collected by the oscilloscope.
Step 202: thecontrol processing module 104 updates the snapshot step value to update the waveform image data for display in the waveform display window when detecting that the data amount of the data stored in thememory 102 is an integer multiple of the total pixel value; the snapshot step value is used for converting the data stored in the memory into waveform image data for displaying a waveform display window in the display interface.
In one embodiment, thestep 202 of updating the snapshot step value upon detecting that the data amount of the data stored in thememory 102 is an integer multiple of the total pixel value includes:
when detecting that the data amount of the data stored in the memory is an integer multiple of the total pixel value, the snapshot step value is updated to the ratio of the data amount of the data stored in thememory 102 to the total pixel value.
In this embodiment, the waveform display method further includes the steps of:
setting the snapshot step value to 1 upon detecting that the amount of data stored in thememory 102 is less than the total pixel value; moreover, when it is detected that the data amount of the data stored in thememory 102 is greater than the preset data amount, in an embodiment, the data storage to thememory 102 may be controlled to stop, that is, the oscilloscope stops recording the data, and at this time, the waveform displayed in the waveform display window does not change any more. In addition, in another embodiment, the data stored first in thememory 102 may be removed, so that a new storage space can be added in thememory 102 to store the newly acquired data in thememory 102, and thus, in the case that the depth value stored in thememory 102 is completely occupied, the data stored first in thememory 102 is removed and the new data is stored in thememory 102 each time the new data needs to be stored.
It should be noted that, the specific implementation method of the method steps provided in this embodiment has been described in detail in the embodiment shown in fig. 1, and is not described herein again.
Those skilled in the art will appreciate that all or part of the functions of the various methods in the above embodiments may be implemented by hardware, or may be implemented by computer programs. When all or part of the functions of the above embodiments are implemented by a computer program, the program may be stored in a computer-readable storage medium, and the storage medium may include: a read only memory, a random access memory, a magnetic disk, an optical disk, a hard disk, etc., and the program is executed by a computer to realize the above functions. For example, the program may be stored in a memory of the device, and when the program in the memory is executed by the processor, all or part of the functions described above may be implemented. In addition, when all or part of the functions in the above embodiments are implemented by a computer program, the program may be stored in a storage medium such as a server, another computer, a magnetic disk, an optical disk, a flash disk, or a removable hard disk, and may be downloaded or copied to a memory of a local device, or may be version-updated in a system of the local device, and when the program in the memory is executed by a processor, all or part of the functions in the above embodiments may be implemented.
The present invention has been described in terms of specific examples, which are provided to aid understanding of the invention and are not intended to be limiting. For a person skilled in the art to which the invention pertains, several simple deductions, modifications or substitutions may be made according to the idea of the invention.