Business management method and device of player, electronic equipment and storage medium
By introducing management modules to monitor and forward player events in the video player, the loose coupling between the player and the business module is achieved, solving the problem of high complexity of traditional design and improving the flexibility and user experience of the system.
Patent Information
- Application Number
- CN202510534057.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2025-07-25
AI Technical Summary
Traditional video player design systems are complex, resulting in difficulty in maintaining and scaling.
By registering the target business party in the business module into the monitoring list of the management module, monitoring the status of the player module, and forwarding events to the target business party when the player module performs operations, the business module enables the corresponding business logic according to the event, and realizes loose coupling between the player and the business module.
It improves the flexibility and scalability of the system, reduces the dependencies between modules, simplifies system maintenance and upgrades, improves development efficiency and stability, and enhances user experience.
Smart Images

Figure CN120371269A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of mobile application development, specifically to the technical field of multimedia processing, and particularly to a service management method, device, electronic device, and storage medium for a player. Background Art
[0002] With the rapid development of the mobile Internet, mobile applications have become an indispensable part of people's daily lives. Among many mobile applications, taking the video player as an example, the playback function of the video player has become a key component due to its rich information transmission ability and high user interactivity. Whether it is social media, online education, or entertainment applications, users expect to enjoy a smooth and feature-rich video playback experience.
[0003] However, the traditional video player design system has a high complexity, making maintenance and expansion difficult. Therefore, there is an urgent need for a new video player design to solve the above problems. Summary of the Invention
[0004] The present disclosure provides a service management method, device, electronic device, and storage medium for a player.
[0005] According to one aspect of the present disclosure, there is provided a service management method for a player, which is applied to a management module. The method includes:
[0006] Obtain a target service party included in a service module, where the target service party has been registered in the management module and is used to monitor the status of a player module;
[0007] When the player module executes a playback operation, monitor player events of the player module;
[0008] Forward the monitored player events to the registered target service party, and the target service party executes service logic corresponding to the target service party according to the player events.
[0009] According to another aspect of the present disclosure, there is provided a service management method for a player, which is applied to a service module. The method includes:
[0010] Obtain a target service party registered in a management module, where the target service party is used to monitor the status of a player module;
[0011] Receive player events forwarded from the player module by the management module, and execute service logic corresponding to the target service party according to the player events.
[0012] According to a third aspect of the present disclosure, there is provided a service management device for a player, which is applied to a management module. The device includes:
[0013] A first acquisition module, configured to acquire a target service party included in a service module, where the target service party has been registered in the management module and is used to monitor the status of a player module;
[0014] A monitoring module, configured to monitor player events of the player module when the player module performs a playback operation;
[0015] A forwarding module, configured to forward the monitored player events to the registered target service party, and enable the target service party to execute service logic corresponding to the target service party according to the player events.
[0016] According to a fourth aspect of the present disclosure, there is provided a service management device for a player, which is applied to a service module. The device includes:
[0017] A second acquisition module, configured to acquire a target service party registered in a management module, where the target service party is used to monitor the status of a player module;
[0018] A receiving module, configured to receive player events from the player module forwarded by the management module, and execute service logic corresponding to the target service party according to the player events.
[0019] According to a fifth aspect of the present disclosure, there is provided an electronic device, including:
[0020] At least one processor; and
[0021] A memory communicatively connected to the at least one processor; wherein,
[0022] The memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to execute the method according to any one of the above technical solutions.
[0023] According to a sixth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, where the computer instructions are used to cause a computer to execute the method according to any one of the above technical solutions.
[0024] According to a seventh aspect of the present disclosure, there is provided a computer program product, including a computer program, where the computer program, when executed by a processor, implements the method according to any one of the above technical solutions.
[0025] The present disclosure provides a service management method, apparatus, electronic device, and storage medium for a player. By registering a target service provider in a service module into a monitoring list to monitor the status of the player module, and during the playback process of the player module, monitoring and forwarding player events to the registered target service providers. In this way, the service module responds to the status changes of the player module by monitoring events, rather than directly relying on the internal implementation of the player module. This design enables the player module to focus on the playback function itself, while the service module can execute its respective business logics according to events, that is, the player module and the service module interact through events and protocols, thus achieving a loosely coupled modular architecture. This decoupling method not only improves the flexibility and scalability of the system, but also reduces the dependency relationship between modules, simplifies the maintenance and upgrade of the system, enables each module to be developed and tested independently, and improves the development efficiency and system stability. In addition, such a design enables the service module to respond in real time to the status changes of the player module and execute precise business logics, such as displaying advertisements or collecting user viewing data at specific time points during video playback, thereby not only enhancing the user experience, but also improving the scalability and maintainability of the system, making the integration of new services more convenient and fast, while also reducing the coupling degree between various parts of the system, contributing to reducing errors and improving development efficiency.
[0026] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The drawings are used to better understand the solution and do not constitute a limitation to the present disclosure. Among them:
[0028] Figure 1 is a schematic diagram of the service management system of the player in the embodiments of the present disclosure;
[0029] Figure 2 is a schematic diagram of the steps of the service management method of the player in the embodiments of the present disclosure;
[0030] Figure 3 is a schematic diagram of the player module in the embodiments of the present disclosure;
[0031] Figure 4 is a schematic diagram of the overall block diagram in the embodiments of the present disclosure;
[0032] Figure 5 The principle block diagram of the service management apparatus of the player in the embodiments of the present disclosure;
[0033] Figure 6 is a block diagram of the electronic device for implementing the service management method of the player in the embodiments of the present disclosure. Detailed implementation manners
[0034] The following describes exemplary embodiments of the present disclosure with reference to the accompanying drawings. Various details of the embodiments of the present disclosure are included to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, descriptions of well-known functions and structures are omitted below for clarity and conciseness.
[0035] The present disclosure provides a service management system for a player. Refer to Figure 1 as shown in Figure 1 which is a schematic diagram of the service management system of the player in the embodiments of the present disclosure. The system includes a player module 101, a service module 102, and a management module 103. The player module 101 (VideoPlayer) is configured to receive control instructions from the management module 103 to execute the playing function of the player. The service module 102 (Business) is configured to execute service logics. Among them, the service module 102 includes a target service party 1 (Business1), a target service party 2 (Business2), a target service party 3 (Business3), and a target service party n. Each different target service party corresponds to a different service logic. The management module 103 (BusinessManger) includes a registration interface (BusinessRegister), a player protocol interface (PlayerProtocol), and a player delegate interface (PlayerDelegate). Among them, the registration interface is configured to register the target service parties included in the service module into a monitoring list for monitoring the status of the player module; when the player module executes a playing operation, the player delegate interface is used to monitor the player events of the player module; the monitored player events are forwarded to the registered target service parties in the service module, and the target service parties execute the service logics corresponding to the target service parties according to the player events. Finally, a second control instruction from the service module can be received through the player protocol interface and forwarded to the player module, so that the player module executes a playing operation corresponding to the second control instruction.
[0036] This solution describes a system architecture that includes a player module, a business module, and a management module, aiming to achieve efficient decoupling and collaborative work between the video playback function and the business logic. Among them, the "player module" is the core component of the system, specifically responsible for executing playback functions such as playing, pausing, and stopping videos; the "business module" contains various business logics, such as advertisement display, user behavior analysis, etc., and it needs to perform specific operations according to the state changes of the player; while the "management module", as the system coordinator, is responsible for registering the target business parties in the business module into a monitoring list, and this list is used to monitor the state changes of the player module.
[0037] Furthermore, the interaction process between each module is as follows: The business module registers the target business party into the monitoring list through the interface provided by the management module, so as to be able to receive notifications of player state changes. Then, the user interacts with the player module through the interaction interface to trigger operations such as playing and pausing. The management module listens for events that may be triggered when the player module executes playback operations, such as the start and end of playback, by implementing the player proxy interface. When the management module monitors a player event, it forwards this event information to the registered target business parties in the monitoring list. The target business parties that receive the event execute corresponding business logics according to the event type and the carried information, such as displaying an advertisement at a specific time point during video playback.
[0038] Through this design, this solution achieves loose coupling between the player and the business logic, improving the flexibility and scalability of the system. The business module can be developed and maintained independently of the player module, while the player module can focus on its core function, namely video playback. In addition, this design also simplifies the integration process of new business modules. Since the new business module only needs to be registered in the management module, it can receive the state updates of the player without having to understand the internal implementation details of the player. This modular and event-driven architecture helps to improve the maintainability and development efficiency of the system, and also provides strong support for building a dynamic, efficient, and user-friendly video playback environment.
[0039] The present disclosure provides a method for business management of a player. Refer to Figure 2 as shown, Figure 2 is a schematic diagram of the steps of the method for business management of the player in an embodiment of the present disclosure. This method is applied to Figure 1 the management module, and this method includes:
[0040] Step S201, obtain the target business parties included in the business module. The target business parties have been registered in the management module and are used to monitor the state of the player module.
[0041] Specifically, by registering the target business parties included in the business module to the monitoring list for monitoring the status of the player module, it aims to achieve loose-coupling communication between the player module (VideoPlayer) and the business module (Business). Among them, the "business module" refers to the components in the application that implement specific business functions, such as the advertising module, user behavior analysis module, etc. The "target business party" refers to the specific business logic units within these modules, which need to perform specific operations according to the status changes of the player.
[0042] The implementation process of this solution includes the following steps: First, when the application starts or the business module is loaded, the business module initializes and prepares to register its internal target business parties. Then, the business module sends the information of the target business parties it contains (such as target business party identifiers, types of events of interest, etc.) to the management module by calling the registration interface provided by the management module. After receiving the registration request, the management module adds the target business party information to the monitoring list and may return a confirmation of successful registration, as well as a monitoring token or handle for subsequent communication. When the status of the player module changes (such as play start, pause, end, etc.), it generates corresponding events and notifies the management module. The management module distributes these events to all registered target business parties according to the information in the monitoring list, enabling them to execute corresponding business logic based on the status changes of the player.
[0043] Step S202, when the player module performs a play operation, monitor the player events of the player module.
[0044] Specifically, when the player module performs a play operation, monitor the player events of the player module, aiming to achieve real-time monitoring and response to the behavior of the video player. Among them, the "player module" refers to the core component in the application responsible for handling video playback, which can perform basic operations such as play, pause, stop, etc.; and the "player events" refer to a series of status change notifications triggered by the player module during video playback, such as play start, play end, buffer completion, error occurrence, etc.
[0045] The implementation process of this solution includes the following steps: First, define a player event interface or protocol, list all possible player event types, and provide corresponding handling methods for each event type. Next, the management module (BusinessManager) implements the player event interface and registers itself as an event listener for the player module. In this way, when the state of the player module changes, the management module can receive notifications. When the user issues a play request through the user interface (UI), the request is converted into a control instruction and sent to the player module. When the player module performs a play operation (such as starting to play a video), it triggers corresponding events according to different stages of the play process. After the management module monitors these events, it executes corresponding processing logic according to the type and content of the events. For example, when the play end event is monitored, the management module may trigger subsequent business logic, such as displaying video recommendations or playing the next video. Due to the existence of the event monitoring mechanism, new business logic can be easily added by implementing the same event interface without modifying the code of the player module.
[0046] In this way, this solution not only decouples the player module from the business logic, but also improves the flexibility and scalability of the system. The business module can perform specific business operations according to player events without directly interacting with the player module, which simplifies the system architecture, reduces the maintenance cost, and improves the development efficiency. In addition, the event-driven design also enables the system to respond more dynamically to user behavior and changes during the play process, thus providing a richer and more personalized user experience.
[0047] Step S203: Forward the monitored player event to the registered target business party, and the target business party executes the business logic corresponding to the target business party according to the player event.
[0048] Specifically, "player event" refers to specific notifications triggered by the player module (VideoPlayer) during video playback, such as play start, pause, end, or error, etc.; "registered target business party" refers to those business modules that add themselves to the monitoring list through the registration interface (BusinessRegister) of the management module (BusinessManager). They are interested in certain events of the player and hope to be notified when the events occur; "business logic" refers to specific operations executed by the target business party according to the player event, such as displaying advertisements, recording user behavior, or providing content recommendations, etc.
[0049] The implementation process of this solution includes the following steps: When the target business party starts or initializes, it registers itself as a listener for player events and specifies the event types it is interested in by calling the registration interface provided by the management module. The management module listens for various events that the player module may trigger by implementing the player proxy interface (PlayerDelegate). When the state of the player module changes and triggers corresponding events, the player module will automatically call the proxy interface method implemented in the management module to notify the management module of the events. After receiving the events, the management module encapsulates these events and the playback information they carry into notifications according to the information in the listening list and forwards them to all registered and interested target business parties. After receiving the event notifications, each target business party executes corresponding business logic according to the event types and playback information, such as displaying advertisements at specific time points during video playback, recording users' viewing behaviors, etc. After executing the business logic, the target business party may feedback the results to the management module to further optimize the event processing flow and enhance the user experience.
[0050] In this way, this solution achieves loose coupling between the player module and the business module, enabling the target business party to flexibly respond to the state changes of the player and execute specific business logic. This design not only improves the flexibility and scalability of the system but also enables the target business party to respond to player events in a timely manner, thereby providing a richer and more personalized user experience. At the same time, this event-driven mechanism also simplifies the code for event processing, improves the maintainability and readability of the code, and helps to enhance the development efficiency and system stability. In addition, by centralizing the event processing logic in the management module, it is easier to add new event processing logic or modify existing logic without affecting the player module and other business parties, thereby improving the maintainability of the system.
[0051] The present disclosure provides a service management method, apparatus, electronic device, and storage medium for a player. The present disclosure registers a target service provider in a service module into a monitoring list to monitor the status of the player module, and during the playback process of the player module, monitors and forwards player events to the registered target service providers. In this way, the service module responds to the status change of the player module by monitoring events, rather than directly depending on the internal implementation of the player module. This design enables the player module to focus on the playback function itself, while the service module can execute its respective business logics based on events, that is, the player module and the service module interact through events and protocols, thereby implementing a loosely coupled modular architecture. This decoupling method not only improves the flexibility and scalability of the system, but also reduces the dependency relationship between modules, simplifies the maintenance and upgrade of the system, enables each module to be developed and tested independently, and improves the development efficiency and system stability. In addition, such a design enables the service module to respond in real time to the status change of the player module and execute precise business logics, such as displaying advertisements or collecting user viewing data at a specific time point during video playback, thereby not only enhancing the user experience, but also improving the scalability and maintainability of the system, making the integration of new services more convenient and fast, while also reducing the coupling degree between various parts of the system, helping to reduce errors and improve development efficiency.
[0052] In some alternative embodiments, before obtaining the target service provider included in the service module, the method further includes;
[0053] Registering the target service provider included in the service module into a monitoring list for monitoring the status of the player module through a registration interface.
[0054] Specifically, registering the target service provider included in the service module into a monitoring list for monitoring the status of the player module through a registration interface aims to establish a communication bridge between the service module and the player module. Among them, the "registration interface" refers to a functional unit within the management module (BusinessManager), which provides a registration mechanism that allows the service module (Business) to add its internal business logic unit (i.e., the "target service provider") to a central monitoring list.
[0055] The implementation process of this solution includes the following steps: When the application starts or the business module is loaded, the business module is initialized. The business module registers the target business parties inside it into the listening list by calling the registration interface provided by the management module. After receiving the registration request, the management module verifies the legitimacy of the target business parties and adds the target business party information to the listening list to ensure that the correct target business parties can be notified when the player status changes. When the status of the player module (VideoPlayer) changes, such as play start, pause, or end, it generates corresponding events. After the management module monitors these events, according to the information in the listening list, it distributes the events to all registered target business parties, so that after the target business parties receive the events, they execute corresponding business logics according to the event types, such as showing advertisements or recording user viewing behaviors at specific time points during video playback.
[0056] In this way, by registering the target business parties included in the business module to the listening list for monitoring the status of the player module through the registration interface, the effective decoupling and dynamic interaction between the player module and the business module are realized. Since the business module can register or unregister the listening at runtime without modifying the player module, the flexibility and scalability of the system are enhanced. Secondly, the business module can receive the player status changes in real time and respond quickly, thus improving the response speed and interactivity of the system. Thirdly, when adding a new module, since the new module only needs to be registered to the listening list to receive event notifications without deeply understanding the internal implementation of the player, the integration process of the new business module is simplified. Since the coupling degree between modules is reduced, modifying or updating a single module is less likely to affect other modules, reducing the maintenance difficulty of the system. It can be seen that this design optimizes the user experience, enabling the player to respond to user behaviors and business requirements more intelligently and personalized.
[0057] In some alternative embodiments, before monitoring the player events of the player module, the method further includes:
[0058] Sending a first control instruction to the player module to enable the player module to execute a playback operation corresponding to the first control instruction.
[0059] Specifically, the "first control instruction" can be, for example, an initial instruction issued by the user through the interaction interface, such as play, pause, stop, fast forward, or rewind, etc., which are directly associated with the basic control functions of the player; the "player module" is the core component in the application program that is specifically responsible for processing video playback, and it can respond to control instructions and execute corresponding playback operations.
[0060] The implementation process of this solution includes the following steps: The user performs a play operation through the user interface (UI) of the application, such as clicking the play button. After the UI layer receives the user operation, it converts it into a control instruction, which is predefined and clearly specifies the operation that the player needs to perform. Then, the generated control instruction is sent to the management module through the logic layer of the application, and the management module is responsible for coordinating the interaction between the player module and the business module. After receiving the control instruction forwarded by the management module, the player module parses the instruction content and performs the corresponding play operation, such as starting the video decoding and play process. After performing the operation, the player module may update its internal state and trigger state change events, which can be listened to and responded to by other registered business modules, thus implementing more complex business logic.
[0061] To facilitate understanding of the solution of the embodiments of this application, refer to Figure 3 as shown in Figure 3 is a schematic diagram of the player module in the embodiments of the present disclosure. Specifically, the player module receives control instructions from the management module. The control instructions, such as play, pause, stop, fast forward, or rewind, are directly related to the basic control functions of the player to implement the basic functions of the player. After performing the basic function operations, the player module may update its internal state and trigger state change events, such as play events, pause events, error events, etc. These events are sent to the management module and distributed to the corresponding business modules through the management module, thereby executing the corresponding business logic.
[0062] In this way, by sending the first control instruction to the player module to enable the player module to perform the play operation corresponding to the first control instruction, this design allows the player module to quickly and accurately perform operations such as play, pause, and stop, enhancing the user experience. At the same time, since the sending and execution processes of the control instructions are clearly defined, this simplifies the communication mechanism between modules, reduces the system complexity, helps to reduce errors and improve the maintainability of the code. In addition, the clear instruction passing mechanism also supports the integration of more complex business logic, enabling the player to respond more flexibly to diverse user needs and business rules, thus providing strong support for building rich and dynamic mobile applications.
[0063] In some optional embodiments, listening to the player events of the player module includes:
[0064] Listening to the player events of the player module through the player proxy interface.
[0065] Specifically, the player proxy interface is a predefined interface that declares the types of events that the player may trigger, such as play start, pause, end, error, etc. The management module registers itself as a listener for these events by implementing this interface. When the state of the player module changes and triggers a corresponding event, the player module automatically calls the proxy interface method implemented in the management module to notify the management module of the event. In this way, the management module can forward the event notification to the business module, and then the business module executes the corresponding business logic according to the received event, such as updating the user interface, recording play statistics, triggering ad display, etc. This design not only decouples the player module from the business logic, improving the flexibility and scalability of the system, but also enables the business module to respond promptly to changes in the player state, thereby optimizing the user experience and enhancing the operation efficiency. In addition, the method of listening to events through the proxy interface also simplifies the event handling code, improving the maintainability and readability of the code.
[0066] In this way, by implementing the player proxy interface to listen to the events of the player module, the high-efficiency decoupling between the player and the business logic is achieved, enabling the management module to flexibly respond to changes in the player state. This design not only improves the scalability and maintainability of the system, allowing each business module to be developed and updated independently of the player, but also enhances the response ability of the system, enabling the business logic to promptly adapt to various events during the playback process, such as displaying ads at a specific time point during video playback or recommending relevant content at the end of playback. In addition, this proxy mechanism simplifies the event handling process, reduces the system complexity, improves the maintainability and readability of the code, thereby optimizing the user experience and enhancing the overall operation efficiency.
[0067] In some alternative embodiments, the monitored player events are forwarded to the registered target business party, and the target business party executes the business logic corresponding to the target business party according to the player events, including:
[0068] When it is monitored that a player event of the player module is triggered, the player event is forwarded to the registered target business party, and the target business party executes the business logic corresponding to the target business party according to the playback information carried by the player event.
[0069] Specifically, a "player event" refers to a specific notification generated by the player module (VideoPlayer) during video playback, such as play start, pause, end, or error; a "registered target business party" refers to those business modules that add themselves to the monitoring list through the registration interface (BusinessRegister) of the management module (BusinessManager), and they are interested in certain events of the player and hope to be notified when the events occur; "playback information" includes various data related to the event, such as the current playback time, the total duration of the video, the playback speed, etc.
[0070] The implementation process of this solution includes the following steps: The management module listens for various events that the player module may trigger by implementing the player proxy interface (PlayerDelegate). When the user interacts with the player or the player state changes, the player module generates corresponding events. After the management module listens for the events, it encapsulates these events and the playback information they carry into notifications, and then forwards these notifications to all registered target business parties according to the monitoring list. After receiving the event notifications, each target business party executes its own business logic according to the playback information. For example, if the playback event is "play end", the advertising target business party may display an advertisement, while the user statistics target business party may record the user's viewing duration.
[0071] In this way, this design enables the management module to immediately transfer these events and their related information to the business modules that care about these events when playback events occur, such as video start, pause, or end. This approach enhances the flexibility and response speed of the system, enabling business modules to respond in real time to changes in the playback state and perform specific business operations, such as displaying relevant advertisements when the video playback ends or collecting user feedback when the playback pauses. In addition, this event-driven method reduces the coupling degree between modules, improves the maintainability of the code, simplifies the system expansion and upgrade process, thereby enhancing the development efficiency and system stability, ultimately optimizing the user experience and improving the operation efficiency.
[0072] In some alternative embodiments, the method further includes:
[0073] Receiving a second control instruction from a business module and forwarding it to the player module to enable the player module to perform a playback operation corresponding to the second control instruction.
[0074] Specifically, the feature of "receiving a second control instruction from a service module and forwarding it to the player module to enable the player module to perform a playback operation corresponding to the second control instruction" describes a flexible control mechanism that allows the target service party (such as an advertising module, a recommendation system, etc.) to send specific control instructions to the player module according to service requirements. Here, the "second control instruction" refers to a control instruction triggered by business logic in addition to the control instruction directly sent by the user through the interface, such as jumping to a specific time point of the video, switching the playback quality, or adjusting the volume, etc. And the "player module" is the core component responsible for performing video playback, which receives and executes the control instructions from the target service party.
[0075] The implementation process of this solution includes the following steps: First, define a player protocol interface, which declares the types of control instructions that the player module can receive and process and their corresponding methods. When needed (such as according to the user behavior analysis result or the advertising display strategy), the target service party sends a second control instruction to the management module by calling the player protocol interface. After receiving the control instruction from the target service party, the management module judges the legality and correctness of the instruction through internal logic, and then forwards the instruction to the player module. After receiving the forwarded control instruction, the player module parses the instruction and executes the corresponding playback operation, such as adjusting the playback progress, changing the playback quality, etc. After executing the control instruction, the player module may trigger new events (such as a change in the playback position), and these events can be notified to other target service parties through the management module so that they can further respond to these changes. In this way, this solution realizes the flexible control of the player behavior by the target service party, enabling the player to dynamically adjust the playback behavior according to service requirements.
[0076] In this way, this design enables the target service party to dynamically send control instructions to the player according to specific service requirements, such as user behavior analysis results or advertising strategies, such as adjusting the playback speed, jumping to a specific time point, or switching the video quality, etc. This method enhances the flexibility and intelligence level of the player module, enabling the player module to more accurately respond to service requirements and user preferences, thereby providing a more personalized and smooth viewing experience. In addition, this flexible control mechanism also helps to improve the accuracy and effect of advertising placement, increase the operation efficiency, and at the same time provides the possibility for implementing more complex business logics, such as dynamic content recommendation based on user interaction, etc. Generally speaking, this method not only optimizes the user experience but also provides strong support for business innovation and operation optimization.
[0077] In some alternative embodiments, receiving a second control instruction from a service module and forwarding it to the player module to enable the player module to perform a playback operation corresponding to the second control instruction includes:
[0078] Receive the second control instruction from the service module through the player protocol interface and forward it to the player module, so that the player module can execute the playback operation corresponding to the second control instruction.
[0079] Specifically, the player protocol interface is a standardized interface that defines the control instructions that the player module can receive, allowing external modules to interact with the player in a unified and predefined manner.
[0080] The implementation process of this solution includes the following steps: First, define a player protocol interface that declares the types of control instructions that the player module can receive and process, such as play, pause, jump, adjust volume, etc. When the target service party needs to control the player, it constructs a second control instruction through the player protocol interface, which may be based on the needs of the business logic, such as showing an advertisement at a specific time point during video playback. The management module, as an intermediary, receives the control instruction from the target service party by implementing the player protocol interface. After receiving the control instruction, the management module is responsible for forwarding the instruction to the player module. This step ensures that the request from the target service party can be correctly passed to the player module. After receiving the forwarded control instruction, the player module parses the instruction and executes the corresponding playback operation. This may involve changing the playback state, adjusting playback parameters, or performing specific playback behaviors. After the operation is executed, the player module may feedback the execution result to the management module through an event or callback mechanism, and then notify the target service party, forming a complete control loop. In this way, this solution realizes the flexible docking of business logic and player behavior, enabling the target service party to dynamically control the player according to actual business needs, enhancing the flexibility and scalability of the system. At the same time, this design also helps to improve the user experience, as the player can respond more intelligently to changes in business logic, such as providing more accurate advertisement placement or content recommendation when the user is watching a video. In addition, this modular and protocol-driven design simplifies the maintenance and upgrade of the system, improving development efficiency and system stability.
[0081] In this way, through the standardized interface, the service module can send control instructions without knowing the internal implementation details of the player, thus simplifying the interaction between the service module and the player module. This not only improves development efficiency but also allows independent updates and extensions of the target service party's functions without affecting the player module. In addition, this design enables the player module to respond more flexibly to diverse business needs, such as dynamically inserting advertisements during video playback or adjusting the playback strategy according to user behavior, thereby optimizing the user experience and improving operation efficiency. At the same time, it helps to reduce the coupling degree of the system, making maintenance and fault diagnosis easier, thus increasing the stability and maintainability of the entire system.
[0082] The present disclosure provides a service management method for a player, which is applied to the Figure 1 service module, and the method includes:
[0083] Obtain a target service provider registered with the management module, where the target service provider is used to monitor the status of the player module;
[0084] Receive a player event forwarded by the management module from the player module, and execute service logic corresponding to the target service provider according to the player event.
[0085] Specifically, the target service provider refers to those service modules that need to execute specific logic according to the change of the player status, such as the advertisement module, the user behavior analysis module, etc. The management module, as the core coordinator of the system, is responsible for managing the registration of service modules and event distribution. The player module is the core component responsible for video playback and can trigger various playback-related events, such as play start, pause, end, etc. Player event: A status change notification generated by the player module during playback, such as play progress update, play error, etc.
[0086] The implementation process of this solution includes the following steps: When initializing or starting up, the target service provider sends a registration request to the management module, indicating that it hopes to monitor the status change of the player module. After receiving the registration request, the management module adds the information of the target service provider to the monitoring list so that these service providers can be notified when the player status changes. When the status of the player module changes (such as play start, pause, end, etc.), corresponding events will be generated. After the management module monitors these events, according to the information in the monitoring list, it forwards the events to all registered target service providers. After receiving the events forwarded by the management module, the target service provider executes corresponding service logic according to the event type and content, such as displaying advertisements at a specific time point during video playback, recording user viewing behaviors, etc. In this way, this solution realizes loose coupling between the player module and the service module, improves the flexibility and scalability of the system. The service module can execute specific service operations according to the real-time status change of the player without directly interacting with the player module, which simplifies the system architecture, reduces the maintenance cost, and improves the development efficiency.
[0087] In this way, this design enables the service module to dynamically execute service logic according to the real-time status change of the player, such as displaying advertisements or recording user behavior data at a specific time point during video playback, thereby enhancing the user experience and operation efficiency. At the same time, since the interaction between the service module and the player is carried out through the management module, this reduces the direct dependence between the components of the system, simplifies the system architecture, enhances the maintainability and scalability of the system, makes the integration of new services and the update of existing services faster and more convenient, and ultimately improves the development efficiency and the stability of the system.
[0088] In some alternative embodiments, the method further includes: before obtaining the target service party registered with the management module, the method further includes:
[0089] Obtain the target service party whose player status needs to be monitored and send a registration request to the management module, and register the target service party through the management module to monitor the status of the player module.
[0090] Specifically, the "target service party" refers to a service module in the application that needs to perform specific operations according to changes in the player status. For example, the advertising module may need to display an advertisement at a specific time point during video playback, and the user behavior analysis module may need to record the user's playback habits; the "management module" acts as the core coordinator of the system and is responsible for maintaining a monitoring list to track which service parties need to receive player status updates; the "player module" is the core component responsible for processing video playback operations such as play, pause, stop, etc.
[0091] The implementation process of this solution includes the following steps: First, it is necessary to identify the service parties that need to monitor the playback status of the player module, such as play start, play end, etc., to obtain the target service parties. Then, the target service parties send a registration request to the management module, indicating that they wish to monitor specific player events. After receiving the registration request, the management module adds the information of the target service parties to the monitoring list to ensure that when the player status changes, the correct service parties can be notified. When the status of the player module changes, such as when the user starts playing a video, it generates a status change event. The management module captures this event, searches the monitoring list, and distributes the event to all target service parties that have registered for this event. After receiving the event, the target service parties execute their predefined business logic, such as displaying an advertisement or recording data.
[0092] In this way, this design improves the flexibility and scalability of the system, enabling service modules to respond in real time to changes in the player status and execute specific business logics such as advertisement display or user behavior analysis. Secondly, this design simplifies the integration process of new service modules. Since new modules only need to register for monitoring events without having to deeply understand the internal implementation of the player, this reduces the complexity of the system and improves the development and maintenance efficiency. Finally, the event-driven mechanism ensures that service modules can quickly respond to player events, thereby optimizing the user experience.
[0093] In some alternative embodiments, the method further includes:
[0094] Send the third control instruction to the management module, and the management module forwards the third control instruction to the player module so that the player module executes the playback operation corresponding to the third control instruction.
[0095] Specifically, the "third control instruction" refers to an additional control instruction triggered by the business logic in addition to the control instruction directly issued by the user, such as automatically jumping to the next video according to the user's viewing habit. The "management module" acts as an intermediary, responsible for receiving control instructions from the business module or the user interface and forwarding them to the "player module". The "player module" is the core component responsible for performing actual playback tasks, such as starting playback, pausing, adjusting the volume, etc.
[0096] The implementation process of this solution includes the following steps: The business party (such as a recommendation system or an advertising module) generates a third control instruction based on specific logic, which may be aimed at achieving specific playback behaviors, such as skipping the intro or inserting an advertisement. The business party sends the generated third control instruction to the management module, requesting to perform a specific playback operation. After receiving the third control instruction, the management module identifies the instruction type and target and forwards the instruction to the player module. The player module receives the forwarded control instruction, parses the instruction content, and performs the corresponding playback operation, such as adjusting the playback progress or switching the video source. After performing the operation, the player module may generate a status change event and feedback the result to the business party through the management module for the business party to perform subsequent processing. Through this mechanism, this solution realizes the flexible docking of business logic and player behavior, enabling the business party to dynamically control player behavior according to actual business needs and enhancing the flexibility and intelligence level of the system.
[0097] In this way, this design enables the business module to send control instructions according to business requirements or user interactions without directly interacting with the player module, thereby enhancing the modularity and decoupling ability of the system. This method enables the player to respond more intelligently to business logic and user operations, which can improve the user experience, and can also enhance the flexibility and response speed of the system, enabling the business module to execute relevant business logic in a timely manner according to changes in the player state. In addition, this design simplifies the integration process of new business functions, reduces development and maintenance costs, and provides support for building a rich and personalized video playback environment.
[0098] To facilitate an overall understanding of the solution of this application, see Figure 4 as shown Figure 4It is a schematic diagram of the overall block diagram of the embodiment of the present disclosure. The block diagram shows the architectural design of a modular video player system, which consists of multiple levels and components, and each level and component works together to realize complex video playback functions and business logic. The system includes: a management module, a player module, a business module, a user interface module (UI) and a Core (core component), wherein the management module is mainly responsible for registering the business module, and coordinating the business module and the player module, the player module focuses on the video playback function, the business module is used to implement specific business logic, and the UI layer provides a user interaction interface, and the Core contains the core functions of the application. This modular design helps to achieve decoupling between modules and improve the maintainability and scalability of the system.
[0099] Specifically, the management module (BusinessManager) includes: builder, registrar and business linkage. The builder is usually used to create and manage object instances, because it is responsible for combining and managing different modules and components. The registrar is responsible for processing the registration of business modules and registering the target business party to the listening list, while the business linkage handles the linkage events between multiple businesses.
[0100] The player module (VideoPlayer) includes the player and video rendering. The player includes playback operation processing and playback status exposure, and is the core component for executing video playback functions. Video rendering is only responsible for UI rendering of the video playback page to ensure the correct display of video content.
[0101] Business modules include: Business 1, Business 2, Business 3, etc. listed in the figure. Each business represents different business logic, such as advertising management, user statistics, content recommendation, etc. Function expansion feedback guidance is used to provide more pages, speed switching, clarity switching, subtitle selection, Toast, Alert and other functions to enhance user experience. These functions can be implemented by different business modules.
[0102] The user interface module includes information operations / gestures, frame area, tool area, play control area, etc. These areas contain buttons and controls for users to interact with the player, such as play, pause, fast forward, fast rewind, etc. It should be noted that the user interface module interacts with both the business module and the player module.
[0103] Core: Usually refers to the core functionality or core components of an application.
[0104] The working process of this system is as follows: Developers define and combine different handlers through a builder to create a player instance with specific behaviors and functions. In the registrar, the target business parties of business modules are registered so that they can receive event notifications from the player, enabling the handling of linkage events between multiple businesses. Subsequently, users interact with the player through various buttons and gestures, such as play, pause, fast forward, rewind, etc. The player module executes corresponding play operations based on the user's operations and updates the play status. The user interface module updates the interface according to the play status, such as displaying the play progress, prompting that the play is loading, showing the end of the play, etc. The player processes various play operations, such as start, pause, stop, fast forward, rewind, speed adjustment, clarity switching, subtitle adjustment, decoding, etc., and exposes the play status, such as play progress, play loading, playing, play ended, play error, etc.
[0105] Through this modular design, the video player application can achieve complex functions while maintaining good scalability and maintainability. Each component has a clear responsibility and can be replaced or extended as needed without affecting other components.
[0106] The following introduces the device embodiments of this application, which can be used to execute the business management method of the player in the above embodiments of this application. For details not disclosed in the device embodiments of this application, please refer to the embodiments of the business management method of the player in the above of this application.
[0107] This disclosure also provides a business management device 500 for a player, as Figure 5 shown, including:
[0108] A first acquisition module 501, configured to acquire the target business parties included in the business module, where the target business parties have been registered in the management module for listening to the status of the player module;
[0109] A listening module 502, configured to listen to the player events of the player module when the player module executes a play operation;
[0110] A forwarding module 503, configured to forward the listened player events to the registered target business parties, and the target business parties execute the business logic corresponding to the target business parties according to the player events.
[0111] In some optional embodiments, before the registration module 501 acquires the target business parties included in the business module, it is further configured to;
[0112] Register the target business parties included in the business module into the listening list for listening to the status of the player module through a registration interface.
[0113] In some alternative embodiments, before the listening module 502 listens for player events of the player module, it is further configured to send a first control instruction to the player module, so that the player module executes a playback operation corresponding to the first control instruction.
[0114] In some alternative embodiments, the listening module 502 listens for player events of the player module, including:
[0115] Listening for player events of the player module through a player proxy interface.
[0116] In some alternative embodiments, the forwarding module 503 forwards the listened player events to the registered target service party, and the target service party executes service logic corresponding to the target service party according to the player events, including:
[0117] When it is monitored that a player event of the player module is triggered, the player event is forwarded to the registered target service party, and the target service party executes service logic corresponding to the target service party according to the playback information carried by the player event.
[0118] In some alternative embodiments, the device further includes a receiving module, and the receiving module is configured to receive a second control instruction from the service module and forward it to the player module, so that the player module executes a playback operation corresponding to the second control instruction.
[0119] In some alternative embodiments, the receiving module receives a second control instruction from the service module and forwards it to the player module, so that the player module executes a playback operation corresponding to the second control instruction, including:
[0120] Receiving a second control instruction from the service module through a player protocol interface and forwarding it to the player module, so that the player module executes a playback operation corresponding to the second control instruction.
[0121] The present disclosure further provides a service management device for a player, and the device includes:
[0122] A second acquisition module, configured to acquire a target service party registered with the management module, and the target service party is used to monitor the status of the player module;
[0123] A receiving module, configured to receive player events forwarded by the management module from the player module, and execute service logic corresponding to the target service party according to the player events.
[0124] In some alternative embodiments, before the second acquisition module acquires the target service party registered to the management module, it is further configured to acquire the target service party whose player status is to be monitored and send a registration request to the management module, and the management module registers the target service party to monitor the status of the player module.
[0125] In some alternative embodiments, the apparatus further includes a sending module, configured to send a third control instruction to the management module, and the management module forwards the third control instruction to the player module, so that the player module executes a playback operation corresponding to the third control instruction.
[0126] In the technical solution of the present disclosure, the acquisition, storage, and application of the user's personal information involved all comply with the provisions of relevant laws and regulations and do not violate public order and good customs.
[0127] According to the embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0128] Figure 6 The schematic block diagram of an example electronic device 600 that can be used to implement the embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, a personal digital processor, a cellular phone, a smart phone, a wearable device, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are only examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0129] As Figure 6 shown, the electronic device 600 includes a computing unit 601, which can execute various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 602 or the computer program loaded from the storage unit 608 into the random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. The input / output (I / O) interface 605 is also connected to the bus 604.
[0130] Multiple components in device 600 are connected to I / O interface 605, including: input unit 606, such as a keyboard, mouse, etc.; output unit 608, such as various types of displays, speakers, etc.; storage unit 608, such as a disk, optical disc, etc.; and communication unit 609, such as a network card, modem, wireless communication transceiver, etc. Communication unit 609 allows device 600 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunications networks.
[0131] Computing unit 601 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of computing unit 601 include but are not limited to a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Computing unit 601 executes the various methods and processes described above, such as the service management method of the player. For example, in some embodiments, the service management method of the player can be implemented as a computer software program that is tangibly included in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed onto device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by computing unit 601, one or more steps of the small program distribution described above can be executed. Alternatively, in other embodiments, computing unit 601 can be configured to execute the service management method of the player in any other suitable way (e.g., by means of firmware).
[0132] Various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special or general-purpose programmable processor, and can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0133] The program code for implementing the methods of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable player business management devices, such that when the program codes are executed by the processor or controller, the functions / operations specified in the flowchart and / or block diagram are implemented. The program codes can be executed entirely on the machine, partially on the machine, executed partially on the machine and partially on a remote machine as an independent software package, or executed entirely on a remote machine or server.
[0134] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0135] In order to provide interaction with a user, the systems and techniques described herein 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 the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, speech input, or tactile input).
[0136] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (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 herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), and the Internet.
[0137] A computer system can include a client and a server. The client and the server are generally far from each other and typically interact through a communication network. The client-server relationship is created by computer programs that run on the respective computers and have a client-server relationship with each other. The server can be a cloud server, can also be a server of a distributed system, or a server that incorporates a blockchain.
[0138] It should be understood that the various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in this disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. There is no limitation herein.
[0139] The above specific embodiments do not constitute a limitation on the protection scope of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the protection scope of this disclosure.
Claims
1. A service management method for a player, which is applied to a management module, wherein, The method includes: Obtaining a target business party included in the service module, where the target business party has been registered in the management module and is used to monitor the status of the player module; When the player module performs a playback operation, monitoring the player events of the player module; Forwarding the monitored player events to the registered target business party, and enabling the target business party to execute corresponding service logic according to the player events.
2. The method according to claim 1, wherein, Before obtaining the target business party included in the service module, the method further includes; Registering the target business party included in the service module to a monitoring list for monitoring the status of the player module through a registration interface.
3. The method according to claim 1, wherein, Before monitoring the player events of the player module, the method further includes: Sending a first control instruction to the player module so that the player module performs a playback operation corresponding to the first control instruction.
4. The method according to claim 1, wherein, The monitoring of the player events of the player module includes: Monitoring the player events of the player module through a player proxy interface.
5. The method according to any one of claims 1 to 4, wherein The forwarding of the monitored player events to the registered target business party and enabling the target business party to execute corresponding service logic according to the player events includes: If it is monitored that the player events of the player module are triggered, then forwarding the player events to the registered target business party, and enabling the target business party to execute corresponding service logic according to the playback information carried by the player events.
6. The method according to any one of claims 1 to 4, wherein, The method further includes: Receiving a second control instruction from the service module and forwarding it to the player module so that the player module performs a playback operation corresponding to the second control instruction.
7. The method according to claim 6, wherein, The receiving of the second control instruction from the service module and forwarding it to the player module so that the player module performs a playback operation corresponding to the second control instruction includes: Receiving a second control instruction from the service module through a player protocol interface and forwarding it to the player module so that the player module performs a playback operation corresponding to the second control instruction.
8. A service management method for a player, applied to a service module, wherein, The method includes: Obtaining a target business party registered in the management module, where the target business party is used to monitor the status of the player module; Receiving player events forwarded by the management module from the player module, and executing corresponding service logic according to the player events.
9. The method according to claim 8, wherein, Before obtaining the target business party registered in the management module, the method further includes: Obtaining a target business party to monitor the status of the player and sending a registration request to the management module, and registering the target business party by the management module to monitor the status of the player module.
10. The method according to claim 8 or 9, wherein, The method further includes: Sending a third control instruction to the management module, and the management module forwarding the third control instruction to the player module so that the player module performs a playback operation corresponding to the third control instruction.
11. A service management device for a player, which is applied to a management module, wherein, The device includes: A first acquisition module, configured to acquire a target service provider included in a service module, where the target service provider has been registered in the management module and is used to monitor the status of a player module; A monitoring module, configured to monitor player events of the player module when the player module performs a playback operation; A forwarding module, configured to forward the monitored player events to the registered target service provider, and enable the target service provider to execute service logic corresponding to the target service provider according to the player events.
12. A service management device for a player, applied to a service module, wherein, The apparatus includes: A second acquisition module, configured to acquire a target service provider registered in a management module, where the target service provider is used to monitor the status of a player module; A receiving module, configured to receive player events forwarded by the management module from the player module, and execute service logic corresponding to the target service provider according to the player events.
13. An electronic device, including: At least one processor; And A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to execute the method according to any one of claims 1-10.
14. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to execute the method according to any one of claims 1-10.
15. A computer program product, including a computer program, where the computer program, when executed by a processor, implements the method according to any one of claims 1-10.