CN109840262A - Data statistical approach and relevant apparatus - Google Patents
Data statistical approach and relevant apparatus Download PDFInfo
- Publication number
- CN109840262A CN109840262A CN201811654887.0A CN201811654887A CN109840262A CN 109840262 A CN109840262 A CN 109840262A CN 201811654887 A CN201811654887 A CN 201811654887A CN 109840262 A CN109840262 A CN 109840262A
- Authority
- CN
- China
- Prior art keywords
- statistical
- data
- statistics
- task
- service
- 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
Links
Landscapes
- Debugging And Monitoring (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The embodiment of the present application discloses data statistical approach and relevant apparatus, statistical fractals applied to data service system, the data service system includes the statistical fractals, multiple business services and multiple data services, each data service docks a database in the multiple data service, the statistical fractals and each data service are established by data source adapter communication connection, method includes: after the first statistics task for receiving the first business service in the multiple business service, it is obtained and associated first statistical data of first statistics task from the multiple data service;According to the first statistical data described in default statistics strategy and model treatment, the first statistical result is obtained;First statistical result is saved in the local data base of the statistical fractals.The application is conducive to improve the statistical efficiency and search efficiency of data.
Description
Technical field
This application involves electronic technology fields, and in particular to a kind of method and relevant apparatus of data statistics.
Background technique
Existing statistical fractals be respectively counted according to the data service and statistical demand of docking each database, and
Statistical result is provided, different data are potentially stored under different databases, and counting strategy and statistical model may be one
It causes, needs to distinguish the statistics interface for docking each data service and providing so as to cause business service, then respectively by business service
Retain statistical data.Different business services may use identical statistics strategy and statistical model, to cause resource wave
Take, statistical efficiency is low, and when the more data volumes of data dimension for needing to count are big, the process of statistics can be long.
Summary of the invention
The embodiment of the present application provides a kind of data statistical approach and relevant apparatus, to improve the statistical efficiency of data and look into
Ask efficiency.
In a first aspect, the embodiment of the present application provides a kind of data statistical approach, the statistics applied to data service system is taken
Business, the data service system include the statistical fractals, multiple business services and multiple data services, the multiple data clothes
Each data service docks a database in business, and the statistical fractals and each data service pass through data source adapter
Foundation has communication connection;The described method includes:
After the first statistics task for receiving the first business service in the multiple business service, from described more
It is obtained and associated first statistical data of first statistics task in a data service;
According to the first statistical data described in default statistics strategy and model treatment, the first statistical result is obtained;
First statistical result is saved in the local data base of the statistical fractals.
Second aspect, the embodiment of the present application provide a kind of data service system, including at least one server, it is described at least
One server includes business service, statistical fractals and multiple data services, at least one described server is for executing first
Step in any one of aspect method.
The third aspect, the embodiment of the present application provide a kind of server, including processor, memory, communication interface and one
A or multiple programs, wherein said one or multiple programs are stored in above-mentioned memory, and are configured by above-mentioned processing
Device executes, and above procedure is included the steps that for executing the instruction in the embodiment of the present application first aspect either method.
Fourth aspect, the embodiment of the present application provide a kind of computer readable storage medium, wherein above-mentioned computer-readable
Storage medium storage is used for the computer program of electronic data interchange, wherein above-mentioned computer program executes computer such as
Step some or all of described in the embodiment of the present application first aspect either method.
5th aspect, the embodiment of the present application provide a kind of computer program product, wherein above-mentioned computer program product
Non-transient computer readable storage medium including storing computer program, above-mentioned computer program are operable to make to calculate
Machine executes the step some or all of as described in the embodiment of the present application first aspect either method.The computer program product
It can be a software installation packet.
As can be seen that statistical fractals are receiving in the multiple business service first in the embodiment of the present application
After first statistics task of the first business service, obtained from the multiple data service associated with first statistics task
First statistical data, secondly, the first statistical data according to default statistics strategy and model treatment, obtains the first statistics knot
Fruit, finally, the local data base in the statistical fractals saves first statistical result.Due to statistical fractals and multiple data
Service has communication connection by data source adapter foundation, and each data service is docked a database and therefore received
To after the first statistics task of the first business service, it can obtain from multiple data services and be associated with the first statistics task simultaneously
The first data, and the first statistical data is counted to obtain the first statistical result according to preset statistics strategy and model,
First statistical result is stored in local data base to facilitate inquiry, is conducive to improve data statistics efficiency and search efficiency.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of application for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is a kind of structural schematic diagram of data service system provided by the embodiments of the present application;
Fig. 2 is a kind of flow diagram of data statistical approach provided by the embodiments of the present application;
Fig. 3 is the flow diagram of another data statistical approach provided by the embodiments of the present application;
Fig. 4 is the flow diagram of another data statistical approach provided by the embodiments of the present application;
Fig. 5 is a kind of structural schematic diagram of server provided by the embodiments of the present application;
Fig. 6 is a kind of functional unit composition block diagram of data statistics device provided by the embodiments of the present application.
Specific embodiment
In order to make those skilled in the art more fully understand application scheme, below in conjunction in the embodiment of the present application
Attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is only
Some embodiments of the present application, instead of all the embodiments.Based on the embodiment in the application, those of ordinary skill in the art
Every other embodiment obtained without creative efforts, shall fall in the protection scope of this application.
The description and claims of this application and term " first " in above-mentioned attached drawing, " second " etc. are for distinguishing
Different objects, are not use to describe a particular order.In addition, term " includes " and " having " and their any deformations, it is intended that
It is to cover and non-exclusive includes.Such as the process, method, system, product or equipment for containing a series of steps or units do not have
It is defined in listed step or unit, but optionally further comprising the step of not listing or unit, or optionally also wrap
Include other step or units intrinsic for these process, methods, product or equipment.
Referenced herein " embodiment " is it is meant that a particular feature, structure, or characteristic described can wrap in conjunction with the embodiments
It is contained at least one embodiment of the application.Each position in the description occur the phrase might not each mean it is identical
Embodiment, nor the independent or alternative embodiment with other embodiments mutual exclusion.Those skilled in the art explicitly and
Implicitly understand, embodiment described herein can be combined with other embodiments.
Server involved by the embodiment of the present application may include various handheld devices, mobile unit, wearable device,
Calculate equipment or be connected to radio modem other processing equipments and various forms of user equipment (User
Equipment, UE), mobile station (Mobile Station, MS), server apparatus (terminal Pevice) etc..
The embodiment of the present application proposes a kind of data statistical approach, is situated between in detail to the embodiment of the present application with reference to the accompanying drawing
It continues.
The embodiment of the present application provides a kind of data statistical approach of expansible more granularities of high-performance, by data service system
Default statistics strategy and statistical model abstract as statistical fractals, and statistical fractals dock realization with multiple data services
The function of statistics and inquiry, can support offline search and real-time query, statistics task be executed by fixed point, when concentration retains minimum
Between granularity statistical result, externally provide free time section and multiple time granularities statistical query function, solve statistics dimension
Single problem is spent, more granularities are embodied.For example, having a statistics task is the on-job people for counting company A in every month, 2018
Member's number, is the on-the-job personnel's number for counting B company in every month, 2018 there are one statistics task, although being different statistics
Task, multi-data source may also from different databases, but count strategy and model can be it is identical, if allowing industry
Business service differentiation docks the interface that each data service provides, and be easy to cause the wasting of resources and statistical efficiency low.
It as described in Figure 1, is a kind of structural schematic diagram of data service system provided by the embodiments of the present application, data service system
System includes at least one server, at least one described server includes multiple business services, statistical fractals and multiple data clothes
Business, the corresponding relationship between each service and server can be uniquely, and it is unique for may not be, such as can be with one
A corresponding server is serviced, alternatively, multiple services correspond to a server.Business service is mainly used for presentation user's interaction page
Face, developer can issue statistics task and query task to statistical fractals by business service, every in multiple data services
A data service docks a database, and the Sybase of target on the market has very much, and Oracle data are illustrated only in Fig. 1
Library and MySQL database, there are also other kinds of databases certainly, do not do any restriction herein.Statistical fractals and each data
Service has a communication connection by data source adapter foundation, and data source adapter is for by the database of mainstream on the market at present
Unified interface packaging is all done, allows data source that there is scalability, so that statistical fractals can be supported to obtain different data simultaneously
The data in library are simultaneously counted, and therefore, by the same statistical fractals, can be executed for different data service and business clothes
The statistics task of business.
Referring to Fig. 2, Fig. 2 is that the embodiment of the present application provides a kind of flow diagram of data statistical approach, it is applied to
The statistical fractals of data service system, the data service system include the statistical fractals, multiple business services and multiple numbers
According to service, each data service docks a database, the statistical fractals and every number in the multiple data service
There is communication connection by data source adapter foundation according to service;The described method includes:
S201, the statistical fractals are in the first system for receiving the first business service in the multiple business service
After meter task, obtained and associated first statistical data of first statistics task from the multiple data service.
Wherein, the corresponding equipment of statistical fractals can be server, realize statistical fractals by running on the server
Function.After statistical fractals are received from the first statistics task of the first business service, due to statistical fractals and multiple data
Service has communication connection by data source adapter foundation, therefore, can count at top speed with first from multiple data services simultaneously
Associated first statistical data of task.
S202, the statistical fractals first statistical data according to default statistics strategy and model treatment, obtains first
Statistical result.
Wherein, after getting the first statistical data, according to preset statistics strategy and the first statistical number of model treatment
According to, it obtains the first statistical result, includes that multiple preset statistics are tactful and model in statistical fractals, according to the first statistics task,
Which specifically used default statistics strategy and model determined, thus, the first statistical data is counted to obtain the first statistics knot
Fruit.Statistical model is the model established using the method for data statistics based on probability theory, some processes can not use theoretical point
Analysis method exports its model, but can acquire the functional relation between each variable by statistical approach by test determination data,
As model.By general linear model, generalized linear model and mixed model, the meaning of statistical model exists common statistical model
Can still have statistics when doing and inferring to the regularity of a large amount of chance events.Statistics strategy is then for according to statistical condition, choosing
Optimal statistical model is selected, and in statistic processes, can prioritize processing which statistics item.
S203, the statistical fractals save first statistical result in the local data base of the statistical fractals.
Wherein, it is corresponding to be stored in statistical fractals after obtaining the first statistical result by statistical fractals for the first statistical result
Local data base in.
Wherein, the statistical result that the statistical data from disparate databases obtains can be stored in respectively difference by statistical fractals
Statistical result divide in table, meanwhile, statistical result can be saved to as unit of the time and be formed statistical result table, statistics is appointed
The execution of business is exactly a preparatory processing to initial data in fact, and initial data is done a simple statistics according to condition,
Obtained statistical result is saved by chronomere of day, and allowing for these basic datas in this way can be according to query demand certainly
By carry out assemble.Such as the chronomere of some statistics task is day, i.e., executes primary statistics, each statistical result daily
It is all stored in a statistical result to divide in table, daily statistical result constitutes statistical result summary table.In addition to most basic day,
Week, the moon, season, Nian Deng chronomere, also support customized time granularity, such as with two days, three weeks, two months etc. are time grain
Degree statistics, can meet a variety of statistical demands.
As can be seen that statistical fractals are receiving in the multiple business service first in the embodiment of the present application
After first statistics task of the first business service, obtained from the multiple data service associated with first statistics task
First statistical data, secondly, the first statistical data according to default statistics strategy and model treatment, obtains the first statistics knot
Fruit, finally, the local data base in the statistical fractals saves first statistical result.Due to statistical fractals and multiple data
Service has communication connection by data source adapter foundation, and each data service is docked a database and therefore received
To after the first statistics task of the first business service, it can obtain from multiple data services and be associated with the first statistics task simultaneously
The first data, and the first statistical data is counted to obtain the first statistical result according to preset statistics strategy and model,
First statistical result is stored in local data base to facilitate inquiry, is conducive to improve data statistics efficiency and search efficiency.
In a possible example, the method also includes: receiving being directed to from first business service
When the first query task of first statistics task, first statistics is inquired from the local data base of the statistical fractals
First statistical result of task;First statistical result is sent to first business service.
Wherein, statistical fractals are inquired in the local database when receiving the first query task from business service
The first business service is fed back to for the first statistical result of the first statistics task, and by the first statistical result inquired.
Wherein, enquiry module externally only provide a statistical result query interface, it is internal then be divided into offline statistical query with
Real-time statistics inquiry.For offline statistical query, the statistical result obtained after being executed due to statistics task can be unit according to day
Primary statistics result table is saved as, then according to query demand, the task ID for issuing inquiry, statistical items, statistical time section etc.
Condition will return after primary statistics result assembling processing.Real-time statistics are inquired, i.e., need real-time calling corresponding according to business
Infrastructure service interface executes statistics, and the freedom degree of statistics is very high, as the supplement counted offline, it is statistics available to it is current newest when
Between data, the time granularity of support is subject to initial data, and minimum can support millisecond.The two combines available customized
Data statistic.
Wherein, in the application the statistics of statistical fractals and inquiry be it is separated, statistical fractals pass through timer asynchronicity execute
First statistics task simultaneously obtains the first statistical data from non-local data library, and the first statistical result is then stored in local number
According in library;When receiving the request of the first statistical result of inquiry, statistical fractals can appoint according to the statistics section and statistics of inquiry
The case where business executes, the data for being divided into the existing data of local data base and needing to obtain from non-local data library.Really operate
Itself data Jing Guo preparatory processing can be external than operation initial data it is many fastly, design avoid any count all in this way
Initial data is obtained from non-local data library to be calculated again, network inputs output is substantially reduced, to substantially increase
Statistic property breaches the performance bottleneck in traditional design.
As it can be seen that business service provides user's interaction page for research staff in this example, can be taken by the first business
Business issues statistics task and query task, and the specific implementation of statistics task and query service is executed by statistical fractals.
In a possible example, described obtain from the multiple data service is associated with first statistics task
The first statistical data, comprising: according to first statistics task, determine multiple databases of the multiple data service docking
In, it is stored with the target database with associated first statistical data of first statistics task;It is adapted to by the data source
Device is stored in associated first system of in the target database and described first statistics task from the acquisition of the same communication interface
It counts.
Wherein, according to statistical fractals according to the first statistics task, in the multiple databases for determining multiple data service docking,
It is stored with the target database with associated first statistical data of the first statistics task, thus, by data source adapter from same
One communication interface obtains the first statistical data being stored in target database.For example, statistical fractals and five data services
Foundation has communication connection, the available data being stored in this five databases, but is stored in only three databases
With associated first statistical data of the first statistics task, what the first statistics task needed to count is the data in nearest one month,
The data being stored with respectively in different time sections in three databases, therefore, it is necessary to the first system is obtained from these three databases
It counts.
As it can be seen that in this example, since statistical fractals and the foundation of multiple data services have communication connection, and each data service
When to being connected to a database, but execute the first statistics task, need first to determine that the first statistics is stored in multiple databases appoints
It is engaged in associated first statistical data, i.e. target database, thus, it is only necessary to the first statistical data is obtained from target database.
It is described to receive the first business service in the multiple business service in a possible example
After first statistics task, acquisition and associated first statistical data of first statistics task from the multiple data service,
It include: to scan whether have the statistics task from the multiple business service according to predeterminated frequency by timer;It is scanning
To after the first statistics task of the first business service in the multiple business service, in holding for first statistics task
The row time determines whether the historical data for first statistics task;If so, being obtained from the multiple data service
With associated first statistical data of first statistics task.
Wherein, a timer built in statistical fractals can be scanned by timer statistical fractals according to predeterminated frequency
Whether statistics task from multiple business services is had, for example, statistical fractals can be scanned for subtask statistics every 0.5
Table detects whether the statistics task from business service, to avoid statistics task or delay disposal statistics task is omitted.
Wherein, statistical fractals determine that the first statistics is appointed after scanning to the first statistics task from the first business service
The execution time of business can be the carrying of the first statistics task between execution, for example, when the first statistics task carries execution
Between, it specifically may be perhaps some date or after a few days at some moment, after having arrived the execution time, statistical fractals be can determine whether
Whether historical data for first statistics task is had, if so, then obtaining from multiple databases by data source adapter
With associated first statistics task of the first statistics task.
Wherein, statistics task mainly includes preset statistics task and customized statistics task, if each business service
Go to issue the statistics task as one, it will cause the waste of resource, therefore statistical fractals can preset some statistics tasks, with full
The some general business statistics demands of foot, these statistics are all the statistical reliability datas of not conditional, and statistical fractals can be voluntarily right
Preset statistical fractals are counted, for example, counting primary, just at regular intervals so as to timely update after database update
Statistical result.In addition, different demands of the customized statistics task according to business, what research staff can be issued by business service
Statistics task under custom condition, the result come out are all with conditional.
As it can be seen that statistical fractals include a timer in this example, whether have from business service so as to timing scan
Statistics task, to avoid omit statistics task, also, can by obtain the first statistics task the execution time, when being executed between
Temporarily executing the first statistics task, therefore, increases the diversity and rich of the first statistics task execution.
In a possible example, the method also includes: the statistical content of first statistics task is stored in
In the local data base of the statistical fractals, the statistical content includes at least one of the following: statistical condition, statistical items, execution
Time.
Wherein, statistical fractals obtain the statistical content of the first statistics task and will unite after receiving the first statistics task
At least one of content to be counted to save in the local database, statistical content may include statistical condition, in statistical items and execution time.
Creation, deletion and the excuse for modifying statistics task that statistical fractals externally provide, can be operated by business service and be retained in statistics clothes
The statistics task and its statistical content being engaged in local data base.
As it can be seen that statistical fractals are after getting the first statistics task, in the task of the first statistics task of acquisition in this example
Hold and store in local data base, statistical content includes the execution time of the first statistics task, thus, when being executed between arrive
The first statistics task of execution, when being executed between arrive before, research staff can cancel at any time the first statistics by business service
Task improves the reliability of statistical query.
In a possible example, first statistical result is saved as unit of the time and forms statistical result
Table;It is described receive from first business service for first statistics task the first query task when, from
The first statistical result of first statistics task is inquired in the local data base of the statistical fractals, comprising: obtain described the
The querying condition of one query task, the querying condition include query time section;When corresponding according to the statistical result table
Between unit, the complete statistical result whether having in the query time section in the statistical result table determined;If so, from institute
It states and inquires the statistical result table in local data base and obtain first statistical result.
Wherein, due to the data of multi-data source there is variation a possibility that, therefore statistical fractals also have have it is certain
Fault-tolerance design.The design provides a kind of statistical calibration function, i.e., deletes the statistical result in specified time and unite again
Meter.
Wherein, the querying condition for obtaining the first query task, so that it is determined that the corresponding query time area of the first query task
Between, whether according to the corresponding chronomere of statistical result table, determining has in the statistical result table in the query time section
Interior complete statistical result obtains first statistics so as to inquire the statistical result table from the local data base
As a result.For example, querying condition is the attendance data statistics inquired between 7 points to 9 points of morning, it is stored at 7 points in statistical result table
Attendance data statistics between to 12 points, and checking-in result statistics one statistical result of stroke of each hour divides table, therefore,
Statistical result can be obtained by query statistic result table directly from local data base.
As it can be seen that in this example, by the querying condition for obtaining the first query task, it is determined whether can be in statistical result table
In inquire corresponding statistical result, if so, directly inquiring, similar offline search.Corresponding inquiry knot can be inquired rapidly
Fruit.
In a possible example, the statistical module carries out saving as unit of the time by the statistical result and shape
At statistical result table;It is described to receive the first inquiry for first statistics task from first business service
When task, the first statistical result of first statistics task is inquired from the local data base of the statistical fractals, comprising: obtain
The querying condition of first query task is taken, the querying condition includes query time section;According to the statistical result table
Corresponding chronomere determines the complete statistical result whether having in the query time section in the statistical result table;
If it is not, from the statistical data obtained in the multiple data service in the statistical time section, and calculate first system
The statistical result of meter task and the statistical result is updated to the statistical result table.
Wherein, the querying condition for obtaining the first query task, so that it is determined that the corresponding query time area of the first query task
Between, whether according to the corresponding chronomere of statistical result table, determining has in the statistical result table in the query time section
Interior complete statistical result obtains first statistics so as to inquire the statistical result table from the local data base
As a result.For example, querying condition is to inquire to count to the attendance data between 6 pm 7 points of morning, it is stored in statistical result table
Attendance data statistics between 7 points to 12 points, therefore, it is necessary to the statistical time section is obtained from the multiple data service
Interior statistical data, and calculate the statistical result of first statistics task and update the statistical result to the statistics
As a result table.
As it can be seen that in this example, by the querying condition for obtaining the first query task, it is determined whether can be in statistical result table
In inquire corresponding statistical result, if it is not, then needing from being obtained in the multiple data service in the statistical time section
Statistical data, and calculate first statistics task statistical result and by the statistical result update to the statistics knot
Fruit table, at this point, the corresponding statistical result of the first statistics task can be inquired.
It is consistent with above-mentioned embodiment shown in Fig. 2, referring to Fig. 3, Fig. 3 is another number provided by the embodiments of the present application
The flow diagram of method according to statistics, applied to the statistical fractals of data service system, the data service system includes described
Statistical fractals, multiple business services and multiple data services, each data service docks a number in the multiple data service
According to library, the statistical fractals have communication connection by data source adapter foundation with each data service, as shown, this
Data statistical approach includes:
S301, the statistical fractals are in the first system for receiving the first business service in the multiple business service
After meter task, obtained and associated first statistical data of first statistics task from the multiple data service.
S302, the statistical fractals first statistical data according to default statistics strategy and model treatment, obtain first
Statistical result.
S303, the statistical fractals save first statistical result in the local data base of the statistical fractals.
S304, the statistical fractals receive from first business service for first statistics task
When the first query task, the first statistics knot of first statistics task is inquired from the local data base of the statistical fractals
Fruit.
First statistical result is sent to first business service by S305, the statistical fractals.
As can be seen that statistical fractals are receiving in the multiple business service first in the embodiment of the present application
After first statistics task of the first business service, obtained from the multiple data service associated with first statistics task
First statistical data, secondly, the first statistical data according to default statistics strategy and model treatment, obtains the first statistics knot
Fruit, finally, the local data base in the statistical fractals saves first statistical result.Due to statistical fractals and multiple data
Service has communication connection by data source adapter foundation, and each data service is docked a database and therefore received
To after the first statistics task of the first business service, it can obtain from multiple data services and be associated with the first statistics task simultaneously
The first data, and the first statistical data is counted to obtain the first statistical result according to preset statistics strategy and model,
First statistical result is stored in local data base to facilitate inquiry, is conducive to improve data statistics efficiency and search efficiency.
In addition, business service provides user's interaction page for research staff, system can be issued by the first business service
The specific implementation of meter task and query task, statistics task and query service is executed by statistical fractals.
Consistent with above-mentioned Fig. 2, embodiment shown in Fig. 3, please referring to 4, Fig. 4 is another kind provided by the embodiments of the present application
The flow diagram of data statistical approach, applied to the statistical fractals of data service system, the data service system includes institute
Statistical fractals, multiple business services and multiple data services are stated, each data service docks one in the multiple data service
Database, the statistical fractals and each data service have communication connection by data source adapter foundation, as shown,
Notebook data statistical method includes:
S401, the statistical fractals are in the first system for receiving the first business service in the multiple business service
After meter task, according to first statistics task, in multiple databases for determining the multiple data service docking, be stored with and
The target database of associated first statistical data of first statistics task.
S402, the statistical fractals are stored in the mesh from the acquisition of the same communication interface by the data source adapter
Mark in database and described associated first statistical data of first statistics task.
S403, the statistical fractals first statistical data according to default statistics strategy and model treatment, obtain first
Statistical result.
S404, the statistical fractals save first statistical result in the local data base of the statistical fractals.
S405, the statistical fractals receive from first business service for first statistics task
When the first query task, the first statistics knot of first statistics task is inquired from the local data base of the statistical fractals
Fruit.
First statistical result is sent to first business service by S406, the statistical fractals.
As can be seen that statistical fractals are receiving in the multiple business service first in the embodiment of the present application
After first statistics task of the first business service, obtained from the multiple data service associated with first statistics task
First statistical data, secondly, the first statistical data according to default statistics strategy and model treatment, obtains the first statistics knot
Fruit, finally, the local data base in the statistical fractals saves first statistical result.Due to statistical fractals and multiple data
Service has communication connection by data source adapter foundation, and each data service is docked a database and therefore received
To after the first statistics task of the first business service, it can obtain from multiple data services and be associated with the first statistics task simultaneously
The first data, and the first statistical data is counted to obtain the first statistical result according to preset statistics strategy and model,
First statistical result is stored in local data base to facilitate inquiry, is conducive to improve data statistics efficiency and search efficiency.
In addition, business service provides user's interaction page for research staff, system can be issued by the first business service
The specific implementation of meter task and query task, statistics task and query service is executed by statistical fractals.
Further, since statistical fractals and the foundation of multiple data services have a communication connection, and each data service is to being connected to one
A database, but when executing the first statistics task, need first to determine that the first statistics task is stored in multiple databases is associated
First statistical data, i.e. target database, thus, it is only necessary to the first statistical data is obtained from target database.
It is consistent with above-mentioned Fig. 2, Fig. 3, embodiment shown in Fig. 4, referring to Fig. 5, Fig. 5 is provided by the embodiments of the present application
A kind of structural schematic diagram of server 500, as shown, the server 500 include application processor 510, memory 520,
Communication interface 530 and one or more programs 521, wherein one or more of programs 521 are stored in above-mentioned memory
In 520, and it is configured to be executed by above-mentioned application processor 510, one or more of programs 521 include following for executing
The instruction of step;
After the first statistics task for receiving the first business service in the multiple business service, from described more
It is obtained and associated first statistical data of first statistics task in a data service;
According to the first statistical data described in default statistics strategy and model treatment, the first statistical result is obtained;
First statistical result is saved in the local data base of the statistical fractals.
As can be seen that statistical fractals are receiving in the multiple business service first in the embodiment of the present application
After first statistics task of the first business service, obtained from the multiple data service associated with first statistics task
First statistical data, secondly, the first statistical data according to default statistics strategy and model treatment, obtains the first statistics knot
Fruit, finally, the local data base in the statistical fractals saves first statistical result.Due to statistical fractals and multiple data
Service has communication connection by data source adapter foundation, and each data service is docked a database and therefore received
To after the first statistics task of the first business service, it can obtain from multiple data services and be associated with the first statistics task simultaneously
The first data, and the first statistical data is counted to obtain the first statistical result according to preset statistics strategy and model,
First statistical result is stored in local data base to facilitate inquiry, is conducive to improve data statistics efficiency and search efficiency.
In a possible example, the instruction in described program is specifically used for executing following operation: coming from receiving
First business service for first statistics task the first query task when, from the local number of the statistical fractals
According to the first statistical result for inquiring first statistics task in library;First statistical result is sent to first business
Service.
In a possible example, closed in described obtained from the multiple data service with first statistics task
In terms of first statistical data of connection, the instruction in described program is specifically used for executing following operation: being appointed according to first statistics
It is engaged in, in the multiple databases for determining the multiple data service docking, is stored with and first statistics task associated first
The target database of statistical data;The number of targets is stored in from the acquisition of the same communication interface by the data source adapter
According in library and described associated first statistical data of first statistics task.
In a possible example, the first business service in the multiple business service is being received described
The first statistics task after, from the multiple data service obtain and associated first statistical data of first statistics task
Whether aspect, the instruction in described program: being scanned by timer according to predeterminated frequency has if being specifically used for executing following operation
Statistics task from the multiple business service;In scanning to the first business service in the multiple business service
After first statistics task, going through for first statistics task is determined whether in the execution time of first statistics task
History data;If so, being obtained and associated first statistical data of first statistics task from the multiple data service.
In a possible example, the instruction in described program is specifically used for executing following operation: described first is united
The statistical content of meter task is stored in the local data base of the statistical fractals, and the statistical content includes following at least one
: statistical condition, executes the time at statistical items.
In a possible example, first statistical result is saved as unit of the time and forms statistical result
Table;It is described receive from first business service for first statistics task the first query task when,
In terms of the first statistical result for inquiring first statistics task from the local data base of the statistical fractals, in described program
Instruction be also used to execute following operation: obtain the querying condition of first query task, the querying condition includes inquiry
Time interval;According to the corresponding chronomere of the statistical result table, determines whether to have in the statistical result table and be looked into described
Ask the complete statistical result in time interval;
In a possible example, the statistical module carries out saving as unit of the time by the statistical result and shape
At statistical result table;Looking into for the first of first statistics task from first business service is being received described
When inquiry task, in terms of the first statistical result that first statistics task is inquired from the local data base of the statistical fractals,
Instruction in described program is specifically used for executing following operation: obtaining the querying condition of first query task, the inquiry
Condition includes query time section;According to the corresponding chronomere of the statistical result table, determining in the statistical result table is
The no complete statistical result having in the query time section;If it is not, obtaining the system from the multiple data service
The statistical data in time interval is counted, and calculates the statistical result of first statistics task and updates the statistical result
To the statistical result table.
It is understood that server is in order to realize the above functions, it comprises execute each corresponding hardware knot of function
Structure and/or software module.Those skilled in the art should be readily appreciated that, describe in conjunction with embodiment presented herein
Each exemplary unit and algorithm steps, the application can be realized with the combining form of hardware or hardware and computer software.Certain
A function is executed in a manner of hardware or computer software driving hardware actually, depending on technical solution specific application and
Design constraint.Professional technician specifically can realize described function using distinct methods to each,
But this realization is it is not considered that exceed scope of the present application.
The embodiment of the present application can carry out the division of functional unit according to above method example to server, for example, can be with
Two or more functions, can also be integrated in a processing unit by corresponding each each functional unit of function division
In.Above-mentioned integrated unit both can take the form of hardware realization, can also realize in the form of software functional units.It needs
It is noted that be schematical, only a kind of logical function partition to the division of unit in the embodiment of the present application, it is practical real
It is current that there may be another division manner.
Fig. 6 is the functional unit composition block diagram of data statistics device 600 involved in the embodiment of the present application.Control dress
It sets 600 and is applied to server, including processing unit 601 and communication unit 602, wherein
The processing unit 601 obtains the querying condition of first query task, institute by the communication unit 602
Stating querying condition includes query time section;And for described according to the corresponding chronomere of the statistical result table, determining
Whether complete statistical result the query time section in is had in statistical result table;And it is used for if it is not, from described more
The statistical data in the statistical time section is obtained in a data service, and calculates the statistical result of first statistics task
And the statistical result is updated to the statistical result table.
Wherein, the data statistics device 600 can also include storage unit 603, the program generation for storage server
Code and data.The processing unit 601 can be processor, and the communication unit 602 can be touching display screen or transmitting-receiving
Device, storage unit 603 can be memory.
As can be seen that statistical fractals are receiving in the multiple business service first in the embodiment of the present application
After first statistics task of the first business service, obtained from the multiple data service associated with first statistics task
First statistical data, secondly, the first statistical data according to default statistics strategy and model treatment, obtains the first statistics knot
Fruit, finally, the local data base in the statistical fractals saves first statistical result.Due to statistical fractals and multiple data
Service has communication connection by data source adapter foundation, and each data service is docked a database and therefore received
To after the first statistics task of the first business service, it can obtain from multiple data services and be associated with the first statistics task simultaneously
The first data, and the first statistical data is counted to obtain the first statistical result according to preset statistics strategy and model,
First statistical result is stored in local data base to facilitate inquiry, is conducive to improve data statistics efficiency and search efficiency.
In a possible example, the processing unit 601 is specifically used for: taking receiving from first business
Business be directed to first statistics task the first query task when, from the local data base of the statistical fractals inquire described in
First statistical result of the first statistics task;And for first statistical result to be sent to first business service.
In a possible example, closed in described obtained from the multiple data service with first statistics task
In terms of first statistical data of connection, the processing unit 601 is specifically used for: according to first statistics task, determining described more
In multiple databases of a data service docking, it is stored with the target with associated first statistical data of first statistics task
Database;And for being stored in the target database by the data source adapter from the acquisition of the same communication interface
And associated first statistical data of the first statistics task.
In a possible example, the first business service in the multiple business service is being received described
The first statistics task after, from the multiple data service obtain and associated first statistical data of first statistics task
Whether aspect, the processing unit 601: being scanned by timer according to predeterminated frequency has from the multiple industry if being specifically used for
The statistics task of business service;And for the first system in scanning to the first business service in the multiple business service
After meter task, the history number for first statistics task is determined whether in the execution time of first statistics task
According to;And it is used for if so, being obtained and associated first statistical data of first statistics task from the multiple data service.
The processing unit 601 described in a possible example is also used to: by the statistical content of first statistics task
It is stored in the local data base of the statistical fractals, the statistical content includes at least one of the following: statistical condition, statistics
Item executes the time.
In a possible example, first statistical result is saved as unit of the time and forms statistical result
Table;It is described receive from first business service for first statistics task the first query task when,
In terms of the first statistical result for inquiring first statistics task from the local data base of the statistical fractals, the processing is single
Member 601 is specifically used for: obtaining the querying condition of first query task, the querying condition includes query time section;With
And for whether according to the corresponding chronomere of the statistical result table, determining to have in the inquiry in the statistical result table
Between complete statistical result in section;And for being obtained if so, inquiring the statistical result table from the local data base
First statistical result.
In a possible example, first statistical result is saved as unit of the time and forms statistical result
Table;It is described receive from first business service for first statistics task the first query task when,
In terms of the first statistical result for inquiring first statistics task from the local data base of the statistical fractals, the processing is single
Member 601 is specifically used for: obtaining the querying condition of first query task, the querying condition includes query time section;With
And for whether according to the corresponding chronomere of the statistical result table, determining to have in the inquiry in the statistical result table
Between complete statistical result in section;And for if it is not, obtaining the statistical time area from the multiple data service
Interior statistical data, and calculate the statistical result of first statistics task and update the statistical result to the system
Count result table.
The embodiment of the present application also provides a kind of computer storage medium, wherein computer storage medium storage is for electricity
The computer program of subdata exchange, the computer program make computer execute any as recorded in above method embodiment
Some or all of method step, above-mentioned computer include server.
The embodiment of the present application also provides a kind of computer program product, and above-mentioned computer program product includes storing calculating
The non-transient computer readable storage medium of machine program, above-mentioned computer program are operable to that computer is made to execute such as above-mentioned side
Some or all of either record method step in method embodiment.The computer program product can be a software installation
Packet, above-mentioned computer includes server.
It should be noted that for the various method embodiments described above, for simple description, therefore, it is stated as a series of
Combination of actions, but those skilled in the art should understand that, the application is not limited by the described action sequence because
According to the application, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art should also know
It knows, the embodiments described in the specification are all preferred embodiments, related actions and modules not necessarily the application
It is necessary.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment
Point, reference can be made to the related descriptions of other embodiments.
In several embodiments provided herein, it should be understood that disclosed device, it can be by another way
It realizes.For example, the apparatus embodiments described above are merely exemplary, such as the division of said units, it is only a kind of
Logical function partition, there may be another division manner in actual implementation, such as multiple units or components can combine or can
To be integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual
Coupling, direct-coupling or communication connection can be through some interfaces, the indirect coupling or communication connection of device or unit,
It can be electrical or other forms.
Above-mentioned unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of software functional units.
If above-mentioned integrated unit is realized in the form of SFU software functional unit and sells or use as independent product
When, it can store in a computer-readable access to memory.Based on this understanding, the technical solution of the application substantially or
Person says that all or part of the part that contributes to existing technology or the technical solution can body in the form of software products
Reveal and, which is stored in a memory, including some instructions are used so that a computer equipment
(can be personal computer, server or network equipment etc.) executes all or part of each embodiment above method of the application
Step.And memory above-mentioned includes: USB flash disk, read-only memory (ROM, ReaP-Only Memory), random access memory
The various media that can store program code such as (RAM, RanPom Access Memory), mobile hard disk, magnetic or disk.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of above-described embodiment is can
It is completed with instructing relevant hardware by program, which can store in a computer-readable memory, memory
May include: flash disk, read-only memory (English: ReaP-Only Memory, referred to as: ROM), random access device (English:
RanPom Access Memory, referred to as: RAM), disk or CD etc..
The embodiment of the present application is described in detail above, specific case used herein to the principle of the application and
Embodiment is expounded, the description of the example is only used to help understand the method for the present application and its core ideas;
At the same time, for those skilled in the art can in specific embodiments and applications according to the thought of the application
There is change place, in conclusion the contents of this specification should not be construed as limiting the present application.
Claims (10)
1. a kind of data statistical approach, which is characterized in that applied to the statistical fractals of data service system, the data service system
System includes the statistical fractals, multiple business services and multiple data services, each data service in the multiple data service
Docking a database, the statistical fractals and each data service has communication connection by data source adapter foundation;
The described method includes:
After the first statistics task for receiving the first business service in the multiple business service, from the multiple number
It is obtained and associated first statistical data of first statistics task according in service;
According to the first statistical data described in default statistics strategy and model treatment, the first statistical result is obtained;
First statistical result is saved in the local data base of the statistical fractals.
2. the method according to claim 1, wherein the method also includes:
Receive from first business service for first statistics task the first query task when, from described
The first statistical result of first statistics task is inquired in the local data base of statistical fractals;
First statistical result is sent to first business service.
3. being obtained from the multiple data service and described the method according to claim 1, wherein described
Associated first statistical data of one statistics task, comprising:
According to first statistics task, in multiple databases for determining the multiple data service docking, be stored with it is described
The target database of associated first statistical data of first statistics task;
In the target database and described the are stored in from the acquisition of the same communication interface by the data source adapter
Associated first statistical data of one statistics task.
4. the method according to claim 1, wherein described receiving in the multiple business service
After first statistics task of the first business service, is obtained from the multiple data service and first statistics task is associated
First statistical data, comprising:
Whether scanned by timer according to predeterminated frequency has the statistics task from the multiple business service;
After scanning the first statistics task to the first business service in the multiple business service, in first system
The execution time of meter task determines whether the historical data for first statistics task;
If so, being obtained and associated first statistical data of first statistics task from the multiple data service.
5. method according to claim 1-4, which is characterized in that the method also includes:
The statistical content of first statistics task is stored in the local data base of the statistical fractals, the statistical content
It includes at least one of the following: statistical condition, statistical items, execute the time.
6. method according to claim 1-4, which is characterized in that first statistical result is as unit of the time
It is saved and forms statistical result table;It is described to receive appointing for first statistics from first business service
When the first query task of business, the first statistics of first statistics task is inquired from the local data base of the statistical fractals
As a result, comprising:
The querying condition of first query task is obtained, the querying condition includes query time section;
Whether according to the corresponding chronomere of the statistical result table, determining has in the statistical result table in the query time
Complete statistical result in section;
If so, inquiring the statistical result table from the local data base obtains first statistical result.
7. method according to claim 1-4, which is characterized in that the statistical module by the statistical result with
Time is that unit is saved and forms statistical result table;It is described receive from first business service for described
When the first query task of the first statistics task, first statistics task is inquired from the local data base of the statistical fractals
The first statistical result, comprising:
The querying condition of first query task is obtained, the querying condition includes query time section;
Whether according to the corresponding chronomere of the statistical result table, determining has in the statistical result table in the query time
Complete statistical result in section;
If it is not, from the statistical data obtained in the multiple data service in the statistical time section, and calculate described
The statistical result of one statistics task and the statistical result is updated to the statistical result table.
8. a kind of data service system, which is characterized in that including at least one server, at least one described server includes more
A business service, statistical fractals and multiple data services, at least one described server is for executing as claim 1-7 is any
Step in item method.
9. a kind of electronic equipment, which is characterized in that including processor, memory, communication interface, and one or more programs,
One or more of programs are stored in the memory, and are configured to be executed by the processor, described program packet
Include the instruction for executing the step in the method according to claim 1 to 7.
10. a kind of computer readable storage medium, which is characterized in that storage is used for the computer program of electronic data interchange,
In, the computer program makes computer execute the method according to claim 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811654887.0A CN109840262B (en) | 2018-12-29 | 2018-12-29 | Data statistical method and related device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811654887.0A CN109840262B (en) | 2018-12-29 | 2018-12-29 | Data statistical method and related device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109840262A true CN109840262A (en) | 2019-06-04 |
CN109840262B CN109840262B (en) | 2021-03-05 |
Family
ID=66883626
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811654887.0A Active CN109840262B (en) | 2018-12-29 | 2018-12-29 | Data statistical method and related device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109840262B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110908886A (en) * | 2019-11-28 | 2020-03-24 | 北京达佳互联信息技术有限公司 | Data sending method and device, electronic equipment and storage medium |
CN111935279A (en) * | 2020-08-08 | 2020-11-13 | 詹能勇 | Internet of things network maintenance method based on block chain and big data and computing node |
CN112084219A (en) * | 2020-09-16 | 2020-12-15 | 京东数字科技控股股份有限公司 | Method, apparatus, electronic device, and medium for processing data |
CN112131276A (en) * | 2020-09-27 | 2020-12-25 | 深圳市欢太科技有限公司 | Data statistics method, electronic equipment and readable storage medium |
CN112988831A (en) * | 2019-12-13 | 2021-06-18 | 深圳云天励飞技术有限公司 | Fault positioning method and related device |
CN114500418A (en) * | 2022-02-11 | 2022-05-13 | 珠海星云智联科技有限公司 | Data statistical method and related device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101557316A (en) * | 2009-05-14 | 2009-10-14 | 阿里巴巴集团控股有限公司 | Method and system for updating statistical data |
CN102509251A (en) * | 2011-09-27 | 2012-06-20 | 宇龙计算机通信科技(深圳)有限公司 | Data statistics method and device |
CN105550314A (en) * | 2015-12-14 | 2016-05-04 | Tcl集团股份有限公司 | Data statistics method, device and system based on combined major key |
CN105608207A (en) * | 2015-12-25 | 2016-05-25 | 广州华多网络科技有限公司 | Data statistics system based on Redis database and statistics method of data statistics system |
CN107562809A (en) * | 2017-08-10 | 2018-01-09 | 广州视源电子科技股份有限公司 | Business data statistical method, device and system and readable storage medium |
-
2018
- 2018-12-29 CN CN201811654887.0A patent/CN109840262B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101557316A (en) * | 2009-05-14 | 2009-10-14 | 阿里巴巴集团控股有限公司 | Method and system for updating statistical data |
CN102509251A (en) * | 2011-09-27 | 2012-06-20 | 宇龙计算机通信科技(深圳)有限公司 | Data statistics method and device |
CN105550314A (en) * | 2015-12-14 | 2016-05-04 | Tcl集团股份有限公司 | Data statistics method, device and system based on combined major key |
CN105608207A (en) * | 2015-12-25 | 2016-05-25 | 广州华多网络科技有限公司 | Data statistics system based on Redis database and statistics method of data statistics system |
CN107562809A (en) * | 2017-08-10 | 2018-01-09 | 广州视源电子科技股份有限公司 | Business data statistical method, device and system and readable storage medium |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110908886A (en) * | 2019-11-28 | 2020-03-24 | 北京达佳互联信息技术有限公司 | Data sending method and device, electronic equipment and storage medium |
CN112988831A (en) * | 2019-12-13 | 2021-06-18 | 深圳云天励飞技术有限公司 | Fault positioning method and related device |
CN112988831B (en) * | 2019-12-13 | 2024-06-07 | 深圳云天励飞技术有限公司 | Fault positioning method and related device |
CN111935279A (en) * | 2020-08-08 | 2020-11-13 | 詹能勇 | Internet of things network maintenance method based on block chain and big data and computing node |
CN111935279B (en) * | 2020-08-08 | 2021-07-09 | 江苏小梦科技有限公司 | Internet of things network maintenance method based on block chain and big data and computing node |
CN112084219A (en) * | 2020-09-16 | 2020-12-15 | 京东数字科技控股股份有限公司 | Method, apparatus, electronic device, and medium for processing data |
CN112131276A (en) * | 2020-09-27 | 2020-12-25 | 深圳市欢太科技有限公司 | Data statistics method, electronic equipment and readable storage medium |
CN114500418A (en) * | 2022-02-11 | 2022-05-13 | 珠海星云智联科技有限公司 | Data statistical method and related device |
CN114500418B (en) * | 2022-02-11 | 2023-10-20 | 珠海星云智联科技有限公司 | Data statistics method and related device |
Also Published As
Publication number | Publication date |
---|---|
CN109840262B (en) | 2021-03-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109840262A (en) | Data statistical approach and relevant apparatus | |
CN109558234A (en) | A kind of timed task dispatching method and device | |
CN103645954B (en) | A kind of CPU dispatching method based on heterogeneous multi-core system, device and system | |
US10459915B2 (en) | Managing queries | |
CN110442329A (en) | Generation method, device, storage medium and the computer equipment of code segment | |
CN109783512A (en) | Data processing method, device, computer equipment and storage medium | |
CN106933669B (en) | Apparatus and method for data processing | |
US8694647B2 (en) | Read-only operations processing in a paxos replication system | |
WO2014062637A2 (en) | Systems and methods for fault tolerant, adaptive execution of arbitrary queries at low latency | |
JP2002517035A (en) | Distributed computing environment using real-time scheduling logic and time-deterministic architecture | |
CN109271435A (en) | A kind of data pick-up method and system for supporting breakpoint transmission | |
CN105243125B (en) | Operation method, device, cluster and the inquiry data method and device of PrestoDB clusters | |
CN109408286A (en) | Data processing method, device, system, computer readable storage medium | |
CN107798135B (en) | Paging query method and device and electronic equipment | |
CN109298924A (en) | Management method, computer readable storage medium and the terminal device of timed task | |
CN107316124B (en) | Extensive affairs type job scheduling and processing general-purpose system under big data environment | |
CN104461710A (en) | Method and device for processing tasks | |
CN102760073B (en) | Method, system and device for scheduling task | |
CN109213493A (en) | Container dispositions method, special resource management terminal and readable storage medium storing program for executing | |
CN112463372A (en) | Target system capacity expansion method, device, equipment and storage medium | |
CN109933574A (en) | A kind of unique key generation method, device and terminal device | |
CN109840141A (en) | Thread control method, device, electronic equipment and storage medium based on cloud monitoring | |
Lee et al. | On-line scheduling of scalable real-time tasks on multiprocessor systems | |
CN106874079A (en) | A kind of method and device of tasks carrying | |
Haritsa et al. | Real-time database systems in the new millenium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |