Bullet screen processing method and device, equipment and medium

By introducing a state machine in the barrage state management, determining the target state of the barrage based on the preset state change rules, and uniformly updating the barrage state in multiple databases, the problem of inconsistent barrage state is solved and the system is improved Reliability and user experience.

CN119484928APending Publication Date: 2025-02-18BEIJING IQIYI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411623186.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The existing barrage status management is chaotic, resulting in inconsistent status of the same barrage in different databases, which in turn causes other abnormal problems.

Method used

Introduce a state machine to determine the target state of the target barrage based on the target trigger event, the current state of the target barrage and the preset state change rules, and uniformly update the target barrage stored in multiple target databases. Current status.

Benefits of technology

Effectively ensure the consistency of the same barrage in multiple databases, optimize the performance of barrage system, and improve the reliability and user experience of barrage management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119484928A_ABST
    Figure CN119484928A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to a bullet screen processing method, a bullet screen processing device, equipment and a medium, and the method comprises the steps: when a target triggering event used for changing the current state of a target bullet screen is monitored, performing bullet screen processing; determining a target state of the target bullet screen based on the target trigger event, the current state of the target bullet screen and a preset state change rule through a preset state machine; based on the target state of the target bullet screen, respectively updating the current states of the target bullet screens stored in a plurality of target databases; wherein the target database is a database in which the target bullet screen is stored, and different target databases have different purposes. According to the embodiment of the invention, the state consistency of the same bullet screen in a plurality of databases can be effectively guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to a bullet screen processing method, device, equipment and medium. Background Art

[0002] Bullet comments refer to the commentary text, emoticons, patterns and other information displayed on the video playback screen. Users can send bullet comments while watching videos to share their video experience with others. Users can also view bullet comments sent by other users while watching videos to learn about other users' video experience. Bullet comments help promote communication between users and increase the fun of watching videos.

[0003] The barrage system responsible for processing barrages usually needs to process a large amount of barrage data, and usually stores the same barrage in different databases based on business needs. However, the inventors have found through research that the existing barrage status management is chaotic, and the same barrage often has inconsistent status in different databases. The above problems will further lead to other abnormalities in the future. Therefore, the problem of inconsistent status of the same barrage in multiple databases needs to be solved urgently. Summary of the invention

