CN111614990A - Method and device for acquiring loading duration and electronic equipment - Google Patents

Method and device for acquiring loading duration and electronic equipment Download PDF

Info

Publication number
CN111614990A
CN111614990A CN202010383470.6A CN202010383470A CN111614990A CN 111614990 A CN111614990 A CN 111614990A CN 202010383470 A CN202010383470 A CN 202010383470A CN 111614990 A CN111614990 A CN 111614990A
Authority
CN
China
Prior art keywords
scene
video
screen recording
frame
frames
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010383470.6A
Other languages
Chinese (zh)
Other versions
CN111614990B (en
Inventor
张旭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202010383470.6A priority Critical patent/CN111614990B/en
Publication of CN111614990A publication Critical patent/CN111614990A/en
Application granted granted Critical
Publication of CN111614990B publication Critical patent/CN111614990B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • H04N21/4334Recording operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44008Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics in the video stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/854Content authoring
    • H04N21/8547Content authoring involving timestamps for synchronizing content

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

The disclosure relates to a method and a device for acquiring loading duration and electronic equipment. Wherein, the method comprises the following steps: at the initial moment when the first scene is switched to the second scene, screen recording operation is carried out on the current interface; when the loading of the second scene is finished, finishing the screen recording operation on the current interface to obtain a screen recording video; acquiring a key frame in the screen recording video, wherein the key frame carries a timestamp; and obtaining the loading duration for switching the first scene to the second scene according to the time stamp of the key frame. The key frame carrying the time stamp is obtained by utilizing the change of the screen content, so that the loading time length for switching from the first scene to the second scene can be more accurately obtained.

Description

Method and device for acquiring loading duration and electronic equipment
Technical Field
The present disclosure relates to the field of data processing, and in particular, to a method and an apparatus for acquiring a loading duration, and an electronic device.
Background
In some scene changes, some loading duration data affecting user experience, such as loading duration data of a page, needs to be acquired, so as to improve products.
In some schemes, the performance data is obtained by calculating the calling time of the key frame function at the client buried point. However, data counted by the client buried point and data sensed or experienced by the user time are deviated, for example, changes of visual effects other than the key point are not counted, and therefore, it is difficult to accurately acquire the scene loading duration when the scene changes.
Disclosure of Invention
The disclosure provides a method and a device for acquiring loading duration and electronic equipment, which are used for at least solving the problem of inaccurate acquisition of scene loading duration in the related art. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, a method for acquiring a loading duration is provided, including:
at the initial moment when the first scene is switched to the second scene, screen recording operation is carried out on the current interface;
when the loading of the second scene is finished, finishing the screen recording operation on the current interface to obtain a screen recording video;
acquiring a key frame in the screen recording video, wherein the key frame carries a timestamp;
and obtaining the loading duration for switching the first scene to the second scene according to the time stamp of the key frame.
Optionally, the acquiring a key frame in the screen recording video includes:
performing video frame splitting processing on the screen recording video to obtain a plurality of video frames, wherein each video frame carries a timestamp;
and extracting key frames in the plurality of video frames according to the interframe difference of the video frames.
Optionally, the number of the key frames is 2.
Optionally, the extracting key frames from the plurality of video frames according to the inter-frame difference of the video frames includes:
calculating an inter-frame difference of each video frame of the plurality of video frames from a previous video frame;
sequencing the interframe differences to obtain an interframe difference sequence which is arranged from large to small;
acquiring two interframe differences which are sequenced into a first interframe difference sequence and a second interframe difference sequence;
and taking the video frame corresponding to the difference between the first and the second frames as a key frame.
Optionally, the obtaining, according to the timestamp of the key frame, a loading duration used for switching the first scene to the second scene includes:
acquiring a time stamp of the key frame in the screen recording video;
and calculating the difference value between the timestamps corresponding to the key frames to be used as the loading time length for switching the first scene to the second scene.
Optionally, at an initial time when the first scene is switched to the second scene, performing a screen recording operation on the current interface includes:
starting a screen recording device of the terminal by using an android debugging bridge at the initial moment when the first scene is switched to the second scene;
and performing screen recording operation on the current interface based on the screen recording device.
Optionally, the performing video frame splitting processing on the screen recording video to obtain a plurality of video frames includes:
and performing frame dismantling processing on the screen recording video by using an open source computer vision library to obtain a plurality of video frames.
According to a second aspect of the embodiments of the present disclosure, there is provided an apparatus for obtaining a loading duration, including:
the screen recording module is configured to perform screen recording operation on a current interface at the initial moment when the first scene is switched to the second scene;
the screen recording ending module is configured to end screen recording operation on the current interface when loading of the second scene is ended, so that a screen recording video is obtained;
the acquisition module is configured to acquire a key frame in the screen recording video, wherein the key frame carries a timestamp;
and the determining module is configured to obtain the loading duration for switching the first scene to the second scene according to the time stamp of the key frame.
Optionally, the obtaining module includes:
the frame splitting unit is configured to perform video frame splitting processing on the screen recording video to obtain a plurality of video frames, wherein each video frame carries a timestamp;
an extraction unit configured to extract a key frame of the plurality of video frames according to an inter-frame difference of the video frames.
Optionally, the number of the key frames is 2.
Optionally, the extracting unit is configured to:
calculating an inter-frame difference of each video frame of the plurality of video frames from a previous video frame;
sequencing the interframe differences to obtain an interframe difference sequence which is arranged from large to small;
acquiring two interframe differences which are sequenced into a first interframe difference sequence and a second interframe difference sequence;
and taking the video frame corresponding to the difference between the first and the second frames as a key frame.
Optionally, the determining module includes:
an acquisition unit configured to acquire a time stamp of the key frame in the screen recording video;
and the calculating unit is configured to calculate a difference value between the timestamps corresponding to the key frames as a loading time length for switching the first scene to the second scene.
Optionally, the screen recording module is configured to:
starting a screen recording device of the terminal by using an android debugging bridge at the initial moment when the first scene is switched to the second scene;
and performing screen recording operation on the current interface based on the screen recording device.
Optionally, the frame splitting unit is configured to:
and performing frame dismantling processing on the screen recording video by using an open source computer vision library to obtain a plurality of video frames.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement any one of the above methods for acquiring a load time length.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a storage medium, where instructions executed by a processor of an electronic device enable the electronic device to perform any one of the above-mentioned methods for acquiring a load duration.
According to a fifth aspect of the embodiments of the present disclosure, there is provided a computer program product, wherein when the instructions in the computer program product are executed by a processor of an electronic device, the electronic device is caused to execute any one of the above-mentioned methods for acquiring a loading duration.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
in the technical scheme provided by the embodiment of the disclosure, at the initial moment when a first scene is switched to a second scene, a screen recording operation is performed on a current interface, when the loading of the second scene is finished, the screen recording operation on the current interface is finished to obtain a screen recording video, then a key frame in the screen recording video is obtained, and finally, according to a timestamp of the key frame, a loading duration for switching the first scene to the second scene is obtained. The key frame carrying the time stamp is obtained by utilizing the change of the screen content, so that the loading time length for switching from the first scene to the second scene can be more accurately obtained.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a flow diagram illustrating a method for obtaining a load time duration in accordance with an illustrative embodiment;
FIG. 2 is a flow diagram illustrating a method for load duration acquisition in accordance with an illustrative embodiment;
FIG. 3 is a block diagram illustrating an apparatus for obtaining loading duration in accordance with an exemplary embodiment;
FIG. 4 is a block diagram illustrating an electronic device in accordance with an exemplary embodiment;
FIG. 5 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The embodiment of the present disclosure provides a method and an apparatus for acquiring a loading duration, and an electronic device, where the method for acquiring a loading duration can acquire a loading duration required for switching from one scene to another scene when any scene changes, for example: the loading duration for opening an application, the loading duration for jumping from one page to another, the loading duration for loading out the most new data when refreshing a page, etc. According to the method and the device, the loading duration is obtained by adopting the change of the screen content, so that the obtained data is consistent with the actual experience of a user, the time obtaining of the internal function of the client is not depended on, and the obtaining is more convenient and accurate. The execution main body of the method for acquiring the loading duration provided by the present disclosure may be the apparatus for acquiring the loading duration provided by the present disclosure, and the apparatus for acquiring the loading duration may be integrated in a mobile terminal device (e.g., a smart phone, a tablet computer, etc.), a notebook computer or a fixed terminal (e.g., a desktop computer, etc.), and the apparatus for acquiring the loading duration may be implemented by hardware and/or software.
Fig. 1 is a flowchart illustrating a method for acquiring a loading duration according to an exemplary embodiment. As shown in the figure, the method for acquiring the loading duration may include: contents shown in step S11 to step S14.
In step S11, at the initial time when the first scene is switched to the second scene, a screen recording operation is performed on the current interface.
In step S12, when the loading of the second scene is finished, the screen recording operation on the current interface is finished, so as to obtain a screen recording video.
In the embodiment of the disclosure, when scene switching is detected, that is, at the initial time when the first scene is switched to the second scene, screen recording operation is performed on the current interface, and when it is detected that loading of the second scene is finished, screen recording is finished to obtain a screen recording video for subsequent use.
In step S13, a key frame in the screen recording video is acquired.
Where the key frame carries a timestamp.
In step S14, the loading duration for switching the first scene to the second scene is obtained according to the timestamp of the key frame.
In the embodiment of the present disclosure, the loading duration for switching the first scene to the second scene is obtained according to the timestamp carried by the key frame acquired from the screen recording video.
Therefore, in the embodiment of the present disclosure, at the initial time when the first scene is switched to the second scene, the screen recording operation is performed on the current interface, when the loading of the second scene is finished, the screen recording operation on the current interface is finished to obtain the screen recording video, then the key frame in the screen recording video is obtained, and finally, according to the timestamp of the key frame, the loading duration for switching the first scene to the second scene is obtained. The key frame carrying the time stamp is obtained by utilizing the change of the screen content, so that the loading time length for switching from the first scene to the second scene can be more accurately obtained.
In one possible implementation manner of the present disclosure, as shown in fig. 2, a flowchart of a method for acquiring a loading duration is shown according to an exemplary embodiment. As shown, acquiring key frames in a screen-recorded video may include: the contents shown in step S131 to step S132.
In step S131, a video frame splitting process is performed on the screen recording video to obtain a plurality of video frames.
Wherein each video frame carries a timestamp.
In the embodiments of the present disclosure, there are many methods for video frame splitting, for example: the video frame splitting is performed by using Python + OpenCV (open source computer vision library), or by using matlab software, and the video frame splitting can also be performed by using other software. After frame dropping, each video frame carries a timestamp.
In step S132, a key frame of the plurality of video frames is extracted according to the inter-frame difference of the video frames.
Wherein, the number of the key frames is 2.
In the embodiment of the present disclosure, when a video is split into frames, the difference degree between the current video frame and the previous video frame is compared, for example, the difference degree may be obtained through an absdiff function in OpenCV, and the difference degree corresponds to the positions of the current video frame and the current video frame in the screen recording video, and finally, the two video frames with the largest difference degree values of all the video frames are determined as the most key frames.
In the embodiment of the disclosure, a plurality of video frames are obtained by performing video frame splitting processing on a screen recording video, then the inter-frame difference of all the video frames is determined, and finally, the key frame is extracted. The change degree between the video frames can be judged through the calculation of the inter-frame difference, so that the key frames can be accurately extracted from all the video frames, the key frames can be accurately acquired without multiple tests, and the efficiency of extracting the key frames is improved.
In one possible embodiment of the present disclosure, extracting a key frame from a plurality of video frames according to an inter-frame difference of the video frames may specifically include: contents shown in step S1321 to step S1324.
In step S1321, an inter-frame difference of each of the plurality of videos from a previous video frame is calculated.
In step S1322, the inter-frame differences are sorted to obtain a sequence of inter-frame differences sorted from large to small.
In step S1323, two inter-frame differences ordered as first and second in the sequence of inter-frame differences are acquired.
In step S1324, the video frame corresponding to the first and second inter-frame differences is used as a key frame.
In the embodiment of the present disclosure, two video frames with the largest inter-frame difference among all the video frames may be obtained in a sorting manner, and the sorting manner may be from large to small, or from small to large; two video frames with the largest interframe difference in all videos can be obtained in a curve distribution diagram mode, namely, a timestamp of each video frame is used as an abscissa of the curve distribution diagram, the interframe difference of each video frame is used as an ordinate of the curve distribution diagram, two points with the largest ordinate can be obtained, and two corresponding video frames are used as key frames, namely the key frames for starting and stopping scene change; other manners may also be adopted to obtain the key frame, which are not always listed in the embodiments of the present disclosure.
It should be noted that, when selecting a key frame, a preset value is set between key frames to avoid an excessive inter-frame difference caused by some interference factors, that is, when selecting a certain video frame as a key frame, the selection of the next key frame can only be selected from the video frames after the preset number. For example, the preset value is 20 frames, and other frame numbers may also be adopted, which is not limited in the embodiment of the present disclosure.
In a possible implementation manner of the present disclosure, obtaining, according to a timestamp of a key frame, a loading duration used for switching a first scene to a second scene may specifically include: the contents shown in step S141 to step S142.
In step S141, a time stamp of the key frame in the screen-recorded video is acquired.
In step S142, a difference between the timestamps corresponding to the key frames is calculated as a loading duration for switching the first scene to the second scene.
In the embodiment of the present disclosure, the key frames are determined through the above embodiment, and then the time difference between two key frames is calculated according to the timestamp carried by the key frames, and is used as the loading duration for switching the first scene to the second scene. The loading duration when the two scenes are switched can be accurately obtained by using the timestamp of the key frame, multiple tests are not needed, and the loading duration when the two scenes are switched can be accurately obtained only by extracting the key frame once.
In one possible embodiment of the present disclosure, performing a screen recording operation on a current interface at an initial time when a first scene is switched to a second scene may include: starting a screen recording device of the terminal by using an android debugging bridge at the initial moment when the first scene is switched to the second scene; and performing screen recording operation on the current interface based on the screen recording device.
In the embodiment of the present disclosure, an Android Debug Bridge (Android Debug Bridge, ADB) may be used to start a screen recording device of a terminal to perform screen recording operation, and the screen recording device may quit from recording when the scene loading is completed, so that the screen recording operation is more convenient and faster.
In one possible embodiment of the present disclosure, performing video frame splitting processing on a screen recording video to obtain a plurality of video frames may include: and performing frame dismantling processing on the screen recording video by using an open source computer vision library to obtain a plurality of video frames.
FIG. 3 is a block diagram illustrating an apparatus for obtaining loading duration according to an example embodiment. Referring to fig. 3, the apparatus 300 may include a screen recording module 301, a screen recording end module 302, an obtaining module 303, and a determining module 304.
The device for acquiring loading duration provided in this embodiment may refer to a flowchart for executing the method shown in fig. 1 and fig. 2, and each unit/module and the other operations and/or functions in the device are respectively for implementing the corresponding flowchart in the method for acquiring loading duration shown in fig. 1 and fig. 2, and may achieve the same or equivalent technical effects, and for brevity, no further description is provided here.
In this embodiment of the present disclosure, the screen recording module 301 is configured to perform a screen recording operation on a current interface at an initial time when a first scene is switched to a second scene. The screen recording ending module 302 is configured to end the screen recording operation on the current interface when the loading of the second scene is ended, so as to obtain a screen recording video. The acquisition module 303 is configured to acquire a key frame in the screen-recording video, wherein the key frame carries a time stamp. The determining module 304 is configured to derive a loading duration for switching the first scene to the second scene based on the timestamp of the key frame.
In the embodiment of the present disclosure, at an initial time when a first scene is switched to a second scene, a screen recording module 301 performs a screen recording operation on a current interface, when loading of the second scene is finished, a screen recording finishing module 302 finishes the screen recording operation on the current interface to obtain a screen recording video, an obtaining module 303 obtains a key frame in the screen recording video, and a determining module 304 obtains a loading duration for switching the first scene to the second scene according to a timestamp of the key frame. The key frame carrying the time stamp is obtained by utilizing the change of the screen content, so that the loading time length for switching from the first scene to the second scene can be more accurately obtained.
In one possible implementation of the present disclosure, the obtaining module 303 may include: a frame splitting unit and an extraction unit.
The frame splitting unit is configured to perform video frame splitting processing on the screen recording video to obtain a plurality of video frames, wherein each video frame carries a timestamp. The extraction module is configured to extract key frames from the plurality of video frames based on inter-frame differences of the video frames.
In one possible embodiment of the present disclosure, the number of key frames is 2.
In one possible embodiment of the present disclosure, the extraction unit may be configured to: calculating an interframe difference between each video frame in the plurality of video frames and a previous video frame; sequencing the multiple inter-frame differences to obtain an inter-frame difference sequence which is arranged from large to small; acquiring two interframe differences which are sequenced into a first interframe difference sequence and a second interframe difference sequence; and taking the video frame corresponding to the difference between the two frames which are sequenced into the first and the second as a key frame.
In one possible embodiment of the present disclosure, the determining module 304 may include: an acquisition unit and a calculation unit.
The acquisition unit is configured to acquire a time stamp of the key frame in the screen recording video. The calculation unit is configured to calculate a difference between timestamps corresponding to the key frames as a loading time period for switching the first scene to the second scene.
In one possible embodiment of the present disclosure, the screen recording module 301 may be configured to: starting a screen recording device of the terminal by using an android debugging bridge at the initial moment when the first scene is switched to the second scene; and performing screen recording operation on the current interface based on the screen recording device.
In one possible embodiment of the present disclosure, the deframing unit may be configured to: and performing frame dismantling processing on the screen recording video by using an open source computer vision library to obtain a plurality of video frames.
Fig. 4 is a block diagram illustrating an electronic device 400 according to an example embodiment, for example, the electronic device 400 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 4, electronic device 400 may include one or more of the following components: a processing component 402, a memory 404, a power component 406, a multimedia component 408, an audio component 410, an interface for input/output (I/O) 412, a sensor component 414, and a communication component 416.
The processing component 402 generally controls overall operation of the electronic device 400, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more processors 420 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 402 can include one or more modules that facilitate interaction between the processing component 402 and other components. For example, the processing component 402 can include a multimedia module to facilitate interaction between the multimedia component 408 and the processing component 402.
The memory 404 is configured to store various types of data to support operations at the device 400. Examples of such data include instructions for any application or method operating on the electronic device 400, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 404 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 406 provides power to the various components of the electronic device 400. Power components 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for electronic device 400.
The multimedia component 408 comprises a screen providing an output interface between the electronic device 400 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 includes a front facing camera and/or a rear facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 400 is in an operational mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 410 is configured to output and/or input audio signals. For example, the audio component 410 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 400 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 404 or transmitted via the communication component 416. In some embodiments, audio component 410 also includes a speaker for outputting audio signals.
The I/O interface 412 provides an interface between the processing component 402 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 414 includes one or more sensors for providing various aspects of status assessment for the electronic device 400. For example, the sensor component 414 can detect an open/closed state of the device 400, the relative positioning of components, such as a display and keypad of the electronic device 400, the sensor component 414 can also detect a change in the position of the electronic device 400 or a component of the electronic device 400, the presence or absence of user contact with the electronic device 400, orientation or acceleration/deceleration of the electronic device 400, and a change in the temperature of the electronic device 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 414 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 416 is configured to facilitate wired or wireless communication between the electronic device 400 and other devices. The electronic device 400 may access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 416 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 400 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a storage medium comprising instructions, such as the memory 404 comprising instructions, executable by the processor 420 of the electronic device 400 to perform the above-described method is also provided. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided, which comprises readable program code executable by the processor 420 of the electronic device 400 to perform the method for acquiring a loading duration according to any of the embodiments. Alternatively, the program code may be stored in a storage medium of the electronic device 400, which may be a non-transitory computer-readable storage medium, for example, ROM, Random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
Fig. 5 is a block diagram of one type of electronic device 500 shown in the present disclosure. For example, the electronic device 500 may be provided as a server.
Referring to fig. 5, electronic device 500 includes a processing component 522 that further includes one or more processors and memory resources, represented by memory 532, for storing instructions, such as applications, that are executable by processing component 522. The application programs stored in memory 532 may include one or more modules that each correspond to a set of instructions. Further, the processing component 522 is configured to execute instructions to perform the load duration obtaining method of any of the embodiments.
The electronic device 500 may also include a power component 526 configured to perform power management of the electronic device 500, a wired or wireless network interface 550 configured to connect the electronic device 500 to a network, and an input/output (I/O) interface 558. The electronic device 500 may operate based on an operating system stored in memory 532, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A method for acquiring loading duration is characterized by comprising the following steps:
at the initial moment when the first scene is switched to the second scene, screen recording operation is carried out on the current interface;
when the loading of the second scene is finished, finishing the screen recording operation on the current interface to obtain a screen recording video;
acquiring a key frame in the screen recording video, wherein the key frame carries a timestamp;
and obtaining the loading duration for switching the first scene to the second scene according to the time stamp of the key frame.
2. The method for acquiring the loading duration according to claim 1, wherein the acquiring the key frames in the screen recording video comprises:
performing video frame splitting processing on the screen recording video to obtain a plurality of video frames, wherein each video frame carries a timestamp;
and extracting key frames in the plurality of video frames according to the interframe difference of the video frames.
3. The method according to claim 2, wherein the interval between any two key frames is not less than a preset number of frames.
4. The method according to claim 2, wherein the number of the key frames is 2.
5. The method according to claim 4, wherein the extracting key frames from the plurality of video frames according to the inter-frame difference of the video frames comprises:
calculating an inter-frame difference of each video frame of the plurality of video frames from a previous video frame;
sequencing the interframe differences to obtain an interframe difference sequence which is arranged from large to small;
acquiring two interframe differences which are sequenced into a first interframe difference sequence and a second interframe difference sequence;
and taking the video frame corresponding to the difference between the first and the second frames as a key frame.
6. The method according to claim 1, wherein the obtaining the loading duration for switching the first scene to the second scene according to the timestamp of the key frame includes:
acquiring a time stamp of the key frame in the screen recording video;
and calculating the difference value between the timestamps corresponding to the key frames to be used as the loading time length for switching the first scene to the second scene.
7. The method for acquiring the loading duration according to claim 1, wherein at an initial time when the first scene is switched to the second scene, a screen recording operation is performed on a current interface, and the method comprises the following steps:
starting a screen recording device of the terminal by using an android debugging bridge at the initial moment when the first scene is switched to the second scene;
and performing screen recording operation on the current interface based on the screen recording device.
8. The method for acquiring the loading duration according to claim 2, wherein the performing video frame splitting processing on the screen recording video to obtain a plurality of video frames comprises:
and performing frame dismantling processing on the screen recording video by using an open source computer vision library to obtain a plurality of video frames.
9. An apparatus for acquiring loading duration, comprising:
the screen recording module is configured to perform screen recording operation on a current interface at the initial moment when the first scene is switched to the second scene;
the screen recording ending module is configured to end screen recording operation on the current interface when loading of the second scene is ended, so that a screen recording video is obtained;
the acquisition module is configured to acquire a key frame in the screen recording video, wherein the key frame carries a timestamp;
and the determining module is configured to obtain the loading duration for switching the first scene to the second scene according to the time stamp of the key frame.
10. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the load duration obtaining method of any one of claims 1 to 8.
CN202010383470.6A 2020-05-08 2020-05-08 Method and device for acquiring loading duration and electronic equipment Active CN111614990B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010383470.6A CN111614990B (en) 2020-05-08 2020-05-08 Method and device for acquiring loading duration and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010383470.6A CN111614990B (en) 2020-05-08 2020-05-08 Method and device for acquiring loading duration and electronic equipment

Publications (2)

Publication Number Publication Date
CN111614990A true CN111614990A (en) 2020-09-01
CN111614990B CN111614990B (en) 2022-06-21

Family

ID=72201490

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010383470.6A Active CN111614990B (en) 2020-05-08 2020-05-08 Method and device for acquiring loading duration and electronic equipment

Country Status (1)

Country Link
CN (1) CN111614990B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112218155A (en) * 2020-09-24 2021-01-12 北京达佳互联信息技术有限公司 Automatic detection method and device for switching time consumption and electronic equipment
CN112511818A (en) * 2020-11-24 2021-03-16 上海哔哩哔哩科技有限公司 Video playing quality detection method and device
CN115484492A (en) * 2022-11-11 2022-12-16 荣耀终端有限公司 Interface time delay obtaining method and device

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003330761A (en) * 2002-05-09 2003-11-21 Lifetree Corp Computer operation screen recording apparatus
CN104424092A (en) * 2013-08-22 2015-03-18 腾讯科技(深圳)有限公司 Page loading time length testing method and device
CN106326098A (en) * 2015-07-01 2017-01-11 上海云双信息科技有限公司 Method and device for testing page perceived performance
CN106844214A (en) * 2017-01-23 2017-06-13 北京思特奇信息技术股份有限公司 A kind of automatic method and device that sectional drawing is carried out to page rendering
CN107678895A (en) * 2017-09-11 2018-02-09 上海斐讯数据通信技术有限公司 A kind of method of testing and system of intelligent terminal page jump time
CN108196904A (en) * 2017-12-27 2018-06-22 广州品唯软件有限公司 Calculate the method, apparatus and computer storage media of page response duration
CN108737885A (en) * 2018-06-07 2018-11-02 北京奇艺世纪科技有限公司 A kind of analysis Online Video plays the method and device of interim card
CN108984395A (en) * 2018-06-21 2018-12-11 腾讯科技(北京)有限公司 A kind of application program launching time-consuming test method, device and storage medium
CN109710520A (en) * 2018-12-14 2019-05-03 中国平安财产保险股份有限公司 Using the time-consuming test method of starting, device, computer equipment and storage medium
CN110324707A (en) * 2019-07-12 2019-10-11 北京奇艺世纪科技有限公司 A kind of video starts broadcasting time-consuming test method and device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003330761A (en) * 2002-05-09 2003-11-21 Lifetree Corp Computer operation screen recording apparatus
CN104424092A (en) * 2013-08-22 2015-03-18 腾讯科技(深圳)有限公司 Page loading time length testing method and device
CN106326098A (en) * 2015-07-01 2017-01-11 上海云双信息科技有限公司 Method and device for testing page perceived performance
CN106844214A (en) * 2017-01-23 2017-06-13 北京思特奇信息技术股份有限公司 A kind of automatic method and device that sectional drawing is carried out to page rendering
CN107678895A (en) * 2017-09-11 2018-02-09 上海斐讯数据通信技术有限公司 A kind of method of testing and system of intelligent terminal page jump time
CN108196904A (en) * 2017-12-27 2018-06-22 广州品唯软件有限公司 Calculate the method, apparatus and computer storage media of page response duration
CN108737885A (en) * 2018-06-07 2018-11-02 北京奇艺世纪科技有限公司 A kind of analysis Online Video plays the method and device of interim card
CN108984395A (en) * 2018-06-21 2018-12-11 腾讯科技(北京)有限公司 A kind of application program launching time-consuming test method, device and storage medium
CN109710520A (en) * 2018-12-14 2019-05-03 中国平安财产保险股份有限公司 Using the time-consuming test method of starting, device, computer equipment and storage medium
CN110324707A (en) * 2019-07-12 2019-10-11 北京奇艺世纪科技有限公司 A kind of video starts broadcasting time-consuming test method and device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112218155A (en) * 2020-09-24 2021-01-12 北京达佳互联信息技术有限公司 Automatic detection method and device for switching time consumption and electronic equipment
CN112511818A (en) * 2020-11-24 2021-03-16 上海哔哩哔哩科技有限公司 Video playing quality detection method and device
CN112511818B (en) * 2020-11-24 2022-08-19 上海哔哩哔哩科技有限公司 Video playing quality detection method and device
CN115484492A (en) * 2022-11-11 2022-12-16 荣耀终端有限公司 Interface time delay obtaining method and device

Also Published As

Publication number Publication date
CN111614990B (en) 2022-06-21

Similar Documents

Publication Publication Date Title
CN107025419B (en) Fingerprint template inputting method and device
CN105845124B (en) Audio processing method and device
CN109359056B (en) Application program testing method and device
CN111614990B (en) Method and device for acquiring loading duration and electronic equipment
EP3173970A1 (en) Image processing method and apparatus
CN109284149B (en) Method and device for starting application program
CN110996121A (en) Information processing method and device, electronic equipment and storage medium
CN106775403B (en) Method and device for acquiring stuck information
EP3261046A1 (en) Method and device for image processing
CN113382270B (en) Virtual resource processing method and device, electronic equipment and storage medium
EP3098765A1 (en) Method and apparatus for recommending cloud card
CN112241361A (en) Test case generation method and device and problem scene automatic reproduction method and device
CN112188091B (en) Face information identification method and device, electronic equipment and storage medium
CN113259226A (en) Information synchronization method and device, electronic equipment and storage medium
CN109298995B (en) Performance test method and device, electronic equipment and storage medium
CN112948704A (en) Model training method and device for information recommendation, electronic equipment and medium
CN109358788B (en) Interface display method and device and terminal
CN110213062B (en) Method and device for processing message
CN109740557B (en) Object detection method and device, electronic equipment and storage medium
CN108647074B (en) Method, device, hardware device and medium for displaying dynamic information in screen locking state
CN111698532A (en) Bullet screen information processing method and device
CN106572431B (en) Equipment pairing method and device
CN110769282A (en) Short video generation method, terminal and server
CN107526683B (en) Method and device for detecting functional redundancy of application program and storage medium
CN113761275A (en) Video preview moving picture generation method, device and equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant