IP Library › Granted Patent US 11,886,798
Granted Patent B2
US 11,886,798 · App. 17/772,628 · Granted Jan 30, 2024

Method and apparatus for obtaining loading time length of image in webpage, and electronic device

Inventor: Guohui Yin (Beijing, CN)
G06F40/143G06F16/9574G06F16/986
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,886,798
App. No.
17/772,628
Granted
Jan 30, 2024
Kind
B2
Abstract

Provided are a method and an apparatus for obtaining a loading time length of an image in a webpage, and an electronic device. The method includes: obtaining, during loading of a Hypertext Markup Language HTML file of the webpage, event tracking data through event tracking that is set in the HTML file, wherein the event tracking data includes loading start time of the HTML file; obtaining a timestamp of a loading end event of the image in the webpage, and determining the loading time length of the image based on the loading start time and the timestamp. The method can obtain the loading time length of the image in the webpage, facilitate the detection of the loading time length of the image, and provide data support for realizing the analysis of the webpage service quality based on the loading time length of the image and improving the webpage service quality.

Claims (36)

1. A method for obtaining a loading time length of an image in a webpage, comprising:

obtaining, during loading of a HyperText Markup Language (HTML) file of the webpage, event tracking data through event tracking that is set in the HTML file, wherein the event tracking data comprises loading start time of the HTML file, the event tracking is set in a head of the HTML file, a tag for importing an external file exists in the head of the HTML file, and the loading start time is loading start time of the external file imported in the head;

obtaining a timestamp of a loading end event of the image in the webpage; and

determining the loading time length of the image based on the loading start time and the timestamp.

2. The method according to claim 1 , wherein the method is performed by a client or a server;

when the method is performed by the client, the method further comprises, subsequent to said obtaining the timestamp of the loading end event of the image in the webpage:

determining the loading time length of the image based on the loading start time and the timestamp, and transmitting the loading time length to a server; or

transmitting the loading start time and the timestamp to the server, wherein the loading time length of the image being determined by the server based on the loading start time and the timestamp.

3. The method according to claim 1 , wherein when the method is performed by a server, the method further comprises, after a client has detected the loading start time of the HTML file and the timestamp of the loading end event of the image: obtaining, by the server from the client, the loading start time of the HTML file and the timestamp of the loading end event of the image, to determine the loading time length of the image based on the obtained loading start time of the HTML file and the obtained timestamp of the loading end event of the image.

4. The method according to claim 1 , wherein the loading end event is a loading completion event or a loading error event.

5. The method according to claim 1 , wherein the external file is a JavaScript file or Cascading Style Sheet (CSS) file.

6. An apparatus for obtaining a loading time length of an image in a webpage, comprising:

an event tracking data obtaining module configured to obtain, during loading of a HyperText Markup Language (HTML) file of the webpage, event tracking data through event tracking that is set in the HTML file, wherein the event tracking data comprises loading start time of the HTML file, the event tracking is set in a head of the HTML file, a tag for importing an external file exists in the head of the HTML file, and the loading start time is loading start time of the external file imported in the head; and

a timestamp obtaining module configured to obtain a timestamp of a loading end event of the image in the webpage, and determine the loading time length of the image based on the loading start time and the timestamp.

7. The apparatus according to claim 6 , wherein the loading end event is a loading completion event or a loading error event.

8. An electronic device, comprising:

a memory having a computer program stored thereon; and

a processor configured to implement a method for obtaining a loading time length of an image in a webpage by executing the computer program,

wherein the method comprises:

obtaining, during loading of a HyperText Markup Language (HTML) file of the webpage, event tracking data through event tracking that is set in the HTML file, wherein the event tracking data comprises loading start time of the HTML file, the event tracking is set in a head of the HTML file, a tag for importing an external file exists in the head of the HTML file, and the loading start time is loading start time of an external file imported in the head;

obtaining a timestamp of a loading end event of the image in the webpage; and

determining the loading time length of the image based on the loading start time and the timestamp.

9. A computer-readable storage medium, having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method according to claim 1 .

10. The electronic device according to claim 8 , wherein the method is performed by a client or a server;

when the method is performed by the client, the method further comprises, subsequent to said obtaining the timestamp of the loading end event of the image in the webpage:

determining the loading time length of the image based on the loading start time and the timestamp, and transmitting the loading time length to a server; or

transmitting the loading start time and the timestamp to the server, wherein the loading time length of the image being determined by the server based on the loading start time and the timestamp.

11. The electronic device according to claim 8 , wherein when the method is performed by a server, the method further comprises, after a client has detected the loading start time of the HTML file and the timestamp of the loading end event of the image: obtaining, by the server from the client, the loading start time of the HTML file and the timestamp of the loading end event of the image, to determine the loading time length of the image based on the obtained loading start time of the HTML, file and the obtained timestamp of the loading end event of the image.

12. The electronic device according to claim 8 , wherein the loading end event is a loading completion event or a loading error event.

13. The electronic device according to claim 8 , wherein the external file is a JavaScript file or Cascading Style Sheet (CSS) file.

14. The computer-readable storage medium according to claim 9 , wherein the method is performed by a client or a server;

when the method is performed by the client, the method further comprises, subsequent to said obtaining the timestamp of the loading end event of the image in the webpage:

determining the loading time length of the image based on the loading start time and the timestamp, and transmitting the loading time length to a server; or

transmitting the loading start time and the timestamp to the server, wherein the loading time length of the image being determined by the server based on the loading start time and the timestamp.

15. The computer-readable storage medium according to claim 9 , wherein when the method is performed by a server, the method further comprises, after a client has detected the loading start time of the HTML file and the timestamp of the loading end event of the image: obtaining, by the server from the client, the loading start time of the HTML file and the timestamp of the loading end event of the image, to determine the loading time length of the image based on the obtained loading start time of the HTML file and the obtained timestamp of the loading end event of the image.

16. The computer-readable storage medium according to claim 9 , wherein the loading end event is a loading completion event or a loading error event.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 6, 2022
From: YIN, GUOHUI
To: BEIJING BYTEDANCE NETWORK TECHNOLOGY CO., LTD.
Reel/Frame 059841/0470 →
Priority Claims (1)
CN 201911032128.5 · Oct 28, 2019 · national
Continuity (1)
Related Publication 20220374582A1 · Nov 24, 2022