CN109413452A - Barrage method of calibration, device, terminal and storage medium based on different modes - Google Patents

Barrage method of calibration, device, terminal and storage medium based on different modes Download PDF

Info

Publication number
CN109413452A
CN109413452A CN201811171044.5A CN201811171044A CN109413452A CN 109413452 A CN109413452 A CN 109413452A CN 201811171044 A CN201811171044 A CN 201811171044A CN 109413452 A CN109413452 A CN 109413452A
Authority
CN
China
Prior art keywords
verification
barrage
class
data
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201811171044.5A
Other languages
Chinese (zh)
Other versions
CN109413452B (en
Inventor
张磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201811171044.5A priority Critical patent/CN109413452B/en
Publication of CN109413452A publication Critical patent/CN109413452A/en
Application granted granted Critical
Publication of CN109413452B publication Critical patent/CN109413452B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/235Processing of additional data, e.g. scrambling of additional data or processing content descriptors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/435Processing of additional data, e.g. decrypting of additional data, reconstructing software from modules extracted from the transport stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/478Supplemental services, e.g. displaying phone caller identification, shopping application
    • H04N21/4788Supplemental services, e.g. displaying phone caller identification, shopping application communicating with other users, e.g. chatting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/643Communication protocols

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the invention discloses a kind of barrage method of calibration, device, terminal and storage medium based on different modes.This method comprises: obtaining target barrage data and object identifier corresponding with target barrage data mark;Object identifier class is determined in each verification class according to object identifier mark, wherein verification class and barrage verification mode correspond, and each verification class inherits verification interface agreement in advance;Preset verification protocol object is initialized according to object identifier class;Using target barrage data as function input parameters, the barrage in verification protocol object after calling initialization verifies function, is verified using the corresponding target barrage verification mode of object identifier class to target barrage data.Technical solution through the embodiment of the present invention, the object identifier mode that can use in different verification modes carries out completeness check to barrage data, and the detection logic in existing verification mode selection approach can be effectively decoupled, the scalability of code is improved.

Description

Barrage method of calibration, device, terminal and storage medium based on different modes
Technical field
The present embodiments relate to barrage technical field more particularly to a kind of barrage method of calibration based on different modes, Device, terminal and storage medium.
Background technique
With the fast development of intelligent terminal, various application software are by development and application in intelligent terminal.Some applications are soft Part be such as broadcast live software, often have the function of in video jukebox software barrage receive, the barrages such as parsing and push.Developing these During application software, just whether the barrage data for needing to issue server carry out dependence test, to determine barrage function Often operation.
Currently, server is according to default barrage protocol construction in the applied software development based on Android operation system After completion barrage data or client is after receiving barrage data, needs to verify barrage data, to guarantee barrage Data can be normally resolved, and avoid result in client and the problems such as system crash occur.
In the prior art, there are a variety of data check modes, and different verification modes need to be utilized according to different situations When verifying to data, the type parameter of an integer int type can be set, by way of to type parameter assignment come Different verification modes is selected, for example, indicating to carry out data check using verification mode 1 as type=1, as type=2 It indicates to carry out data check using verification mode 2, and so on.
If for barrage data verification there is also when a variety of barrage verification modes, directly by verification side in the prior art Formula selection approach is applied in barrage verification, then needs to increase a type parameter in the input parameter that barrage verifies function, And all barrage verification modes are added to inside barrage verification function.As it can be seen that the selection of this barrage verification mode Means can make the logic function of barrage verification function extremely complex, and then lead to the degree of maintenance of barrage verification function also very Lowly, and to the modification of any barrage verification mode the business function for requiring adjustment barrage verification function, is not easy to carry out The processing such as extension and maintenance.
Summary of the invention
The embodiment of the invention provides a kind of barrage method of calibration, device, terminal and storage medium based on different modes, To carry out completeness check to barrage data in the way of the object identifier in different verification modes, and can effectively solve Detection logic in the existing verification mode selection approach of coupling, substantially increases the scalability and maintainability of code.
In a first aspect, the embodiment of the invention provides a kind of barrage method of calibration based on different modes, comprising:
Obtain target barrage data, and object identifier corresponding with target barrage data mark;
It is identified according to the object identifier, object identifier class is determined in each verification class, wherein the verification class and barrage Verification mode corresponds, and each verification class inherits verification interface agreement in advance;
According to the object identifier class, preset verification protocol object is initialized, wherein the verification agreement pair As the object of the type for the verification interface agreement;
The barrage school in verification protocol object using the target barrage data as function input parameters, after calling initialization Function is tested, the target barrage data are verified using the object identifier class corresponding target barrage verification mode.
Second aspect, the embodiment of the invention also provides a kind of barrage calibration equipment based on different modes, comprising:
Target barrage data obtaining module, for obtaining target barrage data, and it is corresponding with the target barrage data Object identifier mark;
Object identifier class determining module determines object identifier for identifying according to the object identifier in each verification class Class, wherein the verification class and barrage verification mode correspond, and each verification class inherits verification interface association in advance View;
Verify protocol object initialization module, for according to the object identifier class, to preset verification protocol object into Row initialization, wherein the verification protocol object is the object of the type of the verification interface agreement;
Target barrage data check module, for calling initialization using the target barrage data as function input parameters Barrage in verification protocol object afterwards verifies function, using the corresponding target barrage verification mode of the object identifier class to institute Target barrage data are stated to be verified.
The third aspect, the embodiment of the invention also provides a kind of terminal, the terminal includes:
One or more processors;
Memory, for storing one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processing Device realizes such as the barrage method of calibration provided by any embodiment of the invention based on different modes.
Fourth aspect, the embodiment of the invention also provides a kind of computer readable storage mediums, are stored thereon with computer Program realizes the barrage verification as provided by any embodiment of the invention based on different modes when the program is executed by processor Method.
The embodiment of the present invention passes through to be identified according to object identifier corresponding with target barrage data, is determined in each verification class Object identifier class, and according to object identifier class, preset verification protocol object is initialized;Using target barrage data as letter Number input parameter, the barrage in verification protocol object after calling initialization verify function, thus corresponding using object identifier class Target barrage verification mode to target barrage data carry out completeness check.By in advance by each verification Similar integral unification Verification interface agreement, and different barrage verification modes is distributed into different verification classes, so that the bullet in each verification class Curtain verification function only realizes the verifying function of corresponding barrage verification mode, to simplify the logic function of barrage verification function Can, and existing verification can be effectively decoupled by way of determining object identifier class come selection target barrage verification mode Detection logic in mode selection approach substantially increases the scalability and maintainability of code.
Detailed description of the invention
Fig. 1 is a kind of flow chart for barrage method of calibration based on different modes that the embodiment of the present invention one provides;
Fig. 2 is a kind of flow chart of barrage method of calibration based on different modes provided by Embodiment 2 of the present invention;
Fig. 3 is a kind of flow chart for barrage method of calibration based on different modes that the embodiment of the present invention three provides;
Fig. 4 is a kind of structural schematic diagram for barrage calibration equipment based on different modes that the embodiment of the present invention four provides;
Fig. 5 is a kind of structural schematic diagram for terminal that the embodiment of the present invention five provides.
Specific embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining the present invention rather than limiting the invention.It also should be noted that in order to just Only the parts related to the present invention are shown in description, attached drawing rather than entire infrastructure.
Embodiment one
Fig. 1 is a kind of flow chart for barrage method of calibration based on different modes that the embodiment of the present invention one provides, this reality Example is applied to be applicable to carry out integrality school to barrage data using the target barrage verification mode in different barrage verification modes The case where testing, after in barrage server according to barrage agreement generation barrage data are preset, to the bullet of generation In the application scenarios that curtain data are verified, while it can be used for the bullet issued in Android client to barrage server In the application scenarios that curtain data are verified.This method can be by being executed based on the barrage calibration equipment of different modes, the dress Setting can be realized by the mode of software and/or hardware, can be integrated in barrage server or be equipped with the tool of android system In the terminal for having barrage function, such as the intelligent terminals such as smart phone, tablet computer, smart television or laptop.Such as Shown in Fig. 1, this method specifically includes the following steps:
S110, target barrage data, and object identifier corresponding with target barrage data mark are obtained.
Wherein, barrage data can refer to barrage parameter information is packaged according to default barrage agreement after the word that obtains The data of symbol string String type.Default barrage agreement can be preset with user demand according to the actual situation, be used for The transmission data structure for providing barrage data, so as to can carry out data transmission between barrage server and client.Default bullet Curtain agreement can specify that the data structure of one or more barrage data.Target barrage data can be barrage parameter information base The barrage to be verified that a kind of data structure (referred to as target data structure) as defined in the default barrage agreement obtains after being packaged Data.Checking mark can be but not limited to data structure mark, verification class mark or verification mode mark, be respectively used to area Point different data structure, different verification classes or different barrage verification modes, so as to according to checking mark to barrage number According to pointedly being verified.Object identifier mark is the corresponding checking mark of target barrage data.Object identifier mark can be with It is configured in advance according to the corresponding target data structure of target barrage data and user demand.Barrage verification mode refers to bullet Curtain data carry out the mode of completeness check.In the present embodiment, the barrage data of different data structure can use different Barrage verification mode is verified, and the barrage data of same data structure also can use a variety of different barrage verification sides Formula is verified.
Specifically, barrage server is generating target barrage data according to the target data structure preset in barrage agreement When, the corresponding data structure mark of target data structure directly can be determined as the corresponding object identifier mark of target barrage data Know, the corresponding verification class mark of target barrage verification mode can also be determined as the corresponding object identifier mark of target barrage data Know, the corresponding verification mode mark of target barrage verification mode can also be determined as the corresponding object identifier of target barrage data Mark, thus when obtaining the target barrage data that barrage server generates, available mesh corresponding with target barrage data Mark checking mark.
S120, it is identified according to object identifier, object identifier class is determined in each verification class.
Wherein, verification class and barrage verification mode correspond, i.e., each barrage verification mode corresponding one independent Verify class.Verification class is one predetermined using the class that correspondingly barrage verification mode verifies barrage data. Each verification class inherits verification interface agreement in advance, so that the verification of corresponding barrage verification mode may be implemented in each verification class Function.Verification interface agreement refers to the interface predetermined for being used to carry out barrage verification, wherein including barrage predetermined Verify function.Object identifier class refers to that one of all verification classes can be to the verification class that target barrage data are verified. Object identifier mark can include but is not limited to object identifier class mark, object identifier mode identifies and target data structure mark Know.
Specifically, the present embodiment can be according to the corresponding relationship and object identifier between each checking mark and each verification class Mark determines object identifier class in each verification class, thus by way of determining object identifier class, it can be in different barrages Target barrage verification mode corresponding with object identifier class is determined in verification mode, to utilize target barrage verification mode to mesh Mark barrage data are verified.
Illustratively, before each verification class inherits verification interface agreement in advance, further includes: define verification interface agreement And the barrage in verification interface agreement verifies function, wherein verification interface agreement is the interface with public permission modifier Type, barrage, which verifies function, has public permission modifier, and the function input parameters type of barrage verification function and function are defeated Parameter type is respectively character string type and Boolean type out.
Specifically, a verification interface agreement is pre-defined, and comprising predetermined in the verification infrastructure protocol, but not The barrage for carrying out function realization verifies function.For example, verification interface agreement can be with is defined as:
public interface ICheckInfo{
public boolean checkDanmInfo(String danmuInfo);
}
The inside of verification interface agreement ICheckInfo includes a barrage verification function checkDanmInfo, and The function input parameters of checkDanmInfo only include the barrage data danmuInfo of a String character string type, The function output parameters of checkDanmInfo are the return value of a boolean Boolean type.Illustratively, if barrage data It verifies successfully, then checkDanmInfo can be by calling return true to return to true, if target barrage data check loses It loses, then checkDanmInfo can call return false to return to false.Verification interface agreement ICheckInfo be with The interface type of public permission modifier public, so that any verification class can inherit the verification interface agreement ICheckInfo.Barrage verification function checkDanmInfo also has public permission modifier public, so as to directly logical It crosses class and calls checkDanmInfo, improve the convenience of barrage verification function call.
Illustratively, each verification class inherits verification interface agreement in advance, comprising: the preparatory calling interface of each verification class after Keyword is held, verification interface agreement is inherited, and overrides the verification function of the barrage in verification interface agreement, so that in each verification class Barrage verification function realize the verifying function of corresponding barrage verification mode.Wherein, interface inheritance keyword refers to Java language The keyword of interface protocol succession is carried out as defined in calling the turn.
Specifically, for each verification class, class is verified by way of interface inheritance keyword implement, after Verification interface agreement ICheckInfo is held, and overrides verification interface by way of overriding@Override in verification class Barrage in agreement ICheckInfo verifies function checkDanmInfo, is existed by that will verify the corresponding barrage verification mode of class It is realized, that is, is instantiated in overriding function checkDanmInfo in verification class, so that the barrage in verification class verifies function The verifying function of corresponding barrage verification mode may be implemented in checkDanmInfo.For example, each verification class CheckSimple It can be with is defined as:
public class CheckSimple implements ICheckInfo{
@Override
public boolean checkDanmInfo(String danmuInfo){}
}
The present embodiment realizes the verifying function of different barrage verification modes by different verification classes, thus effectively The detection logic in existing verification mode selection approach is decoupled, so that subsequently verification operation is more convenient.It should be noted that It is that, if increasing a barrage verification mode, need to only define a new verification class, and by new verification Similar integral verification interface Agreement, so that increased barrage verification mode may be implemented in the barrage verification function checkDanmInfo in new verification class Verifying function, it is not necessary to modify other check codes, to substantially increase the scalability and maintainability of code.
S130, according to object identifier class, preset verification protocol object is initialized.
Wherein, verification protocol object is an object predetermined, for being verified to target barrage data.School Test the object for the type that protocol object is verification interface agreement.
Specifically, object identifier class can be utilized by calling mICheckInfo=new CheckSimple1 () CheckSimple1 () initializes verification protocol object mICheckInfo, so that the verification protocol object after initialization Function is verified comprising the barrage in object identifier class, and verifies the verification function of the barrage in protocol object and target bullet may be implemented The verifying function of curtain verification mode.
S140, the barrage in verification protocol object using target barrage data as function input parameters, after calling initialization Function is verified, target barrage data are verified using object identifier class corresponding target barrage verification mode.
Specifically, by calling just using the target barrage data danmuInfo of character string type as function input parameters Barrage in verification protocol object mICheckInfo after beginningization verifies function mICheckInfo.checkDanmInfo (danmuInfo), to be verified in the way of the corresponding object identifier of object identifier class to target barrage data, and can be with The check results of target barrage data are determined according to the return value that barrage verifies function.
It is verified if should be noted that using some barrage in addition to target barrage verification mode CheckSimple1 () Mode CheckSimple2 () verifies target barrage data, then need to only utilize the corresponding verification of barrage verification mode Class initializes verification protocol object, i.e. mICheckInfo=new CheckSimple2 (), appoints without changing What other check code, so that the switching of barrage checkschema is more convenient.
Optionally, before issuing target barrage data to Android client in barrage server, it can use this implementation Barrage method of calibration based on different modes provided by example is verified, and after the success of target barrage data check, then into Row target barrage data issue operation, to guarantee that the target barrage data that barrage server issues are accurate complete data. After Android client receives the target barrage data issued, it can use provided by the present embodiment based on different modes Barrage method of calibration is verified again, and after the success of target barrage data check, then is parsed to target barrage data Processing improves barrage test so as to avoid leading to problems such as client system crash occur because of barrage data exception Efficiency.
The technical solution of the embodiment of the present invention, by being identified according to object identifier corresponding with target barrage data, each It verifies and determines object identifier class in class, and according to object identifier class, preset verification protocol object is initialized;With target Barrage data are function input parameters, and the barrage in verification protocol object after calling initialization verifies function, to utilize mesh Calibration tests the corresponding target barrage verification mode of class and carries out completeness check to target barrage data.By in advance by each verification The unified verification interface agreement of Similar integral, and different barrage verification modes is distributed into different verification classes, so that each Barrage verification function in verification class only realizes the verifying function of corresponding barrage verification mode, to simplify barrage verification letter Several logic functions, and can effectively be solved by way of determining object identifier class come selection target barrage verification mode Detection logic in the existing verification mode selection approach of coupling, substantially increases the scalability and maintainability of code.
Based on the above technical solution, if S120 may include: that object identifier is identified as object identifier class mark, According to the corresponding relationship and object identifier class mark between each verification class mark and each verification class, object identifier class is determined;If Object identifier is identified as object identifier mode and identifies, then according to each verification mode identify the corresponding relationship between each verification class with And object identifier mode identifies, and determines object identifier class;If object identifier is identified as target data structure mark, according to each number According to the corresponding relationship and target data structure mark between structural identification and each verification class, object identifier class is determined, wherein often A data structural identification corresponds at least one verification class.
Specifically, each to verify between class mark and each verification class when object identifier is identified as object identifier class mark Corresponding relationship is one-to-one relationship, i.e., each verification class identifies one verification class of unique identification, at this time can be directly according to every Corresponding relationship between a verification class mark and each verification class, determines that object identifier class identifies corresponding object identifier class.? When object identifier is identified as object identifier mode and identifies, since verification class and barrage verification mode correspond, and verification mode One barrage verification mode of unique identification is identified, so that the corresponding relationship between each verification mode mark and each verification class is also one One corresponding relationship can determine mesh directly according to the corresponding relationship between each verification mode mark and each verification class at this time It marks verification mode and identifies corresponding object identifier class.When object identifier is identified as target data structure mark, due to same Data structure can correspond to one or more different barrage verification modes, that is, correspond to one or more different verification classes, from And each at least one corresponding verification class of data structure mark, it at this time can be based on default selection rule, according to each data structure Corresponding relationship and target data structure between mark and each verification class identify, and determine object identifier class.
Based on the above technical solution, according to each data structure identify corresponding relationship between each verification class and Target data structure mark, determines object identifier class, may include: according to pair between each data structure mark and each verification class It should be related to, determine the corresponding candidate verification class of target data structure mark;If a candidate verification class is only existed, by candidate school It tests class and is determined as object identifier class;At least two candidate verification class if it exists, then verify the verification priority of class according to each candidate, Determine object identifier class.
Wherein, verification priority can be used for reflecting the verification sequence of each candidate verification class, can be according to candidate school It tests the corresponding verification efficiency of class and user demand is configured in advance.Illustratively, if some corresponding barrage of candidate's verification class Verification efficiency is higher, then the verification priority of candidate verification class is higher.
Specifically, the corresponding relationship between each data structure mark in the present embodiment and each verification class may be one One corresponding relationship, it is also possible to many-one relationship, so that the target data structure mark determined based on the corresponding relationship is corresponding Candidate's verification class is likely to be one, it is also possible to be multiple.When target data structure mark only corresponds to a candidate verification class When, which can be verified into class and be determined directly as object identifier class.When target data structure mark corresponding at least two is candidate When verifying class, the candidate verification class that verify highest priority can be determined as object identifier class, it can also will be preassigned The corresponding candidate verification class of verification priority is determined as object identifier class.
Embodiment two
Fig. 2 is a kind of flow chart of the barrage method of calibration based on different modes provided by Embodiment 2 of the present invention, this reality It applies example on the basis of the above embodiments, is the first preset characters string structure in the corresponding target data structure of target barrage data When, the checking procedure of target barrage data is described in detail.It is wherein same as the previously described embodiments or corresponding term Explain that details are not described herein.
Referring to fig. 2, the barrage method of calibration provided in this embodiment based on different modes the following steps are included:
S210, target barrage data, and object identifier corresponding with target barrage data mark are obtained.
Wherein, the corresponding target data structure of target barrage data is the first preset characters string structure, the first preset characters String structure are as follows: using default first symbol as the first character, each key-value pair information is divided with default separator, is connected with default connector The key information and value information in key-value pair information are connect, using default end mark as ultimate character, wherein key-value pair information does not include Character string identical with default separator.
In the present embodiment, the first character in accurate complete target barrage data is default first symbol, ultimate character To preset end mark, and barrage parameter information exists in the form of key-value pair.Default separator is for dividing in barrage data Each key-value pair information, default connector is used to connect the key information and value information in key-value pair information.Target barrage data In the last one key-value pair information in value information also can use default separator with default end mark and divided, so as to The content that distinguishing value is included.The quantity for the preset characters that default separator or default connector in the present embodiment include can Think one, or multiple.Illustratively, default first symbol can be but be not limited to left brace " ", left round parentheses " (" and left bracket " [".In order to increase the discrimination between key-value pair information content, preferably left brace " ".It is default Separator can be but not limited to slash " " and "/".Default connector can be but not limited to "-", " ", ", " "==" and "=", default end mark can be but not limited to right brace " ", right round parentheses ") " and right bracket "] ".Preferably right flower Bracket " ".
It should be noted that key information and value information according to the regulation of default barrage agreement, in each key-value pair information It will not include character string identical with default separator, and the value information in each key-value pair information can not include and preset The identical character string of connector also may include character string identical with default connector.Illustratively, if with " " be default First symbol, with " " it is default end mark, it is default separator with "/", is default connector with "@=", then the first preset characters The target barrage data of string structure can be with are as follows: and type=uenter/rid=104838/uid=20080138/wgei= 0/ }, wherein not including character string identical with default separator or default connector in each key-value pair information.
The target barrage data of first preset characters string structure may be: {@=104838/ type@=uenter/rid @=0/ uid@=20088/avater@=www@douyu@=tv@com/wgei }, wherein in the 4th key-value pair information Value information " www@douyu@=tv@com " includes character string identical with default connector.
S220, it is identified according to object identifier, object identifier class is determined in each verification class.
S230, according to object identifier class, preset verification protocol object is initialized.
Specifically, the verifying function for the target barrage verification mode that the barrage verification function in object identifier class is realized, tool Body can be realized by step S240-S290.
S240, call initialization after verification protocol object in barrage storage function, by target barrage data store to In barrage data object.
Wherein, barrage data object is one for storing the object of target barrage data.Target bullet in the present embodiment Curtain data are the data of a String type, so that barrage data object is a String object.
S250, call barrage data object in character verify function, in target barrage data the first character and end Position character carries out character verifying.
Wherein, character verifying function is predetermined, for the first character and last bit word in target barrage data Accord with the function verified.Character verifying function may include the first character check function and the second character check function, difference For in target barrage data the first character and ultimate character verified.
Specifically, if by barrage data object be labeled as danmuStr, preset first symbol be " ", default end mark is " ", then mesh can be detected by calling the first character in danmuStr to verify function danmuStr.startWith (" { ") Whether the first character in mark barrage data is default first symbol, if it is not, then showing the first character authentication failed, that is, mesh Mark barrage data are an incomplete data, i.e. unqualified data, can directly determine the mistake of target barrage data check at this time It loses;If so, showing that the first character is proved to be successful, the second character can be called to verify function danmuStr.endWith at this time (" "), detect whether the ultimate character in target barrage data is default end mark, if so, showing in target barrage data The first character and ultimate character be it is legal, can determine that character is proved to be successful at this time;If it is not, then showing target barrage number According to being an incomplete data, the failure of target barrage data check can be directly determined at this time.
If S260, character are proved to be successful, the string segmentation function in barrage data object is called, by target barrage number Separator is preset accordingly to be split, and determines character string dimension.
Wherein, string segmentation function is predetermined, for target barrage data to be split into character string number The function of group.Specifically, if barrage data object is labeled as danmuStr, the string segmentation letter in barrage data object Number can be with are as follows: danmuStr.split (), so as to the target barrage data that will be stored in barrage data object danmuStr It is divided into a character string dimension.
Illustratively, if the target barrage data stored in barrage data object danmuStr are as follows:
{ type@=uenter/rid@=104838/uid@=20088/avater@=www@douyu@=tv@com/ @=0/ wg ei }, presetting separator is "/", then, will by calling splitSrtArray=danmuStr.split ("/") Target barrage data are stored with the string data that "/" is split acquisition into character string dimension splitSrtArray, i.e., String elements in splitSrtArray be respectively as follows: " { type@=uenter ", "@=104838 rid ", " uid@= 20088 ", " avater@=www@douyu@=tv@com ", "@=0 wgei " and " ".
It should be noted that due to not including and default separator phase in the barrage parameter information in target barrage data Same character string, to will not be carried out to barrage content of parameter when being split with default separator to target barrage data Segmentation, avoids the case where accidentally dividing, so as to accurately calculate default point in target barrage data using partitioning scheme Every symbol quantity.
S270, the array length according to character string dimension determine the default separator quantity in target barrage data.
Specifically, the present embodiment can directly acquire the array of character string dimension according to the length attribute of character string dimension Length, that is, the number of the string data after dividing.Illustratively, it by calling splitSrtArray.length, can obtain Obtain the array length of character string dimension splitSrtArray.For accurate complete target barrage data, target barrage number The first character and ultimate character in will not be default separators, and each of target barrage data preset separator Front and back there is a string data, thus segmentation after string data quantity 1 more than default separator quantity, because This result that can subtract 1 for the array length of character string dimension and obtain is determined as default separator quantity.
S280, each string elements in character string dimension are stored into corresponding string, and called each Character in string searches function, determines the default connector quantity in target barrage data.
Wherein, it is character string number predetermined, storing for searching splicing character string object that identifier, which searches function, It whether include the function for inputting parameter in.It, can be by being function input pair with "@=" if default connector is "@=" As, call the identifier in the corresponding string tmpStr of string elements search function tmpStr.contains (" ="), it whether include "@=" in inquiry string element.
Specifically, the present embodiment stores each string elements in character string dimension to corresponding string In, i.e., string elements and string correspond, by calling each to preset connector as function input parameters Identifier in string searches function, and whether the string elements for detecting each string storage include default company Symbol is connect, to count the default connector quantity in target barrage data.The present embodiment can disposably call each character Identifier in string object searches function;Character string can also be called by way of searching loop, in each cycle period Identifier in object searches function, to reduce running memory, promotes calculating speed.
It is only used for determining it should be noted that identifier searches function whether comprising inputting parameter in string data, Can not determine the number for the input parameter for including in string data, thus in barrage parameter information regardless of whether comprising with it is default The identical character string of connector can use identifier lookup function and accurately determine default connector in target barrage data Quantity.
If S290, default separator quantity and default connector quantity are equal, it is determined that the success of target barrage data check.
Wherein, pass through the analysis to the first preset characters string structure, it can be deduced that: if target barrage array is complete, in advance If separator quantity is equal with default connector quantity.
Specifically, if default separator quantity is equal with default connector quantity, show that target barrage data are one Complete data can be normally resolved, and can determine the success of target barrage data check at this time.If default separator quantity with Default connector quantity is unequal, then shows that target barrage data are an invalid datas, can determine target barrage number at this time Fail according to verification.
The technical solution of the present embodiment has carried out integrality school to the target barrage data of the first preset characters string structure It tests.After the success of target barrage data check, target barrage data can normally be parsed, and then avoid because of barrage number Lead to problems such as client system crash occur according to exception, improves barrage testing efficiency.
Embodiment three
Fig. 3 is a kind of flow chart for barrage method of calibration based on different modes that the embodiment of the present invention three provides, this reality It applies example on the basis of the above embodiments, is preset characters string nested structure in the corresponding target data structure of target barrage data When, the checking procedure of target barrage data is described in detail.It is wherein same as the previously described embodiments or corresponding term Explain that details are not described herein.
Referring to Fig. 3, the barrage method of calibration provided in this embodiment based on different modes the following steps are included:
S310, target barrage data, and object identifier corresponding with target barrage data mark are obtained.
Wherein, the corresponding target data structure of target barrage data is preset characters string nested structure, and preset characters string is embedding Nested structure includes: the nested structure formed by the second preset characters string structure of preset quantity, wherein the second preset characters string knot Structure are as follows: using default first symbol as the first character, each key-value pair information is divided with default separator, to preset connector connecting key Value is to the key information and value information in information, using default end mark as ultimate character.The second preset characters in the present embodiment String structure is a non-nested structure.Second preset characters string structure of preset quantity can be formed pre- based on a variety of nested modes If character string nested structure.
Specifically, each second preset characters string structure can be considered as a key-value pair information by the present embodiment, and with pre- It is then nested to another the second predetermined word side by side if separator divides the second preset characters string structure and other key-value pair informations In symbol string nested structure, to form preset characters string nested structure.Illustratively, if default first symbol be " ", presetting terminates Symbol for " ", preset separator be "/", preset connector be "@=", when the second preset characters string structure preset quantity be 3 When, the target barrage data of preset characters string nested structure can be with are as follows: { type=uenter/ { rid=104838/ }/uid =20088/ {@=0/ wgei }/avater@=www@douyu@=tv@com/ }, wherein by first the second preset characters string The data {@=104838 rid } of structure and second the second preset characters string structure {@=0/ wgei } are accordingly to be regarded as a key-value pair Information nested data { type@=uenter/avater@=ww w@to the second preset characters string structure of third arranged side by side Douyu@=tv@com/ } in, to form the barrage data of preset characters string nested structure.
Each second preset characters string structure can also be nested with one another by the present embodiment, to form preset characters string Nested structure.Illustratively, when the preset quantity of the second preset characters string structure is 3, the mesh of preset characters string nested structure Marking barrage data can be with are as follows: and type=uenter/ { rid=104838/ { uid=20088/ }/wgei=0/ }/ Avater@=www@douyu@=tv@com/ }, wherein by the data of first the second preset characters string structure uid@= 20088/ } it is considered as a key-value pair information, it is nested to data {@=104838/ rid of second the second preset characters string structure @=0/ wgei } in, and first the second preset characters string structure and other key-value pair informations are divided with default separator, so It is again that the nested structure {@=104838/ rid {@=20088/ uid }/@=0/ wgei } is nested to the second predetermined word of third afterwards In symbol string nested structure { type@=uent er/avater@=www@douyu@=tv@com/ }, and drawn with default separator Divide nested structure and other key-value pair informations, to form the barrage data of preset characters string nested structure.
Nested mode in the present embodiment, which can also be, carries out nesting side by side for the second preset characters string structure of a part, The second preset characters string structure of another part is nested with one another.The present embodiment is to the nesting in preset characters string nested structure Mode is not specifically limited.
S320, it is identified according to object identifier, object identifier class is determined in each verification class.
S330, according to object identifier class, preset verification protocol object is initialized.
Specifically, the target barrage verification mode that the barrage verification function in the object identifier class in the present embodiment is realized Verifying function can specifically be realized by step S340-S391.
S340, call initialization after verification protocol object in barrage storage function, by target barrage data store to In barrage data object.
S350, calling store the character string transfer function in the barrage data object of target barrage data, by target barrage Data are converted to target character array, and traverse to the character element in target character array, determine target barrage data In default first symbol quantity and default end mark quantity.
Wherein, character string transfer function is predetermined, for target barrage data to be converted to a character array Function.Character sequence in target character array is consistent with the character sequence in target barrage data.Illustratively, if Barrage data object is labeled as danmuStr, then the character string transfer function in danmuStr can be with are as follows: DanmuStr.toCharArray (), the target barrage data so as to store in danmuStr are converted to a target Character array.
Specifically, the present embodiment is when traversing the character element in target character array, can disposably by Each character element in target character array is matched with default first symbol, and the number of successful match is determined as target bullet Curtain data in default first symbol quantity, and by target character array each character element and default end mark carry out Match, the default end mark quantity number of successful match being determined as in target barrage data;Searching loop can also be passed through Mode matches character element in each cycle period with default first symbol and default end mark respectively, so as to It quickly determines default first symbol quantity and default end mark quantity, promotes calculating speed.
If S360, default first symbol quantity are equal to default end mark quantity, it is based on preset characters removing method, removes mesh Each default first symbol and each default end mark in character array are marked, barrage data to be measured are obtained.
Wherein, preset characters removing method refers to the side that first symbol and default end mark are preset in removal target barrage data Formula.Preset characters removing method, which can be but be not limited by, calls the mode of the replacement function in barrage data object to remove word Symbol, or the character removing method based on list structure.
Specifically, when default first symbol quantity is equal to default end mark quantity, the present embodiment can be by calling barrage Replacement function danmuStr.replaceAll (" { ", " ") in data object, will be all default in target barrage data First symbol " " the special invisible character such as null character string is replaced with, to remove all in target barrage data default open Begin symbol;Similarly, by calling the replacement function danmuStr.replaceAll (" } ", " ") in barrage data object, by target In barrage data all default end mark " " replace with the special invisible character such as null character string, to remove target All default end marks in barrage data.The present embodiment can also be by being converted to target character chain for target character array Table traverses each node in target character chained list, is default first symbol or default end mark by node data All nodes are deleted, to update target character chained list.Updated target character chained list is converted into number of characters to be measured Group, then the character array to be measured is converted into character string to be measured, thus using character string to be measured as barrage data to be measured, at this time Barrage data to be measured are the data of a String type.
Illustratively, if there are three node a, b and c in target character chained list, wherein the node data in node a is not It is default first symbol and default end mark, the node pointer (i.e. current pointer) in node a is directed toward node b, the node in node b Data are default first symbol, and the node pointer in node b is directed toward node c, then by call a- > next- > data==" " | | P- > next- > data==" ", to detect whether the node data in node b is to preset first symbol or default end mark, If so, a- > next=b- > next can be passed through, node pointed by the node pointer that node a is directed toward in node b, also It is that the node pointer in node a is directed toward node c, so as to the node b in delete target character chained list, and updates target word Chained list is accorded with, updated target character chained list only includes two nodes a and c at this time, and the node pointer in node a is directed toward section Point c.
S370, calling store the string segmentation function in the testing data object of barrage data to be measured, by barrage to be measured Data are split with default separator, determine character string dimension.
Illustratively, if the barrage data to be measured stored in testing data object danmuStr2 are as follows: type@=uenter/ Rid@=104838/uid@=20088//wgei@=0//avater@=www@douyu@=tv@com/, default separator are "/" is divided target barrage data with "/" then by calling splitSrtArray=danmuStr2.split ("/") The string data for cutting acquisition is stored into character string dimension splitSrtArray, i.e. character string member in splitSrtArray Element be respectively as follows: " type@=uenter ", "@=104838 rid ", "@=20088 ui d ", " ", "@=0 wgei ", " " and " avater@=www@douyu@=tv@com ".It should be noted that the null character string for the tail portion being partitioned into cannot function as character An array element in string array, and intermediate null character string can be used as an array element in character string dimension.
S380, the array length according to character string dimension determine the default separator quantity in barrage data to be measured.
Specifically, for accurate complete barrage data to be measured, the first character in barrage data to be measured will not be Default separator, and ultimate character is default separator, so that the quantity of the string data after segmentation is equal to default separator Quantity, therefore the array length of character string dimension directly can be determined as default separator quantity.
S390, each string elements in character string dimension are stored into corresponding string, and called each Identifier in string searches function, determines the default connector quantity in barrage data to be measured.
S391, it determines that the quantity between default separator quantity and default connector quantity is poor, and in quantity difference and presets When difference between quantity is equal to 1, the success of target barrage data check is determined.
Wherein, by analyzing complete preset characters string nested structure, it will thus be seen that in the second preset characters string When the preset quantity of structure is 1, presets separator quantity and be equal to default connector quantity;When preset quantity is N, barrage data In increase N-1 default separators just to be divided, the quantity of default connector remains unchanged, thus default separator quantity The N-1 more than default connector quantity.As it can be seen that presetting and dividing for the barrage data of complete preset characters string nested structure Quantity difference between symbol quantity and default connector quantity is 1 more than preset quantity.
Specifically, the quantity subtractive between default separator quantity and default connector quantity is gone into preset quantity, obtained The difference of the two, if the difference is equal to 1, then it represents that target barrage data are complete, can determine target barrage data check at this time Otherwise success determines the failure of target barrage data check.
The technical solution of the present embodiment has carried out integrality school to the target barrage data of preset characters string nested structure It tests, to guarantee the normal parsing of target barrage data.
Example IV
Fig. 4 is a kind of structural schematic diagram for barrage calibration equipment based on different modes that the embodiment of the present invention four provides, The present embodiment is applicable to carry out barrage data using the target barrage verification mode in different barrage verification modes complete Property verification the case where, which can specifically include: target barrage data obtaining module 410, object identifier class determining module 420, protocol object initialization module 430 and target barrage data check module 440 are verified.
Wherein, target barrage data obtaining module 410, for obtaining target barrage data, and with target barrage data Corresponding object identifier mark;Object identifier class determining module 420, for being identified according to object identifier, in each verification class really It sets the goal and verifies class, wherein verification class and barrage verification mode correspond, and each verification class inherits verification interface association in advance View;Protocol object initialization module 430 is verified, for carrying out to preset verification protocol object initial according to object identifier class Change, wherein verification protocol object is the object of the type of verification interface agreement;Target barrage data check module 440, for Target barrage data are function input parameters, and the barrage in verification protocol object after calling initialization verifies function, utilize mesh Calibration is tested the corresponding target barrage verification mode of class and is verified to target barrage data.
Optionally, object identifier class determining module 420, comprising: first object verifies class determination unit, if being used for target school It tests and is identified as object identifier class mark, then according to the corresponding relationship and object identifier between each verification class mark and each verification class Class mark, determines object identifier class;Second object identifier class determination unit, if being identified as object identifier mode for object identifier Mark then identifies according to each verification mode mark and each corresponding relationship verified between class and object identifier mode, determines mesh Class is tested in calibration;Third object identifier class determination unit, if target data structure mark is identified as object identifier, according to each Corresponding relationship and target data structure between data structure mark and each verification class identify, and determine object identifier class, wherein At least one corresponding verification class of each data structure mark.
Optionally, third object identifier class determination unit, is specifically used for: according to each data structure mark with each verification class it Between corresponding relationship, determine the corresponding candidate verification class of target data structure mark;It, will if only existing a candidate verification class Candidate's verification class is determined as object identifier class;At least two candidate verification class if it exists, then according to the verification of each candidate verification class Priority determines object identifier class.
Optionally, the device further include: verification interface protocol inheritance module, for the preparatory calling interface of each verification class after Keyword is held, verification interface agreement is inherited, and overrides the verification function of the barrage in verification interface agreement, so that in each verification class Barrage verification function realize the verifying function of corresponding barrage verification mode.
Optionally, the device further include: verification interface protocol definition module, for inheriting verification in advance in each verification class Before interface protocol, the barrage defined in verification interface agreement and verification interface agreement verifies function, wherein verification interface association View is the interface type with public permission modifier, and barrage, which verifies function, has public permission modifier, and barrage verifies letter Several function input parameters types and function output parameters type are respectively character string type and Boolean type.
Optionally, the corresponding target data structure of target barrage data is the first preset characters string structure, the first predetermined word Accord with string structure are as follows: using default first symbol as the first character, each key-value pair information is divided with default separator, to preset connector The key information and value information in key-value pair information are connected, using default end mark as ultimate character, wherein key-value pair information does not wrap Containing character string identical with default separator;Correspondingly, target barrage data check module 440 includes that the first barrage verifies function Execution unit utilizes the corresponding target barrage verification mode of object identifier class to target barrage number for being achieved by the steps of According to the function of being verified:
The data storage function in verification protocol object after calling initialization, target barrage data are stored to barrage number According in object;The character in barrage data object is called to verify function, to the first character and last bit word in target barrage data Symbol carries out character verifying;If character is proved to be successful, the string segmentation function in barrage data object is called, by target barrage Data are split with default separator, determine character string dimension;According to the array length of character string dimension, target barrage is determined Default separator quantity in data;Each string elements in character string dimension are stored to corresponding string In, and the character in each string is called to search function, determine the default connector quantity in target barrage data;If pre- If separator quantity and default connector quantity are equal, it is determined that the success of target barrage data check.
Optionally, the corresponding target data structure of target barrage data is preset characters string nested structure, preset characters string Nested structure includes: the nested structure formed by the second preset characters string structure of preset quantity, wherein the second preset characters string Structure are as follows: using default first symbol as the first character, each key-value pair information is divided with default separator, with default connector connection Key information and value information in key-value pair information, using default end mark as ultimate character;Correspondingly, target barrage data check Module 440 further includes the second barrage verification function execution unit, utilizes object identifier class corresponding for being achieved by the steps of Target barrage verification mode function that target barrage data are verified:
The data storage function in verification protocol object after calling initialization, target barrage data are stored to barrage number According in object;The character string transfer function in barrage data object is called, target barrage data are converted into target character array, And the character element in target character array is traversed, determine the default first symbol quantity in target barrage data and is preset End mark quantity;If default first symbol quantity is equal to default end mark quantity, it is based on preset characters removing method, removes target Each default first symbol and each default end mark in character array, obtain barrage data to be measured;It calls and stores barrage data to be measured Testing data object in string segmentation function, barrage data to be measured are split with default separator, determine character String array;According to the array length of character string dimension, the default separator quantity in barrage data to be measured is determined;By character string number Each string elements in group are stored into corresponding string, and the identifier in each string is called to search Function determines the default connector quantity in barrage data to be measured;Determine default separator quantity and default connector quantity it Between quantity it is poor, and quantity difference preset quantity between difference be equal to 1 when, determine target barrage data check success.
Any embodiment of that present invention can be performed in barrage calibration equipment based on different modes provided by the embodiment of the present invention The provided barrage method of calibration based on different modes has and executes the corresponding function of barrage method of calibration based on different modes It can module and beneficial effect.
Embodiment five
Fig. 5 is a kind of structural schematic diagram for terminal that the embodiment of the present invention five provides.Referring to Fig. 5, which includes:
One or more processors 510;
Memory 520, for storing one or more programs;
When one or more programs are executed by one or more processors 510, so that one or more processors 510 are realized Such as the barrage method of calibration based on different modes that any embodiment is proposed in above-described embodiment.
In Fig. 5 by taking a processor 510 as an example;Processor 510 and memory 520 in terminal can by bus or its He connects mode, in Fig. 5 for being connected by bus.
Memory 520 is used as a kind of computer readable storage medium, can be used for storing software program, journey can be performed in computer Sequence and module, such as the corresponding program instruction of the barrage method of calibration based on different modes/module (example in the embodiment of the present invention Such as, the target barrage data obtaining module 410 in the barrage calibration equipment based on different modes, object identifier class determining module 420, protocol object initialization module 430 and target barrage data check module 440 are verified).Processor 510 passes through operation storage Software program, instruction and module in memory 520, thereby executing the various function application and data processing of terminal, Realize the above-mentioned barrage method of calibration based on different modes.
Memory 520 mainly includes storing program area and storage data area, wherein storing program area can store operation system Application program needed for system, at least one function;Storage data area, which can be stored, uses created data etc. according to terminal.This Outside, memory 520 may include high-speed random access memory, can also include nonvolatile memory, for example, at least one Disk memory, flush memory device or other non-volatile solid state memory parts.In some instances, memory 520 can be into one Step includes the memory remotely located relative to processor 510, these remote memories can pass through network connection to terminal.On The example for stating network includes but is not limited to internet, intranet, local area network, mobile radio communication and combinations thereof.
The barrage method of calibration based on different modes that the terminal and above-described embodiment that the present embodiment proposes propose belongs to together One inventive concept, the technical detail of detailed description not can be found in above-described embodiment in the present embodiment, and the present embodiment has Execute the identical beneficial effect of barrage method of calibration based on different modes.
Embodiment six
The present embodiment provides a kind of computer readable storage mediums, are stored thereon with computer program, and the program is processed Such as the barrage method of calibration provided by any embodiment of the invention based on different modes is realized when device executes.
By the description above with respect to embodiment, it is apparent to those skilled in the art that, the present invention It can be realized by software and required common hardware, naturally it is also possible to which by hardware realization, but in many cases, the former is more Good embodiment.Based on this understanding, technical solution of the present invention substantially in other words contributes to the prior art Part can be embodied in the form of software products, which can store in computer readable storage medium In, floppy disk, read-only memory (Read-Only Memory, ROM), random access memory (Random such as computer Access Memory, RAM), flash memory (FLASH), hard disk or CD etc., including some instructions are with so that a computer is set For each embodiment of (can be personal computer, server or the network equipment etc.) execution present invention based on different modes Barrage method of calibration.
Note that the above is only a better embodiment of the present invention and the applied technical principle.It will be appreciated by those skilled in the art that The present invention is not limited to specific embodiments here, be able to carry out for a person skilled in the art it is various it is apparent variation, again Adjustment and substitution are without departing from protection scope of the present invention.Therefore, although by above embodiments to the present invention carried out compared with For detailed description, but the present invention is not limited to the above embodiments only, without departing from the inventive concept, can be with Including more other equivalent embodiments, and the scope of the invention is determined by the scope of the appended claims.