[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a bullet comment processing method, device, equipment and medium.

[0005] An embodiment of the present disclosure provides a barrage processing method, the method comprising: when a target trigger event for changing the current state of a target barrage is detected, determining the target state of the target barrage based on the target trigger event, the current state of the target barrage and a preset state change rule by a preset state machine; based on the target state of the target barrage, updating the current states of the target barrages stored in multiple target databases respectively; wherein the target database is a database storing the target barrage, and different target databases have different uses.

[0006] Optionally, the state change rule includes at least a plurality of preset state change paths and a triggering event corresponding to each of the state change paths.

[0007] Optionally, the state change path is used to indicate a change from a first state to a second state; different state change paths correspond to different first states and / or second states; the multiple state change paths include a first type of path and a second type of path; wherein, when a trigger event corresponding to the first type of path is detected, the first state indicated by the first type of path is unconditionally changed to the second state; when a trigger event corresponding to the second type of path is detected, the first state indicated by the second type of path is conditionally changed to the second state; the state change rule also includes a state change condition corresponding to the second type of path.

[0008] Optionally, the method further includes: when the state change rule does not include a state change path corresponding to the target trigger event, determining that the target trigger event is an abnormal event; discarding the target trigger event, and recording relevant information of the target trigger event.

[0009] Optionally, based on the target state of the target barrage, the current states of the target barrages stored in multiple target databases are updated respectively, including: for each target database in the multiple target databases, obtaining the current version number of the target barrage in the target database recorded in a preset centralized version database; wherein the centralized version database is a database for recording barrage version numbers; obtaining the target version number of the target barrage to be updated; based on the current version number of the target barrage in the target database recorded in the centralized version database and the target version number of the target barrage to be updated, determining whether to perform a database update operation; if so, based on the target state of the target barrage, updating the current state of the target barrage stored in the target database; and based on the target version number of the target barrage, updating the current version number of the target barrage in the target database recorded in the centralized version database.

[0010] Optionally, the target version number is represented by the timestamp of the target triggering event; the current version number of the target barrage is represented by the timestamp of the triggering event corresponding to the current state of the target barrage.

[0011] Optionally, the judging whether to execute the database update operation based on the current version number of the target barrage in the target database recorded in the centralized version database and the target version number of the target barrage to be updated comprises: comparing the current version number of the target barrage in the target database recorded in the centralized version database and the target version number of the target barrage to be updated; if the target version number is greater than the current version number, determining to execute the database update operation.

[0012] Optionally, the method further includes: if the target version number is not greater than the current version number, discarding the target trigger event.

[0013] The disclosed embodiment also provides a barrage processing device, including: a state determination module, for determining the target state of the target barrage based on the target trigger event, the current state of the target barrage and a preset state change rule through a preset state machine when a target trigger event for changing the state of the target barrage is detected; a database update module, for updating the current states of the target barrages stored in multiple target databases respectively based on the target state of the target barrage; wherein the target database is a database storing the target barrage, and different target databases correspond to different business scenarios.

[0014] An embodiment of the present disclosure also provides an electronic device, which includes: a processor; a memory for storing executable instructions of the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement the barrage processing method provided by the embodiment of the present disclosure.

[0015] An embodiment of the present disclosure further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute the barrage processing method provided by the embodiment of the present disclosure.

[0016] The embodiments of the present disclosure also provide a computer program product, including a computer program, which implements the barrage processing method provided by the embodiments of the present disclosure when executed by a processor.

[0017] The above-mentioned technical solution provided by the embodiment of the present disclosure can introduce the state machine into the barrage state management. When a target trigger event for changing the current state of the target barrage is detected, the target state of the target barrage will first be determined by a preset state machine based on the target trigger event, the current state of the target barrage and the preset state change rule. The target state determined by the state machine according to the state change rule is more accurate and reliable. Then, the target state based on the target barrage is unified, and the current states of the target barrages stored in multiple target databases are updated respectively, thereby effectively ensuring the state consistency of the target barrage in multiple target databases.

[0018] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended 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

[0019] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0021] Figure 1 A schematic diagram of bullet screen status management provided by an embodiment of the present disclosure;

[0022] Figure 2 A schematic diagram of state management of a bullet screen reporting service provided in an embodiment of the present disclosure;

[0023] Figure 3 A schematic diagram of a process flow of a bullet screen processing method provided by an embodiment of the present disclosure;

[0024] Figure 4 A schematic diagram of a state machine principle provided in an embodiment of the present disclosure;

[0025] Figure 5 A schematic diagram of centralized version management provided by an embodiment of the present disclosure;

[0026] Figure 6 A schematic diagram of the structure of a bullet screen processing device provided in an embodiment of the present disclosure;

[0027] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0028] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0029] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.

[0030] The barrage system needs to manage a large amount of barrage data, including real-time barrage input from many viewers and historical barrage, which is usually very complex to manage. The barrage life cycle involves business scenarios such as publishing, review, and governance. Each scenario contains multiple states, and each state has many flow scenarios. Each state is divided into main visible state or guest visible state, which makes barrage state management very difficult. For easier understanding, please refer to Figure 1 A schematic diagram of barrage state management is shown in Figure 1 The following is a simple diagram of some of the state management nodes that a bullet comment goes through when it is published, such as sensitive word verification, blacklist verification, verification center verification, block management, ban management, data anti-spam and other state management nodes that can change the state of the bullet comment. Figure 1 The following are just some simple examples of state management nodes, and we will not list them one by one. Each state management node may generate a bullet screen deletion state, such as "sensitive word deletion state", "blacklist deletion state", etc. Only after all state management nodes have been verified, the bullet screen will finally have a normal state, and the entire bullet screen release process will end in this state. After that, the bullet screen may also go through various services that will still change the status of the bullet screen, such as bullet screen review business, bullet screen reporting business, etc. Figure 2 The state management diagram of a bullet comment reporting service shown in the figure shows that a bullet comment in a normal state will be changed to a user reporting state after being reported by a user. After the report is reviewed, it will also be determined whether the report is successful, thereby determining whether the state of the bullet comment should be changed to a normal state or a report deletion state. It should be noted that Figure 1 This is just a simple example of some state management nodes in the bullet posting process. Figure 2 Only a state management node involved in a business is briefly illustrated. The above is mainly used to illustrate that the complexity of barrage state management is extremely high when the current barrage business is complex and there are many barrage states.

[0031] Furthermore, in response to different business needs, the barrage system usually uses different databases (also called data sources) to store barrages. Since the barrage status management itself is relatively complex, especially in the case of multiple databases, it is very easy to have inconsistent state transfers, that is, the status of the same barrage recorded in different databases is inconsistent, which will lead to many subsequent processing problems, such as abnormal user-side data display problems. For example, the barrage that the user has deleted is displayed to other users, resulting in an abnormal display problem in which the main state is invisible but the guest state is visible. It should also be noted that if there is any inconsistency in the barrage status in each database, it will further complicate the barrage management and may cause serious system errors.

[0032] In order to improve the above problems, the embodiments of the present disclosure provide a barrage processing method, device, equipment and medium, which can better ensure the consistency of the state recorded in different databases of the same barrage, thereby optimizing the performance of the barrage system, improving the reliability of barrage management, and helping to further enhance the user experience.

[0033] Figure 3 A flow chart of a barrage processing method provided in an embodiment of the present disclosure is provided. The method can be executed by a barrage processing device, wherein the device can be implemented using software and / or hardware and can generally be integrated in an electronic device, such as a server device.

[0034] like Figure 1 As shown, the method mainly includes the following steps S302 to S304:

[0035] Step S302, when a target trigger event for changing the current state of the target barrage is detected, a target state of the target barrage is determined by a preset state machine based on the target trigger event, the current state of the target barrage and a preset state change rule.

[0036] In practical applications, any event that can trigger a change in the state of a barrage can be used as a target trigger event, and the barrage that is triggered to change state can be regarded as a target barrage. In practical applications, the server can pre-set a state machine (also called a state machine model), which can be a finite state machine. The state machine is preset with state change rules to indicate the reasonable flow of the barrage state based on the triggering event. The target trigger event and the current state of the target barrage can be provided to the state machine. The state machine can respond quickly based on the state change rules (that is, predefined rules) and efficiently output the target state of the target barrage. Since it is a target state determined based on predefined rules, each barrage state and its flow direction are clear and in line with expectations, so it can effectively ensure the accuracy and reliability of the barrage state and simplify the complexity of barrage state management.

[0037] Step S304, based on the target state of the target barrage, the current states of the target barrages stored in multiple target databases are updated respectively; wherein the target database is a database storing the target barrages, and different target databases have different purposes. Exemplarily, databases such as hbase, tidb or elasticsearch can be used as databases for storing barrages, and each database has different corresponding purposes, that is, it is oriented to different business scenarios. For example, hbase can be used as the main database for big data storage; tidb can be used for user queries and user information queries; elasticsearch can be used as a search engine for operational data queries. The above are only examples, which can be flexibly set and are not limited here.

[0038] The target state determined by the state machine according to the state change rules is more accurate and reliable. On this basis, all target databases storing target barrages are uniformly updated, thereby effectively ensuring the consistency of the state of the target barrage in multiple target databases.

[0039] For ease of understanding, the state change rules preset in the state machine are described below: In some embodiments, the state change rules include at least a plurality of preset state change paths, and the trigger events corresponding to each state change path. In this way, it helps the state machine to quickly determine the corresponding state change path based on the monitored target trigger event, so as to accurately determine the flow of the barrage state based on the state change path, that is, to determine what kind of reasonable state (that is, the target state) the target barrage should change from the current state to meet the expected reasonable state. Exemplarily, the state change path is used to indicate a change from a first state to a second state; different state change paths correspond to different first states and / or second states; the first state can be regarded as a state before the barrage changes, and the second state can be regarded as a state after the barrage changes. For example, state change path 1 is used to indicate a change from barrage state 1 (first state) to barrage state 2 (second state); state change path 2 is used to indicate a change from barrage state 2 (first state) to barrage state 3 (second state). In practical applications, all reasonable state change paths can be pre-set so that the state transition of the barrage occurs in a limited and clear set of states, which is more intuitive and easier to understand and maintain. It can be understood that the state machine simplifies complex business logic into limited states and state change paths, thereby effectively reducing the complexity of barrage state management. In addition, through predefined clear state change paths, the state machine can quickly process and respond to various inputs and output accurate results. For example, the state machine can quickly and accurately determine the target state of the target barrage based on the target trigger event and the current state of the target barrage. The current state of the target barrage is the first state indicated by the state change path corresponding to the target trigger event, and the target state of the target barrage is the second state indicated by the state change path corresponding to the target trigger event.

[0040] Further, multiple state change paths include a first type of path and a second type of path; wherein, when a trigger event corresponding to the first type of path is monitored, the first state indicated by the first type of path is unconditionally changed to the second state; when a trigger event corresponding to the second type of path is monitored, the first state indicated by the second type of path is conditionally changed to the second state; on this basis, the state change rule also includes a state change condition corresponding to the second type of path. Exemplarily, the state change path corresponding to the reporting event can be regarded as a first type of path. If a normal state barrage is reported by someone, the barrage can be unconditionally changed from the normal state to the reporting state. The state change path corresponding to the reporting review event can be regarded as a second type of path. Only when the reporting review is passed can the barrage be changed from the reporting state to the reporting deletion state; or, only when the reporting review is rejected can the barrage be changed from the reporting state to the normal state. In practical applications, the preset multiple state change paths can be reasonably divided into the first type of path or the second type of path according to the type of trigger event corresponding to each state change path, so as to facilitate the state machine to reasonably determine the state flow of the barrage, thereby outputting accurate barrage state results.

[0041] For easier understanding, you can also refer to Figure 4 The schematic diagram of a state machine principle shown in FIG. 1 is a simple diagram of two states. The state change path corresponding to event 1 is from state 1 to state 2, and Figure 4 Condition 1 is marked in the figure, indicating that when event 1 occurs, certain conditions must be met before state 1 can be converted to state 2. That is, the path from state 1 to state 2 belongs to the second type of path. The state change path corresponding to event 2 is from state 2 to state 1, and the corresponding condition is not marked, indicating that when event 2 occurs, state 2 can be converted to state 1 unconditionally. In addition, Figure 4 The additional behavior shown in the figure refers to the business behavior that needs to be processed when event 1 occurs or when the state 1 changes to state 2, such as setting the bullet screen to be invisible. It should be noted that if the state is to be changed, an event must be triggered, but the triggering event or state change is not necessarily accompanied by conditions or behaviors, such as Figure 4 Event 2 in the example is not accompanied by any conditions or behaviors, and can be flexibly set based on actual business needs.

[0042] Furthermore, considering that abnormal events (also referred to as error events) may occur in actual applications, the method provided by the embodiment of the present disclosure also includes: when the state change rule does not contain a state change path corresponding to the target trigger event, determining that the target trigger event is an abnormal event; discarding the target trigger event, and recording relevant information of the target trigger event. Normally, for abnormal events, the state change rules preset in the state machine will not contain the corresponding state change path. At this time, the event can be abandoned and the exception handling mechanism can be triggered, that is, determining that the state machine rule hit fails, and then recording the abnormal change event, that is, when the target trigger event is determined to be an abnormal event, the relevant information of the target trigger event is recorded for subsequent analysis.

[0043] In summary, the disclosed embodiments can abstract all state flows of barrage into a finite state machine model based on the characteristics of the state machine, that is, by referencing the state machine to manage the barrage state, the state machine can quickly process and respond to various inputs according to clear predefined state change rules, and reasonably output the barrage state, which helps to ensure that the database storing the same barrage can accurately and consistently record the state of the barrage. Moreover, the state machine can make the barrage state transfer occur in a limited and clear set of states, which is easier to understand and maintain. In addition, in actual applications, if the state change business is expanded, such as adding a new state, it is only necessary to add a new state machine rule or modify the existing state machine rule. Therefore, the method of managing the barrage state through the state machine is highly scalable and can easily cope with the state change requirements of the barrage system caused by changes in business requirements.

[0044] In order to further ensure the consistency of the bullet screen state of the database, the embodiment of the present disclosure provides a specific example of respectively updating the current states of the target bullet screens stored in multiple target databases based on the target state of the target bullet screen, which can be performed with reference to the following steps A to D:

[0045] Step A, for each target database in multiple target databases, obtain the current version number of the target bullet comment in the target database recorded in the preset centralized version database; wherein the centralized version database is a database for recording the bullet comment version number. Exemplarily, couchbase or redis can be used as the centralized version database, which can be flexibly set and is not limited here.

[0046] As the state of the barrage changes, the version number of the barrage also changes accordingly. Every time a trigger event that changes the state of the barrage occurs, the state of the barrage changes, and the version number changes accordingly. In the embodiment of the present disclosure, a centralized version database for recording the version number of the barrage is additionally provided, and the centralized version database can save the current version number of each barrage in the database used to store the barrage. For the same barrage, taking the target barrage as an example, the target barrage may be stored in different target databases, and the centralized version database can record the version number of the target barrage in each target database, so as to manage the barrage status based on the version number.

[0047] Step B, obtain the target version number of the target barrage to be updated.

[0048] In order to ensure the accuracy and convenience of the bullet chat version number, the timestamp of the bullet chat state change can be used as the version number. The timestamp of the bullet chat state change can also be the timestamp of the trigger event that caused the bullet chat state change. Exemplarily, the target version number is represented by the timestamp of the target trigger event; the current version number of the target bullet chat is represented by the timestamp of the trigger event corresponding to the current state of the target bullet chat.

[0049] Step C, based on the current version number of the target barrage in the target database recorded in the centralized version database and the target version number of the target barrage to be updated, determines whether to perform a database update operation.

[0050] Exemplarily, the current version number of the target barrage in the target database recorded in the centralized version database and the target version number of the target barrage to be updated can be compared; if the target version number is greater than the current version number, it is determined to execute the database update operation.

[0051] Step D, if yes, based on the target state of the target barrage, update the current state of the target barrage stored in the target database; and based on the target version number of the target barrage, update the current version number of the target barrage in the target database recorded in the centralized version database.

[0052] In actual applications, if the current version number of the obtained target bullet comment is empty, it means that the bullet comment is currently corresponding to the initialization write operation or the bullet comment has passed the preset hot activity period. At this time, the database update operation can be directly executed.

[0053] The above method provided by the embodiment of the present disclosure also includes: if the target version number is not greater than the current version number, discarding the target trigger event.

[0054] As mentioned above, the target version number is represented by the timestamp of the target trigger event, and the current version number of the target barrage is represented by the timestamp of the trigger event corresponding to the current state of the target barrage. The database update will only be performed if the target trigger event is located after the trigger event corresponding to the current state of the target barrage, otherwise the trigger event will be discarded. For ease of understanding, an example is given as follows: Assuming that the initial version number of barrage A is V0, and it is in a normal state, at time point T1, trigger event 1 for changing the state of barrage A is detected. Based on the trigger event 1, the state of barrage A is converted from a normal state to a deleted state. At this time, the version number corresponding to barrage A is V1 (V1 can be set as T1); in addition, at time point T2, trigger event 2 for changing the state of barrage A is detected. Based on the trigger event 2, the state of barrage A is converted from a deleted state to a normal state. At this time, the version number corresponding to barrage A is V2 (V2 can be set as T2). Under normal circumstances, the version number of barrage A should be V1 first, then V2; however, there may be a problem of out-of-order consumption in the queue (used for asynchronous processing of database status changes), especially when the time interval between time points T1 and T2 is close. For example, assuming that time point T1 is 2:00, that is, trigger event 1 occurs at 2:00, and time point T2 is 2:01, that is, trigger event 2 occurs at 2:01, theoretically, event consumption, status change, version number change, etc. should be performed in sequence, but the queue used to process database changes may have a problem of out-of-order consumption, such as consuming trigger event 2 first, changing the version number of barrage A in the centralized version database to 2:01, and then consuming trigger event 2 again. At this time, it will be found that the version number to be updated 2:00 is less than the current version number 2:01 of barrage A, so the current version number 2:01 will no longer be updated to version number 2:00, but trigger event 1 can be directly discarded. Through the above method, it can be effectively guaranteed that each update is a one-way overwriting update, and there will be no problem of reverse update, thereby ensuring the final consistency of the barrage status in each target database.

[0055] For easier understanding, you can also refer to Figure 5 A schematic diagram of centralized version management is shown, illustrating a centralized version database, a target database 1, a target database 2, ... a target database n. Figure 5 The target database 1 is used as an example for explanation. For other target databases, the update process is similar to the update method of the target database 1. When a target trigger event is detected, the current version number v1 of the target barrage stored in the centralized version database can be obtained, and then the target version number v2 of the target barrage to be updated can be checked. If v2 is greater than v1, the target database is updated. Specifically, the barrage status in the target database 1 and the current version number of the target barrage recorded in the centralized version database in the target database 1 can be updated. Otherwise, the event is terminated.

[0056] Through the above method, the centralized version management is introduced into the consistency management of multiple databases to ensure the execution order of version modifications of each database. It should be noted that, considering issues such as database performance, each database may not be completely synchronized. It only needs to be updated in accordance with the execution order of version modification when the update is triggered, ensuring that the data update in multiple databases is updated according to linear rules, thereby effectively guaranteeing the final data consistency of multiple databases. Moreover, the above-mentioned centralized version database provided by the embodiment of the present disclosure can efficiently manage the versions of the barrage in each database, and can also establish abnormal data tracking and compensation repair mechanisms, etc. The barrage version control is performed through the centralized version database, which has the ability to clearly trace and record the status of all versions, further improving the efficiency of barrage management.

[0057] In summary, the disclosed embodiment introduces a state machine in a bullet screen system with high concurrency and real-time requirements, which can efficiently and conveniently determine the direction of bullet screen state changes caused by triggering events, greatly avoid abnormal situations in the state flow process, and greatly improve the logical structure of the code. In addition, the state machine can simplify the complexity of existing bullet screen management, make each bullet screen state and its transition clear and easy to understand, and can also quickly respond to various inputs, thereby effectively improving the system processing efficiency. The state machine can change the state according to the preset state change rules, ensure the data accuracy and consistency of each database in the bullet screen state processing, and effectively reduce errors caused by data inconsistency. Further, the disclosed embodiment introduces a centralized version database, which can not only record the version of each bullet screen in each database, and help to accurately track and record the version changes of each state of the bullet screen, but also can ensure the accuracy of the database version modification execution order by comparing the current version with the target version, ensure that the database can accurately and reliably update the state, and further ensure the consistency of the final state of the bullet screen in each database.

[0058] In short, the barrage processing method provided by the embodiment of the present disclosure can effectively ensure the state consistency of the same barrage in multiple databases, can better optimize the barrage system, improve the reliability and efficiency of barrage management, and can effectively avoid problems such as barrage state management errors that affect user experience.

[0059] Corresponding to the aforementioned bullet screen processing method, the embodiment of the present disclosure further provides a bullet screen processing device, Figure 6 This is a schematic diagram of the structure of a bullet screen processing device provided by an embodiment of the present disclosure. The device can be implemented by software and / or hardware and can generally be integrated in an electronic device, such as Figure 6 As shown, the bullet screen processing device includes:

[0060] A state determination module 602 is used to determine the target state of the target barrage based on the target trigger event, the current state of the target barrage, and a preset state change rule through a preset state machine when a target trigger event for changing the state of the target barrage is detected;

[0061] The database update module 604 is used to update the current states of the target barrages stored in multiple target databases based on the target states of the target barrages. The target database is a database storing target barrages, and different target databases correspond to different business scenarios.

[0062] The above-mentioned device provided by the embodiment of the present disclosure can introduce the state machine into the barrage state management. When a target trigger event for changing the current state of the target barrage is detected, the target state of the target barrage will first be determined by a preset state machine based on the target trigger event, the current state of the target barrage and the preset state change rule. The target state determined by the state machine according to the state change rule is more accurate and reliable. Then, the target state based on the target barrage is unified, and the current states of the target barrages stored in multiple target databases are updated respectively, thereby effectively ensuring the consistency of the state of the target barrage in multiple target databases.

[0063] In some implementations, the state change rule at least includes a plurality of preset state change paths and a triggering event corresponding to each of the state change paths.

[0064] In some embodiments, the state change path is used to indicate a change from a first state to a second state; different state change paths correspond to different first states and / or second states; the multiple state change paths include a first type of path and a second type of path; wherein, when a trigger event corresponding to the first type of path is detected, the first state indicated by the first type of path is unconditionally changed to the second state; when a trigger event corresponding to the second type of path is detected, the first state indicated by the second type of path is conditionally changed to the second state; the state change rule also includes a state change condition corresponding to the second type of path.

[0065] In some embodiments, the device further comprises:

[0066] an abnormal event determination module, configured to determine that the target trigger event is an abnormal event when the state change rule does not contain a state change path corresponding to the target trigger event;

[0067] The first event discarding module is used to discard the target triggering event and record relevant information of the target triggering event.

[0068] In some embodiments, the database update module 604 is specifically used to: for each target database among multiple target databases, obtain the current version number of the target barrage in the target database recorded in a preset centralized version database; wherein the centralized version database is a database for recording barrage version numbers; obtain the target version number of the target barrage to be updated; based on the current version number of the target barrage in the target database recorded in the centralized version database and the target version number of the target barrage to be updated, determine whether to perform a database update operation; if so, based on the target state of the target barrage, update the current state of the target barrage stored in the target database; and based on the target version number of the target barrage, update the current version number of the target barrage in the target database recorded in the centralized version database.

[0069] In some implementations, the target version number is represented by the timestamp of the target triggering event; the current version number of the target barrage is represented by the timestamp of the triggering event corresponding to the current state of the target barrage.

[0070] In some embodiments, the database update module 604 is specifically used to: compare the current version number of the target barrage in the target database recorded in the centralized version database and the target version number of the target barrage to be updated; if the target version number is greater than the current version number, determine to execute the database update operation.

[0071] In some implementations, the device further includes a second event discarding module, configured to discard the target triggering event if the target version number is not greater than the current version number.

[0072] The barrage processing device provided in the embodiments of the present disclosure can execute the barrage processing method provided in any embodiment of the present disclosure, and has functional modules and beneficial effects corresponding to the execution method.

[0073] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device embodiment can refer to the corresponding process in the method embodiment, and will not be repeated here.

[0074] An embodiment of the present disclosure provides an electronic device, which includes: a storage device on which a computer program is stored; and a processing device for executing the computer program in the storage device to implement the steps of any method in the present disclosure.

[0075] Reference below Figure 7, which shows a schematic diagram of the structure of an electronic device 700 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0076] like Figure 7 As shown, the electronic device 700 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0077] Typically, the following devices may be connected to the I / O interface 705: an input device 706 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709. The communication device 709 may allow the electronic device 700 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 7 The electronic device 700 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0078] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 709, or installed from a storage device 708, or installed from a ROM 702. When the computer program is executed by the processing device 701, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0079] In addition to the above-mentioned methods and devices, the embodiments of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, cause the processor to perform the image processing method provided by the embodiments of the present disclosure. The computer program product may be written in any combination of one or more programming languages ​​to write program codes for performing the operations of the embodiments of the present disclosure, the programming languages ​​including object-oriented programming languages ​​such as Java, C++, etc., and also conventional procedural programming languages ​​such as "C" language or similar programming languages. The program code may be executed entirely on a user computing device, partially on a user device, as an independent software package, partially on a user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0080] In addition, the embodiments of the present disclosure may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the barrage processing method provided by the embodiments of the present disclosure.

[0081] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0082] The embodiments of the present disclosure also provide a computer program product, including a computer program / instruction, which implements the barrage processing method in the embodiments of the present disclosure when executed by a processor.

[0083] It is understandable that before using the technical solutions disclosed in the various embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0084] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0085] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0086] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0087] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0088] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for processing barrage, characterized in that: include: In the case of detecting a target triggering event for changing the current state of a target barrage, determining the target state of the target barrage based on the target triggering event, the current state of the target barrage and a preset state change rule by a preset state machine; Based on the target state of the target barrage, the current states of the target barrage stored in multiple target databases are updated respectively; wherein the target database is a database storing the target barrage, and different target databases have different uses.

2. The method according to claim 1, characterized in that The state change rule at least includes a plurality of preset state change paths and a trigger event corresponding to each of the state change paths.

3. The method according to claim 2, characterized in that The state change path is used to indicate a change from a first state to a second state; different state change paths correspond to different first states and / or second states; The multiple state change paths include a first type of path and a second type of path; wherein, when a trigger event corresponding to the first type of path is detected, the first state indicated by the first type of path is unconditionally changed to the second state; when a trigger event corresponding to the second type of path is detected, the first state indicated by the second type of path is conditionally changed to the second state; The state change rule further includes a state change condition corresponding to the second type of path.

4. The method according to claim 2, characterized in that: The method further comprises: In a case where the state change rule does not include a state change path corresponding to the target trigger event, determining that the target trigger event is an abnormal event; The target triggering event is discarded, and relevant information of the target triggering event is recorded.

5. The method according to claim 1, characterized in that The updating of the current states of the target bullet screens stored in the plurality of target databases based on the target state of the target bullet screens respectively includes: For each target database among the multiple target databases, obtain the current version number of the target barrage in the target database recorded in a preset centralized version database; wherein the centralized version database is a database for recording the barrage version number; Obtain the target version number of the target bullet comment to be updated; Based on the current version number of the target bullet comment in the target database recorded in the centralized version database and the target version number of the target bullet comment to be updated, determining whether to perform a database update operation; If so, based on the target state of the target barrage, the current state of the target barrage stored in the target database is updated; and based on the target version number of the target barrage, the current version number of the target barrage in the target database recorded in the centralized version database is updated.

6. The method according to claim 5, characterized in that The target version number is represented by the timestamp of the target triggering event; the current version number of the target barrage is represented by the timestamp of the triggering event corresponding to the current state of the target barrage.

7. The method according to claim 6, characterized in that The determining whether to perform a database update operation based on the current version number of the target bullet comment in the target database recorded in the centralized version database and the target version number of the target bullet comment to be updated includes: Compare the current version number of the target bullet comment in the target database recorded in the centralized version database with the target version number of the target bullet comment to be updated; If the target version number is greater than the current version number, it is determined to perform a database update operation.

8. The method according to claim 7, characterized in that The method further comprises: If the target version number is not greater than the current version number, the target trigger event is discarded.

9. A bullet comment processing device, characterized in that: include: A state determination module, for determining the target state of the target barrage based on the target trigger event, the current state of the target barrage, and a preset state change rule through a preset state machine when a target trigger event for changing the state of the target barrage is detected; A database update module is used to update the current states of target barrages stored in multiple target databases based on the target state of the target barrage; wherein the target database is a database storing the target barrage, and different target databases correspond to different business scenarios.

10. An electronic device, characterized in that: The electronic device comprises: a storage device having a computer program stored thereon; A processing device, used to execute the computer program in the storage device to implement the steps of the barrage processing method described in any one of claims 1-8.

11. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program is used to execute the barrage processing method described in any one of claims 1 to 8.

12. A computer program product, characterized in that It includes a computer program, which, when executed by a processor, implements the barrage processing method described in any one of claims 1 to 8.