CN116756480A - Data statistics method and device, storage medium and electronic device - Google Patents

Data statistics method and device, storage medium and electronic device Download PDF

Info

Publication number
CN116756480A
CN116756480A CN202310641012.1A CN202310641012A CN116756480A CN 116756480 A CN116756480 A CN 116756480A CN 202310641012 A CN202310641012 A CN 202310641012A CN 116756480 A CN116756480 A CN 116756480A
Authority
CN
China
Prior art keywords
function
function value
equipment
change data
value
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
CN202310641012.1A
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.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing 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 Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd, Haier Uplus Intelligent Technology Beijing Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202310641012.1A priority Critical patent/CN116756480A/en
Publication of CN116756480A publication Critical patent/CN116756480A/en
Pending legal-status Critical Current

Links

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a data statistics method and device, a storage medium and an electronic device, and relates to the technical field of smart families, wherein the data statistics method comprises the following steps: configuring a first function class of the equipment function according to a first configuration condition of the equipment function, and configuring a period judgment condition of the equipment function according to a second configuration condition of the equipment function; screening out function change data of a plurality of equipment functions from a database according to the first function category; matching the equipment use period of each equipment function in the function change data according to the period judging condition; determining state change data of the equipment function to be analyzed in the equipment use period from the function change data; by adopting the scheme, the problems that in the prior art, for different kinds of equipment, the statistics logic is different when the function data of the equipment are counted, the development difficulty of developers is high and the labor cost is high are solved.

Description

Data statistics method and device, storage medium and electronic device
Technical Field
The invention relates to the technical field of smart families, in particular to a data statistics method and device, a storage medium and an electronic device.
Background
The user of the data reported by the hals equipment comprises industrial data analysis personnel, related technicians and the like, and in the using process, the following using scenes are provided: and analyzing indexes such as the use times and the duration of the user equipment, the use times and the duration of each function of the equipment and the like. These metrics may be presented to the user so that the user knows the use of his own device. The method can also be used for industrial analysts, analysis equipment and the use condition of certain functions, and iteration of products.
But the reported functions are not completely identical for different devices. Moreover, since the statistics of different categories are presented by different users, the statistics of different categories are also inconsistent. Therefore, each time data of one category is counted, logic needs to be independently formulated and then is independently developed by a developer.
Aiming at the problems of the prior art that the development difficulty of developers is high, the labor cost is high and the like when the statistics logic is different when the function data of equipment are counted for different kinds of equipment, no effective solution is proposed yet.
Disclosure of Invention
The embodiment of the invention provides a data statistics method and device, a storage medium and an electronic device, which at least solve the problems of high development difficulty and high labor cost of developers in the prior art, wherein the statistics logic is different when the function data of equipment are counted for different kinds of equipment.
According to an embodiment of the present invention, there is provided a data statistics method including: configuring a first function class of the equipment function according to a first configuration condition of the equipment function, and configuring a period judgment condition of the equipment function according to a second configuration condition of the equipment function; screening out function change data of a plurality of equipment functions from a database according to the first function category; matching the equipment use period of each equipment function in the function change data according to the period judging condition; and determining the state change data of the equipment function to be analyzed in the equipment use period from the function change data.
In one exemplary embodiment, configuring the cycle judgment condition of the device function according to the second configuration condition of the device function includes: analyzing a first function value, a second function value, a third function value and a fourth function value of the equipment function from the second configuration condition; determining a cycle start condition and a cycle end condition of the device function according to the first function value, the second function value, the third function value and the fourth function value, wherein the cycle start condition is that the function value of the device function is changed from the first function value to the second function value, and the cycle end condition is that the function value of the device function is changed from the third function value to the fourth function value; and determining the cycle start condition and the cycle end condition as the cycle determination conditions.
In an exemplary embodiment, screening the function change data of the plurality of device functions from the database according to the first function class includes: determining a plurality of device functions indicated by the first function class and a first target function value for the plurality of device functions; and screening the function change data from the database according to the plurality of equipment functions and the first target function value, wherein the function change data comprises the plurality of equipment functions, current function values of the plurality of equipment functions, starting time and ending time of the current function values and previous function values of the current function values, and the current function value is the first target function value.
In an exemplary embodiment, the device usage period of each device function is matched in the function change data according to the period judgment condition, including: matching a first current function value in a plurality of current function values of the function change data according to the first function value and the second function value, wherein the function change data comprises a plurality of device functions, the current function values of the plurality of device functions, the starting time and the ending time of the current function values and the previous function value of the current function value, the device functions corresponding to the plurality of current function values are identical to the device functions corresponding to the first function value, the first current function value is identical to the second function value, and the first previous function value corresponding to the first current function value is identical to the first function value; matching a second current function value in a plurality of current function values of the function change data according to the third function value and the fourth function value, wherein the second current function value is identical to the fourth function value, and a second previous function value corresponding to the second current function value is identical to the third function value; in a case where the first current function value and the second current function value are matched and a first start time of the first current function value is earlier than a second end time of the second function value, the first start time is determined as a start time of a device use period of the device function, and the second end time is determined as an end time of the device use period.
In an exemplary embodiment, the method further comprises: and if the first current function value and/or the second current function value are not matched or the first starting time is later than the second ending time, determining that the device function does not have the device service period in the function change data.
In an exemplary embodiment, before determining from the function change data that the status change data of the device function to be analyzed is within the device usage period, the method further comprises: determining a plurality of first device functions from the plurality of device functions, wherein the plurality of first device functions are device functions matched with the service cycle of the device; and determining a second device function in the plurality of first device functions according to the selection operation of the target object, and determining a second target function value of the second device function according to the second device function and the second target function value.
In an exemplary embodiment, determining, from the function change data, state change data of a device function to be analyzed in the device usage period includes: determining the starting time and the ending time of the equipment use period of the second equipment function; and screening the state change data between the starting time and the ending time from the function change data according to the second equipment function and the second target function value, wherein the state change data comprises the duration of the second target function value.
According to another embodiment of the present invention, there is also provided a data statistics apparatus including: a configuration module, configured to configure a first function class of a device function according to a first configuration condition of the device function, and configure a cycle judgment condition of the device function according to a second configuration condition of the device function; the screening module is used for screening out function change data of a plurality of equipment functions from the database according to the first function category; the matching module is used for matching the equipment service period of each equipment function in the function change data according to the period judging condition; and the determining module is used for determining the state change data of the equipment function to be analyzed in the equipment use period from the function change data.
According to a further aspect of embodiments of the present invention, there is also provided a computer readable storage medium having a computer program stored therein, wherein the computer program is arranged to perform the above-described data statistics method when run.
According to still another aspect of the embodiments of the present invention, there is further provided an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the data statistics method described above through the computer program.
In the embodiment of the invention, a first function class of the equipment function is configured according to a first configuration condition of the equipment function, and a period judgment condition of the equipment function is configured according to a second configuration condition of the equipment function; then screening out function change data of the plurality of equipment functions from the database according to the first function class; then, according to the period judging condition, the equipment service period of each equipment function is matched in the function change data; finally, determining state change data of the equipment function to be analyzed in the equipment use period from the function change data; by adopting the technical scheme, a set of general function statistical method is provided, and a user can configure indexes to be counted according to the needs by himself; the problem of among the prior art, to the equipment of different categories, the statistics logic when the functional data of statistics equipment is different, the developer development degree of difficulty is big, the human cost is high is solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the invention or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, and it will be obvious to a person skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic diagram of a hardware environment for an alternative data statistics method according to an embodiment of the present invention;
FIG. 2 is a flow chart of an alternative data statistics method according to an embodiment of the present invention;
FIG. 3 is a flow chart of an alternative method of generating a functional usage list in accordance with an embodiment of the present invention;
FIG. 4 is a flow chart of a method of generating an alternative functional usage list in accordance with an embodiment of the present invention;
fig. 5 is a block diagram of an alternative data statistics apparatus according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to one aspect of an embodiment of the present invention, a data statistics method is provided. The data statistics method is widely applied to full-house intelligent digital control application scenes such as intelligent Home (Smart Home), intelligent Home equipment ecology, intelligent Home (Intelligence House) ecology and the like. Alternatively, in the present embodiment, the above-described data statistics method may be applied to a hardware environment constituted by the terminal device 102 and the server 104 as shown in fig. 1. As shown in fig. 1, the server 104 is connected to the terminal device 102 through a network, and may be used to provide services (such as application services and the like) for a terminal or a client installed on the terminal, a database may be set on the server or independent of the server, for providing data storage services for the server 104, and cloud computing and/or edge computing services may be configured on the server or independent of the server, for providing data computing services for the server 104.
The network may include, but is not limited to, at least one of: wired network, wireless network. The wired network may include, but is not limited to, at least one of: a wide area network, a metropolitan area network, a local area network, and the wireless network may include, but is not limited to, at least one of: WIFI (Wireless Fidelity ), bluetooth. The terminal device 102 may not be limited to a PC, a mobile phone, a tablet computer, an intelligent air conditioner, an intelligent smoke machine, a refrigerator device, an intelligent oven, an intelligent cooking range, an intelligent washing machine, an intelligent water heater, an intelligent washing device, an intelligent dish washer, an intelligent projection device, an intelligent television, an intelligent clothes hanger, an intelligent curtain, an intelligent video, an intelligent socket, an intelligent sound box, an intelligent fresh air device, an intelligent kitchen and toilet device, an intelligent bathroom device, an intelligent sweeping robot, an intelligent window cleaning robot, an intelligent mopping robot, an intelligent air purifying device, an intelligent steam box, an intelligent microwave oven, an intelligent kitchen appliance, an intelligent purifier, an intelligent water dispenser, an intelligent door lock, and the like.
In this embodiment, a data statistics method is provided and applied to a computer terminal, and fig. 2 is a flowchart of an alternative data statistics method according to an embodiment of the present invention, where the flowchart includes the following steps:
step S202, configuring a first function class of the equipment function according to a first configuration condition of the equipment function, and configuring a period judgment condition of the equipment function according to a second configuration condition of the equipment function;
step S204, function change data of a plurality of device functions are screened from a database according to the first function category;
step S206, the equipment use period of each equipment function is matched in the function change data according to the period judging condition;
step S208, determining the state change data of the device function to be analyzed in the device use period from the function change data.
In the embodiment of the invention, a first function class of the equipment function is configured according to a first configuration condition of the equipment function, and a period judgment condition of the equipment function is configured according to a second configuration condition of the equipment function; then screening out function change data of the plurality of equipment functions from the database according to the first function class; then, according to the period judging condition, the equipment service period of each equipment function is matched in the function change data; finally, determining state change data of the equipment function to be analyzed in the equipment use period from the function change data; by adopting the technical scheme, a set of general function statistical method is provided, and a user can configure indexes to be counted according to the needs by himself; the problem of among the prior art, to the equipment of different categories, the statistics logic when the functional data of statistics equipment is different, the developer development degree of difficulty is big, the human cost is high is solved.
Alternatively, the cycle determination condition may be configured by the following scheme, specifically including: analyzing a first function value, a second function value, a third function value and a fourth function value of the equipment function from the second configuration condition; determining a cycle start condition and a cycle end condition of the device function according to the first function value, the second function value, the third function value and the fourth function value, wherein the cycle start condition is that the function value of the device function is changed from the first function value to the second function value, and the cycle end condition is that the function value of the device function is changed from the third function value to the fourth function value; and determining the cycle start condition and the cycle end condition as the cycle determination conditions.
The cycle start logic is a function value when the lag_attrb_value is changed to attrb_value, the cycle end logic is a function value when the lag_attrb_value is changed to attrb_value, for example, cycle code 1, i.e. a startup and shutdown cycle, the cycle start logic is that the onOffStatus is changed from false to true, and the cycle end logic is that the onOffStatus is changed from true to false. It is also possible to provide a plurality of judgment conditions, for example, cycle code 2, washing cycle. And reporting 3 values of 1, 2 and 3 by using the operation mode, and changing the period starting logic from 1 to non-1 and the period ending logic from 1 to non-1. Therefore, the first function value, the second function value, the third function value and the fourth function value of the device function are firstly resolved from the second configuration condition; and then determining a cycle start condition and a cycle end condition according to the four functional values, wherein the first functional value and the fourth functional value can be the same, and the second functional value and the third functional value can be the same or different, and the conditions respectively correspond to the condition that only one judging condition is included and the condition that a plurality of judging conditions are included.
Optionally, the above step S204 is performed: the function change data of the plurality of device functions are screened from the database according to the first function category, and the method can be as follows: determining a plurality of device functions indicated by the first function class and a first target function value for the plurality of device functions; and screening the function change data from the database according to the plurality of equipment functions and the first target function value, wherein the function change data comprises the plurality of equipment functions, current function values of the plurality of equipment functions, starting time and ending time of the current function values and previous function values of the current function values, and the current function value is the first target function value.
The process of screening the function change data comprises the following steps: firstly, determining a plurality of device functions indicated by the first function class and specific first target function values of the plurality of device functions, wherein the functions comprise a windSpeedLevel and an onOffStatus, the windSpeedLevel comprises 1 and 2 first target function values, the first target function value of the onOffStatus is null, namely, all the function values reported by the functions need to be counted; and then screening the function change data from the database according to the plurality of device functions and the first target function value, wherein the function change data at least comprises the following information: the device function, the current function value, the starting time and the ending time of the current function value, and the previous function value; and the current function value is equal to the first target function value.
Optionally, the above step S206 is performed: the device use period of each device function is matched in the function change data according to the period judgment condition, and the method comprises the following steps: matching a first current function value in a plurality of current function values of the function change data according to the first function value and the second function value, wherein the function change data comprises a plurality of device functions, the current function values of the plurality of device functions, the starting time and the ending time of the current function values and the previous function value of the current function value, the device functions corresponding to the plurality of current function values are identical to the device functions corresponding to the first function value, the first current function value is identical to the second function value, and the first previous function value corresponding to the first current function value is identical to the first function value; matching a second current function value in a plurality of current function values of the function change data according to the third function value and the fourth function value, wherein the second current function value is identical to the fourth function value, and a second previous function value corresponding to the second current function value is identical to the third function value; in a case where the first current function value and the second current function value are matched and a first start time of the first current function value is earlier than a second end time of the second function value, the first start time is determined as a start time of a device use period of the device function, and the second end time is determined as an end time of the device use period.
The function change data includes a "current function value" and a "previous function value" of each device function, so that the two fields can be matched with a cycle start condition and a cycle end condition of the cycle judgment condition according to the two fields, and a first current function value corresponding to a first function value and a second function value of the cycle start condition is matched in the plurality of current function values, wherein the first current function value meets the following conditions: the first current function value is the same as the second function value, and the first previous function value corresponding to the first current function value is the same as the first function value; similarly, a third function value matching the cycle end condition among the plurality of current function values and a second current function value corresponding to a fourth function value satisfy the following conditions: the second current function value is the same as the fourth function value, and the second previous function value corresponding to the second current function value is the same as the third function value; when the first current function value and the second current function value are matched and the starting time of the first current function value is earlier than the ending time of the second function value, namely, the first current function value and the second current function value are represented that the first current function value and the second current function value can form a complete equipment use period, the time from the first starting time to the second ending time is determined as the equipment use period.
Optionally, the method further comprises: and if the first current function value and/or the second current function value are not matched or the first starting time is later than the second ending time, determining that the device function does not have the device service period in the function change data.
If the first current function value and/or the second current function value are not matched, or the first starting time is later than the second ending time, the fact that the complete equipment use period does not exist in the function change data is indicated, it is determined that the equipment use period does not exist in the function change data, and statistics of the equipment function is not needed.
Optionally, the above step S208 is performed: before determining the state change data of the device function to be analyzed in the service period of the device from the function change data, the method further comprises: determining a plurality of first device functions from the plurality of device functions, wherein the plurality of first device functions are device functions matched with the service cycle of the device; and determining a second device function in the plurality of first device functions according to the selection operation of the target object, and determining a second target function value of the second device function according to the second device function and the second target function value.
After the equipment use period is matched and before the state change data is screened, the equipment function matched with the equipment use period is determined from the plurality of equipment functions, statistical analysis is only carried out on the equipment functions, then a second equipment function is selected from the plurality of first equipment functions according to the requirement of a target object, and a second target function value of the second equipment function is selected, so that the equipment function to be analyzed is determined.
Based on the above steps, step S208: determining state change data of the device function to be analyzed in the device use period from the function change data, wherein the state change data comprises the following steps: determining the starting time and the ending time of the equipment use period of the second equipment function; and screening the state change data between the starting time and the ending time from the function change data according to the second equipment function and the second target function value, wherein the state change data comprises the duration of the second target function value.
The method comprises the steps of determining a starting time and an ending time according to a device use period, and screening state change data which is positioned between the starting time and the ending time and accords with a second device function and a second target function value from the function change data, wherein the state change data at least comprises the duration of the second target function value.
In the prior art, for different kinds of equipment, the methods used in the process of manufacturing the usage periodic table and the function usage statistical table are different, but some periodic tables are firstly made, then corresponding period or function statistics are made based on intermediate tables, then the intermediate tables generated by different developers are different, and the specific flow is shown in fig. 3, and fig. 3 is a schematic flow diagram of a method for generating an optional function usage detailed table according to an embodiment of the present invention, which specifically includes:
step 3.1: reporting source data;
step 3.2: generating an intermediate table;
step 3.3: generating a usage periodic table based on the intermediate table;
step 3.4: the usage specification table is generated from the intermediate table and the usage periodic table.
For the method, because equipment types are different, users are different, butt joint personnel are different, and therefore, the generated solutions are different, and the final products are different; therefore, the method has low applicability, and each piece of equipment added with one product needs to be redeveloped, so that the development period is long, and more development resources are consumed; and development logic is inconsistent, which is not beneficial to managing data assets.
In order to solve the above problem, the present invention provides another alternative method for generating a functional usage list, as shown in fig. 4, specifically including:
Step 4.1: establishing an attribute state change table (function change data);
an attribute state change table is established according to the four-point model and the attribute configuration table (first configuration condition).
The function of the attribute configuration table is to screen the function of the attribute state change table for statistics, and when the items to be counted are newly added each time, the corresponding items and the function of the items to be counted can be added into the table.
The structure of the "attribute configuration table" is as follows:
the function of the attribute state change table is to show the change period of the function and the function value, and the table structure and logic are as follows:
according to one example, the attributes configured in the "attribute configuration table" are as follows:
general class of Products and products wifi_type Function of Function value Data type
01 A001 Typeid1 WindSpeedLevel 1 6D
01 A001 Typeid1 WindSpeedLevel 2 6D
01 A001 Typeid1 onOffStatus Null 6D
According to the information configured in the attribute configuration table, it can be clear that the category of the sea equipment to be counted is 01, the category is A001, wifi_type is typeid1, the functions to be counted are respectively windSpeedLevel, and the corresponding function values are 1 and 2; the corresponding function value of onOffStatus is null, which means that all the function values reported by onOffStatus in the four-point model need to be counted.
Taking the four-point model as an example, the following data are included:
The data of the "attribute state change table" generated according to the above-mentioned "attribute configuration table" and "four-point model" are:
the example data shows the cycle of change of windSpeedLevel, onOffStatus for macid 1. Since only two function values 1 and 2 of the windSpeedLevel function are configured in the attribute configuration table, there are only two function value change periods 1 and 2 of the windSpeedLevel function in the attribute state change table. The value of onOffStatus is null in the "attribute configuration table", so that the change states of all the function values of onOffStatus are retained in the "attribute state change table".
Since neither wifi_type nor dev_big_type_cd to which macid2 belongs is configured in the "attribute configuration table", relevant data of macid2 is not counted in the "attribute state change table".
And each row in the attribute state change table has the information of the current function value and the last function value, and the function value is used for being associated with the period starting and ending logic configured in the period configuration table, so that the period table is generated.
Step 4.2: establishing a "periodic table (device usage period)":
the process mainly comprises three tables, namely a periodic definition table, a periodic configuration table (second configuration condition) and a periodic table. The period refers to a service period of the device defined according to service requirements, such as a switching-on period, a washing period of a washing machine, and a water consumption period of a water heater.
The "period definition table" is used to define the code, the period name, and the major class and the class of the use of the period for each period, to define whether the period belongs to the use period or the water period, and so on. Different classes may use the same periodic code.
The "period definition table" is exemplified as follows:
periodic encoding Cycle name General class of Class (application classification)
1 Cycle of on-off 01 A001
1 Cycle of on-off 02 A002
2 Washing cycle 03 A003
The "period configuration table" functions to configure the judgment logic of each period in the "period definition table". The start tag is "start", which defines the cycle start logic, and accords with the function value when the tag_attrb_value is converted into attrb_value, and the cycle start logic is the cycle start. The start tag is "end", which defines the end-of-cycle logic, which corresponds to the function value when changing from lag_attrb_value to attrb_value, and is the end of the cycle. For example, cycle code 1, i.e., the on-off cycle, the cycle start logic is the conversion of onOffStatus from false to true, and the cycle end logic is the conversion of onOffStatus from true to false.
If a plurality of judging conditions exist, the judging conditions are listed simultaneously. For example cycle code 2, wash cycle. And reporting 3 values of 1, 2 and 3 by using the operation mode, and changing the period starting logic from 1 to non-1 and the period ending logic from 1 to non-1.
The "periodic configuration table" is exemplified as follows:
the periodic table is configured according to the periodic start logic and the periodic end logic configured in the periodic definition table and the periodic configuration table, corresponding logic is automatically matched from the attribute state change table to form periodic start time and periodic end time, and then the periodic start time and the periodic end time are combined into a complete period. For example, the configured period encodes 1, the period start logic is from false to true, and the period end logic is from true to false. Then in the "attribute state change table" the start time of the match function for the outstatus attrbjvalue to true and the lag attrbjvalue to false is taken as the cycle start time. The start time of attrbvalue being false and lag attrbvalue being true matches onOffStatus as the cycle end time.
According to the above examples of the "attribute state change table", "period definition table", and "period configuration table", in the "attribute state change table", it is in accordance with the period logic configured in the "period configuration table", only the following two pieces of data are provided:
the first row of data conforms to the cycle start logic and the start time 1667750400000 of the piece of data is taken as the cycle start time. The second data conforms to the end of cycle logic and the start time 1667750400040 of the piece of data is taken as the end of cycle time. The "periodic table" formed is shown in the following table:
Device mac Device typeid Cycle start time Cycle end time Duration of cycle
Macid1 Typeid1 1667750400000 1667750400040 40
Step 4.3: establishing a "function use list (state change data)":
the function usage details table is "built" based on the "periodic table", "periodic attribute configuration table", "attribute state change table". The role of the "period attribute configuration table" is to screen the functions that need to be analyzed within a period. The usage details of the respective functions configured in the "period attribute configuration table" within the period in the "attribute state change table" are then extracted based on the period start time and the period end time of the "period table".
The "period configuration attribute table" is exemplified as follows:
general class of Products and products wifi_type Function of Function value Data type
01 A001 Typeid1 windSpeedLevel 1 6D
01 A001 Typeid1 onOffStatus Null 6D
Thus, based on the above-described "periodic table" and "periodic attribute configuration table", the "function usage details table" needs to show the changing states of the respective functions conforming to the "periodic attribute configuration table" within the period (between 1667750400000 and 1667750400040), examples are as follows:
if the "period configuration attribute table" is exemplified as follows:
general class of Products and products wifi_type Function of Function value Data type
01 A001 Typeid1 windSpeedLevel 1 6D
01 A001 Typeid1 windSpeedLevel 2 6D
01 A001 Typeid1 onOffStatus Null 6D
The "function usage details table" is:
by the scheme, the cycle statistics and the function statistics logic of all kinds of equipment are comprehensively considered, and the general logic is carded out, so that the data statistics logic of each kind of equipment is unified, and the data quality is improved; the freedom degree of the model is increased through the configuration table, the configuration table can be configured by a user, the statistical index is automatically generated, the data expandability is improved, the configuration can be directly carried out in the configuration table when the class or the function needing to be counted is increased, development is not needed, development resource investment is reduced, and the development period is shortened.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method of the various embodiments of the present invention.
In this embodiment, a data statistics device is further provided, and the data statistics device is used to implement the foregoing embodiments and preferred embodiments, and is not described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
FIG. 5 is a block diagram of an alternative data statistics apparatus according to an embodiment of the present invention; as shown in fig. 5, includes:
a configuration module 52, configured to configure a first function class of a device function according to a first configuration condition of the device function, and configure a cycle judgment condition of the device function according to a second configuration condition of the device function;
a screening module 54, configured to screen the function change data of the plurality of device functions from the database according to the first function class;
a matching module 56, configured to match a device usage period of each device function in the function change data according to the period determination condition;
and the determining module 58 is used for determining the state change data of the device function to be analyzed in the service period of the device from the function change data.
By the device, the first function category of the equipment function is configured according to the first configuration condition of the equipment function, and the period judgment condition of the equipment function is configured according to the second configuration condition of the equipment function; then screening out function change data of the plurality of equipment functions from the database according to the first function class; then, according to the period judging condition, the equipment service period of each equipment function is matched in the function change data; finally, determining state change data of the equipment function to be analyzed in the equipment use period from the function change data; by adopting the technical scheme, a set of general function statistical method is provided, and a user can configure indexes to be counted according to the needs by himself; the problem of among the prior art, to the equipment of different categories, the statistics logic when the functional data of statistics equipment is different, the developer development degree of difficulty is big, the human cost is high is solved.
Optionally, the configuration module 52 is further configured to analyze a first function value, a second function value, a third function value, and a fourth function value of the device function from the second configuration condition; determining a cycle start condition and a cycle end condition of the device function according to the first function value, the second function value, the third function value and the fourth function value, wherein the cycle start condition is that the function value of the device function is changed from the first function value to the second function value, and the cycle end condition is that the function value of the device function is changed from the third function value to the fourth function value; and determining the cycle start condition and the cycle end condition as the cycle determination conditions.
The cycle start logic is a function value when the lag_attrb_value is changed to attrb_value, the cycle end logic is a function value when the lag_attrb_value is changed to attrb_value, for example, cycle code 1, i.e. a startup and shutdown cycle, the cycle start logic is that the onOffStatus is changed from false to true, and the cycle end logic is that the onOffStatus is changed from true to false. It is also possible to provide a plurality of judgment conditions, for example, cycle code 2, washing cycle. And reporting 3 values of 1, 2 and 3 by using the operation mode, and changing the period starting logic from 1 to non-1 and the period ending logic from 1 to non-1. Therefore, the first function value, the second function value, the third function value and the fourth function value of the device function are firstly resolved from the second configuration condition; and then determining a cycle start condition and a cycle end condition according to the four functional values, wherein the first functional value and the fourth functional value can be the same, and the second functional value and the third functional value can be the same or different, and the conditions respectively correspond to the condition that only one judging condition is included and the condition that a plurality of judging conditions are included.
Optionally, the screening module 54 is further configured to determine a plurality of device functions indicated by the first function class and a first target function value of the plurality of device functions; and screening the function change data from the database according to the plurality of equipment functions and the first target function value, wherein the function change data comprises the plurality of equipment functions, current function values of the plurality of equipment functions, starting time and ending time of the current function values and previous function values of the current function values, and the current function value is the first target function value.
The process of screening the function change data comprises the following steps: firstly, determining a plurality of device functions indicated by the first function class and specific first target function values of the plurality of device functions, wherein the functions comprise a windSpeedLevel and an onOffStatus, the windSpeedLevel comprises 1 and 2 first target function values, the first target function value of the onOffStatus is null, namely, all the function values reported by the functions need to be counted; and then screening the function change data from the database according to the plurality of device functions and the first target function value, wherein the function change data at least comprises the following information: the device function, the current function value, the starting time and the ending time of the current function value, and the previous function value; and the current function value is equal to the first target function value.
Optionally, the matching module 56 is further configured to match a first current function value among a plurality of current function values of the function change data according to the first function value and the second function value, where the function change data includes a plurality of device functions, a current function value of the plurality of device functions, a start time and an end time of the current function value, a previous function value of the current function value, a device function corresponding to the plurality of current function values is the same as a device function corresponding to the first function value, the first current function value is the same as the second function value, and a first previous function value corresponding to the first current function value is the same as the first function value; matching a second current function value in a plurality of current function values of the function change data according to the third function value and the fourth function value, wherein the second current function value is identical to the fourth function value, and a second previous function value corresponding to the second current function value is identical to the third function value; in a case where the first current function value and the second current function value are matched and a first start time of the first current function value is earlier than a second end time of the second function value, the first start time is determined as a start time of a device use period of the device function, and the second end time is determined as an end time of the device use period.
The function change data includes a "current function value" and a "previous function value" of each device function, so that the two fields can be matched with a cycle start condition and a cycle end condition of the cycle judgment condition according to the two fields, and a first current function value corresponding to a first function value and a second function value of the cycle start condition is matched in the plurality of current function values, wherein the first current function value meets the following conditions: the first current function value is the same as the second function value, and the first previous function value corresponding to the first current function value is the same as the first function value; similarly, a third function value matching the cycle end condition among the plurality of current function values and a second current function value corresponding to a fourth function value satisfy the following conditions: the second current function value is the same as the fourth function value, and the second previous function value corresponding to the second current function value is the same as the third function value; when the first current function value and the second current function value are matched and the starting time of the first current function value is earlier than the ending time of the second function value, namely, the first current function value and the second current function value are represented that the first current function value and the second current function value can form a complete equipment use period, the time from the first starting time to the second ending time is determined as the equipment use period.
Optionally, the matching module 56 is further configured to determine that the device function does not have the device usage period in the function change data when the first current function value and/or the second current function value are not matched, or the first start time is later than the second end time.
If the first current function value and/or the second current function value are not matched, or the first starting time is later than the second ending time, the fact that the complete equipment use period does not exist in the function change data is indicated, it is determined that the equipment use period does not exist in the function change data, and statistics of the equipment function is not needed.
Optionally, the determining module 58 is further configured to determine a plurality of first device functions from the plurality of device functions, where the plurality of first device functions are device functions that match the device usage period; and determining a second device function in the plurality of first device functions according to the selection operation of the target object, and determining a second target function value of the second device function according to the second device function and the second target function value.
After the equipment use period is matched and before the state change data is screened, the equipment function matched with the equipment use period is determined from the plurality of equipment functions, statistical analysis is only carried out on the equipment functions, then a second equipment function is selected from the plurality of first equipment functions according to the requirement of a target object, and a second target function value of the second equipment function is selected, so that the equipment function to be analyzed is determined.
Optionally, the determining module 58 is further configured to determine a start time and an end time of a device usage period of the second device function; and screening the state change data between the starting time and the ending time from the function change data according to the second equipment function and the second target function value, wherein the state change data comprises the duration of the second target function value.
The method comprises the steps of determining a starting time and an ending time according to a device use period, and screening state change data which is positioned between the starting time and the ending time and accords with a second device function and a second target function value from the function change data, wherein the state change data at least comprises the duration of the second target function value.
An embodiment of the present invention also provides a storage medium including a stored program, wherein the program executes the method of any one of the above.
Alternatively, in the present embodiment, the above-described storage medium may be configured to store program code for performing the steps of:
s1, configuring a first function class of a device function according to a first configuration condition of the device function, and configuring a period judgment condition of the device function according to a second configuration condition of the device function;
s2, screening out function change data of a plurality of equipment functions from a database according to the first function category;
s3, matching the equipment use period of each equipment function in the function change data according to the period judging conditions;
s4, determining state change data of the equipment function to be analyzed in the equipment use period from the function change data.
An embodiment of the invention also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, configuring a first function class of a device function according to a first configuration condition of the device function, and configuring a period judgment condition of the device function according to a second configuration condition of the device function;
s2, screening out function change data of a plurality of equipment functions from a database according to the first function category;
s3, matching the equipment use period of each equipment function in the function change data according to the period judging conditions;
s4, determining state change data of the equipment function to be analyzed in the equipment use period from the function change data.
Alternatively, in the present embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments and optional implementations, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may alternatively be implemented in program code executable by computing devices, so that they may be stored in a memory device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps within them may be fabricated into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method of data statistics, comprising:
configuring a first function class of the equipment function according to a first configuration condition of the equipment function, and configuring a period judgment condition of the equipment function according to a second configuration condition of the equipment function;
screening out function change data of a plurality of equipment functions from a database according to the first function category; matching the equipment use period of each equipment function in the function change data according to the period judging condition;
and determining the state change data of the equipment function to be analyzed in the equipment use period from the function change data.
2. The data statistics method as recited in claim 1, wherein configuring the cycle judgment condition of the device function according to the second configuration condition of the device function comprises:
analyzing a first function value, a second function value, a third function value and a fourth function value of the equipment function from the second configuration condition;
determining a cycle start condition and a cycle end condition of the device function according to the first function value, the second function value, the third function value and the fourth function value, wherein the cycle start condition is that the function value of the device function is changed from the first function value to the second function value, and the cycle end condition is that the function value of the device function is changed from the third function value to the fourth function value;
And determining the cycle start condition and the cycle end condition as the cycle determination conditions.
3. The data statistics method of claim 1, wherein screening the function change data for the plurality of device functions from the database according to the first function class comprises:
determining a plurality of device functions indicated by the first function class and a first target function value for the plurality of device functions;
and screening the function change data from the database according to the plurality of equipment functions and the first target function value, wherein the function change data comprises the plurality of equipment functions, current function values of the plurality of equipment functions, starting time and ending time of the current function values and previous function values of the current function values, and the current function value is the first target function value.
4. The data statistics method according to claim 2, wherein the matching of the device use period of each device function in the function change data according to the period judgment condition includes:
matching a first current function value in a plurality of current function values of the function change data according to the first function value and the second function value, wherein the function change data comprises a plurality of device functions, the current function values of the plurality of device functions, the starting time and the ending time of the current function values and the previous function value of the current function value, the device functions corresponding to the plurality of current function values are identical to the device functions corresponding to the first function value, the first current function value is identical to the second function value, and the first previous function value corresponding to the first current function value is identical to the first function value;
Matching a second current function value in a plurality of current function values of the function change data according to the third function value and the fourth function value, wherein the second current function value is identical to the fourth function value, and a second previous function value corresponding to the second current function value is identical to the third function value;
in a case where the first current function value and the second current function value are matched and a first start time of the first current function value is earlier than a second end time of the second function value, the first start time is determined as a start time of a device use period of the device function, and the second end time is determined as an end time of the device use period.
5. The data statistics method as recited in claim 4, further comprising:
and if the first current function value and/or the second current function value are not matched or the first starting time is later than the second ending time, determining that the device function does not have the device service period in the function change data.
6. The data statistics method of claim 1, wherein determining from the function change data that the device function to be analyzed is prior to the state change data over the device usage period, the method further comprising:
Determining a plurality of first device functions from the plurality of device functions, wherein the plurality of first device functions are device functions matched with the service cycle of the device;
and determining a second device function in the plurality of first device functions according to the selection operation of the target object, and determining a second target function value of the second device function according to the second device function and the second target function value.
7. The data statistics method according to claim 6, wherein determining state change data of a device function to be analyzed in the device use period from the function change data comprises:
determining the starting time and the ending time of the equipment use period of the second equipment function;
and screening the state change data between the starting time and the ending time from the function change data according to the second equipment function and the second target function value, wherein the state change data comprises the duration of the second target function value.
8. A data statistics apparatus, comprising:
a configuration module, configured to configure a first function class of a device function according to a first configuration condition of the device function, and configure a cycle judgment condition of the device function according to a second configuration condition of the device function;
The screening module is used for screening out function change data of a plurality of equipment functions from the database according to the first function category;
the matching module is used for matching the equipment service period of each equipment function in the function change data according to the period judging condition;
and the determining module is used for determining the state change data of the equipment function to be analyzed in the equipment use period from the function change data.
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 7.
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 the claims 1 to 7 by means of the computer program.
CN202310641012.1A 2023-05-31 2023-05-31 Data statistics method and device, storage medium and electronic device Pending CN116756480A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310641012.1A CN116756480A (en) 2023-05-31 2023-05-31 Data statistics method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310641012.1A CN116756480A (en) 2023-05-31 2023-05-31 Data statistics method and device, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN116756480A true CN116756480A (en) 2023-09-15

Family

ID=87950650

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310641012.1A Pending CN116756480A (en) 2023-05-31 2023-05-31 Data statistics method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN116756480A (en)

Similar Documents

Publication Publication Date Title
CN114697150B (en) Command issuing method and device, storage medium and electronic device
CN115358395A (en) Knowledge graph updating method and device, storage medium and electronic device
CN117573320A (en) Task node execution method and device, storage medium and electronic device
CN115631832B (en) Method and device for determining cooking plan, storage medium and electronic device
CN116107975A (en) Control method and device of equipment, storage medium and electronic device
WO2024021546A1 (en) Behavior preference table generation method and apparatus, storage medium and electronic apparatus
CN116881752A (en) Data clustering method and device, storage medium and electronic equipment
CN116756480A (en) Data statistics method and device, storage medium and electronic device
CN114915514B (en) Method and device for processing intention, storage medium and electronic device
CN116383172A (en) Data backtracking method, storage medium and electronic device
CN116540556A (en) Equipment control method and device based on user habit
CN114840557A (en) Data query method and device, storage medium and electronic device
CN115345225A (en) Method and device for determining recommended scene, storage medium and electronic device
CN117579409A (en) Control instruction processing method and device, storage medium and electronic device
CN114839887A (en) Equipment attribute configuration method and device, storage medium and electronic device
CN115878030A (en) Data storage method and device, storage medium and electronic device
CN116540998A (en) Statistical data determining method and device, storage medium and electronic device
CN117573442A (en) Equipment testing method and device, storage medium and electronic device
CN115314332B (en) Equipment theme setting method and device, storage medium and electronic device
CN116301767A (en) Interface file generation method and device, storage medium and electronic device
CN117909872A (en) Method and device for determining classification result, storage medium and electronic device
CN116401322A (en) Method and device for establishing data model
CN115686603A (en) Control method and device of terminal equipment, storage medium and electronic equipment
CN115269926A (en) Family map determination method and device, storage medium and electronic device
CN116382727A (en) Equipment upgrading method, storage medium and electronic 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