Curve graph generation method, curve graph generation device and electronic equipment

By acquiring the size of the display device and the target dataset, coefficients are determined, and curves adapted to different types and sizes of display devices are generated. Combined with user operations, the problem of poor curve display effect is solved, achieving better display and presentation effects, and facilitating user analysis.

CN114926564BActive Publication Date: 2025-11-14CRSC URBAN RAIL TRANSIT TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210395090.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-14
Publication Date
2025-11-14
Estimated Expiration
2042-04-14

AI Technical Summary

Technical Problem

In modern urban rail transit signaling systems, curve graphs are not well-displayed and cannot meet users' needs for data inspection and analysis.

Method used

By acquiring the size of the display device and the target dataset, coefficients are determined, and curves adapted to different types and sizes of display devices are generated. The display coordinates of the curves are then adjusted based on the user's zooming and dragging operations.

Benefits of technology

The generated graphs better meet user needs, have better display and presentation effects, and make it easier for users to check and analyze data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114926564B_ABST
    Figure CN114926564B_ABST
Patent Text Reader

Abstract

This invention provides a method, apparatus, and electronic device for generating curve graphs. The method includes acquiring the display width and height of a display device; determining a first coefficient based on the display width and a first target dataset; determining a second coefficient based on the display height and a second target dataset; determining the display abscissa of a target point based on the first coefficient and the first target dataset; determining the display ordinate of the target point based on the second coefficient and the second target dataset; and generating a target curve graph based on the display abscissa and ordinate. The curve graph generation method of this invention combines data characteristics, display device size, user scaling, and dragging / moving needs to generate curve graphs adapted to different types of data, different display device sizes, and user operation requirements, resulting in better display and presentation effects, better meeting user needs, and facilitating data inspection and analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of rail transit technology, and in particular to a method, apparatus and electronic device for generating curve graphs. Background Technology

[0002] In modern urban rail transit signaling systems, train traction calculations are frequently used to determine the most suitable technical parameters, guiding the design of tracks, signaling, and power supply to achieve efficient and energy-saving train operation. Train distance-time (ST), speed-time (VT), and speed-distance (VS) curves reflect the basic operating conditions of trains and form the basis for traction calculations and signaling system capability analysis. However, after generating these curves using computer software, the resulting graphs often suffer from poor display quality due to the different dimensions of different data types and varying display sizes on different devices, failing to meet users' needs for data inspection and analysis. Summary of the Invention

[0003] This invention provides a method for generating curve graphs to address the shortcomings of poor curve graph display in existing technologies, enabling the generation of curve graphs based on customer needs and the size of the display device.

[0004] This invention provides a method for generating curve graphs, comprising:

[0005] Obtain the display width and display height of the display device;

[0006] Based on the display width and the first target dataset, a first coefficient is determined, and based on the display height and the second target dataset, a second coefficient is determined. The first target dataset is the original dataset corresponding to the horizontal axis, and the second target dataset is the original dataset corresponding to the vertical axis.

[0007] Based on the first coefficient and the first target dataset, determine the displayed x-coordinate of the target point as X = K1*M obj +L1, based on the second coefficient and the second target dataset, determine the displayed ordinate Y = K2*N of the target point. obj +L2, K1 is used to represent the first coefficient, K2 is used to represent the second coefficient, M obj N represents the original data corresponding to the x-coordinate of the target point in the first target dataset. obj L1 represents the original data corresponding to the ordinate of the target point in the second target dataset, and L2 represents the offset of the abscissa of the target point.

[0008] Based on the displayed horizontal and vertical coordinates, a target curve is generated.

[0009] According to a curve generation method provided by the present invention, determining a first coefficient based on the display width and a first target dataset includes:

[0010] Obtain the distance X1 from the left boundary of the display area of ​​the curve display device and the distance X2 from the right boundary of the display device;

[0011] Based on the maximum value M in the first target dataset objmax The first coefficient K1 is determined to be (ScreenWidth - X1 - X2) / (MaxX * ScaleX); where ScreenWidth represents the display width, and MaxX represents the fixed scaling factor of the horizontal axis and the maximum value M. objmax The product of ScaleX and ScaleX represents the initial scaling factor of the horizontal axis.

[0012] According to a curve generation method provided by the present invention, determining a second coefficient based on the display height and a second target dataset includes:

[0013] Obtain the distance Y1 from the upper boundary of the display device and the distance Y2 from the lower boundary of the display device to the curve display area in the display device;

[0014] Based on the maximum value N in the second target dataset objmax The second coefficient K2 is determined to be (ScreenHeight - Y1 - Y2) / (MaxY * ScaleY); where ScreenHeight represents the display height, and MaxY represents the ratio of the vertical axis to the maximum value N. objmax The product of ScaleY and ScaleY is used to represent the initial scaling factor of the ordinate.

[0015] According to a curve graph generation method provided by the present invention, after generating the target curve graph, the method further includes:

[0016] Receive user input via mouse wheel scrolling and obtain the display coordinates (X', Y') of the mouse point;

[0017] Based on the scrolling direction of the mouse wheel, the scaling factor K3 is determined;

[0018] Based on the scaling factor and the display coordinates of the mouse point, the first target coefficient, the second target coefficient, the offset of the horizontal axis, and the offset of the vertical axis are redefined. The redefined first target coefficient K1' = K1 * K3, the redefined second target coefficient K2' = K2 * K3, and the redefined offset of the horizontal axis L1' = X' - K1' * Mobj The redefined offset of the ordinate is L2' = Y' - K2' * N. obj ;

[0019] The displayed horizontal and vertical coordinates are redefined;

[0020] Based on the displayed horizontal and vertical coordinates, the target curve is regenerated.

[0021] According to a curve generation method provided by the present invention, when the scrolling direction of the mouse wheel is a first direction, the scaling factor K3 satisfies 0 < K3 < 1;

[0022] When the scrolling direction of the mouse wheel is the second direction, the scaling factor K3 satisfies that K3 is greater than 1;

[0023] Wherein, the first direction and the second direction are opposite directions.

[0024] According to a curve graph generation method provided by the present invention, after generating the target curve graph, the method further includes:

[0025] Receive user input via mouse clicks and drags, and obtain the displayed coordinates (X, Y) of the mouse point during the dragging process. t Y t );

[0026] Upon releasing the mouse click, the offset of the horizontal axis and the offset of the vertical axis are redefined, and the redefined offset of the horizontal axis L1' = X. t -K1*M obj The offset of the redefined ordinate L2' = Y t -K2*N obj ;

[0027] The displayed horizontal and vertical coordinates are redefined;

[0028] Based on the displayed horizontal and vertical coordinates, the target curve is regenerated.

[0029] The present invention also provides a curve graph generation apparatus, comprising:

[0030] The acquisition module is used to acquire the display width and display height of the display device;

[0031] A first processing module is configured to determine a first coefficient based on the display width and the first target dataset, and to determine a second coefficient based on the display height and the second target dataset, wherein the first target dataset is the original dataset corresponding to the horizontal axis and the second target dataset is the original dataset corresponding to the vertical axis.

[0032] The second processing module is used to determine the display x-coordinate X = K1*M of the target point based on the first coefficient and the first target dataset. obj +L1, based on the second coefficient and the second target dataset, determine the displayed ordinate Y = K2*N of the target point. obj +L2, K1 is used to represent the first coefficient, K2 is used to represent the second coefficient, M obj N represents the original data corresponding to the x-coordinate of the target point in the first target dataset. obj L1 represents the original data corresponding to the ordinate of the target point in the second target dataset, and L2 represents the offset of the abscissa of the target point.

[0033] The generation module is used to generate a target curve based on the displayed horizontal coordinate and the displayed vertical coordinate.

[0034] The present invention also 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 curve generation method as described above.

[0035] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the graph generation method as described above.

[0036] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the curve generation method as described above.

[0037] The graph generation method provided by this invention generates graphs that are suitable for different types of data, different sizes of display devices, and user operation needs by combining data characteristics, display device size, user scaling and dragging requirements. This results in better display and presentation effects, better meeting user needs and facilitating user inspection and analysis of data. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0039] Figure 1 This is one of the flowcharts illustrating the curve generation method provided by the present invention;

[0040] Figure 2 This is the second flowchart illustrating the curve generation method provided by the present invention;

[0041] Figure 3 This is one of the curve graphs generated by the curve graph generation method provided by this invention;

[0042] Figure 4 This is the second type of curve generated by the curve generation method provided by the present invention;

[0043] Figure 5 This is the third flowchart illustrating the curve generation method provided by the present invention;

[0044] Figure 6 This is the third type of curve generated by the curve generation method provided by the present invention;

[0045] Figure 7 This is the fourth flowchart of the curve generation method provided by the present invention;

[0046] Figure 8 This is a schematic diagram of the curve generation device provided by the present invention;

[0047] Figure 9 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0048] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0049] The following is combined with Figures 1-9 The present invention describes a graph generation method, a graph generation apparatus, and an electronic device.

