Call duration determination method and device and computer readable storage medium
By taking screenshots of the terminal and determining the call status, calculating the start and ending time of the voice call, the problem of lack of timing methods in instant messaging software is solved, and effective call duration determination is achieved.
Patent Information
- Application Number
- CN202510447236.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-10
- Publication Date
- 2025-07-01
AI Technical Summary
The prior art is difficult to effectively determine the duration of a voice call made through instant messaging software, because instant messaging software usually does not provide a timing SDK interface.
By obtaining screenshots at the terminal, the call status of the target call is determined, and the start and end time of the call is determined based on the call status, thereby calculating the call duration.
The duration determination of voice calls through instant messaging software is realized, and the problem of lack of effective timing methods in the prior art is solved.
Smart Images

Figure CN120238529A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technologies, and in particular, to a method and apparatus for determining call duration, and a computer-readable storage medium. Background Art
[0002] With the development of the times, people generally make voice calls through the built-in voice call function of instant messaging software (such as WeChat, WeCom, DingTalk, etc.).
[0003] In some cases, it is necessary to determine the call duration of a voice call made through instant messaging software. Generally, since the instant messaging software does not externally provide an SDK interface for timing voice calls, how to determine the call duration of a voice call made through instant messaging software has become an urgent problem to be solved. Summary of the Invention
[0004] This application provides a method and apparatus for determining call duration, and a computer-readable storage medium, which can determine the call duration of a voice call made through instant messaging software.
[0005] To achieve the above object, this application adopts the following technical solutions:
[0006] In a first aspect, a method for determining call duration is provided. The method includes: at a first sampling moment, obtaining a screen shot of a terminal; determining, according to the screen shot of the terminal at the first sampling moment, a call state of a target call in the terminal at the first sampling moment; the target call is a call made through a target instant messaging software in the terminal, and the call state includes in-call or not in-call; in a case where the call state of the target call at a second sampling moment is not in-call, if the call state of the target call at the first sampling moment is in-call, determining the first sampling moment as the start moment of the target call; the second sampling moment is the previous sampling moment of the first sampling moment; determining a third sampling moment, and determining the duration between the first sampling moment and the third sampling moment as the call duration of the target call; the call state of the target call at the third sampling moment is not in-call, the third sampling moment is after the first sampling moment, and the call state of the target call at a fourth sampling moment is in-call, and the fourth sampling moment is any sampling moment between the third sampling moment and the first sampling moment.
[0007] Based on this solution, at the first sampling moment, a screen shot of the terminal is obtained. Subsequently, according to the screen shot of the terminal at the first sampling moment, the call state of the target call in the terminal at the first sampling moment is determined. Subsequently, when the call state of the target call at the second sampling moment, i.e., the previous sampling moment of the first sampling moment, is not in a call, if the call state of the target call at the first sampling moment is in a call, the first sampling moment is determined as the start moment of the target call. Subsequently, a third sampling moment is determined, and the duration between the first sampling moment and the third sampling moment is determined as the call duration of the target call; since the target call is a call made through the target instant messaging software in the terminal, the call state of the target call at the third sampling moment is not in a call, the third sampling moment is after the first sampling moment, and the call state of the target call at the fourth sampling moment is in a call, and the fourth sampling moment is any sampling moment between the third sampling moment and the first sampling moment, therefore, the start and end moments of the target call can be determined through the screen shot of the terminal, and further the call duration of the target call can be determined.
[0008] In combination with the first aspect, in some embodiments of the first aspect, determining the call state of the target call at the first sampling moment according to the screen shot of the terminal at the first sampling moment includes: intercepting an image at a first preset position in the screen shot of the terminal at the first sampling moment to obtain a first sub-screen shot; determining the similarity between the first sub-screen shot and a first preset image; the first preset image is an image at the first preset position on the screen of the terminal when the call interface of the target call is not minimized; when the similarity is greater than or equal to a first preset similarity threshold, determining that the call state of the target call at the first sampling moment is in a call.
[0009] In combination with the first aspect, in some embodiments of the first aspect, when the similarity is less than the first preset similarity threshold, the method further includes: determining whether a target image exists in the screen shot of the terminal at the first sampling moment; the similarity between the target image and a second preset image is greater than or equal to a second preset similarity threshold, and the second preset image is an image indicating that the call state of the target call is in a call on the screen of the terminal after the call interface of the target call is minimized; when the target image exists in the screen shot, determining that the call state of the target call at the first sampling moment is in a call.
[0010] In combination with the first aspect, in some embodiments of the first aspect, the method further includes: when the target image does not exist in the screen shot, determining that the call state of the target call at the first sampling moment is not in a call.
[0011] In combination with the first aspect, in certain embodiments of the first aspect, the method also includes: capturing an image of a second preset position in a target screenshot among multiple screenshots to obtain a second sub-screenshot; the multiple screenshots include a screenshot of the terminal at a first sampling moment, a screenshot of the terminal at a third sampling moment, and a screenshot of the terminal at a fourth sampling moment, the target screenshot being a screenshot of the target call in the multiple screenshots when the call interface is not reduced, the second preset position being the position where the identifier of the call object is located in the screen of the terminal when the call interface of the target call is not reduced; and using the second sub-screenshot as the image identifier of the call object.
[0012] In combination with the first aspect, in certain embodiments of the first aspect, the method also includes: capturing an image at a third preset position in the target screenshot to obtain a third sub-screenshot; the third preset position is adjacent to the second preset position, and the third preset position is located below the second preset position; performing OCR processing on the third sub-screenshot to obtain a target text; and using the target text as a text identifier of the call object.
[0013] In a second aspect, a device for determining call duration is provided for implementing the method for determining call duration in the first aspect. The device for determining call duration includes a module, unit, or means corresponding to the method, which can be implemented by hardware, software, or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above functions.
[0014] In combination with the second aspect, in certain embodiments of the second aspect, the device includes: an acquisition module and a processing module; the acquisition module is used to acquire a screenshot of the terminal at a first sampling moment; the processing module is used to determine the call status of the target call in the terminal at the first sampling moment based on the screenshot of the terminal at the first sampling moment; the target call is a call conducted through the target instant messaging software in the terminal, and the call status includes being in a call or not being called; the processing module is also used to, when the call status of the target call at the second sampling moment is not being called, if the call status of the target call at the first sampling moment is being called, determine the first sampling moment as the start time of the target call; the second sampling moment is the previous sampling moment of the first sampling moment; the processing module is also used to determine the third sampling moment, and determine the duration between the first sampling moment and the third sampling moment as the call duration of the target call; the call status of the target call at the third sampling moment is not being called, and the third sampling moment is after the first sampling moment, and the call status of the target call at the fourth sampling moment is being called, and the fourth sampling moment is any sampling moment between the third sampling moment and the first sampling moment.
[0015] In combination with the second aspect, in some embodiments of the second aspect, the processing module is configured to determine the call status of the target call at the first sampling moment according to the screen capture of the terminal at the first sampling moment, including: intercepting an image at a first preset position in the screen capture of the terminal at the first sampling moment to obtain a first sub-screen capture; determining the similarity between the first sub-screen capture and a first preset image; the first preset image is an image at the first preset position in the screen of the terminal when the call interface of the target call is not minimized; in the case where the similarity is greater than or equal to a first preset similarity threshold, determining that the call status of the target call at the first sampling moment is in a call.
[0016] In combination with the second aspect, in some embodiments of the second aspect, in the case where the similarity is less than the first preset similarity threshold, the processing module is further configured to: determine whether a target image exists in the screen capture of the terminal at the first sampling moment; the similarity between the target image and a second preset image is greater than or equal to a second preset similarity threshold, and the second preset image is an image indicating that the call status of the target call is in a call in the screen of the terminal after the call interface of the target call is minimized; in the case where the target image exists in the screen capture, determining that the call status of the target call at the first sampling moment is in a call.
[0017] In combination with the second aspect, in some embodiments of the second aspect, the processing module is further configured to: in the case where the target image does not exist in the screen capture, determine that the call status of the target call at the first sampling moment is not in a call.
[0018] In combination with the second aspect, in some embodiments of the second aspect, the processing module is further configured to: intercept an image at a second preset position in the target screen capture among multiple screen captures to obtain a second sub-screen capture; the multiple screen captures include the screen capture of the terminal at the first sampling moment, the screen capture of the terminal at the third sampling moment, and the screen capture of the terminal at the fourth sampling moment, the target screen capture is the screen capture when the call interface of the target call among the multiple screen captures is not minimized, and the second preset position is the position where the identifier of the call object is located in the screen of the terminal when the call interface of the target call is not minimized; using the second sub-screen capture as the image identifier of the call object.
[0019] In combination with the second aspect, in some embodiments of the second aspect, the processing module is further configured to: intercept an image at a third preset position in the target screen capture to obtain a third sub-screen capture; the third preset position is adjacent to the second preset position, and the third preset position is below the second preset position; perform OCR processing on the third sub-screen capture to obtain target text; using the target text as the text identifier of the call object.
[0020] In a third aspect, a call duration determination device is provided, including: at least one processor and a memory for storing instructions executable by the processor; wherein, the processor is configured to execute the instructions to implement the method provided in the first aspect and any possible implementation manner thereof.
[0021] In a fourth aspect, a computer-readable storage medium is provided. When the instructions in the computer-readable storage medium are executed by the processor of the call duration determination device, the call duration determination device is enabled to execute the method provided in the first aspect and any possible implementation manner thereof.
[0022] In a fifth aspect, a computer program product containing instructions is provided. When it runs on a computer, the computer can execute the method provided in the above-mentioned first aspect and any possible implementation manner thereof.
[0023] Among them, for the technical effects brought by any implementation manner in the second aspect to the fifth aspect, reference can be made to the technical effects brought by different implementation manners in the first aspect above, which will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 It is a schematic diagram of the architecture of a call duration determination system provided by this application;
[0025] Figure 2 It is a schematic flowchart of a call duration determination method provided by this application;
[0026] Figure 3 It is a schematic diagram of a screenshot provided by this application;
[0027] Figure 4 It is a schematic flowchart of another call duration determination method provided by this application;
[0028] Figure 5 It is a schematic diagram of a first preset image provided by this application;
[0029] Figure 6 It is a schematic diagram of another first preset image provided by this application;
[0030] Figure 7 It is a schematic diagram of another first preset image provided by this application;
[0031] Figure 8 It is a schematic diagram of another first preset image provided by this application;
[0032] Figure 9 It is a schematic diagram of another first preset image provided by this application;
[0033] Figure 10Schematic diagram of a second preset image provided by this application;
[0034] Figure 11 Flow schematic diagram of another call duration determination method provided by this application;
[0035] Figure 12 Schematic diagram of a second sub - screen capture provided by this application;
[0036] Figure 13 Flow schematic diagram of another call duration determination method provided by this application;
[0037] Figure 14 Structural schematic diagram of a call duration determination device provided by this application;
[0038] Figure 15 Structural schematic diagram of another call duration determination device provided by this application. Detailed implementation manners
[0039] In the description of this application, unless otherwise specified, "a plurality" means two or more than two. "At least one (item)" or its similar expression refers to any combination of these items, including any combination of a single item or multiple items. For example, at least one (item) of a, b, or c can represent: a, b, c, a - b, a - c, b - c, or a - b - c, where a, b, c can be single or multiple.
[0040] In addition, for the convenience of clearly describing the technical solutions of the embodiments of this application, in the embodiments of this application, terms such as "first" and "second" are used to distinguish identical or similar items with basically the same functions and roles. Those skilled in the art can understand that terms such as "first" and "second" do not limit the quantity and execution order, and "first" and "second" do not necessarily mean different.
[0041] At the same time, in the embodiments of this application, words such as "exemplary" or "for example" are used to represent examples, illustrations, or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Exactly speaking, using words such as "exemplary" or "for example" aims to present relevant concepts in a specific way for easy understanding.
[0042] It is understood that the "embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, the various embodiments in the entire specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It is understood that in various embodiments of the present application, the size of the sequence number of each process does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.
[0043] It can be understood that in the present application, "when", "if" and "if" all mean that corresponding processing will be carried out under certain objective circumstances, but do not limit the time, nor do they require judgment actions when implementing them, nor do they mean the existence of other limitations.
[0044] It can be understood that some optional features in the embodiments of the present application may be implemented independently in certain scenarios without relying on other features, such as the solution on which they are currently based, to solve corresponding technical problems and achieve corresponding effects, or may be combined with other features according to needs in certain scenarios. Accordingly, the devices provided in the embodiments of the present application may also realize these features or functions accordingly, which will not be elaborated here.
[0045] In this application, unless otherwise specified, the same or similar parts between the various embodiments can refer to each other. In the various embodiments in this application, and the various implementation methods in each embodiment, if there is no special description and logical conflict, the terms and / or descriptions between different embodiments and the various implementation methods in each embodiment are consistent and can be referenced to each other. The technical features in different embodiments and the various implementation methods in each embodiment can be combined to form new embodiments, implementation methods, implementation methods, or implementation methods according to their inherent logical relationships. The following implementation methods of this application do not constitute a limitation on the scope of protection of this application.
[0046] With the development of the times, people generally make voice calls through the built-in voice call function of instant messaging software (for example, WeChat, Enterprise WeChat, DingTalk, etc.).
[0047] In some cases, it is necessary to determine the duration of a voice call made through an instant messaging software. Usually, because the instant messaging software does not provide an SDK interface for timing voice calls, the current market practice is to use Hook technology or crack the database of the instant messaging software and then read the data in the database. This practice is obviously illegal. Therefore, how to determine the duration of a voice call made through an instant messaging software has become an urgent problem to be solved.
[0048] Figure 1 The architecture schematic diagram of a call duration determination system provided for this application. The technical solution of the embodiments of this application can be applied to Figure 1 the call duration determination system shown, as Figure 1 shown, the call duration determination system 10 includes a call duration determination device 11 and an electronic device 12.
[0049] Among them, the call duration determination device 11 is directly or indirectly connected to the electronic device 12. In this connection relationship, a wired connection can be used, or a wireless connection can be used. The embodiments of this application do not make any limitations in this regard.
[0050] Data interaction can be carried out between the call duration determination device 11 and the electronic device 12.
[0051] It should be noted that the call duration determination device 11 and the electronic device 12 can be independent devices, or can be integrated into the same device. This application does not make specific limitations in this regard.
[0052] When the call duration determination device 11 and the electronic device 12 are integrated into the same device, the device can be a terminal, for example, a mobile phone, a tablet computer, etc. The communication method between the call duration determination device 11 and the electronic device 12 is the communication between internal modules of the device. In this case, the communication process between the two is the same as "the communication process between the call duration determination device 11 and the electronic device 12 when they are independent of each other".
[0053] In the following embodiments provided by this application, this application takes the call duration determination device 11 and the electronic device 12 being independently set as an example for description.
[0054] In practical applications, the call duration determination method provided by the embodiments of this application can be applied to the call duration determination device 11, or can be applied to the devices included in the call duration determination device 11.
[0055] Next, in combination with the accompanying drawings, taking the call duration determination method being applied to the call duration determination device 11 as an example, the call duration determination method provided by the embodiments of this application will be described.
[0056] Figure 2 The flowchart of a call duration determination method provided for this application, as Figure 2 shown, this method includes the following steps:
[0057] S201. At the first sampling moment, the call duration determination device obtains a screenshot of the terminal.
[0058] It should be noted that the terminal can be a device such as a mobile phone or a computer. This application does not make specific limitations in this regard.
[0059] Figure 3 A schematic diagram of a screen capture provided for this application, as Figure 3 shown, this screen capture is a screen capture of a mobile phone, and the target instant messaging software in the screen capture during a voice call is WeChat.
[0060] As a possible implementation, after the terminal is powered on, the call duration determination device starts a timer, and the timer is triggered at regular time intervals. When the timer is triggered, the call duration determination device captures a screen shot of the terminal's screen to obtain a screen shot of the terminal.
[0061] The time interval can be 1 second, 2 seconds, or 3 seconds, and this application does not specifically limit the duration of the time interval.
[0062] S202. The call duration determination device determines the call status of the target call in the terminal at the first sampling moment according to the screen shot of the terminal at the first sampling moment.
[0063] Among them, the target call is a call made through the target instant messaging software in the terminal, and the call status includes in call or not in call.
[0064] It should be noted that when the call status of the target call is in call, it means that the user is making a voice call through the target instant messaging software; when the call status of the target call is not in call, it means that the user is not making a voice call through the target instant messaging software.
[0065] As a possible implementation, the call duration determination device intercepts the image at the first preset position in the screen shot of the terminal at the first sampling moment to obtain a first sub-screen shot; determines the similarity between the first sub-screen shot and the first preset image; the first preset image is the image at the first preset position in the terminal's screen when the call interface of the target call is not minimized; when the similarity is greater than or equal to the first preset similarity threshold, it is determined that the call status of the target call at the first sampling moment is in call.
[0066] When the similarity is less than the first preset similarity threshold, the call duration determination device determines whether there is a target image in the screen shot of the terminal at the first sampling moment; the similarity between the target image and the second preset image is greater than or equal to the second preset similarity threshold, and the second preset image is the image indicating that the call status of the target call is in call in the terminal's screen after the call interface of the target call is minimized.
[0067] When there is a target image in the screen shot, it is determined that the call status of the target call at the first sampling moment is in call. When there is no target image in the screen shot, it is determined that the call status of the target call at the first sampling moment is not in call.
[0068] It should be noted that for the specific description of this possible implementation manner, reference can be made to the relevant descriptions in the subsequent parts of the specific implementation manners of this application, which will not be elaborated herein.
[0069] S203. When the call state of the target call at the second sampling moment is not in a call, if the call state of the target call at the first sampling moment is in a call, the first sampling moment is determined as the start moment of the target call.
[0070] Wherein, the second sampling moment is the previous sampling moment of the first sampling moment.
[0071] As a possible implementation manner, the call duration determination device determines whether the call state of the target call at the previous sampling moment of the first sampling moment, that is, the second sampling moment, is not in a call. If the call state of the target call at the second sampling moment is not in a call, the call duration determination device determines whether the call state of the target call at the first sampling moment is in a call. If the call state of the target call at the first sampling moment is in a call, it indicates that the user starts a voice call through the target instant messaging software at the first sampling moment, and the first sampling moment is determined as the start moment of the target call.
[0072] In some cases, if there is no second sampling moment, that is, the first sampling moment is the first sampling moment, if the call duration determination device determines that the call state of the target call at the first sampling moment is in a call, the first sampling moment is determined as the start moment of the target call.
[0073] S204. The call duration determination device determines a third sampling moment, and determines the duration between the first sampling moment and the third sampling moment as the call duration of the target call.
[0074] Wherein, the call state of the target call at the third sampling moment is not in a call, the third sampling moment is after the first sampling moment, the call state of the target call at the fourth sampling moment is in a call, and the fourth sampling moment is any sampling moment between the third sampling moment and the first sampling moment.
[0075] As a possible implementation manner, after the first sampling moment, at regular time intervals, the call duration determination device acquires a screen shot of the terminal, and determines the call state of the target call in the terminal at this sampling moment according to the screen shot of the terminal at this sampling moment.
[0076] The call duration determination device determines whether the call status of the target call at the previous sampling moment of the current sampling moment is in a call. If the call status of the target call at the previous sampling moment is in a call, the call duration determination device determines whether the call status of the target call at the current sampling moment is in a call. If the call status of the target call at the current sampling moment is in a call, it indicates that the user is making a voice call through the target instant messaging software at the current sampling moment, and this sampling moment is the fourth sampling moment.
[0077] If the call status of the target call at the current sampling moment is not in a call, it indicates that the user has stopped making a voice call through the target instant messaging software at the current sampling moment. The call duration determination device determines this sampling moment as the third sampling moment, and determines the duration between the first sampling moment and the third sampling moment as the call duration of the target call.
[0078] It should be noted that the specific description of how the call duration determination device determines the call status of the target call in the terminal at each sampling moment can refer to the description of S202, which will not be elaborated herein.
[0079] Based on this solution, at the first sampling moment, a screen shot of the terminal is obtained. Then, according to the screen shot of the terminal at the first sampling moment, the call status of the target call in the terminal at the first sampling moment is determined. Then, in the case where the call status of the target call at the previous sampling moment of the first sampling moment, that is, the second sampling moment, is not in a call, if the call status of the target call at the first sampling moment is in a call, the first sampling moment is determined as the start moment of the target call. Then, the third sampling moment is determined, and the duration between the first sampling moment and the third sampling moment is determined as the call duration of the target call. Since the target call is a call made through the target instant messaging software in the terminal, the call status of the target call at the third sampling moment is not in a call, the third sampling moment is after the first sampling moment, and the call status of the target call at the fourth sampling moment is in a call, and the fourth sampling moment is any sampling moment between the third sampling moment and the first sampling moment. Therefore, the start and end moments of the target call can be determined through the screen shot of the terminal, and then the call duration of the target call can be determined.
[0080] The above is a general description of the call duration determination method provided by this application. Next, the call duration determination method provided by this application will be further described with reference to the accompanying drawings.
[0081] In one design, Figure 4 is a schematic flowchart of another call duration determination method provided by this application. As Figure 4 shown, S202 provided by the specific implementation manner of this application may specifically include the following multiple steps:
[0082] S401. The call duration determination device intercepts the image at the first preset position in the screen capture of the terminal at the first sampling moment to obtain a first sub-screen capture.
[0083] It should be noted that taking the screen resolution of the terminal as 350*700 and the target instant messaging software as WeChat as an example, the first preset position can be an area in the screen capture that starts from the bottom of the status bar in the screen capture, with a width equal to the width of the screen capture and a height of 50 pixels; or, the first preset position can also be an area in the screen capture that starts from the top of the navigation bar in the screen capture, with a width equal to the width of the screen capture and a height of 126 pixels.
[0084] As a possible implementation, taking the screen resolution of the terminal as 350*700 and the target instant messaging software as WeChat as an example, the call duration determination device removes the status bar of the screen capture, and then starts from the pixel coordinates (0,0), with a width equal to the width of the screen capture and a height of 50 pixels, and intercepts the image of the screen capture, and this image is the first sub-screen capture.
[0085] As another possible implementation, taking the screen resolution of the terminal as 350*700 and the target instant messaging software as WeChat as an example, the call duration determination device removes the navigation bar of the screen capture, and then starts from the bottom, with a width equal to the width of the screen capture and a height of 126 pixels, and intercepts the image of the screen capture, and this image is the first sub-screen capture.
[0086] S402. The call duration determination device determines the similarity between the first sub-screen capture and the first preset image.
[0087] Among them, the first preset image is the image at the first preset position in the screen of the terminal when the call interface of the target call is not minimized.
[0088] Combined with Figure 3 , taking the screen resolution of the terminal as 350*700, the target instant messaging software as WeChat, and the first preset position as an area in the screen capture that starts from the bottom of the status bar in the screen capture, with a width equal to the width of the screen capture and a height of 50 pixels as an example, Figure 5 This is a schematic diagram of a first preset image provided by this application. As Figure 5 shown, Figure 5 the image shown is the image at the first preset position in the screen of the terminal when the call interface of the voice call of WeChat is not minimized.
[0089] Combined with Figure 3, taking the resolution of the terminal screen as 350*700, the target instant messaging software as WeChat, and the first preset position as an example of the area in the screen capture starting from the top of the navigation bar in the screen capture, with a width equal to the width of the screen capture and a height of 126 pixels. Figure 6 This is another schematic diagram of the first preset image provided by this application. As Figure 6 shown, Figure 6 The image shown is the image of the first preset position on the terminal screen when the call interface of the voice call on WeChat is not minimized.
[0090] Combined with Figure 3 , taking the resolution of the terminal screen as 350*700, the target instant messaging software as WeChat, and the first preset position as an example of the area in the screen capture starting from the top of the navigation bar in the screen capture, with a width equal to the width of the screen capture and a height of 126 pixels. Figure 7 This is another schematic diagram of the first preset image provided by this application. As Figure 7 shown, Figure 7 The image shown is the image of the first preset position on the terminal screen when the call interface of the voice call on WeChat is not minimized.
[0091] Combined with Figure 3 , taking the resolution of the terminal screen as 350*700, the target instant messaging software as WeChat, and the first preset position as an example of the area in the screen capture starting from the top of the navigation bar in the screen capture, with a width equal to the width of the screen capture and a height of 126 pixels. Figure 8 This is another schematic diagram of the first preset image provided by this application. As Figure 8 shown, Figure 8 The image shown is the image of the first preset position on the terminal screen when the call interface of the voice call on WeChat is not minimized.
[0092] Combined with Figure 3 , taking the resolution of the terminal screen as 350*700, the target instant messaging software as WeChat, and the first preset position as an example of the area in the screen capture starting from the top of the navigation bar in the screen capture, with a width equal to the width of the screen capture and a height of 126 pixels. Figure 9 This is another schematic diagram of the first preset image provided by this application. As Figure 9 shown, Figure 9 The image shown is the image of the first preset position on the terminal screen when the call interface of the voice call on WeChat is not minimized.
[0093] As a possible implementation, the call duration determination device compares the first sub-screen capture with the first preset image to obtain the similarity between the first sub-screen capture and the first preset image.
[0094] It should be noted that the specific solution for comparing the first sub - screen capture with the first preset image can refer to existing solutions, and this application will not elaborate on it here.
[0095] S403. The call duration determination device determines whether the similarity is greater than or equal to the first preset similarity threshold.
[0096] It should be noted that the first preset similarity threshold can be 90%, 80% or 85%, and this application does not make specific restrictions on it.
[0097] If so, the call duration determination device executes S404.
[0098] If not, the call duration determination device executes S405.
[0099] S404. When the similarity is greater than or equal to the first preset similarity threshold, the call duration determination device determines that the call state of the target call at the first sampling moment is in - call.
[0100] Since the first preset image is the image at the first preset position on the screen of the terminal when the call interface of the target call is not shrunk, when the similarity between the first sub - screen capture and the first preset image is greater than or equal to the first preset similarity threshold, it can be determined that the call state of the target call at the first sampling moment is in - call.
[0101] S405. The call duration determination device determines whether there is a target image in the screen capture of the terminal at the first sampling moment.
[0102] Among them, the similarity between the target image and the second preset image is greater than or equal to the second preset similarity threshold, and the second preset image is the image indicating that the call state of the target call is in - call on the screen of the terminal after the call interface of the target call is shrunk.
[0103] It should be noted that the second preset similarity threshold can be 90%, 80% or 85%, and this application does not make specific restrictions on it.
[0104] Taking the target instant messaging software as WeChat as an example, Figure 10 This is a schematic diagram of a second preset image provided by this application. As Figure 10 shown, after the call interface of the target call in WeChat is shrunk, the following second preset image is displayed on the screen of the terminal. Figure 10 shown in the figure.
[0105] As a possible implementation, the call duration determination device determines whether there is an image in the screenshot whose similarity to the second preset image is greater than or equal to the second similarity threshold. If it is determined that there is an image in the screenshot whose similarity to the second preset image is greater than or equal to the second similarity threshold, it is determined that there is a target image in the screenshot of the terminal at the first sampling moment, and S406 is executed; if it is determined that there is no image in the screenshot whose similarity to the second preset image is greater than or equal to the second similarity threshold, it is determined that there is no target image in the screenshot of the terminal at the first sampling moment, and S407 is executed.
[0106] It should be noted that the specific solution for determining that there is an image in the screenshot whose similarity to the second preset image is greater than or equal to the second similarity threshold can refer to the existing solutions, and will not be described herein in this application.
[0107] S406. When there is a target image in the screenshot, the call duration determination device determines that the call state of the target call at the first sampling moment is in a call.
[0108] S407. When there is no target image in the screenshot, the call duration determination device determines that the call state of the target call at the first sampling moment is not in a call.
[0109] Based on S401 - S407, by matching the screenshot with an image that can indicate a voice call in progress in the target instant messaging software, it is possible to determine whether a voice call is in progress in the target instant messaging software, and thus determine the call state of the target call.
[0110] In one design, Figure 11 is a flowchart of another call duration determination method provided by this application. As Figure 11 shown, the call duration determination method provided by this application may further include the following multiple steps:
[0111] S1101. The call duration determination device intercepts an image at a second preset position in the target screenshot among multiple screenshots to obtain a second sub - screenshot.
[0112] Among them, the multiple screenshots include the screenshot of the terminal at the first sampling moment, the screenshot of the terminal at the third sampling moment, and the screenshot of the terminal at the fourth sampling moment. The target screenshot is the screenshot when the call interface of the target call in the multiple screenshots is not minimized. The second preset position is the position where the identifier of the call object is located on the screen of the terminal when the call interface of the target call is not minimized.
[0113] It should be noted that in combination with Figure 3, taking the resolution of the terminal screen as 350*700 and the target instant messaging software as WeChat as an example, the second preset position can be the area formed by the pixel coordinates (130, 181), pixel coordinates (215, 181), pixel coordinates (130, 266), and pixel coordinates (215, 266) in the screen capture.
[0114] It should be noted that when the resolution of the terminal screen becomes larger, the coordinates or the number of pixels of each pixel provided in the specific implementation manner of the present application also become larger accordingly; when the resolution of the terminal screen becomes smaller, the coordinates or the number of pixels of each pixel provided in the specific implementation manner of the present application also become smaller accordingly.
[0115] Figure 12 This is a schematic diagram of a second sub-screen capture provided by the present application. As Figure 12 shown, Figure 12 the image shown is the image of the second preset position on the terminal screen when the call interface of the voice call on WeChat is not reduced.
[0116] As a possible implementation manner, the call duration determination device starts from the pixel coordinates (130, 181) in the target screen capture, and intercepts a region with a width of 85 pixels and a height of 85 pixels downward to obtain a second sub-screen capture.
[0117] S1102. The call duration determination device uses the second sub-screen capture as the image identifier of the call object.
[0118] In this way, the image identifier of the call object, that is, the avatar of the call object, can be determined.
[0119] In one design, Figure 13 This is a schematic flowchart of another call duration determination method provided by the present application. As Figure 13 shown, the call duration determination method provided by the present application may further include the following multiple steps:
[0120] S1301. The call duration determination device intercepts the image at the third preset position in the target screen capture to obtain a third sub-screen capture.
[0121] Among them, the third preset position is adjacent to the second preset position, and the third preset position is located below the second preset position.
[0122] It should be noted that in combination with Figure 3 , taking the resolution of the terminal screen as 350*700 and the target instant messaging software as WeChat as an example, the third preset position can be the area in the screen capture with a height of 50 pixels below the second preset position and a width equal to the width of the screen capture. Of course, the third preset position can also have other heights, and the present application does not make specific limitations on this.
[0123] As a possible implementation, the height is 50 pixels below the second preset position. The call duration determination device starts from the pixel coordinates (130, 181), and intercepts a region with a width equal to the width of the screenshot and a height of 50 pixels downward to obtain a third sub-screenshot.
[0124] S1302. The call duration determination device performs OCR processing on the third sub-screenshot to obtain the target text.
[0125] As a possible implementation, the call duration determination device performs OCR processing on the third sub-screenshot through an OCR tool to obtain the target text.
[0126] S1303. The call duration determination device uses the target text as the text identifier of the call object.
[0127] In this way, the text identifier of the call object, that is, the nickname of the call object, can be determined.
[0128] The above mainly introduces the solution provided by the embodiments of the present application from the perspective of the call duration determination device executing the call duration determination method. To implement the above functions, the call duration determination device includes the corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should easily realize that, combining the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0129] The embodiments of the present application can divide the call duration determination device into functional modules according to the above method examples. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. Optionally, the division of modules in the embodiments of the present application is illustrative, only a logical function division, and there may be other division methods in actual implementation. In addition, the "module" here can refer to a specific application-specific integrated circuit (ASIC), a circuit, a processor and a memory executing one or more software or firmware programs, an integrated logic circuit, and / or other devices that can provide the above functions.
[0130] In the case of adopting functional module division,Figure 14 The structural schematic diagram of a call duration determination device is shown. As Figure 14 shown, the call duration determination device 140 includes an acquisition module 1401 and a processing module 1402.
[0131] In some embodiments, the call duration determination device 140 may further include a storage module ( Figure 14 not shown in the figure), which is used to store program instructions and data.
[0132] In the case of implementing the functions of the above functional modules in the form of hardware, Figure 15 the structural schematic diagram of another call duration determination device is shown. As Figure 15 shown, the call duration determination device 150 includes a processor 1501, a memory 1502, and a bus 1503. The processor 1501 and the memory 1502 can be connected through the bus 1503.
[0133] The processor 1501 is the control center of the call duration determination device 150, which can be a single processor or a collective term for multiple processing elements. For example, the processor 1501 can be a general-purpose central processing unit (CPU), or other general-purpose processors. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0134] As an embodiment, the processor 1501 may include one or more CPUs, such as Figure 15 the CPU0 and CPU1 shown in the figure.
[0135] The memory 1502 can be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a magnetic disk storage medium, or other magnetic storage devices, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.
[0136] As a possible implementation, the memory 1502 can exist independently of the processor 1501. The memory 1502 can be connected to the processor 1501 through a bus 1503 and is used to store instructions or program codes. When the processor 1501 calls and executes the instructions or program codes stored in the memory 1502, the call duration determination method provided by the embodiments of the present application can be implemented.
[0137] In another possible implementation, the memory 1502 can also be integrated with the processor 1501.
[0138] The bus 1503 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 15 only a thick line is used to represent it in the figure, but it does not mean that there is only one bus or one type of bus.
[0139] It should be noted that Figure 15 the structure shown does not constitute a limitation on the call duration determination device 150. Except Figure 15 for the components shown, the call duration determination device 150 can include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0140] As an example, in combination with Figure 14 , the functions implemented by the acquisition module 1401 and the processing module 1402 in the call duration determination device 140 are the same as those of Figure 15 the processor 1501 in
[0141] Optionally, as Figure 15 shown, the call duration determination device 150 provided by the embodiments of the present application can further include a communication interface 1504.
[0142] The communication interface 1504 is used to connect to other devices through a communication network. The communication network can be an Ethernet, a wireless access network, a wireless local area networks (WLAN), etc. The communication interface 1504 can include a receiving unit for receiving data and a sending unit for sending data.
[0143] In a possible implementation, in the call duration determination device 150 provided by the embodiments of the present application, the communication interface 1504 may also be integrated in the processor 1501. The embodiments of the present application do not make specific limitations thereto.
[0144] As a possible product form, the call duration determination device of the embodiments of the present application may also be implemented using the following: one or more field programmable gate arrays (FPGAs), programmable logic devices (PLDs), controllers, state machines, gate logic, discrete hardware components, any other suitable circuits, or any combination of circuits capable of performing the various functions described throughout the present application.
[0145] Through the description of the above embodiments, those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional units is used as an example for illustration. In actual applications, the above functions may be allocated to different functional units as needed, that is, the internal structure of the device is divided into different functional units to complete all or part of the functions described above. The specific working processes of the systems, devices, and units described above may refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0146] The embodiments of the present application also provide a computer-readable storage medium, on which a computer program or instruction is stored. When the computer program or instruction is executed, the computer performs each step in the method flow shown in the foregoing method embodiments.
[0147] The embodiments of the present application provide a computer program product containing instructions. When the instructions run on a computer, the computer performs each step in the method flow shown in the foregoing method embodiments.
[0148] The embodiments of the present application provide a chip system, including: a processor and an interface circuit; the interface circuit is used to receive a computer program or instruction and transmit it to the processor; the processor is used to execute the computer program or instruction so that the chip system performs each step in the method flow shown in the foregoing method embodiments.
[0149] Among them, a computer-readable storage medium can be, for example, but not limited to, a system, device, or component of electricity, magnetism, light, electromagnetic, infrared ray, or semiconductor, or any combination of the above. More specific examples (a non-exhaustive list) of the computer-readable storage medium include: 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), a register, a hard disk, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above, or any other form of computer-readable storage medium known in the art. An exemplary storage medium is coupled to the processor, so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in a specific application ASIC. In the embodiments of the present application, the computer-readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or combined with an instruction execution system, device, or component.
[0150] Since the call duration determination device, computer-readable storage medium, and computer program product provided in this embodiment can be applied to the call duration determination method provided in the above, therefore, the technical effects that can be obtained can also refer to the method embodiments above, and the embodiments of the present application will not be described in detail here.
[0151] Although the present application has been described in combination with various embodiments herein, however, in the process of implementing the claimed present application, those skilled in the art can understand and implement other changes of the disclosed embodiments by viewing the drawings, the disclosed content, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "one" does not exclude a plurality of situations. A single processor or other unit can implement several functions listed in the claims. Certain measures are recited in mutually different dependent claims, but this does not mean that these measures cannot be combined to produce good results.
[0152] Although the present application has been described in connection with specific features and their embodiments, it will be apparent that various modifications and combinations can be made without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely exemplary illustrations of the present application as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these changes and modifications.
Claims
1. A method for determining call duration, characterized in that: The method comprises: At the first sampling moment, obtaining a screenshot of the terminal; Determine, according to the screenshot of the terminal at the first sampling time, the call state of the target call in the terminal at the first sampling time; the target call is a call conducted through the target instant messaging software in the terminal, and the call state includes being in call or not in call; In the case where the call status of the target call at the second sampling time is not in call, if the call status of the target call at the first sampling time is in call, the first sampling time is determined as the start time of the target call; the second sampling time is the previous sampling time of the first sampling time; Determine a third sampling moment, and determine the duration between the first sampling moment and the third sampling moment as the call duration of the target call; the call status of the target call at the third sampling moment is not in call, the third sampling moment is after the first sampling moment, the call status of the target call at the fourth sampling moment is in call, and the fourth sampling moment is any sampling moment between the third sampling moment and the first sampling moment.
2. The method according to claim 1, characterized in that Determining the call state of the target call at the first sampling time according to the screenshot of the terminal at the first sampling time includes: Intercepting an image at a first preset position in the screenshot of the terminal at the first sampling moment to obtain a first sub-screenshot; Determine the similarity between the first sub-screenshot and a first preset image; the first preset image is an image of the first preset position on the screen of the terminal when the call interface of the target call is not reduced; When the similarity is greater than or equal to a first preset similarity threshold, it is determined that the call state of the target call at the first sampling time is an ongoing call.
3. The method according to claim 2, characterized in that When the similarity is less than a first preset similarity threshold, the method further includes: Determine whether a target image exists in the screenshot of the terminal at the first sampling time; the similarity between the target image and a second preset image is greater than or equal to a second preset similarity threshold, and the second preset image is an image indicating that the call status of the target call is in call on the screen of the terminal after the call interface of the target call is reduced; In a case where a target image exists in the screenshot, it is determined that the call status of the target call at the first sampling moment is in-call.
4. The method according to claim 3, characterized in that The method further comprises: When there is no target image in the screenshot, it is determined that the call status of the target call at the first sampling time is not in call.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: An image at a second preset position in a target screenshot among the multiple screenshots is captured to obtain a second sub-screenshot; the multiple screenshots include a screenshot of the terminal at the first sampling moment, a screenshot of the terminal at the third sampling moment, and a screenshot of the terminal at the fourth sampling moment, the target screenshot is a screenshot of the target call in the multiple screenshots when the call interface is not reduced, and the second preset position is the position where the identifier of the call object is located in the screen of the terminal when the call interface of the target call is not reduced; The second sub-screenshot is used as the image identification of the call object.
6. The method according to claim 5, characterized in that The method further comprises: An image at a third preset position in the target screenshot is captured to obtain a third sub-screenshot; the third preset position is adjacent to the second preset position, and the third preset position is located below the second preset position; Performing OCR processing on the third sub-screenshot to obtain target text; The target text is used as the text identifier of the call object.
7. A device for determining call duration, characterized in that: The device comprises: an acquisition module and a processing module; The acquisition module is used to acquire a screenshot of the terminal at a first sampling moment; The processing module is used to determine the call status of the target call in the terminal at the first sampling time according to the screenshot of the terminal at the first sampling time; the target call is a call conducted through the target instant messaging software in the terminal, and the call status includes being in call or not in call; The processing module is further configured to, when the call status of the target call at the second sampling moment is not in call, determine the first sampling moment as the start moment of the target call if the call status of the target call at the first sampling moment is in call; and the second sampling moment is the previous sampling moment of the first sampling moment; The processing module is also used to determine a third sampling moment, and determine the duration between the first sampling moment and the third sampling moment as the call duration of the target call; the call status of the target call at the third sampling moment is not in call, the third sampling moment is after the first sampling moment, the call status of the target call at the fourth sampling moment is in call, and the fourth sampling moment is any sampling moment between the third sampling moment and the first sampling moment.
8. A computer program product, characterized in that When the computer program product is run on a computer, the computer is enabled to execute the method according to any one of claims 1 to 6.
9. A device for determining call duration, characterized in that: The device for determining call duration comprises: a processor, the processor is coupled to a memory, the memory is used to store programs or instructions, and when the program or instructions are executed by the processor, the device executes the method as claimed in any one of claims 1 to 6.
10. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instructions are executed, the computer is caused to perform the method according to any one of claims 1 to 6.