Histogram processing method, device and computer readable storage medium
By dividing each interval of the original histogram into multiple sub-intervals, processing incremental data and combining updated sub-intervals, the problem of slow processing of incremental data in the prior art is solved, and the rapid processing of incremental data is achieved effect.
Patent Information
- Application Number
- CN202210510889.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-11
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2042-05-11
AI Technical Summary
In the prior art, the method of processing incremental data of histograms is slower.
By dividing each interval of the original histogram into multiple sub-intervals, incremental data is obtained and filled into the corresponding sub-interval, the number of at least some sub-interval data changes, the updated sub-intervals are obtained, and then these sub-intervals are given. Combined to get the updated histogram.
By dividing cell intervals, the rapid processing of incremental data is achieved, and the processing speed is improved.
Smart Images

Figure CN114817859B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of histogram analysis, and in particular, to a histogram processing method, device, computer-readable storage medium, and processor. Background Art
[0002] The existing histogram analysis method analyzes incremental data by merging the newly added data on the original data partition and then constructing an equal-width histogram that is similar to the original histogram, which has a slow processing speed. Summary of the invention
[0003] The main purpose of the present application is to provide a histogram processing method, device, computer-readable storage medium and processor to solve the problem of slow processing speed of the prior art method for processing incremental data with histograms.
[0004] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a histogram processing method is provided, comprising: dividing each interval of the original histogram into multiple sub-intervals; obtaining incremental data, and filling the incremental data into the corresponding sub-intervals, so that the number of data in at least part of the sub-intervals changes, and obtaining updated sub-intervals; combining the updated sub-intervals to obtain an updated histogram, and the updated histogram has the same number of intervals as the original histogram.
[0005] Optionally, the updated sub-intervals are combined to obtain an updated histogram, including: combining multiple updated sub-intervals corresponding to each of the intervals of the original histogram into an updated interval; and using multiple updated intervals to form the updated histogram.
[0006] Optionally, the updated sub-intervals are combined to obtain an updated histogram, including: obtaining the data volume of each updated sub-interval; calculating the sum of the data volume of all updated sub-intervals to obtain the total data volume; dividing the total data volume into N equal parts in order of data from small to large, to obtain the updated histogram, wherein N is equal to the number of intervals of the original histogram.
[0007] Optionally, obtaining the data volume of each updated sub-interval includes: constructing a counter component; and using the counter component to obtain the data volume of each updated sub-interval.
[0008] Optionally, each interval of the original histogram is divided into a plurality of sub-intervals, including: obtaining the width of each interval of the original histogram and the amount of data in each interval; determining the number of sub-intervals corresponding to each interval according to the width of each interval and the amount of data in each interval; and dividing each interval of the original histogram into a plurality of sub-intervals in an ascending order of data according to the number of sub-intervals corresponding to each interval.
[0009] Optionally, filling the incremental data into the corresponding sub-interval includes: obtaining the numerical size of the incremental data; obtaining the minimum value and the maximum value of each sub-interval; determining the sub-interval where the incremental data is located based on the numerical size of the incremental data, the minimum value of each sub-interval and the maximum value of each sub-interval; and filling the incremental data into the corresponding sub-interval.
[0010] Optionally, the original histogram is used to represent the distribution of stock data.
[0011] According to another aspect of the present application, a histogram processing device is provided, including: a division unit, used to divide each interval of an original histogram into multiple sub-intervals; a processing unit, used to obtain incremental data, and fill the incremental data into the corresponding sub-intervals, so that the number of data in at least part of the sub-intervals changes, and updated sub-intervals are obtained; a combination unit, used to combine the updated sub-intervals to obtain an updated histogram, and the updated histogram has the same number of intervals as the original histogram.
[0012] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the methods described.
[0013] According to yet another aspect of the present application, a processor is provided, wherein the processor is used to run a program, wherein the program executes any one of the methods when it is run.
[0014] By applying the technical solution of the present application, each interval of the original histogram is first divided into multiple sub-intervals, and then incremental data is obtained, and the incremental data is filled into the corresponding sub-intervals, so that the number of data in at least part of the sub-intervals changes, and updated sub-intervals are obtained; finally, the updated sub-intervals are combined to obtain an updated histogram, and the updated histogram has the same number of intervals as the original histogram. That is, the rapid processing of incremental data is achieved by dividing the small intervals. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings constituting part of the present application are used to provide a further understanding of the present application. The exemplary embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0016] Figure 1 A flow chart of a histogram processing method according to an embodiment of the present application is shown;
[0017] Figure 2 A schematic diagram of a histogram processing device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0018] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0019] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0020] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0021] It should be understood that when an element (such as a layer, film, region, or substrate) is described as being "on" another element, the element may be directly on the other element, or there may be intermediate elements. Moreover, in the specification and claims, when an element is described as being "connected" to another element, the element may be "directly connected" to the other element, or "connected" to the other element through a third element.
[0022] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:
[0023] Histogram: Also known as mass distribution graph, it is a statistical report graph that represents the data distribution by a series of vertical stripes or line segments of varying heights. The horizontal axis generally represents the data type and the vertical axis represents the distribution. To construct a histogram, the first step is to segment the range of values, that is, to divide the entire range of values into a series of intervals, and then count how many values are in each interval. These values are usually specified as continuous, non-overlapping variable intervals. The intervals must be adjacent and are usually (but not necessarily) equal in size.
[0024] According to an embodiment of the present application, a histogram processing method is provided.
[0025] Figure 1 FIG. 1 is a flowchart of a method for processing a histogram according to an embodiment of the present application. Figure 1 As shown, the method comprises the following steps:
[0026] Step S101, dividing each interval of the original histogram into multiple sub-intervals;
[0027] Specifically, an interval of the original histogram refers to the width of a bar column. For example, the width of the second bar column is [5,10]. The idea of this solution is to first divide the large interval into smaller intervals, for example, divide [5,10] into [5,6](6,7](7,8](8,9](9,10].
[0028] Step S102, obtaining incremental data, and filling the incremental data into the corresponding sub-intervals, so that the number of data in at least part of the sub-intervals changes, and obtaining updated sub-intervals;
[0029] Step S103, combining the updated sub-intervals to obtain an updated histogram, wherein the updated histogram has the same number of intervals as the original histogram.
[0030] Specifically, the number of intervals of the updated histogram and the original histogram is the same, which means that the number of intervals of the finally displayed histogram is the same as the number of intervals of the original histogram. For example, the original histogram has 100 intervals, which is divided into 1000 sub-intervals, but after filling, it is finally represented by the updated histogram with 100 intervals, that is, the small sub-intervals are combined together.
[0031] In the above scheme, each interval of the original histogram is first divided into multiple sub-intervals, and then incremental data is obtained, and the incremental data is filled into the corresponding sub-intervals, so that the number of data in at least part of the sub-intervals changes, and updated sub-intervals are obtained; finally, the updated sub-intervals are combined to obtain an updated histogram, and the updated histogram has the same number of intervals as the original histogram. That is, the rapid processing of incremental data is achieved by dividing the small intervals.
[0032] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0033] In one embodiment of the present application, the updated sub-intervals are combined to obtain an updated histogram, including: combining the multiple updated sub-intervals corresponding to the intervals of the original histogram into an updated interval; using the multiple updated intervals to form the updated histogram. For example, the original histogram has ten intervals, each interval is divided into ten sub-intervals, and then the incremental data is filled into the corresponding sub-intervals, and then the ten changed sub-intervals are merged into a new interval, so that the width of the interval of the updated histogram is the same as that of the original histogram, but the number of data in at least some intervals has changed. The method of processing incremental data using this scheme is highly efficient and can ensure accuracy.
[0034] In another embodiment of the present application, the updated sub-intervals are combined to obtain an updated histogram, including: obtaining the data volume of each of the updated sub-intervals; calculating the sum of the data volume of all the updated sub-intervals to obtain the total data volume; dividing the total data volume into N equal parts in order of data from small to large to obtain the updated histogram, wherein N is equal to the number of intervals of the original histogram. This solution obtains the total data volume by calculating the sum of the data volume of all the updated sub-intervals; dividing the total data volume into N equal parts in order of data from small to large to obtain the updated histogram, so that the data volume in each interval in the obtained histogram is the same, that is, a equi-height histogram is formed.
[0035] In a specific embodiment of the present application, obtaining the data volume of each updated sub-interval includes: constructing a counter component; and using the counter component to obtain the data volume of each updated sub-interval. That is, the method of constructing a counter component can be used to accurately obtain the data volume of each updated sub-interval.
[0036] In one embodiment of the present application, each interval of the original histogram is divided into a plurality of sub-intervals, including: obtaining the width of each interval of the original histogram and the amount of data in each interval; determining the number of sub-intervals corresponding to each interval according to the width of each interval and the amount of data in each interval; and dividing each interval of the original histogram into a plurality of sub-intervals in the order of data from small to large according to the number of sub-intervals corresponding to each interval. Specifically, the number of sub-intervals corresponding to each interval can be determined according to the width of each interval and the amount of data in each interval. For example, when the amount of data in the interval is large, the number of sub-intervals can be appropriately increased. To ensure the processing speed of incremental data.
[0037] In another embodiment of the present application, filling the incremental data into the corresponding sub-interval includes: obtaining the numerical value of the incremental data; obtaining the minimum value and the maximum value of each sub-interval; determining the sub-interval where the incremental data is located according to the numerical value of the incremental data, the minimum value of each sub-interval and the maximum value of each sub-interval; and filling the incremental data into the corresponding sub-interval. That is, if the numerical value of the incremental data falls into the corresponding sub-interval, the incremental data is filled into the corresponding sub-interval.
[0038] In some embodiments, the original histogram is used to represent the distribution of stock data. That is, the original histogram is used to represent the distribution of stock data, and the incremental data is the data newly added on the basis of the stock data. The updated histogram is used to represent the distribution of the full data consisting of the stock data and the incremental data.
[0039] The embodiment of the present application also provides a histogram processing device. It should be noted that the histogram processing device of the embodiment of the present application can be used to execute the histogram processing method provided in the embodiment of the present application. The histogram processing device provided in the embodiment of the present application is introduced below.
[0040] Figure 2 is a schematic diagram of a histogram processing device according to an embodiment of the present application. Figure 2 As shown, the device comprises:
[0041] A division unit 10, used to divide each interval of the original histogram into a plurality of sub-intervals;
[0042] Specifically, an interval of the original histogram refers to the width of a bar column. For example, the width of the second bar column is [5,10]. The idea of this solution is to first divide the large interval into smaller intervals, for example, divide [5,10] into [5,6](6,7](7,8](8,9](9,10].
[0043] The processing unit 20 is used to obtain incremental data and fill the incremental data into the corresponding sub-intervals, so that the number of data in at least part of the sub-intervals changes, thereby obtaining updated sub-intervals;
[0044] The combining unit 30 is used to combine the updated sub-intervals to obtain an updated histogram, and the updated histogram has the same number of intervals as the original histogram.
[0045] Specifically, the number of intervals of the updated histogram and the original histogram is the same, which means that the number of intervals of the finally displayed histogram is the same as the number of intervals of the original histogram. For example, the original histogram has 100 intervals, which is divided into 1000 sub-intervals, but after filling, it is finally represented by the updated histogram with 100 intervals, that is, the small sub-intervals are combined together.
[0046] In the above scheme, the division unit divides each interval of the original histogram into multiple sub-intervals, the processing unit obtains incremental data, and fills the incremental data into the corresponding sub-intervals, so that the number of data in at least part of the sub-intervals changes, and an updated sub-interval is obtained; the combination unit combines the updated sub-intervals to obtain an updated histogram, and the updated histogram has the same number of intervals as the original histogram. That is, the rapid processing of incremental data is achieved by dividing the small intervals.
[0047] In one embodiment of the present application, the combination unit includes a combination module and a processing module. The combination module is used to combine the multiple updated sub-intervals corresponding to each of the above intervals of the above original histogram into an updated interval; the processing module is used to use the multiple updated intervals to form the above updated histogram. For example, the original histogram has ten intervals, each interval is divided into ten sub-intervals, and then the incremental data is filled into the corresponding sub-intervals, and then the ten changed sub-intervals are merged into a new interval, so that the width of the interval of the updated histogram is the same as that of the original histogram, but the number of data in at least some intervals has changed. The method of processing incremental data using this solution is highly efficient and can ensure accuracy.
[0048] In another embodiment of the present application, the combination unit includes a first acquisition module, a calculation module and a first division module, the first acquisition module is used to obtain the data volume of each of the above-mentioned updated sub-intervals; the calculation module is used to calculate the sum of the data volume of all the above-mentioned updated sub-intervals to obtain the total data volume; the first division module is used to divide the above-mentioned total data volume into N equal parts in the order of data from small to large, to obtain the above-mentioned updated histogram, wherein N is equal to the number of the above-mentioned intervals of the above-mentioned original histogram. This scheme obtains the total data volume by calculating the sum of the data volume of all the above-mentioned updated sub-intervals; and divides the above-mentioned total data volume into N equal parts in the order of data from small to large to obtain the above-mentioned updated histogram, so that the data volume in each interval in the obtained histogram is the same, that is, a kind of equal-height histogram is formed.
[0049] In a specific embodiment of the present application, the first acquisition module includes a construction submodule and an acquisition submodule, wherein the construction submodule is used to construct a counter component; and the acquisition submodule is used to use the counter component to obtain the data volume of each of the above updated subintervals. That is, the method of constructing a counter component can be used to accurately obtain the data volume of each of the above updated subintervals.
[0050] In one embodiment of the present application, the division unit includes a second acquisition module, a first determination module, and a second division module. The second acquisition module is used to obtain the width of each of the above intervals of the original histogram and the amount of data in each of the above intervals; the first determination module is used to determine the number of the above sub-intervals corresponding to each of the above intervals according to the width of each of the above intervals and the amount of data in each of the above intervals; the second division module is used to divide each interval of the original histogram into a plurality of the above sub-intervals according to the number of the above sub-intervals corresponding to each of the above intervals and in the order of data from small to large. That is, specifically, the number of the above sub-intervals corresponding to each of the above intervals can be determined according to the width of each of the above intervals and the amount of data in each of the above intervals. For example, when the amount of data in the interval is large, the number of sub-intervals can be appropriately increased. To ensure the processing speed of incremental data.
[0051] In another embodiment of the present application, the processing unit includes a third acquisition module, a fourth acquisition module, a second determination module and a filling module, wherein the third acquisition module is used to obtain the numerical value of the incremental data; the fourth acquisition module is used to obtain the minimum value and the maximum value of each of the above sub-intervals; the second determination module is used to determine the sub-interval where the incremental data is located according to the numerical value of the incremental data, the minimum value of each of the above sub-intervals and the maximum value of each of the above sub-intervals; and the filling module is used to fill the incremental data into the corresponding sub-interval. That is, if the numerical value of the incremental data falls into the corresponding sub-interval, the incremental data is filled into the corresponding sub-interval.
[0052] The above-mentioned histogram processing device includes a processor and a memory. The above-mentioned division unit, processing unit and combination unit are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0053] The processor includes a kernel, and the kernel calls the corresponding program unit from the memory. One or more kernels can be set, and the method of histogram processing incremental data can be improved by adjusting kernel parameters.
[0054] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0055] An embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the histogram processing method.
[0056] An embodiment of the present invention provides a processor, and the processor is used to run a program, wherein the histogram processing method is executed when the program is run.
[0057] An embodiment of the present invention provides a device, the device comprising a processor, a memory, and a program stored in the memory and executable on the processor, and when the processor executes the program, at least the following steps are implemented:
[0058] Step S101, dividing each interval of the original histogram into multiple sub-intervals;
[0059] Step S102, obtaining incremental data, and filling the incremental data into the corresponding sub-intervals, so that the number of data in at least part of the sub-intervals changes, and obtaining updated sub-intervals;
[0060] Step S103, combining the updated sub-intervals to obtain an updated histogram, wherein the updated histogram has the same number of intervals as the original histogram.
[0061] The devices in this article can be servers, PCs, PADs, mobile phones, etc.
[0062] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing at least the following method steps:
[0063] Step S101, dividing each interval of the original histogram into multiple sub-intervals;
[0064] Step S102, obtaining incremental data, and filling the incremental data into the corresponding sub-intervals, so that the number of data in at least part of the sub-intervals changes, and obtaining updated sub-intervals;
[0065] Step S103, combining the updated sub-intervals to obtain an updated histogram, wherein the updated histogram has the same number of intervals as the original histogram.
[0066] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0067] The present application is described 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 application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0068] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0069] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0070] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0071] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0072] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0073] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0074] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:
[0075] 1) The histogram processing method of the present application first divides each interval of the original histogram into multiple sub-intervals, then obtains incremental data, and fills the incremental data into the corresponding sub-intervals, so that the number of data in at least part of the sub-intervals changes, and obtains updated sub-intervals; finally, the updated sub-intervals are combined to obtain an updated histogram, and the updated histogram has the same number of intervals as the original histogram. That is, the rapid processing of incremental data is achieved by dividing the small intervals.
[0076] 2) In the histogram processing device of the present application, the division unit divides each interval of the original histogram into multiple sub-intervals, the processing unit obtains incremental data, and fills the incremental data into the corresponding sub-intervals, so that the number of data in at least part of the sub-intervals changes, and an updated sub-interval is obtained; the combination unit combines the updated sub-intervals to obtain an updated histogram, and the updated histogram has the same number of intervals as the original histogram. That is, the rapid processing of incremental data is achieved by dividing the small intervals.
[0077] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A histogram processing method, characterized in that: include: Divide each interval of the original histogram into multiple sub-intervals; Acquire incremental data, and fill the incremental data into the corresponding sub-intervals, so that the number of data in at least part of the sub-intervals changes, to obtain updated sub-intervals; Combining the updated sub-intervals to obtain an updated histogram, wherein the updated histogram has the same number of intervals as the original histogram; The original histogram is used to represent the distribution of stock data.
2. The method according to claim 1, characterized in that The updated sub-intervals are combined to obtain an updated histogram, including: Combining the multiple updated sub-intervals corresponding to each of the intervals of the original histogram into an updated interval; The updated histogram is constructed by using a plurality of the updated intervals.
3. The method according to claim 1, characterized in that The updated sub-intervals are combined to obtain an updated histogram, including: Acquire the data volume of each updated sub-interval; Calculate the sum of the data volumes of all the updated sub-intervals to obtain the total data volume; The total data volume is divided into N equal parts in order from small to large, to obtain the updated histogram, wherein N is equal to the number of intervals of the original histogram.
4. The method according to claim 3, characterized in that Obtaining the amount of data in each updated sub-interval includes: Build the counter component; The counter component is used to obtain the data volume of each updated sub-interval.
5. The method according to claim 1, characterized in that Divide each interval of the original histogram into multiple sub-intervals, including: Obtaining the width of each of the intervals of the original histogram and the amount of data in each of the intervals; Determining the number of the sub-intervals corresponding to each of the intervals according to the width of each of the intervals and the amount of data in each of the intervals; According to the number of the sub-intervals corresponding to each of the intervals, each interval of the original histogram is divided into a plurality of the sub-intervals in the order of data from small to large.
6. The method according to claim 1, characterized in that Filling the incremental data into the corresponding sub-interval includes: Obtaining the numerical value of the incremental data; Obtaining the minimum and maximum values of each of the subintervals; Determine the subinterval where the incremental data is located according to the numerical value of the incremental data, the minimum value of each subinterval and the maximum value of each subinterval; Fill the incremental data into the corresponding sub-interval.
7. A histogram processing device, characterized in that: include: A division unit, used for dividing each interval of the original histogram into a plurality of sub-intervals; A processing unit, configured to obtain incremental data, and fill the incremental data into the corresponding sub-intervals, so that the number of data in at least part of the sub-intervals changes, thereby obtaining updated sub-intervals; A combining unit, used for combining the updated sub-intervals to obtain an updated histogram, wherein the updated histogram has the same number of intervals as the original histogram; The original histogram is used to represent the distribution of stock data.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 6.
9. A processor, characterized in that: The processor is used to run a program, wherein the program executes the method according to any one of claims 1 to 6 when running.
Citation Information
Patent Citations
Variance optimization histogram construction method and device based on Spark Streaming
CN107193862A
Method for dynamic expansion of histogram
KR1020120100651A