CN109413506A - A kind of method of calibration, device, terminal and the storage medium of barrage data - Google Patents

A kind of method of calibration, device, terminal and the storage medium of barrage data Download PDF

Info

Publication number
CN109413506A
CN109413506A CN201811160416.4A CN201811160416A CN109413506A CN 109413506 A CN109413506 A CN 109413506A CN 201811160416 A CN201811160416 A CN 201811160416A CN 109413506 A CN109413506 A CN 109413506A
Authority
CN
China
Prior art keywords
barrage data
character
default
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
CN201811160416.4A
Other languages
Chinese (zh)
Other versions
CN109413506B (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 CN201811160416.4A priority Critical patent/CN109413506B/en
Publication of CN109413506A publication Critical patent/CN109413506A/en
Application granted granted Critical
Publication of CN109413506B publication Critical patent/CN109413506B/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/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/488Data services, e.g. news ticker
    • H04N21/4884Data services, e.g. news ticker for displaying subtitles
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/126Character encoding

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Signal Processing (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • User Interface Of Digital Computer (AREA)
  • Document Processing Apparatus (AREA)

Abstract

The embodiment of the invention discloses method of calibration, device, terminal and the storage mediums of a kind of barrage data.This method comprises: obtaining the target barrage data of preset characters string structure;Call storage target barrage data barrage data object in character verify function, in target barrage data the first character and ultimate character carry out character verifying;If character is proved to be successful, the string segmentation function in barrage data object is called, target barrage data are split with default identifier, determine character string dimension;According to the array length of character string dimension, the default identifier quantity in target barrage data is determined, and when default identifier quantity meets default verification condition, determine the success of target barrage data check.Technical solution through the embodiment of the present invention can carry out completeness check to barrage data and avoid result in client to guarantee that barrage data can be normally resolved and the problems such as system crash occur.

Description

A kind of method of calibration, device, terminal and the storage medium of barrage data
Technical field
The present embodiments relate to barrage technical field more particularly to a kind of method of calibration, device, the terminals of barrage data 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 completing barrage data, often directly by the barrage data distributing of building to client, and client is receiving barrage When data, and parsing and distribution processor directly are carried out to barrage data.
As it can be seen that server and client side is not to barrage in existing barrage data distributing process and receive process Data carry out any verification, to barrage testing process will be caused mistake occur, very when barrage data are there are when abnormal conditions To leading to problems such as client system crash occur, barrage testing efficiency has been seriously affected.
Summary of the invention
The embodiment of the invention provides method of calibration, device, terminal and the storage mediums of a kind of barrage data, to barrage Data carry out completeness check and avoid result in client to guarantee that barrage data can be normally resolved and system crash occur The problems such as.
In a first aspect, the embodiment of the invention provides a kind of methods of calibration of barrage data, comprising:
Obtain the target barrage data of preset characters string structure;
The character in the barrage data object for storing the target barrage data is called to verify function, to the target barrage The first character and ultimate character in data carry out character verifying;
If character is proved to be successful, the string segmentation function in the barrage data object is called, by the target bullet Curtain data are split with default identifier, determine character string dimension;
According to the array length of the character string dimension, the default identifier quantity in the target barrage data is determined, And when the default identifier quantity meets default verification condition, the target barrage data check success is determined.
Second aspect, the embodiment of the invention also provides a kind of calibration equipments of barrage data, comprising:
Target barrage data acquisition module, for obtaining the target barrage data of preset characters string structure;
Character authentication module, for calling the character in the barrage data object for storing the target barrage data to verify letter Number, in the target barrage data the first character and ultimate character carry out character verifying;
Character string dimension determining module calls the character in the barrage data object if being proved to be successful for character The target barrage data are split with default identifier, determine character string dimension by string segmentation function;
Default identifier quantity correction verification module determines the target for the array length according to the character string dimension Default identifier quantity in barrage data, and when the default identifier quantity meets default verification condition, described in determination The success of target barrage data check.
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 the method for calibration such as barrage data provided by any embodiment of the invention.
Fourth aspect, the embodiment of the invention also provides a kind of computer readable storage mediums, are stored thereon with computer Program realizes the method for calibration such as barrage data provided by any embodiment of the invention when the program is executed by processor.
The embodiment of the present invention is adjusted by storing the target barrage data of preset characters string structure to barrage data object With in barrage data object character verify function, in target barrage data the first character and ultimate character carry out character test Card;If character is proved to be successful, the string segmentation function in barrage data object is called, by target barrage data to be marked in advance Know symbol to be split, determines character string dimension;According to the array length of character string dimension, determine default in target barrage data Identifier quantity, and when default identifier quantity meets default verification condition, determine the success of target barrage data check.Pass through By adopting the above technical scheme, completeness check has been carried out to the target barrage data of preset characters string structure, thus in target bullet After curtain data check success, target barrage data can normally be parsed, and then avoid and led because of barrage data exception It causes client the problems such as system crash occur, improves barrage testing efficiency.
Detailed description of the invention
Fig. 1 is a kind of flow chart of the method for calibration for barrage data that the embodiment of the present invention one provides;
Fig. 2 is a kind of flow chart of the method for calibration of barrage data provided by Embodiment 2 of the present invention;
Fig. 3 is a kind of structural schematic diagram of the calibration equipment for barrage data that the embodiment of the present invention three provides;
Fig. 4 is a kind of structural schematic diagram for terminal that the embodiment of the present invention four 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 of the method for calibration for barrage data that the embodiment of the present invention one provides, and the present embodiment can fit The case where carrying out completeness check for the barrage data to preset characters string structure, it is particularly possible to for root in barrage server After generating barrage data according to default barrage agreement, in the application scenarios that are verified to the barrage data of generation, while can also be with In application scenarios for being verified in Android client to the barrage data that barrage server issues.This method can be with It is executed by the calibration equipment of barrage data, which can be realized by the mode of software and/or hardware, can be integrated in barrage Server is equipped in the terminal with barrage function of android system, such as smart phone, tablet computer, intelligence The intelligent terminals such as TV or laptop.This method specifically includes the following steps:
S110, the target barrage data for obtaining preset characters string structure.
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 one or more data structures.Preset characters string structure can be one kind specified in default barrage agreement Data structure.Preset characters string structure is corresponding with default barrage agreement.Target barrage data can refer to be verified preset The barrage data of character string structure.
Optionally, preset characters string structure are as follows: using default first symbol as the first character, each key is divided with default separator Value is to information, to preset key information and value information in connector connection key-value pair information, using default end mark as last bit word Symbol, wherein value information does not include default connector.
Wherein, presetting first symbol, default separator, default connector and default end mark is previously according to actual conditions The character of setting, and default first symbol, default separator, default connector and default end mark are mutually different characters. The quantity for the preset characters that default separator or default connector in the present embodiment include can be one, or more It is a.Wherein, preset characters can be a kind of number, letter or additional character predetermined etc..Illustratively, first symbol is preset Can be but be not limited to left brace " ", left round parentheses " (" and left bracket " [".In order to increase and key-value pair information content Between discrimination, preferably left brace " ".Default separator can be but not limited to slash " " and "/".Default connection Symbol 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 brace " ".
It specifically, include multiple between the first character and ultimate character in the target barrage data of preset characters string structure Key-value pair information is divided between every two key-value pair information, the key information in each key-value pair information with default separator It is attached with value information with default connector, and does not include default connector in each value information.In the present embodiment Key-value pair information may include English character and/or Chinese character.The present embodiment believes key-value pair in preset characters string structure The quantity of breath is without limitation.Illustratively, the target barrage data of preset characters string structure can be with are as follows:
{@=0/ type@=uenter/rid@=104838/uid@=20080138/wgei }
Wherein, target barrage data with " " be default first symbol, be default separator with "/", be default connect with "@=" Symbol is connect, with " " it is default end mark, including four key-value pair informations.Key information in first key-value pair information is " type ", right The value information answered is " uenter ";Key information in second key-value pair information is " rid ", and corresponding value information is " 104838 "; Key information in third key-value pair information is " uid ", and corresponding value information is " 20080138 ";Key in 4th key-value pair information Information is " wgei ", and corresponding value information is " 0 ".
Optionally, S110 includes: to obtain barrage data to be verified and the corresponding data to be verified of barrage data to be verified Mark;Data Identification in Data Identification to be verified logo collection corresponding with preset characters string structure is matched;If With success, then barrage data to be verified are determined as target barrage data.
Wherein, barrage data to be verified can be barrage parameter information is packaged according to default barrage agreement after obtain Any character string structure barrage data.Each barrage data to be verified correspond to a Data Identification to be verified.It is to be verified Data Identification is used to carry out unique identification to barrage data to be verified, can determine bullet to be verified by Data Identification to be verified The data structure of curtain data.The corresponding logo collection of preset characters string structure may include: that data structure is preset characters string knot The corresponding Data Identification of all barrage data of structure.
It specifically,, can be pre- when generating some barrage data if default barrage agreement defines plurality of data structures Whether the data structure for first detecting the barrage data of generation is preset characters string structure, if so, the barrage data are corresponding Data Identification is added in the corresponding logo collection of preset characters string structure, to be preset characters string by the data structure of generation The corresponding Data Identification of barrage data of structure is added in the logo collection, to carry out subsequent verification operation.It is obtaining It, can be by Data Identification to be verified and preset characters string structure pair after taking the corresponding Data Identification to be verified of barrage data to be verified The Data Identification in logo collection answered is matched one by one, if any data mark in Data Identification to be verified and logo collection Know successful match, then shows that the data structure of the barrage data to be verified is preset characters string structure, this can be waited for into school at this time It tests barrage data and is determined as target barrage data, to carry out completeness check to target barrage data.If data mark to be verified It fails to match with each Data Identification in logo collection for knowledge, then shows that the data structure of the barrage data to be verified is not pre- If character string structure, next barrage data to be verified available at this time are simultaneously identified matching, until obtaining preset characters string The target barrage data of structure.
S120, the character in the barrage data object of storage target barrage data is called to verify function, to target barrage number The first character and ultimate character in carry out character verifying.
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.Character verifies function can Be it is predetermined, for the first character and the function verified of ultimate character in target barrage data.
Optionally, character verifying function is achieved by the steps of to the first character and last bit word in target barrage data Symbol carry out character verifying function: call the first character verify function, detect target barrage data in the first character whether be Default first symbol;If the first character is default first symbol, the second character is called to verify function, detected in target barrage data Whether ultimate character is default end mark;If ultimate character is default end mark, it is determined that character is proved to be successful.
Wherein, the first character verifying function is predetermined, for carrying out to the first character in target barrage data The function of verification.Second character verifying function be it is predetermined, for carrying out school to the ultimate character in target barrage data The function tested.Illustratively, barrage data object is labeled as danmuStr, if default first symbol be " ", default end mark is " ", then call the first character verifying function to can be danmuStr.startWith (" { "), to detect barrage data object The first character in target barrage data in danmuStr whether be " ";Second character verifies function DanmuStr.endWith (" "), to detect the ultimate character in the target barrage data in barrage data object danmuStr Whether be " ".
Specifically, after calling the first character verifying function, if the first character in detection target barrage data is not pre- If first symbol, then show the first character authentication failed, that is, target barrage data are an incomplete data, i.e., it is unqualified Data can directly determine the failure of target barrage data check at this time.If the first character detected in target barrage data is pre- If first symbol, then show that the first character is proved to be successful, the second character can be called to verify function at this time, detects target barrage data In ultimate character whether be default end mark, if so, showing that the first character in target barrage data and ultimate character are equal Be it is legal, can determine that character is proved to be successful at this time;If it is not, then show that target barrage data are an incomplete data, The failure of target barrage data check can be directly determined at this time.
If S130, character are proved to be successful, the string segmentation function in barrage data object is called, by target barrage number Identifier 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.Illustratively, if barrage data object is labeled as danmuStr, the string segmentation in barrage data object Function can be with are as follows: danmuStr.split (), so as to the target barrage number that will be stored in barrage data object danmuStr According to being divided into a character string dimension.Default identifier may include a preset characters, also may include multiple preset characters. A kind of default identifier can be set in the present embodiment, and a variety of default identifiers also can be set.Default identifier can be according to pre- If preset characters string structure as defined in barrage agreement predefines.Default identifier can include but is not limited to default separator and Default connector.
Specifically, the present embodiment can call character to preset identifier as the input parameter of string segmentation function Target barrage data in barrage data object are split with default identifier, and will obtained after segmentation by string segmentation function Multiple string datas constitute character string dimension.Illustratively, it is assumed that the target stored in barrage data object danmuStr Barrage data are as follows: adbcebde, preset identifier be b, then by call splitSrtArray=danmuStr.split (" B "), target barrage data are stored with the string data that b is split acquisition into character string dimension splitSrtArray, That is the information in splitSrtArray are as follows: { " ad ", " ce ", " de " }.
S140, the array length according to character string dimension, determine the default identifier quantity in target barrage data, and When default identifier quantity meets default verification condition, the success of target barrage data check is determined.
Wherein, the array length of character string dimension refers to the element number in character string dimension.Default verification condition refers to When barrage data are complete, the condition that identifier quantity needs to meet is preset.Illustratively, if obtaining some target bullet in advance The accurate quantity that identifier is preset in curtain data is 10, then presetting verification condition can be with are as follows: mark is preset in target barrage data The quantity of symbol is 10.
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 identifiers, and each of target barrage data preset identifier Front and back there is a string data, thus segmentation after string data quantity 1 more than default identifier quantity, because This result that can subtract 1 for the array length of character string dimension and obtain is determined as default identifier quantity.Determining preset characters After quantity, examine whether default identifier quantity meets default test condition, if satisfied, then showing that target barrage data are one Complete accurate data can be normally resolved, and can determine the success of target barrage data check at this time.If not satisfied, then table Improving eyesight mark barrage data are an invalid datas, determine the failure of target barrage data check at this time.
The present embodiment is when determining default identifier quantity, by being divided target barrage data to preset identifier It cuts, default identifier quantity can be determined according to the quantity of the string data after segmentation, without will be in target barrage data Each character is matched or is looped through one by one matching with default identifier, thus when target barrage data are larger, it can To quickly determine the default identifier quantity in target barrage data, calculating speed is substantially increased, and then improve barrage The verification efficiency of data.
It should be noted that function provided by step S120-S140 can be packaged as a bullet by the present embodiment Curtain verification function, thus only need to be using barrage data object as the input object of barrage verification function, by calling barrage verification The checking procedure of target barrage data can be realized in function, so that barrage verification is more convenient.Illustratively, barrage verifies letter Number can be with is defined as: Publis static BooleancheckDanmInfo (String danmuStr).Wherein, CheckDanmInfo is the function name of barrage verification function, and danmuStr is the barrage data pair of character string String type As the return value of barrage verification function checkDanmInfo is the object of boolean's Boolean type.If target barrage number According to verifying successfully, then barrage verification function checkDanmInfo can be by calling return true to return to true, if target The failure of barrage data check, then barrage verification function checkDanmInfo can call return false to return to false.Bullet Curtain verification function checkDanmInfo has public permission modifier public and static types modifier static, in order to Directly to call checkDanmInfo by class, the convenience of barrage verification function call is improved.
Optionally, before issuing target barrage data to Android client in barrage server, it can use this implementation The method of calibration of barrage data provided by example is verified, and after the success of target barrage data check, then carries out target bullet Curtain data issue operation, to guarantee that the target barrage data that barrage server issues are accurate complete data.Android visitor After family terminates the target barrage data for accepting hair, the method for calibration that can use barrage data provided by the present embodiment is carried out again Secondary verification, and target barrage data check success after, then to target barrage data carry out dissection process, so as to avoid because Barrage data exception and lead to problems such as client system crash occur, improve barrage testing efficiency.
The target barrage data of preset characters string structure are stored in barrage data object by the technical solution of the present embodiment Afterwards, call barrage data object in character verify function, in target barrage data the first character and ultimate character carry out Character verifying;If character is proved to be successful, the character string transfer function in barrage data object is called, target barrage data are turned It is changed to target character array;And the adjacent character element of preset quantity every in target character array is subjected to character splicing, really Fixed each splicing character string object;By calling the identifier in each splicing character string object to search function respectively, target bullet is determined The quantity of identifier is preset in curtain data;When the quantity of default identifier meets default verification condition, target barrage number is determined According to verifying successfully.By using above-mentioned technical proposal, integrality school has been carried out to the target barrage data of preset characters string structure It tests, to can normally be parsed to target barrage data, and then avoid because of bullet after the success of target barrage data check Curtain data exception and lead to problems such as client system crash occur, improve barrage testing efficiency.
Embodiment two
Fig. 2 is a kind of flow chart of the method for calibration of barrage data provided by Embodiment 2 of the present invention, and the present embodiment is upper It states on the basis of embodiment to " the string segmentation function in barrage data object being called, by target barrage data to be marked in advance Know symbol to be split, determine character string dimension " it is optimized, and on this basis, also further to " according to character string dimension Array length, determine the default identifier quantity in target barrage data, and meet default verification in default identifier quantity When condition, the success of target barrage data check is determined " it is optimized.Wherein term identical or corresponding with the various embodiments described above Explanation details are not described herein.
Referring to fig. 2, barrage data provided in this embodiment method of calibration the following steps are included:
S210, the target barrage data for obtaining preset characters string structure.
Wherein, the preset characters string structure in the present embodiment are as follows: using default first symbol as the first character, separated with default Symbol divides each key-value pair information, to preset key information and value information in connector connection key-value pair information, to preset end mark As ultimate character, wherein value information does not include default connector.In this embodiment, presetting identifier includes default separator With default connector, and default separator and default connector may each comprise one or more preset characters.Illustratively, Default separator can be but not limited to "/";Default connector can be but not limited to "=".
S220, the character in the barrage data object of storage target barrage data is called to verify function, to target barrage number The first character and ultimate character in carry out character verifying.
If S230, character are proved to be successful, using default separator as function input parameters, call in barrage data object Target barrage data are split with default separator, determine the first character string dimension by string segmentation function.
Specifically, the present embodiment calls character string segmentation function, by barrage using default separator as function input parameters Target barrage data in data object are split with default separator, and the string data after segmentation is constituted the first word Symbol string array.Illustratively, if the target barrage data stored in barrage data object danmuStr are as follows: type@= @=0/ uenter/rid@=104838/uid@=20080138/wgei }, presetting separator is "/", then passes through calling SplitSrtArray1=danmuStr.split ("/"), target barrage data are split to the character string of acquisition with "/" Data are stored into the first character string dimension splitSrtArray1, i.e. information in splitSrtArray1 are as follows: " type@= Uenter ", "@=104838 rid ", "@=20080138 uid ", "@=0 wgei ", " ".
S240, using default connector as function input parameters, call the string segmentation function in barrage data object, will Target barrage data are split with default connector, determine the second character string dimension.
Specifically, the present embodiment calls character string segmentation function, by barrage using default connector as function input parameters Target barrage data in data object are split with default connector, and the string data after segmentation is constituted the second word Symbol string array.Illustratively, if the target barrage data stored in barrage data object danmuStr are as follows: type@= @=0/ uenter/rid@=104838/uid@=20080138/wgei }, presetting connector is "@=", then passes through calling Target barrage data, are split the word of acquisition by splitSrtArray1=danmuStr.split ("@=") with "@=" Symbol string data is stored into the second character string dimension splitSrtArray2, i.e. information in splitSrtArray2 are as follows: " type ", " uenter/rid " " 104838/uid ", " 20080138/wgei ", "=0/ } " }.
S250, according to the array length of the first character string dimension, determine the default separator quantity in target barrage data, And according to the array length of the second character string dimension, the default connector quantity in target barrage data is determined.
Specifically, the present embodiment can be by calling splitSrtArray1.length to obtain the first character string dimension The array length of splitSrtArray1, by calling splitSrtArray2.length to obtain the second character string dimension The array length of splitSrtArray2.Due to character string dimension array length than default identifier quantity more than 1, thus will The result that the array length of first character string dimension subtracts 1 and obtains is determined as default separator quantity;By the second character string dimension The result that array length subtracts 1 and obtains is determined as default connector quantity.
It should be noted that the present embodiment determined by segmentation object barrage data in the way of default separator quantity with When default connector quantity, without limiting the preset characters quantity preset separator and default connector and include, that is to say, that pre- If no matter separator or default connector include several preset characters, the technical solution that can use the present embodiment is rapidly true Default separator quantity and default connector quantity in the barrage data that set the goal, substantially increase calculating speed.
If S260, default separator quantity are equal with default connector quantity, it is determined that the success of target barrage data check.
Wherein, when default identifier includes default separator and default connector, by preset characters string structure Analysis, it can be deduced that: if target barrage array complete and accurate, default separator quantity is equal with default connector quantity, i.e., Default verification condition are as follows: the quantity of default separator is equal to the quantity of default connector.
Specifically, if default separator quantity is equal with default connector quantity, show to meet default verification condition, this When can determine target barrage data check success.It, can be with if default separator quantity and default connector quantity are unequal Determine that target barrage data check fails.
The technical solution of the present embodiment, by carrying out target barrage data to preset separator and default connector respectively String segmentation, so as to quickly determine default separator quantity and default connector quantity, and by comparing default The separator quantity check results to determine target barrage data whether equal with default connector quantity, so that barrage verification is more It is convenient to add.
Based on the above technical solution, barrage number is called using default separator as function input parameters in S230 Before the string segmentation function in object, it can also include: that the character in barrage data object is called to extract function, extract Character information in target barrage data between the first character and ultimate character, and the character information extracted is determined as first Barrage data;Target barrage data in barrage data object are updated to the first barrage data;Correspondingly, S230 include: with Default separator is function input parameters, calls the string segmentation function in barrage data object, by the first barrage data with Default separator is split, and determines the first character string dimension;S240 includes: to adjust using default connector as function input parameters With the string segmentation function in barrage data object, the first barrage data are split with default connector, determine second Character string dimension.
Wherein, character extraction function can be predetermined, for extracting the first character and end in target barrage data The function of character information between the character of position.Illustratively, by calling the character in barrage data object danmuStr to extract Function danmuStr.substring (1, length-1), wherein length is the character length in target barrage data, thus Character information in available target barrage data between the first character and ultimate character.
Specifically, the present embodiment shows that the first character in target barrage data is default opens after character is proved to be successful Begin symbol, and ultimate character is default end mark, thus only need to in target barrage data default first symbol and default end mark it Between character information, i.e. the first barrage data carry out further verify, with further promotions verification efficiency.By by barrage Target barrage data in data object are updated to the first barrage data, thus calling the character string in barrage data object point When cutting function, the first barrage data that barrage data object can be stored are carried out respectively with default separator and default connector Segmentation, determines the first character string dimension and the second character string dimension.
It should be noted that the first character for accurate complete first barrage data, in the first barrage data It is unlikely to be default separator or default connector, and the ultimate character in the first barrage data is default separator, thus After being split to the first barrage data for not including default first symbol and default end mark, the first determining character string dimension Array length can accurately reflect default separator quantity, it can be determined directly as the array length of the first character array Default separator quantity, the result for subtracting 1 for the array length of the second character array and obtaining are determined as default connector quantity.
Based on the above technical solution, it after default separator quantity is equal with default connector quantity, also wraps It includes: each string elements in the first character string dimension is stored into string;It is defeated as function using default connector Enter parameter, call the string segmentation function in each string, each string elements are carried out with default connector Segmentation, determines each character string subnumber group;The sub- array length of each character string subnumber group is obtained, and is in each sub- array length When preset length, the success of target barrage data check is determined.
Wherein, each string elements in the first character string dimension correspond to a string.For complete quasi- For true target barrage data, each string elements in the first character string dimension of acquisition are a key-value pair letter Breath, wherein key information and value information are attached with default connector, and do not include default connector in value information.Default length It spends and refers to when target barrage data are complete, the corresponding sub- array length of character string subnumber group.The present embodiment is in target barrage number According to it is complete when, character string subnumber group includes two character elements, respectively key information and value information, so that preset length can be set It is set to 2.
Specifically, by preset connector as function input parameters, calling the character string point in each string Function is cut, the string elements that each string stores are split with default connector, determines each character string Array.Illustratively, if some string elements in the first character string dimension are as follows:@=104838 rid, default connector are "@=" then stores the string elements into string danmuStr1, and by calling splitSrtArray11= DanmuStr1.split ("@="), which is stored with the string data that "@=" is split acquisition to word In symbol string subnumber group splitSrtArray11, i.e. information in splitSrtArray11 are as follows: [' rid ', ' 104838 '].
It, can be by calling splitSrtArray11.length to obtain each word after determining each character string subnumber group The sub- array length of symbol string subnumber group splitSrtArray11, and by comparing the sub- array length of each character string subnumber group It whether is preset length, to determine the check results of barrage data.If the sub- array length of all character string subnumber groups is Preset length then shows that the data in target barrage data between every two adjacent default separator are a complete key Value includes a key information and a value information, can determine the success of target barrage data check at this time to information.If it exists The sub- array length of at least one character string subnumber group is not equal to preset length, then shows there are incomplete key-value pair information, Barrage parameter information i.e. in target barrage data is imperfect, can determine that target barrage data check fails at this time.This implementation Example is by after default separator quantity is equal with default connector quantity, further to the key-value pair in target barrage data Information carries out completeness check, to may be implemented to target barrage data more in the lower situation of system performance requirements It verifies to stringency, to be further ensured that the integrality of barrage data.
Embodiment three
Fig. 3 is a kind of structural schematic diagram of the calibration equipment for barrage data that the embodiment of the present invention three provides, the present embodiment It is applicable to the case where completeness check is carried out to the barrage data of preset characters string structure, which can specifically include: mesh Mark barrage data acquisition module 310, character authentication module 320, character string dimension determining module 330 and default identifier quantity school Test module 340.
Wherein, target barrage data acquisition module 310, for obtaining the target barrage data of preset characters string structure;Word Authentication module 320 is accorded with, the character in barrage data object for calling storage target barrage data verifies function, to target bullet The first character and ultimate character in curtain data carry out character verifying;Character string dimension determining module 330, if being verified for character Success, then call the string segmentation function in barrage data object, and target barrage data are split with default identifier, Determine character string dimension;Default identifier quantity correction verification module 340, for the array length according to character string dimension, determines mesh The default identifier quantity in barrage data is marked, and when default identifier quantity meets default verification condition, determines target bullet Curtain data check success.
The technical solution of the embodiment of the present invention, by storing the target barrage data of preset characters string structure to barrage number After 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 identifier, determine character string dimension;According to the array length of character string dimension, target barrage is determined Default identifier quantity in data, and when default identifier quantity meets default verification condition, determine target barrage data It verifies successfully.By using above-mentioned technical proposal, completeness check has been carried out to the target barrage data of preset characters string structure, To can normally be parsed to target barrage data, and then avoid because of barrage after the success of target barrage data check Data exception and lead to problems such as client system crash occur, improve barrage testing efficiency.
Optionally, preset characters string structure are as follows: using default first symbol as the first character, each key is divided with default separator Value is to information, to preset key information and value information in connector connection key-value pair information, using default end mark as last bit word Symbol, wherein value information does not include default connector.
Optionally, target barrage data acquisition module 310, is specifically used for:
Obtain barrage data to be verified and the corresponding Data Identification to be verified of barrage data to be verified;
Data Identification in Data Identification to be verified logo collection corresponding with preset characters string structure is matched;
If successful match, barrage data to be verified are determined as target barrage data.
Optionally, character authentication module 320 includes that character verifies function execution unit, for being achieved by the steps of pair The first character and ultimate character in target barrage data carry out the function of character verifying:
It calls the first character to verify function, detects whether the first character in target barrage data is default first symbol;
If the first character is default first symbol, the second character is called to verify function, detects the end in target barrage data Whether position character is default end mark;
If ultimate character is default end mark, it is determined that character is proved to be successful.
Optionally, character string dimension determining module 330, is specifically used for:
Using default separator as function input parameters, the string segmentation function in barrage data object is called, by target Barrage data are split with default separator, determine the first character string dimension;
Using default connector as function input parameters, the string segmentation function in barrage data object is called, by target Barrage data are split with default connector, determine the second character string dimension.
Optionally, identifier quantity correction verification module 340 is preset, is specifically used for:
According to the array length of the first character string dimension, the default separator quantity in target barrage data, and root are determined According to the array length of the second character string dimension, the default connector quantity in target barrage data is determined;
If default separator quantity is equal with default connector quantity, it is determined that the success of target barrage data check.
Optionally, the device further include:
String elements memory module, for after default separator quantity is equal with default connector quantity, by the Each string elements in one character string dimension are stored into string;
Character string subnumber group determining module, for calling each character string pair using default connector as function input parameters Each string elements are split with default connector, determine each character string subnumber group by the string segmentation function as in;
Sub- array length calibration mode is fast, for obtaining the sub- array length of each character string subnumber group, and in each subnumber group When length is preset length, the success of target barrage data check is determined.
The calibration equipment of barrage data provided by the embodiment of the present invention can be performed provided by any embodiment of the invention The method of calibration of barrage data has the corresponding functional module of method of calibration and beneficial effect for executing barrage data.
It is worth noting that, in the embodiment of the calibration equipment of above-mentioned barrage data, included each unit and module It is only divided according to the functional logic, but is not limited to the above division, as long as corresponding functions can be realized; In addition, the specific name of each functional unit is also only for convenience of distinguishing each other, the protection scope being not intended to restrict the invention.
Example IV
Fig. 4 is a kind of structural schematic diagram for terminal that the embodiment of the present invention four provides.Referring to fig. 4, which includes:
One or more processors 410;
Memory 420, for storing one or more programs;
When one or more programs are executed by one or more processors 410, so that one or more processors 410 are realized As in above-described embodiment any embodiment propose barrage data method of calibration, this method comprises:
Obtain the target barrage data of preset characters string structure;
The character in the barrage data object of storage target barrage data is called to verify function, in target barrage data The first character and ultimate character carry out character verifying;
If character is proved to be successful, call the string segmentation function in barrage data object, by target barrage data with Default identifier is split, and determines character string dimension;
According to the array length of character string dimension, the default identifier quantity in target barrage data is determined, and default When identifier quantity meets default verification condition, the success of target barrage data check is determined.
In Fig. 4 by taking a processor 410 as an example;Processor 410 and memory 420 in terminal can by bus or its He connects mode, in Fig. 4 for being connected by bus.
Memory 420 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, if the corresponding program instruction/module of the method for calibration of the barrage data in the embodiment of the present invention is (for example, barrage Target barrage data acquisition module 310 in the calibration equipment of data, character authentication module 320, character string dimension determining module 330 and default identifier quantity correction verification module 340).Processor 410 by operation be stored in memory 420 software program, Instruction and module thereby executing the various function application and data processing of terminal realize the school of above-mentioned barrage data Proved recipe method.
Memory 420 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 420 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 420 can be into one Step includes the memory remotely located relative to processor 410, 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 method of calibration for the barrage data that the terminal and above-described embodiment that the present embodiment proposes propose belongs to same invention structure Think, the technical detail of detailed description not can be found in above-described embodiment in the present embodiment, and the present embodiment has execution barrage The identical beneficial effect of the method for calibration of data.
Embodiment five
The present embodiment five provides a kind of computer readable storage medium, is stored thereon with computer program, the program quilt The method of calibration such as barrage data provided by any embodiment of the invention is realized when processor executes, this method comprises:
Obtain the target barrage data of preset characters string structure;
The character in the barrage data object of storage target barrage data is called to verify function, in target barrage data The first character and ultimate character carry out character verifying;
If character is proved to be successful, call the string segmentation function in barrage data object, by target barrage data with Default identifier is split, and determines character string dimension;
According to the array length of character string dimension, the default identifier quantity in target barrage data is determined, and default When identifier quantity meets default verification condition, the success of target barrage data check is determined.
The computer storage medium of the embodiment of the present invention, can be using any of one or more computer-readable media Combination.Computer-readable medium can be computer-readable signal media or computer readable storage medium.It is computer-readable Storage medium can be for example but not limited to: electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or Any above combination of person.The more specifically example (non exhaustive list) of computer readable storage medium includes: with one Or the electrical connections of multiple conducting wires, portable computer diskette, hard disk, random access memory (RAM), read-only memory (ROM), Erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light Memory device, magnetic memory device or above-mentioned any appropriate combination.In this document, computer readable storage medium can With to be any include or the tangible medium of storage program, the program can be commanded execution system, device or device use or Person is in connection.
Computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal, Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for By the use of instruction execution system, device or device or program in connection.
The program code for including on computer-readable medium can transmit with any suitable medium, including but not limited to: Wirelessly, electric wire, optical cable, RF etc. or above-mentioned any appropriate combination.
The computer for executing operation of the present invention can be write with one or more programming languages or combinations thereof Program code, described program design language include object oriented program language, such as Java, Smalltalk, C++, also Including conventional procedural programming language-such as " C " language or similar programming language.Program code can be complete It executes, partly executed on the user computer on the user computer entirely, being executed as an independent software package, part Part executes on the remote computer or executes on a remote computer or server completely on the user computer.It is relating to And in the situation of remote computer, remote computer can pass through the network of any kind, including local area network (LAN) or wide area network (WAN), it is connected to subscriber computer, or, it may be connected to outer computer (such as led to using ISP Cross internet connection).
Will be appreciated by those skilled in the art that each module of the above invention or each step can use general meter Device is calculated to realize, they can be concentrated on single computing device, or be distributed in network constituted by multiple computing devices On, optionally, they can be realized with the program code that computer installation can be performed, so as to be stored in storage It is performed by computing device in device, perhaps they are fabricated to each integrated circuit modules or will be more in them A module or step are fabricated to single integrated circuit module to realize.In this way, the present invention is not limited to any specific hardware and The combination of software.
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 invention is not limited to the specific embodiments described herein, be able to carry out for a person skilled in the art it is various it is apparent variation, It readjusts and substitutes without departing from protection scope of the present invention.Therefore, although being carried out by above embodiments to the present invention It is described in further detail, but the present invention is not limited to the above embodiments only, without departing from the inventive concept, also It may include 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 method of calibration of barrage data characterized by comprising
Obtain the target barrage data of preset characters string structure;
The character in the barrage data object for storing the target barrage data is called to verify function, to the target barrage data In the first character and ultimate character carry 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 Identifier is preset accordingly to be split, and determines character string dimension;
According to the array length of the character string dimension, the default identifier quantity in the target barrage data is determined, and When the default identifier quantity meets default verification condition, the target barrage data check success is determined.
2. the method according to claim 1, wherein the preset characters string structure are as follows: made with default first symbol For the first character, each key-value pair information is divided with default separator, the key in the key-value pair information is connected with default connector Information and value information, using default end mark as ultimate character, wherein the value information does not include the default connector.
3. the method according to claim 1, wherein the target barrage data for obtaining preset characters string structure Include:
Obtain barrage data to be verified and the corresponding Data Identification to be verified of the barrage data to be verified;
By the Data Identification progress in the Data Identification to be verified logo collection corresponding with the preset characters string structure Match;
If successful match, the barrage data to be verified are determined as the target barrage data.
4. according to the method described in claim 2, it is characterized in that, character verifying function is achieved by the steps of to institute State the function that the first character and ultimate character in target barrage data carry out character verifying:
It calls the first character to verify function, detects whether the first character in the target barrage data is default first symbol;
If the first place character is the default first symbol, calls the second character to verify function, detect the target barrage number Whether the ultimate character in is default end mark;
If the ultimate character is the default end mark, it is determined that character is proved to be successful.
5. according to the method described in claim 2, it is characterized in that, calling the string segmentation letter in the barrage data object The target barrage data are split with default identifier, determine character string dimension by number, comprising:
Using the default separator as function input parameters, the string segmentation function in the barrage data object is called, it will The target barrage data are split with the default separator, determine the first character string dimension;
Using the default connector as function input parameters, the string segmentation function in the barrage data object is called, it will The target barrage data are split with the default connector, determine the second character string dimension.
6. according to the method described in claim 5, it is characterized in that, determining institute according to the array length of the character string dimension The default identifier quantity in target barrage data is stated, and when the default identifier quantity meets default verification condition, really The fixed target barrage data check success, comprising:
According to the array length of first character string dimension, the default separator quantity in the target barrage data is determined, And according to the array length of second character string dimension, the default connector quantity in the target barrage data is determined;
If the default separator quantity is equal with the default connector quantity, it is determined that the target barrage data check at Function.
7. according to the method described in claim 6, it is characterized in that, in the default separator quantity and the default connector After quantity is equal, further includes:
Each string elements in first character string dimension are stored into string;
Using the default connector as function input parameters, the string segmentation function in each string is called, Each string elements are split with the default connector, determine each character string subnumber group;
The sub- array length of each character string subnumber group is obtained, and when each sub- array length is preset length, Determine the target barrage data check success.
8. a kind of calibration equipment of barrage data characterized by comprising
Target barrage data acquisition module, for obtaining the target barrage data of preset characters string structure;
Character authentication module, for calling the character in the barrage data object for storing the target barrage data to verify function, To in the target barrage data the first character and ultimate character carry out character verifying;
Character string dimension determining module calls the character string point in the barrage data object if being proved to be successful for character Function is cut, the target barrage data are split with default identifier, determine character string dimension;
Default identifier quantity correction verification module determines the target barrage for the array length according to the character string dimension Default identifier quantity in data, and when the default identifier quantity meets default verification condition, determine the target The success of barrage data check.
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 method of calibration of the barrage data 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 method of calibration of the barrage data as described in any in claim 1-7 is realized when execution.
CN201811160416.4A 2018-09-30 2018-09-30 Bullet screen data verification method and device, terminal and storage medium Active CN109413506B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811160416.4A CN109413506B (en) 2018-09-30 2018-09-30 Bullet screen data verification method and device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811160416.4A CN109413506B (en) 2018-09-30 2018-09-30 Bullet screen data verification method and device, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN109413506A true CN109413506A (en) 2019-03-01
CN109413506B CN109413506B (en) 2021-06-11

Family

ID=65465970

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811160416.4A Active CN109413506B (en) 2018-09-30 2018-09-30 Bullet screen data verification method and device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN109413506B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111818331A (en) * 2020-08-14 2020-10-23 广州虎牙科技有限公司 Method, device, equipment and medium for detecting bullet screen display fluency

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103248480A (en) * 2012-02-10 2013-08-14 李宏光 Method and system for encrypting, saving and verifying account data
CN104602131A (en) * 2015-02-16 2015-05-06 腾讯科技(北京)有限公司 Barrage processing method and system
WO2016000453A1 (en) * 2014-06-30 2016-01-07 华为技术有限公司 Fully homomorphic message authentication method, device and system
CN106792208A (en) * 2016-11-24 2017-05-31 武汉斗鱼网络科技有限公司 Video preference information processing method, apparatus and system
CN106973332A (en) * 2017-03-10 2017-07-21 武汉斗鱼网络科技有限公司 A kind of barrage message treatment method, analytic method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103248480A (en) * 2012-02-10 2013-08-14 李宏光 Method and system for encrypting, saving and verifying account data
WO2016000453A1 (en) * 2014-06-30 2016-01-07 华为技术有限公司 Fully homomorphic message authentication method, device and system
CN104602131A (en) * 2015-02-16 2015-05-06 腾讯科技(北京)有限公司 Barrage processing method and system
CN106792208A (en) * 2016-11-24 2017-05-31 武汉斗鱼网络科技有限公司 Video preference information processing method, apparatus and system
CN106973332A (en) * 2017-03-10 2017-07-21 武汉斗鱼网络科技有限公司 A kind of barrage message treatment method, analytic method and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111818331A (en) * 2020-08-14 2020-10-23 广州虎牙科技有限公司 Method, device, equipment and medium for detecting bullet screen display fluency

Also Published As

Publication number Publication date
CN109413506B (en) 2021-06-11

Similar Documents

Publication Publication Date Title
CN110390202B (en) Method, device, system, equipment and medium for detecting business logic loophole
CN108628743B (en) Application program testing method, device, equipment and storage medium
CN110691085B (en) Login method, login device, password management system and computer readable medium
CN108694320B (en) Method and system for measuring sensitive application dynamic under multiple security environments
CN108256322B (en) Security testing method and device, computer equipment and storage medium
CN109299719B (en) Bullet screen checking method and device based on character segmentation, terminal and storage medium
CN111339531B (en) Malicious code detection method and device, storage medium and electronic equipment
CN109413450B (en) Bullet screen data integrity verification method and device, terminal and storage medium
CN109413506A (en) A kind of method of calibration, device, terminal and the storage medium of barrage data
CN114546837A (en) Interface test method, device, equipment and storage medium
CN113468276A (en) Trusted data acquisition method and device of on-chain prediction machine and electronic equipment
CN105745625B (en) Carry out the method for the integrality of proving program using hash
CN113836002A (en) Test interface verification method and device, storage medium and electronic device
CN110752933A (en) Verification code input method and device, electronic equipment and storage medium
CN109348305B (en) Bullet screen data verification method and device, terminal and storage medium
CN109005469A (en) A kind of conversion method of message format, device, storage medium and android terminal
CN109348304B (en) Bullet screen data verification method and device and terminal
CN109413505B (en) Bullet screen data verification method and device, terminal and storage medium
CN109756403A (en) Access verification method, device, system and computer readable storage medium
CN114978646A (en) Access authority determination method, device, equipment and storage medium
CN109413504B (en) Bullet screen checking method, device, terminal and storage medium based on character string replacement
CN113886812A (en) Detection protection method, system, computer equipment and readable storage medium
CN113407444A (en) Interface test case generation method, device, equipment and storage medium
CN109413451B (en) Bullet screen data verification method and device and terminal
CN109325496B (en) Bullet screen checking method and device based on character removal, terminal and storage medium

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