Claims (10)

1. a kind of barrage method of calibration based on different modes characterized by comprising
Obtain target barrage data, and object identifier corresponding with target barrage data mark;
It is identified according to the object identifier, object identifier class is determined in each verification class, wherein the verification class and barrage verify Mode corresponds, and each verification class inherits verification interface agreement in advance;
According to the object identifier class, preset verification protocol object is initialized, wherein the verification protocol object is The object of the type of the verification interface agreement;
Using the target barrage data as function input parameters, the barrage in verification protocol object after calling initialization verifies letter Number, verifies the target barrage data using the corresponding target barrage verification mode of the object identifier class.
2. the method according to claim 1, wherein being identified according to the object identifier, in each verification class really It sets the goal and verifies class, comprising:
If the object identifier is identified as object identifier class mark, according between each verification class mark and each verification class Corresponding relationship and object identifier class mark, determine the object identifier class;
If the object identifier is identified as object identifier mode and identifies, according to each verification mode mark with each verification class it Between corresponding relationship and the object identifier mode identify, determine the object identifier class;
If the object identifier be identified as target data structure mark, according to each data structure mark with each verification class it Between corresponding relationship and the target data structure mark, the object identifier class is determined, wherein each data structure Identify at least one corresponding described verification class.
3. according to the method described in claim 2, it is characterized in that, according between each data structure mark and each verification class Corresponding relationship and the target data structure mark, determine the object identifier class, comprising:
According to the corresponding relationship between each data structure mark and each verification class, the target data structure mark is determined Know corresponding candidate verification class;
If only existing the candidate verification class, the candidate verification class is determined as the object identifier class;
At least two candidate verification class if it exists, then according to the verification priority of each candidate verification class, determine described in Object identifier class.
4. the method according to claim 1, wherein each verification class inherits verification interface agreement in advance, Include:
Each preparatory calling interface of the verification class inherits keyword, inherits the verification interface agreement, and override the verification Barrage in interface protocol verifies function, so that the barrage verification function in each verification class realizes corresponding barrage verification The verifying function of mode.
5. the method according to claim 1, wherein inheriting verification interface agreement in advance in each verification class Before, further includes:
Define the barrage verification function in the verification interface agreement and the verification interface agreement, wherein the school Testing interface protocol is the interface type with public permission modifier, and the barrage verification function has public permission modifier, And the function input parameters type and function output parameters type of the barrage verification function are respectively character string type and boolean Type.
6. the method according to claim 1, wherein the corresponding target data structure of the target barrage data is First preset characters string structure, the first preset characters string structure are as follows: using default first symbol as the first character, with default point Each key-value pair information is divided every symbol, key information and value information in the key-value pair information are connected with default connector, with default End mark is as ultimate character, wherein the key-value pair information does not include character string identical with the default separator;
Correspondingly, the barrage verification function is achieved by the steps of the corresponding target bullet of the utilization object identifier class The function that curtain verification mode verifies the target barrage data:
The data storage function in verification protocol object after calling initialization, the target barrage data are stored to barrage number According in object;
The character in the barrage data object is called to verify function, to the first character and last bit in the target barrage data Character carries out character verifying;
If character is proved to be successful, the string segmentation function in the barrage data object is called, by the target barrage number The default separator is split accordingly, determines character string dimension;
According to the array length of the character string dimension, the default separator quantity in the target barrage data is determined;
Each string elements in the character string dimension are stored into corresponding string, and call each word The character accorded in string object searches function, determines the default connector quantity in the target barrage data;
If the default separator quantity and the default connector quantity are equal, it is determined that the target barrage data check at Function.
7. the method according to claim 1, wherein the corresponding target data structure of the target barrage data is Preset characters string nested structure, the preset characters string nested structure include: the second preset characters string structure by preset quantity The nested structure of formation, wherein the second preset characters string structure are as follows: using default first symbol as the first character, with default Separator divides each key-value pair information, key information and value information in the key-value pair information is connected with default connector, with pre- If end mark is as ultimate character;
Correspondingly, the barrage verification function is achieved by the steps of the corresponding target bullet of the utilization object identifier class The function that curtain verification mode verifies the target barrage data:
The data storage function in verification protocol object after calling initialization, the target barrage data are stored to barrage number According in object;
The character string transfer function in the barrage data object is called, the target barrage data are converted into target character number Group, and the character element in the target character array is traversed, determine the default beginning in the target barrage data Accord with quantity and default end mark quantity;
If the default first symbol quantity is equal to the default end mark quantity, it is based on preset characters removing method, removes institute Each default first symbol and each default end mark in target character array are stated, barrage data to be measured are obtained;
The string segmentation function in the testing data object for storing the barrage data to be measured is called, by the barrage number to be measured The default separator is split accordingly, determines character string dimension;
According to the array length of the character string dimension, the default separator quantity in the barrage data to be measured is determined;
Each string elements in the character string dimension are stored into corresponding string, and call each word The identifier accorded in string object searches function, determines the default connector quantity in the barrage data to be measured;
Determine that the quantity between the default separator quantity and the default connector quantity is poor, and in the quantity difference and institute When stating the difference between preset quantity equal to 1, the target barrage data check success is determined.
8. a kind of barrage calibration equipment based on different modes characterized by comprising
Target barrage data obtaining module, for obtaining target barrage data, and mesh corresponding with the target barrage data Mark checking mark;
Object identifier class determining module, for being identified according to the object identifier, the determining object identifier class in each verification class, In, the verification class and barrage verification mode correspond, and each verification class inherits verification interface agreement in advance;
Protocol object initialization module is verified, for being carried out just to preset verification protocol object according to the object identifier class Beginningization, wherein the verification protocol object is the object of the type of the verification interface agreement;
Target barrage data check module, for calling after initializing using the target barrage data as function input parameters The barrage verified in protocol object verifies function, using the corresponding target barrage verification mode of the object identifier class to the mesh Mark barrage data are verified.
9. a kind of terminal, which is characterized in that the terminal includes:
One or more processors;
Memory, for storing one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processors are real The now barrage method of calibration based on different modes as described in any in claim 1-7.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is by processor The barrage method of calibration based on different modes as described in any in claim 1-7 is realized when execution.
CN201811171044.5A 2018-09-30 2018-09-30 Bullet screen checking method and device based on different modes, terminal and storage medium Active CN109413452B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811171044.5A CN109413452B (en) 2018-09-30 2018-09-30 Bullet screen checking method and device based on different modes, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811171044.5A CN109413452B (en) 2018-09-30 2018-09-30 Bullet screen checking method and device based on different modes, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN109413452A true CN109413452A (en) 2019-03-01
CN109413452B CN109413452B (en) 2021-02-02

Family

ID=65466188

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811171044.5A Active CN109413452B (en) 2018-09-30 2018-09-30 Bullet screen checking method and device based on different modes, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN109413452B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160132545A1 (en) * 2006-12-21 2016-05-12 International Business Machines Corporation System and method for adaptive spell checking
CN106681855A (en) * 2015-11-10 2017-05-17 澜起科技(上海)有限公司 One-time programmable memory device and data verification method thereof
CN106973332A (en) * 2017-03-10 2017-07-21 武汉斗鱼网络科技有限公司 A kind of barrage message treatment method, analytic method and system
CN107239316A (en) * 2017-04-20 2017-10-10 武汉斗鱼网络科技有限公司 The optimized treatment method and device of a kind of function
CN107844400A (en) * 2017-10-16 2018-03-27 阿里巴巴集团控股有限公司 The method of calibration and device of a kind of daily record data
CN108089989A (en) * 2018-01-04 2018-05-29 武汉斗鱼网络科技有限公司 A kind of path detection method, electronic equipment and readable storage medium storing program for executing
CN108132880A (en) * 2017-12-21 2018-06-08 武汉斑马快跑科技有限公司 A kind of parameter verification method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160132545A1 (en) * 2006-12-21 2016-05-12 International Business Machines Corporation System and method for adaptive spell checking
CN106681855A (en) * 2015-11-10 2017-05-17 澜起科技(上海)有限公司 One-time programmable memory device and data verification method thereof
CN106973332A (en) * 2017-03-10 2017-07-21 武汉斗鱼网络科技有限公司 A kind of barrage message treatment method, analytic method and system
CN107239316A (en) * 2017-04-20 2017-10-10 武汉斗鱼网络科技有限公司 The optimized treatment method and device of a kind of function
CN107844400A (en) * 2017-10-16 2018-03-27 阿里巴巴集团控股有限公司 The method of calibration and device of a kind of daily record data
CN108132880A (en) * 2017-12-21 2018-06-08 武汉斑马快跑科技有限公司 A kind of parameter verification method and device
CN108089989A (en) * 2018-01-04 2018-05-29 武汉斗鱼网络科技有限公司 A kind of path detection method, electronic equipment and readable storage medium storing program for executing

Also Published As

Publication number Publication date
CN109413452B (en) 2021-02-02

Similar Documents

Publication Publication Date Title
CN109345388B (en) Block chain intelligent contract verification method and device and storage medium
CN107729227B (en) Application program test range determining method, system, server and storage medium
CN109800258B (en) Data file deployment method, device, computer equipment and storage medium
CN112100071B (en) Test case generation method and device, computer equipment and storage medium
CN111339531B (en) Malicious code detection method and device, storage medium and electronic equipment
CN113946546B (en) Abnormality detection method, computer storage medium, and program product
CN109299719B (en) Bullet screen checking method and device based on character segmentation, terminal and storage medium
JP2019003385A (en) Analysis device, analysis program and analysis method
CN108875317A (en) Software clone detection method and device, detection device and storage medium
CN115982053A (en) Method, device and application for detecting software source code defects
CN111752819A (en) Abnormity monitoring method, device, system, equipment and storage medium
CN117687905A (en) Interface test case generation method and device
CN109413450B (en) Bullet screen data integrity verification method and device, terminal and storage medium
CN109413452A (en) Barrage method of calibration, device, terminal and storage medium based on different modes
CN109379640A (en) Barrage method of calibration, device, terminal and storage medium based on chained list mode
CN111881059B (en) Code file detection method and device and electronic equipment
CN112799673B (en) Network protocol data checking method and device
CN111736917B (en) Data verification method and device, computer equipment and storage medium
CN104035864A (en) Path generation method based on contradiction fragment mode
CN110471669B (en) Null pointer reference detection method and detection device
CN109348304B (en) Bullet screen data verification method and device and terminal
CN106775629B (en) Search file generation method and device
CN113626295A (en) Pressure measurement data processing method and system and computer readable storage medium
CN109413505B (en) Bullet screen data verification method and device, terminal and storage medium
CN114172827A (en) Network verification method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant