CN111723219B - Method, apparatus, device and storage medium for playing multimedia - Google Patents

Method, apparatus, device and storage medium for playing multimedia Download PDF

Info

Publication number
CN111723219B
CN111723219B CN202010616794.XA CN202010616794A CN111723219B CN 111723219 B CN111723219 B CN 111723219B CN 202010616794 A CN202010616794 A CN 202010616794A CN 111723219 B CN111723219 B CN 111723219B
Authority
CN
China
Prior art keywords
instance
state
multimedia
target instance
target
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
CN202010616794.XA
Other languages
Chinese (zh)
Other versions
CN111723219A (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202010616794.XA priority Critical patent/CN111723219B/en
Publication of CN111723219A publication Critical patent/CN111723219A/en
Application granted granted Critical
Publication of CN111723219B publication Critical patent/CN111723219B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/40Information retrieval; Database structures therefor; File system structures therefor of multimedia data, e.g. slideshows comprising image and additional audio data
    • G06F16/48Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/40Information retrieval; Database structures therefor; File system structures therefor of multimedia data, e.g. slideshows comprising image and additional audio data
    • G06F16/43Querying
    • G06F16/438Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Library & Information Science (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The application discloses a method, a device, equipment and a storage medium for playing multimedia, relating to the field of video processing and image processing. The specific implementation scheme is as follows: receiving a multimedia playing request, wherein the multimedia playing request comprises a target instance identifier of a target instance for playing multimedia; determining a target instance state corresponding to the target instance identifier according to the target instance identifier and a preset state pool, wherein the state pool is used for storing the corresponding relation between the instance identifier and the instance state; determining a target instance from a preset instance pool in response to determining that the target instance state is an active state; according to the target instance, multimedia is played. According to the implementation method, the multimedia corresponding to the target instance can be played according to the multimedia playing request containing the target instance identifier and the corresponding target instance state, the instance does not need to be created according to the request each time, the memory consumption is reduced, and the resource pressure is relieved.

Description

Method, apparatus, device and storage medium for playing multimedia
Technical Field
The present application relates to the field of computer technology, and in particular, to the field of video processing and image processing, and in particular, to a method, an apparatus, a device, and a storage medium for playing multimedia.
Background
As mobile devices become more powerful, scenes in which multiple videos are simultaneously played are widely supported. Some applications do not have a limit or simple limit on the number of instances. Each instance corresponds to a played video, and when the number of the instances exceeds a certain number, occupied memory and CPU resources are increased, so that the video is blocked, and the product quality and the user experience are affected.
In the prior art, the instance needs to be re-created according to the request every time, and the memory resource occupation is large.
Disclosure of Invention
The present disclosure provides a method, apparatus, device, and storage medium for playing multimedia.
According to an aspect of the present disclosure, there is provided a method for playing multimedia, the method comprising: receiving a multimedia playing request, wherein the multimedia playing request comprises a target instance identifier of a target instance for playing multimedia; determining a target instance state corresponding to the target instance identifier according to the target instance identifier and a preset state pool, wherein the state pool is used for storing the corresponding relation between the instance identifier and the instance state; determining a target instance from a preset instance pool in response to determining that the target instance state is an active state; according to the target instance, multimedia is played.
According to another aspect of the present disclosure, there is provided an apparatus for playing multimedia, the apparatus comprising: a receiving unit configured to receive a multimedia play request including a target instance identification of a target instance for playing multimedia; the system comprises a target instance state determining unit, a state determining unit and a state determining unit, wherein the target instance state determining unit is configured to determine a target instance state corresponding to a target instance identifier according to the target instance identifier and a preset state pool, and the state pool is used for storing the corresponding relation between the instance identifier and the instance state; a target instance determining unit configured to determine a target instance from a preset instance pool in response to determining that the target instance state is an active state; and a multimedia playing unit configured to play multimedia according to the target instance.
According to still another aspect of the present disclosure, there is provided an electronic apparatus including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method for playing multimedia as described above.
According to yet another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the method for playing multimedia as described above.
According to yet another aspect of the present disclosure, a computer program product is provided, comprising a computer program which, when executed by a processor, implements a method for playing multimedia as described above.
According to the technology provided by the application, the problems that an instance needs to be re-created and a large memory is occupied when the multimedia is played are solved, the multimedia corresponding to the target instance is played according to the multimedia playing request containing the target instance identifier and the corresponding target instance state, the instance does not need to be created according to the request each time, the memory consumption is reduced, and the resource pressure is relieved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are included to provide a better understanding of the present application and are not to be construed as limiting the application. Wherein:
FIG. 1 is an exemplary system architecture diagram in which an embodiment of the present application may be applied;
FIG. 2 is a flow chart of one embodiment of a method for playing multimedia in accordance with the present application;
fig. 3 is a flowchart of another embodiment of a method for playing multimedia according to the present application;
fig. 4 is a schematic view of an application scenario of the method for playing multimedia according to the present application;
Fig. 5 is a schematic structural view of an embodiment of an apparatus for playing multimedia according to the present application;
Fig. 6 is a block diagram of an electronic device for implementing a method for playing multimedia according to an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present application will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present application are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other. The application will be described in detail below with reference to the drawings in connection with embodiments.
Fig. 1 shows an exemplary system architecture 100 to which an embodiment of a method for playing multimedia or an apparatus for playing multimedia of the present application may be applied.
As shown in fig. 1, a system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or send messages or the like. Various communication client players, such as a web browsing type application, a video playing type application, etc., may be installed on the terminal devices 101, 102, 103.
The terminal devices 101, 102, 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices including, but not limited to, smartphones, tablets, car-mounted computers, laptop and desktop computers, and the like. When the terminal devices 101, 102, 103 are software, they can be installed in the above-listed electronic devices. Which may be implemented as multiple software or software modules (e.g., to provide distributed services), or as a single software or software module. The present invention is not particularly limited herein.
The server 105 may be a server providing various services, such as a background server providing support for video played on the terminal devices 101, 102, 103. The background server may provide video assets to the terminal devices 101, 102, 103 for playback.
The server 105 may be hardware or software. When the server 105 is hardware, it may be implemented as a distributed server cluster formed by a plurality of servers, or as a single server. When server 105 is software, it may be implemented as a plurality of software or software modules (e.g., to provide distributed services), or as a single software or software module. The present invention is not particularly limited herein.
It should be noted that the method for playing multimedia provided by the embodiment of the present application is generally performed by the terminal devices 101, 102, 103. Accordingly, means for playing multimedia are typically provided in the terminal devices 101, 102, 103.
It will be appreciated that when the video played in the terminal devices 101, 102, 103 is a local video, the network 104 and the server 105 may not be included in the architecture 100.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to fig. 2, a flow 200 of one embodiment of a method for playing multimedia in accordance with the present application is shown. The method for playing multimedia of the present embodiment includes the following steps:
step 201, a multimedia play request is received.
In this embodiment, the execution body of the method for playing multimedia (for example, the terminal devices 101, 102, 103 shown in fig. 1) may receive the multimedia playing request triggered by the user through a wired connection or a wireless connection. The multimedia play request includes a target instance identification of a target instance for playing the multimedia. The multimedia play request may be input by the user through the terminal device and then sent to the execution subject. Such inputs may include text input, touch input, voice input, and the like. After the multimedia playing request is processed, the video requested by the user can be played. The multimedia play may include text play, sound play and image play, video play, animation play, etc. For example, when a user browses a web page, clicking a "click" in a video corresponds to sending a multimedia play request through input to a terminal device, and the terminal device may process the multimedia play request after receiving the multimedia play request. After the multimedia play request is processed, the multimedia requested by the user, such as video, animation, etc., may be played. The target instance identifier included in the multimedia playing request is an identifier of a target instance corresponding to the multimedia requested to be played, which can be understood as a target instance ID, and the multimedia required by the user can be played by starting the target instance.
Step 202, determining a target instance state corresponding to the target instance identifier according to the target instance identifier and a preset state pool.
In this embodiment, the state pool is used to store the correspondence between the instance identifier and the instance state. After receiving the multimedia playing request, the executing body can query whether the state pool comprises a target instance state corresponding to a target instance Identifier (ID) through a preset ID index according to the target instance identifier contained in the request. Here, the instance states may include an active state, an inactive state. The execution body may modify the instance state, for example, modify the inactive state to an active state. An instance of the inactive state cannot be used to play video and an instance of the active state can be used to play video.
In step 203, in response to determining that the target instance state is an active state, the target instance is determined from a preset instance pool.
In this embodiment, after determining the target instance state corresponding to the target instance identifier, the execution body determines whether the target instance state is an active state, and determines the target instance from a preset instance pool in response to determining that the target instance state is an active state. Specifically, after determining that the activation state of the target instance corresponding to the target instance identifier exists in the state pool, the execution body can query the corresponding target instance from the instance pool according to the target instance identifier in an ID index manner. An instance pool may be a storage unit (e.g., memory, cache, hard disk, etc.) in the execution body that stores created instances, each of which corresponds to a unique ID.
Step 204, playing the multimedia according to the target instance.
In this embodiment, after the execution body obtains the target instance, the execution body may play the multimedia according to the target instance. Each instance corresponds to a multimedia. The target instance corresponds to the multimedia to be played. The multimedia herein may be video, animation, etc.
According to the embodiment of the application, the multimedia corresponding to the target instance is played according to the multimedia playing request containing the target instance identifier and the corresponding target instance state, so that the instance does not need to be created according to the request each time, the memory consumption is reduced, and the resource pressure is relieved.
With continued reference to fig. 3, a flow 3000 of another embodiment of a method for playing multimedia according to the present application is shown. As shown in fig. 3, the method for playing multimedia of the present embodiment includes the following steps:
A request 301 is first received, which may be a multimedia play request or a multimedia close request. If a multimedia play request is received, performing steps 302, 3021, 30211, 30213 or 302, 3021, 30212, 30213 or performing steps 302, 3022, 30221; steps 303 to 3032 are performed if a multimedia shutdown request is received.
Step 302, a multimedia play request is received.
Step 3021, determining a target instance state corresponding to the target instance identifier according to the target instance identifier and a preset state pool.
In response to determining that the target instance state is an active state, a target instance is determined from a pre-set instance pool, step 30211.
Step 30213, playing the multimedia according to the target instance.
The principle of steps 302 to 30213 is similar to that of steps 201 to 204, and will not be described here again.
In this embodiment, the method for playing multimedia may further include the steps of:
In response to determining that the target instance state is inactive, the target instance is restored and activated according to the inactive state 30212.
When the execution body determines that the state of the target instance is the inactive state, the execution body can recover and activate the target instance according to the inactive state. When an instance state is inactive, the owned resources are released, saving memory. In the inactive state, data capable of recovering the instance is stored, and the instance is recovered according to the instance data in the inactive state. Specifically, the instance recovery can be performed by programmatically constructing the target instance from the data saved in the inactive state of the instance. The instance is activated after the instance is restored.
In this embodiment, the method for playing multimedia may further include the steps of:
Step 3022, creating a target instance for playing multimedia.
After receiving the multimedia playing request, the executing body can acquire data required by the composing target instance from the network environment, and composes the target instance by using the data. After the target instance is successfully built, the executing host registers the created instance, registers an instance identifier (instance ID), and the ID value corresponding to each instance is unique.
According to the embodiment, the target instance is created and the unique instance Identification (ID) is registered for the created target instance, so that multimedia can be played more accurately according to the target instance identification, disorder of multimedia playing is prevented, and user experience is improved. And the activated target instance is added into the instance pool, so that the target instance can be reused, the target instance does not need to be repeatedly created when multimedia needs to be played, and the memory is saved.
In step 30221, the state of the target instance is set to an active state, and the active target instance is added to the instance pool.
After the execution body creates a target instance for playing multimedia, the newly created target instance is in an inactive state, the execution body may set the state of the target instance to an active state, and add the active target instance to the instance pool. The target instance in the active state can be used for playing the multimedia. An instance pool may be a storage unit (e.g., memory, cache, hard disk, etc.) in the execution body that stores created instances, each of which corresponds to a unique ID.
In this embodiment, the method for playing multimedia may further include the following steps, not shown in fig. 3: the inactive state of the instance is stored in the secondary cache and the active state of the instance is stored in the primary cache.
Specifically, after the execution body creates the target instance, the inactive state of the created target instance may be stored in the second level cache of the state pool, and the active state of the activated target instance may be stored in the first level cache of the state pool. The state pool comprises a first level cache and a second level cache. The second level cache is a buffer of the first level cache, and all data stored in each level cache is part of the next level cache. For example, all data stored in the primary cache is part of the secondary cache.
According to the embodiment, two levels of cache units are adopted for storing the instance states, so that the index speed can be improved, unnecessary time expenditure is reduced, the problems of video playing, black screen, blocking, even breakdown and the like in a video applet multi-video instance scene can be effectively solved, the instance destroyed before the recovery can be unobscured, the user experience is greatly improved, the memory occupation can be reduced and the memory resource is saved by storing the inactive state of the instance in the secondary cache.
Step 303, a multimedia shutdown request is received.
In this embodiment, the executing body (for example, the terminal devices 101, 102, 103 shown in fig. 1) may receive the multimedia shutdown request triggered by the user through a wired connection or a wireless connection. The multimedia shutdown request includes a target instance identification of a target instance corresponding to the multimedia to be shutdown. The multimedia closing request may be input by the user through the terminal device and then transmitted to the execution subject. Such inputs may include text input, touch input, voice input, and the like. After the multimedia shutdown request is processed, the video requested by the user may be shutdown. Multimedia shutdown may include shutdown of text playback, shutdown of sound playback and shutdown of image playback, video playback, animation playback, etc. For example, when a user views multimedia, for example, when viewing a video, clicking on the "close" button in a video corresponds to sending a multimedia close request through input to the terminal device, and the terminal device may process the multimedia close request after receiving the multimedia close request. After the multimedia shutdown request is processed, the user-requested multimedia, such as video, animation, etc., may be shutdown. The target instance identifier included in the multimedia closing request is an identifier of a target instance corresponding to the multimedia requested to be closed, which can be understood as a target instance ID, and the multimedia required to be closed by the user can be closed by closing the target instance.
In step 3031, in response to determining that the number of instances in the instance pool is greater than the preset instance number threshold, the least frequently used instances are destroyed.
Specifically, after receiving the multimedia closing request, the executing body determines that the number of instances in the instance pool is greater than a preset instance number threshold, and can destroy the instance with the least use times. Executing the main body destruction is the instance with the least use times in the instance pool, and the instance state in the state pool is not destroyed. For example, when the number of instances preset in the instance pool is 10 and the sum of the number of instances in the instance pool is 12, the execution body needs to sort the number of times of using the 12 instances, obtain the instances sorted in the last 2 bits, and destroy the instances. The present application does not specifically limit the threshold value of the number of preset instances stored in the instance pool. Of course, it is understood that the step 3031 may also be performed when the step 302 receives the multimedia playing request, and the execution timing of the step 3031 is not specifically limited in the present application.
The method and the device can release the resource space by destroying the unusual examples, but are not limited to destroying the state of the examples corresponding to the unusual examples, and reuse the destroyed examples can be started by the examples while releasing the resource space, so that a new example does not need to be re-established according to the request every time, the program is simplified, and the user experience is improved.
Step 3032, destroying the target instance in the instance pool and deleting the instance state corresponding to the target instance identifier in the state pool.
In this embodiment, after receiving the multimedia shutdown request, the executing body may destroy the corresponding target instance in the instance pool according to the target instance identifier carried in the multimedia shutdown request, and delete the target instance state corresponding to the target instance identifier in the state pool. The destroying of the instance and the deleting of the instance state can be applied in the situations that the user closes the multimedia, cleans up the memory or uninstalls the client, and the application scene is not particularly limited by the application.
According to the method and the device, the instance in the instance pool and the instance state in the state pool are destroyed, so that the memory space can be thoroughly released, and the processing speed is improved.
Fig. 4 is a scene graph 400 of a method for playing multimedia according to the present application.
In fig. 4, a client player 401 receives a multimedia play request, where the multimedia play request includes a target instance identifier of a target instance for playing multimedia, and the client player first determines, from a state pool 404 of an instance management unit 402, whether a target instance state corresponding to the target instance identifier exists through an ID index, and if the target instance state exists and is an active state, determines, from an instance pool 403 of the instance management unit 402, a target instance corresponding to the target instance identifier, and plays multimedia according to the target instance; if the target instance exists and the target instance state is the inactive state, recovering and activating the target instance according to the inactive state, and playing the multimedia according to the target instance; if the state of the target instance does not exist in the state pool 404, the client player 401 needs to create the target instance, and after creating the target instance, registers an ID corresponding to the target instance with the instance management unit 402. After the client player 401 creates the target instance, the target instance is in an inactive state, the instance management unit 402 stores the inactive state of the target instance in the secondary cache 406 of the state pool 404, for example, inactive states S3, S4, S5 of the instance, and when the multimedia corresponding to the target instance needs to be played, the instance management unit 402 activates the target instance in the inactive state and stores the active state of the target instance in the primary cache 405 of the state pool 404, for example, active states S0, S1, S2 of the instance. The client player 401 and the instance management unit 402 may both be located in the terminal devices 101, 102, 103 as shown in fig. 1.
The present application also provides an embodiment of an apparatus for playing multimedia, which corresponds to the method embodiment shown in fig. 2, as shown in the schematic structural diagram 500 of the apparatus for playing multimedia shown in fig. 5.
As shown in fig. 5, the apparatus for playing multimedia includes: a receiving unit 501, a target instance state determining unit 502, a target instance determining unit 503, and a multimedia playing unit 504.
The receiving unit 501 is configured to receive a multimedia play request, which includes a target instance identification for playing a target instance of multimedia.
The target instance determining unit 502 is configured to determine a target instance state corresponding to the target instance identifier according to the target instance identifier and a preset state pool, where the state pool is used to store a correspondence between the instance identifier and the instance state.
The target instance state determining unit 503 is configured to determine a target instance from a preset instance pool in response to determining that the target instance state is an active state.
An instance starting unit 503 is configured to play multimedia according to the target instance.
In some optional implementations of the present embodiment, the apparatus 500 for playing multimedia may further include a target instance activation unit, not shown in fig. 5, configured to restore and activate the target instance according to the inactive state in response to determining that the target instance state is the inactive state.
In some optional implementations of the present embodiment, the apparatus 500 for playing multimedia may further include an instance destruction unit, not shown in fig. 5, configured to destroy the instance with the least number of uses in response to determining that the number of instances in the instance pool is greater than the preset instance number threshold.
In some alternative implementations of the present embodiment, the example destruction unit is further configured to: receiving a multimedia closing request, wherein the multimedia closing request comprises a target instance identifier; destroying the target instance in the instance pool and deleting the instance state corresponding to the target instance identification in the state pool.
In some optional implementations of the present embodiment, the apparatus 500 for playing multimedia may further include an instance pool creation unit, not shown in fig. 5, configured to: receiving a multimedia playing request, and creating a target instance for playing multimedia; the state of the target instance is set to an active state, and the active target instance is added to the instance pool.
In some optional implementations of the present embodiment, the state pool includes a first level cache and a second level cache; and the apparatus 500 for playing multimedia may further include a storage unit, not shown in fig. 5, configured to: the inactive state of the instance is stored in the secondary cache and the active state of the instance is stored in the primary cache.
It should be understood that the units 501 to 504 described in the apparatus 500 for playing multimedia correspond to the respective steps in the method described with reference to fig. 2. Thus, the operations and features described above with respect to the method for playing multimedia are equally applicable to the apparatus 500 and the units contained therein, and are not described in detail herein.
According to an embodiment of the present application, the present application also provides an electronic device and a readable storage medium.
A block diagram 600 of an electronic device for implementing a method for playing multimedia according to an embodiment of the present application, as shown in fig. 6, is a block diagram of an electronic device for implementing a method for playing multimedia according to an embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the applications described and/or claimed herein.
As shown in fig. 6, the electronic device includes: one or more processors 601, memory 602, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses 605 and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the electronic device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In other embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple electronic devices may be connected, each providing a portion of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). One processor 601 is illustrated in fig. 6.
The memory 602 is a non-transitory computer readable storage medium provided by the present application. The memory stores instructions executable by the at least one processor to cause the at least one processor to perform the method for playing multimedia provided by the present application. The non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to perform the method for playing multimedia provided by the present application.
The memory 602 is used as a non-transitory computer readable storage medium, and may be used to store a non-transitory software program, a non-transitory computer executable program, and units, such as program instructions/units corresponding to a method for playing multimedia in an embodiment of the present application (e.g., the receiving unit 501, the target instance state determining unit 502, the target instance determining unit 503, and the multimedia playing 504 shown in fig. 5). The processor 601 executes various functional applications of the server and data processing, i.e., implements the method for playing multimedia in the above-described method embodiment, by running non-transitory software programs, instructions, and modules stored in the memory 602.
The memory 602 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, at least one application program required for a function; the storage data area may store data created according to the use of the electronic device for a method of playing multimedia, etc. In addition, the memory 602 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 602 optionally includes memory remotely located relative to the processor 601, which may be connected to the electronic device for the method of playing multimedia over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device for the method of playing multimedia may further include: an input device 603 and an output device 604. The processor 601, memory 602, input devices 603 and output devices 604 may be connected by a bus 605 or otherwise, in fig. 6 by way of example by bus 605.
The input device 603 may receive input numeric or character information and generate key signal inputs related to user settings and function controls of the electronic device for the method of playing multimedia, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointer stick, one or more mouse buttons, a track ball, a joystick, and the like. The output means 604 may include a display device, auxiliary lighting means (e.g., LEDs), tactile feedback means (e.g., vibration motors), and the like. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device may be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASIC (application specific integrated circuit), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
These computing programs (also referred to as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented in a high-level procedural and/or object-oriented programming language, and/or in assembly/machine language. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
According to the technical scheme of the embodiment of the application, the multimedia corresponding to the target instance can be played according to the multimedia playing request containing the target instance identifier and the corresponding target instance state, and the instance is not required to be created according to the request each time, so that the memory consumption is reduced, and the resource pressure is relieved.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present application may be performed in parallel, sequentially, or in a different order, provided that the desired results of the disclosed embodiments are achieved, and are not limited herein.
The above embodiments do not limit the scope of the present application. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application should be included in the scope of the present application.

Claims (13)

1. A method for playing multimedia, comprising:
Receiving a multimedia playing request, wherein the multimedia playing request comprises a target instance identifier of a target instance for playing multimedia;
Determining a target instance state corresponding to the target instance identifier according to the target instance identifier and a preset state pool, wherein the state pool is used for storing the corresponding relation between the instance identifier and the instance state;
In response to determining that the target instance state is an active state, determining the target instance from a preset instance pool, wherein the instance pool is used for storing instances which are created in the past and are in the active state;
In response to determining that the target instance state is an inactive state, recovering and activating the target instance according to the inactive state, wherein data capable of recovering the instance is stored in the inactive state;
And playing the multimedia according to the target example.
2. The method of claim 1, wherein the method further comprises:
And in response to determining that the number of instances in the instance pool is greater than a preset instance number threshold, destroying the instance with the least use number.
3. The method of claim 2, wherein the method further comprises:
receiving a multimedia closing request, wherein the multimedia closing request comprises the target instance identifier;
Destroying the target instance in the instance pool and deleting the instance state corresponding to the target instance identifier in the state pool.
4. A method according to claim 3, wherein the instance pool is created by the steps comprising:
Receiving a multimedia playing request, and creating a target instance for playing multimedia;
setting the state of the target instance to an activated state, and adding the activated target instance to the instance pool.
5. The method of claim 4, wherein the state pool comprises a primary cache and a secondary cache; and
The method further comprises the steps of:
storing the inactive state of the instance in the secondary cache, and storing the active state of the instance in the primary cache.
6. An apparatus for playing multimedia, comprising:
A receiving unit configured to receive a multimedia play request including a target instance identification of a target instance for playing multimedia;
The target instance state determining unit is configured to determine a target instance state corresponding to the target instance identifier according to the target instance identifier and a preset state pool, wherein the state pool is used for storing a corresponding relation between the instance identifier and the instance state;
A target instance determining unit configured to determine the target instance from a preset instance pool for storing instances that have been created in the past and are in an activated state, in response to determining that the target instance state is an activated state;
A target instance activating unit configured to restore and activate the target instance according to a non-activated state in response to determining that the target instance state is the non-activated state, wherein data in which an instance can be restored is stored in the non-activated state;
And the multimedia playing unit is configured to play multimedia according to the target instance.
7. The apparatus of claim 6, wherein the apparatus further comprises:
and the instance destroying unit is configured to destroy the instance with the least use number in response to determining that the number of instances in the instance pool is larger than a preset instance number threshold value.
8. The apparatus of claim 7, wherein the instance destruction unit is further configured to:
receiving a multimedia closing request, wherein the multimedia closing request comprises the target instance identifier;
Destroying the target instance in the instance pool and deleting the instance state corresponding to the target instance identifier in the state pool.
9. The apparatus of claim 8, wherein the apparatus further comprises: an instance pool creation unit configured to:
Receiving a multimedia playing request, and creating a target instance for playing multimedia;
setting the state of the target instance to an activated state, and adding the activated target instance to the instance pool.
10. The apparatus of claim 9, wherein the state pool comprises a primary cache and a secondary cache; and
The apparatus further comprises:
And the storage unit is configured to store the inactive state of the instance in the secondary cache and store the active state of the instance in the primary cache.
11. An electronic device, comprising:
At least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-5.
13. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-5.
CN202010616794.XA 2020-06-30 2020-06-30 Method, apparatus, device and storage medium for playing multimedia Active CN111723219B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010616794.XA CN111723219B (en) 2020-06-30 2020-06-30 Method, apparatus, device and storage medium for playing multimedia

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010616794.XA CN111723219B (en) 2020-06-30 2020-06-30 Method, apparatus, device and storage medium for playing multimedia

Publications (2)

Publication Number Publication Date
CN111723219A CN111723219A (en) 2020-09-29
CN111723219B true CN111723219B (en) 2024-04-26

Family

ID=72570521

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010616794.XA Active CN111723219B (en) 2020-06-30 2020-06-30 Method, apparatus, device and storage medium for playing multimedia

Country Status (1)

Country Link
CN (1) CN111723219B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114095781A (en) * 2021-11-02 2022-02-25 北京鲸鲮信息系统技术有限公司 Multimedia data processing method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108882041A (en) * 2018-07-09 2018-11-23 青岛海信电器股份有限公司 Player status acquisition methods and device
CN109739648A (en) * 2018-12-28 2019-05-10 北京金山安全软件有限公司 Animation playing control method, device, equipment and storage medium
CN109831521A (en) * 2019-03-11 2019-05-31 深圳市珍爱捷云信息技术有限公司 Cache instance management method, apparatus, computer equipment and storage medium
CN110267091A (en) * 2019-05-07 2019-09-20 北京奇艺世纪科技有限公司 Play instance processes method, apparatus and computer readable storage medium
US10693944B1 (en) * 2017-09-12 2020-06-23 Amazon Technologies, Inc. Media-player initialization optimization

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10693944B1 (en) * 2017-09-12 2020-06-23 Amazon Technologies, Inc. Media-player initialization optimization
CN108882041A (en) * 2018-07-09 2018-11-23 青岛海信电器股份有限公司 Player status acquisition methods and device
CN109739648A (en) * 2018-12-28 2019-05-10 北京金山安全软件有限公司 Animation playing control method, device, equipment and storage medium
CN109831521A (en) * 2019-03-11 2019-05-31 深圳市珍爱捷云信息技术有限公司 Cache instance management method, apparatus, computer equipment and storage medium
CN110267091A (en) * 2019-05-07 2019-09-20 北京奇艺世纪科技有限公司 Play instance processes method, apparatus and computer readable storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Pool-Based Active Learning with Query Construction;Zhang, Shanhong等;《FOUNDATIONS OF INTELLIGENT SYSTEMS》;20121219;全文 *
基于Nucleus Plus操作系统的多实例模式的实现;陈发堂;庹勤;;电子技术应用;20120906(09);全文 *
基于缓冲池技术的手术示教视频播放系统研究;谭珂;潘新华;郭天泉;何胜杰;;中国医学教育技术;20101020(05);全文 *

Also Published As

Publication number Publication date
CN111723219A (en) 2020-09-29

Similar Documents

Publication Publication Date Title
CN110806923B (en) Parallel processing method and device for block chain tasks, electronic equipment and medium
JP7170768B2 (en) Development machine operation task processing method, electronic device, computer readable storage medium and computer program
US11800042B2 (en) Video processing method, electronic device and storage medium thereof
US11175823B2 (en) Method and apparatus for controlling terminal device using gesture control function, and non-transitory computer-readable storage medium
CN111475259A (en) Applet loading method and device and electronic equipment
CN111935502A (en) Video processing method, video processing device, electronic equipment and storage medium
CN111880914A (en) Resource scheduling method, resource scheduling apparatus, electronic device, and storage medium
CN111831752B (en) Spatial arrangement method, device and equipment of distributed database and storage medium
CN111723219B (en) Method, apparatus, device and storage medium for playing multimedia
CN110545324B (en) Data processing method, device, system, network equipment and storage medium
EP3799039A1 (en) Speech control method and apparatus, electronic device, and readable storage medium
CN111339187A (en) Data processing method, device, equipment and storage medium based on intelligent contract
CN111881339A (en) Resource information pushing and informing method and device, electronic equipment and storage medium
CN113158098A (en) Page generation method, device, equipment and medium
JP7257434B2 (en) Voice interaction method, voice interaction device, electronic device, storage medium and computer program product
CN112383825B (en) Video recommendation method and device, electronic equipment and medium
CN111783644B (en) Detection method, detection device, detection equipment and computer storage medium
CN111782357A (en) Label control method and device, electronic equipment and readable storage medium
CN112446728B (en) Advertisement recall method, device, equipment and storage medium
CN112162842A (en) Method, device, electronic equipment and readable storage medium for canceling request
CN112752323A (en) Method and device for changing hotspot access state
CN111882483A (en) Video rendering method and device
CN111651229A (en) Font changing method, device and equipment
CN111723318A (en) Page data processing method, device, equipment and storage medium
CN111935549B (en) Method and device for updating playing sequence

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant