CN112104907B - Picture playing method and device - Google Patents

Picture playing method and device Download PDF

Info

Publication number
CN112104907B
CN112104907B CN201910521648.6A CN201910521648A CN112104907B CN 112104907 B CN112104907 B CN 112104907B CN 201910521648 A CN201910521648 A CN 201910521648A CN 112104907 B CN112104907 B CN 112104907B
Authority
CN
China
Prior art keywords
picture
played
pictures
pool
playing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910521648.6A
Other languages
Chinese (zh)
Other versions
CN112104907A (en
Inventor
刘若鹏
栾琳
季春霖
任冰华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xi'an Guangqi Intelligent Technology Co ltd
Original Assignee
Xi'an Guangqi Intelligent Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xi'an Guangqi Intelligent Technology Co ltd filed Critical Xi'an Guangqi Intelligent Technology Co ltd
Priority to CN201910521648.6A priority Critical patent/CN112104907B/en
Publication of CN112104907A publication Critical patent/CN112104907A/en
Application granted granted Critical
Publication of CN112104907B publication Critical patent/CN112104907B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/478Supplemental services, e.g. displaying phone caller identification, shopping application
    • H04N21/4782Web browsing, e.g. WebTV
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • H04N21/4334Recording operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44004Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving video buffer management, e.g. video decoder buffer or video display buffer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
    • H04N21/47202End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content for requesting content on demand, e.g. video on demand

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

The embodiment of the invention provides a picture playing method and a picture playing device, wherein the method comprises the following steps: the method comprises the steps of loading a plurality of pictures to be played in a playing task into a plurality of sub-pools of a full picture pool in turn, and executing a recording step and a playing step in the process of loading the pictures to be played in the picture pool, wherein the recording step comprises the following steps: recording the number of pictures to be played in a picture pool; the playing step comprises the following steps: when the number of the pictures to be played is recorded to be not smaller than the play start value, the pictures to be played in each sub-pool are started to be played according to the loading sequence of the sub-pools, and the pictures to be played which are fully loaded in each sub-pool are emptied after being played, wherein the play start value is smaller than the total number of the pictures to be played of the play task. The invention solves the technical problems of slow playing start and easy browser breakdown of the traditional picture playing method.

Description

Picture playing method and device
Technical Field
The invention relates to the technical field of picture playing, in particular to a picture playing method and a picture playing device.
Background
With the development of information technology, the application of pictures is more and more widespread, and in many cases, a large number of pictures are stored on a server, so that tools such as a browser need to load the pictures through a network and then play the pictures, and in the existing application, continuous playing is often needed for a plurality of high-definition pictures. For example, in the field of artificial intelligence, in order to continuously display pictures of a plurality of cameras, a browser needs to continuously play the pictures of the plurality of cameras.
At present, a few picture players are available in the market, and the current picture playing method capable of being queried is a Jquery plug-in of some third parties, specifically, the Jquery plug-in loads all pictures at one time and then sequentially plays all pictures. In the picture playing method, the pictures are smoothly played, but the pictures can be played only after all the pictures are loaded, so that the playing start is slow due to the request process and the preloading process of all the pictures, and particularly under the condition that the number of loaded pictures is too large or the quality is too high; in addition, thousands of pictures or hundreds of high-quality pictures are imported at a time, and the browser is found to be easy to collapse through multiple tests.
Aiming at the technical problems that the playing start of the traditional picture playing method is slow and the browser is easy to crash, the prior art lacks an effective solution.
Disclosure of Invention
In view of the above, the embodiments of the present invention provide a method and a device for playing pictures, so as to solve the technical problems of slow playing start and easy browser crash in the conventional method for playing pictures.
According to a first aspect of the present invention, there is provided a picture playing method, including:
a plurality of sub-pools of a picture pool are filled up in turn with a plurality of pictures to be played in a playing task, and in the process of loading the pictures to be played in the picture pool, a recording step and a playing step are executed, wherein,
the recording step includes: recording the number of pictures to be played in the picture pool;
the playing step comprises the following steps: when the number of the pictures to be played is recorded to be not smaller than a play start value, the pictures to be played in each sub-pool are started to be played according to the loading sequence of the sub-pools, and the pictures to be played which are fully loaded in each sub-pool are emptied after being played, wherein the play start value is smaller than the total number of the pictures to be played of the play task.
Optionally, loading a plurality of sub-pools of the full-picture pool with a plurality of pictures to be played in the play task in turn includes:
acquiring a plurality of storage data corresponding to a plurality of pictures to be played in the play task;
sequentially analyzing the plurality of storage data to sequentially obtain reading addresses used when each picture to be played in the playing task is called; the method comprises the steps of,
and after each reading address is obtained, loading the reading address into the picture pool so as to read a plurality of pictures to be played in the playing task through the reading address for playing.
Optionally, the playing task stores the plurality of storage data according to a preset playing sequence through a picture address set;
the method for obtaining the plurality of storage data corresponding to the plurality of pictures to be played in the playing task comprises the following steps: acquiring the picture address set to acquire the plurality of storage data;
sequentially parsing the plurality of storage data, including: and sequentially analyzing the plurality of storage data according to the preset playing sequence.
Optionally, the picture playing method further includes: judging whether the total number of the pictures to be played is larger than a preset threshold value or not;
when the total number of the pictures to be played is not greater than the preset threshold value, starting to play the pictures to be played in the picture pool after the pictures to be played in the playing task are loaded in the picture pool;
and under the condition that the total number of the pictures to be played is larger than the preset threshold value, executing the recording step and the playing step in the process of loading the pictures to be played in the picture pool.
Optionally, the preset threshold is 100.
Optionally, the multiple sub-pools of the picture pool include a first picture pool and a second picture pool, and capacities of the first picture pool and the second picture pool are smaller than the total number of pictures to be played, and the multiple sub-pools of the picture pool are filled with multiple pictures to be played in turn in the playing task, including:
filling the first picture pool and the second picture pool with a plurality of pictures to be played in the playing task in turn; the method comprises the steps of,
and after the first picture pool plays the full picture to be played, carrying out emptying operation on the first picture pool, and after the second picture pool plays the full picture to be played, carrying out emptying operation on the second picture pool.
Optionally, when the current loading picture pool in the first picture pool and the second picture pool is full of pictures to be played and the playing quantity of the currently loaded pictures to be played is equal to the pool changing threshold value, another picture pool is changed to load the pictures to be played.
Optionally, the capacities of the first picture pool and the second picture pool are preset capacities, and the loading the first picture pool and the second picture pool with the plurality of pictures to be played in the playing task in turn includes:
a value assigning step, namely assigning zero to an initial loading index and assigning one to an initial recording round;
a loading step, namely extracting one picture to be played, which is not extracted in the playing task, to load the picture to a target picture pool, wherein the sequence number of the target picture pool is the difference between two and a first target value, and the first target value is the remainder of recording the round and the two division;
a loading recording step, namely adding one to the initial loading index to obtain a current loading index;
judging whether the current loading index is equal to a second target value or not, wherein the second target value is the product of the initial recording round and the preset capacity;
a round recording step of adding one to the initial recording round to obtain a current recording round and determining the current recording round as an initial recording round under the condition that the current loading index is equal to the second target value;
and returning to the step, wherein the current loading index is determined to be an initial loading index and the loading step is returned to be executed until a plurality of pictures to be played in the playing task are loaded under the condition that the current loading index is not equal to the second target value or after the round recording step is executed.
Optionally, the pool-changing threshold is equal to the play start value,
the assigning step further includes: assigning zero to the play index;
the playing step further includes: after starting to play the pictures to be played in the picture pool, adding one to the play index for each picture to be played to obtain the updated play index;
the execution conditions of the round recording step are as follows: the updated play index is not smaller than the sum of a third target value and the play start value, so that when the target picture pool is loaded with the pictures to be played and the play quantity of the pictures to be played which are currently loaded is equal to the pool changing threshold value, another picture pool is changed to load the pictures to be played,
the third target value is the product of a target difference value and the preset capacity, and the target difference value is the initial recording round minus 1.
Optionally, the emptying operation is performed on the first picture pool after the first picture pool plays the full picture to be played, and the emptying operation is performed on the second picture pool after the second picture pool plays the full picture to be played, including:
judging whether the updated play index is equal to the third target value;
and under the condition that the updated play index is equal to the third target value, clearing pictures to be played in the picture pools except the target picture pool in the first picture pool and the second picture pool.
According to a second aspect of the present invention, there is provided a computer readable storage medium storing computer instructions which, when executed, implement a picture playing method according to any one of the embodiments of the first aspect.
According to a third aspect of the present invention, there is provided a picture playing device comprising:
a memory for storing computer instructions;
a processor coupled to the memory, the processor configured to perform implementing the picture playing method according to any implementation of the first aspect based on computer instructions stored in the memory.
Embodiments of the present invention have the following advantages or benefits:
the picture playing method provided by the invention comprises the following steps: and in the process of loading the pictures to be played in the picture pool, recording the number of the pictures to be played in the picture pool, and starting to play the pictures to be played in each sub pool according to the loading sequence of the sub pools when the number of the pictures to be played is not less than the loading start value, wherein each sub pool is emptied after the loaded pictures to be played are played, and the loading start value is less than the total number of the pictures to be played in the play task, so that the playing can be started without introducing all the pictures to be played in the play task at a higher speed at one time, and the browser is easy to crash when the pictures are continuously played and amplified in a slow mode by the traditional picture playing method.
Drawings
The above and other objects, features and advantages of the present invention will become more apparent by describing embodiments thereof with reference to the following drawings in which:
fig. 1 is a flowchart of a picture playing method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating an embodiment of a picture playing method according to the present invention;
FIG. 3 is a flowchart of another implementation method of a picture playing method according to an embodiment of the present invention;
FIG. 4 is a flowchart of another implementation method of a picture playing method according to an embodiment of the present invention;
FIG. 5 is a block diagram of a picture playback system according to an embodiment of the present invention;
fig. 6 is a block diagram of a picture playing device according to an embodiment of the present invention.
Detailed Description
The present invention is described below based on examples, but the present invention is not limited to only these examples. In the following detailed description of the present invention, certain specific details are set forth in detail. The present invention will be fully understood by those skilled in the art without the details described herein. Well-known methods, procedures, and flows have not been described in detail so as not to obscure the nature of the invention. The figures are not necessarily drawn to scale.
Fig. 1 is a flowchart of a picture playing method according to an embodiment of the present invention, where the picture playing method includes:
step S102, a plurality of sub-pools of a picture pool are filled with a plurality of pictures to be played in turn in a playing task, and in the process of loading the pictures to be played in the picture pool, the following steps are executed:
step S104, a recording step, including: recording the number of pictures to be played in a picture pool; the method comprises the steps of,
step S106, a playing step, comprising: when the number of the pictures to be played is recorded to be not smaller than the play start value, the pictures to be played in each sub-pool are started to be played according to the loading sequence of the sub-pools, and the pictures to be played which are fully loaded in each sub-pool are emptied after being played, wherein the play start value is smaller than the total number of the pictures to be played of the play task.
It should be noted that, a plurality of sub-pools of a picture pool are filled with a plurality of pictures to be played in the playing task in turn, that is, after a plurality of sub-pools are filled with one another in turn, another round of loading is performed after one round of loading is performed on all sub-pools until a plurality of pictures to be played in the playing task are all loaded, it should be understood that the last loaded sub-pool cannot be filled.
In the picture playing method provided by the invention, the plurality of sub-pools of the picture pool alternately load a plurality of pictures to be played in the playing task, so that the occupation of storage resources is saved, and the storage pressure of a browser is reduced; and the play start value is smaller than the total number of pictures to be played of the play task, so that all the pictures to be played of the play task do not need to be imported at a higher speed at one time, and the play can be started without loading all the pictures to be played of the play task into the picture pool, namely, the technical effects of shortening the loading time of the pictures before playing and relieving the running pressure of the browser are achieved by reducing the loading quantity of the pictures before playing, and the technical problems that the playing start is slow and the browser is easy to crash when a large number of pictures are continuously played by the traditional picture playing method are solved.
Fig. 2 shows a flowchart of one implementation of the picture playing method in the case where a plurality of sub-pools of the picture pool are not considered, but the picture pool is taken as a loading unit. Referring to fig. 2, the picture playing method includes:
step S201, assigning zero to the initial loading index;
step S202, extracting an unextracted picture to be played in the playing task to load the extracted picture into a picture pool, and adding one to an initial loading index to obtain a current loading index;
step S203, judging whether the current loading index is not less than the play start value, wherein step S204 is executed under the condition that the current loading index is not less than the play start value;
step S204, playing the picture to be played in the picture pool; the method comprises the steps of,
step S205, judging whether the current loading index is smaller than the total number of pictures to be played, wherein the step S202 is executed after the current loading index is determined to be the initial loading index under the condition that the current loading index is smaller than the total number of the pictures to be played.
It should be noted that, after the step S203, if the current loading index is smaller than the play start value, no operation is performed; and step S205, if the current loading index is not less than (equal to) the total number of the pictures to be played after the judgment, loading is ended.
Step S204, the pictures to be played in the picture pool are played, namely, the current loading index is not less than the play start value, until all the pictures to be played in the play task are played.
In the above execution of the picture playing method, the capacity of the picture pool must not be smaller than the total capacity required by a plurality of pictures to be played in the playing task.
In an alternative embodiment, step S102, loading a plurality of sub-pools of a full picture pool with a plurality of pictures to be played in a play task in turn, includes:
acquiring a plurality of storage data corresponding to a plurality of pictures to be played in a playing task;
sequentially analyzing the plurality of storage data to sequentially obtain the reading addresses used when each picture to be played in the playing task is called; the method comprises the steps of,
after each reading address is obtained, the reading address is loaded into a picture pool so as to read a plurality of pictures to be played in the playing task through the reading address for playing.
Specifically, the storage data may be a picture storage address, for example, a local storage address: imaging/1. Png, and, network storage address: http://10.10.10.245:80/images/1.Png. It should be noted that, the storage address of the picture and the read address directly used by the calling picture are different in data format, so after the storage data of the picture is obtained, the storage data can be firstly analyzed to obtain the read address used by the calling picture, and the picture can be directly read by using the read address in the picture pool under the condition that the picture needs to be played, so that the reading speed of the picture is not affected.
The playing task can store a plurality of storage data according to a preset playing sequence through a picture address set, and the length of the picture address set is the number of the storage data in the picture address set, namely the number of a plurality of pictures to be played in the playing task. In this case, acquiring the plurality of storage data includes acquiring a set of picture addresses to acquire the plurality of storage data; and sequentially analyzing the plurality of storage data, including sequentially analyzing the plurality of storage data according to a preset playing sequence, so that a plurality of pictures to be played of the playing task can be conveniently and orderly loaded through the corresponding picture address set of the playing task.
In the embodiment of the invention, compared with the picture, the information quantity of the stored data and the read address is smaller, so that the stored data is obtained more rapidly, the read address is stored more rapidly in the picture pool, and the picture loading is conveniently and rapidly realized by obtaining the stored data and loading the read address.
In an optional embodiment, the picture playing method further includes:
judging whether the total number of pictures to be played is larger than a preset threshold value, wherein,
under the condition that the total number of the pictures to be played is not greater than a preset threshold value, after the pictures to be played in the playing task are loaded in the picture pool, starting to play the pictures to be played in the picture pool;
and under the condition that the total number of the pictures to be played is larger than a preset threshold value, executing a recording step and a playing step in the process of loading the pictures to be played in the picture pool.
It should be noted that, the preset threshold is a value that ensures that the picture loading time is less and the play is smoother when the total number of pictures to be played is greater than the preset threshold. In each example of playing a plurality of pictures, the number and the size of the pictures to be played are not completely consistent, so that in different examples, the preset threshold value can be set to different values.
After a large number of examples of playing a plurality of pictures are tested, the preset threshold value can be set to be 100, and under the condition that the total number of the pictures to be played is larger than the preset threshold value, the picture loading time is short and the playing is smooth.
In the embodiment of the invention, the demarcation is performed through the preset threshold value, wherein the total number of the pictures to be played is smaller under the condition that the total number of the pictures to be played is not greater than the preset threshold value, so that all the pictures to be played in the playing task can be rapidly loaded without adopting the recording step S104 and the playing step S106, and the playing flow is simplified; and when the total number of the pictures to be played is greater than the preset threshold, the total number of the pictures to be played is larger, so that the recording step S104 and the playing step S106 are adopted to simultaneously ensure the quick start and the no-clip playing of the picture playing.
In an optional embodiment, the plurality of sub-pools in the picture pool includes a first picture pool and a second picture pool, and the capacities of the first picture pool and the second picture pool are smaller than the total number of pictures to be played, and step S102, loading the plurality of sub-pools of the picture pool with the plurality of pictures to be played in turn in the play task, includes:
filling a first picture pool and a second picture pool with a plurality of pictures to be played in the playing task in turn; the method comprises the steps of,
and after the first picture pool plays the full picture to be played, the first picture pool is emptied, and after the second picture pool plays the full picture to be played, the second picture pool is emptied.
Fig. 3 is a flowchart of a picture playing method performed under the condition that the number of the plurality of sub-pools in the picture pool is two (i.e., the first picture pool and the second picture pool), and the capacities of the first picture pool and the second picture pool are both the preset capacity m. Referring to fig. 3, loading a plurality of pictures to be played in a playing task in turn to fill a first picture pool and a second picture pool, including:
step S301, a value assigning step, namely assigning zero to an initial loading index and assigning one to an initial recording round n.
Step S302, a loading step, in which an unextracted picture to be played in a playing task is extracted and loaded into a target picture pool, the sequence number of the target picture pool is 2-n%2 which is the difference between two target values and a first target value, and the first target value is n%2 of the remainder of the initial recording round n and two divisions; and a loading recording step, namely adding one to the initial loading index to obtain the current loading index.
For example, if the initial recording round is 1, the target picture pool is the first picture pool; if the initial recording round is 2, the target picture pool is a second picture pool; if the initial recording round is 3, the target picture pool is the first picture pool again, and so on, and as the recording round increases, the target picture pool is selected from the first picture pool and the second picture pool in turn.
Step S303, judging whether the current loading index is equal to a second target value, wherein the second target value is the product n x m of the initial recording round and the preset capacity.
Step S304, a round recording step, namely adding one to the initial recording round to obtain the current recording round under the condition that the current loading index is equal to a second target value, and determining the current recording round as the initial recording round;
step S305, returning to the step, and determining the current loading index as the initial loading index and returning to the step of loading execution until a plurality of pictures to be played in the playing task are loaded under the condition that the current loading index is not equal to the second target value or after the round recording step is completed.
It should be noted that, determining whether the plurality of pictures to be played in the playing task are loaded can be implemented by the method included in the step S205 after the step S302, that is, determining whether the current loading index is smaller than the total number of the pictures to be played, if so, indicating that the plurality of pictures to be played in the playing task are not loaded; and if the number of the pictures to be played is not less than the total number of the pictures to be played, indicating that the pictures to be played in the playing task are loaded, and ending loading.
In the embodiment of the invention, the purpose of filling the first picture pool and the second picture pool in turn is realized by combining the parameters of the initial recording round, the current recording round, the initial loading index and the current loading index and the association processing of the initial recording round and the target picture pool sequence number.
In this embodiment, the playing step may be performed after step S302, where the playing step specifically includes:
step S306, judging whether the current loading index is not less than the play start value;
step S307, sequentially playing the pictures to be played in the target picture pool according to the preset playing sequence under the condition that the current loading index is not less than the playing start value
It should be noted that, after the step S306, if the current loading index is smaller than the play start value, no operation is performed.
In an alternative embodiment, the currently loaded picture pool (i.e. the target picture pool) in the first picture pool and the second picture pool is changed to load the pictures to be played after the pictures to be played are loaded and when the playing quantity of the currently loaded pictures to be played is equal to the pool changing threshold value. Fig. 4 shows a flowchart of a picture playing method in this embodiment, and the pool-changing threshold value adopts a play start value. Referring to fig. 4, the picture playing method is to adjust the steps S301 to S307 as follows:
step S301, a value assigning step, which further comprises assigning zero to the play index;
step S307, after starting to play the pictures to be played in the picture pool, adding one to the play index per play of one picture to be played to obtain an updated play index; the method comprises the steps of,
if the current load index is equal to the second target value after the determination in step S303, no operation may be performed (i.e., step S304 shown in fig. 3 is not performed), but the following steps are performed after step S307:
step S308, judging whether a first condition and a second condition are simultaneously met, wherein the first condition is that the updated play index is not less than the sum of a third target value and a play start value, the second condition is that the current loading index is equal to the second target value, the third target value is the product of a target difference value and a preset capacity m, and the target difference value is the reduction of 1 of an initial recording round n;
step S309, in the case where the first condition and the second condition are simultaneously satisfied, the initial recording round is added by one to obtain the current recording round, and the current recording round is determined as the initial recording round and then the step S302 is executed.
In the embodiment of the present invention, the updated play index is not less than the sum of the third target value and the play start value, and then the initial record round is added by one to obtain the current record round, that is, the initial record round is not increased under the condition that the updated play index is less than the sum of the third target value and the play start value, so that if the current load index is equal to the second target value after the judgment in step S303, the number of the play pictures needs to be waiting to reach the sum of the third target value and the play start value, which is favorable for avoiding the situation that too many pictures are loaded but play is not performed, especially for the operation that the play of the pictures needs to be paused, the loading of more pictures is stopped immediately after the play is stopped midway, and no influence is caused to other subsequent operations of the browser.
In an alternative embodiment, the emptying operation is performed on the first picture pool after the first picture pool plays the full picture to be played, and the emptying operation is performed on the second picture pool after the second picture pool plays the full picture to be played, including:
step S310, judging whether the updated play index is equal to a third target value;
step S311, in the case that the updated play index is equal to the third target value, the pictures to be played in the picture pools except the target picture pool in the first picture pool and the second picture pool are emptied.
It should be noted that, after the step S310, if the updated play index is not equal to the third target value, no operation is performed.
The embodiment of the invention provides a feasible implementation mode of alternately emptying the first picture pool or the second picture pool, provides preparation for the first picture pool and the second picture pool to be utilized for filling the pictures to be played, and particularly for a large number of pictures to be played, two picture pools with smaller capacity can meet continuous loading and continuous playing of the pictures, is beneficial to saving storage resources, and reduces the operation pressure of a browser.
Fig. 5 is a block diagram of a picture playing system according to an embodiment of the present invention. Referring to fig. 5, the picture playing system includes:
the loading module 100 is configured to load a plurality of sub-pools of the picture pool with a plurality of pictures to be played in the play task in turn;
the recording module 200 is used for recording the number of the pictures to be played in the picture pool in the process of loading the pictures to be played in the picture pool;
and the playing module 300 is used for starting to play the pictures to be played in each sub-pool according to the loading sequence of the sub-pools when the number of the pictures to be played is recorded to be not less than the playing start value, and the pictures to be played in each sub-pool are emptied after the loaded pictures to be played are played in each sub-pool, wherein the playing start value is smaller than the total number of the pictures to be played of the playing task.
According to the picture playing system provided by the embodiment of the invention, the plurality of sub-pools of the picture pool load a plurality of pictures to be played in the playing task in turn, so that the occupation of storage resources is saved, and the storage pressure of a browser is reduced; when the number of the pictures to be played is recorded by the recording module and is not smaller than the playing start value, the playing module starts to play the pictures to be played in the picture pool, and the playing start value is smaller than the total number of the pictures to be played of the playing task, so that all the pictures to be played of the playing task do not need to be imported at a higher speed at one time, and the pictures to be played of the playing task do not need to be loaded into the picture pool, namely, the technical effects of shortening the loading time of the pictures before playing and relieving the operation pressure of the browser are achieved by reducing the loading number of the pictures before playing, and the technical problems that the playing start of a traditional picture playing method is slow and the browser is easy to crash are solved.
In an alternative embodiment, the loading module is configured to:
acquiring a plurality of storage data corresponding to a plurality of pictures to be played in a playing task;
sequentially analyzing the plurality of storage data to sequentially obtain the reading addresses used when each picture to be played in the playing task is called; the method comprises the steps of,
after each reading address is obtained, the reading address is loaded into a picture pool so as to read a plurality of pictures to be played in the playing task through the reading address for playing.
In an alternative embodiment, the playing task stores a plurality of storage data according to a preset playing sequence through a picture address set, and the loading module is used for:
acquiring a picture address set to acquire a plurality of storage data; the method comprises the steps of,
and sequentially analyzing the plurality of storage data according to a preset playing sequence.
In an alternative embodiment, the picture playing system further includes a demarcation module for:
judging whether the total number of pictures to be played is larger than a preset threshold value or not;
under the condition that the total number of the pictures to be played is not greater than a preset threshold value, after the pictures to be played in the playing task are loaded in the picture pool, starting to play the pictures to be played in the picture pool;
and under the condition that the total number of the pictures to be played is larger than a preset threshold value, executing a recording step and a playing step in the process of loading the pictures to be played in the picture pool.
In an alternative embodiment, the preset threshold is 100.
In an alternative embodiment, the plurality of sub-pools of the picture pool includes a first picture pool and a second picture pool, and capacities of the first picture pool and the second picture pool are smaller than a total number of pictures to be played, and the loading module is configured to:
filling a first picture pool and a second picture pool with a plurality of pictures to be played in the playing task in turn; the method comprises the steps of,
and after the first picture pool plays the full picture to be played, the first picture pool is emptied, and after the second picture pool plays the full picture to be played, the second picture pool is emptied.
In an alternative embodiment, the loading module is configured to:
and when the current loading picture pools in the first picture pool and the second picture pool are full of pictures to be played and the playing quantity of the current loaded pictures to be played is equal to the pool changing threshold value, the other picture pool is changed to load the pictures to be played.
In an alternative embodiment, the capacities of the first picture pool and the second picture pool are both preset capacities, and the loading module is configured to execute the following steps:
a value assigning step, namely assigning zero to an initial loading index and assigning one to an initial recording round;
a loading step, namely extracting one picture to be played, which is not extracted in the playing task, to load the picture to a target picture pool, wherein the sequence number of the target picture pool is the difference between two and a first target numerical value, and the first target numerical value is the remainder of recording the round and dividing the two;
a loading recording step, namely adding one to the initial loading index to obtain a current loading index;
judging, namely judging whether the current loading index is equal to a second target value, wherein the second target value is the product of the initial recording round and the preset capacity;
a round recording step, namely adding one to the initial recording round to obtain a current recording round under the condition that the current loading index is equal to a second target value, and determining the current recording round as the initial recording round;
and returning to the step, wherein the current loading index is determined to be the initial loading index and returned to the step of executing loading until a plurality of pictures to be played in the playing task are loaded under the condition that the current loading index is not equal to the second target value or after the step of recording the turns is completed.
In an alternative embodiment, the pool-changing threshold is equal to the play-out start value,
the assigning step further comprises: assigning zero to the play index;
the playing step further comprises: after the pictures to be played in the picture pool are started to be played, adding one to the play index for each picture to be played to obtain an updated play index;
the execution conditions of the round recording step are as follows: the updated play index is not less than the sum of the third target value and the play start value, so that when the target picture pool is loaded with the pictures to be played and the play quantity of the currently loaded pictures to be played is equal to the pool changing threshold value, another picture pool is changed to load the pictures to be played,
the third target value is the product of the target difference value and the preset capacity, and the target difference value is the initial recording round minus 1.
In an alternative embodiment, the loading module is configured to:
judging whether the updated play index is equal to a third target value;
and under the condition that the updated play index is equal to the third target value, the pictures to be played in the picture pools except the target picture pool in the first picture pool and the second picture pool are emptied.
An image playing device according to an embodiment of the present invention includes:
a memory for storing computer instructions;
and the processor is coupled to the memory and is configured to execute the picture playing method based on the computer instructions stored in the memory.
The apparatus shown in fig. 6 is only one example of a picture playing device, and should not be construed as limiting the function and scope of use of the embodiment of the present invention. Referring to fig. 6, the message processing apparatus includes a processor 601, a memory 602, and an input-output device 603 connected through a bus. The memory 602 includes Read Only Memory (ROM) and Random Access Memory (RAM), and the memory 602 stores various computer instructions and data required to perform system functions, and the processor 601 reads the various computer instructions from the memory 602 to perform various appropriate actions and processes. The input-output device 603 includes an input portion of a keyboard, a mouse, or the like; an output section including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), etc., and a speaker, etc.; a storage section including a hard disk or the like; and a communication section including a network interface card such as a LAN card, a modem, and the like. The memory 602 also stores the following computer instructions to perform the operations specified by the picture playing method according to the embodiment of the present invention: the method comprises the steps of loading a plurality of pictures to be played in a playing task into a plurality of sub-pools of a picture pool in turn, and executing a recording step and a playing step in the process of loading the pictures to be played in the picture pool, wherein the recording step comprises the following steps: recording the number of pictures to be played in a picture pool; the playing step comprises the following steps: when the number of the pictures to be played is recorded to be not smaller than the play start value, the pictures to be played in each sub-pool are started to be played according to the loading sequence of the sub-pools, and the pictures to be played which are fully loaded in each sub-pool are emptied after being played, wherein the play start value is smaller than the total number of the pictures to be played of the play task.
Accordingly, an embodiment of the present invention provides a computer-readable storage medium storing computer instructions that, when executed, implement operations specified by the above-described picture playback method.
The flowcharts, block diagrams in the figures illustrate the possible architecture, functionality, and operation of the systems, methods, devices according to the embodiments of the present invention, and the blocks in the flowcharts and block diagrams may represent a module, a program segment, or a code segment alone, which is executable instructions for implementing the specified logical function(s). It should also be noted that executable instructions that implement the specified logic functions may be recombined to generate new modules and program segments. The blocks of the drawings and the order of the blocks are thus merely to better illustrate the processes and steps of the embodiments and should not be taken as limiting the invention itself.
The various modules or units of the system may be implemented in hardware, firmware, or software. The software includes, for example, code programs formed using various programming languages such as JAVA, C/C++/C#, SQL, and the like. Although steps and sequences of steps of embodiments of the present invention are presented in terms of methods and apparatus, executable instructions for implementing the specified logical function(s) of steps may be rearranged to generate new steps. The order of steps should not be limited to only the method and the order of steps in the method illustration, but can be adjusted at any time according to the functional requirements. For example, some of the steps may be performed in parallel or in reverse order.
Systems and methods according to the present invention may be deployed on a single or multiple servers. For example, different modules may be deployed on different servers, respectively, to form a dedicated server. Alternatively, the same functional units, modules, or systems may be distributed across multiple servers to relieve load pressure. Servers include, but are not limited to, multiple PCs, PC servers, blades, supercomputers, etc. connected over the Internet in the same local area network.
The above is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and variations of the present invention will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (12)

1. A picture playing method, comprising:
a plurality of sub-pools of a picture pool are filled up in turn with a plurality of pictures to be played in a playing task, and in the process of loading the pictures to be played in the picture pool, a recording step and a playing step are executed, wherein,
the recording step includes: recording the number of pictures to be played in the picture pool;
the playing step comprises the following steps: when the number of the pictures to be played is recorded to be not smaller than a play start value, the pictures to be played in each sub-pool are started to be played according to the loading sequence of the sub-pools, and the pictures to be played which are fully loaded in each sub-pool are emptied after being played, wherein the play start value is smaller than the total number of the pictures to be played of the play task.
2. The picture playing method according to claim 1, wherein the step of alternately loading a plurality of sub-pools of the full picture pool with a plurality of pictures to be played in a play task comprises:
acquiring a plurality of storage data corresponding to a plurality of pictures to be played in the play task;
sequentially analyzing the plurality of storage data to sequentially obtain reading addresses used when each picture to be played in the playing task is called; the method comprises the steps of,
and after each reading address is obtained, loading the reading address into the picture pool so as to read a plurality of pictures to be played in the playing task through the reading address for playing.
3. The picture playback method as claimed in claim 2, characterized in that,
the playing task stores the plurality of storage data according to a preset playing sequence through a picture address set;
the method for obtaining the plurality of storage data corresponding to the plurality of pictures to be played in the playing task comprises the following steps: acquiring the picture address set to acquire the plurality of storage data;
sequentially parsing the plurality of storage data, including: and sequentially analyzing the plurality of storage data according to the preset playing sequence.
4. The picture playing method according to claim 1, further comprising:
judging whether the total number of the pictures to be played is larger than a preset threshold value or not;
when the total number of the pictures to be played is not greater than the preset threshold value, starting to play the pictures to be played in the picture pool after the pictures to be played in the playing task are loaded in the picture pool;
and under the condition that the total number of the pictures to be played is larger than the preset threshold value, executing the recording step and the playing step in the process of loading the pictures to be played in the picture pool.
5. The picture playing method according to claim 4, wherein the preset threshold is 100.
6. The picture playing method according to claim 1, wherein the plurality of sub-pools of the picture pool includes a first picture pool and a second picture pool, and the capacities of the first picture pool and the second picture pool are smaller than the total number of pictures to be played, and the step of alternately loading the plurality of sub-pools of the picture pool with the plurality of pictures to be played in the play task includes:
filling the first picture pool and the second picture pool with a plurality of pictures to be played in the playing task in turn; the method comprises the steps of,
and after the first picture pool plays the full picture to be played, carrying out emptying operation on the first picture pool, and after the second picture pool plays the full picture to be played, carrying out emptying operation on the second picture pool.
7. The method according to claim 6, wherein the currently loaded picture pool in the first picture pool and the second picture pool is changed to load the picture to be played after the picture to be played is loaded and when the number of the currently loaded pictures to be played is equal to the pool changing threshold.
8. The method for playing pictures according to claim 7, wherein the capacities of the first picture pool and the second picture pool are both preset capacities, and the loading the first picture pool and the second picture pool with the plurality of pictures to be played in the playing task in turn comprises:
a value assigning step, namely assigning zero to an initial loading index and assigning one to an initial recording round;
a loading step, namely extracting one picture to be played, which is not extracted in the playing task, to load the picture to a target picture pool, wherein the sequence number of the target picture pool is the difference between two and a first target value, and the first target value is the remainder of recording the round and the two division;
a loading recording step, namely adding one to the initial loading index to obtain a current loading index;
judging whether the current loading index is equal to a second target value or not, wherein the second target value is the product of the initial recording round and the preset capacity;
a round recording step of adding one to the initial recording round to obtain a current recording round and determining the current recording round as an initial recording round under the condition that the current loading index is equal to the second target value;
and returning to the step, wherein the current loading index is determined to be an initial loading index and the loading step is returned to be executed until a plurality of pictures to be played in the playing task are loaded under the condition that the current loading index is not equal to the second target value or after the round recording step is executed.
9. The picture playback method as claimed in claim 8, wherein the pool-changing threshold value is equal to the playback start value,
the assigning step further includes: assigning zero to the play index;
the playing step further includes: after starting to play the pictures to be played in the picture pool, adding one to the play index for each picture to be played to obtain the updated play index;
the execution conditions of the round recording step are as follows: the updated play index is not smaller than the sum of a third target value and the play start value, so that when the target picture pool is loaded with the pictures to be played and the play quantity of the pictures to be played which are currently loaded is equal to the pool changing threshold value, another picture pool is changed to load the pictures to be played,
the third target value is the product of a target difference value and the preset capacity, and the target difference value is the initial recording round minus 1.
10. The picture playing method according to claim 9, wherein the step of performing a purging operation on the first picture pool after the first picture pool plays the full picture to be played and performing a purging operation on the second picture pool after the second picture pool plays the full picture to be played comprises:
judging whether the updated play index is equal to the third target value;
and under the condition that the updated play index is equal to the third target value, clearing pictures to be played in the picture pools except the target picture pool in the first picture pool and the second picture pool.
11. A computer readable storage medium storing computer instructions which, when executed, implement the picture playing method of any one of claims 1 to 10.
12. A picture playback apparatus, comprising:
a memory for storing computer instructions;
a processor coupled to the memory, the processor configured to perform implementing the picture playing method of any one of claims 1 to 10 based on computer instructions stored by the memory.
CN201910521648.6A 2019-06-17 2019-06-17 Picture playing method and device Active CN112104907B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910521648.6A CN112104907B (en) 2019-06-17 2019-06-17 Picture playing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910521648.6A CN112104907B (en) 2019-06-17 2019-06-17 Picture playing method and device

Publications (2)

Publication Number Publication Date
CN112104907A CN112104907A (en) 2020-12-18
CN112104907B true CN112104907B (en) 2024-02-23

Family

ID=73748551

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910521648.6A Active CN112104907B (en) 2019-06-17 2019-06-17 Picture playing method and device

Country Status (1)

Country Link
CN (1) CN112104907B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102176317A (en) * 2011-01-14 2011-09-07 东软集团股份有限公司 Method and system for realizing multi-screen playing frame level synchronization of passenger guidance system
CN103425504A (en) * 2012-05-18 2013-12-04 阿里巴巴集团控股有限公司 Method and device for loading video files
CN106940722A (en) * 2017-03-16 2017-07-11 青岛海信电器股份有限公司 A kind of image display method and device
CN107371061A (en) * 2017-08-25 2017-11-21 普联技术有限公司 A kind of video stream playing method, device and equipment
CN107450997A (en) * 2017-07-27 2017-12-08 东软集团股份有限公司 The method and device of picture dynamic play
CN107613364A (en) * 2017-08-09 2018-01-19 成都路行通信息技术有限公司 A kind of across storage region picture carousel method and system
CN109144445A (en) * 2018-07-24 2019-01-04 深圳市创易联合科技有限公司 Wireless screen transmission method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4676264B2 (en) * 2004-08-19 2011-04-27 株式会社ソニー・コンピュータエンタテインメント Video playback apparatus and video playback method
US20090150697A1 (en) * 2007-12-06 2009-06-11 Yang Su-Young Media file reproduction apparatus and method
JP6724644B2 (en) * 2016-08-10 2020-07-15 コニカミノルタ株式会社 Data management device and image display system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102176317A (en) * 2011-01-14 2011-09-07 东软集团股份有限公司 Method and system for realizing multi-screen playing frame level synchronization of passenger guidance system
CN103425504A (en) * 2012-05-18 2013-12-04 阿里巴巴集团控股有限公司 Method and device for loading video files
CN106940722A (en) * 2017-03-16 2017-07-11 青岛海信电器股份有限公司 A kind of image display method and device
CN107450997A (en) * 2017-07-27 2017-12-08 东软集团股份有限公司 The method and device of picture dynamic play
CN107613364A (en) * 2017-08-09 2018-01-19 成都路行通信息技术有限公司 A kind of across storage region picture carousel method and system
CN107371061A (en) * 2017-08-25 2017-11-21 普联技术有限公司 A kind of video stream playing method, device and equipment
CN109144445A (en) * 2018-07-24 2019-01-04 深圳市创易联合科技有限公司 Wireless screen transmission method and device

Also Published As

Publication number Publication date
CN112104907A (en) 2020-12-18

Similar Documents

Publication Publication Date Title
US12003743B2 (en) Video stream decoding method and apparatus, terminal device, and storage medium
CN109194960B (en) Image frame rendering method and device and electronic equipment
CN110377263B (en) Image synthesis method, image synthesis device, electronic equipment and storage medium
CN107911709A (en) live interface display method, device and terminal
CN102368779A (en) Supersized image loading and displaying method used for mobile internet device
CN109086105B (en) Page layout conversion method and device and electronic equipment
CN112532998B (en) Method, device and equipment for extracting video frame and readable storage medium
CN111683251A (en) Video data storage method and device and computer readable storage medium
CN110647378A (en) Dynamic image loading method and device and electronic equipment
CN106470353B (en) Multimedia data processing method and device and electronic equipment
CN109729429A (en) Video broadcasting method, device, equipment and medium
CN113226501A (en) Streaming media image providing device and method for application program
CN114339412B (en) Video quality enhancement method, mobile terminal, storage medium and device
CN112104907B (en) Picture playing method and device
CN116483587B (en) Video super-division parallel method, server and medium based on image segmentation
CN116193206B (en) High-quality content screening method, device, terminal equipment and storage medium
US6954207B2 (en) Method and apparatus for processing pixels based on segments
US20160142456A1 (en) Method and Device for Acquiring Media File
US10165245B2 (en) Pre-fetching video content
CN115629711A (en) Packet writing alignment method, system, device and medium
CN115049531A (en) Image rendering method and device, graphic processing equipment and storage medium
KR102231875B1 (en) Apparatus and method for providing streaming video or application program
CN110377258B (en) Image rendering method and device, electronic equipment and storage medium
CN114501084A (en) Play starting method, device, equipment and medium of player
CN105306836B (en) A kind of image display method and apparatus

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
TA01 Transfer of patent application right

Effective date of registration: 20221209

Address after: 710000 second floor, building B3, yunhuigu, No. 156, Tiangu 8th Road, software new town, high tech Zone, Xi'an, Shaanxi

Applicant after: Xi'an Guangqi Intelligent Technology Co.,Ltd.

Address before: 710000 second floor, building B3, yunhuigu, 156 Tiangu 8th Road, software new town, Xi'an high tech Zone, Xi'an City, Shaanxi Province

Applicant before: Xi'an Guangqi Future Technology Research Institute

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant