Search

CN-122019629-A - Resource consumption statistical method, storage medium and electronic device

CN122019629ACN 122019629 ACN122019629 ACN 122019629ACN-122019629-A

Abstract

The application discloses a resource consumption statistical method, a storage medium and an electronic device, and relates to the technical field of intelligent home/intelligent families; the method can acquire all task data in an offline data bin, call the resource consumption information of a task to be counted according to the task execution identification, fully acquire the requirement information, calculate and count the acquired data according to the customization requirement of a statistic person, and provide powerful support for optimizing the stability of the offline data bin, improving the expansibility, evaluating the data task value, developing the data treatment work and the like.

Inventors

  • YANG LIBIN
  • HUANG TAO

Assignees

  • 海尔优家智能科技(北京)有限公司
  • 青岛海尔科技有限公司
  • 海尔智家股份有限公司

Dates

Publication Date
20260512
Application Date
20241111

Claims (10)

  1. 1. A method of statistics of resource consumption, comprising: Acquiring execution metadata information in an offline data bin; Analyzing, extracting and processing the execution metadata information to obtain a task execution identifier; the resource consumption information corresponding to the task execution identification is called, wherein the resource consumption information is information which represents the use and consumption conditions of resources in the execution metadata information; And converting the resource consumption information according to preset requirements to obtain a consumption statistical result.
  2. 2. The method of claim 1, wherein the execution metadata information comprises data hierarchy relationships and log information; The obtaining the execution metadata information in the offline data bin comprises the following steps: Determining an acquisition time range of a task to be counted and a query statement, wherein the query statement is generated according to the acquisition time range; Determining execution metadata information of a plurality of tasks in the offline data bin according to the query statement, and generating a query result table according to the execution metadata information, wherein the plurality of tasks comprise the tasks to be counted, and the query result table is used for displaying the data hierarchy relation of each task; and determining log information of each task according to the minimum hierarchy information of the data hierarchy relation.
  3. 3. The method according to claim 2, wherein the analyzing and extracting the execution metadata information to obtain a task execution identifier includes: determining a task execution identification template according to the log information and the task to be counted, wherein the task execution identification template comprises a structural mode of character information and time information of the task to be counted; and traversing the execution metadata information according to the task execution identification template, and determining a task execution identification matched with the task execution identification template.
  4. 4. The method of claim 1, wherein the retrieving the resource consumption information corresponding to the task execution identification comprises: Generating a call request according to the task execution identifier, wherein the call request is used for acquiring all information of the task corresponding to the task execution identifier; obtaining the execution metadata information of the task to be counted according to the calling request; And stripping the execution metadata information of the task to be counted to obtain the resource consumption information.
  5. 5. The method of claim 1, wherein the converting the resource consumption information according to the preset requirement to obtain the consumption statistics includes: saving the resource consumption information to a local server, and performing format conversion processing to obtain first consumption information; classifying the first consumption information according to a preset category to obtain second consumption information; and extracting second consumption information according to the information category corresponding to the preset requirement, and performing arithmetic operation processing to obtain the consumption statistical result.
  6. 6. The method of claim 1, wherein after the obtaining the consumption statistics, the method further comprises: Analyzing the consumption statistical result, and storing the analyzed result into a preset file; and sending the preset file to a statistics person, and/or pushing the preset file to a display tool, wherein the display tool is used for displaying specific contents in the preset file.
  7. 7. A statistical device for resource consumption, comprising: the acquisition module is used for acquiring the execution metadata information in the offline data bin; The processing module is used for analyzing, extracting and processing the execution metadata information to obtain a task execution identifier; The calling module is used for calling the resource consumption information corresponding to the task execution identifier, wherein the resource consumption information is part of the execution metadata information; And the processing module is also used for carrying out conversion processing on the resource consumption information according to preset requirements to obtain a consumption statistical result.
  8. 8. The apparatus of claim 7, further comprising a determination module; the determining module is used for determining the acquisition time range of the task to be counted and query sentences, and the query sentences are generated according to the acquisition time range; The determining module is further configured to determine execution metadata information of a plurality of tasks in the offline data bin according to the query statement, and generate a query result table according to the execution metadata information, where the plurality of tasks include the tasks to be counted, and the query result table is used to display a data hierarchy relationship of each task; The determining module is further configured to determine log information of each task according to minimum level information of the data level relationship.
  9. 9. A computer-readable storage medium, characterized in that the computer-readable storage medium comprises a stored program, wherein the program when run performs the method of any one of claims 1 to 6.
  10. 10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method according to any of claims 1 to 6 by means of the computer program.

Description

Resource consumption statistical method, storage medium and electronic device Technical Field The application relates to the technical field of intelligent home/intelligent families, in particular to a resource consumption statistical method, a storage medium and an electronic device. Background The offline data warehouse is used as a core component for data storage and processing, and the performance, efficiency and resource consumption of the offline data warehouse are directly related to the effects of data analysis and decision support. Therefore, the statistics and analysis of the resource consumption of the offline data warehouse become key links for optimizing the data management and improving the decision quality. In the practical use of the traditional offline data warehouse, in the early development stage, according to familiarity of a developer to a service and a small amount of tasks and data, the developer can effectively manage the task and the data of the digital warehouse according to memory or document records, but with continuous iteration of service demands, the data and the tasks of the digital warehouse are continuously increased, the difficulty of optimizing and iterating the digital warehouse is continuously improved, and the increase of documents enables the developer to be unable to record information of all tasks through the memory and the documents, such as finger palm. The original offline data bin open source component has no resource consumption statistical function, can only inquire by a single task or can only inquire integrally, and has no function for carrying out statistical analysis and calculation on resource consumption data by developers. Disclosure of Invention The application provides a resource consumption statistical method, a device, a storage medium and an electronic device, which are used for solving the problems that the resource consumption statistical function of an offline digital bin open source component is lost, or only a single task can be queried, or only an integral query can be performed, and the function of performing statistical analysis and calculation on resource consumption data by a developer is unavailable. In a first aspect, the present application provides a method for counting resource consumption, including: Acquiring execution metadata information in an offline data bin; Analyzing, extracting and processing the execution metadata information to obtain a task execution identifier; the resource consumption information corresponding to the task execution identification is called, wherein the resource consumption information is part of the execution metadata information; And converting the resource consumption information according to preset requirements to obtain a consumption statistical result. Optionally, the execution metadata information includes a data hierarchy relationship and log information, and the acquiring the execution metadata information in the offline data bin includes: Determining an acquisition time range of a task to be counted and a query statement, wherein the query statement is generated according to the acquisition time range; Determining execution metadata information of a plurality of tasks in the offline data bin according to the query statement, and generating a query result table according to the execution metadata information, wherein the plurality of tasks comprise the tasks to be counted, and the query result table is used for displaying the data hierarchy relation of each task; and determining log information of each task according to the minimum hierarchy information of the data hierarchy relation. Optionally, the analyzing, extracting and processing the execution metadata information to obtain a task execution identifier includes: determining a task execution identification template according to the log information and the task to be counted, wherein the task execution identification template comprises a structural mode of character information and time information of the task to be counted; and traversing the execution metadata information according to the task execution identification template, and determining a task execution identification matched with the task execution identification template. Optionally, the calling the resource consumption information corresponding to the task execution identifier includes: Generating a call request according to the task execution identifier, wherein the call request is used for acquiring all information of the task corresponding to the task execution identifier; obtaining the execution metadata information of the task to be counted according to the calling request; And stripping the execution metadata information of the task to be counted to obtain the resource consumption information. Optionally, the converting the resource consumption information according to a preset requirement to obtain a consumption statistical result includes: saving the resource consumption