seek request response method, device, equipment, readable storage medium and player

文档序号:1326791 发布日期:2020-07-14 浏览:9次 中文

阅读说明:本技术 seek请求响应方法及装置、设备及可读存储介质,播放器 (seek request response method, device, equipment, readable storage medium and player ) 是由 李血健 于 2020-03-23 设计创作,主要内容包括:本申请公开了一种seek请求响应方法、装置、设备及可读存储介质,以及一种播放器。本申请中的执行器和接收器异步执行各自包括的步骤,因此目标位置的缓存操作和读取操作互不影响。本申请在理想情况下能够显示连续seek包括的任一个seek请求对应的目标位置,实现播放画面的实时预览,提高了seek请求的响应效率和用户观看体验,也可以充分发挥播放器的性能。相应地,本申请公开的一种seek请求响应装置、设备及可读存储介质,以及一种播放器,也同样具有上述技术效果。(The application discloses a seek request response method, a seek request response device, readable storage media and a player. The executor and the receiver in the application execute the steps included in each asynchronously, so that the caching operation and the reading operation of the target position do not influence each other. The method and the device can display the target position corresponding to any seek request included by continuous seek under ideal conditions, realize real-time preview of a playing picture, improve response efficiency of the seek request and user viewing experience, and also can give full play to performance of a player. Accordingly, a seek request response device, a device and a readable storage medium, and a player disclosed in the present application also have the above technical effects.)

1. A seek request response method is applied to an executor and comprises the following steps:

if receiving the notification message sent by the receiver, modifying the self state into an execution state, and sending the message entering the execution state to the receiver;

reading a target position in a cache;

judging whether the target position is consistent with the target position read in the previous time;

if yes, the self state is modified into a waiting state, and a message entering the waiting state is sent to the receiver;

if not, displaying the picture of the target position, and executing the step of reading the target position in the cache;

when the receiver receives any seek request included in the continuous seek, if the executor is in a waiting state, the receiver sends the notification message to the executor; when the receiver receives any seek request included in the continuous seek, if the executor is in an execution state, updating the target position in the cache in real time; the seek request corresponds to the target position one by one;

the executor and the receiver asynchronously perform the steps each comprising.

2. The seek request response method according to claim 1, wherein before the displaying the screen of the target location, further comprising:

recording the current timestamp as a first timestamp;

correspondingly, after the displaying the picture of the target position, the method further includes:

recording the current timestamp as a second timestamp;

judging whether the difference value of the second timestamp and the first timestamp is smaller than a preset threshold value or not;

and if not, executing the step of reading the target position in the cache.

3. The seek request response method according to claim 2, further comprising:

and if the difference is smaller than the preset threshold, after sleeping for a preset time length, executing the step of recording the current timestamp as a second timestamp.

4. A seek request response method according to claim 2 or 3, wherein the step of adjusting the preset threshold value comprises:

if the difference value meets a target formula, reducing the preset threshold value; if the difference value does not meet the target formula, increasing the preset threshold value;

wherein the target formula is:

Pt'-(t1+t2+...tp)≥w,

wherein P is the seek times for adjusting the preset threshold, t' is the preset threshold, t1、t2…tPAnd calculating the difference value between the second time stamp and the first time stamp for the 1 st to the P th times, wherein w is a preset target value.

5. The seek request response method according to claim 1, wherein in a consecutive seek, the number of times the executor reads the target location is not greater than the number of times the receiver receives the seek request.

6. The seek request response method according to claim 1, wherein before the displaying the screen of the target location, further comprising:

judging whether the target position is effective or not;

if the target position is valid, executing the step of displaying the picture of the target position;

and if the target position is invalid, executing the step of reading the target position in the cache.

7. A seek request response device, applied to an executor, comprising:

the execution preparation module is used for modifying the self state into the execution state and sending the information which enters the execution state to the receiver if receiving the notification information sent by the receiver;

the reading module is used for reading the target position in the cache;

the judging module is used for judging whether the target position is consistent with the target position read in the previous time;

the exit module is used for modifying the self state into a waiting state if the target position is consistent with the target position read in the previous time, and sending a message entering the waiting state to the receiver;

the display module is used for displaying the picture of the target position and executing the steps in the reading module if the target position is inconsistent with the target position read last time;

when the receiver receives any seek request included in the continuous seek, if the executor is in a waiting state, the receiver sends the notification message to the executor; when the receiver receives any seek request included in the continuous seek, if the executor is in an execution state, updating the target position in the cache in real time; the seek request corresponds to the target position one by one;

the executor and the receiver asynchronously perform the steps each comprising.

8. A player, comprising: a receiver and an actuator, wherein:

the receiver is configured to send a notification message to the executor if the executor is in a waiting state when receiving any seek request included in the consecutive seek; when any seek request included in the continuous seek is received, if the actuator is in an execution state, updating the target position in the cache in real time; the seek request corresponds to the target position one by one;

the executor is used for modifying the self state into the execution state if the notification message is received, and sending the message entering the execution state to the receiver; reading a target position in a cache; judging whether the target position is consistent with the target position read in the previous time; if yes, the self state is modified into a waiting state, and a message entering the waiting state is sent to the receiver; if not, displaying the picture of the target position, and executing the step of reading the target position in the cache;

the executor and the receiver asynchronously perform the steps each comprising.

9. A seek request response device, comprising:

a memory for storing a computer program;

a processor for executing the computer program to implement the seek request response method according to any of claims 1 to 6.

10. A readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the seek request response method according to any of claims 1 to 6.

Technical Field

The present application relates to the field of computer technologies, and in particular, to a seek request response method, apparatus, device, and readable storage medium, and a player.

Background

Currently, when a media file is played, a playing page jumps to a specified position to play, which is called seek. The user continuously drags the progress bar of the player or continuously presses the seek key of the remote controller, so that the player continuously receives a large number of seek requests within the interval of millisecond level, which is called continuous seek.

In the prior art, when the player detects a continuous seek, it responds only to the last seek operation. The method of detecting the successive seeks is generally: recording the timestamp of the current seek request, checking whether a new seek request is received after delaying for a period of time, repeating the previous steps if the new seek request is received, determining the latest received seek request as the last seek request in the continuous seek when the new seek request is not received any more, and responding to the seek request.

The above prior art has the following problems:

after receiving the seek request each time, the player needs to delay for a period of time to determine whether the current seek operation is a continuous seek or whether the current seek operation is the last seek in the continuous seek. Each seek operation is delayed for a period of time before a response is obtained, which may affect the user experience to some extent. Before the user continuously drags the progress bar or presses the seek key of the remote controller for a long time, the player does not actually perform seek operation, so that the playing picture is still in a playing state or a state of being still before the seek, that is, the picture at the seek position cannot be previewed in real time. In the continuous seek process, for example, if the user continuously presses the seek key for 10 seconds, the player will respond to seek operation after 10 seconds, and actually, even if the player performance is poor, it can respond to seek operation for many times within 10 seconds, but due to the current conventional practice, the player performance cannot be fully exerted.

Therefore, how to improve the response efficiency of the seek request is a problem to be solved by those skilled in the art.

Disclosure of Invention

In view of the above, an object of the present application is to provide a seek request response method, apparatus, device and readable storage medium, and a player, so as to improve the response efficiency of the seek request. The specific scheme is as follows:

in a first aspect, the present application provides a seek request response method, applied to an executor, including:

if receiving the notification message sent by the receiver, modifying the self state into an execution state, and sending the message entering the execution state to the receiver;

reading a target position in a cache;

judging whether the target position is consistent with the target position read in the previous time;

if yes, the self state is modified into a waiting state, and a message entering the waiting state is sent to the receiver;

if not, displaying the picture of the target position, and executing the step of reading the target position in the cache;

when the receiver receives any seek request included in the continuous seek, if the executor is in a waiting state, the receiver sends the notification message to the executor; when the receiver receives any seek request included in the continuous seek, if the executor is in an execution state, updating the target position in the cache in real time; the seek request corresponds to the target position one by one;

the executor and the receiver asynchronously perform the steps each comprising.

Preferably, before the displaying the picture of the target position, the method further includes:

recording the current timestamp as a first timestamp;

correspondingly, after the displaying the picture of the target position, the method further includes:

recording the current timestamp as a second timestamp;

judging whether the difference value of the second timestamp and the first timestamp is smaller than a preset threshold value or not;

and if not, executing the step of reading the target position in the cache.

Preferably, the method further comprises the following steps:

and if the difference is smaller than the preset threshold, after sleeping for a preset time length, executing the step of recording the current timestamp as a second timestamp.

Preferably, the adjusting of the preset threshold includes:

if the difference value meets a target formula, reducing the preset threshold value; if the difference value does not meet the target formula, increasing the preset threshold value;

wherein the target formula is:

Pt'(t1+t2+...+tp)≥w,

wherein P is the seek times for adjusting the preset threshold, t' is the preset threshold, t1、t2…tPAnd calculating the difference value between the second time stamp and the first time stamp for the 1 st to the P th times, wherein w is a preset target value.

Preferably, in a continuous seek, the number of times the executor reads the target position is not greater than the number of times the receiver receives seek requests.

Preferably, before the displaying the picture of the target position, the method further includes:

judging whether the target position is effective or not;

if the target position is valid, executing the step of displaying the picture of the target position;

and if the target position is invalid, executing the step of reading the target position in the cache.

In a second aspect, the present application provides a seek request response apparatus, applied to an executor, including:

the execution preparation module is used for modifying the self state into the execution state and sending the information which enters the execution state to the receiver if receiving the notification information sent by the receiver;

the reading module is used for reading the target position in the cache;

the judging module is used for judging whether the target position is consistent with the target position read in the previous time;

the exit module is used for modifying the self state into a waiting state if the target position is consistent with the target position read in the previous time, and sending a message entering the waiting state to the receiver;

the display module is used for displaying the picture of the target position and executing the steps in the reading module if the target position is inconsistent with the target position read last time;

when the receiver receives any seek request included in the continuous seek, if the executor is in a waiting state, the receiver sends the notification message to the executor; when the receiver receives any seek request included in the continuous seek, if the executor is in an execution state, updating the target position in the cache in real time; the seek request corresponds to the target position one by one;

the executor and the receiver asynchronously perform the steps each comprising.

In a third aspect, the present application provides a player comprising: a receiver and an actuator, wherein:

the receiver is configured to send a notification message to the executor if the executor is in a waiting state when receiving any seek request included in the consecutive seek; when any seek request included in the continuous seek is received, if the actuator is in an execution state, updating the target position in the cache in real time; the seek request corresponds to the target position one by one;

the executor is used for modifying the self state into the execution state if the notification message is received, and sending the message entering the execution state to the receiver; reading a target position in a cache; judging whether the target position is consistent with the target position read in the previous time; if yes, the self state is modified into a waiting state, and a message entering the waiting state is sent to the receiver; if not, displaying the picture of the target position, and executing the step of reading the target position in the cache;

the executor and the receiver asynchronously perform the steps each comprising.

In a fourth aspect, the present application provides a seek request response device, including:

a memory for storing a computer program;

a processor for executing the computer program to implement the seek request response method disclosed in the foregoing.

In a fifth aspect, the present application provides a readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the seek request response method disclosed in the foregoing.

According to the above scheme, the present application provides a seek request response method, applied to an actuator, including: if receiving the notification message sent by the receiver, modifying the self state into an execution state, and sending the message entering the execution state to the receiver; reading a target position in a cache; judging whether the target position is consistent with the target position read in the previous time; if yes, the self state is modified into a waiting state, and a message entering the waiting state is sent to the receiver; if not, displaying the picture of the target position, and executing the step of reading the target position in the cache; when the receiver receives any seek request included in the continuous seek, if the executor is in a waiting state, the receiver sends the notification message to the executor; when the receiver receives any seek request included in the continuous seek, if the executor is in an execution state, updating the target position in the cache in real time; the seek request corresponds to the target position one by one; the executor and the receiver asynchronously perform the steps each comprising.

Therefore, after receiving the notification message sent by the receiver, the executor in the application enters an execution state, and reads a target position stored in a cache in real time by the receiver; if the current read target position is consistent with the last read target position, the playing picture is not required to be changed, and the process is exited; and if the currently read target position is inconsistent with the previously read target position, displaying the picture of the currently read target position, reading the target position stored in the cache again, and executing subsequent operation. The target position stored in the cache is stored in the cache in real time when the receiver receives any one of the seek requests included in the continuous seek, so that the executor can read the target position in real time, and display the picture of the target position when the currently read target position is inconsistent with the previously read target position, thereby completing the jump of the played picture. And, since the executor and the receiver asynchronously execute the steps included in each, the cache operation and the read operation of the target location do not affect each other. Ideally, the target position corresponding to any seek request included in the consecutive seek can be displayed, so that real-time preview of a playing picture can be realized, and response efficiency of the seek request and user viewing experience are improved. The number of displays is less than the number of seek requests included by consecutive seek, but this does not affect the user viewing experience and can fully exploit the performance of the current player.

Accordingly, the seek request response device, the apparatus and the readable storage medium provided by the present application, and the player also have the above technical effects.

Drawings

In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.

FIG. 1 is a flowchart of a seek request response method disclosed in the present application;

FIG. 2 is a logic diagram illustrating a seek request response scheme disclosed herein;

FIG. 3 is a flow chart of a method in a receiving unit of the present disclosure;

FIG. 4 is a flow chart of a method in an execution unit of the present disclosure;

FIG. 5 is a schematic diagram of a seek request response apparatus disclosed in the present application;

fig. 6 is a schematic diagram of a seek request response device disclosed in 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.

Currently, after each time a player receives a seek request, the player needs to delay for a period of time to determine whether the current seek operation is a continuous seek or whether the current seek operation is the last seek in the continuous seek. Each seek operation is delayed for a period of time before a response is obtained, which may affect the user experience to some extent. Before the user continuously drags the progress bar or presses the seek key of the remote controller for a long time, the player does not actually perform seek operation, so that the playing picture is still in a playing state or a state of being still before the seek, that is, the picture at the seek position cannot be previewed in real time. In the continuous seek process, for example, if the user continuously presses the seek key for 10 seconds, the player will respond to seek operation after 10 seconds, and actually, even if the player performance is poor, it can respond to seek operation for many times within 10 seconds, but due to the current conventional practice, the player performance cannot be fully exerted. Therefore, the seek request response scheme is provided, and response efficiency of the seek request can be improved.

Referring to fig. 1, an embodiment of the present application discloses a seek request response method, which is applied to an executor and includes:

s101, receiving a notification message sent by a receiver;

s102, modifying the self state into an execution state, and sending a message entering the execution state to a receiver;

s103, reading a target position in the cache;

s104, judging whether the target position is consistent with the target position read in the previous time; if yes, executing S105; if not, executing S106;

it should be noted that, before the receiver receives the seek request for the first time and causes the executor to enter the execution state, no data is stored in the cache. Therefore, the target position read this time is null, and the target position read this time and the null are compared currently. Of course, the null value may also be set to the default value 0 in advance.

S105, modifying the self state into a waiting state, and sending a message entering the waiting state to a receiver;

s106, displaying a picture of the target position, and executing S103.

When the receiver receives any seek request included in the continuous seek, if the executor is in a waiting state, a notification message is sent to the executor; when the receiver receives any seek request included in the continuous seek, if the actuator is in an execution state, the target position in the cache is updated in real time; the seek request corresponds to the target position one by one; the executor and the receiver asynchronously perform the steps each comprising.

In this embodiment, after receiving the notification message sent by the receiver, the actuator enters an execution state and reads a target position stored in the cache in real time by the receiver; if the current read target position is consistent with the previous read target position, it indicates that the playing picture does not need to be changed, so the executor exits the process (i.e. the executor terminates the current operation and enters a waiting state); and if the currently read target position is inconsistent with the previously read target position, displaying a picture of the currently read target position, reading the target position stored in the cache, and executing subsequent operation. The target position stored in the cache is stored in the cache in real time when the receiver receives any one of the seek requests included in the continuous seek, so that the executor can read the target position in real time, and display the picture of the target position when the currently read target position is inconsistent with the previously read target position, thereby completing the jump of the played picture.

After the state of the executor is modified, the executor sends corresponding information to the receiver in time, and the receiver records the information sent by the executor, so that when the receiver receives the seek request, whether the target position in the cache is updated in real time, the information for making the executor enter the execution state is sent, or only the target position in the cache is updated in real time can be determined according to the recorded state of the executor. When a sequential seek includes one seek request, it is essentially a single seek request.

In one embodiment, before displaying the picture of the target position, the method further includes: recording the current timestamp as a first timestamp; correspondingly, after the picture of the target position is displayed, the method further comprises the following steps: recording the current timestamp as a second timestamp; judging whether the difference value of the second time stamp and the first time stamp is smaller than a preset threshold value or not; if not, executing the step of reading the target position in the cache. If so, after sleeping for a preset time length, executing the step of recording the current timestamp as a second timestamp.

It should be noted that if the difference is smaller than the preset threshold, it indicates that the time for currently responding to the seek request is short, but the seek request does not need to be responded substantially as fast, so in order to enable the player to process other transactions simultaneously, the time for responding to the seek request (i.e. the difference) is calculated again after sleeping for the preset duration. The preset threshold value can be flexibly adjusted according to the actual application condition. The preset time duration is, for example, 3 milliseconds, 5 milliseconds, etc., and the preset time duration is preferably the difference between the second time stamp and the first time stamp. And if the difference is not smaller than the preset threshold, recording the difference, reading the target position stored in the cache again, and executing other subsequent operations.

In one embodiment, the adjusting step of the preset threshold includes: if the difference value meets the target formula, reducing a preset threshold value; if the difference value does not meet the target formula, increasing a preset threshold value; wherein the target formula is:

Pt'(t1+t2+...+tp)≥w,

wherein P is the seek times for adjusting the preset threshold, t' is the preset threshold, t1、t2…tPAnd calculating the difference value between the second time stamp and the first time stamp for the 1 st to the P th times, wherein w is a preset target value. And when the value of P is 10, the preset threshold is adjusted based on the response time of the seek requests for 10 times continuously. Of course, a maximum value and a minimum value may also be set for the preset threshold, and when the preset threshold is adjusted to the maximum value or the minimum value in the process of adjusting the preset threshold, the adjustment of the preset threshold is stopped.

In one embodiment, in a consecutive seek, the number of times the executor reads the target location is not greater than the number of times the receiver receives seek requests. That is, the receiver only manages to update the target location in real time, and not every time the cached target location is read by the executor. Thus, the player can perform other transactions simultaneously. When the player performance is good, the number of times that the executor reads the target position may be equal to the number of times that the receiver receives the seek request; when the performance of the player is poor, the number of times that the target position is read by the executor may be less than the number of times that the receiver receives the seek request. The fewer the number of times the actuator reads the target position, the fewer the number of screens that can be previewed. The performance of the player is affected by the type of the code stream, the frame rate, the code rate, and the like.

In one embodiment, before displaying the picture of the target position, the method further includes: judging whether the target position is effective or not; if the target position is valid, executing a step of displaying a picture of the target position; and if the target position is invalid, executing the step of reading the target position in the cache.

In this embodiment, the actuator and the receiver may be physical components or virtual functional devices.

As can be seen, the executor and the receiver in the embodiment of the present application execute the steps included in each asynchronously, so that the cache operation and the read operation of the target location do not affect each other. Ideally, the target position corresponding to any seek request included in the consecutive seek can be displayed, so that real-time preview of a playing picture can be realized, and response efficiency of the seek request and user viewing experience are improved. The number of displays is less than the number of seek requests included by consecutive seek, but this does not affect the user viewing experience and can fully exploit the performance of the current player.

The embodiment of the application discloses a seek request response scheme, which comprises a receiving unit (namely a receiver) and an executing unit (namely an executor).

Referring to fig. 2, the receiving unit is configured to receive the seek request 1 to n times, and update the target location; the execution unit is used for waiting for the notification message sent by the receiving unit and executing the seek processing flow.

Referring to fig. 3, the steps executed by the receiving unit specifically include: when the number of times that a user continuously sends a seek request is n, and a receiving unit receives a 1 st seek request included in the continuous seek, caching a target position corresponding to the current seek request, and informing an execution unit to enter a seek processing flow; when the receiving unit receives the 2 nd to nth seek requests included in the continuous seek, the target position in the cache is updated in real time so as to keep the target position in the current cache as the latest position. The receiving unit waits for the executing unit to send a notification for exiting the seek processing flow in real time.

Referring to fig. 4, the specific steps executed by the execution unit include: after receiving the notification message sent by the receiving unit, the execution unit enters a seek processing flow and notifies the receiving unit: the execution unit has currently entered the seek flow. Reading a target position in a cache; if the current read target position is consistent with the previous read target position, the playing picture is not required to be changed, so the process is exited, the self state is modified into a waiting state, and a message entering the waiting state is sent to the receiving unit; if the currently read target position is inconsistent with the previously read target position, displaying a picture of the currently read target position when the currently read target position is effective; and if the currently read target position is invalid, reading the target position stored in the cache again, and executing subsequent operation.

Referring to fig. 4, in the seek processing flow, the execution unit may further compare the actual response time of each seek request with a preset threshold, and if the actual response time of the seek request is smaller than the preset threshold, it indicates that the time for currently responding to the seek request is short, but the time for responding to the seek request is substantially as fast as the seek request does not need to be responded, so that in order to enable the player to process other transactions simultaneously, the player sleeps for a period of time and then calculates the time (i.e. the difference) for responding to the seek request again.

Specifically, the preset threshold may be floated within a certain range. If P takes a value of 10, then the target formula is: 10t' - (t)1+t2+...t10) Not less than w if t1+t2+...+t10If the formula is satisfied, reducing the preset threshold value until the preset threshold value is reduced to the minimum value; otherwise, the reverse is carried outAnd increasing the preset threshold value until the maximum value of the preset threshold value is increased. t' is a preset threshold value, t1、t2…t10The actual response time for any 10 consecutive seek requests included for a consecutive seek, w is a preset target value.

It can be seen that according to the scheme provided in this embodiment, a receiving unit and an executing unit may be implemented inside the player, and assuming that the number of seek operations received by the receiving unit in a short time is n, the number of seek operations actually executed by the executing unit is m, and m may be matched to a value closest to n according to the actual performance of the player. In the continuous seek process, the playing picture can be previewed in real time; and the condition that the player responds to a large number of seek requests exceeding the performance of the system in a short time to cause system blockage or resource waste can be avoided. Moreover, the embodiment can respond to the seek request in time without waiting for the last seek request in the continuous seek.

In the following, a seek request response device provided in an embodiment of the present application is introduced, and a seek request response device described below and a seek request response method described above may be referred to each other.

Referring to fig. 5, an embodiment of the present application discloses a seek request response apparatus, applied to an executor, including:

an execution preparation module 501, configured to modify a self state into an execution state if a notification message sent by a receiver is received, and send a message that has entered the execution state to the receiver;

a reading module 502, configured to read a target location in a cache;

a judging module 503, configured to judge whether the target position is consistent with the target position read in the previous time;

an exit module 504, configured to modify a self state into a waiting state if the target position is consistent with the target position read last time, and send a message that the self state has entered the waiting state to the receiver;

a display module 505, configured to display a picture of the target position and execute the steps in the reading module if the target position is inconsistent with the target position read last time;

when the receiver receives any seek request included in the continuous seek, if the executor is in a waiting state, a notification message is sent to the executor; when the receiver receives any seek request included in the continuous seek, if the actuator is in an execution state, the target position in the cache is updated in real time; the seek request corresponds to the target position one by one; the executor and the receiver asynchronously perform the steps each comprising.

In a specific embodiment, the method further comprises the following steps:

the first recording module is used for recording the current time stamp as a first time stamp before the picture of the target position is displayed;

correspondingly, the method also comprises the following steps:

the second recording module is used for recording the current time stamp as a second time stamp after the picture of the target position is displayed;

the third judging module is used for judging whether the difference value of the second time stamp and the first time stamp is smaller than a preset threshold value or not; if the difference is not smaller than the preset threshold, executing the step in the reading module;

in a specific embodiment, the method further comprises the following steps:

and the dormancy module is used for executing the steps in the second recording module after the preset time length is dormant if the difference value is smaller than the preset threshold value.

In a specific embodiment, the method further comprises the following steps: an adjusting module for adjusting the preset threshold, the adjusting module being specifically configured to:

if the difference value meets a target formula, reducing the preset threshold value; if the difference value does not meet the target formula, increasing the preset threshold value;

wherein the target formula is:

Pt'-(t1+t2+...tp)≥w,

wherein P is the seek times for adjusting the preset threshold, t' is the preset threshold, t1、t2…tPAnd calculating the difference value between the second time stamp and the first time stamp for the 1 st to the P th times, wherein w is a preset target value.

In a specific embodiment, the method further comprises the following steps:

the validity judging module is used for judging whether the target position is valid or not;

the first execution module is used for executing the step of displaying the picture of the target position if the target position is effective;

and the second execution module is used for executing the steps in the reading module if the target position is invalid.

In one embodiment, in a consecutive seek, the number of times the executor reads the target location is not greater than the number of times the receiver receives seek requests.

For more specific working processes of each module and unit in this embodiment, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not described here again.

It can be seen that the present embodiment provides a seek request response apparatus, in which an executor and a receiver execute the steps included in each asynchronously, so that the cache operation and the read operation of the target location do not affect each other. Ideally, the target position corresponding to any seek request included in the consecutive seek can be displayed, so that real-time preview of a playing picture can be realized, and response efficiency of the seek request and user viewing experience are improved. The number of displays is less than the number of seek requests included by consecutive seek, but this does not affect the user viewing experience and can fully exploit the performance of the current player.

In the following, a player provided in the embodiments of the present application is introduced, and a player described below and a seek request response method and apparatus described above may be referred to each other.

The embodiment of the application discloses a player, including: a receiver and an actuator, wherein:

the receiver is used for sending a notification message to the executor if the executor is in a waiting state when any seek request included by the continuous seek is received; when any seek request included in the continuous seek is received, if the actuator is in an execution state, updating a target position in the cache in real time; the seek request corresponds to the target position one by one;

the executor is used for modifying the self state into the execution state if the notification message is received, and sending the message entering the execution state to the receiver; reading a target position in a cache; judging whether the target position is consistent with the target position read in the previous time; if yes, the self state is modified into a waiting state, and a message entering the waiting state is sent to a receiver; if not, displaying the picture of the target position, and executing the step of reading the target position in the cache;

the executor and the receiver asynchronously perform the steps each comprising.

In a consecutive seek, the number of times the executor reads the target location is not greater than the number of times the receiver receives seek requests.

In one embodiment, the actuator is further configured to:

recording a current time stamp as a first time stamp before displaying a picture of a target position;

correspondingly, the actuator is also used for:

recording the current timestamp as a second timestamp after displaying the picture of the target position; judging whether the difference value of the second time stamp and the first time stamp is smaller than a preset threshold value or not; if the difference is not smaller than the preset threshold, executing the step in the reading module;

in one embodiment, the actuator further comprises:

and the dormancy module is used for executing the steps in the second recording module after the preset time length is dormant if the difference value is smaller than the preset threshold value.

In a specific embodiment, the method further comprises the following steps: an adjusting module for adjusting the preset threshold, the adjusting module being specifically configured to:

if the difference value meets a target formula, reducing the preset threshold value; if the difference value does not meet the target formula, increasing the preset threshold value;

wherein the target formula is:

Pt'-(t1+t2+...+tp)≥w,

wherein P is the seek times for adjusting the preset threshold, t' is the preset threshold, t1、t2…tPAnd calculating the difference value between the second time stamp and the first time stamp for the 1 st to the P th times, wherein w is a preset target value.

It can be seen that the present embodiment provides a player in which the executor and the receiver execute the steps included in each asynchronously, so that the buffering operation and the reading operation of the target location do not affect each other. Ideally, the target position corresponding to any seek request included in the consecutive seek can be displayed, so that real-time preview of a playing picture can be realized, and response efficiency of the seek request and user viewing experience are improved. The number of displays is less than the number of seek requests included by consecutive seek, but this does not affect the user viewing experience and can fully exploit the performance of the current player.

In the following, a seek request response device provided in an embodiment of the present application is introduced, and a seek request response device described below and a seek request response method and apparatus described above may refer to each other.

Referring to fig. 6, an embodiment of the present application discloses a seek request response device, including:

a memory 601 for storing a computer program;

a processor 602 for executing the computer program to implement the method disclosed in any of the embodiments above.

In the following, a readable storage medium provided by an embodiment of the present application is introduced, and a readable storage medium described below and a seek request response method, apparatus, and device described above may be referred to each other.

A readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the seek request response method disclosed in the foregoing embodiments. For the specific steps of the method, reference may be made to the corresponding contents disclosed in the foregoing embodiments, which are not described herein again.

References in this application to "first," "second," "third," "fourth," etc., if any, are intended to distinguish between similar elements and not necessarily to describe a particular order or sequence. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises" and "comprising," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, or apparatus.

It should be noted that the descriptions in this application referring to "first", "second", etc. are for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present application.

The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other.

The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of readable storage medium known in the art.

The principle and the implementation of the present application are explained herein by applying specific examples, and the above description of the embodiments is only used to help understand the method and the core idea of the present application; meanwhile, for a person 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.

16页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:智能双录方法及系统、客户端、服务器

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类