CN117132682A - Waveform drawing method, device and equipment of lock-in amplifier and storage medium - Google Patents

Waveform drawing method, device and equipment of lock-in amplifier and storage medium Download PDF

Info

Publication number
CN117132682A
CN117132682A CN202311101592.1A CN202311101592A CN117132682A CN 117132682 A CN117132682 A CN 117132682A CN 202311101592 A CN202311101592 A CN 202311101592A CN 117132682 A CN117132682 A CN 117132682A
Authority
CN
China
Prior art keywords
time information
waveform data
drawing window
window
waveform
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311101592.1A
Other languages
Chinese (zh)
Inventor
徐翔
董莽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guoyi Qingneng Technology Chongqing Co ltd
Original Assignee
Guoyi Qingneng Technology Chongqing Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guoyi Qingneng Technology Chongqing Co ltd filed Critical Guoyi Qingneng Technology Chongqing Co ltd
Priority to CN202311101592.1A priority Critical patent/CN117132682A/en
Publication of CN117132682A publication Critical patent/CN117132682A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/203Drawing of straight lines or curves
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04845Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Artificial Intelligence (AREA)
  • Image Generation (AREA)

Abstract

The invention discloses a waveform drawing method, device and equipment of a lock-in amplifier and a storage medium. The method comprises the following steps: sampling waveform data of a lock-in amplifier cached in a database according to a preset rule to obtain a target waveform data set, wherein the waveform data in the target waveform data set comprises: waveform parameters and time information corresponding to the waveform parameters; subtracting the minimum time information in the target waveform data set from the initial time information corresponding to each waveform parameter in the target waveform data set to obtain a first waveform data set; determining drawing data corresponding to the current drawing window according to the first waveform data set and the parameter information of the current drawing window; according to the technical scheme, the data volume of drawing can be reduced, the calculated amount is reduced, the drawing efficiency is improved, the integrity of the waveform diagram is ensured, and the convenience of a user in checking the waveform diagram is improved.

Description

Waveform drawing method, device and equipment of lock-in amplifier and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a waveform drawing method, device and equipment of a lock-in amplifier and a storage medium.
Background
A lock-in amplifier (also called a phase detector) is an amplifier that can separate a signal of a specific carrier frequency from an environment where interference is great (signal-to-noise ratio can be as low as-60 dB, or even lower).
The phase-locked amplifier is used for measuring weak signals and has high noise suppression capability and phase measurement accuracy. The phase-locked amplifier is used for drawing data in a certain time period according to the needs of a user after measuring weak signals, and can acquire hundred megabytes of data in one second when sampling at a high speed, and under the sampling speed, if the data in a certain time period are required to be drawn completely, the data in several kilomega is required to be drawn in several tens of seconds, and the data exceeds the size of a memory operated by a system, so that the calculation amount is very large and the drawing efficiency is low.
Disclosure of Invention
The embodiment of the invention provides a waveform drawing method, a waveform drawing device, waveform drawing equipment and a waveform drawing storage medium of a lock-in amplifier, which can effectively reduce the data volume of drawing according to drawing data in a drawing window, further improve the drawing efficiency, and can effectively reduce the calculated amount by matching a database coordinate system through modifying time information of waveform data without modifying the database coordinate system, further improve the drawing efficiency, and can improve the convenience of a user for viewing the waveform diagram while ensuring the integrity of the waveform diagram through rolling display of the drawing window.
According to an aspect of the present invention, there is provided a waveform drawing method of a lock-in amplifier, including:
sampling waveform data of a lock-in amplifier cached in a database according to a preset rule to obtain a target waveform data set, wherein the waveform data in the target waveform data set comprises: waveform parameters and time information corresponding to the waveform parameters;
subtracting the minimum time information in the target waveform data set from the initial time information corresponding to each waveform parameter in the target waveform data set to obtain a first waveform data set;
determining drawing data corresponding to the current drawing window according to the first waveform data set and the parameter information of the current drawing window;
and drawing the target image according to drawing data corresponding to the current drawing window.
According to another aspect of the present invention, there is provided a waveform drawing apparatus of a lock-in amplifier, the waveform drawing apparatus of the lock-in amplifier including:
the sampling module is used for sampling the waveform data of the lock-in amplifier cached in the database according to a preset rule to obtain a target waveform data set, wherein the waveform data in the target waveform data set comprises: waveform parameters and time information corresponding to the waveform parameters;
The first waveform data set determining module is used for subtracting the minimum time information in the target waveform data set from the initial time information corresponding to each waveform parameter in the target waveform data set to obtain a first waveform data set;
the drawing data determining module is used for determining drawing data corresponding to the current drawing window according to the first waveform data set and the parameter information of the current drawing window;
and the image drawing module is used for drawing the target image according to drawing data corresponding to the current drawing window.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of waveform rendering of a lock-in amplifier according to any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to implement the waveform drawing method of the lock-in amplifier according to any one of the embodiments of the present invention when executed.
The embodiment of the invention obtains a target waveform data set by sampling waveform data of a lock-in amplifier cached in a database according to a preset rule, wherein the waveform data in the target waveform data set comprises: waveform parameters and time information corresponding to the waveform parameters; subtracting the minimum time information in the target waveform data set from the initial time information corresponding to each waveform parameter in the target waveform data set to obtain a first waveform data set; determining drawing data corresponding to the current drawing window according to the first waveform data set and the parameter information of the current drawing window; according to the drawing data corresponding to the current drawing window, the target image is drawn, the drawing data volume can be effectively reduced, the drawing efficiency is further improved, a database coordinate system is not required to be modified, the calculated amount is effectively reduced by modifying the time information of the waveform data to match the database coordinate system, the drawing efficiency is further improved, and moreover, the waveform diagram is rolled and displayed through the drawing window, so that the convenience of a user in checking the waveform diagram is improved while the integrity of the waveform diagram is ensured.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for waveform rendering of a lock-in amplifier in an embodiment of the invention;
fig. 2 is a schematic diagram of a waveform drawing apparatus of a lock-in amplifier according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device in an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It will be appreciated that prior to using the technical solutions disclosed in the embodiments of the present disclosure, the user should be informed and authorized of the type, usage range, usage scenario, etc. of the personal information related to the present disclosure in an appropriate manner according to the relevant legal regulations.
Example 1
Fig. 1 is a flowchart of a method for drawing a waveform of a lock-in amplifier according to an embodiment of the present invention, where the method may be performed by a device for drawing a waveform of a lock-in amplifier according to an embodiment of the present invention, and the device may be implemented in software and/or hardware, as shown in fig. 1, and the method specifically includes the following steps:
S110, sampling waveform data of a lock-in amplifier cached in a database according to a preset rule to obtain a target waveform data set, wherein the waveform data in the target waveform data set comprises: waveform parameters and time information corresponding to the waveform parameters.
Wherein the target waveform dataset comprises: at least two waveform data, each waveform data comprising: waveform parameters and time information corresponding to the waveform parameters. For example, the target waveform dataset may include: waveform data a (waveform parameter a and initial time information corresponding to waveform parameter a), waveform data B (waveform parameter B and initial time information corresponding to waveform parameter B), and waveform data C (waveform parameter C and initial time information corresponding to waveform parameter C).
Specifically, sampling waveform data of a lock-in amplifier cached in a database according to a preset rule, and obtaining a target waveform data set may be: and caching waveform data of the lock-in amplifier to a database at intervals of preset time to obtain a waveform data packet, and sampling at least one waveform data packet cached in the database to obtain a target waveform data set. For example, waveform data of a lock-in amplifier may be acquired; storing the waveform data of the lock-in amplifier into a database to obtain a waveform data packet set; determining the extraction point of each waveform data packet according to the sampling steps and the sampling point of the waveform data packet; determining sampling point interval time according to the sampling steps and the sampling intervals; and extracting the waveform data packet set according to the sampling point interval time and the extraction point number of each waveform data packet to obtain a target waveform data set.
S120, subtracting the minimum time information in the target waveform data set from the initial time information corresponding to each waveform parameter in the target waveform data set to obtain a first waveform data set.
The initial time information corresponding to each waveform parameter in the target waveform data set is an acquisition time stamp corresponding to each waveform parameter in the target waveform data set. And the minimum time information in the target waveform data set is the minimum value of the time information corresponding to the waveform parameters in the target waveform data set.
Specifically, the method for subtracting the minimum time information in the target waveform data set from the initial time information corresponding to each waveform parameter in the target waveform data set to obtain the first waveform data set may be: subtracting the minimum time information from the initial time information corresponding to each waveform parameter in the target waveform data set, wherein the waveform parameters are unchanged, and obtaining a first waveform data set. For example, the target waveform dataset may include: waveform data a (waveform parameter a and initial time information corresponding to waveform parameter a), waveform data B (waveform parameter B and initial time information corresponding to waveform parameter B), waveform data C (waveform parameter C and initial time information corresponding to waveform parameter C); initial time information corresponding to waveform parameter a < initial time information corresponding to waveform parameter b < initial time information corresponding to waveform parameter c; the first waveform dataset includes: waveform data a (waveform parameters a and 0), waveform data B (waveform parameter B and initial time information corresponding to waveform parameter B-initial time information corresponding to waveform parameter a), waveform data C (waveform parameter C and initial time information corresponding to waveform parameter C-initial time information corresponding to waveform parameter a).
And S130, determining drawing data corresponding to the current drawing window according to the first waveform data set and the parameter information of the current drawing window.
Specifically, the determining, according to the first waveform data set and the parameter information of the current drawing window, the drawing data corresponding to the current drawing window may be: if the current drawing window is the first drawing window, determining the minimum time information in the first waveform data set as the starting time information of the current drawing window, determining the ending time information of the current drawing window according to the minimum time information in the first waveform data set and the window time of the current drawing window, and screening the first waveform data set according to the starting time information and the ending time information of the current drawing window to obtain drawing data corresponding to the current drawing window; if the current drawing window is a non-first drawing window, determining drawing data corresponding to the current drawing window according to the sliding step length of the drawing window, the first waveform data set and the window time of the current drawing window.
It should be noted that, by scrolling the displayed waveform image through the sliding drawing window, the viewing experience of the user can be improved, and the method is convenient for determining the waveform change condition according to the displayed waveform image.
And S140, drawing the target image according to drawing data corresponding to the current drawing window.
Specifically, the method for drawing the target image according to the drawing data corresponding to the current drawing window may be: and acquiring a database coordinate system, and drawing the target image according to drawing data corresponding to the current drawing window and the database coordinate system.
Optionally, the parameter information of the current drawing window includes: window time of the current drawing window and sliding step length of the current drawing window;
determining drawing data corresponding to the current drawing window according to the first waveform data set and the parameter information of the current drawing window, wherein the method comprises the following steps:
if the current drawing window is the first drawing window, determining the minimum time information in the first waveform data set as the starting time information of the current drawing window, determining the ending time information of the current drawing window according to the minimum time information in the first waveform data set and the window time of the current drawing window, and screening the first waveform data set according to the starting time information and the ending time information of the current drawing window to obtain drawing data corresponding to the current drawing window;
if the current drawing window is not the first drawing window, determining drawing data corresponding to the current drawing window according to the sliding step length of the drawing window, the first waveform data set and the window time of the current drawing window.
The sliding step length of the current drawing window may be a set value, or may be determined according to a difference value between maximum time information and minimum time information corresponding to waveform data in the first waveform data set. The sliding step size of the current drawing window may be determined according to a difference between the time information with the smallest difference between the first waveform data set and the start time information of the previous drawing window. Or a difference between the ending time information of the previous drawing window and the starting time information of the previous drawing window may be determined as a sliding step size of the current drawing window. The difference between third time information and the start time information of the previous drawing window may be determined as a sliding step of the current drawing window, and the third time information may be a difference between the maximum time information in the first waveform data set and the window time of the current drawing window.
Specifically, if the current drawing window is not the first drawing window, the manner of determining the drawing data corresponding to the current drawing window according to the sliding step length of the drawing window, the first waveform data set and the window time of the current drawing window may be: if the current drawing window is not the first drawing window, acquiring the sliding step length of the current drawing window; determining the starting time information of the current drawing window according to the sliding step length of the drawing window and the starting time information of the last drawing window; determining the ending time information of the current drawing window according to the starting time information of the current drawing window and the window time of the drawing window; and if the ending time information of the current drawing window is smaller than or equal to the maximum time information in the first waveform data set, screening the first waveform data set according to the starting time information and the ending time information of the current drawing window to obtain drawing data corresponding to the current drawing window.
Optionally, if the current drawing window is not the first drawing window, determining drawing data corresponding to the current drawing window according to a sliding step length of the drawing window, the first waveform data set and a window time of the current drawing window, including:
if the current drawing window is not the first drawing window, acquiring the sliding step length of the current drawing window;
determining the starting time information of the current drawing window according to the sliding step length of the drawing window and the starting time information of the last drawing window;
determining the ending time information of the current drawing window according to the starting time information of the current drawing window and the window time of the drawing window;
and if the ending time information of the current drawing window is smaller than or equal to the maximum time information in the first waveform data set, screening the first waveform data set according to the starting time information and the ending time information of the current drawing window to obtain drawing data corresponding to the current drawing window.
The maximum time information in the first waveform data set is the maximum value of the time information corresponding to the waveform parameters in the first waveform data set.
Specifically, the method for determining the starting time information of the current drawing window according to the sliding step length of the drawing window and the starting time information of the last drawing window may be: and determining the sum of the sliding step length of the drawing window and the starting time information of the last drawing window as the starting time information of the current drawing window.
Specifically, the manner of determining the ending time information of the current drawing window according to the starting time information of the current drawing window and the window time of the drawing window may be: and determining the sum of the starting time information of the current drawing window and the window time of the drawing window as the ending time information of the current drawing window.
Specifically, if the ending time information of the current drawing window is less than or equal to the maximum time information in the first waveform data set, the manner of filtering the first waveform data set according to the starting time information and ending time information of the current drawing window to obtain drawing data corresponding to the current drawing window may be: and if the ending time information of the current drawing window is smaller than or equal to the maximum time information in the first waveform data set, determining the waveform data between the starting time information and the ending time information of the current drawing window in the first waveform data set as the drawing data.
Optionally, acquiring a sliding step length of the current drawing window includes:
acquiring minimum time information corresponding to waveform parameters in a first waveform data set;
and determining the sliding step length of the current drawing window according to the difference value of the maximum time information and the minimum time information.
The minimum time information is the minimum value of time information corresponding to the waveform parameters in the first waveform data set.
Specifically, the manner of determining the sliding step length of the current drawing window according to the difference value between the maximum time information and the minimum time information may be: if the difference value between the maximum time information and the minimum time information is smaller than a difference value threshold value, determining a first numerical value as the sliding step length of the current drawing window; and if the difference value between the maximum time information and the minimum time information is greater than or equal to a difference threshold value, determining a second numerical value as a sliding step length of the current drawing window, wherein the second numerical value is greater than the first numerical value. The manner of determining the sliding step length of the current drawing window according to the difference value between the maximum time information and the minimum time information may be: if the difference value between the maximum time information and the minimum time information is smaller than a difference value threshold value, acquiring the starting time information of the previous drawing window; acquiring first time information with the smallest difference value between the first waveform data set and the starting time information of the previous drawing window; and determining the difference value between the first time information and the starting time information of the previous drawing window as the sliding step length of the current drawing window. If the difference value between the maximum time information and the minimum time information is greater than or equal to a difference value threshold value, acquiring the starting time information and the ending time information of the previous drawing window; and determining the difference value between the ending time information of the previous drawing window and the starting time information of the previous drawing window as the sliding step length of the current drawing window.
Optionally, determining the sliding step length of the current drawing window according to the difference value between the maximum time information and the minimum time information includes:
if the difference value between the maximum time information and the minimum time information is smaller than a difference value threshold value, acquiring the starting time information of the previous drawing window;
acquiring first time information with the smallest difference value between the first waveform data set and the starting time information of the previous drawing window;
and determining the difference value between the first time information and the starting time information of the previous drawing window as the sliding step length of the current drawing window.
The difference threshold may be a preset value, which is not limited in the embodiment of the present invention.
Specifically, the method for obtaining the first time information with the smallest difference between the first waveform data set and the start time information of the previous drawing window may be: and acquiring a difference value between time information corresponding to each waveform parameter in the first waveform data set and the starting time information of the previous drawing window, and determining the time information with the minimum difference value between the first waveform data set and the starting time information of the previous drawing window as first time information.
Optionally, determining the sliding step length of the current drawing window according to the difference value between the maximum time information and the minimum time information includes:
If the difference value between the maximum time information and the minimum time information is greater than or equal to a difference value threshold value, acquiring the starting time information and the ending time information of the previous drawing window;
if the difference value between the maximum time information and the second time information in the first waveform data set is greater than or equal to a set threshold value, determining the difference value between the ending time information of the previous drawing window and the starting time information of the previous drawing window as a sliding step length of the current drawing window, wherein the second time information is equal to the sum of the ending time information of the previous drawing window and the window time of the current drawing window.
The set threshold may be preset time information, where the set threshold is equal to a window time of n×a drawing window, and N is an integer greater than or equal to zero.
If the difference between the maximum time information and the second time information in the first waveform data set is greater than or equal to the set threshold, it is indicated that the remaining waveform data in the first waveform data set is greater than or equal to the drawing data corresponding to at least one drawing window. That is, if the remaining waveform data in the first waveform data set is smaller than the drawing data corresponding to one drawing window, the difference between the ending time information of the previous drawing window and the starting time information of the previous drawing window cannot be determined as the sliding step length of the current drawing window, and if the difference between the ending time information of the previous drawing window and the starting time information of the previous drawing window is determined as the sliding step length of the current drawing window, the waveform drawn by the current drawing window is incomplete, which affects the user's viewing experience.
Optionally, the method further comprises:
if the difference value between the maximum time information and the second time information in the first waveform data set is smaller than a set threshold value, acquiring third time information, wherein the third time information is the difference value between the maximum time information in the first waveform data set and the window time of the current drawing window;
and determining the difference value between the third time information and the starting time information of the previous drawing window as the sliding step length of the current drawing window.
If the difference between the maximum time information and the second time information in the first waveform data set is smaller than the set threshold, it is indicated that the remaining waveform data in the first waveform data set is smaller than the drawing data corresponding to one drawing window, so that in order to improve the user experience of viewing, the sliding step length of the current drawing window needs to be changed to enable all the data in the first waveform data set to be displayed in a rolling manner. It should be noted that, the drawing window is not a visual window displayed on the display screen, but is a time window, so as to facilitate drawing parameters set by the image, and the image is drawn based on the set drawing window, so that the drawn image can be displayed in a rolling manner, and the user can view the drawn image conveniently.
If the difference between the maximum time information and the minimum time information is greater than or equal to the difference threshold, it is indicated that the time corresponding to the waveform parameter in the first waveform data set is longer, and therefore, a larger sliding step is required to be set. If the difference between the maximum time information and the minimum time information is smaller than the difference threshold, it is indicated that the time corresponding to the waveform parameter in the first waveform data set is shorter, and therefore, a smaller sliding step is required to be set.
Optionally, sampling the waveform data of the lock-in amplifier cached in the database according to a preset rule to obtain a target waveform data set, including:
acquiring waveform data of a lock-in amplifier;
storing the waveform data of the lock-in amplifier into a database to obtain a waveform data packet set;
determining the extraction point of each waveform data packet according to the sampling steps and the sampling point of the waveform data packet;
determining sampling point interval time according to the sampling steps and the sampling intervals;
and extracting the waveform data packet set according to the sampling point interval time and the extraction point number of each waveform data packet to obtain a target waveform data set.
Wherein the waveform data is a two-dimensional array, comprising: time stamps on the x-axis and waveform parameters on the y-axis.
Specifically, the manner of determining the extraction point of each waveform data packet according to the sampling steps and the sampling point of the waveform data packet may be: determining sampling steps according to the number of uploading packets per second, the number of data packet sampling points (preset fixed value) and the current sampling time; and determining the extraction point of each waveform data packet according to the sampling step and the sampling point of the waveform data packet. For example, the sampling step may be determined based on the following formula:
sample step = number of upload packets per second × number of data packet samples × current sample time/total number of single line drawings.
Wherein the number of upload packets per second = 1 s/packet transmission interval. The data packet transmission interval is preset time, the data packet sampling point number is preset sampling point number, the current sampling time is preset time, the current sampling time is required to be longer than the window time of the drawing window, the total single line drawing point number is preset drawing point number, the total single line drawing point number is related to definition, and definition needs to be ensured when setting is carried out.
Determining the extraction point of each waveform data packet based on the following formula:
the number of samples per packet (rounded down) =the number of samples per packet/step of samples.
Specifically, the manner of determining the sampling point interval time according to the sampling step and the sampling interval may be: the sampling point interval time is determined based on the following formula:
dot interval time = sample step × sample interval.
The sampling interval is a preset value, and it is to be noted that when the number of data packet sampling points is large, the sampling interval is small, and when the number of data packet sampling points is small, the sampling interval is large.
In a specific example, the waveform data extraction method includes the steps of:
step 1, acquiring waveform data of a lock-in amplifier;
step 2: caching the waveform data into a database to obtain a waveform data packet set (generally, caching every 50MS to obtain a waveform data packet);
step 3: extracting the cached waveform data according to a sampling rule to obtain a target waveform data set, wherein the sampling rule comprises:
and extracting the waveform data packet set according to the sampling point interval time and each waveform data packet extraction point.
It should be noted that, in the embodiment of the present invention, sampling steps are calculated according to the number of waveform data buffered in the database, then the number of extraction points and sampling point interval time of each waveform data packet are determined according to the sampling steps, waveform data is sequentially extracted from each waveform data packet according to the sampling point interval time, a target waveform data set is obtained, and drawing data is extracted from the target waveform data set, so that not only can the trend of drawing a waveform diagram be ensured, but also the data volume can be effectively reduced, and the drawing efficiency is improved.
Optionally, drawing the target image according to drawing data corresponding to the current drawing window includes:
subtracting the time information corresponding to the first drawing data corresponding to the current drawing window from the time information corresponding to each drawing data in the drawing data corresponding to the current drawing window to obtain target data corresponding to the current drawing window;
and drawing a target image according to the target data.
It should be noted that, the coupling degree between the database coordinate system and the waveform data is very high, and the change of the database coordinate system requires complex modification of the source code, so that the difficulty coefficient is high. According to the embodiment of the invention, the time information of the drawing data is modified, so that the drawing data after the time information is modified can be matched with the coordinate system, the coordinate system is not required to be modified, the calculated amount is reduced, the difficulty of data processing is reduced, and the drawing efficiency is improved.
Optionally, determining drawing data corresponding to the current drawing window according to the first waveform data set and the parameter information of the current drawing window, and drawing the target image according to the drawing data corresponding to the current drawing window, including:
determining target time information according to the minimum time information of the first waveform data set and the window time of the current drawing window;
Determining waveform data between the minimum time information and the target time information in the first waveform data set as first frame drawing data corresponding to the current drawing window;
subtracting the target offset from the time information corresponding to all waveform parameters in the first waveform data set to obtain a second waveform data set, wherein the target offset is equal to the difference value between the second time information corresponding to the previous frame and the first time information corresponding to the previous frame;
deleting the waveform data with the time information smaller than zero in the second waveform data set to obtain a third waveform data set;
and determining waveform data smaller than or equal to the maximum time information corresponding to the current drawing window in the third waveform data set as non-first frame drawing data corresponding to the current drawing window.
Optionally, the way of drawing the target image according to the drawing data corresponding to the current drawing window may be:
drawing at least one frame of image according to the first frame drawing data and the non-first frame drawing data in sequence;
and scrolling and displaying each frame of image according to the generation sequence of each frame of image.
In a specific example, the drawing method includes the steps of:
step 1: acquiring minimum time information t_min in a target waveform data set and window time T of a drawing window;
Step 2: taking the minimum time information t_min in the target waveform data set as a first bias, and subtracting the minimum time information t_min from the initial time information corresponding to all waveform parameters in the target waveform data set; obtaining a first waveform data set, wherein time information corresponding to each waveform parameter in the first waveform data set is a numerical value of an X axis of a coordinate system, and at the moment, the minimum time information t_min is 0, so that the waveform data corresponding to the minimum time information t_min is an origin of the coordinate system;
step 3: drawing waveform data in window time T of a drawing window;
step 4: subtracting the second offset from the time information corresponding to all waveform parameters in the first waveform data set (that is, the sliding step length of the drawing window, for example, when step 4 is executed for the first time, the second offset is obtained by subtracting the time information t0 corresponding to the first waveform parameter from the time information t1 corresponding to the second waveform parameter in the first waveform data set), and when the time information after subtracting the second offset is less than 0, removing the waveform data in the current drawing window;
step 5: determining whether the time information T1 corresponding to the waveform parameters in the first waveform data set after subtracting the second bias is smaller than or equal to the ending time information T_max of the current drawing window (the starting time information T_min of the current drawing window is the origin of the x axis);
Step 6: if T1 is less than or equal to T_max, drawing the waveform data in a drawing window, otherwise, not processing; the time stamp of the waveform data is an X-axis coordinate, and the waveform parameter is a Y-axis coordinate;
step 7: repeating steps 4-6 until all waveform data in the first waveform data set is completely drawn within the drawing window.
According to the technical scheme of the embodiment, a target waveform data set is obtained by sampling waveform data of a lock-in amplifier cached in a database according to a preset rule, wherein the waveform data in the target waveform data set comprises: waveform parameters and time information corresponding to the waveform parameters; subtracting the minimum time information in the target waveform data set from the initial time information corresponding to each waveform parameter in the target waveform data set to obtain a first waveform data set; determining drawing data corresponding to the current drawing window according to the first waveform data set and the parameter information of the current drawing window; according to the drawing data corresponding to the current drawing window, the target image is drawn, the drawing data volume can be effectively reduced, the drawing efficiency is further improved, a database coordinate system is not required to be modified, the calculated amount is effectively reduced by modifying the time information of the waveform data to match the database coordinate system, the drawing efficiency is further improved, and moreover, the waveform diagram is rolled and displayed through the drawing window, so that the convenience of a user in checking the waveform diagram is improved while the integrity of the waveform diagram is ensured.
Example two
Fig. 2 is a schematic diagram of a waveform drawing apparatus of a lock-in amplifier according to an embodiment of the present invention. The embodiment may be applied to the waveform drawing situation of the lock-in amplifier, and the device may be implemented in a software and/or hardware manner, and the device may be integrated in any device that provides the waveform drawing function of the lock-in amplifier, as shown in fig. 2, where the waveform drawing device of the lock-in amplifier specifically includes: the sampling module 210, the first waveform dataset determination module 220, the drawing data determination module 230, and the image drawing module 240.
The sampling module is used for sampling the waveform data of the lock-in amplifier cached in the database according to a preset rule to obtain a target waveform data set, wherein the waveform data in the target waveform data set comprises: waveform parameters and time information corresponding to the waveform parameters;
the first waveform data set determining module is used for subtracting the minimum time information in the target waveform data set from the initial time information corresponding to each waveform parameter in the target waveform data set to obtain a first waveform data set;
the drawing data determining module is used for determining drawing data corresponding to the current drawing window according to the first waveform data set and the parameter information of the current drawing window;
And the image drawing module is used for drawing the target image according to drawing data corresponding to the current drawing window.
The product can execute the method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example III
Fig. 3 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 3, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may 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 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various 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, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the respective methods and processes described above, for example, a waveform drawing method of a lock-in amplifier.
In some embodiments, the waveform rendering method of the lock-in amplifier may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto 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 above-described waveform drawing method of the lock-in amplifier may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the phase-locked amplifier waveform rendering method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out 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, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can 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 a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, 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, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (11)

1. A waveform drawing method of a lock-in amplifier, comprising:
sampling waveform data of a lock-in amplifier cached in a database according to a preset rule to obtain a target waveform data set, wherein the waveform data in the target waveform data set comprises: waveform parameters and time information corresponding to the waveform parameters;
subtracting the minimum time information in the target waveform data set from the initial time information corresponding to each waveform parameter in the target waveform data set to obtain a first waveform data set;
Determining drawing data corresponding to the current drawing window according to the first waveform data set and the parameter information of the current drawing window;
and drawing the target image according to drawing data corresponding to the current drawing window.
2. The method of claim 1, wherein the parameter information of the current drawing window comprises: window time of the current drawing window and sliding step length of the current drawing window;
determining drawing data corresponding to the current drawing window according to the first waveform data set and the parameter information of the current drawing window, wherein the method comprises the following steps:
if the current drawing window is the first drawing window, determining the minimum time information in the first waveform data set as the starting time information of the current drawing window, determining the ending time information of the current drawing window according to the minimum time information in the first waveform data set and the window time of the current drawing window, and screening the first waveform data set according to the starting time information and the ending time information of the current drawing window to obtain drawing data corresponding to the current drawing window;
if the current drawing window is not the first drawing window, determining drawing data corresponding to the current drawing window according to the sliding step length of the drawing window, the first waveform data set and the window time of the current drawing window.
3. The method of claim 2, wherein if the current drawing window is not the first drawing window, determining drawing data corresponding to the current drawing window according to a sliding step size of the drawing window, the first waveform data set, and a window time of the current drawing window, comprises:
if the current drawing window is not the first drawing window, acquiring the sliding step length of the current drawing window;
determining the starting time information of the current drawing window according to the sliding step length of the drawing window and the starting time information of the last drawing window;
determining the ending time information of the current drawing window according to the starting time information of the current drawing window and the window time of the drawing window;
and if the ending time information of the current drawing window is smaller than or equal to the maximum time information in the first waveform data set, screening the first waveform data set according to the starting time information and the ending time information of the current drawing window to obtain drawing data corresponding to the current drawing window.
4. The method of claim 3, wherein obtaining the sliding step size of the current drawing window comprises:
acquiring minimum time information corresponding to waveform parameters in a first waveform data set;
And determining the sliding step length of the current drawing window according to the difference value of the maximum time information and the minimum time information.
5. The method of claim 4, wherein determining the sliding step size of the current drawing window based on the difference between the maximum time information and the minimum time information comprises:
if the difference value between the maximum time information and the minimum time information is smaller than a difference value threshold value, acquiring the starting time information of the previous drawing window;
acquiring first time information with the smallest difference value between the first waveform data set and the starting time information of the previous drawing window;
and determining the difference value between the first time information and the starting time information of the previous drawing window as the sliding step length of the current drawing window.
6. The method of claim 4, wherein determining the sliding step size of the current drawing window based on the difference between the maximum time information and the minimum time information comprises:
if the difference value between the maximum time information and the minimum time information is greater than or equal to a difference value threshold value, acquiring the starting time information and the ending time information of the previous drawing window;
if the difference value between the maximum time information and the second time information in the first waveform data set is greater than or equal to a set threshold value, determining the difference value between the ending time information of the previous drawing window and the starting time information of the previous drawing window as a sliding step length of the current drawing window, wherein the second time information is equal to the sum of the ending time information of the previous drawing window and the window time of the current drawing window.
7. The method as recited in claim 6, further comprising:
if the difference value between the maximum time information and the second time information in the first waveform data set is smaller than a set threshold value, acquiring third time information, wherein the third time information is the difference value between the maximum time information in the first waveform data set and the window time of the current drawing window;
and determining the difference value between the third time information and the starting time information of the previous drawing window as the sliding step length of the current drawing window.
8. The method of claim 1, wherein sampling the waveform data of the lock-in amplifier cached in the database according to a predetermined rule to obtain the target waveform data set comprises:
acquiring waveform data of a lock-in amplifier;
storing the waveform data of the lock-in amplifier into a database to obtain a waveform data packet set;
determining the extraction point of each waveform data packet according to the sampling steps and the sampling point of the waveform data packet;
determining sampling point interval time according to the sampling steps and the sampling intervals;
and extracting the waveform data packet set according to the sampling point interval time and the extraction point number of each waveform data packet to obtain a target waveform data set.
9. A waveform drawing apparatus of a lock-in amplifier, comprising:
the sampling module is used for sampling the waveform data of the lock-in amplifier cached in the database according to a preset rule to obtain a target waveform data set, wherein the waveform data in the target waveform data set comprises: waveform parameters and time information corresponding to the waveform parameters;
the first waveform data set determining module is used for subtracting the minimum time information in the target waveform data set from the initial time information corresponding to each waveform parameter in the target waveform data set to obtain a first waveform data set;
the drawing data determining module is used for determining drawing data corresponding to the current drawing window according to the first waveform data set and the parameter information of the current drawing window;
and the image drawing module is used for drawing the target image according to drawing data corresponding to the current drawing window.
10. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the waveform drawing method of the lock-in amplifier of any one of claims 1 to 8.
11. A computer readable storage medium storing computer instructions for causing a processor to implement the method of waveform rendering of a lock-in amplifier of any one of claims 1-8 when executed.
CN202311101592.1A 2023-08-29 2023-08-29 Waveform drawing method, device and equipment of lock-in amplifier and storage medium Pending CN117132682A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311101592.1A CN117132682A (en) 2023-08-29 2023-08-29 Waveform drawing method, device and equipment of lock-in amplifier and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311101592.1A CN117132682A (en) 2023-08-29 2023-08-29 Waveform drawing method, device and equipment of lock-in amplifier and storage medium

Publications (1)

Publication Number Publication Date
CN117132682A true CN117132682A (en) 2023-11-28

Family

ID=88859486

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311101592.1A Pending CN117132682A (en) 2023-08-29 2023-08-29 Waveform drawing method, device and equipment of lock-in amplifier and storage medium

Country Status (1)

Country Link
CN (1) CN117132682A (en)

Similar Documents

Publication Publication Date Title
CN114623939A (en) Method, device, equipment and medium for determining pulse frequency
CN115205163B (en) Method, device and equipment for processing identification image and storage medium
CN117132682A (en) Waveform drawing method, device and equipment of lock-in amplifier and storage medium
CN115131315A (en) Image change detection method, device, equipment and storage medium
CN115599687A (en) Method, device, equipment and medium for determining software test scene
CN115665285A (en) Data processing method and device, electronic equipment and storage medium
CN115328736A (en) Probe deployment method, device, equipment and storage medium
CN117132681A (en) Waveform drawing method, device and equipment of lock-in amplifier and storage medium
CN114692987A (en) Time sequence data analysis method, device, equipment and storage medium
CN117132678A (en) Image generation method, device, equipment and storage medium
CN114581711A (en) Target object detection method, apparatus, device, storage medium, and program product
CN116974856B (en) Method, device, equipment and medium for automatically acquiring log file
CN117292843B (en) Electrical signal data processing method, apparatus, device and storage medium
CN115333715B (en) Synchronization method, device, communication equipment and medium of narrowband communication system
CN116028228A (en) Bitmap memory occupation detection method, device, equipment and storage medium
CN117150215B (en) Assessment result determining method and device, electronic equipment and storage medium
CN115237880A (en) Method, device and equipment for detecting abnormity of time sequence data and storage medium
CN116975653A (en) Sample information determining method and device, electronic equipment and storage medium
CN115079255A (en) Method, device and equipment for improving seismic data resolution and readable medium
CN116225568A (en) Management method, device and equipment of application system interface and storage medium
CN116664427A (en) Image processing method, device, equipment and storage medium
CN117271289A (en) Webpage monitoring method, device, equipment and storage medium
CN114691495A (en) Applet performance calibration method and device, electronic equipment and storage medium
CN116609825A (en) Stratum absorption attenuation parameter estimation method and device, electronic equipment and storage medium
CN117972469A (en) Igneous rock classification and identification method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination