Software restart duration acquisition method and device
By grouping and sorting location data and log data, the restart time of the App is calculated, which solves the problem that existing technologies cannot accurately count the restart time of the App, improves the accuracy of judging the frequency of App use, and promotes the stability of the IoT platform and the improvement of software performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- QINGDAO HAIER TECH
- Filing Date
- 2021-10-26
- Publication Date
- 2026-06-23
AI Technical Summary
Current technology cannot accurately measure the restart time of an app, leading to inaccurate judgments about whether an app is frequently used by users.
By grouping and sorting the generation time of the location data, and combining it with the log dataset, the restart time of the App from exit to the next launch is calculated. The restart time of the same user token is calculated using the location data and log data.
This improves the quality of judgments on whether an app is frequently used by users, enabling better measurement of IoT platform stability and promoting improvements in software functionality and performance.
Smart Images

Figure CN116028318B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of application software technology, and in particular to a method and apparatus for obtaining software restart duration. Background Technology
[0002] Whether IoT mobile applications (Apps) are frequently used by users is one of the important indicators for measuring the stability of an IoT platform.
[0003] Currently, since each time an app is launched, it generates a unique trace ID, the trace ID is usually used to count the frequency of app usage, and then the frequency is used to assess whether the app is frequently used by users.
[0004] The time interval between each exit and the next launch of an app is called the restart duration. The restart duration is a key factor in determining whether an app is frequently used by users. Since the Trace ID generated each time an app is launched is different, it is impossible to obtain the precise restart duration through the Trace ID, which leads to inaccurate judgments on whether an app is frequently used by users. Summary of the Invention
[0005] To address the problems existing in the prior art, embodiments of the present invention provide a method and apparatus for obtaining software restart duration.
[0006] In a first aspect, the present invention provides a method for obtaining software restart duration, comprising: grouping all point data generated by a target account within a target time period according to the generation time of each point data, and obtaining point data groups; wherein the point data is generated by the target account connecting to a cloud server;
[0007] Based on the log dataset of the target account during the target time period, and in conjunction with the location data group, the restart duration of the target account during the target time period is obtained.
[0008] According to the software restart duration acquisition method provided by the present invention, the step of grouping all location data generated by the target account within a target time period based on the generation time of each location data point to obtain the location data group includes:
[0009] Sort all location data of the target account within the target time period according to the generation time, and obtain the sorted location data;
[0010] Based on a duration threshold, the sorted location data is grouped to obtain the location data group.
[0011] According to the software restart duration acquisition method provided by the present invention, the step of grouping the sorted location data according to a duration threshold includes:
[0012] In the sorted point data, if the interval between the generation times of any two adjacent point data is not less than the duration threshold, then the two adjacent point data are divided into different point data groups.
[0013] If the interval duration is less than the duration threshold, then any two adjacent point data will be divided into the same point data group.
[0014] According to the software restart duration acquisition method provided by the present invention, the step of acquiring the restart duration of the target account within the target time period based on the log dataset of the target account within the target time period and in combination with the location data group includes:
[0015] The first point in each data set is selected as the starting data.
[0016] Sort each log data in the log dataset according to the generation time of each log data from front to back to obtain the sorted log dataset;
[0017] The restart duration is obtained based on the initial data of each data point group and the sorted log dataset.
[0018] According to the software restart duration acquisition method provided by the present invention, the restart duration is obtained based on the initial data of each data point group and the sorted log dataset, including:
[0019] The sorted log dataset is inserted into the sorted location data to obtain the sorted dataset; each data item in the sorted dataset is arranged from front to back according to the generation time of each data item.
[0020] For each starting data, the data in the sorted dataset that is sorted only before the current starting data is identified as the ending data;
[0021] Each starting data and its corresponding ending data are treated as a restart data group;
[0022] The restart duration is obtained from all restart data groups.
[0023] According to the software restart duration acquisition method provided by the present invention, the restart duration is acquired based on all restart data groups, including:
[0024] In any restart data group, the restart sub-duration corresponding to the restart data group is obtained based on the generation time of the start data and the generation time of the end data.
[0025] The restart duration is obtained based on all restart sub-durations.
[0026] According to the software restart duration acquisition method provided by the present invention, after acquiring the location data group, it further includes:
[0027] The usage frequency of the software is obtained based on the location data set.
[0028] Secondly, the present invention provides a software restart duration acquisition device, comprising: a grouping module, used to group all point data generated by a target account within a target time period according to the generation time of each point data, and to acquire point data groups; the point data is generated by the target account connecting to a cloud server;
[0029] The acquisition module is used to obtain the restart duration of the target account during the target time period based on the log dataset of the target account during the target time period and in combination with the location data group.
[0030] Thirdly, the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the software restart duration acquisition method described above.
[0031] Fourthly, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the software restart duration acquisition method described above.
[0032] The software restart duration acquisition method and apparatus provided by this invention can accurately calculate the software restart duration for the same account by combining location data and log datasets. This improves the quality of judgment on whether the software is frequently used by users, thereby better measuring the stability of the IoT platform. At the same time, it promotes the improvement of software functionality and performance, which is conducive to the stable and sound development of IoT software. Attached Figure Description
[0033] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0034] Figure 1This is one of the flowcharts illustrating the method for obtaining software restart duration provided by this invention;
[0035] Figure 2 This is the second flowchart illustrating the method for obtaining software restart duration provided by this invention;
[0036] Figure 3 This is a schematic diagram of the software restart duration acquisition device provided by the present invention;
[0037] Figure 4 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0038] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0039] It should be noted that, in the description of the embodiments of the present invention, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. Those skilled in the art can understand the specific meaning of the above terms in the present invention according to the specific circumstances.
[0040] The time from when an account exits the app to when the app is restarted is recorded as the app's restart time. The restart time can greatly influence the judgment of whether the app is frequently used by users.
[0041] In existing methods, Trace ID cannot accurately measure the restart time of an app, which leads to inaccurate judgments on whether an app is frequently used by users.
[0042] Each time an app is launched, it generates only a unique Trace ID, so it is impossible to determine the relevant data in the same launch and therefore cannot obtain the accurate restart time.
[0043] Currently, there is no method to calculate the restart time after a user exits the app without using Trace ID.
[0044] In the absence of Trace ID linking app and cloud platform data, this invention proposes a method for calculating app restart duration. Based on the same user token, it utilizes location data and log data to calculate the duration from when the same user token exits the app to the next app restart. This solves the problem of detecting app usage frequency without using Trace ID. Using this metric, developers can measure the stability of IoT platforms and scientifically and effectively optimize and improve apps to address user needs and promote healthy development.
[0045] The following is combined Figures 1 to 4 This invention describes the method and apparatus for obtaining software restart duration provided in embodiments of the present invention.
[0046] Figure 1 This is one of the flowcharts illustrating the method for obtaining software restart duration provided by this invention, such as... Figure 1 As shown, including but not limited to the following steps:
[0047] First, in step S1, based on the generation time of each location data point, all location data generated by the target account within the target time period are grouped to obtain location data groups; the location data is generated by the target account connecting to the cloud server.
[0048] The software can be a mobile application (App). In the subsequent embodiments of this invention, the example of obtaining the restart time of the App will be used for illustration, which is not considered as a limitation on the scope of protection of this invention.
[0049] The moment the target account logs into the App, the App connects to the cloud server for the first time, generating the first location data. Each time the App connects to the cloud server, it generates one location data point, and the moment of connecting to the cloud server is the moment the location data is generated.
[0050] Location data can be connect-to-cloud location data. If the time difference between the generation times of two consecutive location data exceeds a duration threshold, the app can be considered to have undergone one launch. The duration threshold can be flexibly selected according to the actual situation.
[0051] A target account has a unique user token. For the same user token, based on the generation time of the location data, all location data within the target time period can be grouped according to the time difference between the generation times of the location data. Location data with a time difference less than the duration threshold are grouped into the same location data group. One or more location data groups can be obtained.
[0052] Further, in step S2, based on the log dataset of the target account during the target time period and in combination with the location data group, the restart duration of the target account during the target time period is obtained.
[0053] Specifically, during the use of the App, procedural event records, namely log data, are generated. Generally, for the same user token, the last log entry sorted by time after each App launch can be used as the endpoint of this App launch. Furthermore, for each App launch, if in the corresponding point data group, there exists a point data entry whose generation time is later than the termination data of this launch, then that last point data entry will be used as the endpoint of this launch.
[0054] The collection formed by all log data is called a log dataset.
[0055] The types of log data include, but are not limited to: device status data, pulled device data, and subscribed device data.
[0056] The first data point generated in any given data set is designated as the starting data, representing the beginning of the App's startup. The generation time of this starting data is considered the start time of the current startup. In the log dataset, the closest data point to the starting data (generated before it) is identified as the ending data point, representing the end point of the App's previous startup. The generation time of this ending data point can be considered the end time of the previous startup. The time difference between this starting and ending data points is calculated as the restart duration of the App after its last exit. Summarizing the restart durations within the target time period yields the total restart duration for that period.
[0057] The software restart duration acquisition method provided by this invention can accurately calculate the software restart duration for the same account by combining location data and log datasets. This improves the quality of judgment on whether the software is frequently used by users, thereby better measuring the stability of the IoT platform. At the same time, it promotes the improvement of software functionality and performance, which is conducive to the stable and sound development of IoT software.
[0058] Optionally, based on the generation time of each data point, all data points generated by the target account within the target time period are grouped to obtain data point groups, including:
[0059] Sort all location data of the target account within the target time period according to the generation time, and obtain the sorted location data;
[0060] Based on a duration threshold, the sorted location data is grouped to obtain the location data group.
[0061] Optionally, grouping the sorted location data according to a duration threshold includes:
[0062] In the sorted point data, if the interval between the generation times of any two adjacent point data is not less than the duration threshold, then the two adjacent point data are divided into different point data groups.
[0063] If the interval duration is less than the duration threshold, then any two adjacent point data will be divided into the same point data group.
[0064] Specifically, all location data of the target account within the target time period are arranged in order from the beginning to the end according to the generation time, and the sorted location data is obtained.
[0065] Based on industry experience, if there is a time difference of more than 2 seconds between the generation times of two consecutive data points in the sorted data points, these two data points are considered to have been generated by the App during two launches. Therefore, the duration threshold can be set to 2 seconds.
[0066] In the sorted location data, if the interval between the generation times of any two adjacent location data points is not less than 2 seconds, then these two location data points can be considered to have been generated by the App during its two launches, and can be divided into two adjacent location data groups. That is, in these two location data points, the one generated earlier in the sorted data was generated during the first launch of the App and is placed in the first location data group; the one generated later in the sorted data was generated during the second launch of the App and can be used as the starting point for the second launch, thus being placed in the second location data group. Finally, one or more location data groups can be obtained. The location data points in each location data group are arranged sequentially according to time.
[0067] The software restart duration acquisition method provided by this invention utilizes the generation time of the location data to sort and group the location data, obtaining multiple location data groups. The calculation is simple and highly accurate, providing a basis for obtaining precise restart duration.
[0068] Optionally, obtaining the restart duration of the target account within the target time period based on the log dataset of the target account during the target time period and in combination with the location data group includes:
[0069] The first point in each data set is selected as the starting data.
[0070] Sort each log data in the log dataset according to the generation time of each log data from front to back to obtain the sorted log dataset;
[0071] The restart duration is obtained based on the initial data of each data point group and the sorted log dataset.
[0072] Specifically, since the data points in each data point group are arranged in chronological order, the data point at the top of each data point group can be determined as the starting data of that data point group, serving as the starting point for the App to launch. Accordingly, the time when the starting data is generated is regarded as the starting time of the App each time it is launched.
[0073] The log dataset within the target time period is sorted by arranging all log data in chronological order from the time each log data was generated.
[0074] Optionally, the restart duration is obtained based on the initial data of each data point group and the sorted log dataset, including:
[0075] The sorted log dataset is inserted into the sorted location data to obtain the sorted dataset; each data item in the sorted dataset is arranged from front to back according to the generation time of each data item.
[0076] For each starting data, the data in the sorted dataset that is sorted only before the current starting data is identified as the ending data;
[0077] Each starting data and its corresponding ending data are treated as a restart data group;
[0078] The restart duration is obtained from all restart data groups.
[0079] Specifically, the sorted log dataset is inserted into the sorted location data to obtain the sorted dataset. The sorted dataset contains two types of data: location data and log data, and the sorted dataset is arranged from beginning to end according to the generation time of each data item.
[0080] For each starting data that serves as the starting point for each App launch, the data in the sorted dataset that is sorted only before the current starting data is identified as the ending data and is considered the end point of the App in the previous launch.
[0081] Each starting data entry and its corresponding ending data entry are grouped together as a restart data group. The restart data group includes the starting data that marks the beginning of this restart and the ending data that marked the end of the previous restart.
[0082] Optionally, the restart duration is obtained based on all restart data groups, including:
[0083] In any restart data group, the restart sub-duration corresponding to the restart data group is obtained based on the generation time of the start data and the generation time of the end data.
[0084] The restart duration is obtained based on all restart sub-durations.
[0085] Specifically, for the start data of this startup and the end data of the last startup in the restart data group, the time difference between their generation times can be used to obtain the restart sub-duration of the target account after the last startup exit; then, the restart sub-durations corresponding to all restart data groups are summarized to obtain the restart duration.
[0086] According to the software restart duration acquisition method provided by the present invention, the start and end points of each software startup are determined based on the start data in each data point group, thereby obtaining the accurate software restart duration, providing a basis for determining whether the software is frequently used by users.
[0087] Optionally, after acquiring the point data set, the following may also be included:
[0088] The usage frequency of the software is obtained based on the location data set.
[0089] After grouping all the location data within the target time period, one or more location data groups are obtained. The number of location data groups within the target time period is the number of times the target account launches the App within the target time period. Based on the number of launches, the usage frequency of the App within the target time period can be obtained.
[0090] According to the software restart duration acquisition method provided by the present invention, the usage frequency of the software can be obtained by using point data groups, providing multi-dimensional data for judging whether the software is frequently used by users, thereby improving the accuracy of the judgment.
[0091] Figure 2 This is the second flowchart illustrating the method for obtaining software restart duration provided by this invention, as follows: Figure 2 As shown, firstly, in step S21, for the same user token, all location data are arranged in chronological order and grouped. All location data are arranged in chronological order and grouped according to the time difference between the generation times of the location data. Location data with a time difference of less than 2 seconds are grouped into the same location data group, allowing for the acquisition of multiple location data groups.
[0092] Furthermore, in step S22, the first point data in each point data group is found as the starting data, which serves as the starting point for the App in a single launch.
[0093] Since the data at each location in the location data group is arranged sequentially according to time, the first data in the sorted order can be determined in each location data group as the starting point for launching the corresponding App.
[0094] Further, in step S23, the log data in the log dataset is arranged in chronological order.
[0095] In the log dataset within the target time period, each log entry is sorted in chronological order of its creation time to obtain the sorted log dataset.
[0096] Furthermore, in step S24, the last piece of termination data in the log data generated before the starting data is determined as the endpoint of the App's startup.
[0097] For the starting data that serves as the starting point for App startup, the log data generated before the starting data is filtered out from the sorted log data. Then, the last log data in the log data before the starting data is determined as the ending data, which serves as the endpoint of the App's last startup.
[0098] Furthermore, in step S25, the time difference between the start point of each startup and the end point of the previous startup is calculated as the restart sub-duration.
[0099] The time difference between the start data of this startup and the end data of the previous startup can be used to obtain the restart sub-duration of the target account after the last startup exit.
[0100] Furthermore, in step S26, all restart sub-durations are summarized to obtain the restart duration within the target time period.
[0101] The software restart duration acquisition method provided by this invention can accurately calculate the software restart duration for the same account by combining location data and log datasets. This improves the quality of judgment on whether the software is frequently used by users, thereby better measuring the stability of the IoT platform. At the same time, it promotes the improvement of software functionality and performance, which is conducive to the stable and sound development of IoT software.
[0102] Figure 3 This is a schematic diagram of the software restart duration acquisition device provided by the present invention, as shown below. Figure 3 As shown, it includes:
[0103] Grouping module 301 is used to group all point data generated by the target account within a target time period according to the generation time of each point data, and obtain point data groups; the point data is generated by the target account connecting to the cloud server;
[0104] The acquisition module 302 is used to acquire the restart duration of the target account during the target time period based on the log dataset of the target account during the target time period and in combination with the location data group.
[0105] First, the grouping module 301 groups all the location data generated by the target account within the target time period according to the generation time of each location data, and obtains the location data group; the location data is generated by the target account connecting to the cloud server.
[0106] The moment the target account logs into the App, the App connects to the cloud server for the first time, generating the first location data. Each time the App connects to the cloud server, it generates one location data point, and the moment of connecting to the cloud server is the moment the location data is generated.
[0107] Location data can be connect-to-cloud location data. If the time difference between the generation times of two consecutive location data exceeds the duration threshold, it can be considered that the App has undergone one launch.
[0108] Each target account possesses a unique user token. For the same user token, based on the generation time of the location data, all location data within the target time period can be grouped according to the time difference between their generation times. Location data with a time difference less than a duration threshold are grouped into the same location data group. One or more location data groups can be obtained. The duration threshold can be flexibly selected according to the actual situation.
[0109] The acquisition module 302 is specifically used to sort all the location data of the target account within the target time period according to the generation time, and obtain the sorted location data;
[0110] In the sorted point data, if the interval between the generation times of any two adjacent point data is not less than the duration threshold, then the two adjacent point data are divided into different point data groups.
[0111] If the interval duration is less than the duration threshold, then any two adjacent point data will be divided into the same point data group.
[0112] Arrange all location data of the target account within the target time period in chronological order of generation time to obtain the sorted location data.
[0113] Based on industry experience, if there is a time difference of more than 2 seconds between the generation times of two consecutive data points in the sorted data points, these two data points are considered to have been generated by the App during two launches. Therefore, the duration threshold can be set to 2 seconds.
[0114] In the sorted location data, if the interval between the generation times of any two adjacent location data points is not less than 2 seconds, then these two location data points can be considered to have been generated by the App during its two launches, and can be divided into two adjacent location data groups. That is, in these two location data points, the one generated earlier in the sorted data was generated during the first launch of the App and is placed in the first location data group; the one generated later in the sorted data was generated during the second launch of the App and can be used as the starting point for the second launch, thus being placed in the second location data group. Finally, one or more location data groups can be obtained. The location data points in each location data group are arranged sequentially according to time.
[0115] Furthermore, the acquisition module 302 obtains the restart duration of the target account during the target time period based on the log dataset of the target account during the target time period and in combination with the location data group.
[0116] Specifically, during the use of the App, procedural event records, namely log data, are generated. Generally, for the same user token, the last log entry sorted by time after each App launch can be used as the endpoint of this App launch. Furthermore, for each App launch, if in the corresponding point data group, there exists a point data entry whose generation time is later than the termination data of this launch, then that last point data entry will be used as the endpoint of this launch.
[0117] The collection formed by all log data is called a log dataset.
[0118] The types of log data include, but are not limited to: device status data, pulled device data, and subscribed device data.
[0119] The first data point generated in any given data set is designated as the starting data, representing the beginning of the app's startup. The generation time of this starting data is considered the start time of the current startup. In the log dataset, the closest data point to the starting data (generated before it) is identified as the ending data point of the previous startup. This is considered the end time of the previous startup, and its generation time can be considered the end time of that previous startup. The time difference between this starting and ending data points is the app's restart sub-duration after the last exit. Summarizing the restart sub-durations within the target time period yields the total restart duration for that period.
[0120] The acquisition module 302 is specifically used to determine the first point data in each point data group as the starting data;
[0121] Sort each log data in the log dataset according to the generation time of each log data from front to back to obtain the sorted log dataset;
[0122] The sorted log dataset is inserted into the sorted location data to obtain the sorted dataset; each data item in the sorted dataset is arranged from front to back according to the generation time of each data item.
[0123] For each starting data, the data in the sorted dataset that is sorted only before the current starting data is identified as the ending data;
[0124] Each starting data and its corresponding ending data are treated as a restart data group;
[0125] In any restart data group, the restart sub-duration corresponding to the restart data group is obtained based on the generation time of the start data and the generation time of the end data.
[0126] The restart duration is obtained based on all restart sub-durations.
[0127] Specifically, since the data points in each data point group are arranged in chronological order, the data point at the top of each data point group can be determined as the starting data of that data point group, serving as the starting point for the App to launch. Accordingly, the time when the starting data is generated is regarded as the starting time of the App each time it is launched.
[0128] The log dataset within the target time period is sorted by arranging all log data in chronological order from the time each log data was generated.
[0129] The sorted log dataset is inserted into the sorted location data to obtain the sorted dataset. The sorted dataset contains two types of data: location data and log data, and the sorted dataset is arranged from the beginning to the end according to the generation time of each data item.
[0130] For each starting data that serves as the starting point for each App launch, the data in the sorted dataset that is sorted only before the current starting data is identified as the ending data and is considered the end point of the App in the previous launch.
[0131] Each starting data entry and its corresponding ending data entry are grouped together as a restart data group. The restart data group includes the starting data that marks the beginning of this restart and the ending data that marked the end of the previous restart.
[0132] The time difference between the start data of this startup and the end data of the last startup in the restart data group can be used to obtain the restart sub-duration of the target account after the last startup exit; then the restart sub-durations corresponding to all restart data groups are summarized to obtain the restart duration.
[0133] The software restart duration acquisition device provided by this invention can accurately calculate the restart duration of software for the same account by combining location data and log datasets. This improves the quality of judgment on whether the software is frequently used by users, thereby better measuring the stability of the Internet of Things (IoT) platform. At the same time, it promotes the improvement of software functionality and performance, which is conducive to the stable and sound development of IoT software.
[0134] It should be noted that the software restart duration acquisition device provided in this embodiment of the invention can execute the software restart duration acquisition method described in any of the above embodiments during actual operation, and this embodiment will not elaborate on this.
[0135] Figure 4 This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 4 As shown, the electronic device may include a processor 410, a communications interface 420, a memory 430, and a communication bus 440. The processor 410, communications interface 420, and memory 430 communicate with each other via the communication bus 440. The processor 410 can call logical instructions in the memory 430 to execute a software restart duration acquisition method. This method includes: grouping all point data generated by the target account within a target time period according to the generation time of each point data point, and obtaining point data groups; the point data is generated by the target account connecting to a cloud server; and obtaining the restart duration of the target account within the target time period based on the target account's log dataset within the target time period, combined with the point data groups.
[0136] Furthermore, the logical instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0137] On the other hand, the present invention also provides a computer program product, the computer program product including a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, when the program instructions are executed by a computer, the computer is able to execute the software restart duration acquisition method provided by the above methods, the method including: grouping all point data generated by the target account within a target time period according to the generation time of each point data, to obtain point data groups; the point data is generated by the target account connecting to a cloud server; and obtaining the restart duration of the target account within the target time period based on the log dataset of the target account within the target time period, combined with the point data groups.
[0138] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the software restart duration acquisition method provided in the above embodiments. The method includes: grouping all point data generated by the target account within a target time period according to the generation time of each point data point, and obtaining point data groups; the point data is generated by the target account connecting to a cloud server; and obtaining the restart duration of the target account within the target time period based on the log dataset of the target account within the target time period, combined with the point data groups.
[0139] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0140] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0141] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for obtaining software restart duration, characterized in that, include: Sort all location data of the target account within the target time period according to the generation time, obtain the sorted location data, and group all location data generated by the target account within the target time period to obtain location data groups; the location data is generated by the target account connecting to the cloud server; The first point in each data group is selected as the starting data. Sort each log data in the log dataset according to the generation time of each log data from front to back to obtain the sorted log dataset; based on the starting data of each data point group and the sorted log dataset, obtain the restart duration, where the time interval between each exit and the next start is the restart duration. Among them, the first point data generated in any point data group is determined as the starting data, and the generation time of the starting data is regarded as the start time of the startup; In the log dataset, find the termination data that was generated before the starting data and is closest to the starting data. The generation time of the termination data can be regarded as the termination time of the last startup. By obtaining the restart sub-duration between the start data and the end data, and summing up the restart sub-durations within the target time period, the restart duration within the target time period can be obtained.
2. The method for obtaining software restart duration according to claim 1, characterized in that, The step of grouping all location data generated by the target account within the target time period to obtain location data groups includes: Based on a duration threshold, the sorted location data is grouped to obtain the location data group.
3. The method for obtaining software restart duration according to claim 2, characterized in that, The step of grouping the sorted location data according to a duration threshold includes: In the sorted point data, if the interval between the generation times of any two adjacent point data is not less than the duration threshold, then the two adjacent point data are divided into different point data groups. If the interval duration is less than the duration threshold, then any two adjacent point data will be divided into the same point data group.
4. The method for obtaining software restart duration according to claim 1, characterized in that, The step of obtaining the restart duration based on the initial data of each data point group and the sorted log dataset includes: The sorted log dataset is inserted into the sorted location data to obtain the sorted dataset; each data item in the sorted dataset is arranged from front to back according to the generation time of each data item. For each starting data, the data in the sorted dataset that is sorted only before the current starting data is identified as the ending data; Each starting data and its corresponding ending data are treated as a restart data group; The restart duration is obtained from all restart data groups.
5. The method for obtaining software restart duration according to claim 4, characterized in that, The step of obtaining the restart duration based on all restart data groups includes: In any restart data group, the restart sub-duration corresponding to the restart data group is obtained based on the generation time of the start data and the generation time of the end data. The restart duration is obtained based on all restart sub-durations.
6. The method for obtaining software restart duration according to any one of claims 1 to 5, characterized in that, After acquiring the point data set, the following is also included: The usage frequency of the software is obtained based on the location data set.
7. A device for obtaining software restart duration, characterized in that, include: The grouping module is used to sort all location data of the target account within the target time period according to the generation time, obtain the sorted location data, and group all location data generated by the target account within the target time period to obtain location data groups; the location data is generated by the target account connecting to the cloud server; The acquisition module is used to determine the first point data in each point data group as the starting data; Sort each log data in the log dataset according to the generation time of each log data from front to back to obtain the sorted log dataset; based on the starting data of each data point group and the sorted log dataset, obtain the restart duration, where the time interval between each exit and the next start is the restart duration. Among them, the first point data generated in any point data group is determined as the starting data, and the generation time of the starting data is regarded as the start time of the startup; In the log dataset, find the termination data that was generated before the starting data and is closest to the starting data. The generation time of the termination data can be regarded as the termination time of the last startup. By obtaining the restart sub-duration between the start data and the end data, and summing up the restart sub-durations within the target time period, the restart duration within the target time period can be obtained.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the software restart duration acquisition method as described in any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the software restart duration acquisition method as described in any one of claims 1 to 6.