Prior art can strengthen the enthusiasm of player interaction in network game to a certain extent, expand the interactivity of watching in network game well, but in concrete enforcement, inventor finds that the interaction design of barrage in current online game has some limitations, barrage interaction technique in existing network game is only limited to the mutual of player and player, and mutual range is limited.The speech of player in barrage system can only obtain the feedback of other players, and other elements in game, as NPC (Non-PlayerCharacter, non-player control role), but to the speech of the barrage of player without any response, NPC's is intelligent very low.
The object of the invention is to, a kind of barrage information processing method, device and system are provided, realize the Intelligence Feedback of non-player control role to barrage information, expand the interactive region of barrage information.
The invention provides the first barrage information processing method to achieve these goals, comprising:
Obtain the barrage information be summarized in game server;
Described barrage information is mated with the keyword preset in dictionary, whether comprises arbitrary keyword in described dictionary to detect described barrage information;
When arbitrary keyword that described barrage packets of information contains in described dictionary being detected, carry out semantic analysis to described barrage information, the result according to semantic analysis searches the highest rule of response of matching degree from rule base; Wherein, described rule of response for limit non-player control role in game described barrage information responded needed for flow chart of data processing;
Flow chart of data processing according to limiting in the rule of response that described matching degree is the highest processes described barrage information, obtains the response results of described non-player control role to described barrage information;
Described response results is sent to described game server, and triggers described game server and described response results is broadcast to all game clients shows.
Preferably, described when arbitrary keyword that described barrage packets of information contains in described dictionary being detected, carry out semantic analysis to described barrage information, the result according to semantic analysis searches the highest rule of response of matching degree from rule base, is specially:
When arbitrary keyword that described barrage packets of information contains in described dictionary being detected, word segmentation processing being carried out to described barrage information, obtaining word segmentation result;
Described word segmentation result is mated with the keyword in described dictionary, to obtain all keywords mated with described word segmentation result;
Signature analysis is carried out to the described keyword mated with described word segmentation result, obtains the characteristic value of described keyword;
The rule of response the highest with described characteristic value matching degree is searched from described rule base.
Preferably, described signature analysis is sentiment analysis, and described characteristic value is Sentiment orientation value.
Preferably, be summarized in the barrage information in game server in described acquisition before, also comprised:
Set up described dictionary and described rule base, and by machine learning algorithm, the rule of response in described rule base is trained.
Preferably, described keyword comprises the title of described non-player control role;
Described rule of response comprises makes response with the name of described non-player control role, and described response comprises at least one in speech, expression and action.
Present invention also offers the second barrage information processing method, comprising:
Receive the barrage information that game client sends, and described barrage information is gathered;
Described barrage information after gathering is sent to central server, triggers described central server and by the first barrage information processing method as previously described, described barrage information is processed;
Receive the response results that described central server returns, and described response results is broadcast to all game clients shows.
Correspondingly, the invention provides the first barrage information processor, comprise
Receiver module, for obtaining the barrage information be summarized in game server;
Whether Keywords matching module, for described barrage information being mated with the keyword preset in dictionary, comprise arbitrary keyword in described dictionary to detect described barrage information;
Semantic module, for when arbitrary keyword that described barrage packets of information contains in described dictionary being detected, carry out semantic analysis to described barrage information, the result according to semantic analysis searches the highest rule of response of matching degree from rule base; Wherein, described rule of response for limit non-player control role in game described barrage information responded needed for flow chart of data processing;
Result acquisition module, for processing described barrage information according to the flow chart of data processing limited in the highest rule of response of described matching degree, obtains the response results of described non-player control role to described barrage information;
Result sending module, for described response results is sent to described game server, and triggers described game server and described response results is broadcast to all game clients shows.
Preferably, described semantic module comprises:
Participle unit, for when arbitrary keyword that described barrage packets of information contains in described dictionary being detected, carries out word segmentation processing to described barrage information, obtains word segmentation result;
Matching unit, for described word segmentation result being mated with the keyword in described dictionary, to obtain all keywords mated with described word segmentation result;
Analytic unit, for carrying out signature analysis to the described keyword mated with described word segmentation result, obtains the characteristic value of described keyword;
Search unit, for searching the rule of response the highest with described characteristic value matching degree from described rule base.
Preferably, described signature analysis is sentiment analysis, and described characteristic value is Sentiment orientation value.
Preferably, described device also comprises:
Building library module, for setting up described dictionary and described rule base, and by machine learning algorithm, the rule of response in described rule base being trained.
Preferably, described keyword comprises the title of described non-player control role;
Described rule of response comprises makes response with the name of described non-player control role, and described response comprises at least one in speech, expression and action.
Correspondingly, the invention provides the second barrage information processor, comprising:
Barrage receiver module, for receiving the barrage information that game client sends, and gathers described barrage information;
Gather sending module, for the described barrage information after gathering is sent to central server, triggers described central server and by the first barrage information processing method as previously described, described barrage information is processed;
Result broadcast module, for receiving the response results that described central server returns, and is broadcast to all game clients by described response results and shows.
In addition, present invention also offers a kind of barrage information processing system, comprise game client, game server and central server;
Described game client, for described game server barrage information;
Described game server is provided with previously described the second barrage information processor;
Described central server is provided with the first barrage information processor previously described.
Compared with prior art, the present invention has the following advantages:
The present invention is gathered by game server the barrage information that client sends and is sent to central server, described central server is according to the keyword preset in dictionary, Keywords matching is carried out to described barrage information, during arbitrary Keywords matching in described barrage information and described dictionary, semantic analysis is carried out to described barrage information, result according to semantic analysis searches the highest rule of response of matching degree from rule base, call the highest rule of response of described matching degree to process described barrage information, obtain non-player control role to the response results of described barrage information, and described response results is sent to described game server, by described game server, described response results is broadcast to all game clients to show.The present invention breaches the limitation of the interactive region that barrage is mutual in existing network game, semantic analysis is carried out by the barrage information inputted player, infer that player is intended to and calls the highest rule of response of matching degree process barrage information, can according to the semanteme of barrage information, Intelligence Feedback is carried out to barrage information, realize the automatic interaction of non-player control role and player, expand the scope that barrage is mutual.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
See Fig. 1, it is the flow chart of an embodiment of barrage information processing method provided by the invention.
As shown in Figure 1, described barrage information processing method comprises step S11 ~ S15:
S11, obtains the barrage information be summarized in game server.
Described barrage information is the speech that player shows with barrage form at the needs that game client sends.
S12, mates described barrage information with the keyword preset in dictionary, whether comprises arbitrary keyword in described dictionary to detect described barrage information.
In the middle of concrete enforcement, can according to the keyword preset in described dictionary, keyword string matching is carried out to described barrage information, keyword in described dictionary whether is comprised to detect described barrage information, when arbitrary keyword that described barrage packets of information contains in described dictionary being detected, giving other module by described barrage information and carrying out subsequent treatment.Described dictionary comprises stammerer participle and gives tacit consent to the dictionary, search dog dictionary and the self-defined dictionary etc. of playing that carry, and the keyword in the self-defined dictionary of wherein said game is by manually pre-setting.
Game server receives the barrage information that player is sent by game client, described information is gathered and forms barrage message queue, described barrage information is sent to central server successively, central server carries out Keywords matching to each barrage information after receiving barrage information respectively, when described barrage information is not mated with any keyword in described dictionary, described barrage information is directly broadcast to all game clients and shows.When arbitrary Keywords matching in described barrage information and described dictionary, then by following step S13 ~ S15, described barrage information is for further processing.
S13, when arbitrary keyword that described barrage packets of information contains in described dictionary being detected, carry out semantic analysis to described barrage information, the result according to semantic analysis searches the highest rule of response of matching degree from rule base.Wherein, described rule of response for limit non-player control role in game described barrage information responded needed for flow chart of data processing.
As shown in Figure 2, in the middle of concrete enforcement, described step S13 realizes by step S131 ~ S134.
S131, when arbitrary keyword that described barrage packets of information contains in described dictionary being detected, carries out word segmentation processing to described barrage information, obtains word segmentation result.
S132, mates described word segmentation result with the keyword in described dictionary, to obtain all keywords mated with described word segmentation result.
The stammerer participle assembly of increasing income can be adopted to carry out word segmentation processing to described barrage information in the middle of concrete enforcement, described barrage information is divided into multiple words, form participle list.Each words after dividing is mated respectively with the keyword in dictionary, obtains all keywords mated.
S133, carries out signature analysis to the described keyword mated with described word segmentation result, obtains the characteristic value of described keyword.
In the middle of one is preferably implemented, described signature analysis is sentiment analysis, and described characteristic value is Sentiment orientation value.The keyword of the coupling obtained in abovementioned steps is analyzed one by one, main analysis content is under this keyword, the semanteme of barrage information how, such as player's speech " the mad cruel Chi of Liu Huahu is outstanding ", two keywords have been preset: especially, so for keyword stream flower lake, the words is positive for stream flower lake and Chi in dictionary, and outstanding for keyword Chi, the words is but passive.
S134, searches the rule of response the highest with described characteristic value matching degree from described rule base.
In the middle of concrete enforcement, can the described characteristic value obtained in step S133 be input in the grader set up in advance, to obtain the highest rule of response of matching degree.Usually, before semantic analysis is carried out to described barrage information, need to set up described dictionary and described rule base in advance, and by machine learning algorithm, the rule of response in described rule base is trained.The foundation in dictionary Sum fanction storehouse needs manual intervention at first, and depend on the manual typing of programmer, the algorithm then by some machine learning is trained perfect, and carries out the excavation of the degree of depth.Described machine learning algorithm can be the NLTK (naturallanguagetoolkit such as naive Bayesian (NaiveBayes) and decision tree (DecisionTree), natural language processing kit) machine learning algorithm that carries, the scikit-learn interface of NLTK can also be used to carry out data training, the barrage constantly collected speech is input in training data, the sorting algorithm of continuous adjustment and discovery the best and characteristic dimension, generate the grader based on training data.
Semantic analysis described in the present embodiment is mainly transformed based on the SnowNlp class libraries of increasing income and NLTK, by natural language processing and text mining, the text of continuous collection player barrage speech, then respective content characteristic is extracted (as sentence number, word number, Sentiment orientation etc.), and barrage speech is marked, the feature extracted is substituted in machine learning algorithm, build grader, finally with optimum grader, the barrage speech newly received is classified, from described rule base, the highest rule of response of matching degree is searched according to classification results.
S14, the flow chart of data processing according to limiting in the rule of response that described matching degree is the highest processes described barrage information, obtains the response results of described non-player control role (Non-PlayerCharacter, NPC) to described barrage information.
One preferred embodiment in the middle of, described keyword comprises the title of non-player control role.Described rule of response comprises makes response with the name of described non-player control role, and described response comprises at least one in speech, expression and action.It will be appreciated by those skilled in the art that above-mentioned embodiment be only one of the present invention preferred embodiment; the particular content of described keyword and described rule of response can be arranged according to actual needs; all protection scope of the present invention is belonged to when not departing from general principle of the present invention; such as; described keyword can further include name map, server name and game term etc. in game, and described rule of response can also comprise carries out intelligent barrage speech etc. by speech robot.
S15, is sent to described game server by described response results, and triggers described game server and described response results is broadcast to all game clients shows.
For the speech of concrete player's barrage, the invention will be further described below.
Player one sends barrage speech, and " Chi is especially very handsome when watching game fight! ", wherein " Chi is outstanding " title that is certain NPC.Game server is transmitted to central server after receiving the barrage speech that player delivers, after central server detects that the speech of described barrage is mated with the keyword " Chi is outstanding " preset in dictionary, further semantic analysis is done to described barrage speech, according to the result of semantic analysis, the highest rule of response of matching degree is obtained from rule base, other little strange NPC in the outstanding and outstanding camp of Chi of last Chi, according to a series of responses that rule is made, described response can be: " player one to send barrage content with the name that Chi is outstanding, I can always general go down ", other little strange NPC make a speech " greatly in fight, player one says that you are good handsome " " oh unexpectedly also have bean vermicelli " etc., the particular content of speech realizes by automatic-answering back device rule.
In online game, employing the invention provides technology and not only can promote the experience of watching, but also expands the mutual scope of barrage in game.In game is watched, except player and player mutual except, the NPC etc. in player and game also can carry out corresponding mutual, as long as the barrage speech of player matches with the keywords database in game, just has and feeds back to player accordingly.Such as, what the barrage of player made a speech that a certain NPC matched in game, then relevant NPC will make the contents such as expression, language, action according to different speeches replies to player.
Described game server can have one or more, each game server gathers the barrage information that connected game client sends and sends to central server respectively, the barrage information processing method that central server is provided by the present embodiment processes the barrage information after gathering, obtain response results, and send to all game servers by the response results of described barrage information, described response results is broadcast to all game clients under described game server by described game server, can realize NPC and player across taking automatic interaction.
See Fig. 3, it is the flow chart of another embodiment of barrage information processing method provided by the invention.
Barrage information processing method comprises step S31 ~ S33 as shown in Figure 3.
S31, receives the barrage information that game client sends, and gathers described barrage information.
S32, is sent to central server by the described barrage information after gathering, and triggers described central server and is processed described barrage information by the barrage information processing method that embodiment provides as shown in Figure 1.
S33, receives the response results that described central server returns, and described response results is broadcast to all game clients shows.
The general principle of the present embodiment is consistent with embodiment illustrated in fig. 1, and part is not described in detail in detail in the present embodiment can associated description in embodiment shown in Figure 1.
It is the structure chart of an embodiment of barrage information processor provided by the invention see Fig. 4.The general principle of the present embodiment is consistent with embodiment illustrated in fig. 1, and part is not described in detail in detail in the present embodiment can associated description in embodiment shown in Figure 1.
As shown in Figure 4, described barrage information processor comprises:
Receiver module 41, for obtaining the barrage information be summarized in game server.
Whether Keywords matching module 42, for described barrage information being mated with the keyword preset in dictionary, comprise arbitrary keyword in described dictionary to detect described barrage information.
Semantic module 43, for when arbitrary keyword that described barrage packets of information contains in described dictionary being detected, carry out semantic analysis to described barrage information, the result according to semantic analysis searches the highest rule of response of matching degree from rule base.Wherein, described rule of response for limit non-player control role in game described barrage information responded needed for flow chart of data processing.
Result acquisition module 44, for processing described barrage information according to the flow chart of data processing limited in the highest rule of response of described matching degree, obtains the response results of described non-player control role to described barrage information.
Result sending module 45, for described response results is sent to described game server, and triggers and described to described game server, described response results be broadcast to all game clients and show.
In the middle of concrete enforcement, semantic module 43 comprises:
Participle unit 431, for when arbitrary keyword that described barrage packets of information contains in described dictionary being detected, carries out word segmentation processing to described barrage information, obtains word segmentation result.
Matching unit 432, for described word segmentation result being mated with the keyword in described dictionary, to obtain all keywords mated with described word segmentation result.
Analytic unit 433, for carrying out signature analysis to the described keyword mated with described word segmentation result, obtains the characteristic value of described keyword.
Search unit 434, for searching the rule of response the highest with described characteristic value matching degree from described rule base.
One preferred embodiment in the middle of, described signature analysis is sentiment analysis, and described characteristic value is Sentiment orientation value.
Though do not draw in Fig. 4, described barrage information processor can further include:
Building library module, for setting up described dictionary and described rule base, and by machine learning algorithm, the rule of response in described rule base being trained.
One preferred embodiment in the middle of, described keyword comprises the title of non-player control role.Described rule of response comprises makes response with the name of described non-player control role, and described response comprises at least one in speech, expression and action.
See Fig. 5, it is the structure chart of another embodiment of the barrage information processor that the present embodiment provides.The general principle of the present embodiment is consistent with embodiment illustrated in fig. 3, and part is not described in detail in detail in the present embodiment can associated description in embodiment shown in Figure 3.
As shown in Figure 5, described barrage information processor, is characterized in that, comprising:
Barrage receiver module 51, for receiving the barrage information that game client sends, and gathers described barrage information.
Gather sending module 52, for the described barrage information after gathering is sent to central server, triggers described central server and by the barrage information processing method that embodiment provides as shown in Figure 1, described barrage information is processed.
Result broadcast module 53, for receiving the response results that described central server returns, and is broadcast to all game clients by described response results and shows.
The general principle of this enforcement is consistent with general principle embodiment illustrated in fig. 3, and part is not described in detail in detail in the present embodiment can associated description in embodiment shown in Figure 3.
See Fig. 6, it is the structure chart of an embodiment of barrage information processing system provided by the invention.
As shown in Figure 6, described barrage information processing system, comprises game client 61, game server 62 and central server 63.
Described game client 61, for sending barrage information to described game server 62.
Described game server 62 is provided with the barrage information processor that embodiment as shown in Figure 5 provides.
Described central server 63 is provided with the barrage information processor that embodiment as shown in Figure 4 provides.
The general principle of the present embodiment is consistent with previous embodiment, and part is not described in detail in detail in the present embodiment can see the associated description in previous embodiment.
In sum, the present invention is gathered by game server the barrage information that client sends and is sent to central server, described central server is according to the keyword preset in dictionary, Keywords matching is carried out to described barrage information, during arbitrary Keywords matching in described barrage information and described dictionary, semantic analysis is carried out to described barrage information, result according to semantic analysis searches the highest rule of response of matching degree from rule base, call the highest rule of response of described matching degree to process described barrage information, obtain non-player control role to the response results of described barrage information, and described response results is sent to described game server, by described game server, described response results is broadcast to all game clients to show.The present invention breaches the limitation of the interactive region that barrage is mutual in existing network game, semantic analysis is carried out by the barrage information inputted player, infer that player is intended to and calls the highest rule of response of matching degree process barrage information, can according to the semanteme of barrage information, Intelligence Feedback is carried out to barrage information, realize the automatic interaction of non-player control role and player, expand the scope that barrage is mutual, be conducive to the Experience Degree and the participation that strengthen player.
It should be noted that, device embodiment described above is only schematic, the wherein said unit module illustrated as separating component or can may not be and physically separates, parts as unit display can be or may not be physical location, namely can be positioned at a place, or also can be distributed on multiple NE.Some or all of module wherein can be selected according to the actual needs to realize the object of the present embodiment scheme.In addition, in device embodiment accompanying drawing provided by the invention, the annexation between module represents to have communication connection between them, specifically can be implemented as one or more communication bus or holding wire.Those of ordinary skill in the art, when not paying creative work, are namely appreciated that and implement.
Through the above description of the embodiments, those skilled in the art can be well understood to the mode that the present invention can add required common hardware by software and realize, and can certainly comprise special IC, dedicated cpu, private memory, special components and parts etc. realize by specialized hardware.Generally, all functions completed by computer program can realize with corresponding hardware easily, and the particular hardware structure being used for realizing same function also can be diversified, such as analog circuit, digital circuit or special circuit etc.But under more susceptible for the purpose of the present invention condition, software program realizes is better embodiment.Based on such understanding, technical scheme of the present invention can embody with the form of software product the part that prior art contributes in essence in other words, this computer software product is stored in the storage medium that can read, as the floppy disk of computer, USB flash disk, portable hard drive, read-only storage (ROM, Read-OnlyMemory), random access memory (RAM, RandomAccessMemory), magnetic disc or CD etc., comprising some instructions in order to make a computer equipment (can be personal computer, server, or the network equipment etc.) perform method described in the present invention each embodiment.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; change can be expected easily or replace, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of described claim.