Data sampling method, device and equipment based on resolution of display screen
Through the data sampling method based on display resolution, feature points in the simulation result graph are extracted and data units are divided, which solves the problems of data point feature loss and large calculations in the prior art, and realizes efficient and accurate display of simulation results .
Patent Information
- Application Number
- CN202411425190.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-10-12
AI Technical Summary
When rendering simulation result graphs in the prior art, the fixed-step sampling method cannot ensure that the sampled data points contain sufficient feature points, resulting in image distortion. Although the Douglas sampling method reduces the number of data points, it increases the calculation amount, affecting the display efficiency. .
Using a data sampling method based on display resolution, by obtaining the coordinates and screen resolution of the simulation data points, the screen is divided into pixel areas, and the data units are determined, and feature points are extracted as sampled data points for each data unit to ensure the features. No missing points, reducing the number of data points and calculation amount.
It ensures the accuracy and display efficiency of the simulation result graph, reduces screen loading and memory usage, reduces the use of massive data transmission on the network, and makes the display of simulation results faster.
Smart Images

Figure CN118939221A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and more particularly to a method, device and apparatus for data sampling based on display screen resolution. Background Art
[0002] With the development of computer technology, the emergence of simulation software has greatly improved the verification efficiency of experiments and reduced the verification cost. Users use simulation software to simulate experimental results with mathematical models, and then the display end renders the simulation result graph by loading the coordinates of each data point in the simulation data calculated by the mathematical model.
[0003] In the prior art, in order to reduce the amount of data points loaded when rendering simulation result graphs, a fixed-step sampling method is usually used, that is, each data point is sampled according to the horizontal coordinate of each data point and the preset step length. However, sampling each data point according to the preset step length cannot guarantee that the sampled data points contain enough feature points, which will cause the sampled data points to lose some features or even important features, thereby causing the simulation result graph rendered on the screen to be distorted.
[0004] Therefore, this specification provides a data sampling method, device and equipment based on display screen resolution. Summary of the invention
[0005] This specification provides a data sampling method, device and equipment based on display screen resolution to partially solve the above-mentioned problems existing in the prior art.
[0006] This manual adopts the following technical solutions: A data sampling method based on display screen resolution, comprising: Obtaining coordinates of each data point in the simulation data and a resolution of a screen displaying the simulation data; According to the resolution, the screen is divided into pixel areas, the coordinates of the data points are divided according to the pixel areas, and the divided data units are determined; For each data unit, characteristic points and corresponding coordinates of each data point of the data unit are determined as sampling data points, wherein the characteristic points are data points used to characterize the characteristics of the simulation result.
[0007] Optionally, determining a threshold value of the number of data points that can be displayed on the screen according to a resolution of the screen; Determine the number of each data point according to the coordinates of each data point; Determine whether the number of each data point is greater than the number threshold; If yes, it is determined that each of the data points needs to be sampled; If not, it is determined that the data points do not need to be sampled.
[0008] Optionally, the simulation result is a curve graph; According to the resolution, the screen is divided into pixel areas, the coordinates of the data points are divided according to the pixel areas, and the divided data units are determined, specifically including: Determine the horizontal pixel number of the screen according to the resolution; Dividing the screen horizontally into pixel areas evenly according to the horizontal number of pixels; Determine a first horizontal coordinate range of each data point according to the horizontal coordinate of each data point; Dividing the horizontal coordinates of the data points according to the number of the pixel regions and the first horizontal coordinate range to determine the second horizontal coordinate ranges corresponding to the data units; The data points corresponding to the data units are determined according to the second horizontal axis ranges corresponding to the data units.
[0009] Optionally, the simulation result is a two-dimensional image; The screen is divided to determine pixel areas, the coordinates of the data points are divided according to the pixel areas, and the divided data units are determined, specifically including: Determine the horizontal number of pixels and the vertical number of pixels of the screen according to the resolution; Dividing the screen into pixel areas evenly according to the horizontal number of pixels and the vertical number of pixels; Determine a first horizontal coordinate range and a first vertical coordinate range of each data point according to the coordinates of each data point; Dividing the coordinates of each data point according to the number of each pixel area, the first horizontal coordinate range, and the first vertical coordinate range, to determine a third horizontal coordinate range and a second vertical coordinate range corresponding to each data unit respectively; The data points corresponding to the data units are determined according to the third horizontal coordinate range and the second vertical coordinate range corresponding to the data units.
[0010] Optionally, the simulation result is a curve graph; Determine the feature points and corresponding coordinates of each data point of the data unit, specifically including: Determine the coordinates of the data point with the largest abscissa, the coordinates of the data point with the smallest abscissa, the coordinates of the data point with the largest ordinate, and the coordinates of the data point with the smallest ordinate in the data unit as the sampling data points; Deduplication of each sampling data point according to the coordinates of each sampling data point; The deduplicated sampling data points are used as feature points of the data unit corresponding to the pixel area, and the coordinates of the feature points are determined.
[0011] Optionally, the simulation result is a two-dimensional image; Determine the feature points and corresponding coordinates of each data point of the data unit, specifically including: Determine the characteristic value of each data point, select at least one of extracting the characteristic points of each data point in the data unit, determining the data point with the largest characteristic value in the pixel area, and determining the data point with the smallest characteristic value in the pixel area, determine the sampling data points, and determine the characteristic value corresponding to each sampling data point.
[0012] Optionally, the simulation result is a curve graph, and the method further includes: Determine a correspondence between each pixel region and each data unit, and map each sampling data point to a corresponding pixel region according to the correspondence and the coordinates of each sampling data point in each data unit; Render a curve graph according to the coordinates of each sampling data point.
[0013] Optionally, the simulation result is a two-dimensional image, and the method further includes: Determining a correspondence between each pixel region and each data unit; For each data unit, at least one is selected from each sampling data point in the data unit, and a corresponding characteristic value is determined, so that the screen renders a two-dimensional image according to the corresponding characteristic value determined for each pixel area.
[0014] This specification provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned data sampling method is implemented.
[0015] 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 implements the above-mentioned data sampling method when executing the program.
[0016] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects: In a data sampling method based on screen resolution provided in this specification, the screen is divided according to the acquired screen resolution and the coordinates of the data points, and each pixel area is determined. Then, each data point is divided according to each pixel area to determine the divided data unit, and the correspondence between the pixel area and the data unit is determined. Then, for each data unit, the feature points of the data points in the data unit are sampled to determine the feature points of the corresponding pixel area.
[0017] It can be seen from the above method that by dividing the screen and each data point, the feature points in each data unit are displayed in the corresponding pixel area, which not only ensures that the feature points of the sampled data points are not missing and that the user sees the image on the screen without distortion, but also reduces the number of screen loading and actual data points, reduces the data processing volume of the screen and the memory usage of the display end, and also reduces the network usage due to massive simulation data transmission, making the display of simulation results faster. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings: Figure 1 A schematic diagram of a data point sampling process provided in an embodiment of this specification; Figure 2 A flowchart of a data sampling method provided in an embodiment of this specification; Figure 3 A schematic diagram of a pixel area division method provided in an embodiment of this specification; Figure 4 A schematic diagram of a pixel area division method provided in an embodiment of this specification; Figure 5 A schematic diagram of a sampling process of a curve graph provided in this specification; Figure 6 A schematic diagram of a data sampling device provided in an embodiment of this specification; Figure 7 The corresponding Figure 2 Schematic diagram of electronic equipment. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0020] With the development of computer technology, traditional test experiments require multiple modifications to circuits, components or devices to test circuits, components or devices under different parameters, which results in high verification costs. The emergence of simulation software has greatly improved verification efficiency. Users use simulation software to simulate experimental results using mathematical models, and then the display end loads the coordinates of each data point in the simulation data calculated by the mathematical model to render the simulation result graph, forming a user-visible image and rendering the simulation result graph.
[0021] However, during the actual operation process, the simulation software will generate a huge amount of simulation data. If all this simulation data is transmitted to the display end to show the simulation results to the user, a large amount of memory of the display end will be occupied. If the device where the simulation software is located and the display end device are different devices but are in the same distributed server, the transmission of massive simulation data will also cause the server's transmission network to be occupied to a large extent.
[0022] Therefore, when displaying the simulation results on the display end, the data points in the simulation data generated by the simulation software should be sampled, and then the sampled points should be determined, and the adopted points should be transmitted to the display end as data points for the display end to render the simulation results according to the sampled data points.
[0023] At present, in order to reduce the amount of data points loaded in the simulation data, a fixed-step sampling method is usually used, that is, each data point is sampled according to the horizontal coordinate of each data point and the preset step size. Although this method reduces the number of transmitted data points, it cannot guarantee that the sampled data points contain enough feature points, which will cause the sampled data points to lose some features or even important features.
[0024] At present, the Douglas sampling method is also used to implement the sampling of data points, that is, the distance from each data point to the line segment between the initial point and the end point is calculated respectively, and the maximum distance is determined to determine whether the maximum distance is less than the threshold. If so, only the initial point and the end point are retained. If not, the maximum distance point is retained and the maximum distance point is used as the new segmentation point to divide the original curve into two parts. Then the Douglas sampling method is recursively applied to these two parts respectively.
[0025] like Figure 1 As shown, Figure 1A schematic diagram of a data point sampling process provided in this specification. The data point sampling process is a sampling process of the Douglas sampling method, wherein before sampling, the curve contains six data points a, b, c, d, e, and f, wherein a and f are the initial point and the end point of the curve, respectively. When sampling, connect the line segment af, and then determine the distances between point b, point c, point d, and point e and the line segment af, wherein the distance between point b and line segment af is the farthest, and the distance from point b to line segment af is higher than the threshold, so point b is retained. Since point a and point b are both data points to be retained, only the points between point b and point f need to be sampled. Then, connect bf, and determine the distances between point c, point d, and point e and line segment bf, wherein the distance from point c to line segment bf is the farthest, and the distance is greater than the threshold, so point c is retained. Then continue to sample the data points between point c and point f. Connect cf, determine the distances of point d and point e from line segment cd respectively, and determine that the distances are both less than the threshold, so point d and point e are not retained, determine the sampled data points: point a, point b, point c, point f, and render the curve graph based on the sampled data points.
[0026] However, although the Douglas sampling method reduces the data points required when rendering the simulation result graph, during the sampling process, due to the recursive calculation of the Douglas sampling method, massive calculations are often required when sampling massive data. That is, although the amount of data loading is reduced, the amount of calculation in the sampling process is greatly increased, which will still affect the display efficiency of the simulation results on the display end.
[0027] Therefore, this specification provides a data sampling method based on screen resolution, so that the screen of the display end can reduce the loading amount of data points without affecting the display effect of the simulation results.
[0028] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.
[0029] like Figure 2 As shown, Figure 2 A schematic diagram of the process of a data sampling method provided in an embodiment of this specification.
[0030] S200: Acquire the coordinates of each data point in the simulation data and the resolution of the screen displaying the simulation data.
[0031] In one or more embodiments of this specification, it is not limited to which device is used to implement the data sampling method, such as a personal computer, a mobile terminal, and a server. However, since the subsequent steps involve operations such as simulation data acquisition and screen resolution recognition, which are generally performed by a server, this specification will also take the server executing the data sampling method as an example for description. Among them, the server can be a single device, or composed of multiple devices, such as a distributed server, and this specification does not limit this.
[0032] In one or more embodiments of the present specification, if the server of the simulation software and the display end are in the same device, the data sampling method can be used by the device where the simulation software is installed to determine the sampled data points by the data sampling method before transmitting the simulation data to the display end for display. If the simulation software and the display end are in different devices, the server where the simulation software is installed can also determine the sampled data points by the data sampling method before transmitting each data point of the simulation data to the display end, and then transmit the sampled data points to the display end server, or other servers can sample each data point in the simulation data by the data sampling method, determine the coordinates of each data point after sampling, and inform the device where the simulation software is installed or the device at the display end. For the convenience of subsequent description, the data sampling method is described by taking the simulation software being installed on the device where the display end is located and executing the data sampling method as an example.
[0033] In order to sample 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 each data point can be sampled according to the coordinates of each data point. Then, in order to make the sampled data points fit the screen of the display terminal when displayed, the server should also obtain the resolution of the screen of the display terminal, so that each data point can be divided according to the resolution of the screen.
[0034] Of course, in one or more embodiments of the present specification, the server is not limited to the specific method by which it obtains the coordinates of each data point and the resolution of the display screen. When obtaining the coordinates of each data point, the coordinates of each data point can be determined by obtaining the simulation result file of the simulation software, or by accessing the result storage address of the simulation software to obtain the coordinates of each data point.
[0035] When obtaining the resolution of the display screen, the server may obtain the resolution of the display screen by obtaining the device information of the display, or may 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.
[0036] In addition, in one or more embodiments of the present specification, the specific form of the simulation data is not limited, and it can be a two-dimensional image or a curve graph, but different data forms have different methods for determining feature points later. It should be noted that in one or more embodiments of the present specification, the curve graph is a monotonic curve graph, and a non-monotonic curve graph can be regarded as a two-dimensional image.
[0037] S202: Divide the screen into pixel areas according to the resolution, divide the coordinates of the data points according to the pixel areas, and determine the divided data units.
[0038] In order to ensure that the feature points in the sampled data points can adapt to the current screen when the sampled data points are displayed on the screen without affecting the user's observation of the simulation results, the server can divide the screen according to the screen resolution, determine the pixel areas after division, and then divide the coordinates of each data point according to the determined pixel areas, determine the data units after division, and then realize the display of the data points in each data unit on the screen after sampling.
[0039] Specifically, the server divides the screen of the display terminal according to the resolution of the display terminal and determines the areas of each pixel. It should be noted that in one or more embodiments of the present specification, when the server divides the screen, it divides the screen according to the type of simulation result graph. Of course, no matter whether the simulation result graph is a curve graph or a two-dimensional image, the simulation result graph can be regarded as a two-dimensional image. Therefore, the screen can be divided by the following method.
[0040] That is Figure 3 As shown, Figure 3 As shown, Figure 3 This is a schematic diagram of a pixel area division method provided in this specification. That is, it is a screen division method for a two-dimensional image in the simulation result diagram. The server determines the horizontal pixel number and the vertical pixel number of the screen according to the resolution of the screen, and then divides the screen into pixel areas according to the horizontal pixel number and the vertical pixel number. For example, for a screen with a resolution of 2560×1400, the server can divide the screen into 3584000 pixel areas.
[0041] If the simulation image is a curve graph, there are generally no two data points with the same horizontal coordinate but different vertical coordinates. Therefore, when the server divides the screen, it can divide the screen only according to the horizontal resolution of the screen. Figure 4 As shown, Figure 4 This is a schematic diagram of a pixel area division method provided in this specification. That is, if the screen resolution is 2560×1400, the server can divide the screen horizontally into a maximum of 2560 pixel areas.
[0042] After determining each pixel area, the server divides the coordinates of each data point according to each pixel area to determine each data unit, each data unit containing at least one data point. Of course, in one or more embodiments of this specification, there is no limitation on the specific way in which the server divides each data point. A coordinate system may be established on the screen, and then each data point may be mapped to the screen according to the coordinates of each data point. Then, according to the division of each pixel area on the screen, the data point corresponding to each pixel area is determined, and the data point corresponding to each pixel area is taken as a data unit.
[0043] Of course, the division can also be performed based on the number of divided pixel areas and the coordinates of each data point. For example, when the determined pixel areas are 10 pixel areas arranged horizontally, the horizontal coordinate range of each data point is determined based on the horizontal coordinate of each data point, and then the horizontal coordinate range is divided into 10 parts on average. The data points with horizontal coordinates in the same horizontal coordinate range constitute a data unit, and then the corresponding pixel area is determined based on the horizontal coordinate of each data point in each data unit.
[0044] S204: For each data unit, determine a feature point and a corresponding coordinate among the data points of the data unit as a sampling data point, wherein the feature point is a data point used to characterize a feature of a simulation result.
[0045] After completing the division of the data units, the server shall perform feature point sampling on the data points in each pixel area, thereby sampling the entire simulation data and reducing the number of data points that need to be displayed on the display terminal when displaying the simulation data. In order not to affect the display result of the sampled simulation data on the screen of the display terminal, feature point extraction shall be performed on the data points in each data unit, so that the sampled data points in each data unit can be displayed through the corresponding pixel area.
[0046] Specifically, the server extracts feature points for each data unit and each data point in each data unit. The server may use different feature point sampling methods for different types of data points. For example, for each data point in the curve graph, the server may extract feature points for the point with the maximum ordinate value, the point with the minimum ordinate value, and the points at both ends of the area in each pixel area. It may also include data points corresponding to the extreme points of the curve or other points that can represent the characteristics of the curve.
[0047] For each data point of the image data, the server may first determine the characteristic value of each data point, which may be the value of the data point in the RGB or HSV color space when it is displayed on the screen, the grayscale value corresponding to the data point when it is displayed on the screen, or other values used to represent the characteristics of the data point when it is displayed on the screen. The server may then use at least one of the following methods to extract points with sudden characteristic value changes in each pixel region, determine the data point with the largest characteristic value, and determine the point with the smallest characteristic value to determine the sampled data point, and record the characteristic value of the data point as the characteristic point sampled in the pixel region.
[0048] That is to say, in one or more embodiments of the present specification, the server is not limited to the specific method used to obtain the feature points in the data points corresponding to the data unit corresponding to each pixel area. The server can determine the feature points to be extracted according to the type of the simulation image.
[0049] Then, the server uses the determined feature points as sampling data points, and obtains information such as coordinates and pixel values of each sampling data point, so as to display the simulation results later.
[0050] based on Figure 2 In a 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, and each pixel area is determined. Then, each data point is divided according to each pixel area to determine the divided data unit, and the correspondence between the pixel area and the data unit is determined. Then, for each data unit, the feature points of the data points in the data unit are sampled to determine the feature points of the corresponding pixel area.
[0051] It can be seen from the above method that by dividing the screen and each data point, the feature points in each data unit are displayed in the corresponding pixel area, which not only ensures that the feature points of the sampled data points are not missing and that the user sees the image on the screen without distortion, but also reduces the number of screen loading and actual data points, reduces the data processing volume of the screen and the memory usage of the display end, and also reduces the network usage due to massive simulation data transmission, making the display of simulation results faster.
[0052] In addition, in step S200, in order to further ensure the efficiency of simulation data transmission and display, the resolution of the display screen can represent both the resolution of the device screen and the resolution 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 based on the code or other data for setting the window.
[0053] Before step S202, in order to further reduce the amount of calculation and realize the rapid display of simulation results, the server can also determine the number threshold of the data points displayed on the screen according to the resolution of the screen. The number threshold is generally a natural number multiple of the number of pixels in the horizontal direction of the screen. The server can determine according to actual needs. The more data points there are, the more accurate the simulation results will be, but the amount of data to be processed will be larger. Then, the server determines the coordinates of each data point, determines the number of each data point, determines the relationship between the number of each data point and the number threshold, and determines whether the data points need to be sampled. If the number of data points is greater than the number threshold, it is determined that each data point needs to be sampled. If the number of data points is less than the number threshold, it is determined that each data point does not need to be sampled, and sampling will affect the display results of the simulation data.
[0054] The number of identifiable data points that will not affect the user's observation of the simulated image can also be determined based on the recognition limit of the user's naked eye. For example, when the simulation result graph is a curve graph, the curve graph is formed by connecting data points. At a horizontal pixel position, if the number of vertical points is greater than 1, the connection will be displayed as a vertical line or a dot, so 1 to 2 points are sufficient to display the shape of the connection at that position. When the number of data points is within 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.
[0055] If the simulation result is a waveform graph, in step S202, the server may sample each data point only according to the horizontal coordinate of each data point, that is, divide the screen and divide each data point according to the horizontal coordinate of each data point.
[0056] If each data point is a point on a two-dimensional image, the server should sample each data point according to the horizontal coordinate and the vertical coordinate of each data point, so as to ensure the characteristics of the image formed by the sampled data points. Specifically, the server determines the number of horizontal pixels and the number of vertical pixels of the screen according to the screen resolution, and then divides the screen into pixel areas according to the number of horizontal pixels and the number of vertical pixels. Then, according to the coordinates of each data point, the first horizontal coordinate range and the first vertical coordinate range of each data point are determined. According to the number of pixel areas, the first horizontal coordinate range and the first vertical coordinate range, the coordinates of the data points are divided to determine the third horizontal coordinate range and the second vertical coordinate range corresponding to each data unit. Finally, according to 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.
[0057] In step S204, if each data point is a point on a waveform graph, the points on each waveform graph should be sampled separately, rather than sampling the points on multiple waveform graphs together. When determining the coordinates of the data point with the largest horizontal coordinate, the coordinates of the data point with the smallest horizontal coordinate, the coordinates of the data point with the largest vertical coordinate, and the coordinates of the data point with the smallest vertical coordinate in each data unit, the sampled data points can be deduplicated, thereby reducing the number of sampled data points without affecting the effect of the rendered curve. If the data unit contains multiple data points with the largest vertical coordinates or multiple data points with the smallest vertical coordinates, the server can take only one of them as a feature point in order to further reduce the number of displayed data points. If it contains multiple maximum points or minimum points, it can also take only one of them as a feature point.
[0058] 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.
[0059] Specifically, if the simulation result is a curve graph, the server determines the correspondence between each pixel area and each data unit, and maps each sampling data point to the corresponding pixel area according to the correspondence and the coordinates of each sampling data point in each data unit, so that the screen can render the curve graph according to the coordinates of each sampling data point.
[0060] If the simulation result is a two-dimensional image, the server determines the correspondence between each pixel area and each data unit. Then, for each data unit, the server can select at least one from each sampling data point in the data unit according to the number of pixel blocks in the pixel area corresponding to the data unit, and determine the corresponding feature value, so that the screen renders the two-dimensional image according to the corresponding feature value determined for each pixel area.
[0061] When there is only one pixel block in the pixel area, it means that the server should display each data point in the data unit through the pixel block. The server can use only one method to determine the sampled data points. When rendering a two-dimensional image, the screen can be rendered based on the data points sampled and determined by this method. When the server uses multiple data point sampling methods, the specific selection of which data point to render can be determined based on the image display effect required by the user. You can select the data points with the largest or smallest eigenvalues, or you can select the data points with sudden changes in eigenvalues in each pixel area. You can also use different data point selection methods for different areas of the two-dimensional image based on the user's choice.
[0062] It should be noted that if the main body executing the 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 or display terminal with the simulation software installed, so that the server with the simulation software installed can send the determined coordinates of the sampling data point to the display terminal, thereby reducing the memory occupied by the simulation data on the display terminal.
[0063] like Figure 5 As shown, Figure 5 A schematic diagram of a sampling process of a curve graph provided in this specification. The original image is a portion of the curve of the image to be displayed, and then after determining the resolution of the screen, the curve is divided to determine that the portion of the curve corresponds to 4 pixel areas, and then the corresponding data points in each pixel area are determined. Then, the data points in each pixel area are sampled to determine the point with the maximum value of the ordinate, the point with the minimum value of the ordinate, and the endpoint of the curve in the pixel area, and the data points in each pixel area are determined. The sampled data points are mapped to the pixel area corresponding to the screen, and the curve is rendered according to the determined data points.
[0064] In addition, the above data sampling method can also be applied to electronic oscilloscopes or other scenarios where data points need to be displayed on a screen.
[0065] The above is 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 shown.
[0066] Figure 6 This specification provides a data sampling device based on display screen resolution, which is used to perform Figure 2 A data sampling method is provided.
[0067] An 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; A division module 601 is used to divide the screen into pixel areas according to the resolution, divide the coordinates of the data points according to the pixel areas, and determine the divided data units; The sampling module 602 is used to determine, for each data unit, feature points and corresponding coordinates of each data point of the data unit as sampling data points, wherein the feature points are data points used to characterize the characteristics of the simulation result.
[0068] Optionally, the device also includes a judgment module 603, which is specifically used to determine a threshold value of the number of data points that can be displayed on the screen according to the resolution of the screen; determine the number of each data point according to the coordinates of each data point; determine whether the number of each data point is greater than the threshold value; if so, determine that each data point needs to be sampled; if not, determine that each data point does not need to be sampled.
[0069] Optionally, the simulation result is a curve graph; the division module 601 is used to determine the number of horizontal pixels of the screen according to the resolution; divide the screen into pixel areas on average according to the number of horizontal 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 areas and the first horizontal coordinate range to 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.
[0070] Optionally, the simulation result is a two-dimensional image, and the division module 601 is used to determine the horizontal pixel number and the vertical pixel number of the screen according to the resolution; divide the screen into pixel areas on an even basis according to the horizontal pixel number and the vertical pixel number; determine the first horizontal coordinate range and the first vertical coordinate range of each data point according to the coordinates of each data point; divide the coordinates of each data point according to the number of pixel areas, the first horizontal coordinate range and the first vertical coordinate range, and determine the third horizontal coordinate range and the second vertical coordinate range corresponding to each data unit; determine each data point corresponding to each data unit according to the third horizontal coordinate range and the second vertical coordinate range corresponding to each data unit.
[0071] 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 coordinates of the data point with the smallest horizontal coordinate, the coordinates of the data point with the largest vertical coordinate, and the coordinates of the data point with the smallest vertical coordinate in the data unit as each sampling data point; deduplicate the sampling data points according to the coordinates of the sampling data points; and use the deduplicated sampling data points as feature points of the data unit corresponding to the pixel area.
[0072] Optionally, the simulation result is a two-dimensional image, and the sampling module 602 is used to determine the eigenvalues of the data points, select at least one of feature point extraction for each data point in the data unit, determine the data point with the largest eigenvalue in the pixel area, and determine the data point with the smallest eigenvalue in the pixel area, determine the sampling data points, and determine the eigenvalues corresponding to each sampling data point.
[0073] Optionally, the simulation result is a curve graph, and the device also includes a drawing module 604, which is used to determine the correspondence between each pixel area and each data unit, and map each sampling data point to a corresponding pixel area according to the correspondence and the coordinates of each sampling data point in each data unit, so that the screen renders the curve graph according to the coordinates of each sampling data point.
[0074] Optionally, the simulation result is a two-dimensional image, and the device also includes a drawing module 604, which is used to determine the correspondence between each pixel area and each data unit; for each data unit, at least one is selected from each sampling data point in the data unit, and the corresponding eigenvalue is determined, so that the screen renders the two-dimensional image according to the corresponding eigenvalue determined for each pixel area.
[0075] This manual also provides Figure 7 The schematic structure diagram of the electronic device shown in FIG. Figure 7 As mentioned above, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 2 Of course, in addition to the software implementation, this specification does not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic.
[0076] In the 1990s, it was very clear whether the improvement of a technology was hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with hardware entity modules. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one kind of HDL, but many kinds, 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, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0077] The controller may be implemented in any suitable manner, for example, the controller may take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (e.g., software or firmware) executable by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, and the memory controller may also be implemented as part of the control logic of the memory. It is also known to those skilled in the art that, in addition to implementing the controller in a purely computer-readable program code manner, the controller may be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller may be considered as a hardware component, and the devices for implementing various functions included therein may also be considered as structures within the hardware component. Or even, the devices for implementing various functions may be considered as both software modules for implementing the method and structures within the hardware component.
[0078] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0079] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0080] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented 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.
[0081] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0082] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0083] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0084] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0085] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0086] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules 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 technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0087] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0088] It should be understood by those skilled in the art that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented 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.
[0089] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0090] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0091] The above description is only an embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the scope of the claims of the present invention.
Claims
1. A data sampling method based on display screen resolution, characterized in that: include: Obtaining coordinates of each data point in the simulation data and a resolution of a screen displaying the simulation data; According to the resolution, the screen is divided into pixel areas, the coordinates of the data points are divided according to the pixel areas, and the divided data units are determined; For each data unit, characteristic points and corresponding coordinates of each data point of the data unit are determined as sampling data points, wherein the characteristic points are data points used to characterize the characteristics of the simulation result.
2. The method according to claim 1, characterized in that: Dividing the screen into pixel areas, the method further comprises: Determining a threshold value of the number of data points that can be displayed on the screen according to the resolution of the screen; Determine the number of each data point according to the coordinates of each data point; Determine whether the number of each data point is greater than the number threshold; If yes, it is determined that each of the data points needs to be sampled; If not, it is determined that the data points do not need to be sampled.
3. The method according to claim 1, characterized in that: The simulation result is a curve graph; According to the resolution, the screen is divided into pixel areas, the coordinates of the data points are divided according to the pixel areas, and the divided data units are determined, specifically including: Determine the horizontal pixel number of the screen according to the resolution; Dividing the screen horizontally into pixel areas evenly according to the horizontal number of pixels; Determine a first horizontal coordinate range of each data point according to the horizontal coordinate of each data point; Dividing the horizontal coordinates of the data points according to the number of the pixel regions and the first horizontal coordinate range to determine the second horizontal coordinate ranges corresponding to the data units; The data points corresponding to the data units are determined according to the second horizontal axis ranges corresponding to the data units.
4. The method according to claim 1, characterized in that: The simulation result is a two-dimensional image; The screen is divided to determine pixel areas, the coordinates of the data points are divided according to the pixel areas, and the divided data units are determined, specifically including: Determine the horizontal number of pixels and the vertical number of pixels of the screen according to the resolution; Dividing the screen into pixel areas evenly according to the horizontal number of pixels and the vertical number of pixels; Determine a first horizontal coordinate range and a first vertical coordinate range of each data point according to the coordinates of each data point; Dividing the coordinates of each data point according to the number of each pixel area, the first horizontal coordinate range, and the first vertical coordinate range, to determine a third horizontal coordinate range and a second vertical coordinate range corresponding to each data unit respectively; The data points corresponding to the data units are determined according to the third horizontal coordinate range and the second vertical coordinate range corresponding to the data units.
5. The method according to claim 1, characterized in that: The simulation result is a curve graph; Determine the feature points and corresponding coordinates of each data point of the data unit, specifically including: Determine the coordinates of the data point with the largest abscissa, the coordinates of the data point with the smallest abscissa, the coordinates of the data point with the largest ordinate, and the coordinates of the data point with the smallest ordinate in the data unit as the sampling data points; Deduplication of each sampling data point according to the coordinates of each sampling data point; The deduplicated sampling data points are used as feature points of the data unit corresponding to the pixel area, and the coordinates of the feature points are determined.
6. The method according to claim 1, characterized in that: The simulation result is a two-dimensional image; Determine the feature points and corresponding coordinates of each data point of the data unit, specifically including: Determine the characteristic value of each data point, select at least one of extracting the characteristic points of each data point in the data unit, determining the data point with the largest characteristic value in the pixel area, and determining the data point with the smallest characteristic value in the pixel area, determine the sampling data points, and determine the characteristic value corresponding to each sampling data point.
7. The method according to claim 1, characterized in that: The simulation result is a curve graph, and the method further includes: Determine the correspondence between each pixel area and each data unit, and map each sampling data point to a corresponding pixel area 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.
8. The method according to claim 6, characterized in that: The simulation result is a two-dimensional image, and the method further includes: Determining a correspondence between each pixel region and each data unit; For each data unit, at least one is selected from each sampling data point in the data unit, and a corresponding characteristic value is determined, so that the screen renders a two-dimensional image according to the corresponding characteristic value determined for each pixel area.
9. A data transmission device, characterized in that: include: An acquisition module, used to acquire the coordinates of each data point in the simulation data and the resolution of the screen displaying the simulation data; A division module, used to divide the screen into pixel areas according to the resolution, divide the coordinates of the data points according to the pixel areas, and determine the divided data units; The sampling module is used to determine, for each data unit, feature points and corresponding coordinates of each data point of the data unit as sampling data points, wherein the feature points are data points used to characterize the characteristics of the simulation results.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of claims 1 to 8 is implemented.
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, the method described in any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Image processing method and apparatus, computer apparatus, and readable storage medium
CN108833877A
View display method and device, storage medium and electronic equipment
CN116959387A
Texture data sampling method and device, storage medium and electronic equipment
CN117934648A
Display processing method and device, electronic equipment and storage medium
CN118505830A
