The enthusiasm of player interaction in network game can be enhanced in the prior art to a certain extent, has expanded in network game see wellThe interactivity of war, but in specific implementation, inventor has found the interaction design of barrage in current online game, and there are certain officesSex-limited, the barrage interaction technique in existing network game is only limited to the interaction of player and player, and interactive range is limited.Player existsSpeech in barrage system can only obtain the feedback of other players, and the other elements in game, such as NPC (Non-PlayerCharacter, non-player's control role), the intelligence of not any response of but making a speech the barrage of player, NPC is very low.
The object of the present invention is to provide a kind of barrage information processing methods, device and system, realize non-player's pilot angleColor expands the interactive region of barrage information to the Intelligence Feedback of barrage information.
The present invention provides the first barrage information processing methods to achieve the goals above, comprising:
Obtain the barrage information being summarized in game server;
The barrage information is matched with keyword preset in dictionary, whether to detect the barrage informationInclude any keyword in the dictionary;
When detecting that the barrage information includes any keyword in the dictionary, language is carried out to the barrage informationJustice analysis, the highest rule of response of matching degree is searched according to the result of semantic analysis from rule base;Wherein, the rule of responseThe barrage information is carried out responding required flow chart of data processing for limiting non-player's control role in game;
According to the flow chart of data processing limited in the highest rule of response of the matching degree to the barrage information atReason, obtains non-player's control role to the response results of the barrage information;
The response results are sent to the game server, and trigger the game server for the response resultsBroadcast to all game clients are shown.
Preferably, described when detecting that the barrage information includes any keyword in the dictionary, to the bulletCurtain information carries out semantic analysis, searches the highest rule of response of matching degree from rule base according to the result of semantic analysis, specificallyAre as follows:
When detecting that the barrage information includes any keyword in the dictionary, the barrage information is dividedWord processing, obtains word segmentation result;
The word segmentation result is matched with the keyword in the dictionary, it is matched with the word segmentation result to obtainAll keywords;
Signature analysis is carried out to the matched keyword of the word segmentation result, obtains the characteristic value of the keyword;
It is searched and the highest rule of response of characteristic value matching degree from the rule base.
Preferably, the signature analysis is sentiment analysis, and the characteristic value is Sentiment orientation value.
Preferably, before the barrage information for obtaining and being summarized in game server, further includes:
Establish the dictionary and the rule base, and by machine learning algorithm to the rule of response in the rule base intoRow training.
Preferably, the keyword includes the title of non-player's control role;
The rule of response includes being responded with the name of non-player's control role, it is described response include language,At least one of expression and movement.
The present invention also provides second of barrage information processing methods, comprising:
The barrage information that game client is sent is received, and the barrage information is summarized;
The barrage information after summarizing is sent to central server, triggers the central server and passes through such as institute aboveThe first the barrage information processing method stated handles the barrage information;
The response results that the central server returns are received, and the response results are broadcasted to all game clientsIt is shown.
Correspondingly, the present invention provides the first barrage information processing units, including
Receiving module, for obtaining the barrage information being summarized in game server;
Keywords matching module, for the barrage information to be matched with keyword preset in dictionary, withDetect whether the barrage information includes any keyword in the dictionary;
Semantic module, for detect the barrage information include the dictionary in any keyword when, it is rightThe barrage information carries out semantic analysis, searches the highest response rule of matching degree from rule base according to the result of semantic analysisThen;Wherein, needed for non-player's control role that the rule of response is used to limit in game responds the barrage informationFlow chart of data processing;
As a result obtain module, for according to the flow chart of data processing limited in the highest rule of response of the matching degree to instituteIt states barrage information to be handled, obtains non-player's control role to the response results of the barrage information;
As a result sending module for the response results to be sent to the game server, and triggers the game garmentBusiness device, which broadcasts the response results to all game clients, to be shown.
Preferably, the semantic module includes:
Participle unit, for detect the barrage information include the dictionary in any keyword when, to describedBarrage information carries out word segmentation processing, obtains word segmentation result;
Matching unit, for the word segmentation result to be matched with the keyword in the dictionary, with obtain with it is describedThe matched all keywords of word segmentation result;
Analytical unit obtains the pass for carrying out signature analysis to the matched keyword of the word segmentation resultThe characteristic value of keyword;
Searching unit, for being searched and the highest rule of response of characteristic value matching degree from the rule base.
Preferably, the signature analysis is sentiment analysis, and the characteristic value is Sentiment orientation value.
Preferably, described device further include:
Library module is built, for establishing the dictionary and the rule base, and by machine learning algorithm to the rule baseIn rule of response be trained.
Preferably, the keyword includes the title of non-player's control role;
The rule of response includes being responded with the name of non-player's control role, it is described response include language,At least one of expression and movement.
Correspondingly, the present invention provides second of barrage information processing units, comprising:
Barrage receiving module, the barrage information sent for receiving game client, and the barrage information is carried outSummarize;
Summarize sending module, is sent to central server for the barrage information after summarizing, triggers the centerServer is handled the barrage information by the first barrage information processing method as previously described;
As a result broadcast module, the response results returned for receiving the central server, and the response results are wideAll game clients are cast to be shown.
In addition, the present invention also provides a kind of barrage information processing system, including game client, game server and inCentral server;
The game client is used for the game server barrage information;
Previously described second of barrage information processing unit is provided on the game server;
The first previously described barrage information processing unit is provided on the central server.
Compared with prior art, the invention has the following advantages that
The present invention summarizes and is sent to central server to the barrage information that client is sent by game server,The central server carries out Keywords matching according to keyword preset in dictionary, to the barrage information, describedWhen any Keywords matching in barrage information and the dictionary, semantic analysis is carried out to the barrage information, according to semanteme pointThe result of analysis searches the highest rule of response of matching degree from rule base, calls the highest rule of response of the matching degree to describedBarrage information is handled, and obtains non-player's control role to the response results of the barrage information, and by the response resultsIt is sent to the game server, the response results are broadcasted to all game clients by the game server and are carried outIt shows.The present invention breaches the limitation of the interactive region of barrage interaction in existing network game, passes through the bullet inputted to playerCurtain information carries out semantic analysis, thus it is speculated that and player is intended to and the highest rule of response of matching degree is called to handle barrage information,Intelligence Feedback can be carried out to barrage information, realize the automatic friendship of non-player's control role and player according to the semanteme of barrage informationMutually, expand the range of barrage interaction.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, completeSite preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based onEmbodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every otherEmbodiment shall fall within the protection scope of the present invention.
It is the flow chart of one embodiment of barrage information processing method provided by the invention referring to Fig. 1.
As shown in Figure 1, the barrage information processing method includes step S11~S15:
S11 obtains the barrage information being summarized in game server.
The barrage information is the speech that player is shown in the form of barrage in the needs that game client is sent.
S12 matches the barrage information, with keyword preset in dictionary to detect the barrage informationWhether any keyword in the dictionary is included.
In specific implementation, the barrage information can be closed according to keyword preset in the dictionaryKeyword string matching, to detect whether the barrage information includes keyword in the dictionary, when detecting the barrageWhen information includes any keyword in the dictionary, i.e., gives the barrage information to other module and carry out subsequent processing.The dictionary includes included dictionary, search dog dictionary and the customized dictionary of game etc. of stammerer participle default, wherein the game is certainlyThe keyword defined in dictionary can be by manually presetting.
Game server receives the barrage information that player is sent by game client, is aggregated to form to the informationThe barrage information is successively sent to central server by barrage message queue, and central server divides after receiving barrage informationIt is other that Keywords matching is carried out to each barrage information, when any keyword in the barrage information and the dictionary notThe barrage information is broadcast directly to all game clients and is shown by timing.When the barrage information and the dictionaryIn any Keywords matching when, then be for further processing by following step S13~S15 to the barrage information.
S13, detect the barrage information include the dictionary in any keyword when, to the barrage information intoThe highest rule of response of matching degree is searched in row semantic analysis according to the result of semantic analysis from rule base.Wherein, the responseNon-player control role of the rule for limiting in game carries out responding required flow chart of data processing to the barrage information.
As shown in Fig. 2, the step S13 can be realized by step S131~S134 in specific implementation.
S131, when detecting that the barrage information includes any keyword in the dictionary, to the barrage informationWord segmentation processing is carried out, word segmentation result is obtained.
S132 matches the word segmentation result with the keyword in the dictionary, to obtain and the word segmentation resultMatched all keywords.
Word segmentation processing can be carried out to the barrage information using the stammerer participle component of open source in specific implementation, it willThe barrage information is divided into multiple words, forms participle list.To the keyword in each words and dictionary after divisionIt is matched respectively, obtains matched all keywords.
S133 carries out signature analysis to the matched keyword of the word segmentation result, obtains the spy of the keywordValue indicative.
In a kind of preferred implementation, the signature analysis is sentiment analysis, and the characteristic value is Sentiment orientation value.It is rightThe matched keyword obtained in abovementioned steps is analyzed one by one, and main analysis content is the barrage letter under this keywordHow is the semanteme of breath, for example player makes a speech " the mad cruel Chi of Liu Huahu is outstanding ", and two keywords have been preset in dictionary: flowing flower lake and ChiEspecially, then for keyword stream flower lake, the words be it is positive, and outstanding for keyword Chi, the words is passive.
S134 is searched and the highest rule of response of characteristic value matching degree from the rule base.
In specific implementation, the characteristic value obtained in step S133 can be input to the classifier pre-establishedIn, to obtain the highest rule of response of matching degree.Generally, it before carrying out semantic analysis to the barrage information, needs pre-The dictionary and the rule base are first established, and the rule of response in the rule base is instructed by machine learning algorithmPractice.The foundation of dictionary and rule base is initially required manual intervention, programmer's craft typing is depended on, then by some engineeringsThe algorithm of habit is perfect to train, and carries out the excavation of depth.The machine learning algorithm can be naive Bayesian(NaiveBayes) and the NLTK such as decision tree (DecisionTree) (natural language toolkit, at natural languageManage kit) included machine learning algorithm, data training, general can also be carried out using the scikit-learn interface of NLTKThe barrage speech constantly collected is input in training data, constantly adjusts and find optimal sorting algorithm and characteristic dimension,Generate the classifier based on training data.
Semantic analysis described in the present embodiment is based primarily upon the SnowNlp class libraries of open source and NLTK is transformed, and passes throughNatural language processing and text mining constantly collect the text of player's barrage speech, then extract respective content characteristic (such asSentence number, word number, Sentiment orientation etc.), and barrage speech is labeled, the feature extracted is substituted into machine learning and is calculatedIn method, construct classifier, finally with optimal classifier to newly receive barrage speech classify, according to classification results fromThe highest rule of response of matching degree is searched in the rule base.
S14, according to the flow chart of data processing limited in the highest rule of response of the matching degree to the barrage information intoRow processing, obtains non-player's control role (Non-Player Character, NPC) to the response knot of the barrage informationFruit.
In a kind of preferred embodiment, the keyword includes the title of non-player's control role.The responseRule includes being responded with the name of non-player's control role, it is described response include language, expression and movement in extremelyFew one kind.It will be appreciated by those skilled in the art that above embodiment is only a kind of preferred embodiment of the invention, instituteThe particular content for stating keyword and the rule of response can be configured according to actual needs, not depart from original substantially of the inventionIt is all belonged to the scope of protection of the present invention in the case where reason, for example, the keyword can further include the map in gameTitle, server name and game term etc., the rule of response can also include carrying out intelligent barrage by speech robotSpeech etc..
The response results are sent to the game server by S15, and trigger the game server for the responseAs a result it broadcasts to all game clients and is shown.
The invention will be further described by taking the speech of specific player's barrage as an example below.
Player one sends barrage speech when watching game fight, and " Chi is especially very handsome!", wherein " Chi is outstanding " is the name of certain NPCClaim.Game server is transmitted to central server after receiving the barrage speech that player delivers, and central server detects describedAfter barrage speech is matched with keyword " Chi is outstanding " preset in dictionary, further semantic analysis, root are made to barrage speechAccording to semantic analysis as a result, obtaining the highest rule of response of matching degree from rule base, last Chi is outstanding and the outstanding camp Chi itsHe small strange NPC, and according to a series of responses for making of rule, the response can be with are as follows: with the outstanding name of Chi send barrage content "Player one, I can always general go down ", other small strange NPC in fight speech " eldest child, player one say your good general " " oh unexpectedlyThere are also beans vermicelli " etc., the particular content of speech can be realized by automatic-answering back device rule.
The experience watched can not only be promoted using offer technology of the present invention in online game, but also expand gameThe range of middle barrage interaction.NPC etc. in game is watched, other than the interaction of player and player, in player and gameIt can be interacted, as long as the barrage speech of player matches with the keywords database in game, be had corresponding anti-accordinglyFeedforward information is to player.The a certain NPC being matched in game for example, the barrage of player is made a speech, then relevant NPC will be according to differenceSpeech make the contents such as expression, language, movement reply to player.
The game server can have one or more, and each game server is respectively to game client connected to itThe barrage information that end is sent is summarized and is sent to central server, the barrage letter that central server provides through this embodimentBreath processing method handles the barrage information after summarizing, and obtains response results, and by the response knot to the barrage informationFruit is sent to all game servers, and the response results are broadcasted the institute to the game server by the game serverHave game client, it can be achieved that NPC and player across taking automatic interaction.
It is the flow chart of another embodiment of barrage information processing method provided by the invention referring to Fig. 3.
Barrage information processing method as shown in Figure 3 includes step S31~S33.
S31 receives the barrage information that game client is sent, and summarizes to the barrage information.
S32, the barrage information after summarizing are sent to central server, trigger the central server and pass through as schemedThe barrage information processing method that 1 illustrated embodiment provides handles the barrage information.
S33 receives the response results that the central server returns, and the response results is broadcasted to all game visitorsFamily end is shown.
The basic principle of the present embodiment is consistent with embodiment illustrated in fig. 1, and place is not described in detail in the present embodiment can be found in Fig. 1 instituteShow the associated description in embodiment.
It is the structure chart of one embodiment of barrage information processing unit provided by the invention referring to fig. 4.The present embodimentBasic principle is consistent with embodiment illustrated in fig. 1, and the correlation that place is not described in detail in the present embodiment can be found in embodiment illustrated in fig. 1 is retouchedIt states.
As shown in figure 4, the barrage information processing unit includes:
Receiving module 41, for obtaining the barrage information being summarized in game server.
Keywords matching module 42, for the barrage information to be matched with keyword preset in dictionary,To detect whether the barrage information includes any keyword in the dictionary.
Semantic module 43, for detect the barrage information include the dictionary in any keyword when,Semantic analysis is carried out to the barrage information, searches the highest response rule of matching degree from rule base according to the result of semantic analysisThen.Wherein, needed for non-player's control role that the rule of response is used to limit in game responds the barrage informationFlow chart of data processing.
As a result module 44 is obtained, for according to the flow chart of data processing pair limited in the highest rule of response of the matching degreeThe barrage information is handled, and obtains non-player's control role to the response results of the barrage information.
As a result sending module 45 for the response results to be sent to the game server, and are triggered described to instituteIt states game server and broadcasts the response results to all game clients and be shown.
In specific implementation, semantic module 43 includes:
Participle unit 431, for detect the barrage information include the dictionary in any keyword when, to instituteIt states barrage information and carries out word segmentation processing, obtain word segmentation result.
Matching unit 432, for matching the word segmentation result with the keyword in the dictionary, with acquisition and instituteState the matched all keywords of word segmentation result.
Analytical unit 433, for carrying out signature analysis to the matched keyword of the word segmentation result, described in acquisitionThe characteristic value of keyword.
Searching unit 434, for being searched and the highest rule of response of characteristic value matching degree from the rule base.
In a kind of preferred embodiment, the signature analysis is sentiment analysis, and the characteristic value is Sentiment orientationValue.
Though being not drawn into Fig. 4, the barrage information processing unit be can further include:
Library module is built, for establishing the dictionary and the rule base, and by machine learning algorithm to the rule baseIn rule of response be trained.
In a kind of preferred embodiment, the keyword includes the title of non-player's control role.The responseRule includes being responded with the name of non-player's control role, it is described response include language, expression and movement in extremelyFew one kind.
It is the structure chart of another embodiment of barrage information processing unit provided in this embodiment referring to Fig. 5.This implementationThe basic principle of example is consistent with embodiment illustrated in fig. 3, can be found in the phase in embodiment illustrated in fig. 3 in place of not being described in detail in the present embodimentClose description.
As shown in figure 5, the barrage information processing unit characterized by comprising
Barrage receiving module 51, the barrage information sent for receiving game client, and to the barrage information intoRow summarizes.
Summarize sending module 52, is sent to central server for the barrage information after summarizing, triggers in describedThe barrage information processing method that central server is provided by embodiment as shown in Figure 1 handles the barrage information.
As a result broadcast module 53, the response results returned for receiving the central server, and by the response resultsBroadcast to all game clients are shown.
The basic principle of this implementation and the basic principle of embodiment illustrated in fig. 3 are consistent, and place is not described in detail in the present embodiment canAssociated description in embodiment shown in Figure 3.
It is the structure chart of one embodiment of barrage information processing system provided by the invention referring to Fig. 6.
As shown in fig. 6, the barrage information processing system, including game client 61, game server 62 and in it is genuinely convincedBusiness device 63.
The game client 61, for sending barrage information to the game server 62.
The barrage information processing unit that embodiment as shown in Figure 5 provides is provided on the game server 62.
The barrage information processing unit that embodiment as shown in Figure 4 provides is provided on the central server 63.
The basic principle of the present embodiment is consistent with previous embodiment, and place is not described in detail in the present embodiment can be found in aforementioned implementationAssociated description in example.
In conclusion during the present invention summarizes and is sent to the barrage information that client is sent by game serverCentral server, the central server carry out keyword according to keyword preset in dictionary, to the barrage informationMatch, when any Keywords matching in the barrage information and the dictionary, semantic analysis, root are carried out to the barrage informationThe highest rule of response of matching degree is searched from rule base according to the result of semantic analysis, calls the highest response rule of the matching degreeThen the barrage information is handled, obtains non-player's control role to the response results of the barrage information, and will be describedResponse results are sent to the game server, are broadcasted the response results to all game visitors by the game serverFamily end is shown.The present invention breaches the limitation of the interactive region of barrage interaction in existing network game, by playerThe barrage information of input carries out semantic analysis, thus it is speculated that player be intended to and call the highest rule of response of matching degree to barrage information intoRow processing can carry out Intelligence Feedback to barrage information according to the semanteme of barrage information, realize non-player's control role and playerAutomatic interaction expands the range of barrage interaction, is conducive to the Experience Degree and participation that enhance player.
It should be noted that the apparatus embodiments described above are merely exemplary, wherein described be used as separation unitThe unit module of explanation may or may not be physically separated, component shown as a unit can be orIt can not be physical unit, it can it is in one place, or may be distributed over multiple network units.It can be according to realityBorder needs to select some or all of the modules therein to achieve the purpose of the solution of this embodiment.In addition, provided by the inventionIn Installation practice attached drawing, the connection relationship between module indicates there is communication connection between them, specifically can be implemented as oneItem or a plurality of communication bus or signal wire.Those of ordinary skill in the art are without creative efforts, it canIt understands and implements.
Through the above description of the embodiments, it is apparent to those skilled in the art that the present invention can borrowHelp software that the mode of required common hardware is added to realize, naturally it is also possible to by specialized hardware include specific integrated circuit, speciallyIt is realized with CPU, private memory, special components and parts etc..Under normal circumstances, all functions of being completed by computer program are okIt is easily realized with corresponding hardware, moreover, being used to realize that the specific hardware structure of same function is also possible to a variety of moreSample, such as analog circuit, digital circuit or special circuit etc..But software program is real in situations more for the purpose of the present inventionIt is now more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words makes the prior artThe part of contribution can be embodied in the form of software products, which is stored in the storage medium that can be readIn, such as the floppy disk of computer, USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memoryDevice (RAM, Random Access Memory), magnetic or disk etc., including some instructions are with so that a computer is setStandby (can be personal computer, server or the network equipment etc.) executes method described in each embodiment of the present invention.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, anyThose familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all containLid is within protection scope of the present invention.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.