Data display method and device
By processing the horizontal coordinates and vertical coordinates in the line chart, the corresponding values are separated by preset time intervals, and some data are aggregated, the problems of missing points and dense data in the line chart are solved, and the display effect and user experience are improved.
Patent Information
- Application Number
- CN202411875220.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-18
AI Technical Summary
In the prior art, the intermediate points of the line chart may be missing, resulting in discontinuity of display; at the same time, if there are too many data points, the line chart will become very dense, affecting the display effect.
By obtaining the data to be displayed and the input parameters, the horizontal coordinates of the line graph are determined based on the input parameter processing, so that adjacent values are separated by preset time intervals; at the same time, the data to be displayed is processed, including assigning and aggregating the corresponding vertical coordinates of the line graph to be determined.
It improves the display effect of line charts, avoids the problems of missing intermediate points and data density, and improves the user experience.
Smart Images

Figure CN119729097A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular, to a data display method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] The anchor center usually includes a variety of data, such as the anchor's live broadcast duration, number of viewers, gift income, and number of bullet comments. In order to have an intuitive understanding of these data, it is usually desirable to generate a line chart for display. The usual practice is that the front end obtains the line chart data from the server and parses it, and then fills the horizontal and vertical coordinates into the line chart to form a displayed line chart, where the horizontal axis is the time period and the vertical axis is the value corresponding to each type of data.
[0003] However, due to reasons such as the source of the data, some intermediate points may be missing, which will make the line chart display discontinuous; in addition, if there are many data points, the data displayed by the line chart will be very dense, affecting the display effect of the line chart.
[0004] It should be noted that the above content is not necessarily prior art, nor is it intended to limit the scope of patent protection of this application. Summary of the invention
[0005] The embodiments of the present application provide a data display method, apparatus, computer device, computer-readable storage medium, and computer program product to solve or alleviate one or more of the technical problems raised above.
[0006] One aspect of an embodiment of the present application provides a data display method, the method comprising: Acquire data to be displayed and input parameters, wherein the input parameters at least include a preset time interval; Performing a first process based on the input parameters, and determining the abscissa of the line graph to be generated based on the result of the first process, wherein the first process at least includes separating adjacent values of the abscissa by the preset time interval; Performing a second process based on the data to be displayed, and determining the ordinate of the line graph to be generated based on a result of the second process, wherein the second process includes at least one of assigning a value to the ordinate corresponding to at least part of the abscissa and performing aggregation processing on part of the data to be displayed; A line graph is generated based on the horizontal axis and the vertical axis for display.
[0007] Optionally, the input parameters also include a start time and an end time; Correspondingly, performing a first processing based on the input parameters and determining the horizontal coordinate of the line graph to be generated based on the result of the first processing includes: Obtain the start time, the end time and the preset time interval; The first processing is performed based on the preset time interval, the start time and the end time to obtain the horizontal coordinate of the line graph to be generated.
[0008] Optionally, the input parameters further include preset DSL statements; Correspondingly, the performing the second processing based on the data to be displayed includes: Obtain the preset DSL statement; Based on the preset DSL statement and the data to be displayed, a value is assigned to at least part of the vertical coordinates corresponding to the horizontal coordinates.
[0009] Optionally, the preset DSL statement is a cron expression; Correspondingly, assigning values to at least part of the vertical coordinates corresponding to the horizontal coordinates based on the preset DSL statement and the data to be displayed includes: Parsing the cron expression to obtain a parsing result; Acquire required target data from the data to be displayed based on the analysis result; Performing an operation based on the target data and the cron expression to determine an operation result of a first ordinate, where the first ordinate is the ordinate corresponding to the cron expression; The operation result is assigned to the first vertical coordinate.
[0010] Optionally, the input parameter further includes a replacement array, and correspondingly, the method further includes: Obtain the replacement array, and determine the second ordinate corresponding to the replacement array; The second ordinate is assigned a value based on the replacement array.
[0011] Optionally, the input parameters also include an aggregation threshold; Correspondingly, the performing the second processing based on the data to be displayed includes: Obtaining the aggregation threshold; Aggregation processing is performed on the data to be displayed based on the aggregation threshold.
[0012] Another aspect of an embodiment of the present application provides a data display device, the device comprising: An acquisition module, used to acquire data to be displayed and input parameters, wherein the input parameters at least include a preset time interval; A first processing module, configured to perform a first processing based on the input parameters, and determine the abscissa of the line graph to be generated based on the result of the first processing, wherein the first processing at least includes separating adjacent values of the abscissa by the preset time interval; a second processing module, configured to perform a second processing based on the data to be displayed, and determine the ordinate of the line graph to be generated based on a result of the second processing, wherein the second processing includes at least one of assigning a value to the ordinate corresponding to at least part of the abscissa and performing aggregation processing on part of the data to be displayed; A generating module is used to generate a line graph based on the horizontal coordinate and the vertical coordinate for display.
[0013] Another aspect of an embodiment of the present application provides a computer device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein: the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method described above.
[0014] Another aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the method described above is implemented.
[0015] Another aspect of an embodiment of the present application provides a computer program product, including a computer program, which implements the method described above when executed by a processor.
[0016] The above technical solution adopted in the embodiment of the present application may have the following advantages: By acquiring the data to be displayed and the input parameters, the horizontal coordinate of the line graph to be generated is determined by making adjacent values of the horizontal coordinate of the line graph to be generated be separated by a preset time interval based on the input parameters; the vertical coordinate of the line graph to be generated is determined by performing processing based on the data to be displayed, so as to assign values to at least part of the horizontal coordinates corresponding to the vertical coordinates and aggregate part of the data to be displayed; a line graph is generated based on the horizontal coordinate and the vertical coordinate for display, and the horizontal and vertical coordinates of the line graph can be appropriately processed as needed, thereby improving the display effect of the line graph and improving the user experience at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.
[0018] Figure 1 The flowchart of the data display method according to the first embodiment of the present application is schematically shown; Figure 2 Schematically shows Figure 1 Flow chart of sub-steps of step S102; Figure 3 Schematically shows Figure 1 Flow chart of sub-steps of step S104; Figure 4 Schematically shows Figure 3 Flow chart of sub-steps of step S302; Figure 5 The newly added process of the data display method according to the first embodiment of the present application is schematically shown; Figure 6 Schematically shows Figure 1 Another sub-step flow chart of step S104; Figure 7 The following schematically shows an example process of the data display method according to the first embodiment of the present application; Figure 8 A block diagram schematically shows a data display device according to the second embodiment of the present application; and Fig. 9 The hardware architecture diagram of the computer device according to the third embodiment of the present application is schematically shown. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0020] It should be noted that the descriptions involving "first", "second", etc. in the embodiments of the present application are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0021] In the description of the present application, it should be understood that the numerical labels before the steps do not indicate the order in which the steps are executed, but are only used to facilitate the description of the present application and to distinguish each step, and therefore should not be understood as a limitation on the present application.
[0022] First, the following terms are explained: DSL (Domain Specific Language): It is a computer language tailored for a specific domain (such as database, network, configuration, etc.). Compared with general programming languages (such as C++, Java, Python), the syntax and expression of DSL are closer to the business concepts of the field, allowing developers to express and solve problems in a more natural and intuitive way.
[0023] Cron expression: a string used to configure scheduled tasks on Unix and Unix-like systems. It specifies the time for task execution through a series of characters and special symbols, and is widely used in various systems and applications.
[0024] Secondly, in order to facilitate those skilled in the art to understand the technical solutions provided in the embodiments of the present application, the relevant technologies are described below: The anchor center usually includes a variety of data, such as the anchor's live broadcast duration, number of viewers, number of gifts, number of bullet comments, etc. In related technologies, the front end usually obtains data from the server for analysis, and then fills the data into the horizontal and vertical axes of the line chart to form a displayed line chart.
[0025] However, the applicant understands that the related technology still has the following defects: Due to reasons such as the data source, some intermediate points in the line chart may be missing, which will make the line chart display discontinuous; in addition, if there are many data points, the data displayed in the line chart will be very dense. These two situations will cause the display effect of the generated line chart to be unsatisfactory and affect the user experience.
[0026] To this end, the embodiment of the present application provides a data display technical solution. In this technical solution, the horizontal and vertical coordinates of the line graph can be processed as needed to improve the display effect of the line graph and improve the user experience. See below for details.
[0027] The technical solutions of the present application are described below through multiple embodiments. It should be noted that these embodiments can be implemented in a variety of different forms and should not be construed as being limited to the embodiments described here.
[0028] Embodiment 1 Figure 1 The flowchart of the data display method according to the first embodiment of the present application is schematically shown.
[0029] like Figure 1 As shown, the data display method may include steps S100 to S106, wherein: Step S100, obtaining data to be displayed and input parameters, wherein the input parameters at least include a preset time interval.
[0030] Step S102, performing a first processing based on the input parameters, and determining the horizontal coordinate of the line graph to be generated based on the result of the first processing, wherein the first processing at least includes separating adjacent values of the horizontal coordinate by the preset time interval.
[0031] Step S104, performing a second processing based on the data to be displayed, and determining the vertical coordinate of the line graph to be generated based on the result of the second processing, wherein the second processing includes at least one of assigning a value to the vertical coordinate corresponding to at least part of the horizontal coordinate and aggregating part of the data to be displayed.
[0032] Step S106, generating a line graph based on the horizontal coordinate and the vertical coordinate for display.
[0033] The data display method provided in the present embodiment obtains the data to be displayed and the input parameters, processes the input parameters so that the adjacent values of the horizontal coordinate of the line graph to be generated are separated by a preset time interval, and determines the horizontal coordinate of the line graph to be generated; processes the data to be displayed so that at least part of the horizontal coordinates are assigned to the corresponding vertical coordinates and part of the data to be displayed are aggregated to determine the vertical coordinate of the line graph to be generated; generates a line graph based on the horizontal coordinate and the vertical coordinate for display, and can appropriately process the horizontal coordinate and the vertical coordinate of the line graph as needed, thereby improving the display effect of the line graph and improving the user experience at the same time.
[0034] The following combination Figure 1 , each step in steps S100~S106 and other optional steps are explained in detail.
[0035] Step S100 , obtaining data to be displayed and input parameters, wherein the input parameters at least include a preset time interval.
[0036] Among them, the data to be displayed can be the data that the user mainly wants to display, for example, it can include data such as the live broadcast duration of the anchor, the number of viewers, the number of gift income and the number of bullet screens, and can also include corresponding time data. The data to be displayed can be stored in a specific location, such as a database, and when the data to be displayed needs to be obtained, it is obtained from the specific location. Optionally, when obtaining the data to be displayed, all the data to be displayed can be obtained at one time, or the data to be displayed can be obtained continuously, for example, the data to be displayed is obtained once at a certain time interval. In the case of continuously obtaining the data to be displayed, the processing of subsequent steps and the generation of the line graph can be a dynamic process, that is, when new data to be displayed is obtained, the data is processed according to the subsequent steps, and the line graph is continued to be generated on the basis of the original generated line graph. For example, if the current time is 8:00, the target data is only the data at and before the current time. After 8:30, the target data is updated to the data at 8:30, and the data at 8:30 can continue to be generated on the basis of the original line graph.
[0037] Step S102 , performing a first processing based on the input parameters, and determining the horizontal coordinate of the line graph to be generated based on the result of the first processing, wherein the first processing at least includes separating adjacent values of the horizontal coordinate by the preset time interval.
[0038] Specifically, a preset time interval in the input parameter can be obtained, and then the horizontal coordinate of the line graph to be generated is first processed according to the preset time interval, so that every two adjacent horizontal coordinate values in the line graph to be generated are separated by a preset time interval. In addition to the preset time interval, the input parameter can also include other content. Some exemplary solutions are provided below.
[0039] In an optional embodiment, the input parameters may also include a start time and an end time, such as Figure 2 As shown, step S102 may include: Step S200, obtaining the start time, the end time and the preset time interval.
[0040] Step S202: performing the first processing based on the preset time interval, the start time and the end time to obtain the horizontal coordinate of the line graph to be generated.
[0041] Specifically, the start time, end time and preset time interval can be obtained from the input parameters, and then the horizontal coordinate of the line graph to be generated is first processed according to the start time, end time and preset time interval to obtain the horizontal coordinate of the line graph to be generated. For example, if the start time is 8:00, the end time is 10:00, and the preset time interval is 30 minutes, the five horizontal coordinate points of 8:00, 8:30, 9:00, 9:30 and 10:00 can be automatically generated. In actual applications, when the data to be displayed includes corresponding time data, the start time and end time can also be determined directly based on the time data.
[0042] In this embodiment, by obtaining the start time, end time and preset time interval in the input parameters, a first processing is performed based on the preset time interval, the start time and the end time to obtain the horizontal coordinate of the line graph to be generated. The adjacent values of the horizontal coordinate of the line graph to be generated can be separated by a preset time interval, so that the subsequently generated line graph will not be too dense. The density of the generated line graph points can be effectively controlled, and the display effect of the generated line graph can be improved, thereby improving the user experience.
[0043] Step S104 , performing a second processing based on the data to be displayed, and determining the vertical coordinate of the line graph to be generated based on the result of the second processing, wherein the second processing includes at least one of assigning a value to the vertical coordinate corresponding to at least part of the horizontal coordinate and aggregating part of the data to be displayed.
[0044] Specifically, the input parameters may also include information on how to perform the second processing, so that the user can input relevant processing content in the input parameters as needed, so that the ordinate of the line graph to be generated meets the different needs of the user. Some exemplary solutions are provided below.
[0045] In an optional embodiment, the input parameters may also include preset DSL statements, such as Figure 3 As shown, step S104 may include: Step S300: Obtain the preset DSL statement.
[0046] Step S302: assigning values to at least part of the vertical coordinates corresponding to the horizontal coordinates based on the preset DSL statement and the data to be displayed.
[0047] It is understandable that when there is no need to use the preset DSL statement to assign values to the vertical coordinates of the line graph to be generated, the preset DSL statement may not be included in the input parameters, that is, the user does not need to input the preset DSL statement. When the input parameters include the preset DSL statement, it means that the user wants to assign values to the vertical coordinates corresponding to at least part of the horizontal coordinates through the DSL statement. For example, if the user wants to process the data at some time points and assign values, the user can write a preset DSL statement for the data at some time points, and then input the written preset DSL statement into the input parameters. In this way, the preset DSL statement can be obtained from the input parameters, and the data at some time points can be processed and assigned values according to the preset DSL statement. In addition, for the vertical coordinates that are not assigned by the preset DSL statement, the corresponding data in the data to be displayed can be directly used.
[0048] In this embodiment, by obtaining a preset DSL statement, assigning values to the vertical coordinates corresponding to at least part of the horizontal coordinates based on the preset DSL statement and the data to be displayed, the vertical coordinates of the line graph to be generated can be assigned values according to the DSL statement pre-written by the user, so that the generated line graph meets the diverse needs of users.
[0049] In an optional embodiment, the preset DSL statement is a cron expression, such as Figure 4 As shown, step 302 may include: Step S400, parsing the cron expression to obtain a parsing result.
[0050] Step S402: acquiring required target data from the data to be displayed based on the analysis result.
[0051] Step S404, performing calculation based on the target data and the cron expression to determine a calculation result of a first ordinate, where the first ordinate is the ordinate corresponding to the cron expression.
[0052] Step S406, assigning the calculation result to the first vertical coordinate.
[0053] Specifically, when a cron expression is obtained from an input parameter, the obtained cron expression can be parsed according to the rules of the cron expression to determine the target data required by the cron expression; then, the required target data is obtained from the data to be displayed, the target data is input into the cron expression for operation, the operation result is obtained, and then the operation result is assigned to the ordinate corresponding to the cron expression (i.e., the first ordinate).
[0054] For example, if the cron expression is (0 0 12 ? ): (+10), the expression is parsed according to the rules of cron expressions to determine that it represents the value corresponding to 12:00:00 plus 10, then the value of 12:00:00 is obtained from the data to be displayed, the obtained value is added with 10 and then assigned to the vertical coordinate corresponding to 12:00:00. For another example, if the cron expression is (0 0 12 ? ): (m+10)+(h+5), the expression is parsed according to the rules of cron expressions to determine that the value representing 12:00:00 = minutes+10+hours+5, the value of 12:00:00 is obtained from the data to be displayed, and then input into the cron expression for calculation and assigned to the vertical coordinate corresponding to 12:00:00.
[0055] In this embodiment, the cron expression is parsed to obtain the parsing result, the required target data is obtained from the data to be displayed based on the parsing result, the operation is performed based on the target data and the cron expression, the operation result of the first vertical coordinate is determined, and the operation result is assigned to the first vertical coordinate. The vertical coordinate of the line chart to be generated can be assigned according to the cron expression pre-written by the user, so that the generated line chart meets the diverse needs of users and improves the flexibility of line chart generation and display effect.
[0056] In an optional embodiment, the input parameters may also include a replacement array, such as Figure 5 As shown, the data display method of the embodiment of the present application may also include: Step S500, obtaining the replacement array and determining a second vertical coordinate corresponding to the replacement array.
[0057] Step S502: assigning a value to the second ordinate based on the replacement array.
[0058] The data in the replacement array can come from the data to be displayed or from other data. For example, when the line chart is mainly generated by cron expressions, for some needs, the data of certain points need to be replaced. In this case, the replacement array can be obtained from the data to be displayed or other data, and the replacement array is passed into the input parameter. After obtaining the replacement array, the second ordinate corresponding to the replacement array is determined, and then the value in the replacement array is assigned to the second ordinate. For example, if the replacement array assigns the value corresponding to 17:00 to 100, then after obtaining the replacement array, the ordinate corresponding to 17:00 is determined and the corresponding ordinate is assigned to 100.
[0059] In this embodiment, by obtaining a replacement array and determining the second vertical coordinate corresponding to the replacement array, and assigning a value to the second vertical coordinate based on the replacement array, some point data of the line chart can be replaced according to user needs, thereby meeting the diverse needs of users.
[0060] In an optional embodiment, the input parameters may also include an aggregation threshold, such as Figure 6 As shown, step S104 may include: Step S600: obtaining the aggregation threshold.
[0061] Step S602: Aggregate the data to be displayed based on the aggregation threshold.
[0062] The aggregation threshold may refer to a specified time interval or step size, which is used to aggregate the time points in the original time series data. During the aggregation process, each aggregated time point will contain a certain summary (such as sum) of all data values in the original data within a certain range before and after the time point (determined by the aggregation threshold). The specific aggregation threshold can be set according to actual needs. For example, if the aggregation threshold is 2, and the horizontal axis has five points of 8:00, 8:30, 9:00, 9:30 and 10:00, then the aggregation processing based on the aggregation threshold can obtain three points of 8:00, 9:00, and 10:00, among which the value of 8:00 can be the value of 8:00 plus the value of 8:30, and the value of 9:00 can be the value of 9:00 plus the value of 9:30, thereby reducing the point data, facilitating the viewing of the line chart, and improving the display effect of the line chart.
[0063] In this embodiment, by obtaining an aggregation threshold and performing aggregation processing on the data to be displayed based on the aggregation threshold, the points of the line graph can be aggregated as needed, thereby effectively reducing the excessive points of the line graph and improving the display effect of the line graph.
[0064] Step S106 , a line graph is generated based on the horizontal axis and the vertical axis for display.
[0065] After determining the horizontal and vertical coordinates, the point array table of the line graph can be obtained according to the corresponding horizontal and vertical coordinates, and the line graph can be generated by inputting it into the line graph and displayed to the user for viewing.
[0066] In order to make this application easier to understand, the following Figure 7 An exemplary application is provided. As shown in the figure, it can generally include the following processes: 1. Input parameters, which may include start time, end time, interval dimension, vertical coordinate generation expression, replacement point data list and number of aggregation points (aggregation threshold); 2. Divide all corresponding points according to the start time, end time and interval dimensions in the input parameters; 3. Determine whether there is an input generation expression in the input parameter. If yes, go to 4, otherwise go to 5; 4. Parse the generated expression, find the corresponding point according to the result of the analysis, and use the generated expression to obtain the value; 5. Determine whether there is an incoming replacement value in the input parameter. If yes, go to 6, otherwise go to 7; 6. Replace the value of the corresponding point with the incoming replacement value; 7. Determine whether the input parameter contains the number of incoming aggregation points. If yes, proceed to step 8, otherwise proceed to step 9; 8. Add the aggregated points together to generate new points according to the number of aggregated points; 9. Output the point array table and generate a line graph.
[0067] In this exemplary application, by inputting parameters, you can choose to generate expressions to generate vertical coordinates, replace the values of certain points, and aggregate the points as needed, so that users can customize the generated line chart as needed, so that the generated line chart will not be discontinuous or have too high data density, thereby improving the display effect of the line chart and thus improving the user experience.
[0068] Embodiment 2 Figure 8 The block diagram of the data display device according to the second embodiment of the present application is schematically shown. The device can be divided into one or more program modules, one or more program modules are stored in a storage medium, and are executed by one or more processors to complete the embodiment of the present application. The program module referred to in the embodiment of the present application refers to a series of computer program instruction segments that can complete specific functions. The following description will specifically introduce the functions of each program module in this embodiment. Figure 8 As shown, the device 700 may include: an acquisition module 710, a first processing module 720, a second processing module 730 and a generation module 740, wherein: An acquisition module 710 is used to acquire data to be displayed and input parameters, wherein the input parameters at least include a preset time interval; A first processing module 720 is used to perform a first processing based on the input parameters, and determine the horizontal coordinate of the line graph to be generated based on the result of the first processing, wherein the first processing at least includes separating adjacent values of the horizontal coordinate by the preset time interval; A second processing module 730 is used to perform a second processing based on the data to be displayed, and determine the ordinate of the line graph to be generated based on the result of the second processing, wherein the second processing includes at least one of assigning a value to the ordinate corresponding to at least part of the abscissa and performing aggregation processing on part of the data to be displayed; The generating module 740 is used to generate a line graph based on the horizontal coordinate and the vertical coordinate for display.
[0069] In an optional embodiment, the input parameters further include a start time and an end time, and the first processing module 720 is further configured to: Obtain the start time, the end time and the preset time interval; The first processing is performed based on the preset time interval, the start time and the end time to obtain the horizontal coordinate of the line graph to be generated.
[0070] In an optional embodiment, the input parameter further includes a preset DSL statement, and the second processing module 730 is further configured to: Obtain the preset DSL statement; Based on the preset DSL statement and the data to be displayed, a value is assigned to at least part of the vertical coordinates corresponding to the horizontal coordinates.
[0071] In an optional embodiment, the preset DSL statement is a cron expression, and the second processing module 730 is further used to: Parsing the cron expression to obtain a parsing result; Acquire required target data from the data to be displayed based on the analysis result; Performing an operation based on the target data and the cron expression to determine an operation result of a first ordinate, where the first ordinate is the ordinate corresponding to the cron expression; The operation result is assigned to the first vertical coordinate.
[0072] In an optional embodiment, the input parameter further includes a replacement array, and the apparatus 700 is further configured to: Obtain the replacement array, and determine the second ordinate corresponding to the replacement array; The second ordinate is assigned a value based on the replacement array. In an optional embodiment, the input parameter further includes an aggregation threshold, and the device 700 is further configured to: Obtaining the aggregation threshold; Aggregation processing is performed on the data to be displayed based on the aggregation threshold.
[0073] Embodiment 3 Fig. 9The schematic diagram of the hardware architecture of a computer device 10000 suitable for implementing the data display method according to the third embodiment of the present application is schematically shown. In some embodiments, the computer device 10000 may be a terminal device such as a smart phone, a wearable device, a tablet computer, a personal computer, a vehicle terminal, a game console, a virtual device, a workbench, a digital assistant, a set-top box, a robot, etc. In other embodiments, the computer device 10000 may be a rack server, a blade server, a tower server, or a cabinet server (including an independent server, or a server cluster composed of multiple servers), etc. Fig. 9 As shown, the computer device 10000 includes but is not limited to: a memory 10010, a processor 10020, and a network interface 10030 that can communicate with each other through a system bus. Among them: The memory 10010 includes at least one type of computer-readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (such as SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 10010 can be an internal storage module of the computer device 10000, such as a hard disk or memory of the computer device 10000. In other embodiments, the memory 10010 can also be an external storage device of the computer device 10000, such as a plug-in hard disk equipped on the computer device 10000, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 10010 can also include both the internal storage module of the computer device 10000 and its external storage device. In this embodiment, the memory 10010 is generally used to store an operating system and various application software installed in the computer device 10000, such as program codes of a data display method, etc. In addition, the memory 10010 can also be used to temporarily store various data that have been output or are to be output.
[0074] In some embodiments, the processor 10020 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other chips. The processor 10020 is generally used to control the overall operation of the computer device 10000, such as performing control and processing related to data interaction or communication with the computer device 10000. In this embodiment, the processor 10020 is used to run the program code stored in the memory 10010 or process data.
[0075] The network interface 10030 may include a wireless network interface or a wired network interface, and the network interface 10030 is generally used to establish a communication link between the computer device 10000 and other computer devices. For example, the network interface 10030 is used to connect the computer device 10000 to an external terminal through a network, and to establish a data transmission channel and a communication link between the computer device 10000 and the external terminal. The network may be a wireless or wired network such as an intranet, the Internet, the Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth, Wi-Fi, etc.
[0076] It should be pointed out that Fig. 9 Only a computer device having components 10010 - 10030 is shown, but it should be understood that implementation of all of the components shown is not a requirement, and more or fewer components may alternatively be implemented.
[0077] In this embodiment, the data display method stored in the memory 10010 can also be divided into one or more program modules and executed by one or more processors (such as processor 10020) to complete the embodiment of the present application.
[0078] Embodiment 4 An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the data display method in the embodiment are implemented.
[0079] In this embodiment, the computer-readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the computer-readable storage medium can be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the computer-readable storage medium can also be an external storage device of a computer device, such as a plug-in hard disk equipped on the computer device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the computer-readable storage medium can also include both the internal storage unit of the computer device and its external storage device. In this embodiment, the computer-readable storage medium is generally used to store an operating system and various application software installed on the computer device, such as the program code of the data display method in the embodiment. In addition, the computer-readable storage medium can also be used to temporarily store various types of data that have been output or are to be output.
[0080] Embodiment 5 An embodiment of the present application also provides a computer program product, including a computer program, which implements the method in the above embodiment when executed by a processor.
[0081] Obviously, those skilled in the art should understand that the modules or steps of the above-mentioned embodiments of the present application can be implemented by general-purpose computer devices, they can be concentrated on a single computer device, or distributed on a network composed of multiple computer devices, optionally, they can be implemented by executable program codes of computer devices, so that they can be stored in a storage device and executed by the computer device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.
[0082] It should be noted that the above are only preferred embodiments of the present application, and the patent protection scope of the present application is not limited thereto. Any equivalent structure or equivalent process transformation made using the contents of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A data display method, characterized in that: The method comprises: Acquire data to be displayed and input parameters, wherein the input parameters at least include a preset time interval; Performing a first process based on the input parameters, and determining the abscissa of the line graph to be generated based on the result of the first process, wherein the first process at least includes separating adjacent values of the abscissa by the preset time interval; Performing a second process based on the data to be displayed, and determining the ordinate of the line graph to be generated based on a result of the second process, wherein the second process includes at least one of assigning a value to the ordinate corresponding to at least part of the abscissa and performing aggregation processing on part of the data to be displayed; A line graph is generated based on the horizontal axis and the vertical axis for display.
2. The method according to claim 1, characterized in that The input parameters also include start time and end time; Correspondingly, performing a first processing based on the input parameters and determining the horizontal coordinate of the line graph to be generated based on the result of the first processing includes: Obtain the start time, the end time and the preset time interval; The first processing is performed based on the preset time interval, the start time and the end time to obtain the horizontal coordinate of the line graph to be generated.
3. The method according to claim 1, characterized in that The input parameters also include preset DSL statements; Correspondingly, the performing the second processing based on the data to be displayed includes: Obtain the preset DSL statement; Based on the preset DSL statement and the data to be displayed, a value is assigned to at least part of the vertical coordinates corresponding to the horizontal coordinates.
4. The method according to claim 3, characterized in that The preset DSL statement is a cron expression; Correspondingly, assigning values to at least part of the vertical coordinates corresponding to the horizontal coordinates based on the preset DSL statement and the data to be displayed includes: Parsing the cron expression to obtain a parsing result; Acquire required target data from the data to be displayed based on the analysis result; Performing an operation based on the target data and the cron expression to determine an operation result of a first ordinate, where the first ordinate is the ordinate corresponding to the cron expression; The operation result is assigned to the first vertical coordinate.
5. The method according to claim 3, characterized in that: The input parameter also includes a replacement array, and correspondingly, the method also includes: Obtain the replacement array, and determine the second ordinate corresponding to the replacement array; The second ordinate is assigned a value based on the replacement array.
6. The method according to any one of claims 1 to 5, characterized in that: The input parameters also include an aggregation threshold; Correspondingly, the performing the second processing based on the data to be displayed includes: Obtaining the aggregation threshold; Aggregation processing is performed on the data to be displayed based on the aggregation threshold.
7. A data display device, characterized in that: The device comprises: An acquisition module, used to acquire data to be displayed and input parameters, wherein the input parameters at least include a preset time interval; A first processing module, configured to perform a first processing based on the input parameters, and determine the abscissa of the line graph to be generated based on the result of the first processing, wherein the first processing at least includes separating adjacent values of the abscissa by the preset time interval; a second processing module, configured to perform a second processing based on the data to be displayed, and determine the ordinate of the line graph to be generated based on a result of the second processing, wherein the second processing includes at least one of assigning a value to the ordinate corresponding to at least part of the abscissa and performing aggregation processing on part of the data to be displayed; A generating module is used to generate a line graph based on the horizontal coordinate and the vertical coordinate for display.
8. A computer device, characterized in that: include: at least one processor; and a memory communicatively connected to the at least one processor; wherein: The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Data display method and apparatus
CN108073558A
Medical record sign broken line chart display method, device and equipment, medium and implementation method
CN111986748A
Data auditing monitoring system
CN114584600A
Data processing method and device applied to business intelligent system, medium and equipment
CN117539892A
Methods, systems, and media for data visualization and navigation of multiple simulation results in urban design
US20210150087A1