[go: up one dir, main page]

CN112380279A - Curve generating method and system - Google Patents

Curve generating method and system Download PDF

Info

Publication number
CN112380279A
CN112380279A CN202011287152.6A CN202011287152A CN112380279A CN 112380279 A CN112380279 A CN 112380279A CN 202011287152 A CN202011287152 A CN 202011287152A CN 112380279 A CN112380279 A CN 112380279A
Authority
CN
China
Prior art keywords
graph
time
information
coordinate
configuration file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011287152.6A
Other languages
Chinese (zh)
Inventor
严永兵
牛震宇
齐占新
艾琳
宋瑜辉
李葱葱
历爽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
State Grid Information and Telecommunication Co Ltd
Beijing China Power Information Technology Co Ltd
Original Assignee
State Grid Information and Telecommunication Co Ltd
Beijing China Power Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by State Grid Information and Telecommunication Co Ltd, Beijing China Power Information Technology Co Ltd filed Critical State Grid Information and Telecommunication Co Ltd
Priority to CN202011287152.6A priority Critical patent/CN112380279A/en
Publication of CN112380279A publication Critical patent/CN112380279A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/26Visual data mining; Browsing structured data

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

本申请公开了一种曲线图生成方法及系统,获取配置文件,配置文件至少包括用于配置实时曲线图的基础参数信息、实时曲线图的更新频率信息及动态数据,运行配置文件中的动态数据,得到结果数据,基于结果数据及配置文件中的基础参数信息生成曲线图,基于配置文件中的更新频率信息更新曲线图。本方案通过运行配置文件中的动态数据,获得结果数据,并能够基于结果数据生成曲线图,在生成曲线图后,基于配置文件中的更新频率信息定期更新曲线图,从而得到实时更新的曲线图,避免了对曲线图进行更新需要手动调整显示规则,操作不便的问题。

Figure 202011287152

The present application discloses a method and system for generating a graph. A configuration file is obtained. The configuration file includes at least basic parameter information for configuring a real-time graph, update frequency information and dynamic data of the real-time graph, and dynamic data in the running configuration file. , obtain the result data, generate a graph based on the result data and the basic parameter information in the configuration file, and update the graph based on the update frequency information in the configuration file. This solution obtains the result data by running the dynamic data in the configuration file, and can generate a graph based on the result data. After the graph is generated, the graph is periodically updated based on the update frequency information in the configuration file, so as to obtain a graph that is updated in real time. , which avoids the problem of manual adjustment of display rules and inconvenient operation when updating the graph.

Figure 202011287152

Description

Curve generating method and system
Technical Field
The present application relates to the field of data, and in particular, to a method and a system for generating a graph.
Background
The business statistical report is an important content of enterprise information construction, and the curve graph is applied more and more widely as an important component of a statistical analysis report.
In the conventional graph, the X axis and the Y axis of the drawn graph need to be determined in advance, then different query conditions are selected by an interface to trigger the equipment to draw the graph, and when the equipment needs to display the curves at different moments, the display rule needs to be modified for multiple times to adjust the displayed graph, so that the operation is inconvenient, and the display efficiency of the graph is reduced.
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.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of a method for generating a graph according to an embodiment of the present disclosure;
FIG. 2 is a graph illustrating a relationship between a horizontal axis and a vertical axis of a graph according to an embodiment of the present disclosure;
FIG. 3 is a flow chart of a method for generating a graph according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of points corresponding to various parameters plotted on a graph according to an embodiment of the present disclosure;
FIG. 5 is a flow chart of a method for generating a graph as disclosed in an embodiment of the present application;
FIG. 6 is a schematic illustration of a graph as disclosed in an embodiment of the present application;
fig. 7 is a schematic diagram illustrating a translation of a coordinate point between a second time and a third time according to an embodiment of the disclosure;
FIG. 8 is a graph illustrating an updated graph according to an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of a curve generation system disclosed in an embodiment of the present application.
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.

Claims (10)

1.一种曲线图生成方法,其特征在于,包括:1. a graph generation method, is characterized in that, comprises: 获取配置文件,所述配置文件至少包括用于配置实时曲线图的基础参数信息、所述实时曲线图的更新频率信息及动态数据;obtaining a configuration file, the configuration file including at least basic parameter information for configuring the real-time graph, update frequency information and dynamic data of the real-time graph; 运行所述配置文件中的动态数据,获得结果数据;Run the dynamic data in the configuration file to obtain the result data; 基于所述结果数据及所述配置文件中的基础参数信息生成曲线图;generating a graph based on the result data and the basic parameter information in the configuration file; 基于所述配置文件中的更新频率信息更新所述曲线图。The graph is updated based on update frequency information in the configuration file. 2.根据权利要求1所述的方法,其特征在于,所述基于所述结果数据及所述配置文件中的基础参数信息生成曲线图,包括:2. The method according to claim 1, wherein the generating a graph based on the result data and basic parameter information in the configuration file comprises: 基于所述基础参数信息确定待生成的曲线图的曲线图类型,所述曲线图类型至少能够表明所述待生成的曲线图的横轴信息、纵轴信息;Determine the graph type of the graph to be generated based on the basic parameter information, where the graph type can at least indicate the horizontal axis information and the vertical axis information of the graph to be generated; 基于所述结果数据为所述待生成的曲线图配置动态参数;Configure dynamic parameters for the graph to be generated based on the result data; 根据所述曲线图类型及所述待生成的曲线图的动态参数生成所述曲线图。The graph is generated according to the graph type and dynamic parameters of the graph to be generated. 3.根据权利要求2所述的方法,其特征在于,所述基于所述基础参数信息确定待生成的曲线图的曲线图类型,包括:3. The method according to claim 2, wherein the determining the graph type of the graph to be generated based on the basic parameter information comprises: 根据所述基础参数信息确定所述待生成的曲线图的宽度和高度;Determine the width and height of the graph to be generated according to the basic parameter information; 基于所述待生成的曲线图的宽度和高度创建图形绘制区域;Create a graphics drawing area based on the width and height of the graph to be generated; 在所述图形绘制区域创建至少包括横轴信息和纵轴信息的坐标轴。A coordinate axis including at least horizontal axis information and vertical axis information is created in the graphics drawing area. 4.根据权利要求3所述的方法,其特征在于,所述根据所述曲线图类型及所述待生成的曲线图的动态参数生成所述曲线图,包括:4. The method according to claim 3, wherein the generating the graph according to the graph type and the dynamic parameters of the graph to be generated comprises: 将所述待生成的曲线图的动态参数转换成与所述横轴信息及所述纵轴信息相匹配的坐标数据;Converting the dynamic parameters of the graph to be generated into coordinate data matching the horizontal axis information and the vertical axis information; 将所述坐标数据与所述图形绘制区域处的坐标轴结合,得到曲线图。The coordinate data is combined with the coordinate axis at the graph drawing area to obtain a graph. 5.根据权利要求1所述的方法,其特征在于,所述基于所述配置文件中的更新频率信息更新所述曲线图,包括:5. The method according to claim 1, wherein the updating the graph based on the update frequency information in the configuration file comprises: 根据所述更新频率信息调整所述曲线图中的坐标点信息,以使调整所述坐标点信息后的曲线图为当前的实时曲线图。The coordinate point information in the graph is adjusted according to the update frequency information, so that the graph after adjusting the coordinate point information is the current real-time graph. 6.根据权利要求5所述的方法,其特征在于,所述根据所述更新频率信息调整所述曲线图中的坐标点信息,包括:6. The method according to claim 5, wherein the adjusting the coordinate point information in the graph according to the update frequency information comprises: 基于所述更新频率信息确定当前时刻为坐标点信息更新时刻,获取当前时刻的坐标信息;Based on the update frequency information, it is determined that the current time is the coordinate point information update time, and the coordinate information of the current time is obtained; 删除所述曲线图中第一时刻的坐标信息,所述第一时刻为所述第一轴上与所述坐标轴原点相邻的时刻,所述第一轴为所述横轴或纵轴中用于表示时刻的轴;Delete the coordinate information of the first moment in the graph, where the first moment is the moment adjacent to the origin of the coordinate axis on the first axis, and the first axis is the horizontal axis or the vertical axis the axis used to represent the moment; 将第二时刻与第三时刻之间的坐标信息向所述坐标轴原点方向平移,所述第二时刻为与所述第一时刻相邻的时刻,所述第三时刻为在所述第一时刻之后与所述第一时刻间隔预设时长、且显示在所述第一轴上的时刻;Translate the coordinate information between the second moment and the third moment in the direction of the origin of the coordinate axis, where the second moment is a moment adjacent to the first moment, and the third moment is at the first moment The time after the time is separated from the first time by a preset period of time and displayed on the first axis; 将所述当前时刻的坐标信息确定为所述曲线图中第四时刻的坐标信息,显示在所述曲线图中,得到调整所述坐标点信息后的当前的实时曲线图,所述第四时刻为在所述第二时刻之后与所述第二时刻间隔预设时长的时刻。Determine the coordinate information at the current moment as the coordinate information at the fourth moment in the graph, display it in the graph, and obtain the current real-time graph after adjusting the coordinate point information, the fourth moment is a time interval between the second time and the second time after the second time by a preset length of time. 7.一种曲线图生成系统,其特征在于,包括:7. A system for generating graphs, comprising: 获取单元,用于获取配置文件,所述配置文件至少包括用于配置实时曲线图的基础参数信息、所述实时曲线图的更新频率信息及动态数据;an acquisition unit, configured to acquire a configuration file, where the configuration file at least includes basic parameter information for configuring the real-time graph, update frequency information and dynamic data of the real-time graph; 运行单元,用于运行所述配置文件中的动态数据,获得结果数据;a running unit for running the dynamic data in the configuration file to obtain result data; 生成单元,用于基于所述结果数据及所述配置文件中的基础参数信息生成曲线图;a generating unit, configured to generate a graph based on the result data and the basic parameter information in the configuration file; 更新单元,用于基于所述配置文件中的更新频率信息更新所述曲线图。An update unit, configured to update the graph based on the update frequency information in the configuration file. 8.根据权利要求7所述的系统,其特征在于,所述生成单元用于:8. The system according to claim 7, wherein the generating unit is used for: 基于所述基础参数信息确定待生成的曲线图的曲线图类型,所述曲线图类型至少能够表明所述待生成的曲线图的横轴信息、纵轴信息;基于所述结果数据为所述待生成的曲线图配置动态参数;根据所述曲线图类型及所述待生成的曲线图的动态参数生成所述曲线图。The graph type of the graph to be generated is determined based on the basic parameter information, and the graph type can at least indicate the horizontal axis information and the vertical axis information of the graph to be generated; The generated graph is configured with dynamic parameters; the graph is generated according to the graph type and the dynamic parameters of the graph to be generated. 9.根据权利要求7所述的系统,其特征在于,所述更新单元用于:9. The system according to claim 7, wherein the updating unit is used for: 根据所述更新频率信息调整所述曲线图中的坐标点信息,以使调整所述坐标点信息后的曲线图为当前的实时曲线图。The coordinate point information in the graph is adjusted according to the update frequency information, so that the graph after adjusting the coordinate point information is the current real-time graph. 10.根据权利要求9所述的系统,其特征在于,所述更新单元根据所述更新频率信息调整所述曲线图中的坐标点信息,包括:10. The system according to claim 9, wherein the updating unit adjusts the coordinate point information in the graph according to the updating frequency information, comprising: 所述更新单元基于所述更新频率信息确定当前时刻为坐标点信息更新时刻,获取当前时刻的坐标信息;删除所述曲线图中第一时刻的坐标信息,所述第一时刻为所述第一轴上与所述坐标轴原点相邻的时刻,所述第一轴为所述横轴或纵轴中用于表示时刻的轴;将第二时刻与第三时刻之间的坐标信息向所述坐标轴原点方向平移,所述第二时刻为与所述第一时刻相邻的时刻,所述第三时刻为在所述第一时刻之后与所述第一时刻间隔预设时长、且显示在所述第一轴上的时刻;将所述当前时刻的坐标信息确定为所述曲线图中第四时刻的坐标信息,显示在所述曲线图中,得到调整所述坐标信息后的当前的实时曲线图,所述第四时刻为在所述第二时刻之后与所述第二时刻间隔预设时长的时刻。The update unit determines, based on the update frequency information, that the current time is the coordinate point information update time, and obtains the coordinate information of the current time; deletes the coordinate information of the first time in the graph, and the first time is the first time. The time on the axis adjacent to the origin of the coordinate axis, the first axis is the axis used to represent the time in the horizontal axis or the vertical axis; the coordinate information between the second time and the third time is sent to the The coordinate axis is shifted in the direction of the origin, the second time is the time adjacent to the first time, the third time is after the first time and is separated from the first time by a preset time, and is displayed in the The time on the first axis; determine the coordinate information of the current time as the coordinate information of the fourth time in the graph, display it in the graph, and obtain the current real-time after adjusting the coordinate information In the graph, the fourth time is a time after the second time that is separated from the second time by a preset time period.
CN202011287152.6A 2020-11-17 2020-11-17 Curve generating method and system Pending CN112380279A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011287152.6A CN112380279A (en) 2020-11-17 2020-11-17 Curve generating method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011287152.6A CN112380279A (en) 2020-11-17 2020-11-17 Curve generating method and system

