An oscilloscope method of a virtual oscilloscope, virtual oscilloscope

CN122597549APending Publication Date: 2026-08-18KINCO ELECTRIC SHENZHEN
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610703453.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-20
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

当面对百万级高频采样点或多通道信号并行展示场景时会衍生出大量独立页面元素,一旦执行波形缩放、平移或是框选查看小段区间等视图交互操作,需遍历全部采样点对应的独立图形元素,逐个重绘,容易出现画面卡顿、系统资源占用过高、开销过大的问题

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122597549A_ABST
    Figure CN122597549A_ABST
Patent Text Reader

Abstract

The application discloses a virtual oscilloscope and an oscilloscope method thereof. The method comprises the following steps: receiving a plurality of sampling data sets, each sampling data set comprising a sampling value and a first index value of the sampling value, the first index value being used to represent a sampling serial number of the sampling value; obtaining a preset first waveform configuration parameter and a second waveform configuration parameter, the first waveform configuration parameter being an X-axis mapping parameter of a waveform diagram, and the second waveform configuration parameter being a Y-axis mapping parameter of the waveform diagram; for each sampling data set, determining a corresponding X-axis coordinate based on the first index value and the first waveform configuration parameter, and determining a corresponding Y-axis coordinate based on the sampling value and the second waveform configuration parameter; drawing the waveform diagram based on the X-axis coordinates and the Y-axis coordinates of the plurality of sampling data sets; receiving a view transformation instruction of a user; and performing view transformation on the entire waveform diagram based on the view transformation instruction. The application can perform view transformation on the entire pixel diagram, thereby avoiding management overhead of a large number of independent graphic objects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of computer software and electronic measurement data visualization technology, and in particular to an oscilloscope method and a virtual oscilloscope. Background Technology

[0002] As web front-end technology continues to develop and improve, the functions of hardware oscilloscopes are gradually being migrated to pure web-based implementations.

[0003] Existing web waveform visualization solutions mostly use SVG or ordinary DOM elements to draw waveforms. These solutions employ a discrete drawing architecture, where each sampling point corresponds to an independent graphical element and is mounted in the web page rendering structure. When faced with scenarios involving millions of high-frequency sampling points or parallel display of multi-channel signals, a large number of independent page elements will be generated. Once interactive operations such as waveform scaling, panning, or selecting and viewing small segments are performed, it is necessary to traverse all the independent graphic elements corresponding to the sampling points and redraw them one by one, which can easily lead to problems such as screen lag, excessive system resource consumption, and excessive overhead. Summary of the Invention

[0004] In view of the above-mentioned defects or deficiencies in the prior art, it is desirable to provide a virtual oscilloscope method and a virtual oscilloscope that can directly draw a pixel map based on pixel coordinates and perform view transformation on the entire pixel map, avoiding the management overhead of relying on a large number of independent graphic objects, thereby maintaining real-time and smooth interaction of view transformation operation at high frequency sampling points.

[0005] In a first aspect, this application discloses an oscilloscope method for a virtual oscilloscope, applied to a virtual oscilloscope, the method comprising: Receive multiple sampled data groups, each sampled data group including a sampled value and a first index value of the sampled value, the first index value being used to characterize the sampled sequence number of the sampled value; Obtain preset first waveform configuration parameters and second waveform configuration parameters. The first waveform configuration parameters are the X-axis mapping parameters of the waveform graph, and the second waveform configuration parameters are the Y-axis mapping parameters of the waveform graph. For each sampled data group, the corresponding X-axis coordinate is determined based on the first index value and the first waveform configuration parameter, and the corresponding Y-axis coordinate is determined based on the sampled value and the second waveform configuration parameter; Waveform plotted based on the X-axis and Y-axis coordinates of multiple sampled data sets; Receive the user's view transformation command, which includes the view transformation type, the center reference of the view transformation, and the view transformation parameters; The view transformation is performed on the entire waveform diagram based on the view transformation command.

[0006] In conjunction with the first aspect, in one possible implementation, the view transformation parameters include the view transformation direction and the view transformation magnitude. Then, the view transformation is performed on the entire waveform based on the view transformation command, specifically as follows: The first waveform configuration parameters and / or the second waveform configuration parameters are adjusted based on the view transformation amplitude, while keeping the position of the center reference unchanged during the adjustment process, so that the viewport of the waveform changes in the view transformation direction.

