CN109379640B - Bullet screen checking method and device based on linked list mode, terminal and storage medium - Google Patents

Bullet screen checking method and device based on linked list mode, terminal and storage medium Download PDF

Info

Publication number
CN109379640B
CN109379640B CN201811160426.8A CN201811160426A CN109379640B CN 109379640 B CN109379640 B CN 109379640B CN 201811160426 A CN201811160426 A CN 201811160426A CN 109379640 B CN109379640 B CN 109379640B
Authority
CN
China
Prior art keywords
preset
bullet screen
character
screen data
node
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.)
Active
Application number
CN201811160426.8A
Other languages
Chinese (zh)
Other versions
CN109379640A (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 CN201811160426.8A priority Critical patent/CN109379640B/en
Publication of CN109379640A publication Critical patent/CN109379640A/en
Application granted granted Critical
Publication of CN109379640B publication Critical patent/CN109379640B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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)
  • Audiology, Speech & Language Pathology (AREA)
  • Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • User Interface Of Digital Computer (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a bullet screen checking method, a bullet screen checking device, a bullet screen checking terminal and a storage medium based on a linked list mode. The method comprises the following steps: acquiring target bullet screen data of a preset character string nested structure; calling a character string conversion function, converting the target bullet screen data into a first character array, traversing character elements in the first character array, and determining the number of preset start symbols and the number of preset end symbols in the target bullet screen data; if the number of the preset start symbols is equal to the number of the preset end symbols, removing each preset start symbol and each preset end symbol in the first character array based on a character removing mode of a linked list structure to obtain bullet screen data to be detected; and calling an identifier determining function, determining the number of preset identifiers in the bullet screen data to be tested, and determining that the verification of the target bullet screen data is successful when the number of the preset identifiers meets a preset verification condition. By the technical scheme of the embodiment of the invention, integrity verification can be carried out on the bullet screen data of the nested structure.

Description

Bullet screen checking method and device based on linked list mode, terminal and storage medium
Technical Field
The embodiment of the invention relates to the technical field of barrage, in particular to a barrage checking method and device based on a linked list mode, a terminal and a storage medium.
Background
With the rapid development of intelligent terminals, various application software is developed and applied to the intelligent terminals. Some application software such as live broadcast software and video playing software often have barrage functions of barrage receiving, parsing, pushing and the like. In the process of developing the application software, the bullet screen data issued by the server needs to be subjected to a relevant test to determine whether the bullet screen function normally operates.
At present, in application software development based on an Android operating system, after a server constructs and completes bullet screen data according to a preset bullet screen protocol, the constructed bullet screen data is often directly issued to a client, and when the client receives the bullet screen data, the client also directly analyzes and distributes the bullet screen data.
Therefore, in the existing bullet screen data issuing process and receiving process, the server and the client do not perform any check on bullet screen data, so that when the bullet screen data has abnormal conditions, the bullet screen testing process is wrong, even the client is crashed, and the like, and the bullet screen testing efficiency is seriously influenced.
Disclosure of Invention
The embodiment of the invention provides a bullet screen checking method, a bullet screen checking device, a terminal and a storage medium based on a linked list mode, which are used for carrying out integrity checking on bullet screen data, so that the bullet screen data can be normally analyzed, and the problems of system breakdown and the like of a client side are avoided.
In a first aspect, an embodiment of the present invention provides a bullet screen checking method based on a linked list mode, including:
acquiring target bullet screen data of a preset character string nested structure, wherein the preset character string nested structure comprises at least two preset start symbols and at least two preset end symbols;
calling a character string conversion function in a bullet screen data object for storing the target bullet screen data, converting the target bullet screen data into a first character array, traversing character elements in the first character array, and determining the number of preset start symbols and the number of preset end symbols in the target bullet screen data;
if the number of the preset start symbols is equal to the number of the preset end symbols, removing each preset start symbol and each preset end symbol in the first character array based on a character removing mode of a linked list structure to obtain bullet screen data to be detected;
calling an identifier determining function in the bullet screen object to be tested for storing the bullet screen data to be tested, determining the number of preset identifiers in the bullet screen data to be tested, and determining that the target bullet screen data is successfully verified when the number of the preset identifiers meets preset verification conditions.
In a second aspect, an embodiment of the present invention further provides a bullet screen checking apparatus based on a linked list mode, including:
the system comprises a target bullet screen data acquisition module, a target bullet screen data acquisition module and a target bullet screen data acquisition module, wherein the target bullet screen data acquisition module is used for acquiring target bullet screen data of a preset character string nested structure, and the preset character string nested structure comprises at least two preset start symbols and at least two preset end symbols;
the character quantity determining module is used for calling a character string conversion function in a bullet screen data object for storing the target bullet screen data, converting the target bullet screen data into a first character array, traversing character elements in the first character array, and determining the quantity of preset start characters and the quantity of preset end characters in the target bullet screen data;
the bullet screen data to be detected determining module is used for removing each preset start symbol and each preset end symbol in the first character array based on a character removing mode of a linked list structure to obtain bullet screen data to be detected if the number of the preset start symbols is equal to the number of the preset end symbols;
and the target bullet screen data verification module calls an identifier determination function in the bullet screen object to be detected for storing the bullet screen data to be detected, determines the number of preset identifiers in the bullet screen data to be detected, and determines that the target bullet screen data is successfully verified when the number of the preset identifiers meets preset verification conditions.
In a third aspect, an embodiment of the present invention further provides a terminal, where the terminal includes:
one or more processors;
a memory for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement the bullet screen checking method based on the linked list mode according to any embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the bullet screen checking method based on a linked list mode according to any embodiment of the present invention is implemented.
According to the technical scheme of the embodiment, target bullet screen data with a preset character string nested structure is stored in a bullet screen data object, a character string conversion function in the bullet screen data object is called, the target bullet screen data is converted into a first character array, character elements in the first character array are traversed, and the number of preset start symbols and the number of preset end symbols in the target bullet screen data are determined; when the number of the preset start symbols is equal to that of the preset end symbols, removing each preset start symbol and each preset end symbol in the first character array based on a character removing mode of a linked list structure, so that non-nested bullet screen data to be detected can be obtained more quickly; and when the number of the preset identifiers in the bullet screen data to be detected meets the preset verification condition, determining that the verification of the target bullet screen data is successful. By adopting the technical scheme, the integrity of the target bullet screen data with the preset character string nested structure is verified, so that the target bullet screen data can be normally analyzed after the target bullet screen data is successfully verified, the problems that the system breakdown occurs in a client side due to the abnormal bullet screen data and the like are solved, and the bullet screen testing efficiency is improved.
Drawings
Fig. 1 is a flowchart of a bullet screen checking method based on a linked list mode according to an embodiment of the present invention;
fig. 2 is a flowchart of a bullet screen checking method based on a linked list mode according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a bullet screen checking device based on a linked list mode according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a terminal according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a bullet screen checking method based on a linked list mode according to an embodiment of the present invention, which is applicable to integrity checking of bullet screen data of a preset character string nested structure, and particularly applicable to an application scenario in which bullet screen data generated by a bullet screen server according to a preset bullet screen protocol is checked after the bullet screen data is generated, and also applicable to an application scenario in which bullet screen data issued by the bullet screen server is checked at an Android client. The method can be executed by a linked list mode-based bullet screen checking device, the device can be realized by a software and/or hardware mode, and can be integrated in a bullet screen server or a terminal with a bullet screen function carrying an Android system, such as an intelligent terminal like a smart phone, a tablet computer, a smart television or a notebook computer. As shown in fig. 1, the method specifically includes the following steps:
s110, target bullet screen data of a preset character string nesting structure are obtained, wherein the preset character string nesting structure comprises at least two preset start symbols and at least two preset end symbols.
The bullet screen data may be data of a String type obtained by encapsulating the bullet screen parameter information according to a preset bullet screen protocol. The preset bullet screen protocol can be preset according to actual conditions and user requirements and is used for stipulating a transmission data structure of bullet screen data so that data transmission can be carried out between a bullet screen server and a client. The preset barrage protocol may specify one or more data structures. The preset character string nesting structure can be a nesting type data structure specified in a preset bullet screen protocol. The preset character string nesting structure corresponds to a preset bullet screen protocol. The target barrage data may be barrage data of a preset character string nested structure to be checked.
The preset start symbol and the preset end symbol in this embodiment may be predefined special symbols. The system is used for identifying the nested structure, and the preset start symbol corresponds to the preset end symbol one by one. Illustratively, the preset start character may be, but is not limited to, a left curly brace "{", a left curly brace "(" or a left curly brace "[". to increase the degree of distinction from the character string body content, it is preferable that the left curly brace "{". the preset end character may be, but is not limited to, a right curly brace "}", a right curly brace ")" or a right curly brace "]", preferably a right curly brace "}". The preset character string nesting structure is characterized in that a preset start symbol and a preset end symbol are used for identifying a nesting substructure, the number of the nesting substructures in the preset character string nesting structure can be predetermined according to a preset bullet screen protocol, and the number of the nesting substructures is at least two, namely the number of the preset start symbol and the number of the preset end symbol are at least two. The number of the preset start symbols and the number of the preset end symbols are equal to the number of the nested sub-structures. For example, if "{" is taken as a preset start symbol, "}" is taken as a preset end symbol, and the number of nested substructures is 3, the target bullet screen data of the preset string nested structure may be: { absd { afgd { sddw } ssfg } amms }, or { absd { afgd } ssfg { sddw } amms }, etc.
Optionally, S110 includes: acquiring bullet screen data to be verified and a bullet screen data identifier to be verified corresponding to the bullet screen data to be verified; matching the data identification to be verified with the data identification in the identification set corresponding to the preset character string nested structure; and if the matching is successful, determining the bullet screen data to be verified as target bullet screen data.
The bullet screen data to be verified can be bullet screen data of any data structure obtained after the bullet screen parameter information is packaged according to a preset bullet screen protocol. And each bullet screen data to be verified corresponds to a data identifier to be verified. The to-be-verified data identification is used for uniquely identifying the bullet screen data to be verified, so that the data structure of the bullet screen data to be verified can be determined through the to-be-verified data identification. The identifier set corresponding to the preset character string nesting structure may include: the data structure is a data identifier corresponding to each bullet screen data of a preset character string nested structure.
Specifically, if the preset bullet screen protocol specifies multiple data structures, when certain bullet screen data is generated, whether the data structure of the generated bullet screen data is a preset character string nested structure or not may be detected in advance, and if so, the data identifier corresponding to the bullet screen data is added to the identifier set corresponding to the preset character string nested structure, so that the data identifiers corresponding to the bullet screen data of which the generated data structure is the preset character string nested structure are all added to the identifier set, so as to perform subsequent checking operations. After the to-be-verified data identification corresponding to the to-be-verified bullet screen data is obtained, the to-be-verified data identification can be matched with the data identification in the identification set corresponding to the preset character string nested structure one by one, if the to-be-verified data identification is successfully matched with any data identification in the identification set, the data structure of the to-be-verified bullet screen data is the preset character string nested structure, and at the moment, the to-be-verified bullet screen data can be determined to be target bullet screen data so as to perform integrity verification on the target bullet screen data. If the matching between the to-be-verified data identifier and each data identifier in the identifier set fails, it is indicated that the data structure of the bullet screen data to be verified is not the preset character string nested structure, and at this time, identifier matching can be performed on the next bullet screen data to be verified until the target bullet screen data of the preset character string nested structure is obtained.
S120, calling a character string conversion function in a bullet screen data object for storing the target bullet screen data, converting the target bullet screen data into a first character array, traversing character elements in the first character array, and determining the number of preset start symbols and the number of preset end symbols in the target bullet screen data.
Wherein, the bullet screen data object is an object for storing target bullet screen data. The target barrage data in this embodiment is a String type data, so that the barrage data object is a String object. The character string conversion function is a predefined function for converting the target bullet screen data into a character array. The character sequence in the first character array is consistent with the character sequence in the target bullet screen data. For example, if the bullet screen data object is labeled danmuStr1, the string conversion function in danmuStr1 may be: danmustr1. tochrarrarray (), so that the target bullet screen data stored in danmuStr1 can be converted into a first character array.
Specifically, assume that the target bullet screen data stored in bullet screen data object danmuStr1 is: abcd, by calling danmuStr char1 ═ danmuStr1. tochrarray (), then save each subordinated object of danmuStr1 in the first character array danmuStr char1, i.e. danmuStr char1 is: { 'a', 'b', 'c','d' }. In this embodiment, during the traversal of the character elements in the first character array, each character element in the first character array may be matched with a preset start symbol at one time, the number of times of successful matching is determined as the number of preset start symbols in the target bullet screen data, each character element in the first character array is matched with a preset end symbol, and the number of times of successful matching is determined as the number of preset end symbols in the target bullet screen data; in a cyclic traversal mode, in each cycle period, the character elements are respectively matched with the preset start symbols and the preset end symbols, so that the number of the preset start symbols and the number of the preset end symbols can be quickly determined, and the calculation speed is increased.
And S130, if the number of the preset start symbols is equal to the number of the preset end symbols, removing each preset start symbol and each preset end symbol in the first character array based on a character removing mode of a linked list structure, and obtaining bullet screen data to be detected.
The linked list structure is composed of a plurality of nodes, each node comprises node data and a node pointer, and the node pointer is used for indicating position information of subsequent node data so as to establish a logic sequence of each node. The character removing mode based on the linked list structure is a mode of removing all the preset start symbols and all the preset end symbols in the first character array by using the linked list data structure. The bullet screen data to be detected is bullet screen data which does not contain a preset start symbol and a preset end symbol, namely non-nested bullet screen data. The method can be obtained by analyzing the nesting structure of the preset character strings, and the number of the preset start symbols in the complete legal target bullet screen data is equal to the number of the preset end symbols.
Specifically, whether the preset start symbols and the preset end symbols in the target bullet screen data are complete or not is verified by detecting whether the number of the preset start symbols is equal to the number of the preset end symbols or not. If the number of the preset start symbols is not equal to the number of the preset end symbols, it is indicated that the preset start symbols and the preset end symbols in the target bullet screen data are not in one-to-one correspondence, that is, the target bullet screen data is illegal data, and at this time, it can be directly determined that the target bullet screen data fails to be checked. If the number of the preset start symbols is equal to the number of the preset end symbols, it is indicated that the preset start symbols and the preset end symbols in the target bullet screen data are in one-to-one correspondence, at this time, subsequent verification operation can be performed, namely, a character removing mode based on a linked list structure is adopted, all the preset start symbols and all the preset end symbols in the first character array are removed, and the removed bullet screen data is determined as bullet screen data to be detected.
Illustratively, the operation of obtaining the bullet screen data to be tested in S130 includes: converting the first character array into a first character linked list; traversing each node in the first character chain table, deleting each preset start symbol and each node corresponding to each preset end symbol in the first character chain table, and obtaining a second character chain table; and converting the second character linked list into a second character array, and converting the second character array into a character string to be tested as the bullet screen data to be tested.
Specifically, each character element in the first character array is stored as node data in a corresponding node in the first character chain table, and the direction of a node pointer in each node is constructed according to the sequence of the character elements in the first character array, so that the sequence of the nodes in the first character chain table is consistent with the sequence of the elements in the first character array. The embodiment can traverse the nodes in the first character chain table at one time, delete all the nodes of which the nodes in the first character chain table are the preset start symbols or the preset end symbols, and determine the deleted first character chain table as the second character chain table; loop traversal may also be performed to increase deletion speed. And then, according to the node sequence in the second character chain table, storing each node data in the second character chain table as a character element into the second character array, so that the first character array containing the preset start symbol and the preset end symbol can be quickly converted into the second character array not containing the preset start symbol and the preset end symbol by using a chain table mode. After the second character array is determined, the array conversion function charArray2.tostring () in the character array object charArray2 for storing the second character array danmuster char2 can be called, the second character array danmuster char2 is converted into a character String to be tested of a String type, the character String to be tested is used as bullet screen data to be tested, and the bullet screen data to be tested at the moment is data of a String type.
It should be noted that, compared to a mode of directly using a character replacement function in a system function, replaceAll (), in which a preset start symbol and a preset end symbol in target bullet screen data are replaced with empty character strings, the character removal mode based on the linked list structure used in this embodiment has a faster removal speed of the preset start symbol and the preset end symbol due to lower performance damage and smaller memory occupation space, and thus improves the operation efficiency.
S140, calling an identifier determining function in the bullet screen object to be tested for storing bullet screen data to be tested, determining the number of preset identifiers in the bullet screen data to be tested, and determining that the verification of the target bullet screen data is successful when the number of the preset identifiers meets preset verification conditions.
The bullet screen object to be tested is an object used for storing bullet screen data to be tested. The bullet screen data to be detected in this embodiment is data of a String type, so that the bullet screen object to be detected is also a String object. The identifier determining function is defined in advance and is used for determining the number of preset identifiers in the bullet screen data to be detected. The preset identifier in this embodiment is a character or a character string having a specific meaning in a preset character string nesting structure specified based on a preset bullet screen protocol. The preset identifier may include one preset character or a plurality of preset characters, where the preset character may be a predefined number, letter, or special symbol. The preset character string nesting structure in this embodiment may include one preset identifier or a plurality of preset identifiers, and the number of the types of the preset identifiers may be predefined by a preset bullet screen protocol. The preset verification condition refers to a condition that the number of preset identifiers needs to meet when the bullet screen data is complete. For example, if the accurate number of the preset identifiers in the certain target bullet screen data obtained in advance is 10, the preset checking condition may be: the number of preset identifiers in the target bullet screen data is 10.
The number of preset identifiers may be determined in various ways in this embodiment. Illustratively, when the preset character string nesting structure only includes one preset identifier and the preset identifier only includes one preset character, the identifier determining function may implement the function of determining the number of the preset identifiers in the bullet screen data to be detected by the following steps: calling a character string conversion function in a bullet screen object to be tested for storing bullet screen data to be tested, converting the bullet screen data to be tested into a character array, performing character matching on each character element in the character array and a preset identifier, and determining the number of successfully matched characters as the number of the preset identifiers in the bullet screen data to be tested.
When the preset character string nesting structure only comprises one preset identifier, and the preset identifier comprises at least two preset characters, the identifier determining function can realize the function of determining the number of the preset identifiers in the bullet screen data to be detected through the following steps: calling a character string segmentation function in a bullet screen object to be detected, which stores bullet screen data to be detected, segmenting the bullet screen data to be detected by using a preset identifier, and determining a character string array; and determining the number of preset identifiers in the bullet screen data to be detected according to the array length of the character string array. Specifically, if the bullet screen object to be detected is marked as danmuster 2, and the preset identifier is ab, the character string data obtained by dividing the bullet screen data to be detected by ab is stored in the character string array splitfrray by calling a character string splitting function splitfsrtaray ═ danmuStr2.split ("\\ ab") in the bullet screen object danmuster 2, then the array length of the character string array splitfraray can be obtained by calling splitfraray.length, and the operation relationship between the array length of the character string array corresponding to the accurate and complete bullet screen data and the preset identifier number can be predetermined according to the preset character string nesting structure, so that the preset identifier number in the bullet screen data to be detected can be calculated according to the array length based on the operation relationship. Illustratively, if the exact and complete bullet screen data is: xaddyabz, the character string array segmented by the preset identifier ab includes three elements, which are: x, Y and Z, i.e. the length of the array of the string is 3, and the number of the default identifiers ab is 2, so that the operational relationship is: the array length of the character string array is 1 more than the number of the preset identifiers. Based on the operational relationship, the difference obtained by subtracting 1 from the array length of the character string array can be determined as the number of the preset identifiers in the bullet screen data to be detected.
Specifically, after the number of the preset identifiers is determined, whether the number of the preset identifiers meets a preset checking condition needs to be detected, if so, the target bullet screen data is complete data and can be normally analyzed, and at this time, it can be determined that the target bullet screen data is successfully checked. If the number of the preset identifiers does not meet the preset detection condition, the target bullet screen data is judged to be illegal data, and at the moment, the target bullet screen data is determined to fail to be verified.
It should be noted that, in this embodiment, the functions provided in steps S120 to S140 may be encapsulated into a bullet screen check function, so that a bullet screen data object is only required to be an input object of the bullet screen check function, and a bullet screen check process based on a linked list mode can be implemented by calling the bullet screen check function, so that bullet screen check is more convenient. Illustratively, the bullet screen check function may be defined as: public static Boolean checkDanmInfo (String danmuStr). Wherein, the checkDanmInfo is the function name of the bullet screen check function, danmuStr is the bullet screen data object of the String type, and the return value of the bullet screen check function checkDanmInfo is an object of Boolean type. If the target bullet screen data is successfully checked, the bullet screen checking function checkDanmInfo can return true by calling return true, and if the target bullet screen data is unsuccessfully checked, the bullet screen checking function checkDanmInfo can call return false. The bullet screen check function checkdanmninfo has public authority modifier public and static type modifier static, so that the bullet screen check function can be called directly through the class, and the convenience of calling the bullet screen check function is improved.
Optionally, before the bullet screen server issues the target bullet screen data to the Android client, the bullet screen verification method based on the linked list mode provided in this embodiment may be used to perform verification, and after the target bullet screen data is successfully verified, the target bullet screen data is issued, so as to ensure that the target bullet screen data issued by the bullet screen server is accurate and complete data. After receiving the delivered target bullet screen data, the Android client can perform secondary verification by using the bullet screen verification method based on the linked list mode provided by the embodiment, and after the target bullet screen data is successfully verified, the target bullet screen data is analyzed, so that the problems of system breakdown and the like of the client due to abnormal bullet screen data can be avoided, and the bullet screen testing efficiency is improved.
According to the technical scheme of the embodiment, target bullet screen data with a preset character string nested structure is stored in a bullet screen data object, a character string conversion function in the bullet screen data object is called, the target bullet screen data is converted into a first character array, character elements in the first character array are traversed, and the number of preset start symbols and the number of preset end symbols in the target bullet screen data are determined; when the number of the preset start symbols is equal to that of the preset end symbols, removing each preset start symbol and each preset end symbol in the first character array based on a character removing mode of a linked list structure, so that non-nested bullet screen data to be detected can be obtained more quickly; and when the number of the preset identifiers in the bullet screen data to be detected meets the preset verification condition, determining that the verification of the target bullet screen data is successful. By adopting the technical scheme, the integrity of the target bullet screen data with the preset character string nested structure is verified, so that the target bullet screen data can be normally analyzed after the target bullet screen data is successfully verified, the problems that the system breakdown occurs in a client side due to the abnormal bullet screen data and the like are solved, and the bullet screen testing efficiency is improved.
Example two
Fig. 2 is a flowchart of a bullet screen checking method based on a linked list method according to a second embodiment of the present invention, where on the basis of the second embodiment, when a preset character string nesting structure further includes a first preset identifier, a second preset identifier, and at least one layer of nesting formed by a preset number of preset character string structures, a checking process of target bullet screen data is described in detail in this embodiment. On this basis, optimization is also performed on "traversing each node in the first character chain table, deleting each preset start symbol and each node corresponding to each preset end symbol in the first character chain table, and obtaining the second character chain table", where explanations of terms that are the same as or corresponding to the above embodiments are not repeated herein.
Referring to fig. 2, the bullet screen checking method based on the linked list mode provided in this embodiment includes the following steps:
s210, target bullet screen data of a preset character string nested structure are obtained.
Wherein the predetermined string nesting structure comprises, in addition to the predetermined start and end symbols, a first predetermined identifier, a second predetermined identifier, and at least one layer of nesting formed by a predetermined number of predetermined string structures. Wherein, the preset character string structure is as follows: and taking a preset start character as a first character, dividing each key value pair information by using a first preset identifier, connecting the key information and the value information in the key value pair information by using a second preset identifier, and taking a preset end character as a last character. Illustratively, the first preset identifier may be, but is not limited to, single slashes "\", "/", double slashes "\ \ and"// "; the second preset identifier may be, but is not limited to, "-", "@", "═ and" @ ═ j ". In this embodiment, according to the specification of the preset bullet screen protocol, neither the key information nor the value information in each piece of key-value pair information includes the same character string as the first preset identifier, and the value information in each piece of key-value pair information may include the same character string as the second preset identifier or the same character string as the second preset identifier. The prescribed manner of the preset character string nesting structure in this embodiment can be more convenient for data transmission.
The preset character string structures with the preset number in the preset character string nesting structures can only form one layer of nesting, namely the layer of nesting is formed by the preset character string structures with the preset number; and multilayer nesting can be formed, namely all the layer nesting are formed by preset character string structures with preset quantity, and the specific nesting structure can be determined according to a preset bullet screen protocol. The at least one layer of nesting formed by the preset number of preset string structures may include a plurality of nesting ways.
Specifically, in this embodiment, each preset character string structure may be regarded as one key value pair information, and the preset character string structure and other key value pair information are divided by the first preset identifier, and then nested in parallel into the preset character string nesting structure, so as to form a layer of nesting. For example, when the preset number is 2 and a layer of nesting is formed, the target bullet screen data of the preset character string nesting structure may be: { type @ uenter/{ rid @ 104838/}/uid @ 20088/{ wgei @ 0/}/aveter @ www @ douyuu @ tv @ com/}, where "/" is a first preset identifier and "@" is a second preset identifier, the bullet screen data includes data of two preset string structures, i.e., { rid @ 104838} and { wgei @ 0/}.
In this embodiment, each preset character string structure may be nested with each other, and then the nested data is regarded as key value pair information and then nested into the preset character string nesting structure, thereby forming a multi-layer nesting. Illustratively, when the preset number is 2 and two-layer nesting is formed, the target bullet screen data of the preset character string nesting structure is as follows: { type @ uenter/{ rid @ 104838/{ uid @ 20088/}/wgei @ 0/}/aveter @ www @ douyuu @ tv @ com/}, wherein the data { uid @ 20088/} of a first preset string structure is regarded as one-key-value pair information, the data is nested into the data { rid @ 104838/wgei @ 0/} of a second preset string structure, so that a first layer of nesting is formed, the first preset string structure and other-key-value pair information are divided by a first preset identifier, and then the nesting structure { rid @ 104838/{ uid @ 20088/}/gei @ 0/} is nested into the second preset string structure, so that a second layer of nesting is formed.
In the embodiment, the nesting manner may also be that a part of the preset character string structures are nested in parallel, and another part of the preset character string structures are nested with each other, and the specific nesting manner may be determined according to a preset bullet screen protocol. The nesting mode in the preset character string nesting structure is not specifically limited in this embodiment.
S220, calling a character string conversion function in a bullet screen data object for storing the target bullet screen data, converting the target bullet screen data into a first character array, traversing character elements in the first character array, and determining the number of preset start symbols and the number of preset end symbols in the target bullet screen data.
And S230, if the number of the preset start symbols is equal to the number of the preset end symbols, converting the first character array into a first character linked list.
Wherein, the first character chain table is: the node data in the head node is null, the node pointer in the head node points to the first node, the node data in the first node is the first character element in the first character array, the node pointer in the first node points to the second node, the node data in the second node is the second character element in the first character array, the node pointer in the second node points to the third node, and so on.
Specifically, when the number of the preset start symbols is equal to the number of the preset end symbols, it is indicated that the preset start symbols and the preset end symbols in the target bullet screen data correspond to each other one to one, and at this time, the first character array may be converted into the first character linked list.
S240, taking the first character chain table as a current first character chain table, taking a head node in the first character chain table as a current node, and taking a node pointer in the head node as a current pointer.
The current first character linked list refers to a first character linked list corresponding to the current moment. The current node is a node in the first character linked list corresponding to the current moment. The current pointer refers to a node pointer in the current node.
Specifically, in this embodiment, each node in the first character chain table may be circularly traversed, and in the first circular period, the current first character chain table is the first character chain table converted by the first character array, the current node is a head node in the first character chain table, and the current pointer is a node pointer in the head node.
S250, detecting whether node data in a next node pointed by the current pointer is a preset start symbol or a preset end symbol, if so, going to step S260, and if not, going to step S270.
Specifically, if the current node is P, the current pointer is P- > next, the preset start symbol is "{", and the preset end symbol is "}", it may be detected whether node data in a next node pointed by the current pointer is the preset start symbol or the preset end symbol by calling P- > next- > data { "| P- > next- > data ═ or" } ", and if the node data in the next node is the preset start symbol or the preset end symbol, the operation in step S260 is executed; if the node data in the next node is neither the preset start nor the preset end, the operation of step S270 is executed.
S260, pointing the current pointer to the node pointed by the node pointer in the next node to update the current first character chain table, and proceeding to step S280.
Specifically, when the node data in the next node is the preset start symbol or the preset end symbol, the current pointer p- > next may be pointed to the node pointed to by the node pointer (p +1) - > next in the next node p +1 by calling p- > next ═ p +1) - > next, so that the next node of the current node may be deleted to update the current first character chain table. Illustratively, if there are three nodes a, b and c in the current first character chain table, where the node a is the current node, the node pointer (i.e., the current pointer) in the node a points to the node b, the node data in the node b is the preset start symbol, and the node pointer in the node b points to the node c, when it is detected that the node data in the node b to which the current pointer points is the preset start symbol, the node b in the current first character chain table may be deleted and the current first character chain table may be updated by pointing the current pointer to the node pointed by the node pointer in the node b, that is, pointing the node pointer in the node a to the node c, where the updated current first character chain table includes two nodes a and c, and the node pointer in the node a points to the node c.
S270, taking the node pointer in the next node as the current pointer to update the current pointer, and taking the next node as the current node to update the current node.
Specifically, when the node data in the next node is not the preset start symbol or the preset end symbol, it indicates that the next node of the current node does not need to be deleted, and at this time, the next node may be used as the current node, and the node pointer in the next node may be used as the current pointer, so as to update the current pointer and the current node. Illustratively, if there are three nodes a, b and c in the current first character chain table, where the node a is the current node, a node pointer (i.e. the current pointer) in the node a points to the node b, the node data in the node b is neither the preset start nor the preset end, and the node pointer in the node b points to the node c, when it is detected that the node data in the node b to which the current pointer points is neither the preset start nor the preset end, the next node b of the current node a is taken as the current node, and the node pointer in the next node b is taken as the current pointer, so as to perform the checking operation in the next cycle period.
S280, detecting whether the current node is the last node in the current first character chain table, if so, entering the step S290, and if not, entering the step S250.
Specifically, in this embodiment, it is checked in each cycle whether the node data in the next node is a preset start symbol or a preset end symbol, so that whether the cycle traversal is ended is determined by detecting whether the current node is the last node in the current first character linked list. If the current node is the last node in the current first character linked list, the loop traversal is finished, and the determined current first character linked list is the final first character linked list. If the current node is not the last node in the current first character chain table, it indicates that the loop traversal has not been completed, and at this time, the next loop cycle is entered by repeatedly executing step S250.
And S290, determining the current first character linked list as a second character linked list.
Specifically, when the current node is the last node in the current first character linked list, it indicates that each node data in the current first linked list is not the preset start symbol and the preset end book, and at this time, the current first character linked list can be directly determined as the second character linked list, so that all the preset start symbols and the preset end symbols are quickly removed based on the character removing mode of the linked list structure, and the second character linked list is obtained.
And S291, converting the second character chain table into a second character array, and converting the second character array into a character string to be tested as the bullet screen data to be tested.
S292, calling a character string segmentation function in the to-be-detected data object for storing the to-be-detected bullet screen data, segmenting the to-be-detected bullet screen data by using a first preset identifier, and determining a character string array.
Specifically, in this embodiment, the first preset identifier may be used as an input parameter of the character string segmentation function, the character string segmentation function is called, the bullet screen data to be detected in the data object to be detected is segmented by the first preset identifier, and a plurality of character string data obtained after segmentation form a character string array.
Illustratively, if the bullet-screen data to be tested stored in the data object to be tested danmuStr2 is: when the first preset identifier is "/", the character string data obtained by dividing the target bullet screen data by "/" is stored in the character string array splitlsrtarray by calling splitlsrtarray @ danmuth 2.split ("\/"), that is, the character string elements in the splitlsrtarray are: "type @," rid @ 104838 "," uid @ ═ 20088 "," @ ", wgei @ ═ 0", "", and "avatar @ ═ www @ douyuu @ tv @ com". It should be noted that the empty string at the tail of the partition cannot be used as an array element in the string array, and the empty string in the middle can be used as an array element in the string array.
It should be noted that, because all the bullet screen parameter information in the bullet screen data to be tested does not contain the character string the same as the first preset identifier, when the bullet screen data to be tested is divided by the first preset identifier, the bullet screen parameter content is not divided, and the situation of mistaken division is avoided, so that the number of the first preset identifiers in the bullet screen data to be tested can be accurately calculated by using the dividing mode.
S293, determining the number of the first preset identifiers in the bullet screen data to be detected according to the array length of the character string array.
The array length refers to the number of elements in the character string array. According to the length attribute of the character string array, the array length of the character string array, namely the number of the divided character string data, can be directly obtained. Illustratively, the array length of the string array splitstartay may be obtained by calling splitstartay. For accurate and complete bullet screen data to be detected, the first character in the bullet screen data to be detected is not the first preset identifier, and the last character is the first preset identifier, so that the number of the segmented character string data is equal to the number of the first preset identifiers, and the array length of the character string array can be directly determined as the number of the first preset identifiers.
S294, storing each character string element in the character string array into a corresponding character string object, calling an identifier searching function in each character string object, and determining the number of second preset identifiers in the bullet screen data to be detected.
The identifier searching function is predefined and is used for searching whether the character string data stored in the spliced character string object contains the function of the input parameter. It should be noted that the identifier lookup function can only be used to determine whether the character string data includes the input parameters, and cannot determine the number of the input parameters included in the character string data, so that the identifier lookup function can be used to accurately determine the number of the second preset identifiers in the bullet screen data to be detected no matter whether the bullet screen parameter information includes the character string identical to the second preset identifier.
Specifically, each character string element in the character string array is stored in a corresponding character string object, namely the character string elements are in one-to-one correspondence with the character string objects, and the identifier search function in each character string object is called by taking a second preset identifier as a function input parameter to detect whether the character string elements stored in each character string object contain the second preset identifier, so that the number of the second preset identifiers in the bullet screen data to be detected is counted. For example, assuming that the second preset identifier is "@", the function input object may be called one by one to find the function tmpstr.contacts ("@"), and the function input object may be searched for whether each string element includes "@", and if so, the variable value of the preset identifier number variable splitCount is incremented by 1. After traversing all the character string elements is finished, the variable value stored in the identifier number variable can be directly determined as the second preset identifier number in the bullet screen data to be tested.
It should be noted that, for the string element "avatar @ ═ www @ douyu @ tv @ com", the number of the second preset identifiers should be 1, instead of 2, if a character matching mode with the second preset identifier is used, the number of the second preset identifiers cannot be accurately determined, so that in this embodiment, by calling an identifier lookup function, as long as the current string element includes the second preset identifier, the variable values of the identifier number variable are accumulated by 1, and thus the number of the second preset identifiers in the bullet screen data to be measured can be more accurately determined.
S295, determining the difference value between the first preset identifier number and the second preset identifier number.
Specifically, the difference between the first preset identifier number and the second preset identifier number is obtained by subtracting the second preset identifier number from the first preset identifier number, so as to perform subsequent checking operation.
And S296, if the difference value is equal to the preset number, determining that the target bullet screen data is successfully verified.
Wherein, through analyzing the complete nested structure of the preset character string, can see that: when a preset character string structure is nested in each preset character string nesting structure, a first preset identifier is added in the bullet screen data for division, and the number of second forecast identifiers is kept unchanged. Illustratively, if the preset string nesting structure includes a nesting structure composed of M preset string structures, the number of the first preset identifiers is M more than the number of the second forecast identifiers for the complete barrage data.
Specifically, if the difference between the first preset identifier number and the second preset identifier number is equal to the preset number, it indicates that the target bullet screen data is complete, and at this time, it may be determined that the target bullet screen data is successfully verified, otherwise, it is determined that the target bullet screen data is failed to be verified.
According to the technical scheme of the embodiment, when the preset character string nesting structure comprises two preset identifiers and at least one layer of nesting formed by a preset number of first preset character string structures, after the character verification of the target bullet screen data of the preset character string nesting structure is successful, the number of the first preset identifiers is determined according to the array length of the character string array; the number of the second preset identifiers can be more accurately determined according to each character string element in the character string array, and a verification result of the target bullet screen data is determined according to whether the difference value between the number of the first preset identifiers and the number of the second preset identifiers is equal to the preset number, so that integrity verification is performed on the target bullet screen data of a preset character string nested structure comprising two preset identifiers, and normal analysis of the bullet screen data is guaranteed. In addition, each node in the first character linked list is traversed based on a circular traversal mode, the second character linked list can be obtained more conveniently, and then the verification efficiency is improved.
On the basis of the above technical solution, before S220, the method further includes: calling a first character verification function in the bullet screen data object, and detecting whether a first character in target bullet screen data is a preset start character or not; if the first character is a preset start character, calling a second character verification function in the bullet screen data object, and detecting whether the last character in the target bullet screen data is a preset end character; accordingly, S220 includes: and if the last character is a preset end character, calling a character string conversion function in the bullet screen data object for storing the target bullet screen data.
The first character verification function is a predefined function used for verifying the first character in the target bullet screen data. The second character verification function is a predefined function for verifying the last character in the target bullet screen data. Illustratively, the bullet screen data object is marked as danmusstr 1, and if the preset start symbol is "{" and the preset end symbol is "}", the first character verification function may be danmusstr1. startwith ("{") to detect whether the first character in the target bullet screen data in the bullet screen data object danmusstr 1 is "{"; the second character validation function may be danmust1. endwith ("}") to detect whether the last character in the target bullet screen data in bullet screen data object danmust 1 is "}".
Specifically, after the first character verification function is called, if it is detected that the first character in the target bullet screen data is not the preset start character, it indicates that the first character verification fails, that is, the target bullet screen data is incomplete data, that is, unqualified data, and at this time, it may be directly determined that the target bullet screen data has failed in verification. If the first character in the target bullet screen data is detected to be a preset start character, the first character is successfully verified, at this moment, a second character verification function can be called, whether the last character in the target bullet screen data is a preset end character or not is detected, if not, the target bullet screen data is incomplete data, and at this moment, the target bullet screen data can be directly determined to be failed in verification; if so, the last character is successfully verified, namely the first character and the last character in the target bullet screen data are legal, and at the moment, a character string conversion function in a bullet screen data object for storing the target bullet screen data can be called so as to continuously execute subsequent verification operation.
In this embodiment, before calling a character string conversion function in a bullet screen data object storing target bullet screen data, character verification can be performed on a first character and a last character in the target bullet screen data respectively by calling a first character verification function and a second character verification function in the bullet screen data object, and when the first character verification fails or the last character verification fails, it can be directly determined that the target bullet screen data fails to be verified; after the first character and the last character are successfully verified, subsequent verification operation is performed, so that the strictness of target bullet screen data verification is improved, and the target bullet screen data is more complete.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a bullet screen checking apparatus based on a linked list mode according to a third embodiment of the present invention, where this embodiment is applicable to a case of performing integrity check on bullet screen data of a preset character string nesting structure, and the apparatus may specifically include: the system comprises a target bullet screen data acquisition module 310, a character quantity determination module 320, a bullet screen data to be tested determination module 330 and a target bullet screen data verification module 340.
The target bullet screen data acquiring module 310 is configured to acquire target bullet screen data of a preset character string nesting structure, where the preset character string nesting structure includes at least two preset start symbols and at least two preset end symbols; the character number determining module 320 is configured to call a character string conversion function in a bullet screen data object storing target bullet screen data, convert the target bullet screen data into a first character array, traverse character elements in the first character array, and determine the number of preset start symbols and the number of preset end symbols in the target bullet screen data; the bullet screen data to be tested determining module 330 is configured to remove each preset start symbol and each preset end symbol in the first character array based on a character removing manner of the linked list structure if the number of the preset start symbols is equal to the number of the preset end symbols, and obtain bullet screen data to be tested; the target bullet screen data verification module 340 calls an identifier determination function in the bullet screen object to be tested, which stores the bullet screen data to be tested, determines the number of preset identifiers in the bullet screen data to be tested, and determines that the verification of the target bullet screen data is successful when the number of the preset identifiers meets preset verification conditions.
Optionally, the bullet screen data determining module 330 to be tested includes:
the first character chain table determining unit is used for converting the first character array into a first character chain table;
the second character linked list determining unit is used for traversing each node in the first character linked list, deleting each preset start symbol and each node corresponding to each preset end symbol in the first character linked list, and obtaining a second character linked list;
and the bullet screen data determining unit to be tested is used for converting the second character linked list into a second character array and converting the second character array into a character string to be tested, and the character string to be tested is used as bullet screen data to be tested.
Optionally, the second character linked list determining unit is specifically configured to: taking the first character linked list as a current first character linked list, taking a head node in the first character linked list as a current node, and taking a node pointer in the head node as a current pointer; detecting whether node data in a next node pointed by the current pointer is a preset start symbol or a preset end symbol; if so, pointing the current pointer to a node pointed by the node pointer in the next node to update the current first character linked list; if not, taking the node pointer in the next node as the current pointer to update the current pointer, and taking the next node as the current node to update the current node; if the current node is the last node in the current first character linked list, determining the current first character linked list as a second character linked list; and if the current node is not the last node in the current first character linked list, returning to execute the operation of detecting whether the node data in the next node pointed by the current pointer is the preset start symbol or the preset end symbol.
Optionally, the preset character string nesting structure further includes: a first preset identifier, a second preset identifier, and at least one layer of nesting formed by a preset number of preset string structures; wherein, the preset character string structure is as follows: and taking a preset start character as a first character, dividing each key value pair information by using a first preset identifier, connecting the key information and the value information in the key value pair information by using a second preset identifier, and taking a preset end character as a last character.
Optionally, the target barrage data checking module 340 further includes: the identifier determination function execution unit is used for realizing the function of determining the number of preset identifiers in the bullet screen data to be detected through the following steps:
calling a character string segmentation function in a to-be-detected data object storing to-be-detected bullet screen data, segmenting the to-be-detected bullet screen data by using a first preset identifier, and determining a character string array; determining the number of first preset identifiers in the bullet screen data to be detected according to the array length of the character string array; and storing each character string element in the character string array into a corresponding character string object, calling an identifier search function in each character string object, and determining the number of second preset identifiers in the bullet screen data to be detected.
Optionally, the target barrage data checking module 340 further includes:
a difference determining unit, configured to determine a difference between the first preset identifier number and the second preset identifier number;
and the target bullet screen data verification unit is used for determining that the target bullet screen data are successfully verified if the difference value is equal to the preset number.
Optionally, the apparatus further comprises:
the first character verification module is used for calling a first character verification function in the bullet screen data object before calling a character string conversion function in the bullet screen data object for storing the target bullet screen data, and detecting whether the first character in the target bullet screen data is a preset start character or not;
the last character checking module is used for calling a second character verification function in the bullet screen data object if the first character is a preset start character, and detecting whether the last character in the target bullet screen data is a preset end character or not;
accordingly, the character number determination module 320 is further configured to: and if the last character is a preset end character, calling a character string conversion function in the bullet screen data object for storing the target bullet screen data.
The linked list mode-based bullet screen verification device provided by the embodiment of the invention can execute the linked list mode-based bullet screen verification method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the linked list mode-based bullet screen verification method.
Example four
Fig. 4 is a schematic structural diagram of a terminal according to a fourth embodiment of the present invention. Referring to fig. 4, the terminal includes:
one or more processors 410;
a memory 420 for storing one or more programs;
when executed by the one or more processors 410, the one or more programs enable the one or more processors 410 to implement the bullet screen checking method based on the linked list approach as set forth in any of the embodiments above.
In FIG. 4, a processor 410 is illustrated as an example; the processor 410 and the memory 420 in the terminal may be connected by a bus or other means, as exemplified by the bus connection in fig. 4.
The memory 420 serves as a computer-readable storage medium, and may be used to store software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the linked list based bullet screen checking method in the embodiment of the present invention (for example, the target bullet screen data obtaining module 310, the character number determining module 320, the bullet screen data to be detected determining module 330, and the target bullet screen data checking module 340 in the linked list based bullet screen checking device). The processor 410 executes various functional applications and data processing of the terminal by operating software programs, instructions and modules stored in the memory 420, that is, the bullet screen checking method based on the linked list mode is implemented.
The memory 420 mainly includes a program storage area and a data storage area, wherein the program storage area can store an operating system and an application program required by at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 420 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 420 may further include memory located remotely from the processor 410, which may be connected to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The terminal provided by this embodiment and the bullet screen checking method based on the linked list mode provided by the above embodiment belong to the same inventive concept, and the technical details that are not described in detail in this embodiment may be referred to the above embodiment.
EXAMPLE five
The fifth embodiment provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the bullet screen checking method based on a linked list manner according to any embodiment of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, where the computer software product may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) to execute the linked list based bullet screen checking method provided in the embodiments of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A bullet screen checking method based on a linked list mode is characterized by comprising the following steps:
acquiring target bullet screen data of a preset character string nested structure, wherein the preset character string nested structure comprises at least two preset start symbols and at least two preset end symbols;
calling a character string conversion function in a bullet screen data object for storing the target bullet screen data, converting the target bullet screen data into a first character array, traversing character elements in the first character array, and determining the number of preset start symbols and the number of preset end symbols in the target bullet screen data;
if the number of the preset start symbols is equal to the number of the preset end symbols, removing each preset start symbol and each preset end symbol in the first character array based on a character removing mode of a linked list structure to obtain bullet screen data to be detected;
calling an identifier determining function in the bullet screen object to be tested for storing the bullet screen data to be tested, determining the number of preset identifiers in the bullet screen data to be tested, and determining that the target bullet screen data is successfully verified when the number of the preset identifiers meets preset verification conditions.
2. The method of claim 1, wherein removing each of the preset start symbols and each of the preset end symbols in the first character array based on a character removal manner of a linked list structure to obtain bullet screen data to be tested comprises:
converting the first character array into a first character linked list;
traversing each node in the first character chain table, deleting each preset start symbol and each node corresponding to each preset end symbol in the first character chain table, and obtaining a second character chain table;
and converting the second character chain table into a second character array, and converting the second character array into a character string to be tested as bullet screen data to be tested.
3. The method of claim 2, wherein traversing each node in the first character chain table, deleting each preset start symbol and each node corresponding to each preset end symbol in the first character chain table, and obtaining a second character chain table comprises:
taking the first character linked list as a current first character linked list, taking a head node in the first character linked list as a current node, and taking a node pointer in the head node as a current pointer;
detecting whether node data in a next node pointed by the current pointer is the preset start symbol or the preset end symbol;
if so, pointing the current pointer to a node pointed by the node pointer in the next node to update the current first character linked list;
if not, taking the node pointer in the next node as the current pointer to update the current pointer, and taking the next node as the current node to update the current node;
if the current node is the last node in the current first character linked list, determining the current first character linked list as a second character linked list;
and if the current node is not the last node in the current first character linked list, returning to execute the operation of detecting whether the node data in the next node pointed by the current pointer is the preset start symbol or the preset end symbol.
4. The method of claim 1, wherein the predetermined string nesting structure further comprises: a first preset identifier, a second preset identifier, and at least one layer of nesting formed by a preset number of preset string structures;
wherein, the preset character string structure is as follows: and taking the preset start character as a first character, dividing each key value pair information by the first preset identifier, connecting the key information and the value information in the key value pair information by the second preset identifier, and taking the preset end character as a last character.
5. The method according to claim 4, wherein the identifier determination function implements the function of determining the number of preset identifiers in the bullet screen data to be tested by:
calling a character string segmentation function in a to-be-detected data object storing the to-be-detected bullet screen data, segmenting the to-be-detected bullet screen data by the first preset identifier, and determining a character string array;
determining the number of first preset identifiers in the bullet screen data to be detected according to the array length of the character string array;
and storing each character string element in the character string array into a corresponding character string object, calling an identifier search function in each character string object, and determining the number of second preset identifiers in the bullet screen data to be detected.
6. The method of claim 5, wherein determining that the target bullet screen data is successfully verified when the number of the preset identifiers meets a preset verification condition comprises:
determining a difference value between the first preset identifier number and the second preset identifier number;
and if the difference is equal to the preset number, determining that the target bullet screen data is successfully verified.
7. The method of claim 4, prior to invoking the string conversion function in the bullet screen data object storing the target bullet screen data, further comprising:
calling a first character verification function in the bullet screen data object, and detecting whether a first character in the target bullet screen data is the preset start character or not;
if the first character is the preset start character, calling a second character verification function in the bullet screen data object, and detecting whether a last character in the target bullet screen data is the preset end character;
correspondingly, calling a character string conversion function in the bullet screen data object for storing the target bullet screen data comprises the following steps:
and if the last character is the preset end character, calling a character string conversion function in the bullet screen data object for storing the target bullet screen data.
8. The utility model provides a bullet curtain verifying attachment based on linked list mode which characterized in that includes:
the system comprises a target bullet screen data acquisition module, a target bullet screen data acquisition module and a target bullet screen data acquisition module, wherein the target bullet screen data acquisition module is used for acquiring target bullet screen data of a preset character string nested structure, and the preset character string nested structure comprises at least two preset start symbols and at least two preset end symbols;
the character quantity determining module is used for calling a character string conversion function in a bullet screen data object for storing the target bullet screen data, converting the target bullet screen data into a first character array, traversing character elements in the first character array, and determining the quantity of preset start characters and the quantity of preset end characters in the target bullet screen data;
the bullet screen data to be detected determining module is used for removing each preset start symbol and each preset end symbol in the first character array based on a character removing mode of a linked list structure to obtain bullet screen data to be detected if the number of the preset start symbols is equal to the number of the preset end symbols;
and the target bullet screen data verification module calls an identifier determination function in the bullet screen object to be detected for storing the bullet screen data to be detected, determines the number of preset identifiers in the bullet screen data to be detected, and determines that the target bullet screen data is successfully verified when the number of the preset identifiers meets preset verification conditions.
9. A terminal, characterized in that the terminal comprises:
one or more processors;
a memory for storing one or more programs;
the linked list based bullet screen checking method according to any one of claims 1-7 is implemented when said processor executes said program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the linked list based bullet screen checking method according to any one of claims 1 to 7.
CN201811160426.8A 2018-09-30 2018-09-30 Bullet screen checking method and device based on linked list mode, terminal and storage medium Active CN109379640B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811160426.8A CN109379640B (en) 2018-09-30 2018-09-30 Bullet screen checking method and device based on linked list mode, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811160426.8A CN109379640B (en) 2018-09-30 2018-09-30 Bullet screen checking method and device based on linked list mode, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN109379640A CN109379640A (en) 2019-02-22
CN109379640B true CN109379640B (en) 2021-04-27

Family

ID=65402808

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811160426.8A Active CN109379640B (en) 2018-09-30 2018-09-30 Bullet screen checking method and device based on linked list mode, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN109379640B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111552513B (en) * 2020-04-30 2024-04-16 中国银行股份有限公司 Character set replacement method and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011035944A1 (en) * 2009-09-25 2011-03-31 International Business Machines Corporation Managing application state information by means of a uniform resource identifier (uri)
RU111938U1 (en) * 2011-03-16 2011-12-27 Общество с ограниченной ответственностью "Научно-производственная компания "СПЕЦОБОРУДОВАНИЕ" RADIO CHANNEL SECURITY COMPLEX
CN105939485A (en) * 2016-06-27 2016-09-14 武汉斗鱼网络科技有限公司 System and method for monitoring bullet screen service availability based on user bullet screen behaviors
CN106973332A (en) * 2017-03-10 2017-07-21 武汉斗鱼网络科技有限公司 A kind of barrage message treatment method, analytic method and system
CN107135429A (en) * 2017-05-12 2017-09-05 武汉斗鱼网络科技有限公司 Barrage message resolution method, device and electronic equipment
CN107465738A (en) * 2017-08-01 2017-12-12 深圳市金立通信设备有限公司 A kind of communication means, server and computer-readable recording medium
CN107920283A (en) * 2017-11-20 2018-04-17 深圳市亿联智能有限公司 A kind of method that real-time barrage is realized by network service

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10708215B2 (en) * 2016-02-26 2020-07-07 Shanghai Hode Information Technology Co., Ltd. Method and apparatus for displaying comment information

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011035944A1 (en) * 2009-09-25 2011-03-31 International Business Machines Corporation Managing application state information by means of a uniform resource identifier (uri)
RU111938U1 (en) * 2011-03-16 2011-12-27 Общество с ограниченной ответственностью "Научно-производственная компания "СПЕЦОБОРУДОВАНИЕ" RADIO CHANNEL SECURITY COMPLEX
CN105939485A (en) * 2016-06-27 2016-09-14 武汉斗鱼网络科技有限公司 System and method for monitoring bullet screen service availability based on user bullet screen behaviors
CN106973332A (en) * 2017-03-10 2017-07-21 武汉斗鱼网络科技有限公司 A kind of barrage message treatment method, analytic method and system
CN107135429A (en) * 2017-05-12 2017-09-05 武汉斗鱼网络科技有限公司 Barrage message resolution method, device and electronic equipment
CN107465738A (en) * 2017-08-01 2017-12-12 深圳市金立通信设备有限公司 A kind of communication means, server and computer-readable recording medium
CN107920283A (en) * 2017-11-20 2018-04-17 深圳市亿联智能有限公司 A kind of method that real-time barrage is realized by network service

Also Published As

Publication number Publication date
CN109379640A (en) 2019-02-22

Similar Documents

Publication Publication Date Title
US11614990B2 (en) Automatic correlation of dynamic system events within computing devices
CN109345388B (en) Block chain intelligent contract verification method and device and storage medium
US20190197174A1 (en) Method and system for replicating data to heterogeneous database and detecting synchronization error of heterogeneous database through sql packet analysis
CN108694320B (en) Method and system for measuring sensitive application dynamic under multiple security environments
CN108459954B (en) Application program vulnerability detection method and device
CN110287696B (en) Detection method, device and equipment for rebound shell process
CN112100071B (en) Test case generation method and device, computer equipment and storage medium
CN109299719B (en) Bullet screen checking method and device based on character segmentation, terminal and storage medium
CN113946546B (en) Abnormality detection method, computer storage medium, and program product
CN113342500B (en) Task execution method, device, equipment and storage medium
CN112434288A (en) Internet of things-based network big data information leakage prevention method and system
CN109379640B (en) Bullet screen checking method and device based on linked list mode, terminal and storage medium
CN114756872A (en) Injection type taint data tracking method and device based on GO language and electronic device
CN109413450B (en) Bullet screen data integrity verification method and device, terminal and storage medium
CN113259449A (en) Distributed storage method, device, equipment and storage medium
CN109348304B (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
CN109413451B (en) Bullet screen data verification method and device and terminal
CN109413504B (en) Bullet screen checking method, device, terminal and storage medium based on character string replacement
CN109413452B (en) Bullet screen checking method and device based on different modes, terminal and storage medium
CN109413506B (en) Bullet screen data verification method and device, terminal and storage medium
CN109413505B (en) Bullet screen data verification method and device, terminal and storage medium
CN111736848B (en) Packet conflict positioning method, device, electronic equipment and readable storage medium
US12124326B2 (en) Automatic correlation of dynamic system events within computing devices
CN117609558A (en) Method, system, terminal and medium for improving depth-first search performance

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