Publications (1)

Publication Number Publication Date
CN112380279A true CN112380279A (en) 2021-02-19

Family

ID=74585826

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011287152.6A Pending CN112380279A (en) 2020-11-17 2020-11-17 Curve generating method and system

Country Status (1)

Country Link
CN (1) CN112380279A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1121200A (en) * 1993-11-30 1996-04-24 卡西欧计算机公司 graphic display device
US6275237B1 (en) * 1998-09-30 2001-08-14 Arphic Technology Co., Ltd. Structural graph display system
US20050203773A1 (en) * 2004-03-05 2005-09-15 Iocent, Llc Systems and methods for risk stratification of patient populations
US20140073869A1 (en) * 2012-09-11 2014-03-13 Nellcor Puritan Bennett Llc Methods and systems for determining physiological information using status indicators
CN104035785A (en) * 2014-07-01 2014-09-10 浪潮(北京)电子信息产业有限公司 Double-axis curve graph drawing method and device
CN105068807A (en) * 2015-08-07 2015-11-18 北京思特奇信息技术股份有限公司 Generation method and system for multi-axis curve graph
CN105842875A (en) * 2016-06-07 2016-08-10 杭州美戴科技有限公司 Method for designing glasses frame based on facial three-dimensional measurement
CN111930975A (en) * 2020-06-21 2020-11-13 中国舰船研究设计中心 Ship navigation data playback and analysis system and method

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1121200A (en) * 1993-11-30 1996-04-24 卡西欧计算机公司 graphic display device
US6275237B1 (en) * 1998-09-30 2001-08-14 Arphic Technology Co., Ltd. Structural graph display system
US20050203773A1 (en) * 2004-03-05 2005-09-15 Iocent, Llc Systems and methods for risk stratification of patient populations
US20140073869A1 (en) * 2012-09-11 2014-03-13 Nellcor Puritan Bennett Llc Methods and systems for determining physiological information using status indicators
CN104035785A (en) * 2014-07-01 2014-09-10 浪潮(北京)电子信息产业有限公司 Double-axis curve graph drawing method and device
CN105068807A (en) * 2015-08-07 2015-11-18 北京思特奇信息技术股份有限公司 Generation method and system for multi-axis curve graph
CN105842875A (en) * 2016-06-07 2016-08-10 杭州美戴科技有限公司 Method for designing glasses frame based on facial three-dimensional measurement
CN111930975A (en) * 2020-06-21 2020-11-13 中国舰船研究设计中心 Ship navigation data playback and analysis system and method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
R. R. NAIR: ""Automated Analysis of Line Plots in Documents"", 《2015 13TH INTERNATIONAL CONFERENCE ON DOCUMENT ANALYSIS AND RECOGNITION (ICDAR)》, 31 December 2015 (2015-12-31), pages 796 - 800 *
钟权: ""基于QCustomPlot 和Qt 的曲线绘制及显示技术"", 《科技视界》, 30 June 2017 (2017-06-30), pages 46 - 47 *

Similar Documents

Publication Publication Date Title
CN108920048B (en) Large drawing browsing method, system, server and computer readable storage medium
CN109471900B (en) Interaction method and system for chart data custom action data
CN101807199B (en) Thumbnail display method and device
KR102607137B1 (en) Method and apparatus for processing image frame, electronic device, storage media and program
CN112201209B (en) Backlight brightness adjusting method and device of display screen, storage medium and terminal
CN113255302A (en) Method for operating tissue architecture diagram, computer device and computer storage medium
JP3038521B2 (en) Product drawing creation device
EP2733623A1 (en) Rapid localized language development for video matrix switching system
JP2006236249A (en) Device for preparing attached image file for e-mail, its method and its control program
CN112380279A (en) Curve generating method and system
CN115797508A (en) Real-time dynamic animation generation method, device, equipment and storage medium
KR102420825B1 (en) Homepage production server
CN111209034A (en) Method for configuring visual dynamic page of TV large screen
JP2004110427A5 (en)
JPWO2019159266A1 (en) Display system and program
JP2014071448A (en) Font generation system and method of display unit
US12266071B2 (en) User-interface-framework based processing method, apparatus, device, and medium
CN118691706A (en) Method, device, electronic device and readable medium for generating curve graph
CN115908628A (en) Big data down-sampling line graph information display method, system, device and medium
US10616448B2 (en) Image processing apparatus performing color conversion process that reflects intention of original color scheme, and control method therefor
CN114363597A (en) Character projection method, device, robot and storage medium
CN113888673A (en) Map editing method, system, device, computing equipment and storage medium
JP2001014131A (en) Display control device and its program recording medium
CN110825390A (en) Visualization large screen project rapid deployment
US20220350777A1 (en) Document search system, document search method, and computer-readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination