CN114222148B - Countdown control method and device, storage medium and computer equipment - Google Patents

Countdown control method and device, storage medium and computer equipment Download PDF

Info

Publication number
CN114222148B
CN114222148B CN202111295949.5A CN202111295949A CN114222148B CN 114222148 B CN114222148 B CN 114222148B CN 202111295949 A CN202111295949 A CN 202111295949A CN 114222148 B CN114222148 B CN 114222148B
Authority
CN
China
Prior art keywords
countdown
time
page
instruction
moment
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.)
Active
Application number
CN202111295949.5A
Other languages
Chinese (zh)
Other versions
CN114222148A (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.)
Guangzhou Cubesili Information Technology Co Ltd
Original Assignee
Guangzhou Cubesili 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 Guangzhou Cubesili Information Technology Co Ltd filed Critical Guangzhou Cubesili Information Technology Co Ltd
Priority to CN202111295949.5A priority Critical patent/CN114222148B/en
Publication of CN114222148A publication Critical patent/CN114222148A/en
Application granted granted Critical
Publication of CN114222148B publication Critical patent/CN114222148B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed
    • 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

Abstract

The embodiment of the application discloses a countdown control method, a countdown control device, a storage medium and computer equipment. The embodiment of the application receives a countdown instruction sent by a server; wherein, the countdown instruction at least carries a first duration; recording a first moment when the countdown instruction is received; loading a countdown page associated with the countdown instruction; recording a second moment when the countdown page is loaded; calibrating the first time according to the difference between the second time and the first time to obtain a second time; and controlling the countdown page to start countdown according to the second duration. Therefore, the countdown time displayed by different clients is consistent by calibrating the countdown time, the accuracy of live broadcast countdown is improved, and the satisfaction degree of a user on live broadcast activities is further improved.

Description

Countdown control method and device, storage medium and computer equipment
Technical Field
The present disclosure relates to the field of network live broadcasting technologies, and in particular, to a countdown control method, a countdown control device, a storage medium, and a computer device.
Background
Today, the live broadcast industry is developing better and better, and watching live webbroadcast is becoming a part of people's daily entertainment consumption. In order to enhance interactivity with audience during live broadcast, relevant live broadcast activities such as popularity comparing, goods popularizing and the like are added, and in order to increase user participation enthusiasm, live broadcast activities are always opened in a time-limited mode, and in order to further increase tension of the user participating in the live broadcast activities, the remaining time of the live broadcast activities, namely live broadcast activity countdown, is displayed on a live broadcast interface.
In the research and practice process of the prior art, the inventor of the application finds that in the prior art, the loading time of a live broadcast activity component cannot be predicted due to the fact that the client network speed used by users is different, so that the countdown of the live broadcast activity seen by each user is inconsistent, the countdown time error of the live broadcast activity is caused, and the experience of the users participating in the live broadcast activity is poor.
Disclosure of Invention
In view of the above problems, the present application provides a countdown control method, a countdown control device, a storage medium and a computer device, which can improve accuracy of live countdown.
In order to solve the technical problems described above, the embodiments of the present application provide the following technical solutions:
A countdown control method, comprising:
receiving a countdown instruction sent by a server; wherein, the countdown instruction at least carries a first duration;
recording a first moment when the countdown instruction is received;
loading a countdown page associated with the countdown instruction;
recording a second moment when the countdown page is loaded;
calibrating the first time according to the difference between the second time and the first time to obtain a second time; and
and controlling the countdown page to start countdown according to the second duration.
A countdown control device, comprising:
the receiving unit is used for receiving the countdown instruction sent by the server; wherein, the countdown instruction at least carries a first duration;
the first recording unit is used for recording a first moment when the countdown instruction is received;
the loading unit is used for loading the countdown page associated with the countdown instruction;
the second recording unit is used for recording a second moment when the countdown page is loaded;
the calibration unit is used for calibrating the first time length according to the difference value between the second time and the first time to obtain a second time length; and
And the control unit is used for controlling the countdown page to start countdown according to the second duration.
In some embodiments, the countdown control device further comprises:
the transmission delay acquisition unit is used for acquiring the data transmission delay between the audience client and the server;
a third duration determining subunit, configured to subtract the data transmission delay from the second duration to obtain a third duration;
the control unit includes:
and the first control subunit is used for controlling the countdown page to start countdown according to the third duration.
In some embodiments, the transmission delay acquiring unit includes:
a third recording subunit, configured to record a third time when the delay detection packet is sent to the server;
a fourth recording subunit, configured to record a fourth time when a response data packet returned by the server in response to the delay detection data packet is received; and
and the transmission delay obtaining subunit is used for obtaining the data transmission delay according to the difference value between the fourth moment and the third moment.
In some embodiments, the countdown instruction further carries a link to a live active page, and the loading unit includes:
The loading subunit is used for controlling the webpage component to load the corresponding page according to the link;
and the second recording subunit is used for injecting a callback method into the webpage component so as to execute the callback method when the loading of the page corresponding to the link is completed, and acquiring a system time stamp as the second moment when the loading is completed in the callback method.
In some embodiments, the control unit comprises:
and the second control subunit is used for transmitting the second time length to the webpage component through a preset interface, so that the webpage component controls the countdown page to start countdown according to the second time length.
In some embodiments, the countdown control device further comprises:
an instruction conversion unit for converting the countdown instruction into a predetermined data model;
the first recording unit includes:
recording a first moment of receiving the countdown instruction in a variable of the data model.
In some embodiments, the control unit comprises:
and the timeout subunit is used for acquiring a predefined loading time length associated with the audience client when the second time length is detected to exceed a preset range, and controlling the countdown page to start countdown according to the predefined loading time length.
A computer storage medium having stored thereon a plurality of instructions adapted to be loaded by a processor to perform the steps of the countdown control method described above.
A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps in the countdown control method provided above when the computer program is executed.
A computer program product or computer program comprising computer instructions stored in a storage medium. The computer instructions are read from the storage medium by a processor of a computer device, and executed by the processor, to cause the computer device to perform the steps in the countdown control method provided above.
The embodiment of the application receives a countdown instruction sent by a server; wherein, the countdown instruction at least carries a first duration; recording a first moment when the countdown instruction is received; loading a countdown page associated with the countdown instruction; recording a second moment when the countdown page is loaded; calibrating the first time according to the difference between the second time and the first time to obtain a second time; and controlling the countdown page to start countdown according to the second duration. Therefore, the countdown time displayed by different clients is consistent by calibrating the countdown time, the accuracy of live broadcast countdown is improved, and the satisfaction degree of a user on live broadcast activities is further improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a scenario of a countdown control system provided in an embodiment of the present application;
fig. 2 is a schematic flow chart of a countdown control method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a live interface provided by an embodiment of the present application;
FIG. 4 is a timing diagram of a countdown control method provided in an embodiment of the present application;
FIG. 5 is a schematic structural diagram of a countdown control device according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The embodiment of the application provides a countdown control method, a countdown control device, a storage medium and computer equipment.
Referring to fig. 1, fig. 1 is a schematic view of a scenario of a countdown control system provided in an embodiment of the present application, including: anchor client a, server B, and audience client C. Information interaction can be performed among the anchor client a, the server B and the audience client C through a network. The network is typically the Internet, but may be any network including, but not limited to, a local area network (Local Area Network, LAN), metropolitan area network (Metropolitan Area Network, MAN), wide area network (Wide Area Network, WAN), a mobile, wired or wireless network, a private network, or any combination of virtual private networks. In some embodiments, the spectator client a, spectator client B, and the server may communicate via a particular communication protocol, including, but not limited to, BLE (Bluetooth low energy ) protocol, WLAN (Wireless Local Area Network, wireless local area network) protocol, bluetooth protocol, zigBee (ZigBee) protocol, or Wi-Fi (Wireless Fidelity ) protocol, or the like. The network includes network entities such as routers, gateways, etc., which are not shown.
In an embodiment of the present application, the countdown control system may further include a countdown control device. The countdown control device can be integrated in a terminal with a storage unit, a microprocessor and an operation capability, such as a tablet computer, a mobile phone, a notebook computer, a desktop computer and the like, and the terminal can be provided with a client, such as a live client or a game client. It should be noted that the live client may include a hosting client a and a viewer client C.
In this embodiment of the present application, the server B may store a correspondence between the anchor client a and each live broadcast room, and when the audience client C selects a live broadcast room, the server B sends live video streams corresponding to the anchor client a to all the audience clients C belonging to the same live broadcast room according to the correspondence between each live broadcast room and the anchor client a. The server B may refer to a separate server or may refer to a server cluster; the cloud server can be a local server or a cloud server.
In fig. 1, a hosting client a may initiate a countdown live broadcast activity, and send a countdown instruction corresponding to the countdown live broadcast activity to a server; the countdown instruction at least carries countdown time length, the server B receives the countdown instruction sent by the anchor client A and sends the received countdown instruction to the audience client C, so that the audience client C belonging to the living broadcast room where the anchor client A is located loads the countdown page according to the received countdown instruction and controls the countdown page to start countdown according to the countdown time length.
Specifically, the viewer client C may be configured to receive a countdown instruction sent by the server B; the countdown instruction at least carries a first duration; recording a first moment when a countdown instruction is received; loading a countdown page associated with the countdown instruction; recording a second moment when the countdown page is loaded; calibrating the first time according to the difference between the second time and the first time to obtain a second time; and controlling the countdown page to start countdown according to the second duration.
It should be noted that, the schematic view of the scenario of the countdown control system shown in fig. 1 is only an example, and the countdown control system and scenario described in the embodiments of the present application are for more clearly describing the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application, and those skilled in the art can know that, with the evolution of the countdown control system and the appearance of a new service scenario, the technical solutions provided in the embodiments of the present application are equally applicable to similar technical problems.
The following will describe in detail.
In the present embodiment, description will be made from the viewpoint of a countdown control device, which may be integrated in a server in particular.
Referring to fig. 2, fig. 2 is a flowchart of a countdown control method according to an embodiment of the present application. The countdown control method comprises the following steps:
in step 101, a countdown instruction sent by a server is received.
In the embodiment of the application, the audience client can receive the countdown instruction sent by the server. The countdown instruction is generated according to the countdown of the live broadcast activity initiated by the anchor client, the anchor client sends the countdown instruction to the server after the countdown instruction is generated, and the server sends the countdown instruction to the audience client currently watching or having the qualification of participating in the activity, so that the countdown of the live broadcast activity initiated by the anchor client can be displayed on the subsequent audience clients.
The method comprises the steps that after a countdown instruction is received by a viewer client, a live broadcast activity countdown is displayed on a live broadcast interface of a live broadcast room, and the live broadcast activity countdown is a countdown of a live broadcast activity initiated by a host user on the host client, so that the countdown instruction at least carries the total duration corresponding to the original live broadcast activity countdown of the live broadcast activity, namely a first duration.
Further, in order to make the live broadcast activity displayed on the live broadcast interface be initiated by the live broadcast room host user initiating the activity, instead of displaying the live broadcast activities initiated by host users of other live broadcast rooms, the countdown instruction may also carry the identifier of the host client corresponding to the live broadcast room.
The audience client can enter a live broadcast room corresponding to any anchor client, and in the live broadcast room, the audience client can watch live broadcast contents displayed by an anchor in the anchor client corresponding to the live broadcast room, such as talent display, game live broadcast, promotion and commodity carrying, and the like. The audience users can interact with the anchor users through the audience clients according to the live broadcast content of the anchor users, for example, the audience users can send a bullet screen to evaluate the live broadcast content of the anchor users, and can also participate in various live broadcast activities initiated by the anchor users in the live broadcast process.
Wherein, live events initiated by the anchor user may be, for example, lottery, popularity ratio with other anchor users, game win/lose predictions, etc. To better stimulate the viewer's desire to participate in live events, these live events set live event countdown. For example, 2 hours, 5 minutes, etc. may be used. The specific live event countdown anchor user can be set according to the actual live event, for example, when the audience users in the live house are more or the live event content is novel, in order to increase the enthusiasm and tension of the audience users to participate in the event, the live event countdown duration can be set to be shorter than the conventional live event countdown duration.
In the related live broadcast technology, the inconsistent display of live broadcast activity countdown of the audience client is mainly caused by that a countdown instruction is sent to the audience client from a server, various delays, such as network delays, exist during the display of live broadcast activity countdown of the audience client according to the received countdown instruction, but the audience client does not consider the delay time brought by the delay when the live broadcast activity countdown displayed after the countdown instruction is received, and still starts the countdown from the initial live broadcast activity countdown, so that the residual countdown time of the live broadcast activity displayed by the audience client is longer than the residual countdown time of the live broadcast activity displayed by the main broadcasting client. And because delay conditions of different audience clients are possibly different, the countdown of live events displayed by the different audience clients is inconsistent, so that the countdown time error of the live events displayed on the different audience clients is caused, the normal holding of the events is affected, and the experience of the users participating in the live events is poor.
Illustratively, audience user A and audience user B are located in the same living room, the correct living activity countdown is 23 seconds(s), but the living activity countdown of the living room on audience client A used by audience user A is displayed for the remaining 29 seconds, while the living activity countdown of the living room on audience client B used by audience user B is displayed for the remaining 25 seconds, because the delay is not calibrated.
In step 102, a first time at which the countdown instruction is received is recorded.
In this embodiment of the present application, the viewer client records the time when the countdown instruction sent by the server is received as the first time, where the storage manner of the first time recorded by the viewer client may have various choices, such as a file, a database, a network, and the like. The first moment is also the moment when the client of the audience starts loading the countdown page according to the instruction after the countdown instruction is received, and then the loading time of the countdown page on the client of the audience can be obtained according to the recorded moment when the client of the audience starts loading and the moment when the client of the audience finishes loading.
In some embodiments, before the first time when the count-down instruction is received by the record, the method further comprises:
(1) And forming a preset data model according to the countdown instruction.
And the audience client converts the relevant data carried in the received countdown instruction into a preset data model. The related data in the countdown instruction may include live event identification, live event content, live event countdown, and the like.
Since a plurality of time data needs to be recorded for the first time in the countdown instruction, a separate time record variable may be created in the formed data model to record the time data needed for the first time to be calibrated in order to facilitate access to the time data.
The data model represents a specific organization of data, and may be, for example, a hierarchical model (tree structure), a relational model (record group, data table, etc.), and a mesh model (connection instruction, pointer, etc.). In this embodiment, the predetermined data model formed according to the countdown instruction may be selected according to the need, which is not limited herein.
In some embodiments, the recording the first time at which the countdown instruction is received includes: (1.1) recording the first time of receipt of the count down instruction in a variable of the data model.
The first time when the countdown instruction is received is recorded in the time recording variable of the formed data model, and then the first time is required to be used for reading from the time recording variable of the data model, so that the first time can be conveniently accessed.
In step 103, a countdown page associated with the countdown instruction is loaded.
Specifically, the countdown instruction carries data related to live broadcast activities initiated by the anchor user, and the audience client can obtain corresponding countdown pages for display according to the data loading.
The countdown page may be a page that displays a countdown message on the live interface to prompt the viewer. Specifically, the countdown page may be a live page after adding an icon (such as a lollipop, a tire, etc.) for identifying the countdown of the live event in the live interface, or a popup window for displaying the countdown of the live event in the live interface, or a floating layer for displaying the countdown of the live event in the live interface.
For example, as shown in fig. 3, the countdown page is to add a tire icon 201 for identifying the countdown of the live event in the live interface, and the countdown of the live event is displayed for 55s on the tire, which indicates that the live event is over for 55 s.
When the countdown page is a popup window or a floating layer, the popup window or the floating layer is displayed on the live interface and can shield the live interface, so that a viewer user can make the popup window or the floating layer disappear by clicking an X control, for example. In some embodiments, it may also be disappeared by clicking on a blank area outside of the popup or float.
In this embodiment, at least the remaining countdown duration is displayed on the countdown page. For example, "23s", "15s", "8s", etc. The end time of the live event may be known to the viewer user based on the displayed countdown remaining time.
In some embodiments, keywords for the live event may also be displayed on the live event countdown icon. For example, when the live event initiated by the anchor user is a commercial robbery, the viewer user sees the keyword "seconds kill" on the live event countdown icon in the live interface; when the live broadcast activity initiated by the anchor user is the popularity PK, the audience user sees the keyword 'popularity PK' on a live broadcast activity countdown icon in a live broadcast interface.
In step 104, a second time when the countdown page loading is complete is recorded.
In the embodiment of the application, the audience client records the time when the countdown page loading is completed as the second time. And obtaining the time length to be calibrated in the first time length according to the second time and the first time recorded before, wherein the time between the first time and the second time is the transition time of loading the countdown page, and the activity countdown in the server is still calculated during the period. For example, when the time of receiving the countdown instruction by the client of the audience is 10:01, that is, when the time of loading the countdown page is 10:02, calibration is needed for 1min in the first time, so that the first time after calibration is 5min-1 min=4 min, in the related art, if the part of transition time is not considered, the countdown time displayed on the client is different from the activity countdown in the server, so that the client of the audience cannot accurately participate reasonably according to the countdown time, the follow-up activity fails to participate, and inconvenience is brought to the user.
In step 105, the first time period is calibrated according to the difference between the second time period and the first time period to obtain a second time period.
The audience client takes time to load the countdown page associated with the countdown instruction after receiving the countdown instruction sent by the server, so that the first time and the second time saved before can be read, and the first time length carried in the countdown instruction is calibrated according to the difference value between the second time and the first time to obtain the second time length.
For example, the first duration in the countdown instruction received by the viewer client is 60s, the difference between the first time recorded when the countdown page starts to be loaded and the second time recorded when the loading is completed is 4s, that is, the countdown page loading duration is 4s, so the second duration=the first duration 60s—the countdown page loading duration is 4s, that is, the second duration obtained by calibrating the first duration is 56s.
In some embodiments, after calibrating the first time period according to the difference between the second time period and the first time period to obtain a second time period, the method further includes:
(1) Acquiring data transmission delay between the audience client and the server;
(2) And deducting the data transmission delay from the second time length to obtain a third time length.
The data transmission delay is the time required by the server to send a countdown instruction to the viewer client, and can also be understood as network delay time.
Specifically, in addition to taking time to load the countdown page, it takes time for the server to send the countdown instruction to the viewer client. Therefore, when the first time length in the countdown instruction is calibrated, the data transmission delay between the server and the audience client needs to be considered, so that the third time length is obtained by continuously deducting the data transmission delay from the obtained second time length, the accuracy of countdown in the countdown page of the audience client can be further increased, and the synchronism of countdown among different audience clients is further ensured.
For example, the first duration in the countdown instruction received by the viewer client is 60s, the difference between the first time recorded when the countdown page starts to be loaded and the second time recorded when the loading is completed is 4s, that is, the countdown page loading duration is 4s, so the second duration=the first duration 60s—the countdown page loading duration is 4s, that is, the second duration obtained by calibrating the first duration is 56s. In addition, the viewer client sends a delay detection data packet to the server, so that the data transmission delay between the viewer client and the server is 2s, and therefore the third duration=the second duration 56 s-the data transmission delay is 2s, that is, the third duration is 54s.
In some embodiments, the obtaining the data transfer delay between the viewer client and the server comprises:
(1.1) recording a third time of sending a delay detection data packet to the server;
(1.2) recording a fourth moment when a response data packet returned by the server in response to the delay detection data packet is received;
and (1.3) obtaining the data transmission delay according to the fourth moment and the third moment.
In order to obtain the data transmission delay, the viewer client may send a delay detection data packet to the server after obtaining the second time length, for testing the data transmission delay, specifically, recording that the sending time is a third time, after receiving the data packet, the server returns a response data packet, the viewer client records that the time when the response data packet is returned by the server in response to the delay detection data packet is a fourth time, and the difference between the fourth time and the third time is the back and forth data transmission delay between the viewer client and the server, so that the data transmission delay between the viewer client and the server is = (fourth time-third time)/2.
In some embodiments, the viewer client may continue to send latency detection packets multiple times to achieve a more accurate and stable data transfer latency between the viewer client and the server.
In step 106, the countdown page is controlled to start counting down according to the second duration.
After the second time length is obtained by calibrating the first time length carried in the countdown instruction according to the difference value between the second time length and the first time length, the countdown page displayed on the audience client starts to count down from the second time length, so that different audience clients corresponding to the same live broadcasting room can count down uniformly, synchronous modification between the client and the server is not needed, flow and processing procedures are saved, and accuracy and processing efficiency of live broadcasting countdown are greatly improved.
In some embodiments, the controlling the countdown page to start countdown according to the second duration includes:
(1) And controlling the countdown page to start countdown according to the third duration.
The audience client sends a delay detection data packet to the server on the basis of obtaining the second time length to obtain data transmission delay, and subtracts the obtained data transmission delay from the second time length to obtain the third time length, so that the countdown page is controlled to start counting down according to the obtained third time length, namely, the countdown page seen by the audience user on the live broadcast interface starts counting down from the third countdown, and therefore more accurate countdown time can be counted further.
In some embodiments, the countdown instruction further carries a link to a live active page, and the loading the countdown page associated with the countdown instruction includes:
(1.1) controlling the webpage component to load a corresponding page according to the link;
and (1.2) injecting a callback method into the webpage component so that the callback method is executed when the loading of the page corresponding to the link is completed, and acquiring a system timestamp as the second moment when the loading is completed in the callback method.
The method comprises the steps that a countdown instruction received by a viewer client side also carries a link corresponding to a live broadcast active page, the viewer client side can control a webpage component to load the corresponding page according to the link in the countdown instruction, a callback method is injected into the webpage component, the callback method is executed when the page corresponding to the link carried in the countdown instruction is loaded, and a system timestamp of the viewer client side is used as a second moment when the page in the callback method is loaded.
Specifically, after the page corresponding to the link is successfully loaded, the system carried by the audience client informs the audience client that the page is successfully loaded through a callback method, then the system judges that the callback method exists in the webpage component, and the callback method is executed to finally obtain a second moment. The system that the audience client carries according to the different terminal devices that exist is also different, for example, when the terminal device is a computer, the system may be Windows, linux, macOS or the like; when the terminal device is a mobile phone, the system may be Android (Android), iOS (apple), harmony os (hong mo), or the like.
In some embodiments, the controlling the countdown page to start countdown according to the second duration includes:
(2.1) transmitting the second time length to the webpage component through a preset interface, so that the webpage component controls the countdown page to start countdown according to the second time length.
And calibrating the first time, namely subtracting the obtained difference between the second time and the first time from the first time to obtain a second time. And transmitting the obtained second time length to the webpage component through a preset interface, so that the webpage component controls the countdown page to start countdown according to the second time length. Specifically, the predetermined interface may be, for example, a JS interface, an HTTP interface, a socket interface, or the like.
And obtaining the second time length according to the first time length carried in the countdown instruction and the loading time required by loading the page, so that the background is not required to be frequently refreshed, and the countdown consistency of the active pages in the live broadcast interfaces of different audience clients is ensured.
In some embodiments, the controlling the countdown page to start countdown according to the second duration includes:
(3.1) when the second duration is detected to exceed a predetermined range, obtaining a predefined loading duration associated with the spectator client, and controlling the countdown page to start countdown according to the predefined loading duration.
In an extreme case, there may be an illegal program (e.g., a plug-in) modifying the system timestamp, resulting in a second duration exception, thereby causing a countdown exception in the countdown page. Thus, for this to occur, when the second time period is detected to exceed the predetermined range, a predefined loading time period associated with the viewer client is obtained and the countdown page is controlled to begin counting down in accordance with the predefined loading time period.
The predefined loading duration may be the second duration using a conventional value, which may be, for example, the second duration in the last normal range, or may be calculated according to model data of the machine, or may be obtained by querying from a server according to the model of the machine, or the like. For example, if the second time length is abnormal, and the second time length obtained after the last countdown page loading is found to be 28s through detection, the countdown page starts to count down from 28 s. Therefore, the exception processing can be realized for the second time length for controlling the countdown of the countdown page, and the user experience is improved.
As can be seen from the above, the embodiment of the present application receives a countdown instruction sent by the server; wherein, the countdown instruction at least carries a first duration; recording a first moment when the countdown instruction is received; loading a countdown page associated with the countdown instruction; recording a second moment when the countdown page is loaded; calibrating the first time according to the difference between the second time and the first time to obtain a second time; and controlling the countdown page to start countdown according to the second time length. Therefore, the countdown time displayed by different clients is consistent by calibrating the countdown time, the accuracy of live broadcast countdown is improved, the problem of time error of the participation of the user in the activity is solved, and the satisfaction degree of the user on the live broadcast activity is improved.
Referring to fig. 4, fig. 4 is a timing diagram of a countdown control method according to an embodiment of the present application. The method flow may include:
in step S1, the anchor client initiates a live broadcast activity, and generates a corresponding countdown instruction according to the live broadcast activity, and sends the count down instruction to the server.
In step S2, the server receives the countdown instruction sent by the anchor client and forwards the countdown instruction to the viewer client.
In step S3, the viewer client receives a countdown instruction sent by the server.
In step S4, the viewer client records the first time at which the countdown instruction was received.
In step S5, the viewer client loads a countdown page associated with the countdown instruction.
In step S6, the viewer client records a second time when the countdown page load is complete.
In step S7, the viewer client calibrates the first time to obtain a second time according to a difference between the second time and the first time.
In step S8, the viewer client controls the countdown page to start counting down according to the second duration.
In the above embodiments, reference may be made to the above detailed description of the countdown control method, which is not repeated here.
In order to facilitate better implementation of the countdown control method provided by the embodiment of the application, the embodiment of the application also provides a device based on the countdown control method. Wherein the meaning of nouns is the same as in the countdown control method described above, specific implementation details can be referred to in the description of the method embodiments.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a countdown control device according to an embodiment of the present application, where the countdown control device is applied to a viewer client, and the countdown control device may include a receiving unit 301, a first recording unit 302, a loading unit 303, a second recording unit 304, a calibration unit 305, a control unit 306, and the like:
a receiving unit 301, configured to receive a countdown instruction sent by a server; wherein, the countdown instruction at least carries a first duration;
a first recording unit 302, configured to record a first time when the countdown instruction is received;
a loading unit 303, configured to load a countdown page associated with the countdown instruction;
a second recording unit 304, configured to record a second time when the countdown page is loaded;
a calibration unit 305, configured to calibrate the first time length according to a difference between the second time and the first time to obtain a second time length; and
and the control unit 306 is configured to control the countdown page to start countdown according to the second duration.
In some embodiments, the calibration unit 305 includes:
a transmission delay obtaining subunit, configured to obtain a data transmission delay between the client and the server;
A third duration determining subunit, configured to subtract the data transmission delay from the second duration to obtain a third duration;
the control unit 306 includes:
and the first control subunit is used for controlling the countdown page to start countdown according to the third duration.
In some embodiments, the transmission delay acquiring unit includes:
a third recording subunit, configured to record a third time when the delay detection packet is sent to the server;
a fourth recording subunit, configured to record a fourth time when a response data packet returned by the server in response to the delay detection data packet is received; and
and the transmission delay obtaining subunit is used for obtaining the data transmission delay according to the difference value between the fourth moment and the third moment.
In some embodiments, the countdown instruction further carries a link to a live active page, and the loading unit 303 includes:
the loading subunit is used for controlling the webpage component to load the corresponding page according to the link;
and the second recording subunit is used for injecting a callback method into the webpage component so as to execute the callback method when the loading of the page corresponding to the link is completed, and acquiring a system time stamp as the second moment when the loading is completed in the callback method.
In some embodiments, the control unit 306 includes:
and the second control subunit is used for transmitting the second time length to the webpage component through a preset interface, so that the webpage component controls the countdown page to start countdown according to the second time length.
In some embodiments, the countdown control device further comprises:
an instruction conversion unit for converting the countdown instruction into a predetermined data model;
the first recording unit 302 includes:
the first time at which the countdown instruction is received is recorded in a variable of the data model.
In some embodiments, the control unit 306 includes:
and the timeout subunit is used for acquiring a predefined loading time length associated with the audience client when the second time length is detected to exceed a preset range, and controlling the countdown page to start countdown according to the predefined loading time length.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the apparatus and modules described above may refer to the corresponding process in the foregoing method embodiment, which is not repeated herein.
In several embodiments provided herein, the coupling of the modules to each other may be electrical, mechanical, or other.
In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module. The integrated modules may be implemented in hardware or in software functional modules.
The embodiment of the present application further provides a computer device, which may be a terminal or a server, as shown in fig. 6, which shows a schematic structural diagram of the computer device according to the embodiment of the present invention, specifically:
the computer device may include one or more processors 401 of a processing core, memory 402 of one or more computer readable storage media, a power supply 403, and an input unit 404, among other components. Those skilled in the art will appreciate that the computer device structure shown in FIG. 6 is not limiting of the computer device and may include more or fewer components than shown, or may be combined with certain components, or a different arrangement of components. Wherein:
the processor 401 is a control center of the computer device, connects various parts of the entire computer device using various interfaces and lines, and performs various functions of the computer device and processes data by running or executing software programs and/or modules stored in the memory 402, and calling data stored in the memory 402, thereby performing overall monitoring of the computer device. Optionally, processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, an application program, etc., and the modem processor mainly processes wireless communication. It will be appreciated that the modem processor described above may not be integrated into the processor 401.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and data processing by executing the software programs and modules stored in the memory 402. The memory 402 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a recording function, a countdown function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the computer device, etc. In addition, memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
The computer device further comprises a power supply 403 for supplying power to the various components, preferably the power supply 403 may be logically connected to the processor 401 by a power management system, so that functions of charge, discharge, and power consumption management may be performed by the power management system. The power supply 403 may also include one or more of any of a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
The computer device may also include an input unit 404, which input unit 404 may be used to receive input numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the computer device may further include a display unit or the like, which is not described herein. In particular, in this embodiment, the processor 401 in the computer device loads executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 executes the application programs stored in the memory 402, so as to implement various functions as follows:
receiving a countdown instruction sent by a server; wherein, the countdown instruction at least carries a first duration; recording a first moment when the countdown instruction is received; loading a countdown page associated with the countdown instruction; recording a second moment when the countdown page is loaded; calibrating the first time according to the difference between the second time and the first time to obtain a second time; and controlling the countdown page to start countdown according to the second time length. Therefore, the countdown time displayed by different clients is consistent by calibrating the countdown time, the accuracy of live broadcast countdown is improved, and the satisfaction degree of a user on live broadcast activities is further improved.
In the foregoing embodiments, the descriptions of the embodiments are focused on, and the portions of an embodiment that are not described in detail in the foregoing embodiments may be referred to in the foregoing detailed description of the countdown control method, which is not repeated herein.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present application provide a computer storage medium having stored therein a plurality of instructions capable of being loaded by a processor to perform the steps of any of the countdown control methods provided by embodiments of the present application.
According to one aspect of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the methods provided in the various alternative implementations provided in the above embodiments.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Wherein the computer storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
Because the instructions stored in the computer storage medium may execute the steps in any countdown control method provided in the embodiments of the present application, the beneficial effects that any countdown control method provided in the embodiments of the present application may be achieved, which are detailed in the previous embodiments and are not described herein.
The foregoing describes in detail a countdown control method, apparatus, storage medium and computer device provided in the embodiments of the present application, and specific examples are applied herein to illustrate the principles and embodiments of the present application, where the foregoing description of the embodiments is only for helping to understand the method and core ideas of the present application; meanwhile, those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, and the present description should not be construed as limiting the present application in view of the above.

Claims (10)

1. A countdown control method applied to a viewer client, comprising:
receiving a countdown instruction sent by a server; the countdown instruction is generated by a host client according to the countdown of the live broadcast activity initiated by the host client, and the first time is the total time corresponding to the countdown of the original live broadcast activity of the live broadcast activity;
recording a first moment when the countdown instruction is received;
loading a countdown page associated with the countdown instruction;
recording a second moment when the countdown page is loaded;
calibrating the first time according to the difference between the second time and the first time to obtain a second time; and
and controlling the countdown page to start countdown according to the second duration.
2. The countdown control method of claim 1, wherein the calibrating the first time period based on the difference between the second time period and the first time period further comprises:
acquiring data transmission delay between the audience client and the server;
deducting the data transmission delay from the second time length to obtain a third time length;
The step of controlling the countdown page to start countdown according to the second duration includes:
and controlling the countdown page to start countdown according to the third duration.
3. The countdown control method of claim 2, wherein said obtaining a data transmission delay between said viewer client and said server comprises:
recording a third moment of sending a delay detection data packet to the server;
recording a fourth moment when a response data packet returned by the server in response to the delay detection data packet is received; and
and obtaining the data transmission delay according to the fourth moment and the third moment.
4. The countdown control method of claim 1, wherein the countdown instruction further carries a link to a live active page, and the loading the countdown page associated with the countdown instruction comprises:
the control webpage component loads a corresponding page according to the link; and
and injecting a callback method into the webpage component so that the callback method is executed when the loading of the page corresponding to the link is completed, and acquiring a system timestamp as the second moment when the loading is completed in the callback method.
5. The countdown control method of claim 4, wherein said controlling the countdown page to begin countdown according to the second duration comprises:
and transmitting the second time length to the webpage component through a preset interface, so that the webpage component controls the countdown page to start countdown according to the second time length.
6. The countdown control method of claim 1, wherein the recording further comprises, prior to the first time at which the countdown instruction is received:
forming a preset data model according to the countdown instruction;
the recording the first moment when the countdown instruction is received includes:
recording a first moment of receiving the countdown instruction in a variable of the data model.
7. The countdown control method according to claim 1, wherein the controlling the countdown page to start the countdown according to the second duration comprises:
and when the second time length is detected to exceed a preset range, acquiring a predefined loading time length associated with the audience client, and controlling the countdown page to start countdown according to the predefined loading time length.
8. A countdown control device, comprising:
the receiving unit is used for receiving the countdown instruction sent by the server; the countdown instruction is generated by a host client according to the countdown of the live broadcast activity initiated by the host client, and the first time is the total time corresponding to the countdown of the original live broadcast activity of the live broadcast activity;
the first recording unit is used for recording a first moment when the countdown instruction is received;
the loading unit is used for loading the countdown page associated with the countdown instruction;
the second recording unit is used for recording a second moment when the countdown page is loaded;
the calibration unit is used for calibrating the first time length according to the difference value between the second time and the first time to obtain a second time length; and
and the control unit is used for controlling the countdown page to start countdown according to the second duration.
9. A computer readable storage medium, characterized in that the storage medium stores a plurality of instructions adapted to be loaded by a processor for performing the steps of the countdown control method of any of claims 1 to 7.
10. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the countdown control method of any of claims 1 to 7 when the computer program is executed.
CN202111295949.5A 2021-11-03 2021-11-03 Countdown control method and device, storage medium and computer equipment Active CN114222148B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111295949.5A CN114222148B (en) 2021-11-03 2021-11-03 Countdown control method and device, storage medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111295949.5A CN114222148B (en) 2021-11-03 2021-11-03 Countdown control method and device, storage medium and computer equipment

Publications (2)

Publication Number Publication Date
CN114222148A CN114222148A (en) 2022-03-22
CN114222148B true CN114222148B (en) 2024-03-01

Family

ID=80695631

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111295949.5A Active CN114222148B (en) 2021-11-03 2021-11-03 Countdown control method and device, storage medium and computer equipment

Country Status (1)

Country Link
CN (1) CN114222148B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103645978A (en) * 2013-12-16 2014-03-19 百度在线网络技术(北京)有限公司 Method, device and system for testing browser webpage loading time
CN103841199A (en) * 2014-03-10 2014-06-04 飞天诚信科技股份有限公司 Method for achieving counting down of browser
CN105487960A (en) * 2015-12-28 2016-04-13 北京大学 Mobile terminal APP loading energy consumption automatic measurement method based on physical actual measurement
CN107203629A (en) * 2017-05-31 2017-09-26 北京京东尚科信息技术有限公司 Page rendering method, system and device
CN111159612A (en) * 2019-12-27 2020-05-15 广州华多网络科技有限公司 Countdown method, system, device, computer equipment and storage medium
WO2021004527A1 (en) * 2019-07-10 2021-01-14 华为技术有限公司 Countdown display method and electronic device
CN113268183A (en) * 2021-05-21 2021-08-17 北京自如信息科技有限公司 List page countdown display method and device
CN113312119A (en) * 2021-06-04 2021-08-27 广州博冠信息科技有限公司 Information synchronization method and device, computer readable storage medium and electronic equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7536319B2 (en) * 2007-10-10 2009-05-19 Oracle International Corporation Method, system, and computer medium for dynamically counting down to an online auction end time

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103645978A (en) * 2013-12-16 2014-03-19 百度在线网络技术(北京)有限公司 Method, device and system for testing browser webpage loading time
CN103841199A (en) * 2014-03-10 2014-06-04 飞天诚信科技股份有限公司 Method for achieving counting down of browser
CN105487960A (en) * 2015-12-28 2016-04-13 北京大学 Mobile terminal APP loading energy consumption automatic measurement method based on physical actual measurement
CN107203629A (en) * 2017-05-31 2017-09-26 北京京东尚科信息技术有限公司 Page rendering method, system and device
WO2021004527A1 (en) * 2019-07-10 2021-01-14 华为技术有限公司 Countdown display method and electronic device
CN111159612A (en) * 2019-12-27 2020-05-15 广州华多网络科技有限公司 Countdown method, system, device, computer equipment and storage medium
CN113268183A (en) * 2021-05-21 2021-08-17 北京自如信息科技有限公司 List page countdown display method and device
CN113312119A (en) * 2021-06-04 2021-08-27 广州博冠信息科技有限公司 Information synchronization method and device, computer readable storage medium and electronic equipment

Also Published As

Publication number Publication date
CN114222148A (en) 2022-03-22

Similar Documents

Publication Publication Date Title
CN108156507B (en) Virtual article presenting method, device and storage medium
CN110830735B (en) Video generation method and device, computer equipment and storage medium
US20120309540A1 (en) Game notification systems and methods
CN113058270A (en) Live broadcast interaction method and device, storage medium and electronic equipment
CN110784752A (en) Video interaction method and device, computer equipment and storage medium
WO2018196733A1 (en) Data sharing method and device, storage medium and electronic device
WO2014183427A1 (en) Method and apparatus for displaying webcast rooms
US20230071173A1 (en) Method for interacting in live streaming and electronic device
CN106604100B (en) Live broadcast platform interaction method and device
CN110166788A (en) Synchronizing information playback method, device and storage medium
US20170279748A1 (en) Information processing method and terminal, and computer storage medium
CN111625353B (en) Virtual resource distribution processing method, device, server and storage medium
CN110602543A (en) Method and apparatus for displaying material, storage medium, and electronic apparatus
CN111901695B (en) Video content interception method, device and equipment and computer storage medium
CN110457229A (en) Game performance monitoring method, device, electronic equipment and storage medium
CN108174267A (en) The sending device of interactive information, method and computer readable storage medium in live streaming
CN111669658B (en) Virtual article issuing method and device, computer equipment and storage medium
CN108174227B (en) Virtual article display method and device and storage medium
CN114268810B (en) Live video display method, system, equipment and storage medium
CN105744338B (en) A kind of method for processing video frequency and its equipment
CN108415908A (en) A kind of processing method and server of multi-medium data
CN114222148B (en) Countdown control method and device, storage medium and computer equipment
CN113312237A (en) Information feedback method and device, electronic equipment and storage medium
CN109388737A (en) A kind of sending method, device and the storage medium of the exposure data of content item
CN110286954A (en) A kind of the starting method, apparatus and storage medium of application program

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