CN114416812A - Data statistical method and device, electronic equipment and storage medium - Google Patents

Data statistical method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114416812A
CN114416812A CN202111531049.6A CN202111531049A CN114416812A CN 114416812 A CN114416812 A CN 114416812A CN 202111531049 A CN202111531049 A CN 202111531049A CN 114416812 A CN114416812 A CN 114416812A
Authority
CN
China
Prior art keywords
data
dimension
service data
target
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.)
Pending
Application number
CN202111531049.6A
Other languages
Chinese (zh)
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.)
Beijing SoundAI Technology Co Ltd
Original Assignee
Beijing SoundAI Technology Co 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 Beijing SoundAI Technology Co Ltd filed Critical Beijing SoundAI Technology Co Ltd
Priority to CN202111531049.6A priority Critical patent/CN114416812A/en
Publication of CN114416812A publication Critical patent/CN114416812A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Probability & Statistics with Applications (AREA)
  • Software Systems (AREA)
  • Fuzzy Systems (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application relates to a data statistical method, a device, an electronic device and a storage medium, which are applied to the technical field of data processing, wherein the method comprises the following steps: acquiring service data of a target service at fixed time according to a first fixed time period, and counting the service data in each dimension aiming at the service data in a single first fixed time period to obtain a statistical result of the service data in each dimension; storing the statistical result of the service data of each dimension into a first data table; responding to a data statistics request aiming at the business data of any dimension, and acquiring one or more statistics results of the business data of any dimension from a first data table; and determining a final statistical result of the business data of any dimension according to one or more statistical results. The method and the device can improve the efficiency of data statistics.

Description

Data statistical method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a data statistics method and apparatus, an electronic device, and a storage medium.
Background
With the continuous development of technology, massive data can be generated in various fields of work and life of people. In the related art, the data can be counted and updated in real time through a computer, and the data can be displayed. However, as the amount of data increases, the time period for data statistics also increases, resulting in a decrease in the efficiency of data statistics.
Disclosure of Invention
In order to solve the technical problem, the application provides a data statistics method, a data statistics device, an electronic device and a storage medium.
According to a first aspect of the present application, there is provided a data statistics method, comprising:
acquiring service data of a target service at fixed time according to a first timing period, and counting the service data in each dimension aiming at the service data in a single first timing period to obtain a counting result of the service data in each dimension;
storing the statistical result of the service data of each dimension into a first data table;
responding to a data statistics request aiming at the business data of any dimension, and acquiring one or more statistics results of the business data of any dimension from the first data table;
and determining a final statistical result of the service data of any dimension according to the one or more statistical results.
Optionally, the method further includes:
detecting the service data of each dimension according to a second timing period;
if the service data of each dimension in the single second timing period comprises the service data of the target dimension, storing the statistical result of the service data of the target dimension to a second data table; wherein the amount of data stored in the second data table is less than the amount of data stored in the first data table;
responding to a data statistics request aiming at the business data of the target dimension, and acquiring one or more statistics results of the business data of the target dimension from the second data table;
and determining a final statistical result of the business data of the target dimension according to one or more statistical results of the business data of the target dimension.
Optionally, the method further includes:
acquiring target service data from the first data table at regular time according to a third timing period; wherein, the data state corresponding to the target service data is a target state;
and for a single target service data in each third timing period, if the target service data is not contained in the third data table, storing the target service data into the third data table.
Optionally, the method further includes:
acquiring the data state of the service data of the target dimension in the second data table and the data state of the service data of the target dimension in the first data table at fixed time according to a fourth timing period;
if the data state of the service data of the target dimension in the second data table is changed within a single fourth timing period and the data state of the service data of the target dimension in the first data table is not changed, synchronously updating the data state of the service data of the target dimension in the first data table, or,
and if the data state of the service data of the target dimension in the first data table is changed and the data state of the service data of the target dimension in the second data table is not changed within a single fourth timing period, synchronously updating the data state of the service data of the target dimension in the second data table.
Optionally, the number of the service data of the target dimension is smaller than a preset number, or the query frequency of the service data of the target dimension is higher than a preset frequency.
Optionally, the multiple statistical results of the service data of any dimension include: the statistical result of the service data of any dimension in each first timing period;
determining a final statistical result of the service data of any dimension according to the one or more statistical results includes:
and determining the sum of the statistical results of the service data of any dimension in each first timing period as a final statistical result of the service data of any dimension.
Optionally, for the service data in a single first timing period, counting the service data in each dimension to obtain a statistical result of the service data in each dimension, where the statistical result includes:
and determining the dimensionality to which the service data belongs aiming at each service data in the single first timing period, and adding 1 to the statistical result of the service data of the dimensionality, wherein the initial value of the statistical result of the service data of each dimensionality is 0.
According to a second aspect of the present application, there is provided a data statistics apparatus comprising:
the timing statistic module is used for acquiring service data of a target service at fixed time according to a first timing period, and counting the service data in each dimension aiming at the service data in the single first timing period to obtain a statistic result of the service data in each dimension;
the first data storage module is used for storing the statistical results of the service data of each dimension into a first data table;
a statistical result obtaining module, configured to obtain, in response to a data statistics request for service data of any dimension, one or more statistical results of the service data of any dimension from the first data table;
and the final statistical result determining module is used for determining the final statistical result of the service data of any dimension according to the one or more statistical results.
Optionally, the data statistics apparatus further includes:
the timing detection module is used for detecting the service data of each dimension in a timing mode according to a second timing period;
a second data storage module, configured to store, if the service data of each dimension in a single second timing period includes service data of a target dimension, a statistical result of the service data of the target dimension to a second data table; wherein the amount of data stored in the second data table is less than the amount of data stored in the first data table;
the statistical result obtaining module is further configured to obtain one or more statistical results of the service data of the target dimension from the second data table in response to a data statistical request for the service data of the target dimension;
and the final statistical result determining module is further used for determining a final statistical result of the service data of the target dimension according to one or more statistical results of the service data of the target dimension.
Optionally, the data statistics apparatus further includes:
the target service data timing acquisition module is used for acquiring target service data from the first data table according to a third timing period; wherein, the data state corresponding to the target service data is a target state;
and a third data storage module, configured to, for a single piece of the target service data in each third timing period, store the target service data in a third data table if the third data table does not contain the target service data.
Optionally, the data statistics apparatus further includes:
a data state obtaining module, configured to obtain, at regular time, a data state of the service data of the target dimension in the second data table and a data state of the service data of the target dimension in the first data table according to a fourth timing period;
a first updating module, configured to update the data state of the service data of the target dimension in the first data table synchronously if the data state of the service data of the target dimension in the second data table is changed and the data state of the service data of the target dimension in the first data table is not changed within a single fourth timing period, or,
a second updating module, configured to update the data state of the service data of the target dimension in the second data table synchronously if the data state of the service data of the target dimension in the first data table is changed and the data state of the service data of the target dimension in the second data table is not changed within a single fourth timing period.
Optionally, the number of the service data of the target dimension is smaller than a preset number, or the query frequency of the service data of the target dimension is higher than a preset frequency.
Optionally, the multiple statistical results of the service data of any dimension include: the statistical result of the service data of any dimension in each first timing period;
the final statistical result determining module is specifically configured to determine a sum of statistical results of the service data of any dimension in each first timing period as a final statistical result of the service data of any dimension.
Optionally, the timing statistics module is specifically configured to obtain service data of a target service at regular time according to a first timing period, determine, for each service data in a single first timing period, a dimension to which the service data belongs, and add 1 to a statistical result of the service data of the dimension, where an initial value of the statistical result of the service data of each dimension is 0.
According to a third aspect of the present application, there is provided an electronic device comprising: a processor for executing a computer program stored in a memory, the computer program, when executed by the processor, implementing the method of the first aspect.
According to a fourth aspect of the present application, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of the first aspect.
According to a fifth aspect of the present application, there is provided a computer program product which, when run on a computer, causes the computer to perform the method of the first aspect.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages:
the service data of the target service can be acquired at regular time according to the first timing period, and when the service data in the first timing period is acquired, the service data in the first timing period can be counted in each dimension, so that a corresponding counting result is obtained and stored in the first data table. When the business data of any dimension are counted, the counted counting result can be directly obtained from the first data table, and the counting from a large amount of business data is not needed. Therefore, the method and the device adopt a timing task mode, the overhead of data statistics can be saved, and the efficiency of data statistics is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
FIG. 1 shows a schematic diagram of a system architecture of an exemplary application environment to which the data statistics method of an embodiment of the present application may be applied;
FIG. 2 is a flow chart of a data statistics method in an embodiment of the present application;
FIG. 3 is a flowchart of a data statistics method according to an embodiment of the present application;
FIG. 4 is a flowchart of a data statistics method according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a data statistics apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
In order that the above-mentioned objects, features and advantages of the present application may be more clearly understood, the solution of the present application will be further described below. It should be noted that the embodiments and features of the embodiments of the present application may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application, but the present application may be practiced in other ways than those described herein; it is to be understood that the embodiments described in this specification are only some embodiments of the present application and not all embodiments.
Fig. 1 shows a schematic diagram of a system architecture of an exemplary application environment to which the data statistics method of the embodiments of the present application can be applied.
As shown in fig. 1, system architecture 100 may include one or more of terminal device 101, terminal device 102, terminal device 103, network 104, and server 105. Network 104 is the medium used to provide communication links between terminal device 101, terminal device 102, terminal device 103, and server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few. The terminal devices 101, 102, 103 may be various electronic devices having a display screen, including but not limited to desktop computers, portable computers, smart phones, tablet computers, and the like. It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. For example, server 105 may be a server cluster comprised of multiple servers, or the like.
The data statistics method provided by the embodiment of the present application is generally executed by the server 105, and accordingly, the data statistics apparatus may be disposed in the server 105. However, it is easily understood by those skilled in the art that the data statistics method provided in the embodiments of the present application may also be executed by the terminal device 101, the terminal device 102, and the terminal device 103. For example, a maintenance person may perform a business operation through applications in the terminal device 101, the terminal device 102, and the terminal device 103 to generate corresponding business data. The server 105 may obtain the corresponding service data, and perform statistics on the service data to obtain a corresponding statistical result. The maintainer can inquire the corresponding statistical result through the terminal device 101, the terminal device 102 and the terminal device 103.
First, the data statistics method according to the embodiment of the present application will be described in detail below.
Referring to fig. 2, fig. 2 is a flowchart of a data statistics method in an embodiment of the present application, which may include the following steps:
step S210, periodically obtaining the service data of the target service according to the first timing period, and counting the service data in each dimension for the service data in a single first timing period to obtain a statistical result of the service data in each dimension.
In the embodiment of the present application, the target service may be a service related to data statistics. For example, in the event of a viral transmission infection, various regions are tested for the virus and, for control, personnel in the various regions are vaccinated. In the process, a large amount of data is generated, and the data can be counted and updated in real time. According to the method and the device, data can be counted based on a timed task mode, namely, the business data of the target business can be obtained according to a preset first timing period, and when the business data in one first timing period is obtained, the business data in the first timing period can be counted in each dimension, so that the counting result of the business data in each dimension is obtained.
For example, in virus detection, the number of reservations, the number of detected persons, the number of persons who cancel reservations, the number of persons whose detection results are positive, the number of persons whose detection results are negative, and the like can be counted. At the time of vaccination, since each person may need to be vaccinated 2 to 3 times, the number of reserved persons, the number of persons who have been vaccinated, the number of persons who cancel the reservation, etc., the number of persons who have completed all the vaccinations, etc. can be counted.
Optionally, the service data may be counted in each dimension according to the following manner: and determining the dimensionality to which the service data belongs for each service data in a single first timing period, and adding 1 to the statistical result of the service data of the dimensionality, wherein the initial value of the statistical result of the service data of each dimensionality is 0.
Step S220, storing the statistical result of the service data of each dimension into a first data table.
After the statistical results of the service data of each dimension are obtained, the statistical results may be stored in the first data table. Therefore, when the statistical result is required to be inquired, the statistical result can be directly read through the interface. The first data table can be a MySQL table, MySQL is a relational database management system, and the relational database can store data in different tables instead of putting all data in a large warehouse, so that the speed of data query and the flexibility of query can be improved.
Step S230, in response to the data statistics request for the service data of any dimension, obtaining one or more statistics results of the service data of any dimension from the first data table.
When a maintainer wants to query a statistical result, the maintainer can send a data statistical request, and the data statistical request can carry a statistical time period, statistical dimensionality and the like. The server responds to the data statistics request, and can directly obtain one or more statistics results corresponding to the data statistics request from the first data table without inquiring corresponding service data from a large amount of data and counting the inquired service data. Therefore, the problem of low efficiency caused by real-time statistics can be avoided. It can be understood that, the statistical time period and the statistical dimension are different, and one or more obtained statistical results are also different.
Step S240, determining a final statistical result of the service data of any dimension according to one or more statistical results.
And under the condition that the statistical result is one, the statistical result is the final statistical result. And under the condition that the number of the statistical results is multiple, the statistical results correspond to different first timing periods, and the sum of the statistical results is determined as a final statistical result. Optionally, under the condition that the data statistics request carries the statistical dimension but does not carry the statistical time period, the statistical result of the service data of any dimension in all the time periods may be counted. The plurality of statistics of the business data of any dimension may include: the statistical result of the service data of any dimension in each first timing period; and determining the sum of the statistical results of the service data of any dimension in each first timing period as the final statistical result of the service data of any dimension.
The data statistical method in the embodiment of the application can acquire the service data of the target service at regular time according to the first timing period, and when the service data in the first timing period is acquired, the service data in the first timing period can be counted in each dimension, so that the corresponding statistical result is obtained and stored in the first data table. When the business data of any dimension are counted, the counted counting result can be directly obtained from the first data table, and the counting from a large amount of business data is not needed. Therefore, the method and the device adopt a timing task mode, the overhead of data statistics can be saved, and the efficiency of data statistics is improved.
Referring to fig. 3, fig. 3 is a flowchart of a data statistics method in an embodiment of the present application, which may include the following steps:
and step S310, detecting the service data of each dimension according to the timing of the second timing period.
It can be understood that, due to the large amount of data in the first data table, if the statistical result of the service data is directly queried from the first data table, the query efficiency is low. Therefore, the service data of each dimension can be detected in a timing task mode to detect whether the service data of each dimension contains the service data of the target dimension. The second timing period may be the same as or different from the first timing period. For example, the first timing period may be 1 hour, the second timing period may be 1 hour, or the second timing period may be 2 hours.
The business data of the target dimension refers to business data which can not need to be queried in a whole table. Optionally, the number of the service data of the target dimension is smaller than the preset number, or the query frequency of the service data of the target dimension is higher than the preset frequency. That is, for the service data with a small data amount or the service data with a high query frequency, the following step S320 may be performed without performing the table query, so as to improve the query efficiency.
Step S320, if the service data of each dimension in a single second timing period includes the service data of the target dimension, storing the statistical result of the service data of the target dimension to a second data table.
The method and the device can generate a new data table, namely a second data table, and the data quantity stored in the second data table is smaller than that stored in the first data table. And if the service data of each dimension in a single second timing period comprises the service data of the target dimension, storing the statistical result of the service data of the target dimension into a second data table. In this way, the statistical result can be directly inquired from the second data table without inquiring the statistical result from the first data table with larger data quantity, thereby improving the efficiency of data statistics.
For example, in a virus detection scenario, most people may be detected once, and a small number of people may need to be reviewed. Because the number of the reinspectors is small, when the reinspectors are stored in the first data table, the reinspectors can be stored in the second data table. Therefore, when the rechecker is counted, the statistical result can be obtained from the second data table.
Step S330, in response to the data statistics request for the service data of the target dimension, obtaining one or more statistics results of the service data of the target dimension from the second data table.
The data statistics request may carry a statistics dimension, and the data statistics request carries a target dimension for the service data of the target dimension. In response to a data statistics request for the business data of the target dimension, a corresponding statistics result may be obtained from the second data table based on the target dimension.
Step S340, determining a final statistical result of the service data of the target dimension according to one or more statistical results of the service data of the target dimension.
And under the condition that the statistical result is one, the statistical result is the final statistical result. And under the condition that the number of the statistical results is multiple, the statistical results correspond to different second timing periods, and the sum of the statistical results is determined as a final statistical result.
Step S350, periodically obtaining the data state of the service data of the target dimension in the second data table and the data state of the service data of the target dimension in the first data table according to the fourth timing period.
Because the first data table and the second data table contain the same service data, in order to avoid that the data states of the same service data in the two data tables are different, a timing task can be adopted, and the data states of the service data of the target dimension in the first data table and the second data table are obtained at regular time according to the fourth timing period, so as to detect whether the data state of the service data of the target dimension is changed.
Step S360, if the data state of the service data of the target dimension in the second data table is changed and the data state of the service data of the target dimension in the first data table is not changed within a single fourth timing period, the data state of the service data of the target dimension in the first data table is updated synchronously.
In some scenarios, the maintainer changes the state of the service data of the target dimension in the second data table, but does not change the state of the service data of the target dimension in the first data table, and at this time, the data state of the service data of the target dimension in the first data table may be synchronously updated through a timing task.
For example, in a virus detection scenario, for the reinspectors, the statistical results of the reinspectors may be stored in the second data table because the data amount is small. If the retest result of a certain person is positive during the retest and the previous test result is negative, the test result can be changed from negative to positive in the second data table. The maintenance personnel may not update the first data table synchronously when updating the second data table, so the data state of the business data of the target dimension in the first data table and the second data table can be detected regularly to change the detection result in the first data table from negative to positive.
Step S370, if the data state of the service data of the target dimension in the first data table is changed and the data state of the service data of the target dimension in the second data table is not changed within a single fourth timing period, the data state of the service data of the target dimension in the second data table is updated synchronously.
Similar to the foregoing step S360, if the data state of the service data of the target dimension in the first data table is changed and the data state of the service data of the target dimension in the second data table is not changed, the data state of the service data of the target dimension in the second data table may be updated synchronously.
According to the data statistical method, for the service data of the target dimension, a whole-table query mode is not adopted, namely data is not queried from the first data table, and a timing task and a mode of generating a new data table (second data table) are adopted to save the overhead of data statistics, so that the efficiency of data statistics is improved. And aiming at the problem that the data in the first data table and the second data table are inconsistent, synchronous updating can be carried out, and the accuracy of the data is improved.
Referring to fig. 4, fig. 4 is a flowchart of a data statistics method in an embodiment of the present application, which may include the following steps:
step S410, obtaining target service data from the first data table according to the third timing period; and the data state corresponding to the target service data is the target state.
In the data statistics, statistics can be performed according to the data state of the service data in addition to the statistics according to the dimension. For example, the traffic data whose data state is the target state, i.e., the target traffic data, may be counted. Similarly, the target service data can also be counted in a timing task mode.
And in a virus detection scene, the detection result comprises negative and positive, and if the number of people with negative detection results needs to be counted, the corresponding business data with negative data states is the target business data.
Step S420, for a single target service data in each third timing period, if the third data table does not contain the target service data, storing the target service data into the third data table.
For the target service data, the target service data may also be stored through an independent data table (i.e., a third data table). Since there may be duplicate data in the first data table, a deduplication operation may be performed during storing the target service data in the third data table. That is, before each storage, it is determined whether the third data table already contains the target service data, and if so, the target service data is not stored; if not, storing.
For example, if a person has undergone multiple virus tests and the test results are all negative, then there will be multiple data for that person in the first data table. When the data of the person is stored in the third data table, only one piece of data may be stored.
By the method, the target service data is stored in the third data table, so that data statistics can be performed from the third data table, and the data volume in the third data table is smaller than that in the first data table and does not contain repeated data, so that the efficiency of data statistics can be improved.
Corresponding to the above method embodiment, the present application further provides a data statistics apparatus, and referring to fig. 5, the data statistics apparatus 500 includes:
a timing statistics module 510, configured to obtain service data of a target service at regular time according to a first timing period, and count the service data in each dimension for the service data in a single first timing period to obtain a statistics result of the service data in each dimension;
a first data storage module 520, configured to store a statistical result of the service data of each dimension into a first data table;
a statistical result obtaining module 530, configured to obtain one or more statistical results of the business data of any dimension from the first data table in response to a data statistical request for the business data of any dimension;
and a final statistical result determining module 540, configured to determine a final statistical result of the service data of any dimension according to one or more statistical results.
Optionally, the data statistics apparatus 500 further includes:
the timing detection module is used for detecting the service data of each dimension in a timing mode according to a second timing period;
the second data storage module is used for storing the statistical result of the service data of the target dimension to a second data table if the service data of each dimension in a single second timing period comprises the service data of the target dimension; the data volume stored in the second data table is smaller than the data volume stored in the first data table;
a statistical result obtaining module 530, configured to obtain one or more statistical results of the business data of the target dimension from the second data table in response to the data statistics request for the business data of the target dimension;
the final statistical result determining module 540 is further configured to determine a final statistical result of the service data of the target dimension according to one or more statistical results of the service data of the target dimension.
Optionally, the data statistics apparatus 500 further includes:
the target service data timing acquisition module is used for acquiring target service data from the first data table according to the third timing period; wherein, the data state corresponding to the target service data is the target state;
and a third data storage module, configured to, for a single target service data in each third timing period, store the target service data in the third data table if the third data table does not contain the target service data.
Optionally, the data statistics apparatus 500 further includes:
the data state acquisition module is used for acquiring the data state of the service data of the target dimension in the second data table and the data state of the service data of the target dimension in the first data table at fixed time according to the fourth timing period;
a first updating module, configured to update the data state of the service data of the target dimension in the first data table synchronously if the data state of the service data of the target dimension in the second data table is changed and the data state of the service data of the target dimension in the first data table is not changed within a single fourth timing period, or,
and the second updating module is used for synchronously updating the data state of the service data of the target dimension in the second data table if the data state of the service data of the target dimension in the first data table is changed and the data state of the service data of the target dimension in the second data table is not changed in a single fourth timing period.
Optionally, the number of the service data of the target dimension is smaller than the preset number, or the query frequency of the service data of the target dimension is higher than the preset frequency.
Optionally, the multiple statistical results of the service data of any dimension include: the statistical result of the service data of any dimension in each first timing period;
the final statistical result determining module 540 is specifically configured to determine a sum of statistical results of the service data of any dimension in each first timing period as a final statistical result of the service data of any dimension.
Optionally, the timing statistics module 510 is specifically configured to obtain service data of a target service at regular time according to a first timing period, determine, for each service data in a single first timing period, a dimension to which the service data belongs, and add 1 to a statistical result of the service data of the dimension, where an initial value of the statistical result of the service data of each dimension is 0.
The details of each module or unit in the above device have been described in detail in the corresponding method, and therefore are not described herein again.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
In an exemplary embodiment of the present application, there is also provided an electronic device including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to perform the above data statistics method in the present exemplary embodiment.
Fig. 6 is a schematic structural diagram of an electronic device in an embodiment of the present application. It should be noted that the electronic device 600 shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 6, the electronic apparatus 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for system operation are also stored. The central processing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a Local Area Network (LAN) card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. When the computer program is executed by the central processing unit 601, various functions defined in the apparatus of the present application are executed.
In an embodiment of the present application, a computer-readable storage medium is further provided, on which a computer program is stored, and the computer program, when executed by a processor, implements the data statistical method.
It should be noted that the computer readable storage medium shown in the present application can be, for example but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, radio frequency, etc., or any suitable combination of the foregoing.
In an embodiment of the present application, a computer program product is further provided, which, when running on a computer, causes the computer to execute the above data statistics method.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is merely exemplary of the present application and is presented to enable those skilled in the art to understand and practice the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method of data statistics, the method comprising:
acquiring service data of a target service at fixed time according to a first timing period, and counting the service data in each dimension aiming at the service data in a single first timing period to obtain a counting result of the service data in each dimension;
storing the statistical result of the service data of each dimension into a first data table;
responding to a data statistics request aiming at the business data of any dimension, and acquiring one or more statistics results of the business data of any dimension from the first data table;
and determining a final statistical result of the service data of any dimension according to the one or more statistical results.
2. The method of claim 1, further comprising:
detecting the service data of each dimension according to a second timing period;
if the service data of each dimension in the single second timing period comprises the service data of the target dimension, storing the statistical result of the service data of the target dimension to a second data table; wherein the amount of data stored in the second data table is less than the amount of data stored in the first data table;
responding to a data statistics request aiming at the business data of the target dimension, and acquiring one or more statistics results of the business data of the target dimension from the second data table;
and determining a final statistical result of the business data of the target dimension according to one or more statistical results of the business data of the target dimension.
3. The method of claim 1, further comprising:
acquiring target service data from the first data table at regular time according to a third timing period; wherein, the data state corresponding to the target service data is a target state;
and for a single target service data in each third timing period, if the target service data is not contained in the third data table, storing the target service data into the third data table.
4. The method of claim 2, further comprising:
acquiring the data state of the service data of the target dimension in the second data table and the data state of the service data of the target dimension in the first data table at fixed time according to a fourth timing period;
if the data state of the service data of the target dimension in the second data table is changed within a single fourth timing period and the data state of the service data of the target dimension in the first data table is not changed, synchronously updating the data state of the service data of the target dimension in the first data table, or,
and if the data state of the service data of the target dimension in the first data table is changed and the data state of the service data of the target dimension in the second data table is not changed within a single fourth timing period, synchronously updating the data state of the service data of the target dimension in the second data table.
5. The method of claim 2, wherein the amount of the business data of the target dimension is less than a preset amount, or the query frequency of the business data of the target dimension is higher than a preset frequency.
6. The method of claim 1, wherein the plurality of statistics of the traffic data of any dimension comprises: the statistical result of the service data of any dimension in each first timing period;
determining a final statistical result of the service data of any dimension according to the one or more statistical results includes:
and determining the sum of the statistical results of the service data of any dimension in each first timing period as a final statistical result of the service data of any dimension.
7. The method according to claim 1, wherein for the service data in a single first timing period, counting the service data in each dimension to obtain a statistical result of the service data in each dimension, includes:
and determining the dimensionality to which the service data belongs aiming at each service data in the single first timing period, and adding 1 to the statistical result of the service data of the dimensionality, wherein the initial value of the statistical result of the service data of each dimensionality is 0.
8. A data statistics apparatus, characterized in that the apparatus comprises:
the timing statistic module is used for acquiring service data of a target service at fixed time according to a first timing period, and counting the service data in each dimension aiming at the service data in the single first timing period to obtain a statistic result of the service data in each dimension;
the first data storage module is used for storing the statistical results of the service data of each dimension into a first data table;
a statistical result obtaining module, configured to obtain, in response to a data statistics request for service data of any dimension, one or more statistical results of the service data of any dimension from the first data table;
and the final statistical result determining module is used for determining the final statistical result of the service data of any dimension according to the one or more statistical results.
9. An electronic device, comprising: a processor for executing a computer program stored in a memory, the computer program, when executed by the processor, implementing the steps of the method of any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202111531049.6A 2021-12-14 2021-12-14 Data statistical method and device, electronic equipment and storage medium Pending CN114416812A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111531049.6A CN114416812A (en) 2021-12-14 2021-12-14 Data statistical method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111531049.6A CN114416812A (en) 2021-12-14 2021-12-14 Data statistical method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114416812A true CN114416812A (en) 2022-04-29

Family

ID=81268448

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111531049.6A Pending CN114416812A (en) 2021-12-14 2021-12-14 Data statistical method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114416812A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117851478A (en) * 2024-03-07 2024-04-09 成方金融科技有限公司 Data statistics method, device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101557316A (en) * 2009-05-14 2009-10-14 阿里巴巴集团控股有限公司 Method and system for updating statistical data
CN108959279A (en) * 2017-05-17 2018-12-07 北京京东尚科信息技术有限公司 Data processing method, data processing equipment, readable medium and electronic equipment
CN109840262A (en) * 2018-12-29 2019-06-04 深圳云天励飞技术有限公司 Data statistical approach and relevant apparatus
CN113094409A (en) * 2021-04-08 2021-07-09 国网电子商务有限公司 Service data processing method and device and computer storage medium
CN113312412A (en) * 2021-06-25 2021-08-27 建信金融科技有限责任公司 Statistical data acquisition method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101557316A (en) * 2009-05-14 2009-10-14 阿里巴巴集团控股有限公司 Method and system for updating statistical data
CN108959279A (en) * 2017-05-17 2018-12-07 北京京东尚科信息技术有限公司 Data processing method, data processing equipment, readable medium and electronic equipment
CN109840262A (en) * 2018-12-29 2019-06-04 深圳云天励飞技术有限公司 Data statistical approach and relevant apparatus
CN113094409A (en) * 2021-04-08 2021-07-09 国网电子商务有限公司 Service data processing method and device and computer storage medium
CN113312412A (en) * 2021-06-25 2021-08-27 建信金融科技有限责任公司 Statistical data acquisition method and device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117851478A (en) * 2024-03-07 2024-04-09 成方金融科技有限公司 Data statistics method, device, electronic equipment and storage medium
CN117851478B (en) * 2024-03-07 2024-07-16 成方金融科技有限公司 Data statistics method, device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109299348B (en) Data query method and device, electronic equipment and storage medium
CN108880931B (en) Method and apparatus for outputting information
CN106959894B (en) Resource allocation method and device
CN112115200A (en) Data synchronization method and device, electronic equipment and readable storage medium
CN107291835B (en) Search term recommendation method and device
CN110737655A (en) Method and device for reporting data
CN114416812A (en) Data statistical method and device, electronic equipment and storage medium
CN109634986B (en) System monitoring method, device, computer and computer readable storage medium
CN108764866B (en) Method and equipment for allocating resources and drawing resources
CN108011936B (en) Method and device for pushing information
CN109656803B (en) Information pushing method and device and electronic equipment
CN110928594A (en) Service development method and platform
EP3828705A1 (en) Method and apparatus for processing a service of an abnormal server
CN111124858B (en) Buried point-free insertion code data processing method, system, terminal equipment and storage medium
CN109189810B (en) Query method, query device, electronic equipment and computer-readable storage medium
CN113220705A (en) Slow query identification method and device
CN116204428A (en) Test case generation method and device
CN113377604B (en) Data processing method, device, equipment and storage medium
CN112131257B (en) Data query method and device
CN114036132A (en) Object information processing method and device, storage medium and electronic equipment
CN114968696A (en) Index monitoring method, electronic equipment and chip system
CN109787851A (en) A kind of traffic statistics acquisition methods and device
CN113535768A (en) Production monitoring method and device
CN113672791B (en) Method and device for determining search result sequence
CN113362097B (en) User determination method and device

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