Data processing method and device, storage medium and computer program product
By dividing the information items in the log data into types during the data statistics process, the high cost problems caused by manual analysis in the prior art are solved, and fast and efficient data statistics are achieved.
Patent Information
- Application Number
- CN202510197355.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-21
- Publication Date
- 2025-05-30
AI Technical Summary
The prior art requires manual analysis of the meaning of information items in the process of data statistics, resulting in higher labor and time costs.
By obtaining log data, the content of the first target information item is divided into p types. If it is a classification information item, it is classified according to a preset classification method. If it is a numerical information item, it is divided according to a numerical interval, and the record information is divided into corresponding record information sets for merging to generate statistical information.
It realizes the rapid and efficient division of information items into types, reducing the labor and time costs in the data statistics process.
Smart Images

Figure CN120067174A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and in particular, to a data processing method, apparatus, storage medium, and computer program product. Background Art
[0002] Currently, with the wide application of big data in various operations such as enterprise operation decisions, data statistics are required in more and more scenarios. Specifically, in the prior art, the process of data statistics specifically includes the following steps:
[0003] First, export the corresponding log data from the system.
[0004] Among them, the log data may include m record information, and each record information is used to record a target event that has occurred. Exemplarily, taking the target event as the user login behavior, the log data may be as Figure 1 shown. The log data includes 22 record information with serial numbers 1-22 respectively. Among them, each record information is respectively used to record a user login behavior (i.e., the target event) that has occurred, and each record information respectively includes 5 information items: "user", "gender", "city", "login time", and "online duration". These 5 information items are respectively used to record 5 types of information corresponding to the target event that has occurred. Among them, the information item "user" is used to record the user account corresponding to the target event that has occurred, the information item "gender" is used to record the user gender corresponding to the target event that has occurred, the information item "city" is used to record the city corresponding to the target event that has occurred, the information item "login time" is used to record the time stamp corresponding to the target event that has occurred, and the information item "online duration (minutes)" is used to record the duration corresponding to the target event that has occurred.
[0005] Then, for the information items that need to be statistically analyzed in the log data, classify the information items into types. For example, for Figure 1 the information item "gender" in the shown log data, the information item "gender" can be classified into two types: male and female.
[0006] Then, according to one or more record information corresponding to each type in the log data, generate statistical information corresponding to each type respectively. For example, according to Figure 1 the record information corresponding to "male" and the record information corresponding to "female" in the shown log data, generate statistical information corresponding to male and statistical information corresponding to female, such as Figure 2 shown.
[0007] Among them, since the number of information items in the log data is usually large ( Figure 1Only five information items are taken as examples for illustration (in actual application, there may be more information items), and the differences in the information items included in different log data (for example Figure 1 Only taking the user login behavior as an example, in actual application, the target event can be the user consumption behavior, the sales amount generated per unit time, etc.). Therefore, for different information items, it is usually necessary to manually analyze the meaning of the information item to classify the content of the information item, and then generate statistical information corresponding to each type according to one or more record information corresponding to each type. Therefore, it takes a lot of human and time costs to complete the above data statistics process. Summary of the Invention
[0008] To solve the above technical problems, the present application provides a data processing method, device, storage medium, and computer program product.
[0009] In a first aspect, the present application provides a data processing method, including: obtaining log data; the log data includes m record information, each of the record information is respectively used to record a target event that has occurred, and each of the record information includes n first information items, and the n first information items are respectively used to record n kinds of information corresponding to the target event that has occurred; dividing the content of the first target information item into p types; the first target information item is one of the n first information items; wherein, if the first target information item is an information item classified according to a preset classification method, the p types correspond to p classification texts corresponding to the preset classification method; if the first target information item is an information item for recording a numerical value, the p types correspond to p different numerical intervals; according to the content of the first target information item included in each of the m record information, dividing the m record information into p record information sets corresponding one-to-one to the p types; respectively merging the record information in each of the p record information sets to generate p pieces of statistical information; the p pieces of statistical information are respectively used to reflect the statistical results corresponding to each of the p types.
[0010] In the above method of the present application, it is considered that: the information items in the log data usually can include two types: one is the information item for classification according to a preset classification method (such as the information items "gender" and "city"), and the other is the information item for recording numerical values (such as the information items "login time" and "online duration (minutes)"). Therefore, after obtaining the log data in this method, the first target information item can be divided into p types in one of two ways (that is, if the first target information item is the information item for classification according to a preset classification method, then the p types correspond to p classification texts corresponding to the preset classification method, and if the first target information item is the information item for recording numerical values, then the p types correspond to p different numerical ranges). Thus, the first target information item can be quickly and efficiently divided into p types. Furthermore, the m record information can be divided into p record information sets corresponding one by one to the p types, and by respectively merging the record information in each record information set in the p record information sets, p statistical information can be generated, so that p statistical information can be obtained respectively for reflecting the statistical results corresponding to each of the p types. In this way, the data statistics process can be completed more quickly and efficiently, thereby reducing the human and time costs in data statistics.
[0011] In some implementation manners, if the first target information item is the information item for recording numerical values, then the p types correspond to p different numerical ranges, including: if the first target information item is the information item for recording time numerical values, then the p types respectively correspond to p time intervals of a first preset duration.
[0012] In some implementation manners, the method further includes: obtaining a query request; the query request is used to query the statistical result of the target event in the case where the statistical period is a second preset duration; wherein, the second preset duration is an integer multiple of the first preset duration; according to the query request, dividing the p statistical information into j statistical information sets; the j statistical information sets respectively correspond to j time intervals of the second preset duration; respectively merging the statistical information in each statistical information set in the j statistical information sets to generate j statistical information; the j statistical information are respectively used to reflect the statistical results corresponding to the j time intervals of the second preset duration.
[0013] In some implementation manners, the method further includes: obtaining a first user operation of selecting an information item from the n first information items; in response to the first user operation, determining a first target information item from the n first information items.
[0014] In some implementations, each of the p pieces of statistical information includes q second information items; the method further includes: obtaining a second user operation for requesting to display the content of the second target information item among the p pieces of statistical information; the second target information item is one of the q second information items; in response to the second user operation, determining a target chart type from multiple preset chart types; the multiple preset chart types include any one of a bar chart, a pie chart, and a line chart; generating and displaying a target chart of the target chart type; the target chart includes the content of the second target information item in each of the p pieces of statistical information.
[0015] In some implementations, the determining a target chart type from multiple preset chart types in response to the second user operation includes: if the p types correspond to p different numerical ranges, determining that the target chart type is a bar chart or a line chart.
[0016] In some implementations, the determining a target chart type from multiple preset chart types in response to the second user operation includes: if the p types correspond to p classification texts, determining that the target chart type is a bar chart or a pie chart.
[0017] In a second aspect, a data processing apparatus is provided, including: an obtaining unit configured to obtain log data; the log data includes m pieces of record information, each of the pieces of record information is respectively used to record a target event that has occurred, and each of the pieces of record information includes n first information items, and the n first information items are respectively used to record n types of information corresponding to the target event that has occurred; a processing unit configured to divide the content of the first target information item into p types; the first target information item is one of the n first information items; wherein, if the first target information item is an information item for classification according to a preset classification method, the p types correspond to p classification texts corresponding to the preset classification method; if the first target information item is an information item for recording a numerical value, the p types correspond to p different numerical ranges; the processing unit is further configured to divide the m pieces of record information into p record information sets corresponding one-to-one to the p types according to the content of the first target information item included in each of the m pieces of record information; the processing unit is further configured to respectively merge the record information in each of the p record information sets to generate p pieces of statistical information; the p pieces of statistical information are respectively used to reflect the statistical results corresponding to each of the p types.
[0018] In some implementations, if the first target information item is an information item for recording a numerical value, the p types correspond to p different numerical value ranges, including: if the first target information item is an information item for recording a time value, the p types respectively correspond to p time ranges of a first preset duration.
[0019] In some implementations, the obtaining unit is further configured to obtain a query request; the query request is used to query the statistical result of the target event in a case where the second preset duration is used as a statistical period; wherein the second preset duration is an integer multiple of the first preset duration; the processing unit is further configured to divide the p pieces of statistical information into j statistical information sets according to the query request; the j statistical information sets respectively correspond to j time ranges of the second preset duration; the processing unit is further configured to respectively merge the statistical information in each of the j statistical information sets to generate j pieces of statistical information; the j pieces of statistical information are respectively used to reflect the statistical results corresponding to the j time ranges of the second preset duration.
[0020] In some implementations, the obtaining unit is further configured to obtain a first user operation for selecting one information item from the n first information items; the processing unit is further configured to determine a first target information item from the n first information items in response to the first user operation.
[0021] In some implementations, each of the p pieces of statistical information includes q second information items; the obtaining unit is further configured to obtain a second user operation for requesting to display the content of a second target information item among the p pieces of statistical information; the second target information item is one of the q second information items; the processing unit is further configured to determine a target chart type from multiple preset chart types in response to the second user operation; the multiple preset chart types include any one of a bar chart, a pie chart, and a line chart; the processing unit is further configured to generate and display a target chart of the target chart type; the target chart includes the content of the second target information item in each of the p pieces of statistical information.
[0022] In some implementations, the processing unit is further configured to determine a target chart type from multiple preset chart types in response to the second user operation, including: the processing unit is further configured to determine the target chart type as a bar chart or a line chart if the p types correspond to p different numerical value ranges.
[0023] In some implementations, the processing unit is further configured to determine a target chart type from multiple preset chart types in response to the second user operation, including: if the p types correspond to p classification texts, the processing unit is further configured to determine that the target chart type is a bar chart or a pie chart.
[0024] In a third aspect, a data processing device is provided, including: a memory and a processor, where the memory is configured to store a computer program, and the processor is configured to cause the data processing device to implement the method according to the first aspect or any implementation manner in the first aspect when executing the computer program.
[0025] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a computing device, the computing device is caused to implement the method according to the first aspect or any implementation manner in the first aspect.
[0026] In a fifth aspect, a computer program product is provided. When the computer program product runs on a computer, the computer is caused to implement the method according to the first aspect or any implementation manner in the first aspect.
[0027] The technical solution provided in the embodiments of the present application has the following advantages compared with the prior art:
[0028] In the above method of the present application, it is considered that: the information items in the log data usually can include two types: one is the information item for classification according to a preset classification method (such as the information items "gender" and "city"), and the other is the information item for recording a value (such as the information items "login time" and "online duration (minutes)"). Therefore, after the log data is obtained, the first target information item can be divided into p types in one of two ways (that is, if the first target information item is an information item for classification according to a preset classification method, then the p types correspond to p classification texts corresponding to the preset classification method; if the first target information item is an information item for recording a value, then the p types correspond to p different value ranges). Thus, the first target information item can be quickly and efficiently divided into p types. Furthermore, the m record information can be divided into p record information sets corresponding one by one to the p types, and by respectively merging the record information in each record information set in the p record information sets to generate p statistical information, p statistical information for respectively reflecting the statistical results corresponding to each of the p types can be obtained. In this way, the data statistics process can be completed more quickly and efficiently, thereby reducing the human and time costs in data statistics. Description of the Drawings
[0029] The accompanying drawings here are incorporated into and form a part of this specification, showing embodiments consistent with this application, and are used together with the specification to explain the principles of this application.
[0030] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the following will briefly introduce the accompanying drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0031] Figure 1 A schematic diagram of a log data provided by an embodiment of this application;
[0032] Figure 2 One of the schematic diagrams of a statistical information provided by an embodiment of this application;
[0033] Figure 3 Another schematic diagram of a statistical information provided by an embodiment of this application;
[0034] Figure 4 One of the schematic flowcharts of a data processing method provided by an embodiment of this application;
[0035] Figure 5 Another schematic flowchart of a data processing method provided by an embodiment of this application;
[0036] Figure 6 Another schematic diagram of a statistical information provided by an embodiment of this application;
[0037] Figure 7 Another schematic flowchart of a data processing method provided by an embodiment of this application;
[0038] Figure 8 Another schematic flowchart of a data processing method provided by an embodiment of this application;
[0039] Figure 9 One of the schematic structural diagrams of a data processing device provided by an embodiment of this application;
[0040] Figure 10 Another schematic structural diagram of a data processing device provided by an embodiment of this application. Detailed implementation manners
[0041] To be able to more clearly understand the above objects, features, and advantages of this application, the following will further describe the solutions of this application. It should be noted that, without conflict, the embodiments of this application and the features in the embodiments can be combined with each other.
[0042] In the following description, many specific details are set forth to facilitate a full understanding of the present application, but the present application may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only part of the embodiments of the present application, rather than all of the embodiments.
[0043] The technical solution provided in the embodiments of the present application is introduced below.
[0044] In the embodiment of the present application, it is considered that: the information items in the log data can generally include two types: one is the information items for classification according to the preset classification method (for example, Figure 1 The other is information items that record values (e.g. Figure 1 "Login time" and "Online time (minutes)" in the information items).
[0045] Therefore, on one hand, when performing data statistics on information items classified according to a preset classification method, the content of the information item can be divided into p types according to the p types of classification texts included in the information item. Figure 1 The information item "gender" can be divided into two types, namely "male" and "female", according to the two classification texts "male" and "female". Figure 1 The information item "city" can be divided into multiple types according to multiple classification texts such as "Beijing" and "Shanghai". In this way, the record information in the log data can be divided into p record information sets corresponding to p types one by one, and the record information in each of the p record information sets is merged to generate p statistical information, so that p statistical information reflecting the statistical results corresponding to each of the p types can be obtained. For example Figure 2 The two pieces of statistical information generated are used to reflect the statistical results corresponding to the two types of "male" and "female".
[0046] On the other hand, when performing data statistics on information items that record numerical values, multiple numerical ranges can be divided (p numerical ranges are taken as an example below), and then the content of the information item can be divided into p types according to the numerical ranges into which the numerical values in the information item fall. Figure 1 The information item "login time" can be divided into p types by dividing the time interval into 24 hours. In this way, the record information in the log data can be divided into p record information sets corresponding to the p types, and the record information in each of the p record information sets can be merged to generate p pieces of statistical information, so that p pieces of statistical information reflecting the statistical results corresponding to each of the p types can be obtained, for example Figure 3The multiple pieces of statistical information generated as shown, which reflect the statistical results corresponding to each time interval.
[0047] Next, in combination with examples, the technical solutions provided in the embodiments of the present application will be introduced in detail. Specifically, the embodiments of the present application provide a data processing method. Among them, the execution subject of this data processing method can be a data processing device. When this data processing device runs, it can be used to execute all or part of the steps in the data processing method provided in the embodiments of the present application. Among them, in actual application, the functions of this data processing device can be realized by an electronic device such as a personal computer (including a desktop computer, a laptop computer, a handheld computer, and a notebook computer), or a smart phone, a server, etc.; or, the functions of the above data processing device can also be realized by some hardware / software devices in the above electronic devices. The embodiments of the present application do not impose special restrictions on the specific form of the data processing device.
[0048] As Figure 4 shown, the data processing method provided in the embodiments of the present application may include the following contents of S101-S103:
[0049] S101. The data processing device acquires log data.
[0050] Among them, the log data includes m pieces of record information. Among them, each piece of record information is respectively used to record a target event that has occurred. Exemplarily, taking the target event as the user login behavior, the log data can Figure 1 be shown as including 22 pieces of record information numbered 1-22, and each piece of record information is respectively used to record a user login behavior that has occurred.
[0051] In addition, each piece of record information respectively includes n information items (hereinafter referred to as n first information items), and the n first information items are respectively used to record n types of information corresponding to the target event that has occurred. For example Figure 1 in, each piece of record information respectively includes 5 first information items of "user", "gender", "city", "login time", and "online duration". These 5 first information items are respectively used to record 5 types of information corresponding to the target event that has occurred.
[0052] S102. The data processing device divides the content of the first target information item into p types.
[0053] Among them, the first target information item is one of the n first information items.
[0054] Among them, if the first target information item is an information item for classification according to a preset classification method, the p types correspond to p classification texts corresponding to the preset classification method.
[0055] For example, for Figure 1 the information item "gender" in Figure 1 , the content of this information item can be divided into two types, namely "male" and "female", according to the two classification texts "male" and "female". Another example is for Figure 1 the information item "city" in Figure 1 , the content of this information item can be divided into multiple types according to multiple classification texts such as "Beijing" and "Shanghai". It can be understood that Figure 1 only two cities are exemplarily shown in the log data shown in Figure 1 . It can be understood that in actual applications, more cities can be included, and the number of cities can be predetermined, that is, p classification texts can be predetermined.
[0056] If the first target information item is an information item for recording numerical values, then the p types correspond to p different numerical value ranges.
[0057] In some designs, if the first target information item is an information item for recording time numerical values, then the p types respectively correspond to p time intervals of a first preset duration.
[0058] For example, for Figure 1 the information item "login time" in Figure 1 , the content of this information item can be divided into p types in the way of dividing a time interval every 24 hours. At this time, it can be understood that the first preset duration is 24 hours.
[0059] Among them, in the case where the first target information item is an information item for recording numerical values, the range sizes of the respective numerical value ranges can be set according to different implementation manners according to actual needs.
[0060] In some implementation manners, the method may further include: determining the ranges of the respective numerical value ranges among the p different numerical value ranges according to the distribution of the numerical values recorded in the first target information item in each record information in the log data.
[0061] For example, taking the "login time" of the user login behavior as the first target information item as an example: if it is determined according to the distribution of the numerical values recorded in the first target information item in each record information in the log data that the numerical values recorded in the first target information item are relatively densely distributed between 18:00 and 23:00 every day, then 1 hour can be used as the range of each of the p different numerical value ranges, so that the fluctuation of the data within a day can be reflected; in addition, if it is determined according to the distribution of the numerical values recorded in the first target information item in each record information in the log data that the numerical values recorded in the first target information item are relatively densely distributed on Saturdays and Sundays, then 24 hours (i.e., 1 day) can be used as the range of each of the p different numerical value ranges, so that the fluctuation of the data every day can be reflected.
[0062] S103. The data processing device divides the m record information into p record information sets corresponding one-to-one to p types according to the content of the first target information items respectively included in each of the m record information.
[0063] For example, taking the first target information item as Figure 1 the information item "gender" in it as an example, the p types correspond to two classification texts of "male" and "female" (that is, p is 2 at this time), then the data processing device can divide the m record information into 2 record information sets. Among them, one record information set corresponds to the classification text "male", and this record information set may include Figure 1 the record information with serial numbers 1 / 2 / 4 / 6 / 8 / 10 / 12 / 13 / 15 / 17 / 19 / 21 in it; the other record information set corresponds to the classification text "female", and this record information set may include Figure 1 the record information with serial numbers 3 / 5 / 7 / 9 / 11 / 14 / 16 / 18 / 20 / 22 in it.
[0064] S104. The data processing device merges the record information in each of the p record information sets respectively to generate p statistical information.
[0065] Among them, the p statistical information is respectively used to reflect the statistical results corresponding to each of the p types.
[0066] Specifically, each of the p statistical information may include one or more information items (hereinafter referred to as q second information items). The q second information items are respectively used to record q kinds of information corresponding to the target events that occur.
[0067] Exemplarily, the statistical information corresponding one-to-one to the two classification texts of "male" and "female" generated is as Figure 2 shown. Among them, each statistical information includes: "number of cities", "number of online people", "online duration", and "number of logins", these 4 information items. These 4 information items are respectively used to record a kind of information corresponding to the user login behavior that occurs.
[0068] For another example, taking the first target information item as Figure 1 the information item "login time" in it as an example, the p types may correspond to p data intervals with 24 hours as a numerical interval, and then the p statistical information corresponding one-to-one to the p types generated is as Figure 3 shown.
[0069] Among them, Figure 3 each statistical information includes: "number of cities", "number of online people", "online duration", and "gender ratio", these 4 information items. These 4 information items are respectively used to record a kind of information corresponding to the user login behavior that occurs.
[0070] In the above method of the present application, it is considered that: the information items in the log data usually can include two types: one is the information item for classification according to a preset classification method (such as the information items "gender" and "city"), and the other is the information item for recording numerical values (such as the information items "login time" and "online duration (minutes)"). Therefore, after obtaining the log data, in this method, if the first target information item is the information item for classification according to a preset classification method, then the p types are p classification texts corresponding to the preset classification method; if the first target information item is the information item for recording numerical values, then the p types are p different numerical intervals. In this way, the first target information item can be divided into p types quickly and efficiently. Furthermore, the m record information can be divided into p record information sets corresponding one by one to the p types, and by merging the record information in each record information set in the p record information sets respectively to generate p statistical information, p statistical information for reflecting the statistical results corresponding to each of the p types can be obtained. In this way, the data statistics process can be completed more quickly and efficiently, thereby reducing the labor and time costs in data statistics.
[0071] In some implementation manners, it is considered that: in the actual application process, with different usage requirements, the statistical granularity of the statistical results required by users may also be different. For example, in some applications, statistical results with a statistical granularity of 1 day are required, such as Figure 3 each piece of statistical information shown is respectively used to reflect the statistical results corresponding to 1 day; while in other applications, statistical results with other time intervals as the statistical granularity may be required.
[0072] Therefore, in the case where the p types can respectively correspond to time intervals of p first preset durations, as Figure 5 shown, this method further includes:
[0073] S105. The data processing device obtains a query request.
[0074] Among them, the query request is used to query the statistical results of the target event in the case where the second preset duration is used as the statistical period. Among them, the second preset duration is an integer multiple of the first preset duration.
[0075] For example, the first preset duration is 24 hours (i.e., 1 day), and the second preset duration is 1 month.
[0076] S106. The data processing device divides the p pieces of statistical information into j statistical information sets according to the query request.
[0077] Among them, the j statistical information sets respectively correspond to j time intervals of the second preset duration.
[0078] Taking Figure 3 the p statistical information shown as an example, assuming that the first preset duration is 24 hours (i.e., 1 day) and the second preset duration is 1 month, then the p statistical information shown Figure 3 can be divided into multiple statistical information sets (i.e., j statistical information sets) on a monthly basis. For example, the 31 statistical information with time between 2024 / 12 / 1 and 2024 / 12 / 31 in Figure 3 can be divided into 1 statistical information set ( Figure 3 only shows the content of 3 statistical information exemplarily, and it can be understood that other statistical information can be obtained in the same statistical manner during actual application). Similarly, the statistical information of other months can be divided into corresponding statistical information sets respectively.
[0079] S107. The data processing device merges the statistical information in each of the j statistical information sets respectively to generate j statistical information.
[0080] Among them, the j statistical information is respectively used to reflect the statistical results corresponding to the time intervals of the j second preset durations.
[0081] For example, in the 31 statistical information with time between 2024 / 12 / 1 and 2024 / 12 / 31 in Figure 3 , the values in the information item "online duration" can be summed to obtain the "online duration" corresponding to December 2024. Similarly, the corresponding "online duration" of other months can be obtained, and the j statistical information obtained is as shown in Figure 6 .
[0082] In some implementation manners, as shown in Figure 7 , the method may further include:
[0083] S108. The data processing device obtains a first user operation of selecting one information item from n first information items.
[0084] For example, after the data processing device obtains the log data, it can display the n first information items included in the log data on the interface, and the first user operation can be an operation such as clicking, long pressing, or dragging any one of the n first information items displayed on the interface.
[0085] S109. The data processing device determines a first target information item from the n first information items in response to the first user operation.
[0086] Specifically, the data processing device can determine the first target information item from the n first information items by obtaining the first user operation (for example, the first user operation can be an operation such as clicking, long - pressing, or dragging the first target information item among the n first information items).
[0087] Through the above implementation method, the information items to be counted can be determined according to the actual needs of the user, and then p statistical information items can be generated according to the process of S102 - S103 above. Thus, the user only needs to check the corresponding information items through the first operation to generate the statistical results corresponding to the information items (that is, p statistical information items).
[0088] In some other implementation methods, after obtaining the log data, the data processing device can generate one or more statistical information items corresponding to each information item in the log data respectively according to the process of S102 - S103 above. In this way, the user only needs to import the log data into the data processing device, and the data processing device can generate the statistical information items corresponding to each information item in the log data, so that the user can directly select the required statistical information for analysis from the generated statistical information items corresponding to each information item during the subsequent data analysis process.
[0089] In addition, in some implementation methods, when each of the p statistical information items includes q second information items, as Figure 8 shown, the method may further include:
[0090] S110: The data processing device obtains a second user operation for requesting to display the content of the second target information item among the p statistical information items.
[0091] Wherein, the second target information item is one of the q second information items.
[0092] Exemplarily, when the p statistical information items include Figure 2 the statistical information of two classification texts, "male" and "female", among the q second information items include: "number of cities", "number of online people", "online duration", and "number of logins", these 4 information items. The second target information item can be one of the above 4 information items.
[0093] Exemplarily again, when the p statistical information items include Figure 3 the statistical information shown, among the q second information items include: "number of cities", "number of online people", "online duration", and "gender ratio", these 4 information items. The second target information item can be one of the above 4 information items.
[0094] S111: The data processing device determines a target chart type from multiple preset chart types in response to the second user operation.
[0095] Among them, there are multiple preset chart types, including any one of bar charts, pie charts, and line charts.
[0096] S112. The data processing device generates and displays a target chart of the target chart type.
[0097] Among them, the content of the second target information item in each statistical information among the p statistical information is included in the target chart.
[0098] Through the above implementation method, according to the second operation of the user, the information item (i.e., the second target information item) that needs to be analyzed can be determined from the p statistical information, and then the second target information item can be visually displayed according to the above process of S111 - S112. In this way, the effect that the user can visually display the second target information item only by checking the corresponding second target information item through the second operation can be achieved.
[0099] In some designs, S111 may specifically include:
[0100] If the p types correspond to p different numerical intervals, then determine that the target chart type is a bar chart or a line chart.
[0101] For example, taking the online duration in Figure 3 as an example of the second target information item, at this time the p types are p time intervals (i.e., numerical intervals), then determine that the target chart type is a bar chart or a line chart.
[0102] In the above design, considering that when the p types are p different numerical intervals, the value of p is often large (i.e., there are many types), and at this time it is usually more necessary to reflect the changes in a continuous number of numerical intervals (such as the changes in a continuous number of time intervals), so using a bar chart or a line chart can more clearly reflect the changes in multiple numerical intervals.
[0103] In other designs, S111 may specifically further include:
[0104] If the p types correspond to p classification texts, then determine that the target chart type is a bar chart or a pie chart.
[0105] For example, taking the online duration in Figure 2 as an example of the second target information item, at this time the p types are two classification texts of "male" and "female", then determine that the target chart type is a bar chart or a pie chart.
[0106] In the above design, considering that when the p types are p classification texts, the value of p is often small (i.e., there are few types), and at this time using a bar chart or a pie chart can more clearly reflect the proportion of each type in the total amount.
[0107] Based on the same inventive concept, as an implementation of the above method, an embodiment of the present application further provides a data processing device. This embodiment corresponds to the foregoing method embodiment. For the convenience of reading, the details in the foregoing method embodiment will not be repeated one by one in this embodiment. However, it should be clear that the data processing device in this embodiment can correspondingly implement all the content in the foregoing method embodiment.
[0108] An embodiment of the present application provides a data processing device. Figure 9 As a schematic structural diagram of the data processing device, as Figure 9 shown, the data processing device 20 includes:
[0109] An acquisition unit 201, configured to acquire log data; the log data includes m pieces of record information, each piece of record information is respectively used to record a target event that has occurred, and each piece of record information respectively includes n first information items, and the n first information items are respectively used to record n types of information corresponding to the target event that has occurred;
[0110] A processing unit 202 divides the content of the first target information item into p types; the first target information item is one of the n first information items; wherein, if the first target information item is an information item for classification according to a preset classification method, the p types correspond to p classification texts corresponding to the preset classification method; if the first target information item is an information item for recording a numerical value, the p types correspond to p different numerical value ranges;
[0111] The processing unit 202 is further configured to divide the m pieces of record information into p record information sets corresponding one-to-one to the p types according to the content of the first target information item included in each of the m pieces of record information;
[0112] The processing unit 202 is further configured to respectively merge the record information in each record information set in the p record information sets to generate p pieces of statistical information; the p pieces of statistical information are respectively used to reflect the statistical results corresponding to each of the p types.
[0113] In some implementation manners, if the first target information item is an information item for recording a numerical value, the p types correspond to p different numerical value ranges, including: if the first target information item is an information item for recording a time numerical value, the p types respectively correspond to p time intervals of a first preset duration.
[0114] In some implementation manners, the acquisition unit 201 is further configured to acquire a query request; the query request is used to query the statistical result of the target event in the case where the statistical period is a second preset duration; wherein, the second preset duration is an integer multiple of the first preset duration;
[0115] The processing unit 202 is further configured to divide the p pieces of statistical information into j statistical information sets according to the query request; the j statistical information sets respectively correspond to time intervals of j second preset durations.
[0116] The processing unit 202 is further configured to merge the statistical information in each of the j statistical information sets respectively to generate j pieces of statistical information; the j pieces of statistical information are respectively used to reflect the statistical results corresponding to the time intervals of the j second preset durations.
[0117] In some implementation manners, the obtaining unit 201 is further configured to obtain a first user operation of selecting one information item from the n first information items.
[0118] The processing unit 202 is further configured to determine a first target information item from the n first information items in response to the first user operation.
[0119] In some implementation manners, each piece of statistical information in the p pieces of statistical information respectively includes q second information items; the obtaining unit 201 is further configured to obtain a second user operation for requesting to display the content of a second target information item in the p pieces of statistical information; the second target information item is one of the q second information items.
[0120] The processing unit 202 is further configured to determine a target chart type from multiple preset chart types in response to the second user operation; the multiple preset chart types include any one of a bar chart, a pie chart, and a line chart.
[0121] The processing unit 202 is further configured to generate and display a target chart of the target chart type; the content of the second target information item in each piece of statistical information in the p pieces of statistical information is included in the target chart.
[0122] In some implementation manners, the processing unit 202 is further configured to determine the target chart type from multiple preset chart types in response to the second user operation, including:
[0123] The processing unit 202 is further configured to determine that the target chart type is a bar chart or a line chart if the p types correspond to p different numerical intervals.
[0124] In some implementation manners, the processing unit 202 is further configured to determine the target chart type from multiple preset chart types in response to the second user operation, including:
[0125] The processing unit 202 is further configured to determine that the target chart type is a bar chart or a pie chart if the p types correspond to p classification texts.
[0126] The data processing device 20 provided in the embodiments of the present application can execute the data processing method provided in any of the above embodiments. The implementation principle and technical effects are similar and will not be elaborated here.
[0127] Based on the same inventive concept, the embodiments of the present application also provide a data processing device. Figure 10 The structural schematic diagram of the data processing device provided in the embodiments of the present application is shown in Figure 10 As shown, the data processing device provided in this embodiment includes: a memory 301 and a processor 302. The memory 301 is used to store a computer program, and the processor 302 is used to execute the data processing method provided in the above embodiments when executing the computer program.
[0128] Based on the same inventive concept, the embodiments of the present application also provide a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the computing device is enabled to implement the data processing method provided in the above embodiments.
[0129] Based on the same inventive concept, the embodiments of the present application also provide a computer program product. When the computer program product runs on a computer, the computing device is enabled to implement the data processing method provided in the above embodiments.
[0130] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.
[0131] The processor can be a central processing unit (CPU), or can also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor, or the processor can also be any conventional processor, etc.
[0132] The memory may include non - permanent memory in the form of computer - readable media, such as random access memory (RAM) and / or non - volatile memory, such as read - only memory (ROM) or flash RAM. The memory is an example of computer - readable media.
[0133] Computer - readable media includes permanent and non - permanent, removable and non - removable storage media. The storage media can implement information storage by any method or technology, and the information can be computer - readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase - change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read - only memory (ROM), electrically erasable programmable read - only memory (EEPROM), flash memory or other memory technologies, compact disc read - only memory (CD - ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic disk storage or other magnetic storage devices, or any other non - transitory media that can be used to store information accessible by a computing device. As defined herein, computer - readable media does not include transitory computer - readable media, such as modulated data signals and carrier waves.
[0134] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features. And these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A data processing method, characterized in that: The method comprises: Obtain log data; the log data includes m pieces of record information, each piece of record information is used to record a target event that has occurred, each piece of record information includes n first information items, and the n first information items are used to record n types of information corresponding to the target event that has occurred; The content of the first target information item is divided into p types; the first target information item is one of the n first information items; wherein, if the first target information item is an information item for classification according to a preset classification method, the p types correspond to the p types of classification texts corresponding to the preset classification method; if the first target information item is an information item for recording a numerical value, the p types correspond to p different numerical intervals; According to the content of the first target information item respectively included in each of the m pieces of record information, the m pieces of record information are divided into p sets of record information corresponding to the p types one by one; The record information in each of the p record information sets are respectively merged to generate p pieces of statistical information; the p pieces of statistical information are respectively used to reflect the statistical results corresponding to each type in the p types.
2. The method according to claim 1, characterized in that If the first target information item is an information item recording a numerical value, the p types correspond to p different numerical intervals, including: if the first target information item is an information item recording a time value, the p types respectively correspond to p time intervals of a first preset duration.
3. The method according to claim 2, characterized in that The method further comprises: Obtain a query request; the query request is used to query the statistical results of the target event when the second preset time period is used as the statistical period; wherein the second preset time period is an integer multiple of the first preset time period; According to the query request, the p pieces of statistical information are divided into j statistical information sets; the j statistical information sets respectively correspond to j time intervals of the second preset time length; The statistical information in each statistical information set in the j statistical information sets are respectively merged to generate j pieces of statistical information; the j pieces of statistical information are respectively used to reflect the statistical results corresponding to j time intervals of the second preset duration.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Acquire a first user operation of selecting an information item from the n first information items; In response to the first user operation, a first target information item is determined from the n first information items.
5. The method according to any one of claims 1 to 3, characterized in that: Each of the p pieces of statistical information includes q second information items respectively; the method further includes: Acquire a second user operation for requesting to display content of a second target information item in the p pieces of statistical information; the second target information item is one of the q second information items; In response to the second user operation, determining a target chart type from a plurality of preset chart types; the plurality of preset chart types include any one of a bar chart, a pie chart, and a curve chart; A target chart of the target chart type is generated and displayed; the target chart includes the content of the second target information item in each of the p pieces of statistical information.
6. The method according to claim 5, characterized in that In response to the second user operation, determining a target chart type from a plurality of preset chart types includes: If the p types correspond to p different value intervals, the target chart type is determined to be a bar chart or a curve chart.
7. The method according to claim 5, characterized in that In response to the second user operation, determining a target chart type from a plurality of preset chart types includes: If the p types correspond to p types of classified texts, the target chart type is determined to be a bar chart or a pie chart.
8. A data processing device, characterized in that: include: An acquisition unit, used to acquire log data; the log data includes m pieces of record information, each piece of record information is used to record a target event that has occurred, each piece of record information includes n first information items, and the n first information items are used to record n types of information corresponding to the target event that has occurred; A processing unit, dividing the content of the first target information item into p types; The first target information item is one of the n first information items; wherein, if the first target information item is an information item for classification according to a preset classification method, the p types correspond to the p types of classification texts corresponding to the preset classification method; if the first target information item is an information item for recording a numerical value, the p types correspond to p different numerical value intervals; The processing unit is further configured to divide the m pieces of record information into p sets of record information corresponding to the p types one by one according to the content of the first target information item respectively included in each of the m pieces of record information; The processing unit is further used to merge the record information in each record information set in the p record information sets to generate p pieces of statistical information; the p pieces of statistical information are used to reflect the statistical results corresponding to each type in the p types.
9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory is used to store a computer program and the processor is used to enable the electronic device to implement the data processing method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a computing device, the computing device implements the data processing method according to any one of claims 1 to 7.
11. A computer program product, characterized in that When the computer program product runs on a computer, the computer is enabled to implement the data processing method according to any one of claims 1 to 7.