CN104951467A - Statistical method and device - Google Patents

Statistical method and device Download PDF

Info

Publication number
CN104951467A
CN104951467A CN201410123667.0A CN201410123667A CN104951467A CN 104951467 A CN104951467 A CN 104951467A CN 201410123667 A CN201410123667 A CN 201410123667A CN 104951467 A CN104951467 A CN 104951467A
Authority
CN
China
Prior art keywords
value
statistical
field
combined field
destination object
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201410123667.0A
Other languages
Chinese (zh)
Other versions
CN104951467B (en
Inventor
熊水林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba China Network Technology Co Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201410123667.0A priority Critical patent/CN104951467B/en
Publication of CN104951467A publication Critical patent/CN104951467A/en
Application granted granted Critical
Publication of CN104951467B publication Critical patent/CN104951467B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention provides a statistical method and device. Statistical information is obtained, wherein the statistical information includes filtering conditions, statistical fields and at least two grouped fields. The values of the statistical fields and the values of the at least two grouped fields of target objects are obtained according to the statistical information, and the value of a combined field of each target object is obtained according to the values of the at least two grouped fields, so that according to the value of each combined field, statistical operation can be carried out on the value of the statistical field of each target object to obtain the statistical value corresponding to the value of each combined field. Statistical operation can be performed on combination of multiple specific domains, and statistical flexibility of SOLR is improved.

Description

Statistical method and device
[technical field]
The application relates to statistical technique, particularly relates to a kind of statistical method and device.
[background technology]
SOLR is a search engine of increasing income, and provide not only full-text search service more better than Lucene, can also as the statistical tool of mass data.The bottom data structure of SOLR, the column file remaining Lucene stores, and each train value is exist with the form of array or chained list hereof.Namely the statistics component (StatsComponent) of SOLR can divide into groups to multiple specified domain of these files respectively, carries out statistical operation.
But, the statistics component of SOLR can only to each specified domain independent carry out statistical operation, statistical operation cannot be carried out to the combination of multiple specified domain, thus result in the reduction of the statistics dirigibility of SOLR.
[summary of the invention]
The many aspects of the application provide a kind of statistical method and device, in order to improve the statistics dirigibility of SOLR.
The one side of the application, provides a kind of statistical method, is applied in SOLR, comprises:
Obtain statistical information, described statistical information comprises filtercondition, static fields and at least two grouping field;
According to described statistical information, obtain the value of static fields and the value of at least two grouping field of destination object;
According to the value of described at least two grouping field, obtain the value of the combined field of described each destination object;
According to the value of each combined field, statistical operation is carried out to the value of the static fields of described each destination object, with the statistical value corresponding to the value obtaining described each combined field.
Aspect as above and arbitrary possible implementation, provide a kind of implementation further, described according to described statistical information, obtains the value of static fields and the value of at least two grouping field of destination object, comprising:
According to described filtercondition, perform querying flow, to obtain described destination object; Wherein, described querying flow comprises filter operation;
According to described static fields and described at least two grouping field, obtain the value of the static fields of described destination object and the value of at least two grouping field.
Aspect as above and arbitrary possible implementation, provide a kind of implementation further, described querying flow also comprises scoring operation and sorting operation.
Aspect as above and arbitrary possible implementation, provide a kind of implementation further, also comprise the operation mark of described statistical operation in described statistical information; The described value according to each combined field, carries out statistical operation to the value of the static fields of described each destination object, with the statistical value corresponding to the value obtaining described each combined field, comprising:
According to value and the described operation mark of each combined field, described statistical operation is carried out to the value of the static fields of described each destination object, with the statistical value corresponding to the value obtaining described each combined field.
Aspect as above and arbitrary possible implementation, a kind of implementation is provided further, the described value according to each combined field, statistical operation is carried out to the value of the static fields of described each destination object, after the statistical value corresponding to the value obtaining described each combined field, also comprise:
According to the value of described each combined field, the value of at least two grouping field described in acquisition.
Aspect as above and arbitrary possible implementation, a kind of implementation is provided further, the described value according to each combined field, statistical operation is carried out to the value of the static fields of described each destination object, after the statistical value corresponding to the value obtaining described each combined field, also comprise:
Described statistical operation is carried out to each statistical value, obtains statistical summaries value.
Aspect as above and arbitrary possible implementation, a kind of implementation is provided further, the described value according to each combined field, statistical operation is carried out to the value of the static fields of described each destination object, after the statistical value corresponding to the value obtaining described each combined field, also comprise:
By the statistical value corresponding to the value of described statistical information, described each combined field and the value of described each combined field, store in the buffer.
Aspect as above and arbitrary possible implementation, provide a kind of implementation further,
Described acquisition statistical information, described statistical information also comprises after comprising filtercondition, static fields and at least two grouping field:
According to described statistical information, search in described buffer memory, with the statistical value corresponding to the value of the value and described each combined field that obtain stored described each combined field;
Described according to described statistical information, obtain the value of static fields and the value of at least two grouping field of destination object, comprising:
If there is no in described buffer memory the value of the described each combined field stored and the statistical value corresponding to value of described each combined field, according to described statistical information, obtain the value of static fields and the value of at least two grouping field of destination object.
The one side of the application, provides a kind of statistic device, is applied in SOLR, comprises:
Acquiring unit, for obtaining statistical information, described statistical information comprises filtercondition, static fields and at least two grouping field;
Dimensional analysis unit, for according to described statistical information, obtains the value of static fields and the value of at least two grouping field of destination object;
Dimension converter unit, for the value according to described at least two grouping field, obtains the value of the combined field of described each destination object;
Statistic unit, for the value according to each combined field, carries out statistical operation to the value of the static fields of described each destination object, with the statistical value corresponding to the value obtaining described each combined field.
Aspect as above and arbitrary possible implementation, provide a kind of implementation further, described dimensional analysis unit, specifically for
According to described filtercondition, perform querying flow, to obtain described destination object; Wherein, described querying flow comprises filter operation; And
According to described static fields and described at least two grouping field, obtain the value of the static fields of described destination object and the value of at least two grouping field.
Aspect as above and arbitrary possible implementation, provide a kind of implementation further, described querying flow also comprises scoring operation and sorting operation.
Aspect as above and arbitrary possible implementation, provide a kind of implementation further, also comprise the operation mark of described statistical operation in described statistical information; Described statistic unit, specifically for
According to value and the described operation mark of each combined field, described statistical operation is carried out to the value of the static fields of described each destination object, with the statistical value corresponding to the value obtaining described each combined field.
Aspect as above and arbitrary possible implementation, provide a kind of implementation further, described dimension converter unit, also for
According to the value of described each combined field, the value of at least two grouping field described in acquisition.
Aspect as above and arbitrary possible implementation, provide a kind of implementation, described statistic unit further, also for
Described statistical operation is carried out to each statistical value, obtains statistical summaries value.
Aspect as above and arbitrary possible implementation, provide a kind of implementation further, described device also comprises buffer unit, for
By the statistical value corresponding to the value of described statistical information, described each combined field and the value of described each combined field, store in the buffer.
Aspect as above and arbitrary possible implementation, provide a kind of implementation further,
Described acquiring unit, also for
According to described statistical information, search in described buffer memory, with the statistical value corresponding to the value of the value and described each combined field that obtain stored described each combined field;
Described dimensional analysis unit, specifically for
If described acquiring unit there is no in described buffer memory the value of the described each combined field stored and the statistical value corresponding to value of described each combined field, according to described statistical information, obtain the value of static fields and the value of at least two grouping field of destination object.
As shown from the above technical solution, the embodiment of the present application is by obtaining statistical information, described statistical information comprises filtercondition, static fields and at least two grouping field, and then according to described statistical information, obtain the value of static fields and the value of at least two grouping field of destination object, and according to the value of described at least two grouping field, obtain the value of the combined field of described each destination object, make it possible to the value according to each combined field, statistical operation is carried out to the value of the static fields of described each destination object, with the statistical value corresponding to the value obtaining described each combined field, achieve and statistical operation is carried out to the combination of multiple specified domain, thus improve the statistics dirigibility of SOLR.
In addition, adopt the technical scheme that the application provides, owing to simplifying operation included in querying flow, namely only include filter operation in query manipulation, and do not comprise scoring operation and sorting operation, therefore, the statistical efficiency of SOLR effectively can be provided, reduce the statistic property consumption of SOLR.
In addition, adopt the technical scheme that the application provides, statistical value corresponding to the direct value to each combined field carries out statistical operation, obtain the statistical summaries value of this statistics, and no longer repeatedly statistical operation is performed to the value of the static fields of each destination object, obtain the statistical summaries value of this statistics, therefore, the statistical efficiency of SOLR effectively can be provided, reduce the statistic property consumption of SOLR.
In addition, adopt the technical scheme that the application provides, due to by the statistical value corresponding to the value of the value of statistical information, each combined field and described each combined field, store in the buffer, make in the on all four situation of obtained statistical information, directly can obtain the statistical value corresponding to value of each combined field from buffer memory, therefore, the statistical efficiency of SOLR effectively can be provided, reduce the statistic property consumption of SOLR.
[accompanying drawing explanation]
In order to be illustrated more clearly in the technical scheme in the embodiment of the present application, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is some embodiments of the application, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
The schematic flow sheet of the statistical method that Fig. 1 provides for the application one embodiment;
The structural representation of the statistic device that Fig. 2 provides for another embodiment of the application;
The structural representation of the statistic device that Fig. 3 provides for another embodiment of the application.
[embodiment]
For making the object of the embodiment of the present application, technical scheme and advantage clearly, below in conjunction with the accompanying drawing in the embodiment of the present application, technical scheme in the embodiment of the present application is clearly and completely described, obviously, described embodiment is some embodiments of the present application, instead of whole embodiments.Based on the embodiment in the application, those of ordinary skill in the art are not making other embodiments whole obtained under creative work prerequisite, all belong to the scope of the application's protection.
In addition, term "and/or" herein, being only a kind of incidence relation describing affiliated partner, can there are three kinds of relations in expression, and such as, A and/or B, can represent: individualism A, exists A and B simultaneously, these three kinds of situations of individualism B.In addition, character "/" herein, general expression forward-backward correlation is to the relation liking a kind of "or".
The schematic flow sheet of the statistical method that Fig. 1 provides for the application one embodiment, is applied in SOLR, as shown in Figure 1.
101, obtain statistical information, described statistical information comprises filtercondition, static fields and at least two grouping field.
Alternatively, in one of the present embodiment possible implementation, in 101, specifically can receive the described statistical information that client sends.
Such as, be responsible for by SOLR existing request container handling (SolrDispatchFilter) the described statistical information receiving client transmission.
102, according to described statistical information, the value of static fields and the value of at least two grouping field of destination object is obtained.
Alternatively, in one of the present embodiment possible implementation, in 102, specifically according to described filtercondition, querying flow can be performed, to obtain described destination object; Wherein, described querying flow comprises filter operation.Then, according to described static fields and described at least two grouping field, the value of the static fields of described destination object and the value of at least two grouping field is obtained.
Such as, described querying flow, except comprising filter operation, can further include scoring operation and sorting operation.That is, specifically can perform complete querying flow by the existing enquiring component of SOLR (QueryComponent), then, then perform corresponding statistical flowsheet by the collection device (StatsDocCollector) of SOLR.
Or, more such as, described querying flow can only include filter operation.That is, specifically can perform by the existing enquiring component of SOLR (QueryComponent) querying flow simplified, then, and then self-defined one performs corresponding statistical flowsheet for the collection device (StatsDocCollector) added up.Like this, owing to simplifying operation included in querying flow, namely only include filter operation in query manipulation, and do not comprise scoring operation and sorting operation, therefore, it is possible to effectively provide the statistical efficiency of SOLR, reduce the statistic property consumption of SOLR.
103, according to the value of described at least two grouping field, the value of the combined field of described each destination object is obtained.
Alternatively, in one of the present embodiment possible implementation, in 103, specifically can utilize the instantiation of the function (Multifunction) of a self-defining multiparameter, such as, ConcatFunction operates, and by the value of at least two grouping field, is converted to the value of a combined field.Wherein, conversion method can adopt any method, and such as, the joining method of specific character string, the present embodiment is not particularly limited this.
104, according to the value of each combined field, statistical operation is carried out to the value of the static fields of described each destination object, with the statistical value corresponding to the value obtaining described each combined field.
Alternatively, in one of the present embodiment possible implementation, in 104, specifically can according to the value of each combined field, preassigned at least one statistical operation is carried out to the value of the static fields of described each destination object, with the statistical value corresponding to the value obtaining described each combined field.
Such as, whole statistical operations that SOLR supports can be carried out, i.e. max function, min function, count function, missing function, sum function, avg function, sqr function and the computing corresponding to stddev function.
Or, more such as, the conventional part statistical operation that SOLR supports can be carried out, i.e. max function, min function, count function and the computing corresponding to sum function.
Alternatively, in one of the present embodiment possible implementation, in 101, in the described statistical information obtained, can further include the operation mark of described statistical operation.Correspondingly, in 104, specifically according to the value of each combined field and described operation mark, described statistical operation can be carried out to the value of the static fields of described each destination object, with the statistical value corresponding to the value obtaining described each combined field.Like this, by increasing the operation mark of statistical operation in statistical information, make it possible to, according to the statistical demand of this statistics, autotelicly carry out statistical operation, thus improve the statistical efficiency of SOLR.
Alternatively, in one of the present embodiment possible implementation, after 104, can also further according to the value of described each combined field, the value of at least two grouping field described in acquisition.Particularly, specifically can perform the inverse operation of ConcatFunction operation, by the value of a combined field, be converted to the value of at least two grouping field.Wherein, the conversion method of the inverse operation of ConcatFunction operation can adopt the method for reducing corresponding with the conversion method that ConcatFunction operates.Like this, just can according to the value of described at least two grouping field, and the statistical value corresponding to the value of described at least two grouping field, generate statistics, be supplied to client.
Alternatively, in one of the present embodiment possible implementation, after 104, described statistical operation can also be carried out to each statistical value further, obtain statistical summaries value.Like this, statistical value corresponding to the direct value to each combined field carries out statistical operation, obtain the statistical summaries value of this statistics, and no longer repeatedly statistical operation is performed to the value of the static fields of each destination object, obtain the statistical summaries value of this statistics, therefore, it is possible to effectively provide the statistical efficiency of SOLR, reduce the statistic property consumption of SOLR.
Alternatively, in one of the present embodiment possible implementation, after 104, further by the statistical value corresponding to the value of described statistical information, described each combined field and the value of described each combined field, can also store in the buffer.
Correspondingly, after 101, further according to described statistical information, can also search in described buffer memory, with the statistical value corresponding to the value of the value and described each combined field that obtain stored described each combined field.
So, in 102, if there is no in described buffer memory the value of the described each combined field stored and the statistical value corresponding to value of described each combined field, then can continue the operation after execution 101, namely according to described statistical information, the value of static fields and the value of at least two grouping field of destination object is obtained.
Like this, due to by the statistical value corresponding to the value of the value of statistical information, each combined field and described each combined field, store in the buffer, make in the on all four situation of obtained statistical information, the statistical value corresponding to value of each combined field directly can be obtained from buffer memory, therefore, it is possible to effectively provide the statistical efficiency of SOLR, reduce the statistic property consumption of SOLR.
The method provided for making the embodiment of the present invention clearly, HTML (Hypertext Markup Language) (the Hyper Text Transfer Protocol of client transmission will be received below with SOLR, HTTP) request and http://localhost:8983/tigo/select stats=on & q=sku:sku_1* & wt=xml & stats.fiel d=price & f.price.stats.func=sum_max & stats.field=weight & f.weight.stats.func=avg_sqr & stats.pivot=sku, category as an example.Statistical information is comprised, namely in this HTTP request
Filtercondition is the value of sku field is " sku_1* ";
Static fields is price field and weight field;
Statistical operation is the computing of price field corresponding to sum function and the computing corresponding to max function, and the computing of the operation mark of weight field corresponding to avg function and the computing corresponding to sqr function;
Grouping field is sku field and category field.
Wherein, stats=on: after representing the filter operation performing and comprise in querying flow, performing statistical flowsheet immediately, namely calling the statistics component (StatsComponent) of SOLR, without the need to performing scoring operation and sorting operation again.
The enquiring component (QueryComponent) of SOLR according to statistical information, generates a buffer memory Key object QueryResultKey with statistical information, and then judges whether there is this objects of statistics in buffer memory after receiving the HTTP request that client sends.If there is this objects of statistics in buffer memory, then directly can take out result object corresponding to this objects of statistics (StatsValues) from buffer memory; If there is not this objects of statistics in buffer memory, then according to filtercondition, querying flow can be performed, to obtain destination object, and calls the statistics component (StatsComponent) of SOLR.
Self-defining collection device (StatsDocCollector) collects the set of destination object that enquiring component (QueryComponent) obtains and document identification (ID), the territory buffer memory (FieldCache) of initialization static fields, the value of static fields to be put into the territory buffer memory (FieldCache) of static fields, and the territory buffer memory (FieldCache) of initialisation packet field, the value of grouping field to be put into the territory buffer memory (FieldCache) of grouping field, and then structure is operated by the ConcatFunction of grouping field as parameter.
Collection device (StatsDocCollector) utilizes ConcatFunction to operate, and obtains the value of the unique combined field corresponding to each destination object.Wherein, in ConcatFunction operation, involved conversion method can adopt any method, and such as, the joining method of specific character string, the present embodiment is not particularly limited this.This value can as the Key of statistical value, and destination object and Key are many-to-one relations, and namely each Key corresponding, has many records.
Classified statistics object (StatsValueFacet) in collection device (StatsDocCollector) preserves the mapping relations Map<K of a result object (StatsValues), V>.Wherein, to be described Key, V be K corresponds to the statistical value of some statistical operation of many records of Key, such as, and the computing etc. corresponding to sum function.Particularly, when collection device (StatsDocCollector) travels through each destination object, classified statistics object (StatsValueFacet) takes out a value from the territory buffer memory (FieldCache) of each static fields, with in Map to value corresponding to the K of destination object carrying out statistical operation, to obtain statistical value V.
Collection device (StatsDocCollector) travel through each destination object complete after, statistical operation can be carried out to each statistical value further, obtain statistical summaries value.
Map<K, V> store in the buffer by collection device (StatsDocCollector).Like this,
When having same HTTP request, directly taken out next time.
Above statistical value, or the statistical value taken out from buffer memory, all result object (StatsValues) the i.e. Map<K of single combination fields (combination dimension), V>, also need the inverse operation performing ConcatFunction operation further, with realize from combination fields K to multiple territory and k1(sku field) and k2(category field) conversion, to obtain Map< (k1=v1, k2=v2), V> object.
So far, the statistical operation in multiple territories of single static fields is finished.
Be understandable that, if multiple static fields, so, last statistics can be " the line structure " of following bivariate table case form
So far, the statistical operation of multiple territories combination of multiple static fields is all finished.
In the present embodiment, by obtaining statistical information, described statistical information comprises filtercondition, static fields and at least two grouping field, and then according to described statistical information, obtain the value of static fields and the value of at least two grouping field of destination object, and according to the value of described at least two grouping field, obtain the value of the combined field of described each destination object, make it possible to the value according to each combined field, statistical operation is carried out to the value of the static fields of described each destination object, with the statistical value corresponding to the value obtaining described each combined field, achieve and statistical operation is carried out to the combination of multiple specified domain, thus improve the statistics dirigibility of SOLR.
In addition, adopt the technical scheme that the application provides, owing to simplifying operation included in querying flow, namely only include filter operation in query manipulation, and do not comprise scoring operation and sorting operation, therefore, the statistical efficiency of SOLR effectively can be provided, reduce the statistic property consumption of SOLR.
In addition, adopt the technical scheme that the application provides, statistical value corresponding to the direct value to each combined field carries out statistical operation, obtain the statistical summaries value of this statistics, and no longer repeatedly statistical operation is performed to the value of the static fields of each destination object, obtain the statistical summaries value of this statistics, therefore, the statistical efficiency of SOLR effectively can be provided, reduce the statistic property consumption of SOLR.
In addition, adopt the technical scheme that the application provides, due to by the statistical value corresponding to the value of the value of statistical information, each combined field and described each combined field, store in the buffer, make in the on all four situation of obtained statistical information, directly can obtain the statistical value corresponding to value of each combined field from buffer memory, therefore, the statistical efficiency of SOLR effectively can be provided, reduce the statistic property consumption of SOLR.
It should be noted that, for aforesaid each embodiment of the method, in order to simple description, therefore it is all expressed as a series of combination of actions, but those skilled in the art should know, the application is not by the restriction of described sequence of movement, because according to the application, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in instructions all belongs to preferred embodiment, and involved action and module might not be that the application is necessary.
In the above-described embodiments, the description of each embodiment is all emphasized particularly on different fields, in certain embodiment, there is no the part described in detail, can see the associated description of other embodiments.
The structural representation of the statistic device that Fig. 2 provides for another embodiment of the application, is applied to SOLR, as shown in Figure 2.The statistic device of the present embodiment can comprise acquiring unit 21, dimensional analysis unit 22, dimension converter unit 23 and statistic unit 24.Wherein,
Acquiring unit 21, for obtaining statistical information, described statistical information comprises filtercondition, static fields and at least two grouping field.
Alternatively, in one of the present embodiment possible implementation, acquiring unit 21 specifically can receive the described statistical information that client sends.
Such as, be responsible for by SOLR existing request container handling (SolrDispatchFilter) the described statistical information receiving client transmission.
Dimensional analysis unit 22, for according to described statistical information, obtains the value of static fields and the value of at least two grouping field of destination object.
Alternatively, in one of the present embodiment possible implementation, described dimensional analysis unit 22, specifically may be used for according to described filtercondition, performs querying flow, to obtain described destination object; Wherein, described querying flow comprises filter operation; And according to described static fields and described at least two grouping field, obtain the value of the static fields of described destination object and the value of at least two grouping field.
Such as, described querying flow, except comprising filter operation, can further include scoring operation and sorting operation.That is, specifically can perform complete querying flow by the existing enquiring component of SOLR (QueryComponent), then, then perform corresponding statistical flowsheet by the collection device (StatsDocCollector) of SOLR.
Or, more such as, described querying flow can only include filter operation.That is, specifically can perform by the existing enquiring component of SOLR (QueryComponent) querying flow simplified, then, and then perform corresponding statistical flowsheet by self-defined one for the collection device (StatsDocCollector) added up.Like this, owing to simplifying operation included in querying flow, namely only include filter operation in query manipulation, and do not comprise scoring operation and sorting operation, therefore, it is possible to effectively provide the statistical efficiency of SOLR, reduce the statistic property consumption of SOLR.
Dimension converter unit 23, for the value according to described at least two grouping field, obtains the value of the combined field of described each destination object.
Alternatively, in one of the present embodiment possible implementation, dimension converter unit 23 specifically can utilize the instantiation of the function (Multifunction) of a self-defining multiparameter, such as, ConcatFunction operates, by the value of at least two grouping field, be converted to the value of a combined field.Wherein, conversion method can adopt any method, and such as, the joining method of specific character string, the present embodiment is not particularly limited this.
Statistic unit 24, for the value according to each combined field, carries out statistical operation to the value of the static fields of described each destination object, with the statistical value corresponding to the value obtaining described each combined field.
Alternatively, in one of the present embodiment possible implementation, described statistic unit 24, specifically may be used for the value according to each combined field, preassigned at least one statistical operation is carried out to the value of the static fields of described each destination object, with the statistical value corresponding to the value obtaining described each combined field.
Such as, described statistic unit 24 can carry out whole statistical operations that SOLR supports, i.e. max function, min function, count function, missing function, sum function, avg function, sqr function and the computing corresponding to stddev function.
Or, more such as, described statistic unit 24 can carry out the conventional part statistical operation that SOLR supports, i.e. max function, min function, count function and the computing corresponding to sum function.
Alternatively, in one of the present embodiment possible implementation, in the described statistical information that acquiring unit 21 obtains, can further include the operation mark of described statistical operation.Correspondingly, described statistic unit 24, specifically may be used for the value according to each combined field and described operation mark, described statistical operation is carried out to the value of the static fields of described each destination object, with the statistical value corresponding to the value obtaining described each combined field.Like this, by increasing the operation mark of statistical operation in statistical information, make it possible to, according to the statistical demand of this statistics, autotelicly carry out statistical operation, thus improve the statistical efficiency of SOLR.
Alternatively, in one of the present embodiment possible implementation, described dimension converter unit 23, can also be further used for the value according to described each combined field, the value of at least two grouping field described in acquisition.Particularly, described dimension converter unit 23 specifically can perform the inverse operation of ConcatFunction operation, by the value of a combined field, is converted to the value of at least two grouping field.Wherein, the conversion method of the inverse operation of ConcatFunction operation can adopt the method for reducing corresponding with the conversion method that ConcatFunction operates.Like this, just can according to the value of described at least two grouping field, and the statistical value corresponding to the value of described at least two grouping field, generate statistics, be supplied to client.
Alternatively, in one of the present embodiment possible implementation, described statistic unit 24, can also be further used for carrying out described statistical operation to each statistical value, obtains statistical summaries value.Like this, statistical value corresponding to the direct value to each combined field carries out statistical operation, obtain the statistical summaries value of this statistics, and no longer repeatedly statistical operation is performed to the value of the static fields of each destination object, obtain the statistical summaries value of this statistics, therefore, it is possible to effectively provide the statistical efficiency of SOLR, reduce the statistic property consumption of SOLR.
Alternatively, in one of the present embodiment possible implementation, as shown in Figure 3, the statistic device that the present embodiment provides can further include buffer unit 31, for by the statistical value corresponding to the value of described statistical information, described each combined field and the value of described each combined field, store in the buffer.
Correspondingly, described acquiring unit 21, can also be further used for, according to described statistical information, searching in described buffer memory, with the statistical value corresponding to the value of the value and described each combined field that obtain stored described each combined field.
So, described dimensional analysis unit 22, if there is no in described buffer memory the value of the described each combined field stored and the statistical value corresponding to value of described each combined field specifically for described acquiring unit 21, then can perform corresponding operation, namely according to described statistical information, the value of static fields and the value of at least two grouping field of destination object is obtained.
Like this, due to by the statistical value corresponding to the value of the value of statistical information, each combined field and described each combined field, store in the buffer, make in the on all four situation of obtained statistical information, the statistical value corresponding to value of each combined field directly can be obtained from buffer memory, therefore, it is possible to effectively provide the statistical efficiency of SOLR, reduce the statistic property consumption of SOLR.
In the present embodiment, statistical information is obtained by acquiring unit, described statistical information comprises filtercondition, static fields and at least two grouping field, and then by dimensional analysis unit according to described statistical information, obtain the value of static fields and the value of at least two grouping field of destination object, and dimension converter unit is according to the value of described at least two grouping field, obtain the value of the combined field of described each destination object, make statistic unit can according to the value of each combined field, statistical operation is carried out to the value of the static fields of described each destination object, with the statistical value corresponding to the value obtaining described each combined field, achieve and statistical operation is carried out to the combination of multiple specified domain, thus improve the statistics dirigibility of SOLR.
In addition, adopt the technical scheme that the application provides, owing to simplifying operation included in querying flow, namely only include filter operation in query manipulation, and do not comprise scoring operation and sorting operation, therefore, the statistical efficiency of SOLR effectively can be provided, reduce the statistic property consumption of SOLR.
In addition, adopt the technical scheme that the application provides, statistical value corresponding to the direct value to each combined field carries out statistical operation, obtain the statistical summaries value of this statistics, and no longer repeatedly statistical operation is performed to the value of the static fields of each destination object, obtain the statistical summaries value of this statistics, therefore, the statistical efficiency of SOLR effectively can be provided, reduce the statistic property consumption of SOLR.
In addition, adopt the technical scheme that the application provides, due to by the statistical value corresponding to the value of the value of statistical information, each combined field and described each combined field, store in the buffer, make in the on all four situation of obtained statistical information, directly can obtain the statistical value corresponding to value of each combined field from buffer memory, therefore, the statistical efficiency of SOLR effectively can be provided, reduce the statistic property consumption of SOLR.
Those skilled in the art can be well understood to, and for convenience and simplicity of description, the system of foregoing description, the specific works process of device and unit, with reference to the corresponding process in preceding method embodiment, can not repeat them here.
In several embodiments that the application provides, should be understood that, disclosed system, apparatus and method, can realize by another way.Such as, device embodiment described above is only schematic, such as, the division of described unit, be only a kind of logic function to divide, actual can have other dividing mode when realizing, such as multiple unit or page assembly can in conjunction with or another system can be integrated into, or some features can be ignored, or do not perform.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, and the indirect coupling of device or unit or communication connection can be electrical, machinery or other form.
The described unit illustrated as separating component or can may not be and physically separates, and the parts as unit display can be or may not be physical location, namely can be positioned at a place, or also can be distributed in multiple network element.Some or all of unit wherein can be selected according to the actual needs to realize the object of the present embodiment scheme.
In addition, each functional unit in each embodiment of the application can be integrated in a processing unit, also can be that the independent physics of unit exists, also can two or more unit in a unit integrated.Above-mentioned integrated unit both can adopt the form of hardware to realize, and the form that hardware also can be adopted to add SFU software functional unit realizes.
The above-mentioned integrated unit realized with the form of SFU software functional unit, can be stored in a computer read/write memory medium.Above-mentioned SFU software functional unit is stored in a storage medium, comprising some instructions in order to make a computer equipment (can be personal computer, server, or the network equipment etc.) or processor (processor) perform the part steps of method described in each embodiment of the application.And aforesaid storage medium comprises: USB flash disk, portable hard drive, ROM (read-only memory) (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disc or CD etc. various can be program code stored medium.
Last it is noted that above embodiment is only in order to illustrate the technical scheme of the application, be not intended to limit; Although with reference to previous embodiment to present application has been detailed description, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme described in foregoing embodiments, or carries out equivalent replacement to wherein portion of techniques feature; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the spirit and scope of each embodiment technical scheme of the application.

Claims (16)

1. a statistical method, is applied in SOLR, it is characterized in that, comprising:
Obtain statistical information, described statistical information comprises filtercondition, static fields and at least two grouping field;
According to described statistical information, obtain the value of static fields and the value of at least two grouping field of destination object;
According to the value of described at least two grouping field, obtain the value of the combined field of described each destination object;
According to the value of each combined field, statistical operation is carried out to the value of the static fields of described each destination object, with the statistical value corresponding to the value obtaining described each combined field.
2. method according to claim 1, is characterized in that, described according to described statistical information, obtains the value of static fields and the value of at least two grouping field of destination object, comprising:
According to described filtercondition, perform querying flow, to obtain described destination object; Wherein, described querying flow comprises filter operation;
According to described static fields and described at least two grouping field, obtain the value of the static fields of described destination object and the value of at least two grouping field.
3. method according to claim 2, is characterized in that, described querying flow also comprises scoring operation and sorting operation.
4. method according to claim 1, is characterized in that, also comprises the operation mark of described statistical operation in described statistical information; The described value according to each combined field, carries out statistical operation to the value of the static fields of described each destination object, with the statistical value corresponding to the value obtaining described each combined field, comprising:
According to value and the described operation mark of each combined field, described statistical operation is carried out to the value of the static fields of described each destination object, with the statistical value corresponding to the value obtaining described each combined field.
5. method according to claim 1, it is characterized in that the described value according to each combined field carries out statistical operation to the value of the static fields of described each destination object, after the statistical value corresponding to the value obtaining described each combined field, also comprise:
According to the value of described each combined field, the value of at least two grouping field described in acquisition.
6. method according to claim 1, it is characterized in that the described value according to each combined field carries out statistical operation to the value of the static fields of described each destination object, after the statistical value corresponding to the value obtaining described each combined field, also comprise:
Described statistical operation is carried out to each statistical value, obtains statistical summaries value.
7. the method according to the arbitrary claim of claim 1 ~ 6, it is characterized in that the described value according to each combined field carries out statistical operation to the value of the static fields of described each destination object, after the statistical value corresponding to the value obtaining described each combined field, also comprise:
By the statistical value corresponding to the value of described statistical information, described each combined field and the value of described each combined field, store in the buffer.
8. method according to claim 7, is characterized in that,
Described acquisition statistical information, described statistical information also comprises after comprising filtercondition, static fields and at least two grouping field:
According to described statistical information, search in described buffer memory, with the statistical value corresponding to the value of the value and described each combined field that obtain stored described each combined field;
Described according to described statistical information, obtain the value of static fields and the value of at least two grouping field of destination object, comprising:
If there is no in described buffer memory the value of the described each combined field stored and the statistical value corresponding to value of described each combined field, according to described statistical information, obtain the value of static fields and the value of at least two grouping field of destination object.
9. a statistic device, is applied in SOLR, it is characterized in that, comprising:
Acquiring unit, for obtaining statistical information, described statistical information comprises filtercondition, static fields and at least two grouping field;
Dimensional analysis unit, for according to described statistical information, obtains the value of static fields and the value of at least two grouping field of destination object;
Dimension converter unit, for the value according to described at least two grouping field, obtains the value of the combined field of described each destination object;
Statistic unit, for the value according to each combined field, carries out statistical operation to the value of the static fields of described each destination object, with the statistical value corresponding to the value obtaining described each combined field.
10. device according to claim 9, is characterized in that, described dimensional analysis unit, specifically for
According to described filtercondition, perform querying flow, to obtain described destination object; Wherein, described querying flow comprises filter operation; And
According to described static fields and described at least two grouping field, obtain the value of the static fields of described destination object and the value of at least two grouping field.
11. devices according to claim 10, is characterized in that, described querying flow also comprises scoring operation and sorting operation.
12. devices according to claim 9, is characterized in that, also comprise the operation mark of described statistical operation in described statistical information; Described statistic unit, specifically for
According to value and the described operation mark of each combined field, described statistical operation is carried out to the value of the static fields of described each destination object, with the statistical value corresponding to the value obtaining described each combined field.
13. devices according to claim 9, is characterized in that, described dimension converter unit, also for
According to the value of described each combined field, the value of at least two grouping field described in acquisition.
14. devices according to claim 9, is characterized in that, described statistic unit, also for
Described statistical operation is carried out to each statistical value, obtains statistical summaries value.
15. devices according to the arbitrary claim of claim 9 ~ 14, it is characterized in that, described device also comprises buffer unit, for
By the statistical value corresponding to the value of described statistical information, described each combined field and the value of described each combined field, store in the buffer.
16. devices according to claim 15, is characterized in that,
Described acquiring unit, also for
According to described statistical information, search in described buffer memory, with the statistical value corresponding to the value of the value and described each combined field that obtain stored described each combined field;
Described dimensional analysis unit, specifically for
If described acquiring unit there is no in described buffer memory the value of the described each combined field stored and the statistical value corresponding to value of described each combined field, according to described statistical information, obtain the value of static fields and the value of at least two grouping field of destination object.
CN201410123667.0A 2014-03-28 2014-03-28 Statistical method and device Active CN104951467B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410123667.0A CN104951467B (en) 2014-03-28 2014-03-28 Statistical method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410123667.0A CN104951467B (en) 2014-03-28 2014-03-28 Statistical method and device

Publications (2)

Publication Number Publication Date
CN104951467A true CN104951467A (en) 2015-09-30
CN104951467B CN104951467B (en) 2019-04-30

Family

ID=54166130

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410123667.0A Active CN104951467B (en) 2014-03-28 2014-03-28 Statistical method and device

Country Status (1)

Country Link
CN (1) CN104951467B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106897280A (en) * 2015-12-17 2017-06-27 阿里巴巴集团控股有限公司 Data query method and device
CN106933923A (en) * 2015-12-31 2017-07-07 北京国双科技有限公司 The method and apparatus for screening session

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103049296A (en) * 2012-12-28 2013-04-17 北界创想(北京)软件有限公司 Method and device for automatically matching target application for downloading equipment
US20130144863A1 (en) * 2011-05-25 2013-06-06 Forensic Logic, Inc. System and Method for Gathering, Restructuring, and Searching Text Data from Several Different Data Sources
US20140025626A1 (en) * 2012-04-19 2014-01-23 Avalon Consulting, LLC Method of using search engine facet indexes to enable search-enhanced business intelligence analysis

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130144863A1 (en) * 2011-05-25 2013-06-06 Forensic Logic, Inc. System and Method for Gathering, Restructuring, and Searching Text Data from Several Different Data Sources
US20140025626A1 (en) * 2012-04-19 2014-01-23 Avalon Consulting, LLC Method of using search engine facet indexes to enable search-enhanced business intelligence analysis
CN103049296A (en) * 2012-12-28 2013-04-17 北界创想(北京)软件有限公司 Method and device for automatically matching target application for downloading equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106897280A (en) * 2015-12-17 2017-06-27 阿里巴巴集团控股有限公司 Data query method and device
CN106897280B (en) * 2015-12-17 2020-07-14 菜鸟智能物流控股有限公司 Data query method and device
CN106933923A (en) * 2015-12-31 2017-07-07 北京国双科技有限公司 The method and apparatus for screening session
CN106933923B (en) * 2015-12-31 2020-04-21 北京国双科技有限公司 Method and device for screening session

Also Published As

Publication number Publication date
CN104951467B (en) 2019-04-30

Similar Documents

Publication Publication Date Title
US10922361B2 (en) Identifying and structuring related data
CN105719329B (en) Bookkeeping voucher generation method and system
CN102915373A (en) Data storage method and device
CN109564573A (en) Platform from computer application metadata supports cluster
CN103902535A (en) Method, device and system for obtaining associational word
CN109064031A (en) Project stakeholder&#39;s credit assessment method, block chain and storage medium based on block chain
CN103631791A (en) Information fusion classification display method and system
CN107403111A (en) HIVE data desensitization method and device
CN104993962A (en) Method and system for obtaining use state of terminal
CN109359237A (en) It is a kind of for search for boarding program method and apparatus
CN114817968B (en) Method, device and equipment for tracing path of featureless data and storage medium
CN105144155A (en) Visually representing queries of multi-source data
CN106471501A (en) The method of data query, the storage method data system of data object
CN105302730A (en) Calculation model detection method, testing server and service platform
CN109471893A (en) Querying method, equipment and the computer readable storage medium of network data
CN104199977A (en) Method for creating information search based on data in database
CN104699788A (en) Database query method and device
CN104951467A (en) Statistical method and device
CN111488386B (en) Data query method and device
CN107273401A (en) Management method, mobile device and the storage device of application data file
CN111553133B (en) Report generation method and device, electronic equipment and storage medium
CN113553425A (en) Data aggregation method, device, equipment and storage medium based on RPA and AI
CN102129455A (en) Patent retrieval method and system based on cloud storage
CN104750823A (en) Popularization condition data search method and device
CN109508364A (en) The analysis of public opinion method and device of chat group

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20211126

Address after: No. 699, Wangshang Road, Binjiang District, Hangzhou, Zhejiang

Patentee after: Alibaba (China) Network Technology Co.,Ltd.

Address before: Box 847, four, Grand Cayman capital, Cayman Islands, UK

Patentee before: ALIBABA GROUP HOLDING Ltd.

TR01 Transfer of patent right