Bullet screen special effect processing method and device, storage medium and electronic equipment
By abstracting the target game engine into a view component and embedding it in the barrage container, the efficient development and thermal update mechanism of the game engine are used to solve the problem of excessive resource consumption in barrage special effects processing, achieving rich special effects and low The effect of resource consumption.
Patent Information
- Application Number
- CN202411546923.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-14
AI Technical Summary
During the process of barrage special effects, resource consumption is too large, resulting in high client performance requirements and high rendering resource consumption. The existing technology has not yet proposed an effective solution.
By abstracting the target game engine into a view component and embedding the view component in the barrage container of the target application, the efficient development and thermal update mechanism of the game engine can be used to achieve rapid iteration and dynamic loading of barrage special effects.
It enriches the diversity of barrage special effects, reduces hardware requirements for client performance, reduces resource consumption, and improves application response speed and user experience.
Smart Images

Figure CN119450159A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and more specifically, to a method and device for processing bullet screen special effects, a storage medium, and an electronic device. Background Art
[0002] As a real-time interactive way of commenting on online videos or live broadcasts, barrage has been widely welcomed on Internet video platforms in recent years. It can be displayed in real time on the video content in the form of text. Users can quickly view and participate, interact with the video content, and enhance the viewing experience.
[0003] In order to enhance user participation and interactivity, barrage includes dynamic display, real-time update, instant feedback and other functions to meet users' real-time understanding of video content and immediate participation in comments. However, since the barrage rendered by the client needs to be dynamically generated and dynamically superimposed with the video content, it places high demands on client performance and requires more rendering resources, resulting in the technical problem of excessive resource consumption during the processing of barrage special effects.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present application provide a method and device for processing barrage special effects, a storage medium and an electronic device, so as to at least solve the technical problem of excessive resource consumption in the process of processing barrage special effects.
[0006] According to one aspect of an embodiment of the present application, a method for processing barrage special effects is provided, comprising: in the process of playing a target video through a target application, in response to a target barrage sent by a target account, starting a barrage container of the target application, wherein the barrage container is used to process the display form and control logic of the barrage, and the barrage container carries a view component of a target game engine; in response to a matching process between the video ID of the target video and the resource ID of the target resource, configuring a hot update path to a hot update directory of the target game engine; based on the hot update path, loading the target script and target resource file under the hot update directory, and updating the barrage control logic in the view component of the target game engine; based on the barrage control logic, determining a target barrage special effect of the target barrage, and displaying the target barrage in the target video screen according to the target display form indicated by the target barrage special effect.
[0007] Optionally, the above-mentioned configuration of the hot update path to the hot update directory of the target game engine in response to the matching processing between the video ID of the target video and the resource ID of the target resource includes: searching the local cache directory in response to the matching processing between the video ID of the target video and the resource ID of the target resource to obtain a target retrieval result; when the target retrieval result indicates that a hot update resource package corresponding to the resource ID already exists in the local cache, configuring the hot update path to the hot update directory of the target game engine.
[0008] Optionally, the above method also includes: when the target retrieval result indicates that the hot update resource corresponding to the resource ID does not exist in the local cache, based on the resource ID, downloading the hot update resource package from a remote server; decompressing the hot update resource package to obtain the hot update path, and configuring the hot update path to the hot update directory of the target game engine.
[0009] Optionally, before configuring the hot update path to the hot update directory of the target game engine, the method further includes: downloading a pre-configured resource configuration table from a remote server, wherein the resource configuration table includes the latest resource information used in the process of playing the target video; determining a first version number of a resource package in the remote server based on the resource configuration table; obtaining a second version number of the resource package currently being used by the target video being played from the local cache; comparing the first version number with the second version number to obtain a target comparison result; and downloading the hot update resource package from the remote server based on the resource ID when the target comparison result indicates that the first version number is inconsistent with the second version number.
[0010] Optionally, before starting the barrage container in the target application in response to the target barrage sent by the target account, the method further includes: obtaining the target game engine; abstracting the target game engine into the view component, and connecting the view component to the barrage container of the target application.
[0011] Optionally, the above method also includes: in response to a trigger operation on the target video screen, passing a trigger event corresponding to the trigger operation to the barrage container; transmitting the trigger event to the target game engine through the barrage container; when it is determined that the target game engine has responded to the trigger event, distributing the trigger event to the target game engine, and processing the trigger event through the target game engine.
[0012] Optionally, the above method also includes: without performing a matching process between the video ID of the target video and the resource ID of the target resource, starting the original control logic of the barrage container of the target application, wherein the original control logic is different from the barrage control logic in the view component; based on the original control logic, determining the target barrage special effect of the target barrage, and displaying the target barrage in the target video screen according to the target display form indicated by the target barrage special effect.
[0013] According to another aspect of the embodiment of the present application, a device for processing barrage special effects is also provided, including a starting unit, which is used to start the barrage container of the target application in response to the target barrage sent by the target account during the process of playing the target video through the target application, wherein the barrage container is used to process the display form and control logic of the barrage, and the barrage container carries the view component of the target game engine; a first configuration unit, which is used to configure the hot update path to the hot update directory of the target game engine in response to the matching processing between the video ID of the target video and the resource ID of the target resource; a first processing unit, which is used to load the target script and target resource file under the hot update directory based on the hot update path, and update the barrage control logic in the view component of the target game engine; a second processing unit, which is used to determine the target barrage special effect of the target barrage based on the barrage control logic, and display the target barrage in the target video screen according to the target display form indicated by the target barrage special effect.
[0014] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is used to execute the above-mentioned method for processing barrage special effects when run by an electronic device.
[0015] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program that implements the steps of the above method when the computer program is executed by a processor.
[0016] According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the method for processing the barrage special effects through the computer program.
[0017] By adopting the above-mentioned embodiment provided by the present application, the target game engine is abstracted as a view component and the view component is embedded in the barrage container of the target application, so that when the target barrage sent by the target account is received, the target game engine is started. At the same time, through the efficient development and hot update mechanism of the target game engine, the rapid iteration and dynamic loading of the barrage special effects are realized, which not only enriches the diversity of the barrage special effects, but also reduces the hardware requirements for client performance, thereby achieving the technical effect of reducing resource consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute improper limitations on the present application.
[0019] Figure 1 It is a schematic diagram of an application scenario of an optional method for processing barrage special effects according to an embodiment of the present application;
[0020] Figure 2 is a flowchart of an optional method for processing barrage special effects according to an embodiment of the present application;
[0021] Figure 3 is a schematic diagram of a hierarchical structure of an optional user interface according to an embodiment of the present application;
[0022] Figure 4 is a development flow chart of an optional bullet screen function according to an embodiment of the present application;
[0023] Figure 5 It is an overall flow chart of an optional method for processing barrage special effects according to an embodiment of the present application;
[0024] Figure 6 is an optional hot update flow chart according to an embodiment of the present application;
[0025] Figure 7 is a schematic diagram of an optional communication process between a native component and an abstracted view component according to an embodiment of the present application;
[0026] Figure 8 is a structural schematic diagram of an optional device for processing barrage special effects according to an embodiment of the present application;
[0027] Fig. 9 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] The technical solutions in the embodiments of the present application will comply with legal provisions during implementation. When performing operations according to the technical solutions in the embodiments, the data used will not involve user privacy. While ensuring that the operation process is compliant and legal, the security of the data is guaranteed.
[0031] In addition, when the above embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant regulations and standards of the relevant country or region.
[0032] According to one aspect of the embodiments of the present application, a method for processing a bullet screen special effect is provided. As an optional implementation, the above-mentioned method for processing a bullet screen special effect can be applied to, but is not limited to, Figure 1 The application scenario shown in Figure 1In the application scenario shown, the target terminal 102 may, but is not limited to, communicate with the server 106 via the network 104, and the server 106 may, but is not limited to, perform operations on the database 108, such as write data operations or read data operations. The above-mentioned target terminal 102 may, but is not limited to, include a human-computer interaction screen, a processor, and a memory. The above-mentioned human-computer interaction screen may, but is not limited to, be used to display the video screen of the target video and the target barrage on the target terminal 102. The above-mentioned processor may, but is not limited to, be used to respond to the above-mentioned human-computer interaction operation, perform corresponding operations, or generate corresponding instructions, and send the generated instructions to the server 106. The above-mentioned memory is used to store relevant processing data, such as the target video, video ID, and resource ID.
[0033] Optionally, in this embodiment, the target terminal may be a terminal configured with a target client, which may include but is not limited to at least one of the following: a mobile phone (such as an Android phone, an iOS phone, etc.), a laptop, a tablet computer, a PDA, a MID (Mobile Internet Devices), a PAD, a desktop computer, a smart TV, etc. The target client may be a video client, an instant messaging client, a browser client, an education client, etc. The network may include but is not limited to: a wired network, a wireless network, wherein the wired network includes: a local area network, a metropolitan area network and a wide area network, and the wireless network includes: Bluetooth, WIFI and other networks that realize wireless communication. The server may be a single server, or a server cluster consisting of multiple servers, or a cloud server.
[0034] In order to solve the problem of excessive resource consumption in the process of processing the barrage special effects, a method for processing the barrage special effects is proposed in an embodiment of the present application. Figure 2 It is a flowchart of a method for processing barrage special effects according to an embodiment of the present application, and the process includes the following steps S202 to S208.
[0035] It should be noted that the method for processing the bullet screen special effects shown in steps S202 to S208 can be, but is not limited to, executed by an electronic device, wherein the electronic device can be, but is not limited to, Figure 1 The target terminal or server is shown.
[0036] Step S202, in the process of playing the target video through the target application, in response to the target bullet screen sent by the target account, starting the bullet screen container of the target application, wherein the bullet screen container is used to process the display form and control logic of the bullet screen, and the bullet screen container carries the view component of the target game engine;
[0037] Step S204: in response to the matching process between the video ID of the target video and the resource ID of the target resource, configuring the hot update path to the hot update directory of the target game engine;
[0038] Step S206, based on the hot update path, loading the target script and target resource file in the hot update directory, and updating the bullet screen control logic in the view component of the target game engine;
[0039] Step S208, based on the barrage control logic, determine the target barrage special effect of the target barrage, and display the target barrage in the target video screen according to the target display form indicated by the target barrage special effect.
[0040] The technical solution in the embodiment of the present application can be applied to, but not limited to, displaying bullet comments sent by other accounts while watching a video played on a video platform, wherein the video platform includes, but is not limited to, long video platforms, short video platforms, live video platforms, and video sharing platforms. The service content of the video platform can be, but is not limited to, video uploading, storage, sharing, recommendation, live broadcast, on-demand, interaction, and other forms.
[0041] For ease of understanding, the present application embodiment takes the target application that can play videos as a video platform, and the video played in the target application as a target video as an example to explain the processing process of the above-mentioned barrage special effects.
[0042] During the process of playing the target video through the target application, assuming that account 1 and the target account are watching the target video at the same time, and the target account sends a barrage (for example, a target barrage), then in response to the target barrage sent by the target account, the barrage container of the target application is started.
[0043] The bullet screen container usually refers to the interface part used to display users' real-time comments or feedback during video playback. These comments are displayed floating on the video screen in the form of bullet screen, providing viewers with a novel viewing experience and interactive method.
[0044] Danmu containers may be supported by specific Danmu services or APIs, such as JavaScript libraries (such as vue-danmaku) in web pages to display and control Danmu. Danmu containers can handle animation effects such as display, movement, and disappearance of Danmu, as well as user interaction with Danmu.
[0045] In order to increase the diversity of bullet screen special effects, the following embodiments are proposed in the present application: Figure 3A barrage container is shown, in which the target game engine is abstracted into a view component (view), and the view component is embedded in the original barrage container layer of the target application. When it is determined that the target game engine needs to be started, the target barrage is displayed using a more diverse barrage special effect that the target game engine can provide.
[0046] That is to say, the part of the game engine responsible for handling the barrage logic (such as creation, rendering, movement, collision detection, etc.) is encapsulated into an independent module or layer (view component), and the module is regarded as a subview (subview) in the game view (view). The advantage of this processing method is that the barrage function can be modularized, making it easier to integrate into other parts of the game, improving the reusability and maintainability of the code.
[0047] Among them, the bullet screen container layer can usually achieve the following functions:
[0048] 1) Barrage management: create and manage barrage objects in the game;
[0049] 2) Rendering: Render bullet comments correctly on the screen, including their positions, speeds, and trajectories;
[0050] 3) User input: Process user input, such as shooting or moving, to generate new bullet screens;
[0051] 4) Collision detection: Detect collisions between bullet screens and game objects (such as players);
[0052] 5) Performance optimization: Ensure that the rendering and processing of bullet comments does not negatively impact game performance.
[0053] Before starting the bullet message container, the method further includes:
[0054] Obtain the target game engine;
[0055] The target game engine is abstracted as the view component, and the view component is connected to the bullet screen container of the target application.
[0056] In other words, by encapsulating the barrage logic in a separate layer, developers can control the behavior of the barrage more flexibly, while also reducing the coupling between other parts of the game and the barrage system, making it easier to expand and modify in the future.
[0057] Among them, the specific process of using the target game engine to develop barrage special effects is as follows Figure 4As shown, the project is created by importing resource data into the editor of the cocos creator game engine, and the developer develops the barrage special effect logic, and designs the scene production according to the barrage special effect logic. After the development is completed, the cocos creator game engine is used to package and publish the barrage function, and the editor outputs a specific resource file, and finally the resource file path is configured to the target game engine for loading and execution.
[0058] It should be noted that after responding to the target barrage sent by the target account, it will be determined whether the target game engine needs to be started to implement the special effects processing of the target barrage based on whether the video ID and the resource ID are matched. In other words, the target barrage in the embodiment of the present application can use the components in the native barrage container in the target application to process the barrage special effects, or use the target game engine to process the barrage special effects.
[0059] When it is determined that the target game engine is used to process the bullet screen special effects, the latest resource package will be obtained through the pre-configured hot update path before starting the target game engine, and the bullet screen control logic in the view component will be updated in real time by loading the resource package. The specific implementation method of the hot update process of the resource package will be described in detail below in conjunction with a specific embodiment.
[0060] Obviously, the advantages of using the target game engine to process bullet screen special effects include but are not limited to the following:
[0061] (1) Provides a variety of bullet screen special effects;
[0062] (2) Improved bullet screen rendering efficiency: Game engines are usually gamified and can quickly render a large number of bullet screens;
[0063] (3) Easy to achieve complex effects: The particle system and other tools provided by the game engine can easily create complex barrage special effects;
[0064] (4) Improved development efficiency: The game engine provides a resource management system to facilitate developers to manage barrage resources, thereby improving development efficiency;
[0065] (5) Save development time: Using a game engine can avoid writing code from scratch, greatly saving development time;
[0066] (6) Enriched user experience: The game engine allows audio and visual effects to be integrated into the bullet screen, providing a richer user experience.
[0067] By adopting the above method, the target game engine is abstracted into a view component and the view component is embedded in the barrage container of the target application, so that when the target barrage sent by the target account is received, the target game engine is started. At the same time, through the efficient development and hot update mechanism of the target game engine, the rapid iteration and dynamic loading of the barrage special effects are realized, which not only enriches the diversity of the barrage special effects, but also reduces the hardware requirements for client performance, thereby achieving the technical effect of reducing resource consumption.
[0068] As an optional implementation, in response to the matching process between the video ID of the target video and the resource ID of the target resource, configuring the hot update path to the hot update directory of the target game engine includes:
[0069] In response to the matching process between the video ID of the target video and the resource ID of the target resource, searching the local cache directory to obtain a target search result;
[0070] When the target search result indicates that the hot update resource package corresponding to the resource ID already exists in the local cache, the hot update path is configured in the hot update directory of the target game engine.
[0071] Since the developers have uploaded the pre-developed bullet screen control logic and all resource data to the remote server (or cloud), the dynamic update of the bullet screen function will be achieved by configuring a hot update path for the target game engine before starting it.
[0072] Among them, the location of the hot update resource on the server can be determined through the hot update path, so that the client knows where to download the updated resource. At the same time, through the hot update path, resources of different versions can also be accessed, which facilitates cross-version updates.
[0073] In addition, the hot update path allows downloading only the changed resources instead of the entire resource package, saving bandwidth and speeding up the update process. Through the hot update path, real-time updates can be performed without the end user using the target application to watch the target video, improving the user experience.
[0074] The resources required for hot update can be obtained from the remote server, and then the barrage control logic in the view component can be updated using the resources to determine how to display the target barrage and in what form of special effects to display it.
[0075] It should be noted that the purpose of searching the local cache directory before configuring the hot update path is to avoid repeated downloading of the same hot update resource package and save download resources.
[0076] It can be seen that the hot update path is a key component for realizing the hot update function, which ensures the accuracy, security and efficiency of resource updates.
[0077] As an optional example, after configuring the hot update path, the method further includes:
[0078] If the target search result indicates that the hot update resource corresponding to the resource ID does not exist in the local cache, downloading the hot update resource package from a remote server based on the resource ID;
[0079] The hot update resource package is decompressed to obtain the hot update path, and the hot update path is configured into the hot update directory of the target game engine.
[0080] As can be seen from the description in the above embodiment, when a hot update resource corresponding to a resource ID already exists in the local cache, the hot update path is directly configured into the hot update directory of the target game engine.
[0081] On the contrary, if the hot update resource corresponding to the resource ID is not retrieved in the local cache, it is necessary to first download the hot update resource package from the remote server according to the resource ID, then decompress the compressed package corresponding to the hot update resource package, obtain the hot update path, and configure the hot update path to the hot update directory of the target game engine.
[0082] In order to understand the configuration process of the hot update path more clearly, the following is combined Figure 5 The flowchart shown in the figure further describes the implementation process.
[0083] S502, start the bullet screen container;
[0084] The condition for starting the barrage container may be, but is not limited to, when the target account sends one or more barrages while the target video is being watched, wherein the target account may be one or more barrages sent by one, two or more accounts other than the current account that is currently watching the video.
[0085] S504, matching the video ID and the resource ID;
[0086] Get the video ID of the target video being played, and match the video ID with the resource ID.
[0087] S506, searching the local cache directory according to the resource ID, and searching the result according to the target;
[0088] Specifically, the local cache directory is searched according to the resource ID, wherein the local cache directory includes the resource ID of each resource package. According to the resource ID, it is determined whether there is a resource ID corresponding to the resource used to play the target video in the local cache directory.
[0089] S508, determining whether a resource package corresponding to the resource ID already exists in the local cache according to the target search result;
[0090] If it exists, execute step S514; otherwise, execute step S510.
[0091] S510, downloading a data packet (resource package) corresponding to the resource ID from a remote server according to the resource ID;
[0092] If the resource bundle corresponding to the resource ID already exists in the local cache, the resource bundle path is written to the database with the key hot_update_path.
[0093] S512, decompress the downloaded data packet to obtain a hot update path;
[0094] The decompressed hot update path is written to the database with the key hot_update_path.
[0095] S514, configuring the hot update resource path to the hot update directory of the target game engine;
[0096] S516, start the game engine.
[0097] Before the game engine is started, the hot update path configuration operation is performed. During the game engine startup phase, the database is read to retrieve the item with the key hot_update_path, and the corresponding hot update path is set to the hot update directory of the game engine. In this way, the target game engine will give priority to loading the scripts and resource files in the hot update directory.
[0098] If the script and resource files do not exist in the hot update directory, they will be loaded from the built-in directory.
[0099] Through the configuration mechanism of the above hot update path, when storing the barrage control logic and resource data of the target game engine, it is ensured that the hot update resource package can be loaded preferentially by the target game engine, so as to realize the dynamic update of the barrage function, improve the rapid loading of the barrage special effects, and make the special effects presentation smoother, reduce resource consumption, and improve the overall application response speed and user satisfaction.
[0100] As an optional example, before configuring the hot update path to the hot update directory of the target game engine, the method further includes:
[0101] Downloading a pre-configured resource configuration table from a remote server, wherein the resource configuration table includes the latest resource information used in the process of playing the target video;
[0102] Based on the resource configuration table, determining a first version number of the resource package in the remote server;
[0103] Obtaining from the local cache a second version number of a resource package currently being used by the target video being played;
[0104] Compare the first version number with the second version number to obtain a target comparison result;
[0105] When the target comparison result indicates that the first version number is inconsistent with the second version number, the hot update resource package is downloaded from the remote server based on the resource ID.
[0106] In the embodiment of the present application, the method for determining whether hot update is required can refer to Figure 6 As shown, including:
[0107] S610, downloading a pre-configured resource configuration table from a remote server;
[0108] The configuration table includes resource categories and resource information, that is, the resource configuration table can be used to determine whether the developer in the remote server has uploaded an updated resource package and obtain the first version number of the latest resource package in the current server.
[0109] S612, comparing the first version number with the second version number of the resource package in the local cache;
[0110] S614, when the first version number and the second version number are inconsistent, determine to start the hot update process;
[0111] S616, downloading a hot update resource package;
[0112] S618, verifying the resource file;
[0113] When the resource configuration table is downloaded from the remote server, the resource file is also downloaded. In order to ensure the accuracy of the remotely downloaded resource file, the resource file needs to be proofread.
[0114] The specific method of proofreading is to obtain the first hash code of the original resource file when it is uploaded to the remote server, and obtain the second hash code of the downloaded resource file. By comparing the first hash code and the second hash code, it is determined whether the downloaded resource file is complete and whether the file content has been tampered with.
[0115] It should be noted that hash codes are a mechanism for ensuring file integrity. A hash code (or hash value) is a string of fixed-length characters calculated by a hash function on a file, which can uniquely identify the contents of a file. If the contents of a file change in any way, even a minor change, its hash value will change significantly. Therefore, hash codes are often used to detect whether a file has been tampered with or damaged during transmission or storage.
[0116] When the resource file verification fails, the process jumps to step S616 to re-download the hot update resource package.
[0117] S620, enter the game to load the hotfix.
[0118] Before executing steps S610 to S620, the server-side file steps need to be completed through the hot update preparation stage, wherein the preparation stage mainly includes the production and deployment of the hot update package. Through the production of the target game engine, the hot update package is output in the form of a compressed package and deployed to the server side, as follows:
[0119] S602, recording the package version number and all resource information during packaging;
[0120] After completing development, operators or developers record the version number of the packaged resources.
[0121] S604, outputting hot update resources through the editor of the target game engine;
[0122] S606, obtaining a hot update package (hot update resource package) and a resource configuration table;
[0123] S608: The server completes file deployment.
[0124] It can be seen that the dynamic update capability of the barrage function is achieved by uploading the barrage control logic and all resource data to the cloud (remote server) and configuring the hot update path before starting the game engine.
[0125] In this embodiment, the hot update method is adopted because hot update allows new or modified resources (such as images, audio, scripts, etc.) to be downloaded through the network after the game or application is released, and replaced or added to the application in real time without restarting the application; secondly, through hot update technology, developers can directly perform dynamic updates during the operation of the target application, providing developers and users with a more flexible, efficient and secure update method.
[0126] As an optional example, the above method further includes:
[0127] In response to a trigger operation on a target video screen, a trigger event corresponding to the trigger operation is transmitted to the bullet screen container;
[0128] Transmitting the trigger event to the target game engine via the bullet screen container;
[0129] When it is determined that the target game engine responds to the trigger event, the trigger event is distributed to the target game engine, and the trigger event is processed by the target game engine.
[0130] In an embodiment of the present application, by adding a click event proxy layer, all click events (which can also be understood as trigger events) are intercepted, and the click events are preferentially passed to the barrage container for processing by the game engine. The consumption of the event is determined based on the processing results, and the click event proxy layer then distributes the event based on the consumption.
[0131] The trigger operation or click event mentioned above includes but is not limited to the user pausing or fast-forwarding the target video through the trigger operation during the process of watching the target video. During the process of watching the video, the user pauses, fast-forwards, and other operations. Are these operations taught to the engine to handle or handed over to the native component to handle? The so-called consumption situation may include but is not limited to whether the game engine responds to the click event.
[0132] Through the design of the above click event layer, the gesture conflict problem between the view component abstracted by the target game engine and the native component is avoided, ensuring the smoothness of user interaction.
[0133] The gesture conflict problem refers to the situation in which multiple components in the user interface are bound to gesture events at the same time, or the same component is bound to multiple gestures. These gesture events may interfere with each other, resulting in the user's operations not being responded to correctly.
[0134] It should be noted that the interaction between the target game engine and the native application in the embodiment of the present application can be but is not limited to Figure 7 Specifically, it is based on JsbABridge to complete the two-way communication between Cocos and native components through pre-agreed cmd (command) and msg (message or message event).
[0135] The above communication method realizes two-way data interaction and event processing between the target game engine and the native reference, ensuring seamless connection between the target game engine and the native application, improving the efficiency of data interaction and the accuracy of event processing. Through these mechanisms, the bullet screen special effects can be updated in real time.
[0136] As an optional example, the above method further includes:
[0137] In the case where the matching process between the video ID of the target video and the resource ID of the target resource is not performed, the original control logic of the bullet-chat container of the target application is started, wherein the original control logic is different from the bullet-chat control logic in the view component;
[0138] Based on the original control logic, the target barrage special effect of the target barrage is determined, and the target barrage is displayed in the target video screen according to the target display form indicated by the target barrage special effect.
[0139] From the description of the above embodiments, it can be seen that by abstracting the target game engine into a view component and utilizing the efficient development and hot update mechanism of the game engine, not only the categories and operation of the barrage special effects are enriched, but also the rapid iteration and dynamic loading of the barrage special effects are improved.
[0140] However, the barrage container layer carried by the native application itself can also complete the special effects processing of the target barrage. Therefore, a processing mechanism is designed in the embodiment of the present application to determine whether it is necessary to start the target game engine to process the barrage special effects.
[0141] Specifically, it checks whether the video ID of the currently playing video matches the resource ID of the target resource. If a match is made, the target game engine is started first, and the hot update process is executed to determine the target bullet screen special effects. Otherwise, the original control logic of the native target application is still used to determine the form in which the target bullet screen is displayed.
[0142] In a specific embodiment, optimization can be performed for devices with different performances according to the device level and player configuration strategy, and a more efficient rendering strategy can be adopted for low-end devices to avoid problems such as low rendering efficiency and inability to load complex barrage special effects due to device performance issues.
[0143] The above switching mechanism ensures the smooth operation of the barrage special effects on different devices, and maintains good performance even on low-end devices, avoiding freezes and delays. It is suitable for devices with limited resources, such as old mobile phones and low-configuration tablets, and improves the viewing experience of users of these devices.
[0144] In addition to the contents described in the above embodiments, in order to ensure that the barrage special effects determined by the target game engine can be displayed normally in the video screen, during the background implementation process, the surfaceview (a special view component) in the Android system is set to transparent mode, and the clearcolor field of the camera in the target game engine is controlled to be transparent, so that there is a non-transparent surfaceview as a base under the transparent surfaceview, thereby ensuring that there will be no black screen problem.
[0145] In the Android system, transparent surfaceview will cause a black screen problem due to digging holes. Therefore, the engine barrage can only be turned on when the video player is configured in surfaceview mode to ensure that there will be no black screen problem.
[0146] It should be noted that in the traditional game screen, there is only one layer of view components, and the game screen and bullet comments are displayed simultaneously on the single-level user interface where the view component is located. However, in the embodiment of the present application, the target game engine is abstracted into a view component, thereby forming a multi-level view component, and rendering UI elements on different layers. For example, the video screen is rendered on the layer where the native component is located, and the engine bullet comments processed by the game engine are rendered on the layer where the abstracted view component is located.
[0147] By utilizing the rendering capabilities of the target game engine, the extensibility of the barrage function is improved, and many effects that cannot be achieved in the native barrage library are realized. At the same time, the development efficiency of the barrage function is also improved. Combined with the cross-platform capabilities of the game engine, one-time development and multi-terminal deployment are realized. The update capability of the barrage function is improved, and combined with the hot update capability of the game engine, the ability to dynamically update without releasing a version is realized.
[0148] By integrating the game engine and leveraging the cross-platform capabilities of the game engine, the barrage container can be developed once and deployed on multiple terminals (for example, iOS, Android, and WebGL). By introducing the scripting engine function of the game engine, the barrage container can be dynamically updated.
[0149] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0150] According to another aspect of the embodiment of the present application, there is also provided Figure 8 A device for processing barrage special effects is shown, the device comprising:
[0151] The starting unit 802 is used to start the bullet screen container of the target application in response to the target bullet screen sent by the target account during the process of playing the target video through the target application, wherein the bullet screen container is used to process the display form and control logic of the bullet screen, and the bullet screen container carries the view component of the target game engine;
[0152] A first configuration unit 804 is configured to configure a hot update path into a hot update directory of the target game engine in response to a matching process between the video ID of the target video and the resource ID of the target resource;
[0153] The first processing unit 806 is used to load the target script and target resource file in the hot update directory based on the hot update path, and update the bullet screen control logic in the view component of the target game engine;
[0154] The second processing unit 808 is used to determine the target barrage special effect of the target barrage based on the barrage control logic, and display the target barrage in the target video screen according to the target display form indicated by the target barrage special effect.
[0155] Optionally, the first configuration unit 804 includes:
[0156] A first retrieval module, configured to retrieve a local cache directory in response to a matching process between the video ID of the target video and the resource ID of the target resource, and obtain a target retrieval result;
[0157] The first configuration module is used to configure the hot update path to the hot update directory of the target game engine when the target search result indicates that the hot update resource package corresponding to the resource ID already exists in the local cache.
[0158] Optionally, the above device further includes:
[0159] A first downloading unit, configured to download the hot update resource package from a remote server based on the resource ID when the target search result indicates that the hot update resource corresponding to the resource ID does not exist in the local cache;
[0160] The second configuration unit is used to decompress the hot update resource package to obtain the hot update path, and configure the hot update path to the hot update directory of the target game engine. Optionally, the above device also includes:
[0161] A second downloading unit is used to download a pre-configured resource configuration table from a remote server before configuring the hot update path into the hot update directory of the target game engine, wherein the resource configuration table includes the latest resource information used in the process of playing the target video;
[0162] A third processing unit, configured to determine a first version number of the resource package in the remote server based on the resource configuration table;
[0163] A first acquisition unit, configured to acquire, from the local cache, a second version number of a resource package currently being used by the target video being played;
[0164] A fourth processing unit, used to compare the first version number with the second version number to obtain a target comparison result;
[0165] A third downloading unit downloads the hot update resource package from the remote server based on the resource ID when the target comparison result indicates that the first version number is inconsistent with the second version number.
[0166] Optionally, the above device further includes:
[0167] A second acquisition unit is used to acquire the target game engine before starting the barrage container in the target application in response to the target barrage sent by the target account;
[0168] The fifth processing unit is used to abstract the target game engine into the view component and connect the view component to the bullet screen container of the target application.
[0169] Optionally, the above device further includes:
[0170] A sixth processing unit, configured to transmit a trigger event corresponding to the trigger operation to the bullet screen container in response to a trigger operation on the target video screen;
[0171] A transmission unit, used for transmitting the trigger event to the target game engine through the bullet commentary container;
[0172] A distribution unit is used to distribute the triggering event to the target game engine when it is determined that the target game engine responds to the triggering event, and process the triggering event through the target game engine.
[0173] Optionally, the above device further includes:
[0174] a seventh processing unit, configured to start the original control logic of the bullet-chassis container of the target application without performing a matching process between the video ID of the target video and the resource ID of the target resource, wherein the original control logic is different from the bullet-chassis control logic in the view component;
[0175] The eighth processing unit is used to determine the target barrage special effect of the target barrage based on the original control logic, and display the target barrage in the target video screen according to the target display form indicated by the target barrage special effect.
[0176] By applying the above-mentioned device to abstract the target game engine into a view component and embedding the view component in the barrage container of the target application, the target game engine is started when the target barrage sent by the target account is received. At the same time, through the efficient development and hot update mechanism of the target game engine, the rapid iteration and dynamic loading of the barrage special effects are achieved, which not only enriches the diversity of the barrage special effects, but also reduces the hardware requirements for client performance, thereby achieving the technical effect of reducing resource consumption.
[0177] It should be noted that the embodiment of the device for processing the barrage special effects here can refer to the embodiment of the method for processing the barrage special effects mentioned above, which will not be repeated here.
[0178] According to another aspect of the embodiment of the present application, an electronic device for implementing the above-mentioned method for processing barrage special effects is also provided. The electronic device may be Figure 1 The target terminal or server shown in FIG. This embodiment is described by taking the electronic device as the target terminal as an example. Fig. 9 As shown, the electronic device includes a memory 902 and a processor 904. The memory 902 stores a computer program, and the processor 904 is configured to execute the steps in any of the above method embodiments through the computer program.
[0179] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
[0180] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0181] S1, in the process of playing a target video through a target application, in response to a target bullet screen sent by a target account, starting a bullet screen container of the target application, wherein the bullet screen container is used to process the display form and control logic of the bullet screen, and the bullet screen container carries a view component of a target game engine;
[0182] S2, in response to the matching process between the video ID of the target video and the resource ID of the target resource, configuring the hot update path into the hot update directory of the target game engine;
[0183] S3, based on the hot update path, loading the target script and target resource file in the hot update directory, and updating the bullet screen control logic in the view component of the target game engine;
[0184] S4, based on the barrage control logic, determine the target barrage special effect of the target barrage, and display the target barrage in the target video screen according to the target display form indicated by the target barrage special effect.
[0185] Alternatively, a person skilled in the art may understand that: Fig. 9 The structure shown is for illustration only. Fig. 9 The electronic device and the electronic equipment described above are not limited in structure. Fig. 9 More or fewer components (such as network interfaces, etc.) as shown in, or with Fig. 9 Different configurations are shown.
[0186] Among them, the memory 902 can be used to store software programs and modules, such as the program instructions / modules corresponding to the method and device for processing the barrage special effects in the embodiments of the present application. The processor 904 executes various functional applications and data processing by running the software programs and modules stored in the memory 902, that is, realizing the above-mentioned method for processing the barrage special effects. The memory 902 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 902 may further include a memory remotely located relative to the processor 904, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 902 can be specifically, but not limited to, used to store target video images, target scripts, and target resource files, etc. As an example, such as Fig. 9 As shown, the memory 902 may include, but is not limited to, the pneumatic unit 802, the first configuration unit 804, the first processing unit 806, and the second processing unit 808 in the processing device for the bullet screen special effects. In addition, other module units in the processing device for the bullet screen special effects may also be included but are not limited to, which will not be repeated in this example.
[0187] Optionally, the transmission device 906 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wired network and a wireless network. In one example, the transmission device 906 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 906 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0188] In addition, the electronic device further includes: a display 908 for displaying the video screen of the target video and the target barrage; and a connection bus 910 for connecting the various module components in the electronic device.
[0189] In other embodiments, the target terminal or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes through network communication. The nodes may form a point-to-point network, and any form of computing device, such as a server, a target terminal or other electronic device, may become a node in the blockchain system by joining the point-to-point network.
[0190] According to another aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the processing method of the bullet screen special effects provided in various optional implementations of the above-mentioned server verification processing and other aspects, wherein the computer program is configured to execute the steps of any of the above-mentioned method embodiments when running.
[0191] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0192] S1, in the process of playing a target video through a target application, in response to a target bullet screen sent by a target account, starting a bullet screen container of the target application, wherein the bullet screen container is used to process the display form and control logic of the bullet screen, and the bullet screen container carries a view component of a target game engine;
[0193] S2, in response to the matching process between the video ID of the target video and the resource ID of the target resource, configuring the hot update path into the hot update directory of the target game engine;
[0194] S3, based on the hot update path, loading the target script and target resource file in the hot update directory, and updating the bullet screen control logic in the view component of the target game engine;
[0195] S4, based on the barrage control logic, determine the target barrage special effect of the target barrage, and display the target barrage in the target video screen according to the target display form indicated by the target barrage special effect.
[0196] Optionally, in the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0197] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing the hardware related to the target terminal through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0198] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0199] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to execute all or part of the steps of the methods of each embodiment of the present application.
[0200] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0201] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0202] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0203] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0204] The above are only preferred implementations of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for processing barrage special effects, characterized in that: include: In the process of playing the target video through the target application, in response to the target bullet screen sent by the target account, the bullet screen container of the target application is started, wherein the bullet screen container is used to process the display form and control logic of the bullet screen, and the bullet screen container carries the view component of the target game engine; In response to a matching process between the video ID of the target video and the resource ID of the target resource, configuring a hot update path into a hot update directory of the target game engine; Based on the hot update path, load the target script and target resource file in the hot update directory, and update the bullet screen control logic in the view component of the target game engine; Based on the barrage control logic, the target barrage special effect of the target barrage is determined, and the target barrage is displayed in the target video screen according to the target display form indicated by the target barrage special effect.
2. The method according to claim 1, characterized in that: The step of configuring the hot update path to the hot update directory of the target game engine in response to the matching process between the video ID of the target video and the resource ID of the target resource comprises: In response to the matching process between the video ID of the target video and the resource ID of the target resource, searching the local cache directory to obtain a target search result; When the target search result indicates that the hot update resource package corresponding to the resource ID already exists in the local cache, the hot update path is configured in the hot update directory of the target game engine.
3. The method according to claim 2, characterized in that The method further comprises: If the target search result indicates that the hot update resource corresponding to the resource ID does not exist in the local cache, downloading the hot update resource package from a remote server based on the resource ID; The hot update resource package is decompressed to obtain the hot update path, and the hot update path is configured into the hot update directory of the target game engine.
4. The method according to claim 2, characterized in that: Before configuring the hot update path into the hot update directory of the target game engine, the method further includes: Downloading a pre-configured resource configuration table from a remote server, wherein the resource configuration table includes the latest resource information used in the process of playing the target video; Based on the resource configuration table, determining a first version number of the resource package in the remote server; Obtaining from the local cache a second version number of a resource package currently being used by the target video being played; Compare the first version number with the second version number to obtain a target comparison result; When the target comparison result indicates that the first version number is inconsistent with the second version number, the hot update resource package is downloaded from the remote server based on the resource ID.
5. The method according to claim 1, characterized in that Before starting the barrage container in the target application in response to the target barrage sent by the target account, the method further includes: Obtain the target game engine; The target game engine is abstracted as the view component, and the view component is connected to the bullet screen container of the target application.
6. The method according to claim 1, characterized in that The method further comprises: In response to a trigger operation on a target video screen, a trigger event corresponding to the trigger operation is transmitted to the bullet screen container; Transmitting the trigger event to the target game engine via the bullet screen container; When it is determined that the target game engine responds to the trigger event, the trigger event is distributed to the target game engine, and the trigger event is processed by the target game engine.
7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: In the case where the matching process between the video ID of the target video and the resource ID of the target resource is not performed, the original control logic of the bullet-chat container of the target application is started, wherein the original control logic is different from the bullet-chat control logic in the view component; Based on the original control logic, the target barrage special effect of the target barrage is determined, and the target barrage is displayed in the target video screen according to the target display form indicated by the target barrage special effect.
8. A device for processing barrage special effects, characterized in that: include: A starting unit, used for starting a bullet-screen container of the target application in response to a target bullet-screen sent by a target account during the process of playing a target video through a target application, wherein the bullet-screen container is used to process the display form and control logic of the bullet-screen, and the bullet-screen container carries a view component of a target game engine; A first configuration unit, configured to configure a hot update path into a hot update directory of the target game engine in response to a matching process between a video ID of the target video and a resource ID of a target resource; A first processing unit, configured to load a target script and a target resource file in the hot update directory based on the hot update path, and update a bullet screen control logic in a view component of the target game engine; The second processing unit is used to determine the target barrage special effect of the target barrage based on the barrage control logic, and display the target barrage in the target video screen according to the target display form indicated by the target barrage special effect.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program can be executed by a terminal device or a computer to execute the method as claimed in any one of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.