WO2018161403A1 - Data statistics method and system for report forms - Google Patents

Data statistics method and system for report forms Download PDF

Info

Publication number
WO2018161403A1
WO2018161403A1 PCT/CN2017/080129 CN2017080129W WO2018161403A1 WO 2018161403 A1 WO2018161403 A1 WO 2018161403A1 CN 2017080129 W CN2017080129 W CN 2017080129W WO 2018161403 A1 WO2018161403 A1 WO 2018161403A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
report
object attribute
sequential
result
Prior art date
Application number
PCT/CN2017/080129
Other languages
French (fr)
Chinese (zh)
Inventor
黄驰
熊娅娟
袁也
刘新奇
曾昭志
Original Assignee
深圳市科脉技术股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市科脉技术股份有限公司 filed Critical 深圳市科脉技术股份有限公司
Publication of WO2018161403A1 publication Critical patent/WO2018161403A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2462Approximate or statistical queries

Abstract

The invention provides a data statistics method and system for report forms and relates to the technical field of report forms. The method comprises following steps: obtaining report form data information, wherein the report form data information comprises object properties and corresponding data of the object properties (S101); sequencing the data corresponding to the object properties according to the object properties to obtain a sequential data set, wherein the data of the same object property are arranged next to each other (S102); and calculating the data in the sequential data set to obtain a calculation result (S103). According to the invention, a statistics algorithm of sequencing firstly and then generalizing is used so as to increase the statistics efficiency of memory data.

Description

报表的数据统计方法和系统Report data statistics method and system
本申请要求于2017年03月10日提交中国专利局的申请号为CN201710145193.3、名称为“报表的数据统计方法和系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. CN201710145193.3, entitled "Data Statistics Method and System for Reports", filed on March 10, 2017, the entire contents of which is incorporated herein by reference. in.
技术领域Technical field
本发明涉及报表技术领域,尤其是涉及报表的数据统计方法和系统。The present invention relates to the field of report technology, and in particular, to a data statistics method and system for a report.
背景技术Background technique
在报表中,通常需要统计同一对象属性的所有数据,例如,将同一对象属性的所有数值累加进行统计。但是,在数据库中,每一个数据都是单独保存的,因此,在统计的过程中,每个数据都需要先在内存中进行分组计算,以得到统计结果。现有技术中,对于内存中的原始数据,采用的统计方法为:先将第1个数据保存下来;将第2个数据与第1个数据比较,如果两者属于不同的对象属性,则将第2个数据单独保存下来;将第3个数据与第1个数据比较,如果为不同对象属性,再与第2个数据比较,如果为相同对象属性,则将第3个数据与第2个数据累加并保存,以此类推,将每个数据与它前面所有保存数据进行比较,直至所有数据处理完毕。In a report, it is often necessary to count all data for the same object attribute, for example, to accumulate all the values of the same object attribute for statistics. However, in the database, each data is saved separately. Therefore, in the process of statistics, each data needs to be grouped and calculated in memory to obtain statistical results. In the prior art, for the original data in the memory, the statistical method is: first save the first data; compare the second data with the first data, if the two belong to different object attributes, then The second data is saved separately; the third data is compared with the first data, if it is a different object attribute, and then compared with the second data, if it is the same object attribute, the third data and the second data The data is accumulated and saved, and so on, each data is compared to all of the previously saved data until all the data has been processed.
从上述步骤可知,这种处理方法,需要将每个数据都遍历前面已经存在的所有数据,对于大量数据,其统计效率将非常低。It can be seen from the above steps that this processing method needs to traverse each data in front of all the data already existing, and the statistical efficiency for a large amount of data will be very low.
发明内容Summary of the invention
有鉴于此,本发明的目的在于提供报表的数据统计方法和系统,采用先排序再归纳的统计算法,可以提高内存数据的统计效率。 In view of this, the object of the present invention is to provide a data statistics method and system for a report, and a statistical algorithm that first sorts and then summarizes can improve the statistical efficiency of the memory data.
第一方面,本发明实施例提供了报表的数据统计方法,所述方法包括如下步骤:In a first aspect, an embodiment of the present invention provides a data statistics method for a report, where the method includes the following steps:
获取报表数据信息,所述报表数据信息包括对象属性和所述对象属性对应的数据;Obtaining report data information, where the report data information includes an object attribute and data corresponding to the object attribute;
将所述对象属性对应的数据按照所述对象属性进行排序,得到顺序数据组,其中,所述对象属性相同的数据挨紧排列;Sorting data corresponding to the object attribute according to the object attribute to obtain a sequential data group, wherein the data with the same object attribute is closely arranged;
对所述顺序数据组中的数据进行计算,得到计算结果。Calculating the data in the sequential data set to obtain a calculation result.
结合第一方面,本发明实施例提供了第一方面的第一种可能的实施方式,其中,所述对所述顺序数据组中的数据进行计算得到计算结果的步骤包括:With reference to the first aspect, the embodiment of the present invention provides a first possible implementation manner of the first aspect, wherein the step of calculating data in the sequential data group to obtain a calculation result includes:
对所述顺序数据组中的数据进行求和计算,得到求和结果;Performing a summation calculation on the data in the sequential data group to obtain a summation result;
或者,or,
对所述顺序数据组中的数据进行求平均值计算,得到求平均值结果;Performing averaging calculation on the data in the sequential data group to obtain an averaging result;
或者,or,
对所述顺序数据组中的数据进行求最值计算,得到求最值结果。The data in the sequential data set is subjected to a maximum value calculation to obtain a maximum value result.
结合第一方面的第一种可能的实施方式,本发明实施例提供了第一方面的第二种可能的实施方式,其中,所述顺序数据组包括第一数据和第二数据,所述对所述顺序数据组中的数据进行求和计算得到求和结果的步骤包括,重复执行以下处理,直至所述顺序数据组的所有数据均被遍历:With reference to the first possible implementation manner of the first aspect, the embodiment of the present invention provides the second possible implementation manner of the first aspect, wherein the sequence data group includes first data and second data, the pair The step of performing the summation calculation on the data in the sequential data set to obtain the summation result includes repeatedly performing the following processing until all the data of the sequential data group is traversed:
将所述第一数据进行保存,并将所述第二数据与所述第一数据进行比对,得到比对结果;Saving the first data, and comparing the second data with the first data to obtain a comparison result;
如果所述比对结果为属于相同对象属性,则将所述第一数据与所述第二数据相加,得到第三数据;If the comparison result is belonging to the same object attribute, adding the first data to the second data to obtain third data;
如果所述比对结果为属于不同对象属性,则将所述第二数据单独进行保 存。If the comparison result is belonging to different object attributes, the second data is separately protected Save.
结合第一方面,本发明实施例提供了第一方面的第三种可能的实施方式,其中,所述对象属性为报表的统计项目中的多种对象属性。With reference to the first aspect, the embodiment of the present invention provides a third possible implementation manner of the first aspect, wherein the object attribute is a plurality of object attributes in a statistical item of the report.
结合第一方面,本发明实施例提供了第一方面的第四种可能的实施方式,其中,所述报表数据信息和所述计算结果保存在数据库中。In conjunction with the first aspect, an embodiment of the present invention provides a fourth possible implementation manner of the first aspect, wherein the report data information and the calculation result are saved in a database.
第二方面,本发明实施例还提供报表的数据统计系统,包括:In a second aspect, the embodiment of the present invention further provides a data statistics system for a report, including:
获取单元,配置成获取报表数据信息,所述报表数据信息包括对象属性和所述对象属性对应的数据;An obtaining unit, configured to acquire report data information, where the report data information includes an object attribute and data corresponding to the object attribute;
排序单元,配置成将所述对象属性对应的数据按照所述对象属性进行排序,得到顺序数据组,其中,所述对象属性相同的数据挨紧排列;a sorting unit configured to sort the data corresponding to the object attribute according to the object attribute to obtain a sequential data group, wherein the data with the same object attribute is closely arranged;
计算单元,配置成对所述顺序数据组中的数据进行计算,得到计算结果。The calculating unit is configured to calculate data in the sequential data group to obtain a calculation result.
结合第二方面,本发明实施例提供了第二方面的第一种可能的实施方式,其中,所述计算单元包括:With reference to the second aspect, the embodiment of the present invention provides a first possible implementation manner of the second aspect, wherein the calculating unit includes:
求和单元,配置成对所述顺序数据组中的数据进行求和计算,得到求和结果;a summation unit configured to perform a summation calculation on the data in the sequential data group to obtain a summation result;
求平均值单元,配置成对所述顺序数据组中的数据进行求平均值计算,得到求平均值结果;An averaging unit configured to perform averaging calculation on data in the sequential data group to obtain an averaging result;
求最值单元,配置成对所述顺序数据组中的数据进行求最值计算,得到求最值结果。The most value unit is configured to perform a maximum value calculation on the data in the sequential data group to obtain a maximum value result.
结合第二方面的第一种可能的实施方式,本发明实施例提供了第二方面的第二种可能的实施方式,其中,所述顺序数据组包括第一数据和第二数据,所述求和单元包括:With reference to the first possible implementation manner of the second aspect, the embodiment of the present invention provides the second possible implementation manner of the second aspect, wherein the sequential data group includes first data and second data, And units include:
比对单元,配置成将所述第一数据进行保存,并将所述第二数据与所述第 一数据进行比对,得到比对结果;a matching unit configured to save the first data and the second data and the first A data is compared and a comparison result is obtained;
累加单元,配置成在所述比对结果为属于相同对象属性的为情况下,将所述第一数据与所述第二数据相加,得到第三数据;The accumulating unit is configured to add the first data and the second data to obtain the third data if the comparison result is belonging to the same object attribute;
保存单元,配置成在所述比对结果为属于不同对象属性的情况下,将所述第二数据单独进行保存。The saving unit is configured to separately save the second data if the comparison result is a different object attribute.
结合第二方面,本发明实施例提供了第二方面的第三种可能的实施方式,其中,所述对象属性为报表的统计项目中的多种对象属性。With reference to the second aspect, the embodiment of the present invention provides a third possible implementation manner of the second aspect, wherein the object attribute is a plurality of object attributes in a statistical item of the report.
结合第二方面,本发明实施例提供了第二方面的第四种可能的实施方式,其中,所述报表数据信息和所述计算结果保存在数据库中。With reference to the second aspect, the embodiment of the present invention provides a fourth possible implementation manner of the second aspect, wherein the report data information and the calculation result are saved in a database.
本发明提供了报表的数据统计方法和系统,该方法包括:获取报表数据信息,报表数据信息包括对象属性和对象属性对应的数据;将对象属性对应的数据按照对象属性进行排序,得到顺序数据组,其中,对象属性相同的数据挨紧排列;对顺序数据组中的数据进行计算,得到计算结果。通过采用先排序再归纳的统计算法,可以提高内存数据的统计效率。The present invention provides a data statistics method and system for a report, the method comprising: obtaining report data information, the report data information including data corresponding to an object attribute and an object attribute; and sorting data corresponding to the object attribute according to the object attribute to obtain a sequential data group , wherein the data with the same object attributes are closely arranged; the data in the sequential data group is calculated to obtain a calculation result. The statistical efficiency of memory data can be improved by using a statistical algorithm that sorts and then generalizes.
本发明的其他特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明而了解。本发明的目的和其他优点在说明书、权利要求书以及附图中所特别指出的结构来实现和获得。Other features and advantages of the invention will be set forth in the description which follows, and The objectives and other advantages of the invention are realized and attained by the invention particularly pointed in
为使本发明的上述目的、特征和优点能更明显易懂,下文特举较佳实施例,并配合所附附图,作详细说明如下。The above described objects, features and advantages of the present invention will become more apparent from the aspects of the appended claims.
附图说明DRAWINGS
为了更清楚地说明本发明具体实施方式或现有技术中的技术方案,下面将对具体实施方式或现有技术描述中所需要使用的附图作简单地介绍,显而易见 地,下面描述中的附图是本发明的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following is a brief description of the drawings used in the specific embodiments or the description of the prior art. The drawings in the following description are some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without any creative work.
图1为本发明实施例一提供的报表的数据统计方法流程图;1 is a flowchart of a data statistics method for a report according to Embodiment 1 of the present invention;
图2为本发明实施例一提供的报表的数据统计方法的另一流程图;2 is another flowchart of a data statistics method for a report according to Embodiment 1 of the present invention;
图3为本发明实施例一提供的报表的数据统计系统的结构示意图;3 is a schematic structural diagram of a data statistics system of a report according to Embodiment 1 of the present invention;
图4为本发明实施例二提供的报表的数据统计系统的计算单元的结构示意图;4 is a schematic structural diagram of a computing unit of a data statistics system of a report according to Embodiment 2 of the present invention;
图5为本发明实施例二提供的报表的数据统计系统的求和单元的结构示意图。FIG. 5 is a schematic structural diagram of a summation unit of a data statistics system of a report according to Embodiment 2 of the present invention.
图标:icon:
10-获取单元;20-排序单元;30-计算单元;31求和单元;32-求平均值单元;33-求最值单元;310-比对单元;311-累加单元;312-保存单元。10-acquisition unit; 20-sorting unit; 30-computing unit; 31 summing unit; 32-averaging unit; 33-finalizing unit; 310-aligning unit; 311-accumulating unit;
具体实施方式detailed description
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合附图对本发明的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The embodiments of the present invention will be clearly and completely described in detail with reference to the accompanying drawings. An embodiment. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
目前,现有技术中对于内存中的原始数据,采用的统计方法为:先将第1个数据保存下来;将第2个数据与第1个数据比较,如果两者属于不同的对象属性,则将第2个数据单独保存下来;将第3个数据与第1个数据比较,如果为不同对象属性,再与第2个数据比较,如果为相同对象属性,则将第3个数据与第2个数据累加并保存,以此类推,将每个数据与它前面所有保存数据进行比较,直至所有数据处理完毕。这种处理方法,需要将每个数据都遍历前面 已经存在的所有数据,对于大量数据,其统计效率将非常低。基于此,本发明实施例提供的报表的数据统计方法和系统,采用先排序再归纳的统计算法,可以提高内存数据的统计效率。At present, in the prior art, the statistical method used for the original data in the memory is: first save the first data; compare the second data with the first data, if the two belong to different object attributes, then Save the second data separately; compare the third data with the first data, if it is a different object attribute, compare it with the second data, if it is the same object attribute, then the third data and the second data The data is accumulated and saved, and so on, each data is compared to all of the saved data in front of it until all the data has been processed. This kind of processing method needs to traverse each data in front of it. All the data that already exists, for a large amount of data, its statistical efficiency will be very low. Based on this, the data statistics method and system for the report provided by the embodiment of the present invention can improve the statistical efficiency of the memory data by using a statistical algorithm that is first sorted and then summarized.
为便于对本实施例进行理解,首先对本发明实施例所公开的报表的数据统计方法进行详细介绍。In order to facilitate the understanding of the embodiment, the data statistics method of the report disclosed in the embodiment of the present invention is first introduced in detail.
实施例一:Embodiment 1:
图1为本发明实施例一提供的报表的数据统计方法流程图。FIG. 1 is a flowchart of a data statistics method for a report according to Embodiment 1 of the present invention.
参照图1,报表的数据统计方法包括:Referring to Figure 1, the data statistics method of the report includes:
步骤S101,获取报表数据信息,报表数据信息包括对象属性和对象属性对应的数据;Step S101: Acquire report data information, where the report data information includes data corresponding to the object attribute and the object attribute;
具体地,假使A、B、C、D、E表示对象属性,这里的对象属性表示报表中的统计项目的多种对象属性,比如各个对象包括多种产品,统计项目包括单据编号、机构名称、机构编码、产品名称、日期等等,这些都可以由用户自定义,然后保存在数据库中,当统计项目为单据编号时,对象属性包括具体的单据编号,包括RT00117012350001、RT00117012350001等。在报表系统中,通常需要统计同一对象属性的所有数据,即将同一对象属性下的所有数据进行统计计算。但是,在数据库中,每一个数据都是单独保存的,如表1所示,以A、B、C、C、B、D、E对象属性和各个对象属性对应的数据1、2、3、4、5、6、7为例,展示了数据库中对象属性和对象属性对应的数据的保存形式。Specifically, if A, B, C, D, and E represent object attributes, the object attributes here represent various object attributes of the statistical items in the report, for example, each object includes multiple products, and the statistical items include document number, organization name, The organization code, product name, date, etc., can be customized by the user and then saved in the database. When the statistical item is a document number, the object attribute includes the specific document number, including RT00117012350001, RT00117012350001, and so on. In the reporting system, it is usually necessary to count all the data of the same object attribute, that is, all the data under the same object attribute is statistically calculated. However, in the database, each data is stored separately, as shown in Table 1, with A, B, C, C, B, D, E object attributes and data corresponding to each object attribute 1, 2, 3, 4, 5, 6, and 7 are examples, showing the storage form of the data corresponding to the object attribute and the object attribute in the database.
表1Table 1
对象属性Object property 数据data
AA 11
BB 22
CC 55
CC 33
BB 44
DD 66
EE 77
步骤S102,将对象属性对应的数据按照对象属性进行排序,得到顺序数据组,其中,将对象属性相同的数据挨紧排列;Step S102, sorting the data corresponding to the object attribute according to the object attribute to obtain a sequential data group, wherein the data with the same object attribute is tightly arranged;
具体地,以表1中的对象属性和数据为例,先对所有的数据1、2、5、3、4、6、7按对象属性进行排序,得到新的数据组,即1、2、4、5、3、6、7,具体可参照表2所示,因为各个数据的对象属性在运算之前已经可以确定了,这样只需要将相邻数据进行比对就可以了,这个算法的成本只在排序上面,而传统的Linq算法需要将每个数据与前面存在的所有数据进行比对,最终将该数据归组,本实施例中的排序算法比Linq算法简单的多,整体时间成本要比传统的Linq算法在一些特定的场景要快上10倍左右。Specifically, taking the object attributes and data in Table 1 as an example, all the data 1, 2, 5, 3, 4, 6, and 7 are sorted by object attributes to obtain a new data group, that is, 1, 2, 4, 5, 3, 6, and 7, as shown in Table 2, because the object properties of each data can be determined before the operation, so only need to compare the adjacent data, the cost of this algorithm Only in the sorting, the traditional Linq algorithm needs to compare each data with all the data existing in front, and finally group the data. The sorting algorithm in this embodiment is much simpler than the Linq algorithm, and the overall time cost is It is about 10 times faster than the traditional Linq algorithm in some specific scenarios.
表2Table 2
对象属性Object property 数据data
AA 11
BB 22
BB 44
CC 55
CC 33
DD 66
EE 77
步骤S103,对顺序数据组中的数据进行计算,得到计算结果。In step S103, the data in the sequential data group is calculated to obtain a calculation result.
进一步地,步骤S103包括:Further, step S103 includes:
步骤S1031,对顺序数据组中的数据进行求和计算,得到求和结果;Step S1031: performing a summation calculation on the data in the sequential data group to obtain a summation result;
或者, Or,
步骤S1032,对顺序数据组中的数据进行求平均值计算,得到求平均值结果;Step S1032, performing averaging calculation on the data in the sequential data group to obtain an averaging result;
或者,or,
步骤S1033,对顺序数据组中的数据进行求最值计算,得到求最值结果。In step S1033, the data in the sequential data group is calculated to obtain the most value result.
进一步地,顺序数据组包括第一数据和第二数据,如图2所示,步骤S1031包括,重复执行以下处理,直至所述顺序数据组的所有数据均被遍历:Further, the sequential data group includes first data and second data. As shown in FIG. 2, step S1031 includes repeatedly performing the following processing until all data of the sequential data group is traversed:
S201,将第一数据进行保存,并将第二数据与第一数据进行比对,得到比对结果;S201: save the first data, and compare the second data with the first data to obtain a comparison result;
S202,如果比对结果为属于相同对象属性,则将第一数据与第二数据相加,得到第三数据;S202, if the comparison result belongs to the same object attribute, adding the first data and the second data to obtain the third data;
S203,如果比对结果为属于不同对象属性,则将第二数据单独进行保存。S203. If the comparison result belongs to different object attributes, the second data is separately saved.
具体地,在本实施例中,以A、B、C、C、B、D、E对象属性为例,对应的数据为1、2、5、3、4、6、7。先对上述数据按对象属性进行排序,然后再进行统计计算。具体步骤如下:Specifically, in the embodiment, the A, B, C, C, B, D, and E object attributes are taken as an example, and the corresponding data is 1, 2, 5, 3, 4, 6, and 7. The above data is sorted by object attributes, and then statistical calculations are performed. Specific steps are as follows:
将对应的数据按照对象属性进行排序,得到1、2、4、5、3、6、7,这个数据组;Sorting the corresponding data according to the object attributes to obtain 1, 2, 4, 5, 3, 6, and 7, the data group;
先将第一个数据1保存下来;Save the first data 1 first;
将第2个数据2与第一个数据1比较,两者属于不同的对象属性,则将第2个数据2单独保存下来;Comparing the second data 2 with the first data 1, the two belonging to different object attributes, the second data 2 is separately saved;
将第3个数据4与第2个数据2比较,两者属于相同的对象属性,则将两者累加保存起来;Comparing the third data 4 with the second data 2, and the two belong to the same object attribute, then the two are accumulated and saved;
将第4个数据5与第3个数据4比较,两者属于不同的对象属性,则将第4个数据5单独保存起来; Comparing the fourth data 5 with the third data 4, the two belonging to different object attributes, the fourth data 5 is separately saved;
将第5个数据3与第4个数据5比较,两者属于相同的对象属性,则将两者累加保存起来;Comparing the fifth data 3 with the fourth data 5, and the two belong to the same object attribute, then the two are cumulatively saved;
将第6个数据6与第5个数据3比较,两者属于不同的对象属性,则将第6个数据6单独保存起来;Comparing the sixth data 6 with the fifth data 3, the two belonging to different object attributes, the sixth data 6 is separately saved;
将第7个数据7与第6个数据6比较,两者属于不同的对象属性,则将第7个数据7单独保存起来;Comparing the 7th data 7 with the 6th data 6 and the two belong to different object attributes, the 7th data 7 is separately saved;
通过上述步骤得到统计后的各个对象属性和各个对象属性对应的累加数据,具体可参照表3。Through the above steps, the statistics of each object attribute and the accumulated data corresponding to each object attribute are obtained. For details, refer to Table 3.
表3table 3
对象属性Object property 数据data
AA 11
BB 77
CC 77
DD 66
EE 77
通过上述步骤可知,本实施例不再需要每个条目遍历前面已经存在的分组条目,因此省去了匹配计算的过程,提高了计算效率。特别是在数据量较大时,效率提高显著。It can be seen from the above steps that the embodiment does not need to traverse each of the previously existing group entries, thereby eliminating the process of matching calculation and improving the calculation efficiency. Especially when the amount of data is large, the efficiency is improved significantly.
需要说明的是,对顺序数据组中的数据进行求平均值计算和求最值计算和上述求和计算类似,即将对象属性相同的所有数据求平均值或求最值,其中, 求最值包括求最大值和求最小值,可以将顺序数据组的相邻数据进行比对,如果属于相同对象属性,则比较大小,最终得到对象属性相同的所有数据的最大值或最小值,在此不再赘述。It should be noted that the averaging calculation and the calculation of the maximum value of the data in the sequential data group are similar to the above-mentioned summation calculation, that is, averaging or maximizing all the data with the same object attribute, wherein, Find the maximum value including the maximum value and the minimum value. You can compare the adjacent data of the sequential data group. If they belong to the same object attribute, compare the size and finally get the maximum or minimum value of all the data with the same object attribute. I will not repeat them here.
进一步地,对象属性为报表的统计项目中的多种对象属性。Further, the object attribute is a plurality of object attributes in the statistical item of the report.
进一步地,报表数据信息和计算结果保存在数据库中。Further, the report data information and the calculation result are saved in the database.
实施例二:Embodiment 2:
图3为本发明实施例一提供的报表的数据统计系统的结构示意图。FIG. 3 is a schematic structural diagram of a data statistics system of a report according to Embodiment 1 of the present invention.
参照图3,报表的数据统计系统包括:Referring to Figure 3, the data statistics system of the report includes:
获取单元10,用于获取报表的内存数据信息,内存数据信息包括对象属性和对应的数据;The obtaining unit 10 is configured to obtain memory data information of the report, where the memory data information includes an object attribute and corresponding data;
排序单元20,用于将所述对象属性对应的数据按照所述对象属性进行排序,得到顺序数据组,其中,所述对象属性相同的数据挨紧排列;The sorting unit 20 is configured to sort the data corresponding to the object attribute according to the object attribute to obtain a sequential data group, wherein the data with the same object attribute is closely arranged;
计算单元30,用于对所述顺序数据组中的数据进行计算,得到计算结果。The calculating unit 30 is configured to calculate data in the sequential data group to obtain a calculation result.
进一步地,如图4所示,计算单元30包括:Further, as shown in FIG. 4, the computing unit 30 includes:
求和单元31,用于对顺序数据组中的数据进行求和计算,得到求和结果;a summation unit 31, configured to perform a summation calculation on the data in the sequential data group to obtain a summation result;
求平均值单元32,用于对顺序数据组中的数据进行求平均值计算,得到求平均值结果;The averaging unit 32 is configured to perform averaging calculation on the data in the sequential data group to obtain an averaging result;
求最值单元33,用于对顺序数据组中的数据进行求最值计算,得到求最值结果。The most value unit 33 is configured to perform the most value calculation on the data in the sequential data group to obtain the most valued result.
进一步地,顺序数据组包括第一数据和第二数据,如图5所示,求和单元31包括:Further, the sequential data group includes first data and second data. As shown in FIG. 5, the summation unit 31 includes:
比对单元310,用于将所述第一数据进行保存,并将所述第二数据与所述第一数据进行比对,得到比对结果;The comparing unit 310 is configured to save the first data, and compare the second data with the first data to obtain a comparison result;
累加单元311,用于在比对结果为属于相同对象属性的为情况下,将第一数据与所述第二数据相加,得到第三数据; The accumulating unit 311 is configured to add the first data and the second data to obtain the third data if the comparison result is belonging to the same object attribute;
保存单元312,用于在比对结果为属于不同对象属性的情况下,将第二数据单独进行保存。The saving unit 312 is configured to separately save the second data if the comparison result is belonging to different object attributes.
进一步地,对象属性为报表的统计项目中的多种对象属性。Further, the object attribute is a plurality of object attributes in the statistical item of the report.
进一步地,报表数据信息和计算结果保存在数据库中。Further, the report data information and the calculation result are saved in the database.
本发明实施例提供的报表的数据统计系统,与上述实施例提供的报表的数据统计方法具有相同的技术特征,所以也能解决相同的技术问题,达到相同的技术效果。The data statistics system of the report provided by the embodiment of the present invention has the same technical features as the data statistics method of the report provided by the foregoing embodiment, so that the same technical problem can be solved and the same technical effect can be achieved.
本发明提供了报表的数据统计方法和系统,该方法包括:获取报表数据信息,报表数据信息包括对象属性和对象属性对应的数据;将对象属性对应的数据按照所述对象属性进行排序,得到顺序数据组,其中,将对象属性相同的数据挨紧排列;对顺序数据组中的数据进行计算,得到计算结果。通过采用先排序再归纳的统计算法,可以提高内存数据的统计效率。The present invention provides a data statistics method and system for a report, the method comprising: obtaining report data information, the report data information including data corresponding to an object attribute and an object attribute; and sorting data corresponding to the object attribute according to the object attribute, obtaining a sequence A data group in which data having the same object attribute is closely arranged; the data in the sequential data group is calculated to obtain a calculation result. The statistical efficiency of memory data can be improved by using a statistical algorithm that sorts and then generalizes.
本发明实施例所提供的计算机程序产品,包括存储了程序代码的计算机可读存储介质,所述程序代码包括的指令可用于执行前面方法实施例中所述的方法,具体实现可参见方法实施例,在此不再赘述。The computer program product provided by the embodiment of the present invention includes a computer readable storage medium storing the program code, and the program code includes instructions for executing the method described in the foregoing method embodiment. For the specific implementation, refer to the method embodiment. , will not repeat them here.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统和装置的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。A person skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the system and the device described above can refer to the corresponding process in the foregoing method embodiments, and details are not described herein again.
另外,在本发明实施例的描述中,除非另有明确的规定和限定,术语“安装”、“相连”、“连接”应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本发明中的具体含义。In addition, in the description of the embodiments of the present invention, the terms "installation", "connected", and "connected" are to be understood broadly, and may be a fixed connection or a detachable connection, unless otherwise explicitly defined and defined. , or connected integrally; may be mechanical connection or electrical connection; may be directly connected, or may be indirectly connected through an intermediate medium, and may be internal communication between the two elements. The specific meaning of the above terms in the present invention can be understood in a specific case by those skilled in the art.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以 以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。The functions may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a standalone product. Based on such understanding, the technical solution of the present invention may contribute to the prior art or part of the technical solution. Illustrated in the form of a software product stored in a storage medium, comprising instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform the embodiments of the present invention All or part of the steps of the method. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .
在本发明的描述中,需要说明的是,术语“中心”、“上”、“下”、“左”、“右”、“竖直”、“水平”、“内”、“外”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本发明和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本发明的限制。此外,术语“第一”、“第二”、“第三”仅用于描述目的,而不能理解为指示或暗示相对重要性。In the description of the present invention, it is to be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inside", "outside", etc. The orientation or positional relationship of the indications is based on the orientation or positional relationship shown in the drawings, and is merely for the convenience of the description of the invention and the simplified description, rather than indicating or implying that the device or component referred to has a specific orientation, in a specific orientation. The construction and operation are therefore not to be construed as limiting the invention. Moreover, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
最后应说明的是:以上所述实施例,仅为本发明的具体实施方式,用以说明本发明的技术方案,而非对其限制,本发明的保护范围并不局限于此,尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,其依然可以对前述实施例所记载的技术方案进行修改或可轻易想到变化,或者对其中部分技术特征进行等同替换;而这些修改、变化或者替换,并不使相应技术方案的本质脱离本发明实施例技术方案的精神和范围,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。 Finally, it should be noted that the above-mentioned embodiments are merely specific embodiments of the present invention, and are used to explain the technical solutions of the present invention, and are not limited thereto, and the scope of protection of the present invention is not limited thereto, although reference is made to the foregoing. The present invention has been described in detail, and those skilled in the art should understand that any one skilled in the art can still modify the technical solutions described in the foregoing embodiments within the technical scope disclosed by the present invention. The changes may be easily conceived, or equivalents may be substituted for some of the technical features. The modifications, variations, or substitutions of the present invention are not intended to depart from the spirit and scope of the technical solutions of the embodiments of the present invention. Within the scope of protection. Therefore, the scope of the invention should be determined by the scope of the appended claims.

Claims (10)

  1. 一种报表的数据统计方法,其特征在于,所述方法包括如下步骤:A data statistics method for a report, characterized in that the method comprises the following steps:
    获取报表数据信息,所述报表数据信息包括对象属性和所述对象属性对应的数据;Obtaining report data information, where the report data information includes an object attribute and data corresponding to the object attribute;
    将所述对象属性对应的数据按照所述对象属性进行排序,得到顺序数据组,其中,所述对象属性相同的数据挨紧排列;Sorting data corresponding to the object attribute according to the object attribute to obtain a sequential data group, wherein the data with the same object attribute is closely arranged;
    对所述顺序数据组中的数据进行计算,得到计算结果。Calculating the data in the sequential data set to obtain a calculation result.
  2. 根据权利要求1所述的报表的数据统计方法,其特征在于,所述对所述顺序数据组中的数据进行计算得到计算结果的步骤包括:The data statistics method of the report according to claim 1, wherein the step of calculating the data in the sequential data group to obtain a calculation result comprises:
    对所述顺序数据组中的数据进行求和计算,得到求和结果;Performing a summation calculation on the data in the sequential data group to obtain a summation result;
    或者,or,
    对所述顺序数据组中的数据进行求平均值计算,得到求平均值结果;Performing averaging calculation on the data in the sequential data group to obtain an averaging result;
    或者,or,
    对所述顺序数据组中的数据进行求最值计算,得到求最值结果。The data in the sequential data set is subjected to a maximum value calculation to obtain a maximum value result.
  3. 根据权利要求2所述的报表的数据统计方法,其特征在于,所述顺序数据组包括第一数据和第二数据,所述对所述顺序数据组中的数据进行求和计算得到求和结果的步骤包括,重复执行以下处理,直至所述顺序数据组的所有数据均被遍历:The data statistics method of the report according to claim 2, wherein the sequential data group comprises first data and second data, and the summation of the data in the sequential data group is performed to obtain a summation result. The steps include repeating the following processing until all data of the sequential data group is traversed:
    将所述第一数据进行保存,并将所述第二数据与所述第一数据进行比对,得到比对结果;Saving the first data, and comparing the second data with the first data to obtain a comparison result;
    如果所述比对结果为属于相同对象属性,则将所述第一数据与所述第二数据相加,得到第三数据; If the comparison result is belonging to the same object attribute, adding the first data to the second data to obtain third data;
    如果所述比对结果为属于不同对象属性,则将所述第二数据单独进行保存。If the comparison result is belonging to a different object attribute, the second data is separately saved.
  4. 根据权利要求1所述的报表的数据统计方法,其特征在于,所述对象属性为报表的统计项目中的多种对象属性。The data statistics method of the report according to claim 1, wherein the object attribute is a plurality of object attributes in a statistical item of the report.
  5. 根据权利要求1所述的报表的数据统计方法,其特征在于,所述报表数据信息和所述计算结果保存在数据库中。The data statistics method of a report according to claim 1, wherein the report data information and the calculation result are saved in a database.
  6. 一种报表的数据统计系统,其特征在于,包括:A data statistics system for a report, comprising:
    获取单元,配置成获取报表数据信息,所述报表数据信息包括对象属性和所述对象属性对应的数据;An obtaining unit, configured to acquire report data information, where the report data information includes an object attribute and data corresponding to the object attribute;
    排序单元,配置成将所述对象属性对应的数据按照所述对象属性进行排序,得到顺序数据组,其中,所述对象属性相同的数据挨紧排列;a sorting unit configured to sort the data corresponding to the object attribute according to the object attribute to obtain a sequential data group, wherein the data with the same object attribute is closely arranged;
    计算单元,配置成对所述顺序数据组中的数据进行计算,得到计算结果。The calculating unit is configured to calculate data in the sequential data group to obtain a calculation result.
  7. 根据权利要求6所述的报表的数据统计系统,其特征在于,所述计算单元包括:The data statistics system of the report according to claim 6, wherein the calculating unit comprises:
    求和单元,配置成对所述顺序数据组中的数据进行求和计算,得到求和结果;a summation unit configured to perform a summation calculation on the data in the sequential data group to obtain a summation result;
    求平均值单元,配置成对所述顺序数据组中的数据进行求平均值计算,得到求平均值结果;An averaging unit configured to perform averaging calculation on data in the sequential data group to obtain an averaging result;
    求最值单元,配置成对所述顺序数据组中的数据进行求最值计算,得到求最值结果。The most value unit is configured to perform a maximum value calculation on the data in the sequential data group to obtain a maximum value result.
  8. 根据权利要求7所述的报表的数据统计系统,其特征在于,所述顺序数据组包括第一数据和第二数据,所述求和单元包括:The data statistics system of the report according to claim 7, wherein the sequential data group comprises first data and second data, and the summation unit comprises:
    比对单元,配置成将所述第一数据进行保存,并将所述第二数据与所述第 一数据进行比对,得到比对结果;a matching unit configured to save the first data and the second data and the first A data is compared and a comparison result is obtained;
    累加单元,配置成在所述比对结果为属于相同对象属性的为情况下,将所述第一数据与所述第二数据相加,得到第三数据;The accumulating unit is configured to add the first data and the second data to obtain the third data if the comparison result is belonging to the same object attribute;
    保存单元,配置成在所述比对结果为属于不同对象属性的情况下,将所述第二数据单独进行保存。The saving unit is configured to separately save the second data if the comparison result is a different object attribute.
  9. 根据权利要求6所述的报表的数据统计系统,其特征在于,所述对象属性为报表的统计项目中的多种对象属性。The data statistics system of the report according to claim 6, wherein the object attribute is a plurality of object attributes in a statistical item of the report.
  10. 根据权利要求6所述的报表的数据统计系统,其特征在于,所述报表数据信息和所述计算结果保存在数据库中。 The data statistics system for a report according to claim 6, wherein the report data information and the calculation result are saved in a database.
PCT/CN2017/080129 2017-03-10 2017-04-11 Data statistics method and system for report forms WO2018161403A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710145193.3 2017-03-10
CN201710145193.3A CN106919712A (en) 2017-03-10 2017-03-10 The data statistical approach and system of form

Publications (1)

Publication Number Publication Date
WO2018161403A1 true WO2018161403A1 (en) 2018-09-13

Family

ID=59461256

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/080129 WO2018161403A1 (en) 2017-03-10 2017-04-11 Data statistics method and system for report forms

Country Status (2)

Country Link
CN (1) CN106919712A (en)
WO (1) WO2018161403A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109542947B (en) * 2018-10-29 2020-12-29 金蝶软件(中国)有限公司 Data statistical method, device, computer equipment and storage medium
CN110427599A (en) * 2019-06-06 2019-11-08 北京辰森世纪科技股份有限公司 The statistical method and device of report subtotal, storage medium, electronic device
CN114462365A (en) * 2021-12-27 2022-05-10 奇安信科技集团股份有限公司 Report generation method, device, equipment, storage medium and program product

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101963970A (en) * 2010-01-12 2011-02-02 浪潮(山东)电子信息有限公司 Data statistics method with high efficiency and low maintenance
CN102360371A (en) * 2011-09-29 2012-02-22 畅捷通信息技术股份有限公司 Data processing device and data processing method
CN103020150A (en) * 2011-11-22 2013-04-03 微软公司 Multidimensional grouping operators
CN103365909A (en) * 2012-04-09 2013-10-23 江南大学 Method for sequentially generating accumulated values one by one in data table

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101963970A (en) * 2010-01-12 2011-02-02 浪潮(山东)电子信息有限公司 Data statistics method with high efficiency and low maintenance
CN102360371A (en) * 2011-09-29 2012-02-22 畅捷通信息技术股份有限公司 Data processing device and data processing method
CN103020150A (en) * 2011-11-22 2013-04-03 微软公司 Multidimensional grouping operators
CN103365909A (en) * 2012-04-09 2013-10-23 江南大学 Method for sequentially generating accumulated values one by one in data table

Also Published As

Publication number Publication date
CN106919712A (en) 2017-07-04

Similar Documents

Publication Publication Date Title
US11416456B2 (en) Method, apparatus, and computer program product for data quality analysis
US8738721B1 (en) System and method for detecting spam using clustering and rating of E-mails
US10103942B2 (en) Computer processing method and system for network data
US20120130940A1 (en) Real-time analytics of streaming data
WO2018161403A1 (en) Data statistics method and system for report forms
CN108415964A (en) Tables of data querying method, device, terminal device and storage medium
WO2019052162A1 (en) Method, apparatus and device for improving data cleaning efficiency, and readable storage medium
CN102609464A (en) Method and device for associative table query of MONGODB shards
AU2020202605A1 (en) User data sharing method and device
CN113051308A (en) Alarm information processing method, equipment, storage medium and device
US20160147886A1 (en) Querying Groups of Users Based on User Attributes for Social Analytics
US10810458B2 (en) Incremental automatic update of ranked neighbor lists based on k-th nearest neighbors
US20190042893A1 (en) Incremental clustering of a data stream via an orthogonal transform based indexing
Das et al. Incremental maintenance of maximal bicliques in a dynamic bipartite graph
US20120109981A1 (en) Generating progressive query results
CN108664492B (en) Method and device for pushing content to user, electronic equipment and storage medium
Mohbey Memory-optimized distributed utility mining for big data
US11768752B2 (en) Optimizing large scale data analysis
CN110019152A (en) A kind of big data cleaning method
WO2019153546A1 (en) Ten-thousand-level dimension data generation method, apparatus and device, and storage medium
Guo et al. Parallelizing the extraction of fresh information from online social networks
CN108255710B (en) Script abnormity detection method and terminal thereof
CN105447137A (en) Algorithm for retrieving data with same master-slave relation from big data on the basis of relational database
CN107248929B (en) Strong correlation data generation method of multi-dimensional correlation data
CN115563103B (en) Multi-dimensional aggregation method, system, electronic equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17899396

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17899396

Country of ref document: EP

Kind code of ref document: A1