A data sampling method, device and equipment based on display screen resolution
By using a data sampling method based on display resolution, the screen is divided into pixel regions and feature points are extracted, which solves the problems of missing data point features and large computational load in the existing technology, and realizes fast and accurate simulation result display.
Patent Information
- Application Number
- CN202411425190.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2044-10-12
AI Technical Summary
In existing technologies, the fixed-step sampling method cannot guarantee that the sampled data points contain enough feature points, resulting in distortion of the simulation results. Furthermore, although the Douglas sampling method reduces the number of data points, it increases the amount of computation and affects display efficiency.
The data sampling method based on screen resolution divides the screen into pixel regions, determines data units, and extracts feature points as sampling data points, thereby reducing the number of data points without affecting the display effect.
This ensures that the simulation results are displayed accurately, reduces screen data processing and memory usage, lowers network transmission load, and improves the display speed of simulation results.
Smart Images

Figure CN118939221B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of computers, and in particular to a data sampling method, apparatus, and device based on display screen resolution. Background Technology
[0002] With the development of computer technology, the emergence of simulation software has greatly improved the efficiency of experimental verification and reduced verification costs. Users use simulation software to simulate experimental results using mathematical models, and then the display terminal loads the coordinates of each data point in the simulation data calculated by the mathematical model to render the simulation result graph, thus rendering the simulation result graph.
[0003] In existing technologies, to reduce the amount of data points loaded when rendering simulation results, a fixed-step sampling method is typically used. This involves sampling each data point according to its x-coordinate and a preset step size. However, sampling each data point according to a preset step size cannot guarantee that the sampled data points contain enough feature points. This can lead to the loss of some features or even important features, resulting in distortion of the simulation results rendered on the screen.
[0004] Therefore, this specification provides a data sampling method, apparatus, and device based on display screen resolution. Summary of the Invention
[0005] This specification provides a data sampling method, apparatus, and device based on display screen resolution to partially solve the aforementioned problems existing in the prior art.
[0006] The following technical solution is adopted in this specification:
[0007] A data sampling method based on display resolution includes:
[0008] Obtain the coordinates of each data point in the simulation data and the resolution of the screen displaying the simulation data;
[0009] Based on the resolution, the screen is divided into pixel regions, and the coordinates of each data point are divided according to each pixel region to determine each data unit after division.
[0010] For each data unit, the feature points and their corresponding coordinates in each data point of that data unit are determined as sampling data points, wherein the feature points are data points used to characterize the features of the simulation results.
[0011] Optionally, a threshold number of data points that the screen can display is determined based on the screen's resolution;
[0012] The number of each data point is determined based on its coordinates.
[0013] Determine whether the number of each data point is greater than the number threshold;
[0014] If so, then it is determined that each data point needs to be sampled;
[0015] If not, then it is determined that none of the data points need to be sampled.
[0016] Optionally, the simulation results are presented as a graph;
[0017] Based on the resolution, the screen is divided into pixel regions, and the coordinates of each data point are divided according to each pixel region to determine each data unit after division, specifically including:
[0018] The horizontal pixel count of the screen is determined based on the resolution;
[0019] The screen is divided horizontally into pixel regions based on the horizontal pixel count.
[0020] Based on the x-coordinates of each data point, determine the first x-coordinate range of each data point;
[0021] Based on the number of each pixel region and the first horizontal coordinate range, the horizontal coordinates of each data point are divided to determine the second horizontal coordinate range corresponding to each data unit.
[0022] The data points corresponding to each data unit are determined based on the range of the second horizontal coordinate corresponding to each data unit.
[0023] Optionally, the simulation result is a two-dimensional image;
[0024] The screen is divided into pixel regions, and the coordinates of each data point are divided according to the pixel regions to determine the data units after division. Specifically, this includes:
[0025] The horizontal and vertical pixel counts of the screen are determined based on the resolution.
[0026] Based on the horizontal and vertical pixel counts, the screen is divided into pixel regions on an average basis.
[0027] Based on the coordinates of each data point, determine the first abscissa range and the first ordinate range of each data point;
[0028] Based on the number of each pixel region, the first horizontal coordinate range, and the first vertical coordinate range, the coordinates of each data point are divided to determine the third horizontal coordinate range and the second vertical coordinate range corresponding to each data unit.
[0029] The data points corresponding to each data unit are determined based on the third horizontal coordinate range and the second vertical coordinate range corresponding to each data unit.
[0030] Optionally, the simulation results are presented as a graph;
[0031] Determine the feature points and their corresponding coordinates in each data point of the data unit, specifically including:
[0032] Determine the coordinates of the data point with the largest x-coordinate, the data point with the smallest x-coordinate, the data point with the largest y-coordinate, and the data point with the smallest y-coordinate in the data unit, and use them as each sampling data point;
[0033] The sampling data points are deduplicated based on their coordinates.
[0034] Each deduplicated sampled data point is used as a feature point of the data unit corresponding to the pixel region, and the coordinates of the feature points are determined.
[0035] Optionally, the simulation result is a two-dimensional image;
[0036] Determine the feature points and their corresponding coordinates in each data point of the data unit, specifically including:
[0037] The feature values of each data point are determined, and at least one of the following is selected: feature point extraction, determining the data point with the largest feature value in the pixel region, and determining the data point with the smallest feature value in the pixel region. Sampling data points are then determined, and the feature values corresponding to each sampling data point are determined.
[0038] Optionally, the simulation result is a curve graph, and the method further includes:
[0039] Determine the correspondence between each pixel region and each data unit, and map each sampled data point to its corresponding pixel region based on the correspondence and the coordinates of each sampled data point in each data unit.
[0040] Render a curve based on the coordinates of each sampled data point.
[0041] Optionally, the simulation result is a two-dimensional image, and the method further includes:
[0042] Determine the correspondence between each pixel region and each data unit;
[0043] For each data unit, at least one sampled data point is selected from each sampled data point in that data unit, and the corresponding feature value is determined, so that the screen renders a two-dimensional image based on the corresponding feature value determined for each pixel region.
[0044] This specification provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described data sampling method.
[0045] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the above-described data sampling method.
[0046] The above-mentioned technical solutions adopted in this specification can achieve the following beneficial effects:
[0047] In the screen resolution-based data sampling method provided in this specification, the screen is divided according to the obtained screen resolution and the coordinates of the data points to determine each pixel region. Then, each data point is divided according to each pixel region to determine the data units after division and to determine the correspondence between the pixel regions and the data units. Then, for each data unit, feature points are sampled for the data points in the data unit to determine the feature points of the corresponding pixel region.
[0048] As can be seen from the above method, by dividing the screen and each data point, the feature points in each data unit are displayed in the corresponding pixel area. This not only ensures that the feature points of the sampled data points are not missing and that the image seen by the user on the screen is not distorted, but also reduces the number of data points loaded and displayed on the screen, reduces the amount of data processing on the screen and the memory occupation of the display terminal, and also reduces the network occupation caused by massive simulation data transmission, making the display of simulation results faster. Attached Figure Description
[0049] The accompanying drawings, which are included to provide a further understanding of this specification and form part of this specification, illustrate exemplary embodiments and are used to explain this specification, but do not constitute an undue limitation thereof. In the drawings:
[0050] Figure 1 This is a schematic diagram of a data point sampling process provided in an embodiment of this specification;
[0051] Figure 2 A flowchart illustrating a data sampling method provided in an embodiment of this specification;
[0052] Figure 3 A schematic diagram illustrating a pixel region division method provided in an embodiment of this specification;
[0053] Figure 4 A schematic diagram illustrating a pixel region division method provided in an embodiment of this specification;
[0054] Figure 5This is a schematic diagram of the sampling process for a graph provided in this specification;
[0055] Figure 6 A schematic diagram of a data sampling device provided in an embodiment of this specification;
[0056] Figure 7 The corresponding information provided in this specification Figure 2 A schematic diagram of an electronic device. Detailed Implementation
[0057] To make the objectives, technical solutions, and advantages of this specification clearer, the technical solutions of this specification will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of them. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0058] With the development of computer technology, traditional testing experiments require multiple modifications to circuits, components, or devices to test them under different parameters, resulting in high verification costs. Simulation software, however, has greatly improved verification efficiency. Users can use mathematical models to simulate experimental results using simulation software. The display then loads the coordinates of data points from the simulation data calculated by the mathematical model to render the simulation result graph, forming a visual image for the user.
[0059] However, simulation software generates massive amounts of simulation data during actual calculations. If all of this simulation data is transmitted to the display device to show the simulation results to the user, it will consume a large amount of the display device's memory. If the simulation software and the display device are different devices but located on the same distributed server, the transmission of massive amounts of simulation data will also cause the server's transmission network to be heavily occupied.
[0060] Therefore, when displaying simulation results on the display terminal, the data points in the simulation data generated by the simulation software should be sampled, and then the sampled points should be determined. The sampled points should be transmitted to the display terminal as data points so that the display terminal can render the simulation results based on the sampled data points.
[0061] Currently, to reduce the number of data points loaded in simulation data, a fixed-step sampling method is commonly used. This method samples each data point according to its x-coordinate and a preset step size. While this method reduces the number of data points transmitted, it cannot guarantee that the sampled data points contain enough feature points, leading to the loss of some features or even important features.
[0062] Currently, the Douglas sampling method is also used to sample data points. That is, the distance from each data point to the line segment between the initial point and the endpoint is calculated, and the maximum distance is determined. It is then determined whether the maximum distance is less than a threshold. If it is, only the initial point and the endpoint are retained. If not, the maximum distance point is retained and used as the new dividing point to divide the original curve into two parts. Then, the Douglas sampling method is recursively applied to these two parts.
[0063] like Figure 1 As shown, Figure 1 This is a schematic diagram of a data point sampling process provided in this specification. This data point sampling process follows the Douglas sampling method. Before sampling, the curve contains six data points: a, b, c, d, e, and f, where a and f are the initial and final points of the curve, respectively. During sampling, line segment af is connected, and the distances from points b, c, d, and e to line segment af are determined. Point b has the farthest distance from line segment af, and its distance to af exceeds a threshold; therefore, point b is retained. Since points a and b are both data points to be retained, only the points between b and f need to be sampled. Then, bf is connected, and the distances from points c, d, and e to line segment bf are determined. Point c has the farthest distance to bf, and its distance exceeds a threshold; therefore, point c is retained. The sampling of data points between c and f continues. Connect cf, determine the distances of points d and e to line segment cd respectively, and determine that the distances are all less than the threshold. Therefore, points d and e are not retained. Determine the sampled data points: points a, b, c, and f, and render the curve based on the sampled data points.
[0064] However, while the Douglas sampling method reduces the number of data points required to render simulation results, the recursive calculations during the sampling process often result in massive computations when sampling large amounts of data. In other words, although it reduces the amount of data loaded, it greatly increases the amount of computation during the sampling process, which still affects the efficiency of the display on the simulation results.
[0065] Therefore, this specification provides a data sampling method based on screen resolution, which allows the display screen to reduce the amount of data points loaded without affecting the display effect of the simulation results.
[0066] The technical solutions provided in the various embodiments of this specification are described in detail below with reference to the accompanying drawings.
[0067] like Figure 2 As shown, Figure 2 This is a schematic diagram of the flow of a data sampling method provided in an embodiment of this specification.
[0068] S200: Obtain the coordinates of each data point in the simulation data and the resolution of the screen displaying the simulation data.
[0069] In one or more embodiments of this specification, the specific device used to implement the data sampling method is not limited, such as a personal computer, mobile terminal, or server. However, since subsequent steps involve operations such as simulation data acquisition and screen resolution recognition, which are generally performed by a server, this specification will also describe the data sampling method using a server as an example. The server can be a single device or a combination of multiple devices, such as a distributed server; this specification does not impose any limitations on this.
[0070] In one or more embodiments of this specification, if the server of the simulation software and the display terminal are located on the same device, the data sampling method can be used by the device with the simulation software installed to determine the sampled data points before transmitting the simulation data to the display terminal for display. If the simulation software and the display terminal are located on different devices, the server with the simulation software installed can also determine the sampled data points using the data sampling method before transmitting each data point of the simulation data to the display terminal, and then transmit the sampled data points to the display terminal server. Alternatively, other servers can use the data sampling method to sample each data point in the simulation data, determine the coordinates of each data point after sampling, and inform the device with the simulation software installed or the display terminal device. For ease of subsequent description, the data sampling method will be described first as an example where the simulation software is installed on the device where the display terminal is located and executes the data sampling method.
[0071] To extract feature points from massive amounts of simulation data, the server should first obtain the coordinates of each data point in the simulation data so that it can subsequently sample each data point based on its coordinates. Then, to ensure that the sampled data points are adapted to the display screen, the server should also obtain the screen resolution so that it can subsequently segment the data points according to the screen resolution.
[0072] Of course, in one or more embodiments of this specification, the specific method by which the server obtains the coordinates of each data point and the resolution of the display screen is not limited. When obtaining the coordinates of each data point, the coordinates can be determined by obtaining the simulation result file of the simulation software, or by accessing the result storage address of the simulation software.
[0073] When obtaining the resolution of a display screen, the server can obtain the device information of the display screen to obtain the resolution of the display screen, or it can obtain the resolution of the display screen through other tools, such as Cascading Style Sheets (CSS) media queries, Java screen detection, responsive frameworks and libraries, etc.
[0074] Furthermore, in one or more embodiments of this specification, the specific form of the simulation data is not limited; it can be a two-dimensional image or a graph. However, different data representations require different methods for subsequently determining feature points. It should be noted that in one or more embodiments of this specification, the graph is a monotonic graph; a non-monotonic graph can be considered a two-dimensional image.
[0075] S202: Based on the resolution, the screen is divided into pixel regions, and the coordinates of each data point are divided according to each pixel region to determine each data unit after division.
[0076] To ensure that the feature points in the sampled data points can be adapted to the current screen and do not affect the user's observation of the simulation results when the sampled data points are displayed on the screen, the server can divide the screen according to the screen resolution, determine each pixel region after the division, and then divide the coordinates of each data point according to the determined pixel region to determine each data unit after the division, thereby realizing the sampling and display of data points in each data unit on the screen.
[0077] Specifically, the server divides the screen of the display terminal according to the resolution of the display terminal and determines each pixel area. It should be noted that, in one or more embodiments of this specification, when the server divides the screen, it divides the screen according to the type of simulation result image. Of course, regardless of whether the simulation result image is a curve or a two-dimensional image, the simulation result image can be regarded as a two-dimensional image. Therefore, the screen can be divided by the following method.
[0078] That is, Figure 3 As shown, Figure 3 As shown, Figure 3 This diagram illustrates a pixel region division method provided in this specification. Specifically, it describes a screen division method for simulation results that are two-dimensional images. The server determines the horizontal and vertical pixel counts of the screen based on its resolution, and then divides the screen into pixel regions based on these counts. For example, for a screen with a resolution of 2560×1400, the server can divide the screen into 3,584,000 pixel regions.
[0079] If the simulated image is a curve, there are generally no two data points with the same horizontal coordinate but different vertical coordinates. Therefore, when dividing the screen, the server can divide the screen only based on the horizontal resolution. Figure 4 As shown, Figure 4 This is a schematic diagram illustrating a method for dividing pixel regions as provided in this specification. Specifically, if the screen resolution is 2560×1400, the server can horizontally divide the screen into up to 2560 pixel regions.
[0080] After determining each pixel region, the server divides the coordinates of each data point according to each pixel region to determine each data unit, with each data unit containing at least one data point. Of course, in one or more embodiments of this specification, the specific method by which the server divides the data points is not limited. It can establish a coordinate system on the screen, then map each data point onto the screen according to its coordinates, and then determine the data points corresponding to each pixel region based on the division of the pixel regions on the screen, with each data point corresponding to a pixel region serving as a data unit.
[0081] Of course, the division can also be based on the number of pixel regions and the coordinates of each data point. For example, when the determined pixel regions are 10 horizontally arranged pixel regions, the horizontal coordinate range of each data point is determined according to the horizontal coordinate of each data point. Then, the horizontal coordinate range is divided into 10 equal parts. Data points with horizontal coordinates within the same horizontal coordinate range constitute a data unit. Then, the corresponding pixel region is determined according to the horizontal coordinate of each data point in each data unit.
[0082] S204: For each data unit, determine the feature points and corresponding coordinates of each data point in that data unit as sampling data points, wherein the feature points are data points used to characterize the features of the simulation results.
[0083] After dividing the data into units, the server should sample feature points for the data points within each pixel region, thereby sampling the entire simulation data and reducing the number of data points that the display device needs to show when displaying the simulation data. To avoid affecting the screen display of the sampled simulation data, feature points should be extracted for the data points within each data unit, allowing the sampled data points within each data unit to be displayed through their corresponding pixel regions.
[0084] Specifically, the server extracts feature points from each data unit and each data point within that unit. Different feature point sampling methods can be used for different types of data points. For example, for data points in a curve graph, the server can sample the points with the maximum and minimum ordinate values within each pixel region, as well as the points at both ends of that region. It can also include data points corresponding to the curve's extreme points or other points that represent the curve's characteristics.
[0085] For each data point in the image data, the server can first determine the feature value of each data point. This feature value can be the value of the data point in the RGB or HSV color space when displayed on the screen, the corresponding grayscale value, or other values representing the characteristics of the data point when displayed on the screen. Then, the server can use at least one of the following methods to determine the sampled data point: extracting points with abrupt changes in feature values within each pixel region, determining the data point with the largest feature value, and determining the point with the smallest feature value. Simultaneously, the server records the feature value of this data point as the sampled feature point within that pixel region.
[0086] In other words, in one or more embodiments of this specification, the specific method by which the server acquires the feature points in the corresponding data points of the data units within each pixel region is not limited. The server can determine the feature points to be extracted based on the type of the simulated image.
[0087] Then, the server uses the identified feature points as sampling data points and obtains information such as the coordinates and pixel values of each sampling data point so that the simulation results can be displayed later.
[0088] based on Figure 2 In the data sampling method based on screen resolution shown, the screen is divided according to the obtained screen resolution and the coordinates of the data points to determine each pixel region. Then, each data point is divided according to each pixel region to determine the data unit after division and the correspondence between the pixel region and the data unit. Then, for each data unit, feature points are sampled for the data points in the data unit to determine the feature points of the corresponding pixel region.
[0089] As can be seen from the above method, by dividing the screen and each data point, the feature points in each data unit are displayed in the corresponding pixel area. This not only ensures that the feature points of the sampled data points are not missing and that the image seen by the user on the screen is not distorted, but also reduces the number of data points loaded and displayed on the screen, reduces the amount of data processing on the screen and the memory occupation of the display terminal, and also reduces the network occupation caused by massive simulation data transmission, making the display of simulation results faster.
[0090] Furthermore, in step S200, in order to further ensure the efficiency of simulation data transmission and display, the resolution of the display screen can represent either the resolution of the device screen or the size of the interface or window displaying the simulation results. When the resolution of the display screen represents the resolution of the device screen, the resolution of the window can be determined according to the setting window code or other data.
[0091] Before step S202, to further reduce computation and achieve rapid display of simulation results, the server can determine a threshold for the number of data points to be displayed on the screen based on the screen resolution. This threshold is generally a natural multiple of the number of pixels in the horizontal direction of the screen. The server can determine this threshold according to actual needs. The more data points there are, the more accurate the simulation results will be, but the larger the amount of data to be processed. Then, the server determines the coordinates of each data point, determines the number of each data point, and judges the relationship between the number of data points and the threshold. It then determines whether sampling of the data points is necessary. If the number of data points is greater than the threshold, it is determined that each data point needs to be sampled; if the number of data points is less than the threshold, it is determined that each data point does not need to be sampled, as sampling will affect the display results of the simulation data.
[0092] The number of data points that can be identified can also be determined based on the user's visual recognition limit without affecting the user's observation of the simulation image. For example, when the simulation result is a curve, the curve is formed by connecting data points. At a horizontal pixel position, if the vertical number of points is greater than 1, the connecting line will be displayed as a vertical line or a point. Therefore, taking 1 to 2 points is enough to display the shape of the connecting line at that position. When the number of data points is less than twice the number of horizontal pixels on the screen, the shape of the curve can be clearly observed. The number threshold is generally twice the number of horizontal pixels.
[0093] If the simulation result is a waveform, in step S202, the server can sample each data point only based on the horizontal coordinate of each data point, that is, to divide the screen and divide each data point based on the horizontal coordinate of each data point.
[0094] If each data point is a point on a two-dimensional image, the server should sample each data point according to its horizontal and vertical coordinates to ensure the characteristics of the image formed by the sampled data points. Specifically, the server determines the horizontal and vertical pixel counts of the screen based on the screen resolution, and then divides the screen into pixel regions on an average basis according to these counts. Next, based on the coordinates of each data point, the server determines the first horizontal and first vertical coordinate ranges. Based on the number of pixel regions, the first horizontal and first vertical coordinate ranges, the server further divides the coordinates of each data point, determining the third horizontal and second vertical coordinate ranges corresponding to each data unit. Finally, based on the third horizontal and second vertical coordinate ranges corresponding to each data unit, the server determines the data points corresponding to each data unit.
[0095] In step S204, if each data point is a point on a waveform graph, sampling should be performed separately for each point on each waveform graph, rather than sampling points from multiple waveform graphs together. When determining the coordinates of the data point with the largest x-coordinate, the smallest x-coordinate, the largest y-coordinate, and the smallest y-coordinate in each data unit, duplicate data points can be removed from the sampled data points, thereby reducing the number of sampled data points without affecting the rendered curve. If the data unit contains multiple data points with the largest or smallest y-coordinates, the server can select only one as a feature point to further reduce the number of displayed data points. Similarly, if it contains multiple maximum or minimum points, only one can be selected as a feature point.
[0096] Finally, after determining the sampling data points in each data unit, the server determines the coordinates of the sampling data points in each data unit, so that the screen maps each sampling data point to the screen pixel coordinates according to the coordinates of each sampling data point, and draws the simulation result image according to the mapping result.
[0097] Specifically, if the simulation result is a curve, the server determines the correspondence between each pixel region and each data unit. Based on the correspondence and the coordinates of each sampled data point in each data unit, the server maps each sampled data point to the corresponding pixel region so that the screen can render the curve based on the coordinates of each sampled data point.
[0098] If the simulation result is a two-dimensional image, the server determines the correspondence between each pixel region and each data unit. Then, for each data unit, the server can select at least one sampling data point from each sampling data point in the data unit based on the number of pixel blocks in the pixel region corresponding to the data unit, and determine the corresponding feature value, so that the screen renders the two-dimensional image based on the corresponding feature values determined for each pixel region.
[0099] When there is only one pixel block within a pixel region, the server should display the data points in that data unit through that pixel block. The server can consistently use only one method to determine the sampled data points; when rendering a 2D image, the screen can render based on the data points determined by that method. When the server uses multiple data point sampling methods, the specific data point selected for rendering can be determined based on the user's desired image display effect. It can select data points with the largest or smallest eigenvalues, data points with abrupt changes in eigenvalues within each pixel region, or different data point selection methods for different regions of the 2D image based on the user's choice.
[0100] It should be noted that if the main body executing this data sampling method is a server other than the display terminal and the server with the simulation software installed in the distributed server, after determining the coordinates and other data of each sampling data point, the server should send the coordinates of each sampling data point to the server with the simulation software installed or the display terminal. This allows the server with the simulation software installed to send the coordinates of the determined sampling data points to the display terminal, thereby reducing the memory occupation of the simulation data on the display terminal.
[0101] like Figure 5 As shown, Figure 5 This diagram illustrates a sampling process for a curve graph provided in this specification. The original image is a portion of the curve of the image to be displayed. After determining the screen resolution, the curve is divided into four pixel regions, and then the corresponding data points within each pixel region are determined. Next, the data points within each pixel region are sampled to determine the point with the maximum and minimum ordinate, as well as the endpoints of the curve within that pixel region, thus defining all data points within each pixel region. The sampled data points are then mapped to the corresponding pixel regions on the screen, and the curve is rendered based on these data points.
[0102] In addition, the above-mentioned data sampling method can also be applied to electronic oscilloscopes or other scenarios where data points need to be displayed on the screen.
[0103] The above describes a data sampling method based on display screen resolution, provided by one or more embodiments of this specification. Based on the same idea, this specification also provides a corresponding data sampling device based on display screen resolution, such as... Figure 6 As shown.
[0104] Figure 6 This specification provides a data sampling device based on display screen resolution, the device being used to perform... Figure 2 A data sampling method is provided.
[0105] The acquisition module 600 is used to acquire the coordinates of each data point in the simulation data and the resolution of the screen displaying the simulation data;
[0106] The partitioning module 601 is used to divide the screen into pixel regions according to the resolution, divide the coordinates of each data point according to each pixel region, and determine each data unit after partitioning.
[0107] The sampling module 602 is used to determine the feature points and their corresponding coordinates in each data point of each data unit for each data unit, and use them as sampling data points, wherein the feature points are data points used to characterize the features of the simulation results.
[0108] Optionally, the device further includes a judgment module 603, specifically configured to determine a threshold number of data points that the screen can display based on the screen resolution; determine the number of each data point based on the coordinates of each data point; determine whether the number of each data point is greater than the threshold number; if so, determine that each data point needs to be sampled; if not, determine that each data point does not need to be sampled.
[0109] Optionally, the simulation result is a curve graph; the division module 601 is used to determine the horizontal number of pixels on the screen according to the resolution; divide the screen into pixel regions on an average basis according to the horizontal number of pixels; determine the first horizontal coordinate range of each data point according to the horizontal coordinate of each data point; divide the horizontal coordinate of each data point according to the number of pixel regions and the first horizontal coordinate range, and determine the second horizontal coordinate range corresponding to each data unit; determine each data point corresponding to each data unit according to the second horizontal coordinate range corresponding to each data unit.
[0110] Optionally, the simulation result is a two-dimensional image. The segmentation module 601 is used to determine the horizontal and vertical pixel counts of the screen based on the resolution; to divide the screen into pixel regions on an average basis based on the horizontal and vertical pixel counts; to determine the first horizontal coordinate range and the first vertical coordinate range of each data point based on the coordinates of each data point; to divide the coordinates of each data point based on the number of pixel regions, the first horizontal coordinate range, and the first vertical coordinate range, and to determine the third horizontal coordinate range and the second vertical coordinate range corresponding to each data unit; and to determine the data points corresponding to each data unit based on the third horizontal coordinate range and the second vertical coordinate range corresponding to each data unit.
[0111] Optionally, the simulation result is a curve graph; the sampling module 602 is used to determine the coordinates of the data point with the largest horizontal coordinate, the data point with the smallest horizontal coordinate, the data point with the largest vertical coordinate, and the data point with the smallest vertical coordinate in the data unit, as each sampling data point; to remove duplicates from each sampling data point according to the coordinates of each sampling data point; and to use the deduplicated sampling data points as feature points of the data unit corresponding to the pixel region.
[0112] Optionally, the simulation result is a two-dimensional image. The sampling module 602 is used to determine the feature value of each data point, select at least one of the following: extracting feature points for each data point in the data unit, determining the data point with the largest feature value in the pixel region, and determining the data point with the smallest feature value in the pixel region, to determine the sampled data points, and to determine the feature value corresponding to each sampled data point.
[0113] Optionally, the simulation result is a curve graph, and the device further includes a drawing module 604, which is used to determine the correspondence between each pixel region and each data unit, and to map each sampling data point to the corresponding pixel region according to the correspondence and the coordinates of each sampling data point in each data unit, so that the screen renders a curve graph according to the coordinates of each sampling data point.
[0114] Optionally, the simulation result is a two-dimensional image, and the device further includes a drawing module 604, used to determine the correspondence between each pixel region and each data unit; for each data unit, at least one sampled data point is selected from each sampled data point in the data unit, and the corresponding feature value is determined, so that the screen renders the two-dimensional image according to the corresponding feature value determined for each pixel region.
[0115] This instruction manual also provides Figure 7 The diagram shows a schematic structural representation of the electronic device. Figure 7 At the hardware level, the electronic device includes a processor, internal bus, network interface, memory, and non-volatile memory, and may also include other hardware required for the business operations. The processor reads the corresponding computer program from the non-volatile memory into memory and then runs it to achieve the above-mentioned functions. Figure 2 The data sampling method described herein. Of course, in addition to software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic device.
[0116] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many methodological improvements today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that a methodological improvement cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program and "integrate" a digital system onto a PLD themselves, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must also be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also understand that by simply performing some logic programming on the method flow using one of these hardware description languages and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.
[0117] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.
[0118] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.
[0119] For ease of description, the above devices are described in terms of function, divided into various units. Of course, in implementing this specification, the functions of each unit can be implemented in one or more software and / or hardware.
[0120] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0121] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0122] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0123] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0124] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0125] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0126] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0127] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0128] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this specification may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0129] This specification can be described in the general context of computer-executable instructions that are executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This specification can also be practiced in distributed computing environments, where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0130] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0131] The above description is merely an embodiment of this specification and is not intended to limit the scope of this specification. Various modifications and variations can be made to this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims of this invention.
Claims
1. A data sampling method based on display screen resolution, characterized in that, include: The coordinates of each data point in the simulation data and the resolution of the screen displaying the simulation data are obtained. The simulation data is generated by the simulation software during actual calculation. Based on the resolution, the screen is divided into pixel regions, and the coordinates of each data point are divided according to each pixel region to determine each data unit after division. For each data unit, the feature points and their corresponding coordinates in each data point of that data unit are determined as sampling data points. The feature points are data points used to characterize the features of the simulation results, and the feature points are determined according to the type of simulation image.
2. The method as described in claim 1, characterized in that, The method further includes dividing the screen into pixel regions: Based on the screen resolution, determine the threshold number of data points that the screen can display; The number of each data point is determined based on its coordinates. Determine whether the number of each data point is greater than the number threshold; If so, then it is determined that each data point needs to be sampled; If not, then it is determined that none of the data points need to be sampled.
3. The method as described in claim 1, characterized in that, The simulation results are presented as a curve graph. Based on the resolution, the screen is divided into pixel regions, and the coordinates of each data point are divided according to each pixel region to determine each data unit after division, specifically including: The horizontal pixel count of the screen is determined based on the resolution; The screen is divided horizontally into pixel regions based on the horizontal pixel count. Based on the x-coordinates of each data point, determine the first x-coordinate range of each data point; Based on the number of each pixel region and the first horizontal coordinate range, the horizontal coordinates of each data point are divided to determine the second horizontal coordinate range corresponding to each data unit. The data points corresponding to each data unit are determined based on the range of the second horizontal coordinate corresponding to each data unit.
4. The method as described in claim 1, characterized in that, The simulation result is a two-dimensional image; The screen is divided into pixel regions, and the coordinates of each data point are divided according to the pixel regions to determine the data units after division. Specifically, this includes: The horizontal and vertical pixel counts of the screen are determined based on the resolution. Based on the horizontal and vertical pixel counts, the screen is divided into pixel regions on an average basis. Based on the coordinates of each data point, determine the first abscissa range and the first ordinate range of each data point; Based on the number of each pixel region, the first horizontal coordinate range, and the first vertical coordinate range, the coordinates of each data point are divided to determine the third horizontal coordinate range and the second vertical coordinate range corresponding to each data unit. The data points corresponding to each data unit are determined based on the third horizontal coordinate range and the second vertical coordinate range corresponding to each data unit.
5. The method as described in claim 1, characterized in that, The simulation results are presented as a curve graph. Determine the feature points and their corresponding coordinates in each data point of the data unit, specifically including: Determine the coordinates of the data point with the largest x-coordinate, the data point with the smallest x-coordinate, the data point with the largest y-coordinate, and the data point with the smallest y-coordinate in the data unit, and use them as each sampling data point; The sampling data points are deduplicated based on their coordinates. Each deduplicated sampled data point is used as a feature point of the data unit corresponding to the pixel region, and the coordinates of the feature points are determined.
6. The method as described in claim 1, characterized in that, The simulation result is a two-dimensional image; Determine the feature points and their corresponding coordinates in each data point of the data unit, specifically including: The feature values of each data point are determined, and at least one of the following is selected: feature point extraction, determining the data point with the largest feature value in the pixel region, and determining the data point with the smallest feature value in the pixel region. Sampling data points are then determined, and the feature values corresponding to each sampling data point are determined.
7. The method as described in claim 1, characterized in that, The simulation result is a curve graph, and the method further includes: The correspondence between each pixel region and each data unit is determined. Based on the correspondence and the coordinates of each sampled data point in each data unit, each sampled data point is mapped to the corresponding pixel region, so that the screen renders a curve based on the coordinates of each sampled data point.
8. The method as described in claim 6, characterized in that, The simulation result is a two-dimensional image, and the method further includes: Determine the correspondence between each pixel region and each data unit; For each data unit, at least one sampled data point is selected from each sampled data point in that data unit, and the corresponding feature value is determined, so that the screen renders a two-dimensional image based on the corresponding feature value determined for each pixel region.
9. A data transmission device, characterized in that, include: The acquisition module is used to acquire the coordinates of each data point in the simulation data and the resolution of the screen displaying the simulation data, wherein the simulation data is the simulation data generated by the simulation software during actual calculation. The segmentation module is used to divide the screen into pixel regions according to the resolution, divide the coordinates of each data point according to each pixel region, and determine each data unit after segmentation. The sampling module is used to determine the feature points and their corresponding coordinates in each data point of each data unit for each data unit, and use them as sampling data points. The feature points are data points used to characterize the features of the simulation results, and the feature points are determined according to the type of simulation image.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the method described in any one of claims 1 to 8.
11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method described in any one of claims 1 to 8.
Citation Information
Patent Citations
View display method and device, storage medium and electronic equipment
CN116959387A