[0050] The curve generation method of this invention includes steps 110, 120, 130 and 140.

[0051] Step 110: Obtain the display width and display height of the display device.

[0052] It is understandable that a display device is a container used to display graphs, and different display devices have different sizes and different aspect ratios.

[0053] The display width of a display device is the width of the area within the display device that can be used for display and presentation, and the display height of a display device is the height of the area within the display device that can be used for display and presentation.

[0054] The display device can be a screen, monitor, television, large display screen, or other similar device of an electronic device; there is no restriction on the type of display device.

[0055] Step 120: Determine the first coefficient based on the display width and the first target dataset, and determine the second coefficient based on the display height and the second target dataset.

[0056] It should be noted that the first target dataset is the dataset corresponding to the horizontal axis, and the second target dataset is the dataset corresponding to the vertical axis.

[0057] When plotting curves based on different data, the meanings of the parameters represented by the horizontal and vertical axes of the curves will also be different.

[0058] For example, when plotting a train distance-time (ST) curve, the first target dataset is the dataset corresponding to time T on the horizontal axis, and the second target dataset is the dataset corresponding to distance S on the vertical axis.

[0059] When plotting the speed-distance (VS) curve of a train, the first target dataset is the dataset corresponding to the distance S on the horizontal axis, and the second target dataset is the dataset corresponding to the speed V on the vertical axis.

[0060] It is understandable that the horizontal axis of the display device is used to draw the curve along the display width direction, and the vertical axis of the display device is used to draw the curve along the display height direction.

[0061] Based on the display width and the first target dataset, a first coefficient can be determined, which is used to characterize the relationship between the horizontal axis of the curve and the display width of the display device.

[0062] Based on the display height and the second target dataset, a second coefficient can be determined, which is used to characterize the relationship between the vertical axis of the curve and the display height of the display device.

[0063] In some embodiments, determining a first coefficient based on the display width and a first target dataset includes obtaining the distance X1 from the left boundary of the display device and the distance X2 from the right boundary of the display device to the curve display area in the display device.

[0064] Understandably, graphs are used to display data within the area of ​​a display device that is available for display and presentation. However, the area displayed by a graph is smaller than the area available for display and presentation on the display device.

[0065] After determining the distances X1 from the left boundary of the curve display area to the right boundary of the display device, X2 from the right boundary of the display device, Y1 from the top boundary of the display device, and Y2 from the bottom boundary of the display device, the first coefficient and the second coefficient can be confirmed.

[0066] In some embodiments, the maximum value M in the first target dataset can be used as the basis. objmax Determine the first coefficient.

[0067] It is understandable that the maximum value in the first target dataset represents the maximum value of the data corresponding to the horizontal axis in the curve graph.

[0068] In this embodiment, the first coefficient K1 = (ScreenWidth - X1 - X2) / (MaxX * ScaleX).

[0069] ScreenWidth represents the display width of the display device, and the width of the area in the display device that can be used for display is ScreenWidth-X1-X2.

[0070] In some embodiments, X1 = X2 = 0.1 * ScreenWidth. Of course, X1 and X2 can also be other values, such as 0.2 * ScreenWidth. X1 and X2 can be equal or unequal. There are no restrictions on the values ​​of X1 and X2 here.

[0071] MaxX is used to represent the fixed scaling factor and maximum value M of the horizontal axis. objmax The product of the products can have a fixed proportionality coefficient that can be any value between 1 and 2, such as 1.1. There is no restriction on the value of the fixed proportionality coefficient here.

[0072] ScaleX is used to represent the initial scaling factor of the horizontal axis, reflecting the user's scaling factor in the horizontal axis direction of the curve. The default value of ScaleX can be 1.

[0073] In some implementation examples, the second coefficient is determined based on the display height and the second target dataset, including: obtaining the distance Y1 from the upper boundary of the display device and the distance Y2 from the lower boundary of the display device to the curve display area in the display device.

[0074] In some embodiments, the maximum value M in the second target dataset can be used as the basis. objmax Determine the second coefficient.

[0075] It is understandable that the maximum value in the second target dataset represents the maximum value of the data corresponding to the vertical axis in the curve graph.

[0076] In this embodiment, the second coefficient K2 = (ScreenHeight - Y1 - Y2) / (MaxY * ScaleY).

[0077] ScreenHeight represents the display height of the display device, and the height of the area in the display device that can be used for display is ScreenHeight-Y1-Y2.

[0078] In some embodiments, Y1 = Y2 = 0.1 * ScreenHeight. Of course, Y1 and Y2 can also be other values, such as 0.2 * ScreenHeight. Y1 and Y2 can be equal or unequal. There are no restrictions on the values ​​of Y1 and Y2 here.

[0079] MaxY is used to represent the fixed scaling factor and maximum value N of the ordinate. objmax The product of the products can have a fixed proportionality coefficient that can be any value between 1 and 2, such as 1.1. There is no restriction on the value of the fixed proportionality coefficient here.

[0080] ScaleY is used to represent the initial scaling factor of the vertical axis, reflecting the scaling factor applied by the user to the vertical axis of the curve. The default value of ScaleY can be 1.

[0081] According to the curve generation method of the present invention, a first coefficient and a second coefficient are determined based on the maximum value in the dataset of the generated curve and the size of the area in the display device that can be used for display and presentation, taking into account the user's scaling requirements, thereby realizing the transformation from the dataset to the coordinate curve graph. This method can take into account the size of the actual display area of ​​the display device, the characteristics of the data, and the user's needs, so that the curve graph can better meet the user's needs.

[0082] Step 130: Based on the first coefficient and the first target dataset, determine the displayed abscissa X = K1 * M of the target point according to the formula for determining the displayed abscissa. obj +L1, based on the second coefficient and the second target dataset, determine the displayed ordinate Y of the target point according to the formula for determining the displayed ordinate Y = K2 * N. obj +L2.

[0083] It is understandable that the target points are the points on the graph corresponding to two data points in the first and second target datasets. K1 is used to represent the first coefficient, and K2 is used to represent the second coefficient.

[0084] M obj N represents the original data corresponding to the x-coordinate of the target point in the first target dataset. obj The ordinate of the target point corresponds to the original data in the second target dataset.

[0085] For example, when plotting a train distance-time (ST) curve, M obj For data at time T, N obj This is the data for distance S.

[0086] When plotting the speed-distance (VS) curve of a train, M obj For the distance S, N obj The data is for time T.

[0087] L1 represents the offset of the target point's x-coordinate, and L2 represents the offset of the target point's y-coordinate.

[0088] It should be noted that the initial values ​​of L1 and L2 can be 0. In this case, the value of L1 and L2 is 0 to indicate that the user has not dragged the graph. When the graph is displayed on the display device, the coordinate points corresponding to all data in the first target dataset and the second target dataset can be displayed and viewed on the display device.

[0089] Step 140: Generate the target curve based on the displayed horizontal and vertical axes.

[0090] It is understandable that the displayed horizontal and vertical coordinates are coordinates on the display device, and the displayed horizontal and vertical coordinates correspond to the positions in the width and height directions of the display device, respectively.

[0091] After determining the distances X1 from the left boundary of the graph display area to the right boundary of the display device, X2 from the right boundary of the display device, Y1 from the top boundary of the display device, and Y2 from the bottom boundary of the display device, the positions of the coordinate axes can be determined.

[0092] For example, when the data in both the first and second target datasets are positive, the target points are all located in the first quadrant. The distance between the origin of the curve and the left boundary of the display device is X1, and the distance between the origin of the curve and the lower boundary of the display device is Y2.

[0093] The curves in the display device can be obtained from multiple target points through fitting, regression, and other methods.

[0094] The graph generation method according to embodiments of the present invention generates graphs that are adapted to different types of data, different sizes of display devices, and user operation needs by combining data characteristics, display device size, user scaling and dragging requirements, thereby improving the display and presentation effect, better meeting user needs, and facilitating user inspection and analysis of data.

[0095] In some embodiments, such as Figure 2As shown, after generating the target curve based on the first dataset and the second dataset, the curve generation method further includes: receiving input from the user through mouse wheel scrolling and obtaining the display coordinates (X', Y') of the mouse point.

[0096] Understandably, after generating the graph, the data can be checked and analyzed based on the graph.

[0097] In this embodiment, control commands can be input using a mouse.

[0098] Each time the mouse wheel is scrolled, the direction of the scrolling and the display coordinates of the mouse point on the display device are obtained.

[0099] The scaling factor K3 can be determined based on the scrolling direction of the mouse wheel.

[0100] In some embodiments, when the mouse wheel scrolling direction is a first direction, the scaling factor K3 satisfies 0 < K3 < 1. For example, the value of K3 can be 0.875.

[0101] When the mouse wheel scrolls in the second direction, the scaling factor K3 must be greater than 1. For example, the value of K3 can be 1.125.

[0102] It should be noted that the first direction and the second direction are opposite directions.

[0103] In some embodiments, the product of the two scaling factors can be 1 in two different scrolling directions of the mouse wheel, so that the visual difference between a single zoom-out and a single zoom-in is the same, making it easy for the user to undo the previous zoom operation by scrolling the mouse wheel in the opposite direction.

[0104] For example, when the first direction is upward, after detecting the signal of the mouse wheel scrolling upward, it can be determined that an instruction to zoom in on the curve needs to be executed.

[0105] In this case, the second direction is downward. After detecting the signal of the mouse wheel scrolling downward, it can be determined that an instruction to shrink the curve needs to be executed.

[0106] After determining the scaling factor, the first target factor, the second target factor, the offset of the horizontal axis, and the offset of the vertical axis are re-determined based on the scaling factor and the display coordinates of the mouse point.

[0107] In this embodiment, the first target coefficient K1' = K1 * K3 is redefined, and the second target coefficient K2' = K2 * K3 is redefined.

[0108] Based on the formulas for determining the horizontal and vertical coordinates, the offset of the redefined horizontal coordinate is L1' = X' - K1' * M. obj The offset of the redefined ordinate L2' = Y' - K2' * N obj This allows for the updating of parameters in the formulas for determining the horizontal and vertical coordinates.

[0109] Based on the newly determined formulas for determining the horizontal and vertical coordinates, the horizontal and vertical coordinates are redefined, and then the target curve is regenerated based on the horizontal and vertical coordinates.

[0110] like Figure 3 and Figure 4 As shown, Figure 3 The horizontal axis represents time T, and the vertical axis represents velocity V. When the user moves the mouse point to the area on the left side of the curve in the graph and scrolls the mouse wheel upwards, Figure 3 The curve in the image is magnified to obtain Figure 4 The curve. Accordingly, the coordinates in the coordinate system of the display device can also be updated accordingly.

[0111] According to the curve graph generation method of the present invention, by receiving the user's scrolling operation of the mouse wheel, the corresponding position in the curve graph can be scaled, which makes it convenient for the user to view on the display device and can better meet the user's needs.

[0112] In some embodiments, refer to Figure 5 After generating the target curve, the curve generation method also includes receiving user input via mouse clicks and drags, and obtaining the display coordinates (X, Y, F, Z) of the mouse point during the dragging process. t Y t ).

[0113] It is understandable that the graph is moved by clicking the mouse and during the clicking process.

[0114] When the mouse click is released, the offsets of the horizontal and vertical axes are redefined. The redefined horizontal offset L1' = X. t -K1*M obj The offset of the redefined ordinate L2' = Y t -K2*N obj .

[0115] After updating the parameters in the formulas for determining the horizontal and vertical coordinates, the horizontal and vertical coordinates are redefined, and the target curve is regenerated based on the horizontal and vertical coordinates.

[0116] like Figure 3 and Figure 6 As shown, when the user presses the mouse and moves the mouse point located in the center of the graph upwards, Figure 3 The curve in the middle is moved to obtain Figure 6 The curve in the display device. Correspondingly, the coordinates in the coordinate system of the display device can also be updated accordingly.

[0117] According to the curve generation method of the present invention, by receiving the user's drag operation with the mouse, the curve in the curve graph can be moved, making it convenient for the user to view the data at the target position on the display device, and can better meet the user's needs.

[0118] In some embodiments, such as Figure 7 As shown, after obtaining the first coefficient and the second coefficient based on the first dataset and the second dataset, the display coordinates of the target point on the display device can be obtained, and the target curve can be generated.

[0119] After receiving the user's zoom and drag input, the system can reconfirm the first coefficient, the second coefficient, and the offset of the horizontal and vertical axes based on the user's input.

[0120] User zooming and dragging input can also be done through touch input, voice input, key input, etc.

[0121] In this embodiment, by combining the characteristics of the data, the size of the display device, and the user's scaling and dragging needs, a graph is generated that is adapted to different types of data, different sizes of display devices, and user operation needs, so that the display and presentation effect is better, more in line with the user's needs, and easier for the user to check and analyze the data.

[0122] The curve generation apparatus provided by the present invention will be described below. The curve generation apparatus described below can be referred to in correspondence with the curve generation method described above.

[0123] Reference Figure 8 The graph generation device of this invention includes an acquisition module 810, a first processing module 820, a second processing module 830, and a generation module 840.

[0124] The acquisition module 810 is used to acquire the display width and display height of the display device;

[0125] The first processing module 820 is used to determine a first coefficient based on the display width and the first target dataset, and to determine a second coefficient based on the display height and the second target dataset, wherein the first target dataset is the dataset corresponding to the horizontal axis and the second target dataset is the dataset corresponding to the vertical axis.

[0126] The second processing module 830 is used to determine the display x-coordinate X = K1*M of the target point based on the first coefficient and the first target dataset. obj +L1, based on the second coefficient and the second target dataset, determine the displayed ordinate Y = K2*N of the target point. obj +L2, K1 is used to represent the first coefficient, K2 is used to represent the second coefficient, M obj N represents the original data corresponding to the x-coordinate of the target point in the first target dataset. obj L1 represents the original data corresponding to the ordinate of the target point in the second target dataset, and L2 represents the offset of the x-coordinate of the target point.

[0127] The generation module 840 is used to generate a target curve based on the displayed horizontal and vertical coordinates.

[0128] According to an embodiment of the present invention, a graph generation device combines data characteristics, display device size, user scaling and dragging needs to generate graphs that are suitable for different types of data, display devices of different sizes, and user operation needs, resulting in better display and presentation effects, better meeting user needs, and facilitating user inspection and analysis of data.

[0129] In some embodiments, the first processing module is further configured to obtain the distance X1 from the left boundary of the display device and the distance X2 from the right boundary of the display device to the curve display area in the display device; based on the maximum value M in the first target dataset... objmax Determine the first coefficient K1 = (ScreenWidth - X1 - X2) / (MaxX * ScaleX); where ScreenWidth represents the display width, and MaxX represents the fixed scaling factor of the horizontal axis and its maximum value M. objmax The product of ScaleX and ScaleX represents the initial scaling factor of the horizontal axis.

[0130] In some embodiments, the first processing module is further configured to obtain the distance Y1 from the upper boundary of the display device and the distance Y2 from the lower boundary of the display device to the curve display area in the display device; based on the maximum value N in the second target dataset... objmax The second coefficient K2 is determined as K2 = (ScreenHeight - Y1 - Y2) / (MaxY * ScaleY); where ScreenHeight represents the display height, and MaxY represents the fixed scaling factor of the vertical axis and its maximum value N. objmax The product of ScaleY and ScaleY is used to represent the initial scaling factor of the ordinate.

[0131] In some embodiments, the graph generation apparatus of the present invention further includes a third processing module, which is used to receive input from a user via a mouse wheel scrolling operation and obtain the display coordinates (X', Y') of the mouse point; determine a scaling factor K3 based on the scrolling direction of the mouse wheel; and redetermine a first target factor, a second target factor, an offset of the horizontal axis, and an offset of the vertical axis based on the scaling factor and the display coordinates of the mouse point. The redetermined first target factor K1' = K1 * K3, the redetermined second target factor K2' = K2 * K3, and the redetermined offset of the horizontal axis L1' = X' - K1' * M obj The offset of the redefined ordinate L2' = Y' - K2' * N obj ; Redefine the displayed x-axis and y-axis; Based on the displayed x-axis and y-axis, regenerate the target curve.

[0132] In some embodiments, when the mouse wheel scrolling direction is a first direction, the scaling factor K3 satisfies 0 < K3 < 1; when the mouse wheel scrolling direction is a second direction, the scaling factor K3 satisfies K3 > 1; wherein the first direction and the second direction are opposite directions.

[0133] In some embodiments, the graph generation apparatus of the present invention further includes a fourth processing module, which is configured to receive input from a user via mouse click and drag and obtain the display coordinates (X, Y) of the mouse point during the dragging process. t Y t ); When the mouse click is released, the offset of the horizontal axis and the offset of the vertical axis are redefined. The redefined offset of the horizontal axis L1' = X t -K1*M obj The offset of the redefined ordinate L2' = Y t -K2*N obj ; Redefine the displayed x-axis and y-axis; Based on the displayed x-axis and y-axis, regenerate the target curve.

[0134] Figure 9 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 9As shown, the electronic device may include: a processor 910, a communication interface 920, a memory 830, and a communication bus 940, wherein the processor 810, the communication interface 920, and the memory 930 communicate with each other through the communication bus 940. The processor 910 can call logical instructions in the memory 930 to execute a curve generation method, which includes: obtaining the display width and display height of the display device; determining a first coefficient based on the display width and a first target dataset; determining a second coefficient based on the display height and a second target dataset, wherein the first target dataset is the dataset corresponding to the horizontal axis, and the second target dataset is the dataset corresponding to the vertical axis; and determining the display horizontal coordinate X = K1*M of the target point based on the first coefficient and the first target dataset. obj +L1, based on the second coefficient and the second target dataset, determine the displayed ordinate Y = K2*N of the target point. obj +L2, K1 is used to represent the first coefficient, K2 is used to represent the second coefficient, M obj N represents the original data corresponding to the x-coordinate of the target point in the first target dataset. obj The target point's ordinate is the original data corresponding to the target point's x-coordinate in the second target dataset. L1 represents the offset of the target point's x-coordinate, and L2 represents the offset of the target point's ordinate. Based on the displayed x-coordinate and displayed ordinate, a target curve is generated.

[0135] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0136] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the curve generation method provided by the above methods. The method includes: obtaining the display width and display height of a display device; determining a first coefficient based on the display width and a first target dataset; determining a second coefficient based on the display height and a second target dataset, wherein the first target dataset is the dataset corresponding to the horizontal axis and the second target dataset is the dataset corresponding to the vertical axis; and determining the display horizontal coordinate X = K1*M of the target point based on the first coefficient and the first target dataset. obj +L1, based on the second coefficient and the second target dataset, determine the displayed ordinate Y = K2*N of the target point. obj +L2, K1 is used to represent the first coefficient, K2 is used to represent the second coefficient, M obj N represents the original data corresponding to the x-coordinate of the target point in the first target dataset. obj The target point's ordinate is the original data corresponding to the target point's x-coordinate in the second target dataset. L1 represents the offset of the target point's x-coordinate, and L2 represents the offset of the target point's ordinate. Based on the displayed x-coordinate and displayed ordinate, a target curve is generated.

[0137] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the curve generation method provided by the above methods. The method includes: acquiring the display width and display height of a display device; determining a first coefficient based on the display width and a first target dataset; determining a second coefficient based on the display height and a second target dataset, wherein the first target dataset is the dataset corresponding to the horizontal axis and the second target dataset is the dataset corresponding to the vertical axis; and determining the display horizontal coordinate X = K1*M of a target point based on the first coefficient and the first target dataset. obj +L1, based on the second coefficient and the second target dataset, determine the displayed ordinate Y = K2*N of the target point. obj +L2, K1 is used to represent the first coefficient, K2 is used to represent the second coefficient, M obj N represents the original data corresponding to the x-coordinate of the target point in the first target dataset. obj The target point's ordinate is the original data corresponding to the target point's x-coordinate in the second target dataset. L1 represents the offset of the target point's x-coordinate, and L2 represents the offset of the target point's ordinate. Based on the displayed x-coordinate and displayed ordinate, a target curve is generated.

[0138] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0139] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0140] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for generating curve graphs, characterized in that, include: Obtain the display width and display height of the display device; Based on the display width and the first target dataset, a first coefficient is determined, and based on the display height and the second target dataset, a second coefficient is determined. The first target dataset is the original dataset corresponding to the horizontal axis, and the second target dataset is the original dataset corresponding to the vertical axis. Based on the first coefficient and the first target dataset, determine the displayed x-coordinate of the target point as X = K1*M obj +L1, based on the second coefficient and the second target dataset, determine the displayed ordinate Y = K2*N of the target point. obj +L2, K1 is used to represent the first coefficient, K2 is used to represent the second coefficient, M obj N represents the original data corresponding to the x-coordinate of the target point in the first target dataset. obj L1 represents the original data corresponding to the ordinate of the target point in the second target dataset, and L2 represents the offset of the abscissa of the target point. Based on the displayed horizontal and vertical coordinates, a target curve graph is generated; The step of determining the first coefficient based on the display width and the first target dataset includes: Obtain the distance X1 from the left boundary of the display area of ​​the curve display device and the distance X2 from the right boundary of the display device; Based on the maximum value M in the first target dataset objmax The first coefficient K1 is determined to be (ScreenWidth - X1 - X2) / (MaxX * ScaleX); where ScreenWidth represents the display width, and MaxX represents the fixed scaling factor of the horizontal axis and the maximum value M. objmax The product of ScaleX and (ScreenWidth-X1-X2) represents the initial scaling factor of the horizontal axis, and (ScreenWidth-X1-X2) represents the width of the area used for display and presentation in the display device. The determination of the second coefficient based on the display height and the second target dataset includes: Obtain the distance Y1 from the upper boundary of the display device and the distance Y2 from the lower boundary of the display device to the curve display area in the display device; Based on the maximum value N in the second target dataset objmax The second coefficient K2 is determined to be (ScreenHeight - Y1 - Y2) / (MaxY * ScaleY); where ScreenHeight represents the display height, and MaxY represents the ratio of the vertical axis to the maximum value N. objmax The product of ScaleY and (ScreenHeight-Y1-Y2) represents the initial scaling factor of the vertical coordinate, and (ScreenHeight-Y1-Y2) represents the height of the area in the display device used for display and presentation.

2. The curve generation method according to claim 1, characterized in that, After generating the target curve, the method further includes: Receive user input via mouse wheel scrolling and obtain the display coordinates (X', Y') of the mouse point; Based on the scrolling direction of the mouse wheel, the scaling factor K3 is determined; Based on the scaling factor and the display coordinates of the mouse point, the first target factor, the second target factor, the offset of the horizontal axis, and the offset of the vertical axis are redefined. The redefined first target factor K1' = K1 * K3, the redefined second target factor K2' = K2 * K3, and the redefined offset of the horizontal axis L1' = X' - K1' * M obj The redefined offset of the ordinate is L2' = Y' - K2' * N. obj ; The displayed horizontal and vertical coordinates are redefined; Based on the displayed horizontal and vertical coordinates, the target curve is regenerated.

3. The curve generation method according to claim 2, characterized in that, When the scrolling direction of the mouse wheel is the first direction, the scaling factor K3 satisfies 0 < K3 < 1; When the scrolling direction of the mouse wheel is the second direction, the scaling factor K3 satisfies that K3 is greater than 1; Wherein, the first direction and the second direction are opposite directions.

4. The curve generation method according to claim 1, characterized in that, After generating the target curve, the method further includes: Receive user input via mouse clicks and drags, and obtain the displayed coordinates (X, Y) of the mouse point during the dragging process. t Y t ); Upon releasing the mouse click, the offset of the horizontal axis and the offset of the vertical axis are redefined, and the redefined offset of the horizontal axis L1' = X. t -K1*M obj The offset of the redefined ordinate L2' = Y t -K2*N obj ; The displayed horizontal and vertical coordinates are redefined; Based on the displayed horizontal and vertical coordinates, the target curve is regenerated.

5. A curve graph generation device, characterized in that, include: The acquisition module is used to acquire the display width and display height of the display device; A first processing module is configured to determine a first coefficient based on the display width and the first target dataset, and to determine a second coefficient based on the display height and the second target dataset, wherein the first target dataset is the original dataset corresponding to the horizontal axis and the second target dataset is the original dataset corresponding to the vertical axis. The second processing module is used to determine the display x-coordinate X = K1*M of the target point based on the first coefficient and the first target dataset. obj +L1, based on the second coefficient and the second target dataset, determine the displayed ordinate Y = K2*N of the target point. obj +L2, K1 is used to represent the first coefficient, K2 is used to represent the second coefficient, M obj N represents the original data corresponding to the x-coordinate of the target point in the first target dataset. obj L1 represents the original data corresponding to the ordinate of the target point in the second target dataset, and L2 represents the offset of the abscissa of the target point. The generation module is used to generate a target curve based on the displayed horizontal axis and the displayed vertical axis; The step of determining the first coefficient based on the display width and the first target dataset includes: Obtain the distance X1 from the left boundary of the display area of ​​the curve display device and the distance X2 from the right boundary of the display device; Based on the maximum value M in the first target dataset objmax The first coefficient K1 is determined to be (ScreenWidth - X1 - X2) / (MaxX * ScaleX); where ScreenWidth represents the display width, and MaxX represents the fixed scaling factor of the horizontal axis and the maximum value M. objmax The product of ScaleX and (ScreenWidth-X1-X2) represents the initial scaling factor of the horizontal axis, and (ScreenWidth-X1-X2) represents the width of the area used for display and presentation in the display device. The determination of the second coefficient based on the display height and the second target dataset includes: Obtain the distance Y1 from the upper boundary of the display device and the distance Y2 from the lower boundary of the display device to the curve display area in the display device; Based on the maximum value N in the second target dataset objmax The second coefficient K2 is determined to be (ScreenHeight - Y1 - Y2) / (MaxY * ScaleY); where ScreenHeight represents the display height, and MaxY represents the ratio of the vertical axis to the maximum value N. objmax The product of ScaleY and (ScreenHeight-Y1-Y2) represents the initial scaling factor of the vertical coordinate, and (ScreenHeight-Y1-Y2) represents the height of the area in the display device used for display and presentation.

6. 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 graph generation method as described in any one of claims 1 to 4.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the graph generation method as described in any one of claims 1 to 4.

8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the graph generation method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Method and device for simulating various screen resolutions

    CN101763234A

  • K line chart animation zooming method, electronic equipment and storage medium

    CN108389248A

  • Robot, projection method, and storage medium

    CN114257799A