A method and device for counting software usage time
By obtaining the form arrangement order and handle information, the software usage time is counted, which solves the problem of omission and low accuracy caused by the form being covered, and achieves more accurate software usage time statistics.
Patent Information
- Application Number
- CN201911203868.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-29
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2039-11-29
AI Technical Summary
Existing technology cannot effectively solve the problem of forms being overwritten, resulting in missing software usage time statistics and low accuracy.
By obtaining the arrangement order of the windows corresponding to the software in the z-order, and obtaining the process identification and display area of each form according to the form handle, the software information is determined to count the usage time, avoiding omissions and improving accuracy.
It effectively avoids statistical omissions, improves the accuracy of software usage time statistics, and ensures the integrity and reliability of data.
Smart Images

Figure CN112882886B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for counting software usage time. Background Art
[0002] The length of time the software is used can be used to obtain information such as the user stickiness of the corresponding software, providing data support for the promotion or adjustment of the software.
[0003] The existing technology mainly uses means such as monitoring window time changes, regularly obtaining system process flow tables, and regularly taking desktop screenshots to count software usage time.
[0004] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0005] 1. The problem of the window being covered cannot be solved, and statistical omissions may occur easily;
[0006] 2. The system process flow table cannot determine the software in the user-visible area, and it is difficult to accurately identify the corresponding software program through screenshots, resulting in low accuracy of statistical data. Summary of the invention
[0007] In view of this, an embodiment of the present invention provides a method and device for counting software usage time, which can avoid the problem of statistical omissions and improve the accuracy of statistical data.
[0008] To achieve the above object, according to a first aspect of an embodiment of the present invention, a method for counting software usage time is provided, comprising:
[0009] Get the arrangement order of the windows corresponding to the software in the z-order;
[0010] Get the process ID corresponding to each window and the display area on the terminal screen according to the window handle;
[0011] Determine software information corresponding to the form according to the process identifier, wherein the software information indicates timestamp information;
[0012] The usage time of corresponding software is counted according to the arrangement order, display area and software information.
[0013] Furthermore, the step of obtaining the display area of each window on the terminal screen according to the window handle includes: obtaining the coordinate position of the corresponding window on the terminal screen according to the window handle, and obtaining the display area of the corresponding window on the terminal screen by performing area calculation on the coordinate position.
[0014] Furthermore, the step of counting the usage time of the corresponding software according to the arrangement order, display area and software information includes: according to the arrangement order, starting from the window at the top of the z-order, determining all windows that make the display area corresponding to the window greater than or equal to the upper limit of the terminal screen threshold, and the software information corresponding to all the windows.
[0015] Furthermore, the step of counting the usage time of the corresponding software according to the arrangement order, display area and software information includes: according to the software information, counting the usage time of the software corresponding to all windows when the display area corresponding to each window is between the upper limit and the lower limit of the terminal screen threshold.
[0016] Furthermore, the method for counting software usage time also includes: accumulating the usage time of software of the same type to obtain the total usage time.
[0017] Furthermore, the number of the terminal screen is at least one.
[0018] Furthermore, the method for counting software usage time also includes: setting a loop period and cyclically executing the following steps: obtaining the arrangement order of the windows corresponding to the software in the z-order; obtaining the process identifier corresponding to each window and the display area on the terminal screen according to the window handle; determining the software information corresponding to the window according to the process identifier; and counting the usage time of the corresponding software according to the arrangement order, display area and software information.
[0019] According to a second aspect of an embodiment of the present invention, a device for counting software usage time is provided, comprising:
[0020] The arrangement order acquisition module is used to obtain the arrangement order of the windows corresponding to the software in the z order;
[0021] The window handle module is used to obtain the process ID corresponding to each window and the display area on the terminal screen according to the window handle;
[0022] A software information determination module, used to determine the software information corresponding to the form according to the process identifier, wherein the software information indicates the timestamp information;
[0023] The statistics module is used to count the usage time of the corresponding software according to the arrangement order, display area and software information.
[0024] According to a third aspect of an embodiment of the present invention, a terminal device is provided, including:
[0025] one or more processors;
[0026] a storage device for storing one or more programs,
[0027] When one or more programs are executed by one or more processors, the one or more processors implement any of the above-mentioned methods for counting software usage time.
[0028] According to a fourth aspect of an embodiment of the present invention, there is provided a computer-readable medium on which a computer program is stored. When the program is executed by a processor, the method for counting the usage time of any of the above software is implemented.
[0029] An embodiment of the above invention has the following advantages or beneficial effects: because the arrangement order of the windows corresponding to the software in the z-order is obtained; the process identifier corresponding to each window and the display area on the terminal screen are obtained according to the window handle; the software information corresponding to the window is determined according to the process identifier, wherein the software information indicates the timestamp information; and the technical means of counting the usage time of the corresponding software according to the arrangement order, display area and software information are used, so the situation of statistical omissions caused by the inability to solve the problem of window coverage in the prior art and the technical problem of low statistical accuracy are overcome, thereby achieving the technical effect of avoiding the problem of statistical omissions and improving the accuracy of statistical data.
[0030] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0032] Figure 1 is a schematic diagram of the main process of the method for counting software usage time provided by the first embodiment of the present invention;
[0033] Figure 2a is a schematic diagram of the main process of the method for counting software usage time provided by the second embodiment of the present invention;
[0034] Figure 2b is based on Figure 2a A schematic diagram of the z-order arrangement sequence obtained by the method shown;
[0035] Figure 3 is a schematic diagram of main modules of a statistical device for software usage time provided in accordance with an embodiment of the present invention;
[0036] Figure 4 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0037] Figure 5 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0038] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0039] Figure 1 Schematic diagram of the main process of the method for counting software usage time provided according to the first embodiment of the present invention; Figure 1 As shown, the statistical method for software usage time provided by the embodiment of the present invention mainly includes:
[0040] Step S101, obtaining the arrangement order of the windows corresponding to the software in the z-order.
[0041] The window z-order is a virtual axis in the terminal screen, from the inside to the outside. If the width of the terminal screen is regarded as the x-axis and the height of the terminal screen is regarded as the y-axis, the z-order is an axis perpendicular to these two axes. Its main function is to arrange the order of windows, which window is activated first, etc.
[0042] By obtaining the arrangement order of the windows in the z-order through the above settings, the situation where the windows are covered in the prior art can be solved, and the problem of statistical omissions can be avoided.
[0043] Step S102, obtaining the process identifier corresponding to each window and the display area on the terminal screen according to the window handle.
[0044] Specifically, according to an embodiment of the present invention, the above-mentioned step of obtaining the display area of each window on the terminal screen according to the window handle includes: obtaining the coordinate position of the corresponding window on the terminal screen according to the window handle, and obtaining the display area of the corresponding window on the terminal screen by performing area calculation on the coordinate position.
[0045] Through the above settings, the window handle corresponding to the corresponding window can be obtained through API (Application Program Interface), and then the display area of the window in the terminal screen and the process ID (PID) corresponding to the window can be obtained through the window handle.
[0046] Step S103: determining software information corresponding to the window according to the process identifier, wherein the software information indicates timestamp information.
[0047] Through the above settings, the software name and timestamp information corresponding to the window displayed on the screen can be obtained, and the usage time can be determined.
[0048] According to an embodiment of the present invention, the above software information also includes information such as the software name, software version, and a digital signature corresponding to the software.
[0049] By obtaining the software name, the existing technology avoids obtaining the system process list. By comparing the content in the process list, the software and time before and after the process change can be obtained, but it is impossible to distinguish which software is in the user-visible area, and the exported statistical data is mixed with a lot of irrelevant data, which affects the accuracy of the statistics. The digital signature can determine whether the software is legal software; the hash value corresponding to the software can also be obtained by calculation, and the comparison of the hash value can determine whether the software file has been tampered with. The above settings can effectively avoid the use of piracy and illegal software.
[0050] Step S104, counting the usage time of the corresponding software according to the arrangement order, display area and software information.
[0051] Specifically, according to an embodiment of the present invention, the above-mentioned step of counting the usage time of the corresponding software according to the arrangement order, display area and software information includes: according to the arrangement order, starting from the window at the top of the z-order, determine all windows that make the display area corresponding to the window greater than or equal to the upper limit of the threshold, and the software information corresponding to all the windows.
[0052] Through the above settings, the duration of all software displayed on the terminal screen can be counted, which not only avoids the statistical omission problem caused by window coverage, but also improves the accuracy of software duration statistics. At the same time, according to the statistical results, corresponding software updates can be recommended according to user preferences.
[0053] Further, according to an embodiment of the present invention, the above-mentioned step of counting the usage time of the corresponding software according to the arrangement order, display area and software information includes also including: according to the software information, counting the usage time of the software corresponding to all windows when the display area corresponding to each window is between the upper limit and the lower limit of the terminal screen threshold.
[0054] The above setting determines the usage status of the corresponding window by periodically judging the display area of the window. That is, when the window display area is smaller than the lower threshold of the terminal screen (not visible on the screen or closed), the corresponding usage time statistics are stopped, and then the usage time statistics are performed.
[0055] Furthermore, according to a specific implementation of an embodiment of the present invention, the above-mentioned software duration statistics method also includes: accumulating the usage duration of software of the same type to obtain the total usage duration, and uploading the total usage duration to the server at regular intervals. According to actual conditions, users may switch to the corresponding window of other software to perform corresponding business operations during the use of software. Therefore, for the same software, its usage process may not be continuous. Therefore, through the above-mentioned settings, within a certain period of time, several usage durations of the same software are summarized to obtain the total usage duration, and uploaded to the server for corresponding records.
[0056] Specifically, the number of the terminal screen is at least one. According to actual conditions, the display screen of the desktop can be one or more.
[0057] According to an embodiment of the present invention, the above-mentioned method for counting software usage time also includes: setting a loop period, and cyclically executing the following steps: obtaining the arrangement order of the windows corresponding to the software in the z-order; obtaining the process identifier corresponding to each window and the display area on the terminal screen according to the window handle; determining the software information corresponding to the window according to the process identifier; and counting the usage time of the corresponding software according to the arrangement order, display area and software information.
[0058] By setting a cycle, the window arrangement order, display area and software information are obtained at regular intervals, and then the software usage time is counted.
[0059] According to the technical solution of the embodiment of the present invention, the arrangement order of the windows corresponding to the software in the z-order is obtained; the process identifier corresponding to each window and the display area on the terminal screen are obtained according to the window handle; the software information corresponding to the window is determined according to the process identifier, wherein the software information indicates the timestamp information; and the technical means of counting the usage time of the corresponding software according to the arrangement order, display area and software information are used. Therefore, the situation of statistical omissions caused by the inability to solve the problem of window coverage in the prior art and the technical problem of low statistical accuracy are overcome, thereby achieving the technical effect of avoiding the problem of statistical omissions and improving the accuracy of statistical data.
[0060] Figure 2a Schematic diagram of the main process of the method for counting software usage time provided by the second embodiment of the present invention; Figure 2a As shown, the statistical method of software duration provided by the embodiment of the present invention mainly includes:
[0061] Step S201, periodically obtaining the arrangement order of the windows corresponding to the software in the z-order.
[0062] The z-order of a window: indicates the position of a window in a stack of overlapping windows, which is positioned according to an imaginary axis (the z-axis extending outward from the screen). The topmost window in the z-order covers (including complete and partial coverage) all other windows, and the bottommost window in the z-order is covered (including complete and partial coverage) by all other windows.
[0063] Get the arrangement order of the form in the z order by timing (setting the cycle) (such as Figure 2b As shown), the problem of window coverage in the prior art can be solved, the situation of statistical omissions can be avoided, and the accuracy of usage time statistics can be further improved. Specifically, according to the actual situation, the timing can be set to traverse and obtain the arrangement order of the windows in the z order every second or every minute.
[0064] Step S202: acquiring the display area of the window on the terminal screen according to the arrangement order from the upper layer to the lower layer and the window handle.
[0065] First, the display area corresponding to the top window in the z-order is obtained through the window handle, and the window handle is obtained through the API. For example, obtaining the window handle of the top window in the z-order can be achieved by calling the system API: GetTopWindow.
[0066] Specifically, the coordinate position of the corresponding window on the terminal screen can be obtained according to the window handle, and the display area of the corresponding window on the terminal screen can be obtained by performing area calculation on the coordinate position. According to a specific implementation of the embodiment of the present invention, it can be implemented by calling the system API: GetWindowRect.
[0067] Step S203, determine whether the acquired display area exceeds the upper threshold of the terminal screen. If the determination result is yes, execute step S204; if not, go to step S205.
[0068] The upper threshold limit can be the area of the entire desktop screen (there is at least one desktop screen), or can be slightly smaller than the above area. The purpose of this setting is to filter out windows with too small display areas to avoid irrelevant data affecting the final statistical results.
[0069] Step S204, obtaining the process ID of the obtained window according to the window handle.
[0070] The process ID corresponding to the window is obtained through the window handle. The process ID indicates the properties of the application (software) corresponding to the window, including property information such as software name, software version and timestamp.
[0071] Step S205, obtaining the next window in the arrangement order.
[0072] According to the arrangement order from the top to the bottom, the display area of the corresponding window is obtained in sequence, which can avoid statistical omissions. Specifically, it can be achieved by calling the system API: GetNextWindow.
[0073] Step S206, determining the software information corresponding to the window according to the process identifier.
[0074] Specifically, the process identifier indicates the properties of the application (software) corresponding to the form, including property information such as the software name, software version, and timestamp. Through the above settings, the software name and timestamp information corresponding to the form displayed on the screen can be known, and then the usage time can be determined. This avoids the problem of obtaining the system's process list in the prior art, obtaining the software and time before and after the process change by comparing the content in the process list, but being unable to distinguish which software is in the user-visible area, and exporting statistical data mixed with a lot of irrelevant data, affecting the accuracy of the statistics.
[0075] Furthermore, according to the above process identifier, the digital signature and other information corresponding to the software can be obtained, and the digital signature can be used to determine whether the software is legal; the hash value corresponding to the software can also be obtained by calculation, and the comparison of the hash value can be used to determine whether the software file has been tampered with. The above settings can effectively avoid the use of pirated and illegal software.
[0076] Step S207, counting the usage time of the corresponding software according to the software information.
[0077] The usage time of the corresponding software is counted according to the timestamp information indicated by the software information. Through the above settings, the usage time of the software that is only partially covered is counted, which avoids the situation of statistical omissions and improves the accuracy of the time statistics. At the same time, according to the statistical results, the corresponding software updates can be recommended according to the user's preferences.
[0078] Furthermore, according to an embodiment of the present invention, the statistical method of the software duration also includes: accumulating the usage duration of the same type of software to obtain the total usage duration, and uploading the total usage duration to the server at regular intervals. According to actual conditions, the user may switch to the window corresponding to other software to perform corresponding business operations during the use of the software. Therefore, for the same software, its use process may not be continuous. Therefore, through the above settings, within a certain period of time, several usage durations of the same software are summarized to obtain the total usage duration, and uploaded to the server for corresponding records.
[0079] According to the technical solution of the embodiment of the present invention, the arrangement order of the windows corresponding to the software in the z-order is obtained; the process identifier corresponding to each window and the display area on the terminal screen are obtained according to the window handle; the software information corresponding to the window is determined according to the process identifier, wherein the software information indicates the timestamp information; and the technical means of counting the usage time of the corresponding software according to the arrangement order, display area and software information are used. Therefore, the situation of statistical omissions caused by the inability to solve the problem of window coverage in the prior art and the technical problem of low statistical accuracy are overcome, thereby achieving the technical effect of avoiding the problem of statistical omissions and improving the accuracy of statistical data.
[0080] Figure 3 Schematic diagram of main modules of the statistical device for software usage time provided according to an embodiment of the present invention; Figure 3 As shown, the software usage time statistics device 300 provided in the embodiment of the present invention mainly includes:
[0081] The arrangement order acquisition module 301 is used to acquire the arrangement order of the windows corresponding to the software in the z-order.
[0082] The window z-order is a virtual axis in the terminal screen, from the inside to the outside. If the width of the terminal screen is regarded as the x-axis and the height of the terminal screen is regarded as the y-axis, the z-order is an axis perpendicular to these two axes.
[0083] By obtaining the arrangement order of the windows in the z-order through the above settings, the problem of windows being covered in the prior art can be solved, and the problem of statistical omissions can be avoided.
[0084] The window handle module 302 is used to obtain the process identifier corresponding to each window and the display area on the terminal screen according to the window handle.
[0085] Specifically, according to an embodiment of the present invention, the window handle module 302 is further used to obtain the coordinate position of the corresponding window on the terminal screen according to the window handle, and obtain the display area of the corresponding window on the terminal screen by performing area calculation on the coordinate position.
[0086] Through the above settings, the window handle corresponding to the corresponding window can be obtained through API (Application Program Interface), and then the display area of the window in the terminal screen and the process ID (PID) corresponding to the window can be obtained through the window handle.
[0087] The software information determination module 303 is used to determine the software information corresponding to the window according to the process identifier, wherein the software information indicates the timestamp information.
[0088] Through the above settings, the software name and timestamp information corresponding to the window displayed on the screen can be obtained, and the usage time can be determined.
[0089] According to an embodiment of the present invention, the above software information also includes information such as the software name, software version, and a digital signature corresponding to the software.
[0090] By obtaining the software name, the existing technology avoids obtaining the system process list. By comparing the content in the process list, the software and time before and after the process change can be obtained, but it is impossible to distinguish which software is in the user-visible area, and the exported statistical data is mixed with a lot of irrelevant data, which affects the accuracy of the statistics. The digital signature can determine whether the software is legal software; the hash value corresponding to the software can also be obtained by calculation, and the comparison of the hash value can determine whether the software file has been tampered with. The above settings can effectively avoid the use of piracy and illegal software.
[0091] The statistics module 304 is used to count the usage time of the corresponding software according to the arrangement order, display area and software information.
[0092] Specifically, according to an embodiment of the present invention, the statistical module 304 is also used to: according to the arrangement order, starting from the window at the top of the z-order, determine all windows whose display area corresponding to the window is greater than or equal to the upper limit of the terminal screen threshold, and the software information corresponding to all the windows.
[0093] Through the above settings, the duration of all software displayed on the screen can be counted, which not only avoids the statistical omission problem caused by window coverage, but also improves the accuracy of software duration statistics. At the same time, according to the statistical results, corresponding software updates can be recommended according to user preferences.
[0094] Further, according to an embodiment of the present invention, the statistics module 304 is also used to: based on the software information, count the usage time of the software corresponding to all windows when the display area corresponding to each window is between the upper threshold and the lower threshold.
[0095] The above setting determines the usage status of the corresponding window by periodically judging the display area of the window. That is, when the window display area is smaller than the lower threshold of the terminal screen (not visible on the screen or closed), the corresponding usage time statistics are stopped, and then the usage time statistics are performed.
[0096] Furthermore, according to a specific implementation of an embodiment of the present invention, the software usage time statistics device 300 also includes an upload module, which is used to accumulate the usage time of software of the same type to obtain the total usage time, and upload the total usage time to the server at regular intervals. According to actual conditions, the user may switch to the window corresponding to other software to perform corresponding business operations during the use of the software. Therefore, for the same software, its use process may not be continuous. Therefore, through the above settings, within a certain period of time, several usage times of the same software are summarized to obtain the total usage time, and uploaded to the server for corresponding records.
[0097] Specifically, the number of the above screens is at least one. According to actual conditions, the display screen of the desktop can be one or more.
[0098] According to an embodiment of the present invention, the software usage time statistics device 300 also includes a loop module, which is used to set a loop period and cyclically execute the following steps: obtaining the arrangement order of the windows corresponding to the software in the z-order; obtaining the process identifier corresponding to each window and the display area on the terminal screen according to the window handle; determining the software information corresponding to the window according to the process identifier; and counting the usage time of the corresponding software according to the arrangement order, display area and software information.
[0099] By setting a cycle, the window arrangement order, display area and software information are obtained at regular intervals, and then the software usage time is counted.
[0100] According to the technical solution of the embodiment of the present invention, the arrangement order of the windows corresponding to the software in the z-order is obtained; the process identifier corresponding to each window and the display area on the terminal screen are obtained according to the window handle; the software information corresponding to the window is determined according to the process identifier, wherein the software information indicates the timestamp information; and the technical means of counting the usage time of the corresponding software according to the arrangement order, display area and software information are used. Therefore, the situation of statistical omissions caused by the inability to solve the problem of window coverage in the prior art and the technical problem of low statistical accuracy are overcome, thereby achieving the technical effect of avoiding the problem of statistical omissions and improving the accuracy of statistical data.
[0101] It can be understood that since the method embodiment and the device embodiment are different presentation forms of the same technical concept, the content of the method embodiment part in this application should be synchronously adapted to the device embodiment part and will not be repeated here.
[0102] Figure 4 An exemplary system architecture 400 is shown to which the software usage time statistics method or software usage time statistics device according to the embodiments of the present invention can be applied.
[0103] like Figure 4As shown, the system architecture 400 may include terminal devices 401, 402, 403, a network 404 and a server 405 (this architecture is only an example, and the components included in the specific architecture may be adjusted according to the specific application). The network 404 is used to provide a medium for a communication link between the terminal devices 401, 402, 403 and the server 405. The network 404 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0104] Users can use terminal devices 401, 402, 403 to interact with server 405 through network 404 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 401, 402, 403, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0105] The terminal devices 401 , 402 , and 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0106] The server 405 may be a server that provides various services, such as a background management server (only for example) that provides support for shopping websites browsed by users using the terminal devices 401, 402, and 403. The background management server may analyze and process the received data such as arrangement order, process identifier, display area, etc., and feed back the processing results (such as software information, usage time - only for example) to the terminal device.
[0107] It should be noted that the statistical method for software usage time provided in the embodiment of the present invention is generally executed by the server 405 , and accordingly, the statistical device for software usage time is generally set in the server 405 .
[0108] It should be understood that Figure 4 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.
[0109] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 of a terminal device suitable for implementing an embodiment of the present invention. Figure 5 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0110] like Figure 5As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0111] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.
[0112] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.
[0113] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0114] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0115] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes an arrangement order acquisition module, a window handle module, and a statistics module. The names of these modules do not constitute a limitation on the modules themselves under certain circumstances. For example, the arrangement order acquisition module may also be described as "a module for acquiring the arrangement order on the window z-order corresponding to the software".
[0116] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: obtaining the arrangement order of the windows corresponding to the software in the z-order; determining the process identifier corresponding to each window and the display area on the terminal screen according to the window handle; determining the software information corresponding to the window according to the process identifier, wherein the software information indicates the timestamp information; and counting the usage time of the corresponding software according to the arrangement order, display area and software information.
[0117] According to the technical solution of the embodiment of the present invention, the arrangement order of the windows corresponding to the software in the z-order is obtained; the process identifier corresponding to each window and the display area on the terminal screen are determined according to the window handle; the software information corresponding to the window is determined according to the process identifier, wherein the software information indicates the timestamp information; and the technical means of counting the usage time of the corresponding software according to the arrangement order, display area and software information are used. Therefore, the situation of statistical omissions caused by the inability to solve the problem of window coverage in the prior art and the technical problem of low statistical accuracy are overcome, thereby achieving the technical effect of avoiding the problem of statistical omissions and improving the accuracy of statistical data.
[0118] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A statistical method for software usage time, characterized in that: include: Get the arrangement order of the corresponding windows of the software in the z order; Get the process ID and display area of each window on the terminal screen according to the window handle; Determining software information corresponding to the window according to the process identifier, wherein the software information indicates timestamp information; The usage time of the corresponding software is counted according to the arrangement order, the display area and the software information; specifically, the method includes: according to the arrangement order, starting from the window at the top of the z-order, determining all windows that make the display area corresponding to the window greater than or equal to the upper limit of the terminal screen threshold, and the software information corresponding to all the windows; according to the software information, counting the usage time of the software corresponding to all the windows when the display area corresponding to each window is between the upper limit and the lower limit of the terminal screen threshold.
2. The method for counting software usage time according to claim 1, characterized in that: The step of obtaining the display area of each window on the terminal screen according to the window handle includes: obtaining the coordinate position of the corresponding window on the terminal screen according to the window handle, and obtaining the display area of the corresponding window on the terminal screen by performing area calculation on the coordinate position.
3. The method for counting software usage time according to claim 1, wherein: The method for counting software usage time also includes: accumulating the usage time of software of the same type to obtain the total usage time.
4. The method for counting software usage time according to claim 1, wherein: The number of the terminal screen is at least one.
5. The method for counting software usage time according to claim 1, wherein: The method for counting the software usage time also includes: setting a loop period and cyclically executing the following steps: obtaining the arrangement order of the windows corresponding to the software in the z-order; obtaining the process identifier corresponding to each window and the display area on the terminal screen according to the window handle; determining the software information corresponding to the window according to the process identifier; and counting the usage time of the corresponding software according to the arrangement order, the display area and the software information.
6. A statistical device for software usage time, characterized in that: include: The arrangement order acquisition module is used to obtain the arrangement order of the windows corresponding to the software in the z order; The window handle module is used to obtain the process ID corresponding to each window and the display area on the terminal screen according to the window handle; a software information determination module, configured to determine software information corresponding to the window according to the process identifier, wherein the software information indicates timestamp information; The statistical module is used to count the usage time of the corresponding software according to the arrangement order, the display area and the software information; specifically, it is used to determine, starting from the window at the top of the z-order according to the arrangement order, all windows whose display areas corresponding to the windows are greater than or equal to the upper limit of the terminal screen threshold, and the software information corresponding to all the windows; according to the software information, count the usage time of the software corresponding to all the windows when the display area corresponding to each window is between the upper limit and the lower limit of the terminal screen threshold.
7. A terminal device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.
8. A computer-readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Method and apparatus for reducing power consumption in display area
CN101004632A
Method for achieving shaking of control induction form
CN101576821A
Program operation time duration statistics method and system
CN105139122A
Inter-process communication authentication method and system as well as inter-application communication method and system
CN105468462A
Human activity information mining method
CN108009134A