[0007] In conjunction with the first aspect, in one possible implementation, the first waveform configuration parameter includes a first offset and a first scaling factor; the first offset is used to characterize the starting position of the waveform on the X-axis, and the first scaling factor is used to characterize the pixel spacing of the unit offset of the first index value in the X-axis direction. The method also includes: Get the first query coordinate of the X-axis input by the user; The second index value corresponding to the first query coordinate is determined based on the first offset, the first scaling factor, and the first query coordinate. The second index value is rounded down, and the sampled value corresponding to the first query coordinate is determined based on the rounded second index value.

[0008] In conjunction with the first aspect, in one possible implementation, the second index value is rounded down, and the sampled value corresponding to the first query coordinate is determined based on the rounded second index value, specifically as follows: Determine whether the second index value is an integer. If it is, then determine the sample value corresponding to the second index value as the sample value corresponding to the first query coordinate. If not, then the second index value is rounded up to obtain the first rounded value, and the second index value is rounded down to obtain the second rounded value; A first candidate sample value is determined based on a first rounded value; and a second candidate sample value is determined based on a second rounded value. Linear interpolation is performed on the first candidate sample value and the second candidate sample value to obtain the sample value corresponding to the first query coordinate.

[0009] In conjunction with the first aspect, in one possible implementation, the second waveform configuration parameter includes a second offset and a second scaling factor; the second offset is used to characterize the starting position of the waveform on the Y-axis, and the second scaling factor is used to characterize the pixel spacing of the unit offset of the sampled value in the Y-axis direction. The method also includes: Get the second query coordinate of the Y-axis input by the user; The sampled value corresponding to the second query coordinate is determined based on the second offset, the second scaling factor, and the second query coordinate.

[0010] In conjunction with the first aspect, one possible implementation method also includes: Obtain the start and end coordinates input by the user. The start and end coordinates are used to limit the user's query range in the X-axis direction. Based on the configuration parameters of the first waveform, the coordinates of the start and end points are mapped to obtain the index interval, which includes multiple first index values ​​within the query range; Aggregate the sampled values ​​corresponding to multiple first index values ​​within the index interval. The aggregation operation is at least one of the following: accumulation operation, mean square product summation, minimum value tracking, maximum value tracking, effective sample counting, mean calculation, root mean square calculation, and range calculation.

[0011] In conjunction with the first aspect, one possible implementation method also includes: Obtain the coordinates of the first boundary of the drawing interface, which is the display medium for the waveform diagram; The second boundary coordinates are determined based on the first boundary coordinates. The second boundary coordinates are used to limit the display area of ​​the aggregation calculation results in the drawing interface. The results of the aggregation calculation are displayed in a floating manner based on the second boundary coordinates.

[0012] In conjunction with the first aspect, in one possible implementation, linear interpolation is performed on the first candidate sample value and the second candidate sample value to obtain the sample value corresponding to the first query coordinate, specifically as follows: Determine a first difference between the first rounded value and the second index value, or a second difference between the second rounded value and the second index value; The interpolation weights are determined based on either the first or second difference. Linear interpolation is performed on the first candidate sample value and the second candidate sample value based on the interpolation weight to obtain the sample value corresponding to the first query coordinate.

[0013] Secondly, this application also discloses a virtual oscilloscope, which includes: The interface module is used to receive multiple sampled data groups. Each sampled data group includes a sampled value and a first index value of the sampled value. The first index value is used to represent the sampling sequence number of the sampled value. The mapping module is used to obtain preset first waveform configuration parameters and second waveform configuration parameters. The first waveform configuration parameters are the X-axis mapping parameters of the waveform graph, and the second waveform configuration parameters are the Y-axis mapping parameters of the waveform graph. The coordinate module is used to determine the corresponding X-axis coordinate for each sampled data group based on the first index value and the first waveform configuration parameters, and to determine the corresponding Y-axis coordinate based on the sampled value and the second waveform configuration parameters. The plotting module is used to plot waveforms based on the X-axis and Y-axis coordinates of multiple sampled data sets. The interaction module is used to receive view transformation commands from users. The view transformation commands include view transformation type, view transformation center reference, and view transformation parameters. The transformation module is used to perform view transformations on the entire waveform diagram based on view transformation commands.

[0014] In conjunction with the second aspect, in one possible implementation, the coordinate module is a React data-driven front-end rendering component; The drawing module is a single-layer / multi-layer HTML5 Canvas component. Attached Figure Description

[0015] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 This is a schematic diagram of the structure of the virtual oscilloscope of this application in one embodiment; Figure 2 This is a flowchart illustrating the method of this application in one embodiment; Figure 3 This is another flowchart illustrating the method of this application in one embodiment; Figure 4 This is a schematic diagram of another process of the method of this application in one embodiment. Detailed Implementation

[0016] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.

[0017] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The present application will now be described in detail with reference to the accompanying drawings and embodiments. Furthermore, the term "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. The terms "first" and "second," etc., in the specification and claims of the embodiments of this application are used to distinguish different objects, not to describe a specific order of objects.

[0018] Traditional hardware oscilloscopes are widely used in electronic engineering and signal acquisition, but these physical devices are not very portable and are difficult to integrate with today's mainstream cloud-based business systems. With the continuous development and improvement of web front-end technologies, the functionality of hardware oscilloscopes is gradually migrating to purely web-based interfaces.

[0019] Existing web waveform visualization solutions mostly use SVG or ordinary DOM elements to draw waveforms. These solutions employ a discrete drawing architecture, where each signal sampling point generates an independent graphic element and is mounted in the web page rendering structure. This makes it impossible to merge massive sampling points into a unified display. When faced with scenarios involving millions of high-frequency sampling points or parallel display of multi-channel signals, a large number of independent page elements are generated. Furthermore, browsers do not have the ability to load and calculate only local intervals. Once interactive operations such as waveform scaling, panning, or selecting small intervals are performed, it is still necessary to traverse all the independent elements corresponding to all sampling points, recalculate the coordinates, size, and display position of each one, and complete the layout redraw. This significantly increases the overall computational and rendering load, leading to problems such as screen stuttering, excessive system resource consumption, and excessive redrawing overhead. This is an inherent defect of the SVG and DOM discrete drawing architecture, which creates performance bottlenecks in large-scale data application scenarios.

[0020] In addition, existing web waveform solutions can only be fixed at preset sampling points when using measurement cursors to measure waveform parameters. They cannot perform fine interpolation calculations at arbitrary positions on the waveform. They also lack integrated processing capabilities to perform in-depth data calculation and analysis such as root mean square and extreme value difference in real time for waveform areas defined by the user.

[0021] Based on this, embodiments of this application provide an oscilloscope method for a virtual oscilloscope and a virtual oscilloscope that can directly draw a pixel map based on pixel coordinates and perform view transformation on the entire pixel map, avoiding the management overhead of relying on a large number of independent graphic objects, thereby maintaining real-time and smooth interaction of view transformation operations at high-frequency sampling points.

[0022] The method provided in this application embodiment can be applied to, for example... Figure 4 The virtual oscilloscope 40 shown is deployed in a web browser and includes: Interface module 401 is used to receive multiple sampled data groups, each sampled data group including a sampled value and a first index value of the sampled value, the first index value being used to characterize the sampled sequence number of the sampled value; Specifically, the interface module 401 can be a hardware backend, serving as the basic data access unit for the virtual oscilloscope. The interface module 401 communicates with external data acquisition cards and browsers respectively, and is used to send high-density sampled data groups through WebSocket or other channels and transmit them to the browser webpage, providing a basic data source for subsequent waveform drawing, vernier measurement, and aggregation calculation.

[0023] In one possible implementation, the high-density sampling array issued by the hardware backend is not immediately used for pixel projection, but is instead maintained in the virtual off-screen memory (Virtual Data Domain) of the browser webpage.

[0024] The mapping module 402 is used to obtain preset first waveform configuration parameters and second waveform configuration parameters. The first waveform configuration parameters are the X-axis mapping parameters of the waveform diagram, and the second waveform configuration parameters are the Y-axis mapping parameters of the waveform diagram. Specifically, the mapping module 402 is used to maintain the bidirectional mapping relationship between waveform configuration parameters and corresponding coordinate axes.

[0025] The coordinate module 403 is used to determine the corresponding X-axis coordinate for each sampled data group based on the first index value and the first waveform configuration parameter, and to determine the corresponding Y-axis coordinate based on the sampled value and the second waveform configuration parameter. The plotting module 404 is used to plot waveforms based on the X-axis and Y-axis coordinates of multiple sampled data groups. Interaction module 405 is used to receive view transformation instructions from users. The view transformation instructions include view transformation type, center reference of view transformation, and view transformation parameters. One possible implementation is to prevent the operating system from making unintended page-level responses (such as overall webpage zooming or bounce scrolling) to the user's zoom or scroll wheel operations. This application attaches a non-passive event listener as an interaction module 405, which directly intercepts native two-finger zoom or mouse wheel events at the browser level and takes over control to the view transformation logic of this application, thereby suppressing the default intervention of the operating system.

[0026] Transformation module 406 is used to perform view transformation on the entire waveform diagram based on view transformation instructions.

[0027] One possible implementation is that coordinate module 403 is a React data-driven front-end rendering component; The drawing module 404 is a single-layer / multi-layer HTML5 Canvas (HyperText Markup Language 5 Canvas) component.

[0028] In other words, the React data-driven front-end rendering component in this application is mainly used to maintain the logical state of the periphery (such as the global control state of front-end running interactions such as viewport dragging, cursor activation, channel switching, zoom interaction, query range activation, etc.) and maintain waveform configuration parameters based on different logical states, while Canvas is only responsible for listening to the data points processed by the React data-driven front-end rendering component and converting them into physical pixels.

[0029] like Figure 1 As shown, this application also discloses an oscilloscope method for a virtual oscilloscope, applied to a virtual oscilloscope, the method comprising: S101. Receive multiple sampled data groups, each sampled data group including a sampled value and a first index value of the sampled value, the first index value being used to characterize the sampled sequence number of the sampled value; In one possible implementation, each first index value is determined based on the corresponding sampling time. For example, the sampling time corresponding to the initial moment of starting sampling can be defined as the base time (e.g., 0 microseconds), and the first index value corresponding to the base time can be defined as the initial index value (e.g., integer 0). Subsequently, after each equally spaced sampling is completed, the first index value is incremented by a fixed step size (e.g., integer 1), and the corresponding sampling time is "initial base time + first index value × sampling interval time", where the sampling interval time is the reciprocal of the preset fixed sampling rate. For example, if the preset fixed sampling rate is 1 MS / s (i.e., 1 million sampling points are collected per second), then the corresponding sampling interval time is 1 μs. At this time, the first index value 0 corresponds to the sampling time 0 μs, the first index value 1 corresponds to the sampling time 1 μs, the first index value 2 corresponds to the sampling time 2 μs, and so on, so that the first index value and the sampling time form a one-to-one correspondence.

[0030] S102. Obtain preset first waveform configuration parameters and second waveform configuration parameters. The first waveform configuration parameters are the X-axis mapping parameters of the waveform diagram, and the second waveform configuration parameters are the Y-axis mapping parameters of the waveform diagram. One possible implementation is that the initial value of the waveform configuration parameter can be configured by the user through the system preset settings or manually entered, or it can be dynamically updated based on the view transformation command issued by the user. The core function of the waveform configuration parameter is to convert the first index value of the sampled data group into pixel coordinates in the X-axis direction of the drawing interface.

[0031] S103. For each sampled data group, determine the corresponding X-axis coordinate based on the first index value and the first waveform configuration parameter, and determine the corresponding Y-axis coordinate based on the sampled value and the second waveform configuration parameter. S104. Draw a waveform based on the X-axis and Y-axis coordinates of multiple sampled data groups; Specifically, for each sampled data group, each first index value is mapped to the X-axis based on the first waveform configuration parameter; each sampled value is mapped to the Y-axis based on the second waveform configuration parameter, and the X-axis mapping result and Y-axis mapping result of the same sampled data group are matched one by one to obtain the position of each sampled data group in the waveform diagram.

[0032] In one possible implementation, when marking the X-axis, each index value is converted into a corresponding sampling time so that the timing information of the waveform can be viewed from the user's perspective.

[0033] S105. Receive the user's view transformation command, which includes the view transformation type, the center reference of the view transformation, and the view transformation parameters. The view transformation type can be zoom or pan; One possible implementation is that this application uses the position of the cursor when the user inputs a view transformation command as the central reference to perform view transformations in the X and / or Y directions respectively.

[0034] S106. Perform a view transformation on the entire waveform diagram based on the view transformation command.

[0035] One possible implementation involves using view transformation parameters, including view transformation direction and view transformation magnitude, to perform view transformation on the entire waveform based on view transformation instructions. Specifically: The first waveform configuration parameters and / or the second waveform configuration parameters are adjusted based on the view transformation amplitude, while keeping the position of the center reference unchanged during the adjustment process, so that the viewport of the waveform changes in the view transformation direction, wherein the view transformation direction can be the X-axis direction and / or the Y-axis direction.

[0036] One possible implementation is that the first waveform configuration parameters include a first offset and a first scaling factor; the first offset is used to characterize the starting position of the waveform on the X-axis, and the first scaling factor is used to characterize the pixel spacing of the unit offset of the first index value in the X-axis direction; Specifically, the first offset is Offset, which is the index value corresponding to the starting point of the waveform X-axis. The first scaling factor is Scale, which refers to the scaling factor when mapping the data field to the pixel field. Specifically, it is expressed as the pixel width occupied by the unit index value interval in the current view.

[0037] The method also includes: Get the first query coordinate of the X-axis input by the user; It is worth mentioning that from the user's perspective, the first query coordinate input on the X-axis is the query time, but from the system perspective of the virtual oscilloscope, the first query coordinate read is the X-axis pixel coordinate corresponding to the query time.

[0038] The second index value corresponding to the first query coordinate is determined based on the first offset, the first scaling factor, and the first query coordinate. Specifically, in contrast to the mapping process in S3, this section describes the process of mapping the first query coordinates to the second index value based on the first offset and the first scaling factor.

[0039] It is worth mentioning that the second index value specifically refers to the first index value corresponding to the first query coordinates, and this is only for the purpose of easy description and distinction.

[0040] For example, when the user drags the X cursor to any position xp, xp is converted into the second index value:

[0041] In the formula, Idx is the second index value; Offset is the first offset; maxIntervals is the total number of data intervals, which is obtained by subtracting 1 from the total number of sampled values; CanvasWidth is the canvas width, which is a preset value; and currentScale is the current first scaling factor.

[0042] The second index value is rounded down, and the sampled value corresponding to the first query coordinate is determined based on the rounded second index value.

[0043] One possible implementation involves rounding the second index value and determining the sampled value corresponding to the first query coordinate based on the rounded second index value, specifically: Determine whether the second index value is an integer. If it is, then determine the sample value corresponding to the second index value as the sample value corresponding to the first query coordinate. If not, then the second index value is rounded up to obtain the first rounded value, and the second index value is rounded down to obtain the second rounded value; A first candidate sample value is determined based on a first rounded value; and a second candidate sample value is determined based on a second rounded value. Linear interpolation is performed on the first candidate sample value and the second candidate sample value to obtain the sample value corresponding to the first query coordinate.

[0044] One possible implementation involves performing linear interpolation on the first and second candidate sample values ​​to obtain the sample value corresponding to the first query coordinate, specifically: Determine a first difference between the first rounded value and the second index value, or a second difference between the second rounded value and the second index value; The interpolation weights are determined based on either the first or second difference. Linear interpolation is performed on the first candidate sample value and the second candidate sample value based on the interpolation weight to obtain the sample value corresponding to the first query coordinate.

[0045] For example, when the sampling object is voltage and the sampling value is voltage, after obtaining the first query coordinate based on the user's dragging of the X-axis cursor, the process of determining the voltage value corresponding to the first query coordinate is as follows: Based on the first waveform configuration parameters, the first query coordinates are mapped to the second index value; The second index value Idx is rounded up to obtain the first rounded value floor(Idx) and the second rounded value ceil(Idx); The interpolation weights are determined using Idx - floor(Idx); Based on the interpolation weights, the smoothed interpolated transient voltage value corresponding to the first query coordinate is obtained: Transient voltage value = voltage value corresponding to floor (Idx) × (1 - interpolation weight) + voltage value corresponding to ceil (Idx) × interpolation weight.

[0046] This application uses a fractional-domain coordinate continuity dynamic interpolation algorithm to obtain the precise voltage value between any two sampling points under theoretical conditions. Specifically, when the calculated second index value is not an integer, it is rounded up and down to obtain two boundary sampling points. The fractional part of the second index value is used as the interpolation weight to perform linear interpolation on the voltage value corresponding to the boundary sampling point, thereby accurately extracting the transient voltage value at the query coordinate that linearly intersects with the boundary sampling point.

[0047] One possible implementation is that the second waveform configuration parameters include a second offset and a second scaling factor; the second offset is used to characterize the starting position of the waveform on the Y-axis, and the second scaling factor is used to characterize the pixel spacing of the unit offset of the sampled value in the Y-axis direction; The method also includes: Get the second query coordinate of the Y-axis input by the user; The sampled value corresponding to the second query coordinate is determined based on the second offset, the second scaling factor, and the second query coordinate.

[0048] like Figure 2 In the embodiment shown, when the sampling object is voltage and the sampled value is voltage, the process of determining the voltage value at any point in the waveform graph based on the user-input X / Y axis cursor position is as follows: S201. Detect the user's operation of dragging the cursor in the waveform graph; S202. Determine the waveform graph axis region where the user's cursor dragging operation is located; When the X-axis cursor is captured, proceed to steps S203~S209; S203, Obtain the first query coordinate screenX; S204. Map screenX to the mathematical domain index Index = Offset + X_ratio / Scale, where Offset is the first offset, X_ratio is obtained by subtracting the X-axis coordinate value of the waveform's starting point from the first query coordinate, dividing it by the total pixel width of the waveform, and then multiplying it by the total number of sampling intervals, and Scale is the first scaling factor. S205. Determine if Index is an integer. If it is, proceed to step S206. S206. Directly collect the corresponding voltage value; If not, proceed to step S207; S207. Round the Index up to obtain floorIdx and round it down to obtain ceilIdx, and determine the interpolation weight Weight1. S208. Perform linear interpolation Val = V_floor×(1-Weight1) + V_ceil×Weight1; S209. Calculate the precise voltage between any two points under theoretical conditions using a linear interpolation algorithm; When the Y-axis cursor is captured, proceed to step S210; S210, Obtain the second query coordinate screenY; S211. Obtain the voltage value corresponding to screenY by reverse mapping based on the second waveform configuration parameters; S212. Perform linear interpolation based on the adjacent voltage values ​​at both ends of screenY. al = _floor × (1-Weight2) + _ceil × Weight 2, _floor represents the previous voltage value. _ceil represents the next voltage value, and Weight2 is the voltage value corresponding to screenY minus... The interpolation weights obtained from _floor; S213 outputs precise voltage values.

[0049] This application proposes a continuous data extraction method across discrete sampling points during waveform numerical reading, which includes independent X-axis and Y-axis verniers and orthogonal hybrid vernier modes. Specifically, this application reverse-maps the user's query pixel coordinates in the waveform diagram into a first index value and a timestamp, and performs boundary exploration. Then, it uses a linear interpolation algorithm to solve for the precise sampled value corresponding to the query pixel coordinates. This application abandons the existing method of snapping to the index of nearby integer points, breaks through the limitation of discrete sampling points to realize super-resolution data observation, and effectively improves the reading accuracy of sampled values ​​in super-resolution scenarios.

[0050] One possible implementation method also includes: Obtain the start and end coordinates input by the user. The start and end coordinates are used to limit the user's query range in the X-axis direction. Based on the configuration parameters of the first waveform, the coordinates of the start and end points are mapped to obtain the index interval, which includes multiple first index values ​​within the query range; Specifically, after the user defines the time window T1~T2 on the X-axis, the X-axis coordinate segment of the cursor in the time window T1~T2 is extracted, and the two endpoints of the X-axis coordinate segment are mapped according to the first waveform configuration parameters to obtain the index interval [index1, index2]. Aggregate the sampled values ​​corresponding to multiple first index values ​​within the index interval. The aggregation operation is at least one of the following: accumulation operation, mean square product summation, minimum value tracking, maximum value tracking, effective sample counting, mean calculation, root mean square calculation, and range calculation.

[0051] After obtaining the index range [index1, index2], this application extracts data fragments within the index range [index1, index2], specifically: startIdx = Math.min(index1, index2) endIdx = Math.max(index1, index2) Where startIdx and endIdx are the start and end positions of the cut, respectively.

[0052] During the traversal of the partitions, Sum, SquareSum, Min, and Max are accumulated in real time, and the number of valid items is counted as Count = endIdx - startIdx + 1. The next step is to calculate the average value = Sum / Count, the root mean square RMS = SQRT(SquareSum / Count), and the range = Max - Min.

[0053] In one possible implementation, the virtual oscilloscope has a built-in rendering engine bypass and convergence calculation pipeline. When the user defines a time window in the waveform graph, the rendering engine bypass wakes up the convergence calculation pipeline and instantly reads the channel metadata within the data slice range.

[0054] This application solves the problem of traditional cloud-based instruments lacking independent real-time front-end computing capabilities by performing calculations such as average value and effective value on user-defined waveform segments in the browser front-end, without needing to send data back to the back-end server for processing.

[0055] like Figure 3 The following is an embodiment illustrating the aggregation operation process of this application: S301. Obtain the time intervals T1 and T2 when the user places the cursor; S302. Based on T1, T2 and the first waveform configuration parameters, the index interval [index1, index2] is obtained; S303. Extract data fragments within the index range [index1, index2], where: startIdx = Math.min(index1, index2), endIdx = Math.max(index1, index2); S304. Determine if the data within the data segment is valid; If so, proceed to steps S305~S308; otherwise, proceed to step S309. S305: Traverse the partitions and accumulate the sums to obtain Sum, SquareSum, Min, and Max. S306. Determine the number of data items within the index range: Count = EndIdx - StartIdx + 1; S307. Calculate the average value (Average = Sum / Count), root mean square (RMS) = SQRT(SquareSum / Count), and range (Range = Max - Min).

[0056] S308. Output the aggregation calculation results; S309, Return to null indicator.

[0057] One possible implementation is that, after completing the above aggregation calculations, this application will automatically inject core engineering analysis values ​​such as mean, maximum, minimum, range, and effective value into a decoupled external floating container or external state machine to achieve uninterrupted real-time display. This process specifically includes: Obtain the coordinates of the first boundary of the drawing interface, which is the display medium for the waveform diagram; One possible implementation involves real-time monitoring of changes in the size and layout of the DOM container within the browser page to detect whether page reflow triggers a change in the position of the drawing interface. When a position change is detected, the real-time coordinates of the Canvas parent container corresponding to the drawing interface relative to the browser viewport are frequently obtained, and these coordinates are used as the first boundary coordinates.

[0058] The second boundary coordinates are determined based on the first boundary coordinates. The second boundary coordinates are used to limit the display area of ​​the aggregation calculation results in the drawing interface. In one possible implementation, whenever the first boundary coordinates change, this application dynamically calculates the second boundary coordinates based on the first boundary coordinates to ensure that the aggregation calculation results are fully visible at any viewport size. The aggregation calculation results are then displayed in a floating manner based on the second boundary coordinates.

[0059] This application determines the second boundary coordinates based on the real-time updated first boundary coordinates, so that the floating display of the aggregation calculation results is not affected by the browser page layout reflow and changes in sibling containers. By dynamically adapting the position of the drawing interface to constrain the floating display position, it effectively prevents the display area from overflowing or truncating content on high-resolution or narrow-screen devices.

[0060] It should be noted that although the operations of the method of the present invention are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all of the operations shown must be performed to achieve the desired result. On the contrary, the steps depicted in the flowchart may be performed in a different order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0061] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0062] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this application.

Claims

1. An oscilloscope method using a virtual oscilloscope, characterized in that, Applied to a virtual oscilloscope, the method includes: Receive multiple sampled data groups, each sampled data group including a sampled value and a first index value of the sampled value, the first index value being used to characterize the sampled sequence number of the sampled value; Obtain preset first waveform configuration parameters and second waveform configuration parameters, wherein the first waveform configuration parameters are the X-axis mapping parameters of the waveform graph, and the second waveform configuration parameters are the Y-axis mapping parameters of the waveform graph; For each sampled data group, the corresponding X-axis coordinate is determined based on the first index value and the first waveform configuration parameter, and the corresponding Y-axis coordinate is determined based on the sampled value and the second waveform configuration parameter; The waveform is plotted based on the X-axis and Y-axis coordinates of the multiple sampled data groups; Receive the user's view transformation command, which includes the view transformation type, the center reference of the view transformation, and the view transformation parameters; The view transformation is performed on the entire waveform based on the view transformation command.

2. The method according to claim 1, characterized in that, The view transformation parameters include the view transformation direction and the view transformation amplitude. Based on the view transformation command, the entire waveform is then subjected to view transformation, specifically as follows: The first waveform configuration parameters and / or the second waveform configuration parameters are adjusted based on the view transformation amplitude, while keeping the position of the center reference unchanged during the adjustment process, so that the viewport of the waveform changes in the view transformation direction.

3. The method according to claim 1, characterized in that, The first waveform configuration parameters include a first offset and a first scaling factor; the first offset is used to characterize the starting position of the waveform on the X-axis, and the first scaling factor is used to characterize the pixel spacing of the unit offset of the first index value in the X-axis direction; The method further includes: Obtain the first query coordinate of the X-axis input by the user; The second index value corresponding to the first query coordinates is determined based on the first offset, the first scaling factor, and the first query coordinates; The second index value is rounded down, and the sampled value corresponding to the first query coordinate is determined based on the rounded second index value.

4. The method according to claim 3, characterized in that, The second index value is rounded down, and the sampled value corresponding to the first query coordinate is determined based on the rounded second index value, specifically as follows: Determine whether the second index value is an integer. If it is, then determine the sample value corresponding to the second index value as the sample value corresponding to the first query coordinate. If not, then the second index value is rounded up to obtain the first rounded value, and the second index value is rounded down to obtain the second rounded value; A first candidate sample value is determined based on the first rounded value; and a second candidate sample value is determined based on the second rounded value. Linear interpolation is performed on the first candidate sample value and the second candidate sample value to obtain the sample value corresponding to the first query coordinate.

5. The method according to claim 1, characterized in that, The second waveform configuration parameters include a second offset and a second scaling factor; the second offset is used to characterize the starting position of the waveform on the Y-axis, and the second scaling factor is used to characterize the pixel spacing of the unit offset of the sampled value in the Y-axis direction; The method further includes: Obtain the second query coordinate of the Y-axis input by the user; The sampled value corresponding to the second query coordinate is determined based on the second offset, the second scaling factor, and the second query coordinate.

6. The method according to any one of claims 2 to 5, characterized in that, The method further includes: The start and end point coordinates input by the user are obtained respectively, and the start and end point coordinates are used to limit the user's query range in the X-axis direction; Based on the first waveform configuration parameters, the start and end point coordinates are mapped to obtain an index interval, which includes multiple first index values ​​within the query range; The sampled values ​​corresponding to multiple first index values ​​within the index interval are aggregated and calculated. The aggregation operation is at least one of the following: accumulation operation, mean square product summation, minimum value tracking, maximum value tracking, effective sample counting, mean calculation, root mean square calculation, and range calculation.

7. The method according to claim 6, characterized in that, The method further includes: Obtain the first boundary coordinates of the drawing interface, which is the display carrier of the waveform diagram; The second boundary coordinates are determined based on the first boundary coordinates, and the second boundary coordinates are used to define the display area of ​​the result of the aggregation calculation in the drawing interface. The results of the aggregation calculation are displayed in a floating manner based on the second boundary coordinates.

8. The method according to claim 4, characterized in that, Linear interpolation is performed on the first candidate sample value and the second candidate sample value to obtain the sample value corresponding to the first query coordinate, specifically: Determine a first difference between the first rounded value and the second index value, or a second difference between the second rounded value and the second index value; The interpolation weight is determined based on the first difference or the second difference; Based on the interpolation weights, linear interpolation is performed on the first candidate sample value and the second candidate sample value to obtain the sample value corresponding to the first query coordinate.

9. A virtual oscilloscope, characterized in that, The virtual oscilloscope includes: The interface module is used to receive multiple sampled data groups, each sampled data group including a sampled value and a first index value of the sampled value, the first index value being used to characterize the sampling sequence number of the sampled value; The mapping module is used to obtain preset first waveform configuration parameters and second waveform configuration parameters, wherein the first waveform configuration parameters are the X-axis mapping parameters of the waveform diagram and the second waveform configuration parameters are the Y-axis mapping parameters of the waveform diagram; The coordinate module is used to determine the corresponding X-axis coordinate for each sampled data group based on the first index value and the first waveform configuration parameters, and to determine the corresponding Y-axis coordinate based on the sampled value and the second waveform configuration parameters. A plotting module is used to plot the waveform based on the X-axis and Y-axis coordinates of the multiple sampled data groups; The interaction module is used to receive the user's view transformation command, which includes the view transformation type, the center reference of the view transformation, and the view transformation parameters; The transformation module is used to perform view transformation on the entire waveform based on the view transformation command.

10. The virtual oscilloscope according to claim 9, characterized in that, The coordinate module is a React data-driven front-end rendering component; The drawing module is a single-layer / multi-layer HTML5 Canvas component.