Disclosure of Invention
In view of this, the present application provides a method and a system for generating a curve, which have the following specific schemes:
a curve generation method, comprising:
acquiring a configuration file, wherein the configuration file at least comprises basic parameter information for configuring a real-time curve graph, updating frequency information of the real-time curve graph and dynamic data;
running the dynamic data in the configuration file to obtain result data;
generating a graph based on the result data and basic parameter information in the configuration file;
updating the graph based on the update frequency information in the configuration file.
Further, the generating a graph based on the result data and the basic parameter information in the configuration file includes:
determining the graph type of the graph to be generated based on the basic parameter information, wherein the graph type at least can indicate horizontal axis information and vertical axis information of the graph to be generated;
configuring dynamic parameters for the graph to be generated based on the result data;
and generating the curve graph according to the curve graph type and the dynamic parameters of the curve graph to be generated.
Further, the determining the graph type of the graph to be generated based on the basic parameter information includes:
determining the width and the height of the curve graph to be generated according to the basic parameter information;
creating a graph drawing area based on the width and the height of the graph to be generated;
and creating a coordinate axis at least comprising horizontal axis information and vertical axis information in the graph drawing area.
Further, the generating the graph according to the graph type and the dynamic parameter of the graph to be generated includes:
converting the dynamic parameters of the curve graph to be generated into coordinate data matched with the horizontal axis information and the vertical axis information;
and combining the coordinate data with the coordinate axis of the graph drawing area to obtain a curve graph.
Further, the updating the graph based on the update frequency information in the configuration file includes:
and adjusting the coordinate point information in the curve graph according to the updating frequency information so that the curve graph after the coordinate point information is adjusted is the current real-time curve graph.
Further, the adjusting the coordinate point information in the graph according to the update frequency information includes:
determining the current time as the coordinate point information updating time based on the updating frequency information, and acquiring the coordinate information of the current time;
deleting coordinate information of a first moment in the graph, wherein the first moment is a moment adjacent to the origin of the coordinate axis on the first axis, and the first axis is an axis used for representing the moment in the horizontal axis or the vertical axis;
translating coordinate information between a second moment and a third moment to the direction of the coordinate axis origin, wherein the second moment is a moment adjacent to the first moment, and the third moment is a moment which is after the first moment and is separated from the first moment by a preset time length and is displayed on the first axis;
and determining the coordinate information of the current moment as coordinate information of a fourth moment in the curve graph, and displaying the coordinate information in the curve graph to obtain the current real-time curve graph after the coordinate point information is adjusted, wherein the fourth moment is a moment after the second moment and separated from the second moment by a preset time length.
A graph generation system, comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a configuration file, and the configuration file at least comprises basic parameter information for configuring a real-time curve graph, updating frequency information of the real-time curve graph and dynamic data;
the operation unit is used for operating the dynamic data in the configuration file to obtain result data;
the generating unit is used for generating a curve graph based on the result data and basic parameter information in the configuration file;
and the updating unit is used for updating the graph based on the updating frequency information in the configuration file.
Further, the generating unit is configured to:
determining the graph type of the graph to be generated based on the basic parameter information, wherein the graph type at least can indicate horizontal axis information and vertical axis information of the graph to be generated; configuring dynamic parameters for the graph to be generated based on the result data; and generating the curve graph according to the curve graph type and the dynamic parameters of the curve graph to be generated.
Further, the update unit is configured to:
and adjusting the coordinate point information in the curve graph according to the updating frequency information so that the curve graph after the coordinate point information is adjusted is the current real-time curve graph.
Further, the updating unit adjusts the coordinate point information in the graph according to the update frequency information, and includes:
the updating unit determines the current time as the coordinate point information updating time based on the updating frequency information and acquires the coordinate information of the current time; deleting coordinate information of a first moment in the graph, wherein the first moment is a moment adjacent to the origin of the coordinate axis on the first axis, and the first axis is an axis used for representing the moment in the horizontal axis or the vertical axis; translating coordinate information between a second moment and a third moment to the direction of the coordinate axis origin, wherein the second moment is a moment adjacent to the first moment, and the third moment is a moment which is after the first moment and is separated from the first moment by a preset time length and is displayed on the first axis; and determining the coordinate information of the current moment as coordinate information of a fourth moment in the curve graph, and displaying the coordinate information in the curve graph to obtain the current real-time curve graph after the coordinate information is adjusted, wherein the fourth moment is a moment after the second moment and separated from the second moment by a preset time length.
According to the technical scheme, the method and the system for generating the curve graph acquire the configuration file, the configuration file at least comprises basic parameter information for configuring the real-time curve graph, updating frequency information of the real-time curve graph and dynamic data, the dynamic data in the configuration file is operated to obtain result data, the curve graph is generated based on the result data and the basic parameter information in the configuration file, and the curve graph is updated based on the updating frequency information in the configuration file. According to the scheme, the result data are obtained by running the dynamic data in the configuration file, the curve graph can be generated based on the result data, and the curve graph is updated periodically based on the updating frequency information in the configuration file after the curve graph is generated, so that the curve graph updated in real time is obtained, and the problems that the display rule needs to be manually adjusted when the curve graph is updated, and the operation is inconvenient are solved.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The application discloses a curve generating method, a flow chart of which is shown in fig. 1, comprising the following steps:
step S11, obtaining a configuration file, wherein the configuration file at least comprises basic parameter information for configuring a real-time curve graph, updating frequency information of the real-time curve graph and dynamic data;
step S12, running the dynamic data in the configuration file to obtain result data;
step S13, generating a curve graph based on the result data and the basic parameter information in the configuration file;
step S14, the graph is updated based on the update frequency information in the configuration file.
The plurality of types of data are included in the configuration file so that the graph can be generated based on the plurality of types of data included.
The configuration file at least comprises basic parameter information for configuring the real-time curve graph, updating frequency information of the real-time curve graph and dynamic data.
Wherein, the basic parameter information may be: identification information of the graph, font related information in the graph, colors of the graph, display information of coordinate axes in the graph, and the like. The graph can be uniquely determined based on the identification information of the graph, the font related information may be a font color, a font size, a font type, and the like, the color of the graph may be different curves of the graph or colors of different points, and the display information of the coordinate axes may be information respectively represented by each coordinate axis in the graph, such as: the X-axis represents units of time and the Y-axis represents data volume.
The configuration file also comprises dynamic data, and the dynamic data is operated by adopting a Structured Query Language (SQL) to obtain result data, so that a graph can be generated based on the result data.
According to the basic parameter information in the configuration file and the result data, a graph can be created, and the graph comprises data corresponding to different moments.
When the time is changed, in order to change the data in the graph correspondingly, the frequency updating information in the configuration file needs to be called, and the graph needs to be updated based on the frequency updating information.
Specifically, each graph displays a fixed length and a fixed width, that is, the length of the X axis displayed in the graph is fixed, the number of data on the displayed X axis is also fixed, the length of the Y axis is fixed, and the number of data on the displayed Y axis is also fixed, as shown in fig. 2, only the value 7 is shown on the X axis, only the value 3 is shown on the Y axis, and when time changes, the value of the Y axis corresponding to the value on each X axis may also change, and therefore, the curve in the graph is updated with the change of time.
When the configuration file comprises the frequency updating information, as long as the frequency updating time specified in the frequency updating information is reached along with the change of time, the data in the curve graph can be automatically updated, so that the updated curve graph is curve data matched with the time, the automatic updating of the curve graph is realized, the timeliness of the curve graph is ensured, and the curve graph needs to be independently reconstructed for the changed data configuration when the data is changed.
Furthermore, after the configuration file is obtained, all information in the configuration file is loaded into the memory, so that when the information in the configuration file is applied later, related data can be directly called from the memory.
The graph generating method disclosed in this embodiment obtains a configuration file, where the configuration file at least includes basic parameter information for configuring a real-time graph, update frequency information of the real-time graph, and dynamic data, runs the dynamic data in the configuration file to obtain result data, generates a graph based on the result data and the basic parameter information in the configuration file, and updates the graph based on the update frequency information in the configuration file. According to the scheme, the result data are obtained by running the dynamic data in the configuration file, the curve graph can be generated based on the result data, and the curve graph is updated periodically based on the updating frequency information in the configuration file after the curve graph is generated, so that the curve graph updated in real time is obtained, and the problems that the display rule needs to be manually adjusted when the curve graph is updated, and the operation is inconvenient are solved.
The embodiment discloses a curve generation method, a flowchart of which is shown in fig. 3, and the method comprises the following steps:
step S31, obtaining a configuration file, wherein the configuration file at least comprises basic parameter information for configuring a real-time curve graph, updating frequency information of the real-time curve graph and dynamic data;
step S32, running the dynamic data in the configuration file to obtain result data;
step S33, determining the graph type of the graph to be generated based on the basic parameter information, wherein the graph type at least can indicate the horizontal axis information and the vertical axis information of the graph to be generated;
step S34, configuring dynamic parameters for the graph to be generated based on the result data;
step S35, generating a curve graph according to the curve graph type and the dynamic parameters of the curve graph to be generated;
step S36, the graph is updated based on the update frequency information in the configuration file.
The graph type at least includes the type of data characterized by the graph to be generated, i.e. the horizontal axis represents what information and the vertical axis represents what information, such as: the graph to be generated is used for representing the electric quantity used by the users in a certain area in different time periods, or the electric quantity used by the users in different areas in a certain fixed time period, and the like.
Specifically, the width and the height of a curve graph to be generated are determined according to basic parameter information; creating a graph drawing area based on the width and the height of a graph to be generated; a coordinate axis including at least horizontal axis information and vertical axis information is created in the graphic drawing area.
The basic parameter information includes display information of coordinate axes in the graph, and the display information of the coordinate axes may be what data is represented by a horizontal axis, what data is represented by a vertical axis, and a length of the horizontal axis, a width of the vertical axis, and the like in the graph.
The length and the width of the curve graph can be determined based on the length of the horizontal axis and the width of the vertical axis, and after the length and the width of the curve graph are determined, the size of the space occupied by the curve graph in the display interface can be determined, so that a region is selected in the display interface and is used as the drawing region of the curve graph, namely the drawing region of the created graph, and the curve graph can be directly created at the position of the drawing region of the graph when the dynamic parameters of the result data are configured.
And converting the dynamic parameters of the curve graph to be generated into coordinate data matched with the horizontal axis information and the vertical axis information, and combining the coordinate data with a coordinate axis at the graph drawing area to obtain the curve graph.
And converting the dynamic parameters into a form of horizontal and vertical coordinates, namely a form of coordinate points, drawing each coordinate point on a coordinate axis frame corresponding to the curve graph, and connecting the coordinate points one by one according to the sequence of the horizontal coordinates to obtain the curve graph.
When the result data is configured with dynamic parameters, so that a graph is created at the position of the graph drawing area, the parameters on the horizontal axis and the vertical axis are directly in one-to-one correspondence, and when the graph is created, points corresponding to the parameters are directly drawn on the graph, as shown in fig. 4, and the points are connected one by one according to the sequence corresponding to the horizontal coordinates of the points to form the graph.
Further, after the data in the configuration file is loaded into the memory, the dynamic data in the configuration file is operated to obtain result data, the result data is also loaded into the memory, after the result data is loaded into the memory, the data information in the memory is read, the data information is converted into a coordinate point parameter with a horizontal axis parameter and a vertical axis parameter, the height and the width of the curve graph are determined, and the vertical axis parameter of the coordinate point parameter is compared with the height of the curve graph.
If the vertical axis parameter in the coordinate point parameters is larger than the height of the curve graph, the corresponding proportion of the height of the curve graph and the vertical axis unit is adjusted, so that the vertical axis parameter can be smaller than the height of the curve graph after the corresponding proportion is adjusted, and the vertical coordinate of the coordinate point parameter does not exceed the height range of the curve graph when the coordinate point parameter is drawn into the curve graph.
The graph generating method disclosed in this embodiment obtains a configuration file, where the configuration file at least includes basic parameter information for configuring a real-time graph, update frequency information of the real-time graph, and dynamic data, runs the dynamic data in the configuration file to obtain result data, generates a graph based on the result data and the basic parameter information in the configuration file, and updates the graph based on the update frequency information in the configuration file. According to the scheme, the result data are obtained by running the dynamic data in the configuration file, the curve graph can be generated based on the result data, and the curve graph is updated periodically based on the updating frequency information in the configuration file after the curve graph is generated, so that the curve graph updated in real time is obtained, and the problems that the display rule needs to be manually adjusted when the curve graph is updated, and the operation is inconvenient are solved.
The embodiment discloses a curve generation method, a flowchart of which is shown in fig. 5, and the method comprises the following steps:
step S51, obtaining a configuration file, wherein the configuration file at least comprises basic parameter information for configuring a real-time curve graph, updating frequency information of the real-time curve graph and dynamic data;
step S52, running the dynamic data in the configuration file to obtain result data;
step S53, generating a curve graph based on the result data and the basic parameter information in the configuration file;
and step S54, coordinate point information in the curve graph is adjusted according to the updating frequency information, so that the curve graph after the coordinate point information is adjusted is the current real-time curve graph.
Determining the update frequency information, and if the update condition indicated by the update frequency information is currently reached, such as: when the curve graph currently displayed on the display interface is displayed for a preset time, or the latest data is currently received, or the preset curve graph updating time is reached, coordinate point information in the curve graph is adjusted, and an updated data is added.
Specifically, adding an updated data may be: adding a moment after the last moment of the abscissa of the curve graph in the curve graph, and displaying the data of the ordinate corresponding to the moment on the display area of the curve graph so that the updated curve graph is the curve graph added with one updated datum;
alternatively, the following may be used: and deleting all points and lines in the display area of the currently displayed curve graph, re-determining a plurality of coordinate points to be updated, and connecting the plurality of coordinate points to form the updated curve graph.
Further, the method can also comprise the following steps:
determining the current time as the coordinate point information updating time based on the updating frequency information, and acquiring the coordinate information of the current time; deleting coordinate information of a first moment in the graph, wherein the first moment is a moment adjacent to an origin of a coordinate axis on a first axis, and the first axis is an axis used for representing the moment in a horizontal axis or a vertical axis; translating coordinate information between a second moment and a third moment to the direction of the coordinate axis origin, wherein the second moment is a moment adjacent to the first moment, and the third moment is a moment which is separated from the first moment by a preset time length and is displayed on the first axis after the first moment; and determining the coordinate information of the current moment as coordinate information of a fourth moment in the curve graph, and displaying the coordinate information in the curve graph to obtain the current real-time curve graph after the coordinate point information is adjusted, wherein the fourth moment is a moment after the second moment and separated from the second moment by a preset time length.
Specifically, if it is determined that the update condition is currently satisfied based on the update frequency information, for example: when the current time reaches the coordinate point information updating time, the coordinate information of the current time is acquired, and at the same time, the coordinate information of the first time in the graph is deleted, as shown in fig. 6, the graph displayed on the display interface includes A, B, C, D, E, F, G seven coordinate points, which respectively correspond to seven sequential times of 1, 2, 3, 4, 5, 6, and 7 on the abscissa, and when the updating condition is satisfied, the time 8 is reached, the coordinate information of the time 8 is acquired, which corresponds to the H coordinate point.
The graph is a graph including only six coordinate points B, C, D, E, F, G as shown in fig. 7, in which coordinate information of the first time in the graph, that is, the point a of the time having the abscissa of 1 is deleted, and the coordinate point between the second time and the third time is shifted in the direction of the origin of the coordinate axis, that is, the coordinate point B, C, D, E, F, G corresponding to the six times having the abscissas of 2 to 7 is shifted in the direction of the origin of the coordinate axis.
The coordinate information of the current time is determined as the coordinate information of the fourth time in the graph, and is displayed in the graph, that is, the coordinate point H of the time 8 is displayed in the graph, as shown in fig. 8, so as to form an updated graph, and achieve the purpose of updating the graph in real time.
The graph generating method disclosed in this embodiment obtains a configuration file, where the configuration file at least includes basic parameter information for configuring a real-time graph, update frequency information of the real-time graph, and dynamic data, runs the dynamic data in the configuration file to obtain result data, generates a graph based on the result data and the basic parameter information in the configuration file, and updates the graph based on the update frequency information in the configuration file. According to the scheme, the result data are obtained by running the dynamic data in the configuration file, the curve graph can be generated based on the result data, and the curve graph is updated periodically based on the updating frequency information in the configuration file after the curve graph is generated, so that the curve graph updated in real time is obtained, and the problems that the display rule needs to be manually adjusted when the curve graph is updated, and the operation is inconvenient are solved.
The embodiment discloses a graph generating system, a schematic structural diagram of which is shown in fig. 9, including:
an acquisition unit 91, an operation unit 92, a generation unit 93, and an update unit 94.
The acquiring unit 91 is configured to acquire a configuration file, where the configuration file at least includes basic parameter information for configuring a real-time graph, update frequency information of the real-time graph, and dynamic data;
the operation unit 92 is configured to operate the dynamic data in the configuration file to obtain result data;
the generating unit 93 is used for generating a curve graph based on the result data and the basic parameter information in the configuration file;
the updating unit 94 is used to update the graph based on the update frequency information in the configuration file.
The plurality of types of data are included in the configuration file so that the graph can be generated based on the plurality of types of data included.
The configuration file at least comprises basic parameter information for configuring the real-time curve graph, updating frequency information of the real-time curve graph and dynamic data.
Wherein, the basic parameter information may be: identification information of the graph, font related information in the graph, colors of the graph, display information of coordinate axes in the graph, and the like. The graph can be uniquely determined based on the identification information of the graph, the font related information may be a font color, a font size, a font type, and the like, the color of the graph may be different curves of the graph or colors of different points, and the display information of the coordinate axes may be information respectively represented by each coordinate axis in the graph, such as: the X-axis represents units of time and the Y-axis represents data volume.
The configuration file also comprises dynamic data, and the dynamic data is operated by adopting a Structured Query Language (SQL) to obtain result data, so that a graph can be generated based on the result data.
According to the basic parameter information in the configuration file and the result data, a graph can be created, and the graph comprises data corresponding to different moments.
When the time is changed, in order to change the data in the graph correspondingly, the frequency updating information in the configuration file needs to be called, and the graph needs to be updated based on the frequency updating information.
Specifically, each graph displays a fixed length and a fixed width, that is, the length of the X axis displayed in the graph is fixed, the number of data on the displayed X axis is also fixed, the length of the Y axis is fixed, and the number of data on the displayed Y axis is also fixed, as shown in fig. 2, only the value 7 is shown on the X axis, only the value 3 is shown on the Y axis, and when time changes, the value of the Y axis corresponding to the value on each X axis may also change, and therefore, the curve in the graph is updated with the change of time.
When the configuration file comprises the frequency updating information, as long as the frequency updating time specified in the frequency updating information is reached along with the change of time, the data in the curve graph can be automatically updated, so that the updated curve graph is curve data matched with the time, the automatic updating of the curve graph is realized, the timeliness of the curve graph is ensured, and the curve graph needs to be independently reconstructed for the changed data configuration when the data is changed.
Furthermore, after the configuration file is obtained, all information in the configuration file is loaded into the memory, so that when the information in the configuration file is applied later, related data can be directly called from the memory.
Further, the generating unit 93 is configured to:
determining the type of a curve graph to be generated based on the basic parameter information, wherein the curve graph type at least can indicate horizontal axis information and vertical axis information of the curve graph to be generated; configuring dynamic parameters for the graph to be generated based on the result data; and generating a curve graph according to the type of the curve graph and the dynamic parameters of the curve graph to be generated.
The graph type at least includes the type of data characterized by the graph to be generated, i.e. the horizontal axis represents what information and the vertical axis represents what information, such as: the graph to be generated is used for representing the electric quantity used by the users in a certain area in different time periods, or the electric quantity used by the users in different areas in a certain fixed time period, and the like.
Specifically, the width and the height of a curve graph to be generated are determined according to basic parameter information; creating a graph drawing area based on the width and the height of a graph to be generated; a coordinate axis including at least horizontal axis information and vertical axis information is created in the graphic drawing area.
The basic parameter information includes display information of coordinate axes in the graph, and the display information of the coordinate axes may be what data is represented by a horizontal axis, what data is represented by a vertical axis, and a length of the horizontal axis, a width of the vertical axis, and the like in the graph.
The length and the width of the curve graph can be determined based on the length of the horizontal axis and the width of the vertical axis, and after the length and the width of the curve graph are determined, the size of the space occupied by the curve graph in the display interface can be determined, so that a region is selected in the display interface and is used as the drawing region of the curve graph, namely the drawing region of the created graph, and the curve graph can be directly created at the position of the drawing region of the graph when the dynamic parameters of the result data are configured.
And converting the dynamic parameters of the curve graph to be generated into coordinate data matched with the horizontal axis information and the vertical axis information, and combining the coordinate data with a coordinate axis at the graph drawing area to obtain the curve graph.
And converting the dynamic parameters into a form of horizontal and vertical coordinates, namely a form of coordinate points, drawing each coordinate point on a coordinate axis frame corresponding to the curve graph, and connecting the coordinate points one by one according to the sequence of the horizontal coordinates to obtain the curve graph.
When the result data is configured with dynamic parameters, so that a graph is created at the position of the graph drawing area, the parameters on the horizontal axis and the vertical axis are directly in one-to-one correspondence, and when the graph is created, points corresponding to the parameters are directly drawn on the graph, as shown in fig. 4, and the points are connected one by one according to the sequence corresponding to the horizontal coordinates of the points to form the graph.
Further, after the data in the configuration file is loaded into the memory, the dynamic data in the configuration file is operated to obtain result data, the result data is also loaded into the memory, after the result data is loaded into the memory, the data information in the memory is read, the data information is converted into a coordinate point parameter with a horizontal axis parameter and a vertical axis parameter, the height and the width of the curve graph are determined, and the vertical axis parameter of the coordinate point parameter is compared with the height of the curve graph.
If the vertical axis parameter in the coordinate point parameters is larger than the height of the curve graph, the corresponding proportion of the height of the curve graph and the vertical axis unit is adjusted, so that the vertical axis parameter can be smaller than the height of the curve graph after the corresponding proportion is adjusted, and the vertical coordinate of the coordinate point parameter does not exceed the height range of the curve graph when the coordinate point parameter is drawn into the curve graph.
Further, the updating unit 94 is configured to:
and adjusting the coordinate point information in the curve graph according to the updated frequency information so that the curve graph after the coordinate point information is adjusted is the current real-time curve graph.
Determining the update frequency information, and if the update condition indicated by the update frequency information is currently reached, such as: when the curve graph currently displayed on the display interface is displayed for a preset time, or the latest data is currently received, or the preset curve graph updating time is reached, coordinate point information in the curve graph is adjusted, and an updated data is added.
Specifically, adding an updated data may be: adding a moment after the last moment of the abscissa of the curve graph in the curve graph, and displaying the data of the ordinate corresponding to the moment on the display area of the curve graph so that the updated curve graph is the curve graph added with one updated datum;
alternatively, the following may be used: and deleting all points and lines in the display area of the currently displayed curve graph, re-determining a plurality of coordinate points to be updated, and connecting the plurality of coordinate points to form the updated curve graph.
Further, the method can also comprise the following steps:
determining the current time as the coordinate point information updating time based on the updating frequency information, and acquiring the coordinate information of the current time; deleting coordinate information of a first moment in the graph, wherein the first moment is a moment adjacent to an origin of a coordinate axis on a first axis, and the first axis is an axis used for representing the moment in a horizontal axis or a vertical axis; translating coordinate information between a second moment and a third moment to the direction of the coordinate axis origin, wherein the second moment is a moment adjacent to the first moment, and the third moment is a moment which is separated from the first moment by a preset time length and is displayed on the first axis after the first moment; and determining the coordinate information of the current moment as coordinate information of a fourth moment in the curve graph, and displaying the coordinate information in the curve graph to obtain the current real-time curve graph after the coordinate point information is adjusted, wherein the fourth moment is a moment after the second moment and separated from the second moment by a preset time length.
Specifically, if it is determined that the update condition is currently satisfied based on the update frequency information, for example: when the current time reaches the coordinate point information updating time, the coordinate information of the current time is acquired, and at the same time, the coordinate information of the first time in the graph is deleted, as shown in fig. 6, the graph displayed on the display interface includes A, B, C, D, E, F, G seven coordinate points, which respectively correspond to seven sequential times of 1, 2, 3, 4, 5, 6, and 7 on the abscissa, and when the updating condition is satisfied, the time 8 is reached, the coordinate information of the time 8 is acquired, which corresponds to the H coordinate point.
The graph is a graph including only six coordinate points B, C, D, E, F, G as shown in fig. 7, in which coordinate information of the first time in the graph, that is, the point a of the time having the abscissa of 1 is deleted, and the coordinate point between the second time and the third time is shifted in the direction of the origin of the coordinate axis, that is, the coordinate point B, C, D, E, F, G corresponding to the six times having the abscissas of 2 to 7 is shifted in the direction of the origin of the coordinate axis.
The coordinate information of the current time is determined as the coordinate information of the fourth time in the graph, and is displayed in the graph, that is, the coordinate point H of the time 8 is displayed in the graph, as shown in fig. 8, so as to form an updated graph, and achieve the purpose of updating the graph in real time.
The graph generating method disclosed in this embodiment obtains a configuration file, where the configuration file at least includes basic parameter information for configuring a real-time graph, update frequency information of the real-time graph, and dynamic data, runs the dynamic data in the configuration file to obtain result data, generates a graph based on the result data and the basic parameter information in the configuration file, and updates the graph based on the update frequency information in the configuration file. According to the scheme, the result data are obtained by running the dynamic data in the configuration file, the curve graph can be generated based on the result data, and the curve graph is updated periodically based on the updating frequency information in the configuration file after the curve graph is generated, so that the curve graph updated in real time is obtained, and the problems that the display rule needs to be manually adjusted when the curve graph is updated, and the operation is inconvenient are solved.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.