CN114222148A - Countdown control method and device, storage medium and computer equipment - Google Patents
Countdown control method and device, storage medium and computer equipment Download PDFInfo
- Publication number
- CN114222148A CN114222148A CN202111295949.5A CN202111295949A CN114222148A CN 114222148 A CN114222148 A CN 114222148A CN 202111295949 A CN202111295949 A CN 202111295949A CN 114222148 A CN114222148 A CN 114222148A
- Authority
- CN
- China
- Prior art keywords
- countdown
- time
- page
- instruction
- time length
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 69
- 230000000694 effects Effects 0.000 claims abstract description 56
- 230000005540 biological transmission Effects 0.000 claims description 32
- 238000001514 detection method Methods 0.000 claims description 15
- 238000013499 data model Methods 0.000 claims description 13
- 230000004044 response Effects 0.000 claims description 11
- 238000004590 computer program Methods 0.000 claims description 8
- 238000010586 diagram Methods 0.000 description 8
- 230000008569 process Effects 0.000 description 8
- 230000006870 function Effects 0.000 description 7
- 238000012545 processing Methods 0.000 description 6
- 238000007667 floating Methods 0.000 description 5
- 238000006243 chemical reaction Methods 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 230000008878 coupling Effects 0.000 description 2
- 238000010168 coupling process Methods 0.000 description 2
- 238000005859 coupling reaction Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000007704 transition Effects 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000001934 delay Effects 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 235000011475 lollipops Nutrition 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/21—Server components or server architectures
- H04N21/218—Source of audio or video content, e.g. local disk arrays
- H04N21/2187—Live feed
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/85—Assembly of content; Generation of multimedia applications
- H04N21/854—Content authoring
- H04N21/8547—Content authoring involving timestamps for synchronizing content
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Computer Security & Cryptography (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The embodiment of the application discloses a countdown control method and device, a storage medium and computer equipment. The method comprises the steps of receiving a countdown instruction sent by a server; the countdown instruction at least carries a first duration; recording a first time 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 length according to the difference value between the second time and the first time to obtain a second time length; and controlling the countdown page to start countdown according to the second time length. Therefore, the countdown time is calibrated to enable the countdown displayed by different clients to be consistent, the accuracy of live broadcast countdown is improved, and the satisfaction degree of a user on live broadcast activities is improved.
Description
Technical Field
The present application relates to the field of live webcasting technologies, and in particular, to a countdown control method, apparatus, storage medium, and computer device.
Background
Nowadays, the live broadcast industry develops better and better, and watching the live broadcast on the internet gradually becomes a part of daily entertainment consumption of people. In the live broadcast process, related live broadcast activities, such as popularity, delivery promotion and the like, are added for enhancing interactivity with audiences, the live broadcast activities are always started in a limited time for increasing the enthusiasm of users to participate in the live broadcast activities, and the remaining time of the live broadcast activities, namely the countdown, is displayed on a live broadcast interface for further increasing the tension of the users to participate in the live broadcast activities.
In the research and practice processes of the prior art, the inventor of the application finds that in the prior art, due to the fact that the loading time of live activity components cannot be known in advance due to the fact that the network speed of the client used by users is different, the live activity countdown seen by each user is possibly different, the live activity countdown time is wrong, and the experience of the users participating in live activities is poor.
Disclosure of Invention
In view of the above problems, the present application provides a countdown control method, apparatus, storage medium and computer device, which can improve accuracy of live countdown.
In order to solve the above technical problem, an embodiment of the present application provides the following technical solutions:
a countdown control method, comprising:
receiving a countdown instruction sent by a server; the countdown instruction at least carries a first duration;
recording a first time 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 length according to the difference value between the second time and the first time to obtain a second time length; and
and controlling the countdown page to start countdown according to the second time length.
A countdown control device, comprising:
the receiving unit is used for receiving a countdown instruction sent by the server; 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;
a load unit to load a 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 time length.
In some embodiments, the countdown control device further includes:
a transmission delay acquiring unit, configured to acquire a data transmission delay between the viewer client and the server;
a third duration determining subunit, configured to deduct 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 time length.
In some embodiments, the transmission delay obtaining unit includes:
a third recording subunit, configured to record a third time at which 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 configured to obtain the data transmission delay according to a difference between the fourth time and the third time.
In some embodiments, the countdown instruction further carries a link to a live activity 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 page corresponding to the link is loaded, and acquiring a system timestamp as the second moment when the page is loaded 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 includes:
an instruction conversion unit for converting the countdown instruction into a predetermined data model;
the first recording unit includes:
recording a first time at which the countdown instruction is received in a variable of the data model.
In some embodiments, the control unit comprises:
and the timeout subunit is configured to, when it is detected that the second duration exceeds the predetermined range, acquire a predefined loading duration associated with the viewer client, and control the countdown page to start countdown according to the predefined loading duration.
A computer storage medium having stored thereon a plurality of instructions adapted to be loaded by a processor for performing the steps of the countdown control method.
A computer device comprising a memory, a processor and a computer program stored in said memory and executable on said processor, said processor implementing the steps of the countdown control method provided above when executing said computer program.
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 the computer device, and the computer instructions are executed by the processor, so that the computer device executes the steps of the countdown control method provided by the above.
The method comprises the steps of receiving a countdown instruction sent by a server; the countdown instruction at least carries a first duration; recording a first time 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 length according to the difference value between the second time and the first time to obtain a second time length; and controlling the countdown page to start countdown according to the second time length. Therefore, the countdown time is calibrated to enable the countdown displayed by different clients to be consistent, the accuracy of live countdown is improved, and the satisfaction degree of a user on live activities is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic view of a countdown control system provided in an embodiment of the present application;
fig. 2 is a schematic flowchart 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 illustrating a countdown control method according to 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 application;
fig. 6 is a schematic structural diagram of a computer device provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a countdown control method and device, a storage medium and computer equipment.
Referring to fig. 1, fig. 1 is a schematic view of a countdown control system according to an embodiment of the present application, including: an anchor client a, a server B and a viewer client C. The anchor client A, the server B and the audience client C can carry out information interaction through a network. The Network is typically the Internet, but may be any Network including, but not limited to, a Local Area Network (LAN), a Metropolitan Area Network (MAN), a Wide Area Network (WAN), a mobile, wireline or wireless Network, a private Network, or any combination of virtual private networks. In some embodiments, the viewer client a, the viewer client B and the server may communicate via a specific communication protocol, which includes but is not limited to BLE (Bluetooth low energy) protocol, WLAN (Wireless Local Area Network) protocol, Bluetooth protocol, ZigBee (ZigBee) protocol, Wi-Fi (Wireless Fidelity) protocol, etc. The network includes network entities such as routers, gateways, etc., which are not shown in the figure.
In an embodiment of the present application, the countdown control system may further include a countdown control device. The countdown control device can be specifically integrated in a terminal with computing capability, such as a tablet computer, a mobile phone, a notebook computer, a desktop computer and the like, which is provided with a storage unit and a microprocessor, 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 an anchor client a and a viewer client C.
In the embodiment of the application, the server B may store a corresponding relationship between the anchor client a and each live broadcast room, and after the viewer client C selects a live broadcast room, the server B sends a live broadcast video stream corresponding to the anchor client a to all the viewer clients C belonging to the same live broadcast room according to the corresponding relationship between each live broadcast room and the anchor client a. The server B may refer to an individual server or a server cluster; the server can be a local server or a cloud server.
In fig. 1, an anchor 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 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 live broadcast room of the anchor client A loads a countdown page according to the received countdown instruction and controls the countdown page to start countdown according to the countdown time.
Specifically, the viewer client C may be configured to receive a countdown instruction sent by the server B; wherein, 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 length according to the difference value between the second time and the first time to obtain a second time length; and controlling the countdown page to start countdown according to the second time length.
It should be noted that the scenario diagram of the countdown control system shown in fig. 1 is only an example, and the countdown control system and the scenario described in the embodiment of the present application are for more clearly illustrating the technical solution of the embodiment of the present application, and do not form a limitation on the technical solution provided in the embodiment of the present application, and it is known by a person skilled in the art that the technical solution provided in the embodiment of the present application is also applicable to similar technical problems with the evolution of the countdown control system and the occurrence of new service scenarios.
The following are detailed below.
In the present embodiment, description will be made from the viewpoint of a countdown control device, which may be specifically integrated in a server.
Referring to fig. 2, fig. 2 is a flowchart illustrating 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 an embodiment of the present application, the viewer client may receive a 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 which is watching currently or is qualified to participate in the activity, so that the countdown of the live broadcast activity initiated by the anchor client can be displayed on the follow-up audience client.
The audience client displays live broadcast activity countdown on a live broadcast interface of a live broadcast room after receiving a countdown instruction, wherein the live broadcast activity countdown is the countdown of live broadcast activity initiated by an anchor user on the anchor client, and therefore the countdown instruction at least carries the total time length corresponding to the countdown of the original live broadcast activity of the live broadcast activity, namely the first time length.
Further, in order to enable the live broadcast activity displayed on the live broadcast interface to be initiated by the anchor user of the live broadcast room initiating the activity, rather than displaying the live broadcast activity initiated by the anchor user of other live broadcast rooms, the countdown instruction may also carry an identifier of the anchor client corresponding to the live broadcast room.
The audience client can enter a live broadcast room corresponding to any anchor client, and the audience client can watch live broadcast contents, such as talent show, game live broadcast, promotion with goods and the like, of the anchor client corresponding to the live broadcast room. The audience users can interact with the anchor user through the audience client according to the live content of the anchor user, for example, the live content of the anchor user can be evaluated by launching a bullet screen, and various live activities initiated by the anchor user in the live broadcasting process can also be participated in.
The live broadcast activity initiated by the anchor user may be, for example, a lottery, a popularity match with other anchor users, a game win-or-lose prediction, and the like. To better motivate audience users' desire to participate in live events, these live events set a live event countdown. For example, it may be 2 hours, 5 minutes, or the like. The specific live event countdown anchor user can be set according to actual live events, for example, when more audience users exist in a live broadcast room or the content of live events is novel, in order to increase the enthusiasm and tension of the audience users in participating in the events, 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 reason why the countdown display of the live broadcast activity at the spectator client is inconsistent is that the countdown instruction is sent to the spectator client from the server, the spectator client displays various delays, such as network delay, during the countdown of the live broadcast activity according to the received countdown instruction, but the delay duration caused by the delay is not considered when the spectator client counts down the live broadcast activity displayed after receiving the countdown instruction, and the countdown is started from the initial live broadcast activity countdown, so that the remaining countdown duration of the live broadcast activity displayed at the spectator client is longer than the actual remaining countdown duration of the live broadcast activity, namely the remaining countdown duration of the live broadcast activity displayed at the anchor client. And because the delay conditions of different audience clients may be different, the countdown of the live broadcast activities displayed by different audience clients is inconsistent, the countdown time of the live broadcast activities displayed by different audience clients is wrong, the normal handling of the activities is influenced, and the experience of the user participating in the live broadcast activities is poor.
Illustratively, audience user A and audience user B are in the same live room with a correct live activity countdown of 23 seconds(s), but since the delay is not calibrated, audience user A uses audience client A to display the remaining 29s of live activity countdown in the live room on viewer client B, and audience user B uses the remaining 25s of live activity countdown in the live room on viewer client B.
In step 102, a first time at which the countdown instruction is received is recorded.
In the 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 options, such as a file, a database, a network, and the like. After the countdown instruction is received, the countdown page starts to be loaded according to the instruction, so that the first time is the time when the audience client side starts to load the countdown page, and then the loading duration of the countdown page on the audience client side can be obtained according to the recorded time when the audience client side starts to load and the time when the audience client side finishes loading.
In some embodiments, before the recording receives the first time of the countdown instruction, the recording further includes:
(1) a predetermined data pattern is formed based on the countdown instructions.
The audience client converts the relevant data carried in the received countdown instruction into a preset data model according to the received countdown instruction. Relevant data in the countdown instruction may include live event identification, live event content, live event countdown, and the like.
Since the first time length in the countdown instruction needs to be calibrated and a plurality of time data need to be recorded, a single time recording variable can be created in the formed data model to record the time data needed for calibrating the first time length in order to conveniently access 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, or the like), or a mesh model (connection command, pointer, or the like). In this embodiment, the predetermined data model formed according to the countdown instruction may be selected according to the need, and is not limited herein.
In some embodiments, the recording a first time at which the countdown instruction is received includes: (1.1) recording a first time of receiving the countdown instruction in a variable of the data model.
The first moment when the countdown instruction is received is recorded into the time record variable of the formed data model, and then the first moment can be read from the time record variable of the data model if the first moment is needed, so that the convenient access to the first moment can be realized.
In step 103, a countdown page associated with the countdown instruction is loaded.
Specifically, the countdown instruction carries data related to a live broadcast activity initiated by the anchor user, and the viewer client may obtain a corresponding countdown page 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 user. Specifically, the countdown page may be a live broadcast page in which an icon (e.g., lollipop, tire, etc.) for identifying the countdown of the live broadcast activity is added to the live broadcast interface, a popup window for displaying the countdown of the live broadcast activity on the live broadcast interface, or a floating layer for displaying the countdown of the live broadcast activity on the live broadcast interface.
For example, as shown in fig. 3, the countdown page is a tire icon 201 added to the live event interface for identifying the countdown of the live event, and the display of the countdown 55s of the live event on the tire indicates that the live event has ended 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 broadcast interface and can block the live broadcast interface, so that the viewer user can make the popup window or the floating layer disappear by clicking an 'x' control, for example. In some embodiments, the blank area other than the pop-up window or the floating layer may also be disappeared by clicking on it.
In this embodiment, at least the countdown remaining time length is displayed on the countdown page. For example, "23 s", "15 s", "8 s", etc. The viewer user can know the end time of the live event based on the displayed countdown remaining time.
In some implementations, keywords for the live event can also be displayed on the live event countdown icon. For example, when the live event initiated by the anchor user is a product purchase, the viewer user sees the keyword "kill of seconds" on the live event countdown icon in the live interface; when the live event initiated by the anchor user is popularity PK, the viewer user sees the keyword "popularity PK" on the live event countdown icon in the live broadcast interface.
In step 104, a second time when the countdown page load is complete is recorded.
In this embodiment of the present application, the viewer client records the time when the countdown page is completely loaded as the second time. And obtaining the time length needing to be calibrated in the first time length according to the second time and the previously recorded first time, wherein the time between the first time and the second time is the transition time of loading the countdown page, and during the time, the activity countdown in the server is still calculated. For example, if the first time when the spectator client receives the countdown instruction is 10:01, and the second time when the countdown page is loaded is 10:02, the first time needs to be calibrated for 1min, so that the calibrated first time is 5min-1 min-4 min, and in the related art, if the transition time is not considered, the countdown time displayed on the client is different from the activity countdown in the server, so that the spectator client cannot accurately participate reasonably according to the countdown time, subsequent activity participation failure is caused, and inconvenience is brought to the user.
In step 105, the first time length is calibrated according to a difference between the second time and the first time to obtain a second time length.
The audience client needs to spend time for loading the countdown page related to the countdown instruction after receiving the countdown instruction sent by the server, so that the first time and the second time which are saved before can be read, and the first time carried in the countdown instruction is calibrated according to the difference between the second time and the first time so as to obtain the second time.
For example, the first duration in the countdown instruction received by the viewer client is 60s, and 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 that the second duration is 60s for the first duration-4 s for the countdown page loading duration, that is, the second duration obtained by calibrating the first duration is 56 s.
In some embodiments, after calibrating the first duration according to the difference between the second time and the first time to obtain the second duration, the method further comprises:
(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 for the server to send the countdown instruction to the viewer client, and can also be understood as network delay time.
In particular, in addition to the time it takes to load the countdown page, the server sends the countdown instructions to the viewer client as well as the time it takes. Therefore, the data transmission delay between the server and the audience client needs to be considered when calibrating the first time length in the countdown instruction, 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 improved, and the synchronization of countdown between different audience clients is further ensured.
For example, the first duration in the countdown instruction received by the viewer client is 60s, and 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 that the second duration is 60s for the first duration-4 s for the countdown page loading duration, that is, the second duration obtained by calibrating the first duration is 56 s. In addition, the spectator client sends the delay detection packet to the server, so that the data transmission delay between the spectator client and the server is 2s, and therefore the third time length is the second time length 56s — the data transmission delay 2s, that is, the third time length is 54 s.
In some embodiments, the obtaining the data transmission delay between the viewer client and the server includes:
(1.1) recording a third moment of sending the delay detection data packet to the server;
(1.2) recording a fourth moment of receiving a response data packet returned by the server in response to the delay detection data packet;
and (1.3) obtaining the data transmission delay according to the fourth time and the third time.
In order to obtain the data transmission delay, the spectator client may send a delay detection data packet to the server after obtaining the second duration, where the delay detection data packet is used to test the data transmission delay, specifically, the sending time is recorded as a third time, the server returns a response data packet after receiving the data packet, the spectator client records the time when the server returns the response data packet in response to the delay detection data packet as a fourth time, and a difference between the fourth time and the third time is a round-trip data transmission delay between the spectator client and the server, so that the data transmission delay between the spectator client and the server is (the fourth time-the third time)/2.
In some embodiments, the viewer client may continuously transmit the delay detection packet for multiple times to obtain more accurate and stable data transmission delay 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 first time length carried in the countdown instruction is calibrated according to the difference value between the second time and the first time length to obtain the second time length, the countdown page displayed on the audience client starts to count down from the second time length, so that the countdown time can be unified for different audience clients corresponding to the same live broadcast room, the synchronization modification between the countdown page and the server is not needed, the flow and the processing process are saved, and the accuracy and the processing efficiency of the live broadcast countdown are greatly improved.
In some embodiments, the controlling the countdown page to begin counting down according to the second duration includes:
(1) and controlling the countdown page to start countdown according to the third time length.
The audience client sends the delay detection data packet to the server on the basis of obtaining the second time length to obtain data transmission delay, and the obtained data transmission delay is subtracted from the second time length to obtain a 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 further counted.
In some embodiments, the countdown instruction further carries a link to a live activity page, and the loading the countdown page associated with the countdown instruction includes:
(1.1) controlling a webpage component to load a corresponding page according to the link;
(1.2) injecting a callback method into the webpage component so that the callback method is executed when the page corresponding to the link is loaded, and acquiring a system timestamp when the page is loaded in the callback method as the second moment.
The countdown instruction received by the viewer client also carries a link corresponding to the live activity page, the viewer client can control the webpage component to load the corresponding page according to the link in the countdown instruction, a callback method is injected into the webpage component, so that the page corresponding to the link carried in the countdown instruction executes the callback method when the page is loaded, and a system timestamp of the viewer client when the page in the callback method is loaded is taken as a second moment.
Specifically, the system carried by the viewer client notifies the viewer client of successful page loading through a callback method after the page corresponding to the link is successfully loaded, and then the system judges that the callback method exists in the webpage component, and executes the callback method to finally obtain the second moment. The audience client side is different according to different systems carried by the existing terminal equipment, for example, when the terminal equipment is a computer, the system can be Windows, Linux, MacOS, and the like; when the terminal device is a mobile phone, the system may be Android (Android), iOS (apple), harmony os (hong meng), or the like.
In some embodiments, the controlling the countdown page to begin counting down according to the second duration includes:
and (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 length by the difference between the second time and the first time when the countdown instruction is received, which is obtained by the callback method, namely subtracting the obtained difference between the second time and the first time from the first time length to obtain the second time length. 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 a second duration according to the first duration carried in the countdown instruction and the loading time required by loading the page, so that frequent refreshing of a background is not required, 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 begin counting down according to the second duration includes:
(3.1) when the second duration is detected to exceed the preset range, acquiring a predefined loading duration associated with the audience client, and controlling the countdown page to start countdown according to the predefined loading duration.
In extreme cases, there may be an illegal program (e.g., a plug-in) that modifies the system timestamp, causing a second duration exception, thereby causing a countdown exception in the countdown page. Thus, for this to occur, when it is detected that the second length of time exceeds the predetermined range, a predefined load length of time associated with the viewer client is obtained and the countdown page is controlled to begin counting down according to the predefined load length of time.
The predefined loading duration may be a routine value as the second duration, and the routine value may be, for example, the second duration in the last normal range, or may be derived according to model data of the machine, or may be obtained by querying from the server according to the model of the machine. For example, if the second duration is abnormal, the second duration obtained after the last countdown page is loaded is detected to be 28s, and the countdown of the current countdown page is started from 28 s. Therefore, exception handling can be performed on the second time length for controlling countdown of the page, and user experience is improved.
As can be seen from the above, in the embodiment of the present application, a countdown instruction sent by a server is received; wherein, the countdown instruction at least carries a first duration; recording a first time 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 length according to the difference value between the second time and the first time to obtain a second time length; and controlling the countdown page to start countdown according to the second time length. Therefore, the countdown time is calibrated to enable the countdown displayed by different clients to be consistent, the accuracy of live countdown is improved, the problem of time error of user participation is solved, and the satisfaction degree of the user on live activities is improved.
Referring to fig. 4, fig. 4 is a timing diagram illustrating a countdown control method according to an embodiment of the present application. The method flow can comprise the following steps:
in step S1, the anchor client initiates a live activity, and generates a corresponding countdown instruction according to the live activity and sends the countdown 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 the countdown instruction transmitted by the server.
In step S4, the viewer client records the first time the countdown instruction was received.
In step S5, the viewer client loads the countdown page associated with the countdown instruction.
In step S6, the viewer client records a second time when the countdown page loading is complete.
In step S7, the viewer client calibrates the first duration to obtain a second duration according to the 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 described herein again.
In order to better implement the countdown control method provided by the embodiments of the present application, the embodiments of the present application further provide a device based on the countdown control method. Wherein the meaning of the noun is the same as that in the countdown control method, and the details of the implementation can refer to the description in the method embodiment.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a countdown control device applied to a viewer client according to an embodiment of the present disclosure, where 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, and a control unit 306:
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 load 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 completes loading;
a calibration unit 305, configured to calibrate the first time duration to obtain a second time duration according to a difference between the second time and the first time; and
the control unit 306 is configured to control the countdown page to start counting down according to the second duration.
In some embodiments, the calibration unit 305 includes:
a transmission delay acquiring subunit, configured to acquire a data transmission delay between the viewer client and the server;
a third duration determining subunit, configured to deduct 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 time length.
In some embodiments, the transmission delay obtaining unit includes:
a third recording subunit, configured to record a third time at which 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 configured to obtain the data transmission delay according to a difference between the fourth time and the third time.
In some embodiments, the countdown instruction further carries a link to a live activity 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 page corresponding to the link is loaded, and acquiring a system timestamp as the second moment when the page is loaded 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 includes:
an instruction conversion unit for converting the countdown instruction into a predetermined data model;
the first recording unit 302 includes:
the first time 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 configured to, when it is detected that the second duration exceeds the predetermined range, acquire a predefined loading duration associated with the viewer client, and control the countdown page to start countdown according to the predefined loading duration.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and modules may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, the coupling between the modules may be electrical, mechanical or other type of coupling.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
An embodiment of the present application further provides a computer device, where the computer device may be a terminal or a server, as shown in fig. 6, which shows a schematic structural diagram of a computer device according to an embodiment of the present invention, specifically:
the computer device may include components such as a processor 401 of one or more processing cores, memory 402 of one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that the computer device configuration illustrated in FIG. 6 does not constitute a limitation of computer devices, and may include more or fewer components than those illustrated, or some components may be combined, 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 monitoring the computer device as a whole. Optionally, processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. 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 operating the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function (such as a recording function, a countdown function, etc.), and the like; the storage data area may store data created according to use of the computer device, and the like. Further, the 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 access to the memory 402.
The computer device further comprises a power supply 403 for supplying power to the various components, and preferably, the power supply 403 is logically connected to the processor 401 via a power management system, so that functions of managing charging, discharging, and power consumption are implemented via the power management system. The power supply 403 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
The computer device may also include an input unit 404, the input unit 404 being operable 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 and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 401 in the computer device loads the executable file corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 401 runs the application programs stored in the memory 402, thereby implementing 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 time 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 length according to the difference value between the second time and the first time to obtain a second time length; and controlling the countdown page to start countdown according to the second time length. Therefore, the countdown time is calibrated to enable the countdown displayed by different clients to be consistent, the accuracy of live broadcast countdown is improved, and the satisfaction degree of a user on live broadcast activities is improved.
In the above embodiments, the descriptions of the embodiments have respective emphasis, and a part which is not described in detail in a certain embodiment may refer to the above detailed description of the countdown control method, and is not described herein again.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, the present application provides a computer storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any one of the countdown control methods provided in the present application.
According to an aspect of the application, a computer program product or computer program is provided, comprising computer instructions, the computer instructions being 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 to cause the computer device to perform the method provided in the various alternative implementations provided by the embodiments described above.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the computer storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the computer storage medium may execute the steps in any one of the countdown control methods provided in the embodiments of the present application, beneficial effects that can be achieved by any one of the countdown control methods provided in the embodiments of the present application may be achieved, which are detailed in the foregoing embodiments and will not be described herein again.
The countdown control method, apparatus, storage medium and computer device provided in the embodiments of the present application are introduced in detail, and a specific example is applied in the present application to explain the principle and the implementation of the present application, and the description of the embodiments is only used to help understand the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.
Claims (10)
1. A countdown control method for use in a viewer client, comprising:
receiving a countdown instruction sent by a server; the countdown instruction at least carries a first duration;
recording a first time 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 length according to the difference value between the second time and the first time to obtain a second time length; and
and controlling the countdown page to start countdown according to the second time length.
2. The countdown control method of claim 1 wherein, after calibrating the first duration according to the difference between the second time and the first time to obtain a second duration, further comprising:
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 controlling the countdown page to start counting down according to the second duration includes:
and controlling the countdown page to start countdown according to the third time length.
3. The countdown control method of claim 2 wherein the obtaining of the data transmission delay between the viewer client and the server comprises:
recording a third moment of sending a delay detection data packet to the server;
recording a fourth moment of receiving a response data packet returned by the server in response to the delay detection data packet; and
and obtaining data transmission delay according to the fourth time and the third time.
4. The countdown control method of claim 1, wherein the countdown instruction further carries a link to a live activity page, and the loading the countdown page associated with the countdown instruction comprises:
controlling a webpage component to load a corresponding page according to the link; and
and injecting a callback method into the webpage component so as to execute the callback method when the page corresponding to the link is loaded, wherein a system timestamp when the page is loaded is acquired in the callback method and is used as the second moment.
5. The countdown control method of claim 4 wherein said controlling the countdown page to begin counting down 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 method of claim 1 wherein prior to the recording of the first time that the countdown instruction is received, further comprising:
forming a preset data model according to the countdown instruction;
the recording a first time when the countdown instruction is received includes:
recording a first time at which the countdown instruction is received in a variable of the data model.
7. The countdown control method of claim 1 wherein said controlling the countdown page to begin counting down 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 a countdown instruction sent by the server; 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;
a load unit to load a 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 time length.
9. A computer readable storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps of the countdown control method according to 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 in the countdown control method according to any of claims 1 to 7 when executing the computer program.
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 true CN114222148A (en) | 2022-03-22 |
CN114222148B 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) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114815966A (en) * | 2022-03-30 | 2022-07-29 | 中国银行股份有限公司 | Method, device and equipment for correcting timing error of operating system and storage medium |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090099939A1 (en) * | 2007-10-10 | 2009-04-16 | Oracle International Corporation | Configurable intelligent countdown clock for online auctions |
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 |
-
2021
- 2021-11-03 CN CN202111295949.5A patent/CN114222148B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090099939A1 (en) * | 2007-10-10 | 2009-04-16 | Oracle International Corporation | Configurable intelligent countdown clock for online auctions |
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 |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114815966A (en) * | 2022-03-30 | 2022-07-29 | 中国银行股份有限公司 | Method, device and equipment for correcting timing error of operating system and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN114222148B (en) | 2024-03-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111405304B (en) | Anchor interaction method and device, computer equipment and storage medium | |
CN108156507B (en) | Virtual article presenting method, device and storage medium | |
CN106937158B (en) | Live broadcast display method, device and system | |
CN110830735B (en) | Video generation method and device, computer equipment and storage medium | |
US8764568B2 (en) | Game notification systems and methods | |
US10734032B2 (en) | Method, device, and system of synchronously playing media file | |
CN111246308A (en) | Method and device for accessing live broadcast room, live broadcast server and storage medium | |
EP2548181B1 (en) | Voting communicating system | |
EP4145841A1 (en) | Method for interacting in live streaming and electronic device | |
CN114286156A (en) | Live broadcast interaction method and device, storage medium and computer equipment | |
US20170279748A1 (en) | Information processing method and terminal, and computer storage medium | |
KR101871876B1 (en) | Chat information transmission method and apparatus, and chat information push method and server | |
CN107748690A (en) | Using jump method, device and computer-readable storage medium | |
CN114143371A (en) | Screen projection method and device, storage medium and electronic equipment | |
CN114222148B (en) | Countdown control method and device, storage medium and computer equipment | |
CN113346973B (en) | Event prompting method and device, electronic equipment and computer readable storage medium | |
CN109413455B (en) | User information display method and device for voice microphone interaction | |
CN105898596B (en) | Direct broadcasting room display control method and device | |
CN112044061A (en) | Game picture processing method and device, electronic equipment and storage medium | |
CN105872756A (en) | Method, device and system for sharing television playing information | |
CN112558901A (en) | Time reminding method, screen sharing method and device | |
CN111885167B (en) | Data synchronization method, device, electronic equipment and storage medium | |
CN115767119A (en) | Main broadcasting and downloading processing method and device, electronic equipment and storage medium | |
CN112764837B (en) | Data reporting method, device, storage medium and terminal | |
CN113132808B (en) | Video generation method and device and computer 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 |