Chart processing method and device, electronic device and storage medium
By calculating the correlation between time series data items and category values in the chart, the chart processing results are automatically generated, which solves the problems that require manual processing in the existing technology, and realizes automatic processing and efficiency improvement.
Patent Information
- Application Number
- CN202111221955.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-20
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2041-10-20
AI Technical Summary
The prior art cannot automatically mine key information in charts and generate relevant data conclusions, and it requires manual processing.
By obtaining the time series data in the chart, the correlation between the data items and the category values is calculated, and the chart processing results are generated based on the correlation, and automated processing is achieved.
Automatic mining of time series data in the chart is realized, and relevant data conclusions are generated, which reduces human intervention, saves processing time, and improves efficiency.
Smart Images

Figure CN114077628B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and more specifically, to a method and device for processing a chart, an electronic device, and a storage medium. Background Art
[0002] Charts are tabular or graphical displays of sequence data and play an important role in office work. Currently, chart software can automatically generate charts from sequence data, but manual processing of charts to generate data conclusions is still required. Summary of the invention
[0003] One purpose of the embodiments of the present disclosure is to provide a method and device for processing a chart, an electronic device, and a storage medium, which can automatically mine key information of a chart to generate relevant data conclusions.
[0004] According to a first aspect of the present disclosure, a method for processing a chart is provided. The method comprises:
[0005] Acquire a first target data sequence in the chart, where the first target data sequence is in time order;
[0006] Obtaining a first correlation, where the first correlation is a correlation between a data item of the first target data sequence and a category value corresponding to the data item of the first target data sequence;
[0007] According to the first correlation, a graph processing result related to the first correlation is output.
[0008] Optionally, before acquiring the first target data sequence in the chart, the method further includes:
[0009] Get the data series in the chart;
[0010] In a case where the category values corresponding to the data items of the data sequence represent time and the category values corresponding to the data items of the data sequence have an order relationship, the data sequence is determined to be the first target data sequence.
[0011] Optionally, when there are N first target time data sequences and there is a time order relationship between the N first target data sequences, N is an integer and N≥2, the method further includes:
[0012] Processing data items of an nth first target data sequence to obtain target data corresponding to an nth first target data sequence, wherein the nth first target data sequence is any one of the N first target data sequences;
[0013] According to the time sequence relationship between the N first target data sequences, the target data corresponding to the N first target data sequences are assigned category values as data items to construct a second target data sequence in time sequence;
[0014] Obtaining a second correlation, where the second correlation is a correlation between a data item of the second target data sequence and a category value corresponding to the data item of the second target data sequence;
[0015] According to the second correlation, a graph processing result corresponding to the second correlation is output.
[0016] Optionally, outputting a chart processing result corresponding to the first correlation according to the first correlation includes:
[0017] When the first correlation represents that a data item of the first target data sequence is positively correlated with a category value corresponding to the data item, determining a relationship between two adjacent data items in a sequential direction in the first target data sequence;
[0018] According to the relationship between two adjacent data items in the order direction in the first target data sequence, a chart processing result corresponding to the first correlation is generated.
[0019] Optionally, determining the relationship between two adjacent data items in the first target data sequence in a sequential direction includes: for two adjacent data items in the first target data sequence, calculating a growth rate of the latter data item relative to the former data item;
[0020] The method of generating a chart processing result corresponding to the first correlation based on the relationship between two adjacent data items in the sequential direction in the first target data sequence includes: determining whether the latter data item is negatively growing based on the growth rate of the latter data item relative to the former data item; and generating a chart processing result corresponding to the first correlation based on the number of data items with negative growth in the first target data sequence and the position of the data items with negative growth in the first target data sequence.
[0021] Optionally, outputting a chart processing result corresponding to the first correlation according to the first correlation includes:
[0022] When the first correlation represents that a data item of the first target data sequence is negatively correlated with a category value corresponding to the data item, determining a relationship between two adjacent data items in a sequential direction in the first target data sequence;
[0023] According to the relationship between two adjacent data items in the order direction in the first target data sequence, a chart processing result corresponding to the first correlation is generated.
[0024] Optionally, determining the relationship between two adjacent data items in the first target data sequence in a sequential direction includes: for two adjacent data items in the first target data sequence, calculating a growth rate of the latter data item relative to the former data item;
[0025] The method of generating a chart processing result corresponding to the first correlation based on the relationship between two adjacent data items in the sequential direction in the first target data sequence includes: determining whether the latter data item is positively growing based on the growth rate of the latter data item relative to the former data item; and generating a chart processing result corresponding to the first correlation based on the number of positively growing data items in the first target data sequence and the position of the positively growing data items in the first target data sequence.
[0026] Optionally, outputting a chart processing result corresponding to the first correlation according to the first correlation includes:
[0027] When the first correlation represents that the data items of the first target data sequence are unrelated to the category values corresponding to the data items, determining an average value of the data items of the first target data sequence and a maximum value and a minimum value among the data items of the first target data sequence;
[0028] Determine a first difference and a second difference, wherein the first difference is a difference between the maximum value and the average value, and the second difference is a difference between the average value and the minimum value;
[0029] When the first difference is greater than the second difference, outputting the category value corresponding to the maximum value;
[0030] When the first difference is smaller than the second difference, the category value corresponding to the minimum value is output.
[0031] Optionally, the method further comprises:
[0032] For two adjacent data items in the first target data sequence, calculating the growth rate of the latter data item relative to the former data item;
[0033] According to the growth rate of the latter data item relative to the former data item, determine whether the latter data item is growing positively or negatively;
[0034] According to the category values of the data items with positive growth and the category values of the data items with negative growth, the corresponding chart processing results are output.
[0035] According to a second aspect of the present disclosure, a diagram processing device is provided. The device comprises:
[0036] A first acquisition module is used to acquire a first target data sequence in the chart, where the first target data sequence is in time order;
[0037] A second acquisition module, configured to obtain a first correlation, where the first correlation is a correlation between a data item of the first target data sequence and a category value corresponding to the data item of the first target data sequence;
[0038] An output module is used to output a chart processing result related to the first correlation according to the first correlation.
[0039] According to a third aspect of the present disclosure, an electronic device is further provided, comprising a memory and a processor, wherein the memory is used to store a computer program; and the processor is used to execute the computer program to implement the method of the first aspect of the present disclosure.
[0040] According to a fourth aspect of the present disclosure, a computer-readable storage medium is further provided, on which a computer program is stored. When the computer program is executed by a processor, the method of the first aspect of the present disclosure is implemented.
[0041] The chart processing method and device, electronic device and storage medium of the embodiments of the present disclosure can mine key information and generate relevant data conclusions for data sequences with time as the axis in the chart without excessive human intervention, thereby realizing the automation of chart processing, saving chart processing time and bringing convenience to users.
[0042] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can also be obtained based on these drawings without creative work.
[0044] Figure 1 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure and can be used to implement an embodiment of the present disclosure;
[0045] Figure 2-8 A flowchart showing a method for processing a chart provided by an embodiment of the present disclosure is shown;
[0046] Figure 9-10 A schematic diagram showing a chart provided by an embodiment of the present disclosure;
[0047] Fig.11 A schematic diagram of a diagram processing device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0048] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless otherwise specifically stated.
[0049] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.
[0050] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.
[0051] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0052] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0053] <Hardware Configuration>
[0054] Figure 1 The electronic device can be used to implement the diagram processing method of the embodiment of the present disclosure.
[0055] The electronic device 1000 can be a smart phone, a portable computer, a desktop computer, a tablet computer, a server, etc., which is not limited here.
[0056] The electronic device 1000 may include, but is not limited to, a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, a speaker 1700, a microphone 1800, and the like. Among them, the processor 1100 may be a central processing unit CPU, a graphics processing unit GPU, a microprocessor MCU, and the like, and is used to execute a computer program / instruction, which may be written in an instruction set of an architecture such as x86, Arm, RISC, MIPS, SSE, and the like. The memory 1200 may include, for example, a ROM (read-only memory), a RAM (random access memory), a non-volatile memory such as a hard disk, and the like. The interface device 1300 may include, for example, a USB interface, a serial interface, a parallel interface, and the like. The communication device 1400 may, for example, be capable of wired communication using an optical fiber or a cable, or wireless communication, and may specifically include WiFi communication, Bluetooth communication, 2G / 3G / 4G / 5G communication, and the like. The display device 1500 may be, for example, a liquid crystal display screen, a touch display screen, and the like. The input device 1600 may, for example, include a touch screen, a keyboard, a somatosensory input, and the like. The speaker 1700 is used to output audio signals. The microphone 1800 is used to collect audio signals.
[0057] As used in the embodiments of the present disclosure, the memory 1200 of the electronic device 1000 is used to store a computer program / instruction, which is used to control the processor 1100 to operate to implement the chart processing method according to the embodiments of the present disclosure. The technician can design the computer program / instruction according to the scheme disclosed in the present disclosure. How the computer program / instruction controls the processor to operate is well known in the art, so it will not be described in detail here. The electronic device 1000 can be installed with an intelligent operating system (such as Windows, Linux, Android, IOS, etc.) and application software.
[0058] It should be understood by those skilled in the art that although Figure 1 , multiple devices of the electronic device 1000 are shown; however, the electronic device 1000 of the embodiment of the present disclosure may only involve some of the devices, for example, only the processor 1100 and the memory 1200.
[0059] Fig. 9 and Fig.10 is a chart corresponding to the same source data, where Fig. 9 The graphical form of the chart is shown. Fig.10 The table form of the chart is shown. The chart includes multiple data series, among which, Fig. 9 and Fig.10Only one of the data sequences is shown, which is {9700,109267,6800,20864,17602,68028,27400,5000,92855,27400,15650,15520,32450}, which is a total of 13 data items. The category values corresponding to the data items represent time. For example, the category value "1" represents "February 8", and the category value "2" represents "February 11", etc.
[0060] Combine the following Fig. 9 and Fig.10 , see Figure 3 As shown, a method for processing a chart provided by an embodiment of the present disclosure is described, and the method includes steps S102-S106.
[0061] Step S102: Acquire a first target data sequence in the chart, where the first target data sequence is in time order.
[0062] In one example, before step S102, a process of determining a first target sequence in the chart is also included. First, each data sequence in the chart is obtained. When the category values corresponding to the data items of the data sequence represent time and the category values corresponding to the data items of the data sequence have a sequential relationship, the data sequence is determined as the first target data sequence.
[0063] Reference Fig. 9 and Fig.10 In the data sequence shown, the 13 category values corresponding to the 13 data items are "1", "2", ..., "13", there is a sequential relationship between the category values, and the category values represent time. It can be determined that the data sequence is a time sequence, and the data sequence can be determined as the first target sequence.
[0064] In one example, determining whether the data sequence is a time sequence includes: obtaining a graph type corresponding to the data sequence. When the graph type corresponding to the data sequence is a line graph, determining that the data sequence is a time sequence.
[0065] Step S104: Obtain a first correlation, where the first correlation is a correlation between a data item of the first target data sequence and a category value corresponding to the data item of the first target data sequence.
[0066] In one example, a correlation coefficient between a data item of the first target data sequence and a category value corresponding to the data item can be calculated, and whether the data item of the first target data sequence and its category value are positively correlated, negatively correlated, or uncorrelated can be determined based on the correlation coefficient. Correlation refers to the degree of association between two variables, where the two variables are the data item of the first target data sequence and the category value corresponding to the data item of the first target data sequence.
[0067] In one example, the correlation coefficient takes a value between -1 and 1, 0 indicates no correlation, the larger the absolute value of the correlation coefficient, the larger the first correlation, the positive value tends to be positively correlated, and the negative value tends to be negatively correlated. In one example, the correlation coefficient can be the covariance between the data item of the first target data sequence and the category value corresponding to the data item. Covariance can reflect the synergistic relationship between the two variables X and Y, that is, whether the change trends of the two variables are consistent. If variable X increases and variable Y also increases at the same time, it means that the two variables change in the same direction, and the covariance is positive. If variable X increases and variable Y decreases at the same time, it means that the two variables change in the opposite direction, and the covariance is negative. In this example, the data item of the first target data sequence is used as variable X, and the corresponding category value is used as variable Y, and the covariance between the two is calculated.
[0068] In one example, if the first correlation coefficient between the data item of the data sequence and the category value corresponding to the data item is greater than a positive threshold, it is determined that the data item of the data sequence and the category value corresponding to the data item are positively correlated. The positive threshold is, for example, 0.7.
[0069] In one example, if the first correlation coefficient between the data item of the data sequence and the category value corresponding to the data item is less than a negative threshold, it is determined that the data item of the data sequence and the category value corresponding to the data item are negatively correlated. The negative threshold is, for example, -0.7.
[0070] In one example, if the first correlation coefficient between the data item of the data sequence and the category value corresponding to the data item is less than or equal to a positive threshold and greater than or equal to a negative threshold, it is determined that the data item of the data sequence and the category value corresponding to the data item are uncorrelated. The positive threshold is, for example, 0.7, and the negative threshold is, for example, -0.7, that is, if the first correlation coefficient is less than or equal to 0.7 and greater than or equal to -0.7, it is determined that the data item of the data sequence and the category value corresponding to the data item are uncorrelated.
[0071] Step S106: outputting a chart processing result related to the first correlation according to the first correlation.
[0072] The following is an example of step S106:
[0073] In one example, see Figure 4 As shown, step S106 includes steps S402-S404.
[0074] Step S402: when the first correlation characterizes that a data item of the first target data sequence is positively correlated with a category value corresponding to the data item, determine the relationship between two adjacent data items in the order direction in the first target data sequence.
[0075] Step S404: Generate a chart processing result corresponding to the first correlation according to the relationship between two adjacent data items in the order direction in the first target data sequence.
[0076] In step S402, determining the relationship between two adjacent data items in the order direction in the first target data sequence may include: for two adjacent data items in the first target data sequence, calculating the growth rate of the latter data item relative to the former data item.
[0077] For the i-th data item in the first target data sequence, K i =(S i -S i-1 ) / S i-1 , where S i is the i-th data item in the first target data sequence, S i-1 is the i-1th data item in the first target data sequence, i is an integer and i≥2. i-1 and S i Adjacent in the order direction, K i is the growth rate of the i-th data item in the first target data sequence relative to the i-1-th data item.
[0078] In step S404, based on the relationship between two adjacent data items in the sequential direction in the first target data sequence, a chart processing result corresponding to the first correlation is generated, which may include: determining whether the latter data item is negatively growing based on the growth rate of the latter data item relative to the previous data item; and generating a chart processing result corresponding to the first correlation based on the number of data items with negative growth in the first target data sequence and the position of the data items with negative growth in the first target data sequence.
[0079] If K i is a positive value, determine the i-th data item S i is positive growth. If K i is a negative value, determine the i-th data item S i It is negative growth.
[0080] According to the number of negatively growing data items in the first target data sequence and the positions of the negatively growing data items in the first target data sequence, a chart processing result corresponding to the first correlation is generated, for example, it may be:
[0081] If the number of negatively growing data items in the first target data sequence is zero, the generated chart processing conclusion is: steady growth.
[0082] If the number of data items with negative growth in the first target data sequence is 1 and the only data item with negative growth is the last data item of the first target data sequence, the generated chart processing conclusion includes: overall growth but a slight slowdown in the recent growth rate.
[0083] If the number of negatively growing data items in the first target data sequence is 1, and assuming that the time represented by the category value corresponding to the unique data item is T11, the generated chart processing conclusion includes: except for a decline at time T11, the other times continue to grow.
[0084] If the number of data items with negative growth in the first target data sequence is greater than or equal to 1, select the data item with the smallest growth rate. Assuming that the time represented by the category value corresponding to the data item with the smallest growth rate is T12, the generated chart processing conclusion includes: the fastest decline at time T12.
[0085] For the data series with time as the axis in the chart, the chart processing method in the above example can be used to mine key information and generate relevant data conclusions without too much human intervention, thus realizing the automation of chart processing, saving chart processing time and bringing convenience to users.
[0086] In one example, see Figure 5 As shown, step S106 includes steps S502-S504.
[0087] Step S502: when the first correlation characterizes that a data item of the first target data sequence is negatively correlated with a category value corresponding to the data item, determine the relationship between two adjacent data items in the order direction in the first target data sequence.
[0088] Step S504: Generate a chart processing result corresponding to the first correlation according to the relationship between two adjacent data items in the order direction in the first target data sequence.
[0089] In step S502, determining the relationship between two adjacent data items in the order direction in the first target data sequence may include: for two adjacent data items in the first target data sequence, calculating the growth rate of the latter data item relative to the former data item.
[0090] For the i-th data item in the first target data sequence, K i =(S i -S i-1 ) / S i-1 , where S i is the i-th data item in the first target data sequence, S i-1 is the i-1th data item in the first target data sequence, i is an integer and i≥2. i-1 and Si Adjacent in the order direction, K i is the growth rate of the i-th data item in the first target data sequence relative to the i-1-th data item.
[0091] In step S504, based on the relationship between two adjacent data items in the sequential direction in the first target data sequence, a chart processing result corresponding to the first correlation is generated, which may include: determining whether the latter data item is positively growing based on the growth rate of the latter data item relative to the previous data item; and generating a chart processing result corresponding to the first correlation based on the number of positively growing data items in the first target data sequence and the position of the positively growing data items in the first target data sequence.
[0092] If K i is a positive value, determine the i-th data item S i is positive growth. If K i is a negative value, determine the i-th data item S i It is negative growth.
[0093] According to the number of positively increasing data items in the first target data sequence and the positions of the positively increasing data items in the first target data sequence, a chart processing result corresponding to the first correlation is generated, for example, it may be:
[0094] If the number of positively increasing data items in the first target data sequence is zero, the generated chart processing conclusion includes: steadily decreasing.
[0095] If the number of positively increasing data items in the first target data sequence is 1 and the only positively increasing data item is the last data item of the first target data sequence, the generated chart processing conclusion includes: an overall decrease but a slightly slower decrease rate in the recent period.
[0096] If the number of positively increasing data items in the first target data sequence is 1, and assuming that the time represented by the category value corresponding to the unique data item is T21, the generated chart processing conclusion includes: except for the growth at time T21, the other times continue to decline.
[0097] If the number of positively growing data items in the first target data sequence is greater than or equal to 1, select the data item with the largest growth rate. Assuming that the time represented by the category value corresponding to the data item with the largest growth rate is T22, the generated chart processing conclusion includes: the fastest growth is at time T22.
[0098] For the data series in the chart with time as the axis, the chart processing method in the above example can be used to mine key information and generate relevant data conclusions without too much human intervention, thus realizing the automation of chart processing, saving chart processing time and bringing convenience to users.
[0099] In one example, see Figure 6 As shown, step S106 includes steps S602-S606.
[0100] Step S602: when the first correlation characterizes that the data items of the first target data sequence are irrelevant to the category values corresponding to the data items, determine the average value of the data items of the first target data sequence and the maximum value and the minimum value of the data items of the first target data sequence.
[0101] Step S604: determine a first difference and a second difference, the first difference being the difference between the maximum value and the average value, and the second difference being the difference between the average value and the minimum value.
[0102] Step S606: When the first difference is greater than the second difference, the category value corresponding to the maximum value is output. When the first difference is less than the second difference, the category value corresponding to the minimum value is output.
[0103] For example, when the first difference is greater than the second difference, the category value corresponding to the maximum value is output. Assuming that the category value corresponding to the maximum value is time T31, the generated chart processing result includes: the maximum value at time T31.
[0104] For example, when the first difference is smaller than the second difference, the category value corresponding to the minimum value is time T32, and the generated chart processing result includes: the minimum value at time T32.
[0105] For the data series in the chart with time as the axis, the chart processing method in the above example can be used to mine key information and generate relevant data conclusions without too much human intervention, thus realizing the automation of chart processing, saving chart processing time and bringing convenience to users.
[0106] See also Figure 7 As shown, the method for processing a chart may further include steps S702-S706.
[0107] Step S702: For two adjacent data items in the first target data sequence, calculate the growth rate of the latter data item relative to the former data item.
[0108] In step S702, for the i-th data item in the first target data sequence, K i =(S i -S i-1 ) / S i-1 , where S i is the i-th data item in the first target data sequence, S i-1 is the i-1th data item in the first target data sequence, i is an integer and i≥2. i-1 and S iAdjacent in the order direction, K i is the growth rate of the i-th data item in the first target data sequence relative to the i-1-th data item.
[0109] Step S704: Determine whether the subsequent data item is growing positively or negatively based on the growth rate of the subsequent data item relative to the previous data item.
[0110] In step S704, based on the relationship between two adjacent data items in the sequential direction in the first target data sequence, a chart processing result corresponding to the first correlation is generated, which may include: determining whether the latter data item is negatively growing based on the growth rate of the latter data item relative to the previous data item; and generating a chart processing result corresponding to the first correlation based on the number of data items with negative growth in the first target data sequence and the position of the data items with negative growth in the first target data sequence.
[0111] If K i is a positive value, determine the i-th data item S i is positive growth. If K i is a negative value, determine the i-th data item S i It is negative growth.
[0112] Step S706: Output corresponding chart processing results according to the category values of the collected positive-growth data items and the category values of the collected negative-growth data items.
[0113] In step S706, the data are aggregated for classification processing and the same type is collected; according to the category value of the aggregated positive growth data item, the category values of all the positive growth data items calculated above can be arranged in chronological order or other order, and the category value of at least one positive growth data item whose order is continuous and uninterrupted is taken as a collection data. After arranging all the collected data, the processing result corresponding to the category value of the positive growth data item is output, and the processing result can be described as the total number of positive growth times and time periods in this chart processing; similarly, the category value of the aggregated negative growth data item can be the category value of all the negative growth data items calculated above, which is arranged in chronological order or other order. The data are arranged in time sequence or other sequences, and the category value of at least one data item with continuous and uninterrupted negative growth is taken as a collection data. After sorting out all the collection data, the processing result corresponding to the category value of the data item with negative growth is output. The processing result can be described as the total number of negative growth times and time periods in this chart processing; further, combined with the total number of positive growth times and time periods and the total number of negative growth times and time periods, the corresponding overall processing result of the chart can be output as the comparison result of the number of positive growth times relative to the number of negative growth times, the length of the positive growth time period relative to the length of the negative growth time period, and the length of the time period is the sum of the time of all time periods.
[0114] See also Figure 8 As shown, when there are N first target time data sequences and there is a time sequence relationship between the N first target data sequences (the N first target data sequences may belong to the same chart or multiple charts), N is an integer and N≥2, the method may include steps S802-S808.
[0115] Step S802: Process the data items of the nth first target data sequence to obtain target data corresponding to the nth first target data sequence, where the nth first target data sequence is any one of the N first target data sequences.
[0116] The target data corresponding to the first target data sequence is data determined based on the data items in the first target data sequence. For example, the target data corresponding to the first target data sequence may be the average value of all the data items in the first target data sequence. For example, the target data corresponding to the first target data sequence may be the maximum value of all the data items in the first target data sequence. For example, the target data corresponding to the first target data sequence may be the minimum value of all the data items in the first target data sequence. For example, the target data corresponding to the first target data sequence may be the difference between the maximum value and the minimum value.
[0117] Step S804: according to the time sequence relationship between the N first target data sequences, the target data corresponding to the N first target data sequences are assigned category values as data items to construct a second target data sequence in time sequence.
[0118] The time sequence relationship between the N first target data sequences can be determined according to the time range corresponding to the first target data sequences. For example, if the time range corresponding to the first first target data sequence is the first half of the year, and the time range corresponding to the second first target data sequence is the second half of the year, then the time sequence relationship between the two is that the first first target data sequence is in front and the second first target data sequence is in the back.
[0119] The target data corresponding to the N first target data sequences are taken as N new data items, and these new data items are arranged into a new sequence according to the time sequence relationship between the N first target data sequences. Category values are assigned to the data items in the new sequence so that the category values corresponding to the data items in the new sequence have a sequence relationship, thereby obtaining a second target data sequence in time sequence.
[0120] Step S806: Obtain a second correlation, where the second correlation is the correlation between the data items of the second target data sequence and the category values corresponding to the data items of the second target data sequence.
[0121] Step S808: According to the second correlation, output a chart processing result corresponding to the second correlation.
[0122] In this example, if there are multiple first target time data sequences and there is a time order relationship between these first target data sequences, the target data corresponding to these first target data sequences are assigned category values as data items to construct a second target data sequence in time order. Then, through steps S806-S808, based on a similar method to the aforementioned steps 104-S106, the chart processing result for the second target data sequence is output.
[0123] In this example, a comprehensive analysis can be performed on multiple time-based data series in the chart, and the relationships between the multiple time-based data series can be mined to generate relevant data conclusions. This does not require much human intervention, and the chart processing is automated, saving chart processing time and bringing convenience to users.
[0124] See also Fig.11 As shown, in this embodiment, a diagram processing device is also provided. The diagram processing device 20 includes the following modules:
[0125] The first acquisition module 21 is used to acquire a first target data sequence in the chart, where the first target data sequence is in time order.
[0126] The second acquisition module 22 is used to obtain a first correlation, where the first correlation is a correlation between a data item of the first target data sequence and a category value corresponding to the data item of the first target data sequence.
[0127] The first output module 23 is used to output a chart processing result related to the first correlation according to the first correlation.
[0128] In one example, the diagram processing device further includes a determination module.
[0129] A determination module is used to obtain a data sequence in a chart; when the category values corresponding to the data items of the data sequence represent time and the category values corresponding to the data items of the data sequence have an order relationship, determine that the data sequence is a first target data sequence.
[0130] In one example, the chart processing device further includes a first processing module, a construction module, a third acquisition module, and a second output module.
[0131] The first processing module is used to process the data items of the nth first target data sequence to obtain the target data corresponding to the nth first target data sequence when there are N first target time data sequences and there is a time order relationship between the N first target data sequences, N is an integer and N≥2, and the nth first target data sequence is any one of the N first target data sequences.
[0132] A construction module is used to assign category values to the target data corresponding to the N first target data sequences as data items according to the time sequence relationship between the N first target data sequences to construct a second target data sequence in time order.
[0133] The third acquisition module is used to obtain a second correlation, where the second correlation is a correlation between a data item of the second target data sequence and a category value corresponding to the data item of the second target data sequence.
[0134] The second output module is used to output a chart processing result corresponding to the second correlation according to the second correlation.
[0135] In one example, based on the first correlation, a chart processing result corresponding to the first correlation is output, including: determining the relationship between two adjacent data items in the sequential direction of the first target data sequence when the first correlation represents that the data items of the first target data sequence are positively correlated with the category values corresponding to the data items; generating a chart processing result corresponding to the first correlation based on the relationship between two adjacent data items in the sequential direction of the first target data sequence.
[0136] In this example, determining the relationship between two adjacent data items in the order direction in the first target data sequence includes: for two adjacent data items in the first target data sequence, calculating the growth rate of the latter data item relative to the former data item. Generating a chart processing result corresponding to the first correlation based on the relationship between two adjacent data items in the order direction in the first target data sequence includes: determining whether the latter data item is negative growth based on the growth rate of the latter data item relative to the former data item; generating a chart processing result corresponding to the first correlation based on the number of negative growth data items in the first target data sequence and the position of the negative growth data items in the first target data sequence.
[0137] In one example, based on the first correlation, a chart processing result corresponding to the first correlation is output, including: determining the relationship between two adjacent data items in the sequence direction in the first target data sequence when the first correlation represents that the data items of the first target data sequence are negatively correlated with the category values corresponding to the data items; generating a chart processing result corresponding to the first correlation based on the relationship between two adjacent data items in the sequence direction in the first target data sequence.
[0138] In this example, determining the relationship between two adjacent data items in the first target data sequence in the order direction includes: for two adjacent data items in the first target data sequence, calculating the growth rate of the latter data item relative to the former data item. Generating a chart processing result corresponding to the first correlation based on the relationship between two adjacent data items in the order direction in the first target data sequence includes: determining whether the latter data item is positively growing based on the growth rate of the latter data item relative to the former data item; generating a chart processing result corresponding to the first correlation based on the number of positively growing data items in the first target data sequence and the position of the positively growing data items in the first target data sequence.
[0139] In one example, based on the first correlation, a chart processing result corresponding to the first correlation is output, including: when the first correlation characterizes that the data items of the first target data sequence are irrelevant to the category values corresponding to the data items, determining the average value of the data items of the first target data sequence and the maximum and minimum values in the data items of the first target data sequence; determining a first difference and a second difference, the first difference being the difference between the maximum value and the average value, and the second difference being the difference between the average value and the minimum value; when the first difference is greater than the second difference, outputting the category value corresponding to the maximum value; when the first difference is less than the second difference, outputting the category value corresponding to the minimum value.
[0140] In one example, the diagram processing device further includes a second processing module and a third output module.
[0141] The second processing module is used to calculate the growth rate of the latter data item relative to the previous data item for two adjacent data items in the first target data sequence; and determine whether the latter data item is positively growing or negatively growing according to the growth rate of the latter data item relative to the previous data item.
[0142] The third output module is used to output corresponding chart processing results according to the category values of the positively growing data items and the category values of the negatively growing data items.
[0143] This embodiment also provides an electronic device, which includes a memory and a processor, wherein the memory is used to store a computer program; and the processor is used to execute the computer program to implement the method for processing a chart according to the first aspect of the present disclosure.
[0144] This embodiment also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method for processing a chart according to the first aspect of the present disclosure is implemented.
[0145] In this embodiment, an electronic device is also provided. The electronic device includes a memory and a processor. The memory is used to store a computer program; the processor is used to execute the computer program to implement the chart processing method provided in any of the above embodiments.
[0146] In this embodiment, a computer-readable storage medium is further provided. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for processing a chart provided in any of the above embodiments is implemented.
[0147] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the server embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0148] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0149] The present invention may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.
[0150] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
[0151] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0152] The computer program instructions for performing the operation of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present invention.
[0153] Various aspects of the present invention are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0154] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0155] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0156] The flowchart and block diagram in the accompanying drawings show the possible architecture, functions and operations of the system, method and computer program product according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of an instruction, and a part of a module, a program segment or an instruction contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of the boxes in the block diagram and / or the flowchart can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that it is equivalent to implement it by hardware, implement it by software, and implement it by combining software and hardware.
[0157] Embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the marketplace, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the present invention is defined by the appended claims.
Claims
1. A method for processing a chart, characterized in that: The method comprises: Acquire a first target data sequence in the chart, where the first target data sequence is in time order; Obtaining a first correlation, where the first correlation is a correlation between a data item of the first target data sequence and a category value corresponding to the data item of the first target data sequence; outputting a chart processing result related to the first correlation according to the first correlation; Outputting a chart processing result corresponding to the first correlation according to the first correlation includes: In the case where the first correlation represents that the data item of the first target data sequence is positively correlated with the category value corresponding to the data item, determining the relationship between two adjacent data items in the first target data sequence in the order direction; generating a chart processing result corresponding to the first correlation according to the relationship between two adjacent data items in the order direction in the first target data sequence; or In the case where the first correlation represents that the data item of the first target data sequence is negatively correlated with the category value corresponding to the data item, determining the relationship between two adjacent data items in the order direction in the first target data sequence; generating a chart processing result corresponding to the first correlation according to the relationship between two adjacent data items in the order direction in the first target data sequence; or In a case where the first correlation characterizes that the data items of the first target data sequence are irrelevant to the category values corresponding to the data items, determine the average value of the data items of the first target data sequence and the maximum and minimum values in the data items of the first target data sequence; determine a first difference and a second difference, the first difference being the difference between the maximum value and the average value, and the second difference being the difference between the average value and the minimum value; in a case where the first difference is greater than the second difference, output the category value corresponding to the maximum value; in a case where the first difference is less than the second difference, output the category value corresponding to the minimum value.
2. The method according to claim 1, characterized in that Before acquiring the first target data sequence in the chart, the method further includes: Get the data series in the chart; In a case where the category values corresponding to the data items of the data sequence represent time and the category values corresponding to the data items of the data sequence have an order relationship, the data sequence is determined to be the first target data sequence.
3. The method according to claim 1, characterized in that In the case where there are N first target time data sequences and there is a time order relationship between the N first target data sequences, N is an integer and N≥2, the method further includes: Processing data items of an nth first target data sequence to obtain target data corresponding to an nth first target data sequence, wherein the nth first target data sequence is any one of the N first target data sequences; According to the time sequence relationship between the N first target data sequences, the target data corresponding to the N first target data sequences are assigned category values as data items to construct a second target data sequence in time sequence; Obtaining a second correlation, where the second correlation is a correlation between a data item of the second target data sequence and a category value corresponding to the data item of the second target data sequence; According to the second correlation, a graph processing result corresponding to the second correlation is output.
4. The method according to claim 1, characterized in that The determining the relationship between two adjacent data items in the order direction in the first target data sequence includes: for two adjacent data items in the first target data sequence, calculating the growth rate of the latter data item relative to the former data item; The method of generating a chart processing result corresponding to the first correlation based on the relationship between two adjacent data items in the sequential direction in the first target data sequence includes: determining whether the latter data item is negatively growing based on the growth rate of the latter data item relative to the former data item; and generating a chart processing result corresponding to the first correlation based on the number of data items with negative growth in the first target data sequence and the position of the data items with negative growth in the first target data sequence.
5. The method according to claim 1, characterized in that The determining the relationship between two adjacent data items in the order direction in the first target data sequence includes: for two adjacent data items in the first target data sequence, calculating the growth rate of the latter data item relative to the former data item; The method of generating a chart processing result corresponding to the first correlation based on the relationship between two adjacent data items in the sequential direction in the first target data sequence includes: determining whether the latter data item is positively growing based on the growth rate of the latter data item relative to the former data item; and generating a chart processing result corresponding to the first correlation based on the number of positively growing data items in the first target data sequence and the position of the positively growing data items in the first target data sequence.
6. The method according to claim 1, characterized in that The method further comprises: For two adjacent data items in the first target data sequence, calculating the growth rate of the latter data item relative to the former data item; According to the growth rate of the latter data item relative to the former data item, determine whether the latter data item is growing positively or negatively; According to the category values of the collected positive-growth data items and the category values of the collected negative-growth data items, the corresponding chart processing results are output.
7. A diagram processing device, characterized in that: include: A first acquisition module is used to acquire a first target data sequence in the chart, where the first target data sequence is in time order; A second acquisition module, configured to obtain a first correlation, where the first correlation is a correlation between a data item of the first target data sequence and a category value corresponding to the data item of the first target data sequence; an output module, configured to output a chart processing result related to the first correlation according to the first correlation; Wherein, the output module is specifically used for: In the case where the first correlation represents that the data item of the first target data sequence is positively correlated with the category value corresponding to the data item, determining the relationship between two adjacent data items in the first target data sequence in the order direction; generating a chart processing result corresponding to the first correlation according to the relationship between two adjacent data items in the order direction in the first target data sequence; or In the case where the first correlation represents that the data item of the first target data sequence is negatively correlated with the category value corresponding to the data item, determining the relationship between two adjacent data items in the order direction in the first target data sequence; generating a chart processing result corresponding to the first correlation according to the relationship between two adjacent data items in the order direction in the first target data sequence; or In a case where the first correlation characterizes that the data items of the first target data sequence are irrelevant to the category values corresponding to the data items, determine the average value of the data items of the first target data sequence and the maximum and minimum values in the data items of the first target data sequence; determine a first difference and a second difference, the first difference being the difference between the maximum value and the average value, and the second difference being the difference between the average value and the minimum value; in a case where the first difference is greater than the second difference, output the category value corresponding to the maximum value; in a case where the first difference is less than the second difference, output the category value corresponding to the minimum value.
8. An electronic device comprising a memory and a processor, wherein the memory is used to store a computer program; and the processor is used to execute the computer program to implement 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 a computer program, and when the computer program is executed by a processor, the computer program implements the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Generating charts from data in a data table
CN109643329A