CN112287097A - Markup language text analysis method and device, storage medium and electronic equipment - Google Patents

Markup language text analysis method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN112287097A
CN112287097A CN201910678876.4A CN201910678876A CN112287097A CN 112287097 A CN112287097 A CN 112287097A CN 201910678876 A CN201910678876 A CN 201910678876A CN 112287097 A CN112287097 A CN 112287097A
Authority
CN
China
Prior art keywords
markup language
text
type data
language text
digital content
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
CN201910678876.4A
Other languages
Chinese (zh)
Other versions
CN112287097B (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910678876.4A priority Critical patent/CN112287097B/en
Publication of CN112287097A publication Critical patent/CN112287097A/en
Application granted granted Critical
Publication of CN112287097B publication Critical patent/CN112287097B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/34Browsing; Visualisation therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Document Processing Apparatus (AREA)
  • Machine Translation (AREA)

Abstract

The present disclosure provides a markup language text parsing method and apparatus, an electronic device, and a storage medium; relates to the technical field of computers. The text parsing method comprises the following steps: acquiring a markup language text, and analyzing digital content in the markup language text into corresponding text type data; when an application request aiming at any digital content is received, the text type data corresponding to the digital content is analyzed into corresponding digital type data. The method and the device can improve the efficiency of text parsing of the markup language and save computer resources.

Description

Markup language text analysis method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a markup language text parsing method, a markup language text parsing apparatus, an electronic device, and a computer-readable storage medium.
Background
The markup language text is a data transmission format text in the network, and the parser can parse the markup language text and display the obtained parsed data to the user. Parsing the digital content in the markup language text into digital type data in the in-memory data structure is very resource consuming. In the related art, when the digital content in the markup language text is parsed into the digital type data, the parsing efficiency is low, and computer resources are wasted.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The present disclosure is directed to a markup language text parsing method, a markup language text parsing apparatus, an electronic device, and a computer-readable storage medium, so as to overcome the problems of low markup language text parsing efficiency and waste of computer resources in the related art to some extent.
According to a first aspect of the present disclosure, there is provided a markup language text parsing method, including:
acquiring a markup language text, and analyzing digital content in the markup language text into corresponding text type data;
when an application request aiming at any digital content is received, the text type data corresponding to the digital content is analyzed into corresponding digital type data.
In an exemplary embodiment of the present disclosure, the parsing the digital content in the markup language text into corresponding text type data includes:
and analyzing the numerical values in the markup language text into corresponding text type data.
In an exemplary embodiment of the present disclosure, the parsing the digital content in the markup language text into corresponding text type data includes:
when the markup language text contains array type data, aiming at the element containing the digital content in the array type data, the digital content in the element is analyzed into corresponding text type data.
In an exemplary embodiment of the present disclosure, the parsing the digital content in the markup language text into corresponding text type data includes:
when the markup language text contains object type data and each element in the object type text contains a digital text, analyzing the digital text in each element into corresponding text type data and analyzing the digital content in the element into corresponding text type data.
In an exemplary embodiment of the present disclosure, after the obtaining the markup language text, the method further comprises:
analyzing the empty content in the markup language text into corresponding empty type data;
analyzing Boolean content in the markup language text into corresponding Boolean type data;
and analyzing the character string content in the markup language text into corresponding character string type data.
In an exemplary embodiment of the present disclosure, the markup language text parsing method further includes:
after parsing the markup language text, displaying the resulting parsed data to a user.
In an exemplary embodiment of the present disclosure, the markup language text includes: JavaScript object markup language text, extensible markup language text, or hypertext markup language text.
According to a second aspect of the present disclosure, there is provided a markup language text parsing apparatus comprising:
the text type data analysis module is used for acquiring a markup language text and analyzing the digital content in the markup language text into corresponding text type data;
and the digital type data analysis module is used for analyzing the text type data corresponding to the digital content into corresponding digital type data when receiving an application request aiming at any digital content.
In an exemplary embodiment of the disclosure, the text type data parsing module is specifically configured to parse a numerical value in the markup language text into corresponding text type data.
In an exemplary embodiment of the present disclosure, the text type data parsing module includes:
and the array type data analysis unit is used for analyzing the digital content in the element into corresponding text type data aiming at the element containing the digital content in the array type data when the markup language text contains the array type data.
In an exemplary embodiment of the present disclosure, the text type data parsing module includes:
and the object type data analysis unit is used for analyzing the digital text in each element into corresponding text type data and analyzing the digital content in the element into corresponding text type data for the element containing the digital content in the object type data when the markup language text contains the object type data and each element in the object type text contains the digital text.
In an exemplary embodiment of the present disclosure, the markup language text apparatus further includes:
the empty content analysis module is used for analyzing the empty content in the markup language text into corresponding empty type data;
the Boolean content analysis module is used for analyzing the Boolean content in the markup language text into corresponding Boolean type data;
and the character string content analysis module is used for analyzing the character string content in the markup language text into corresponding character string type data.
In an exemplary embodiment of the present disclosure, the markup language text parsing apparatus further includes:
and the analysis data display module is used for displaying the obtained analysis data to a user after the markup language text is analyzed.
In an exemplary embodiment of the present disclosure, the markup language text includes: JavaScript object markup language text, extensible markup language text, or hypertext markup language text.
According to a third aspect of the present disclosure, there is provided an electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the method of any one of the above via execution of the executable instructions.
According to a fourth aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of any one of the above.
Exemplary embodiments of the present disclosure may have some or all of the following benefits:
in the text parsing method provided by an example embodiment of the present disclosure, instead of immediately parsing the digital content into the digital type data in the in-memory data structure, the digital content in the markup language text may be parsed into the corresponding text type data. When an application request for any digital content is received, namely, when the digital content is used, the text type data corresponding to the digital content is analyzed into the corresponding digital type data, namely, the text type data is analyzed when the digital content is used. Because a large amount of time and computer resources are consumed when the digital content is analyzed into the digital type data in the memory data structure, when part of the digital content is used, the digital content to be used can be only analyzed into the digital type data, so that the efficiency of analyzing the markup language text is improved on one hand, and the digital content to be used is quickly obtained; on the other hand, computer resources are saved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty.
FIG. 1 is a schematic diagram illustrating an exemplary system architecture of an application environment to which a markup language text parsing method and apparatus of an embodiment of the present disclosure may be applied;
FIG. 2 is a structural diagram before and after parsing a JavaScript object markup language text in the related art;
FIG. 3 is a flowchart of a markup language text parsing method according to an embodiment of the present disclosure;
FIG. 4 is a flowchart of a markup language text parsing method according to an embodiment of the present disclosure;
FIG. 5 is a structural diagram of a JavaScript object markup language text before and after parsing in an embodiment of the present disclosure;
FIG. 6 is a flowchart illustrating parsing of tuple type data in a markup language text according to an embodiment of the present disclosure;
FIG. 7 is a schematic diagram of an application scenario of markup language text parsing in an embodiment of the present disclosure;
FIG. 8 is a structural diagram of a JavaScript object markup language text before and after parsing during use in an embodiment of the present disclosure;
FIG. 9 is a block diagram of a markup language text parsing apparatus according to an embodiment of the present disclosure;
FIG. 10 illustrates a schematic structural diagram of a computer system suitable for use in implementing an electronic device of an embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
Fig. 1 is a schematic diagram illustrating a system architecture of an exemplary application environment to which a markup language text parsing method and apparatus according to an embodiment of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include one or more of terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few. The terminal devices 101, 102, 103 may be various electronic devices having a display screen, including but not limited to desktop computers, portable computers, smart phones, tablet computers, and the like. It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. For example, server 105 may be a server cluster comprised of multiple servers, or the like.
The markup language text parsing method provided by the embodiment of the present disclosure is generally executed by the server 105, and accordingly, a markup language text parsing apparatus is generally disposed in the server 105. However, it is easily understood by those skilled in the art that the markup language text parsing method provided in the embodiment of the present disclosure may also be executed by the terminal devices 101, 102, and 103, and accordingly, the markup language text parsing apparatus may also be disposed in the terminal devices 101, 102, and 103, which is not particularly limited in this exemplary embodiment. For example, in an exemplary embodiment, the user may upload the markup language text to the server 105 through the terminal devices 101, 102, 103, and the server parses the markup language text by using the markup language text parsing method provided by the embodiment of the present disclosure, and displays the resulting parsed data to the terminal devices 101, 102, 103, and the like.
In the related art, when the markup language text is analyzed, the digital content is analyzed into the digital type in the memory data structure when encountering the digital content in the markup language text, and the structure before and after the JavaScript object markup language text is analyzed can be referred to fig. 2. In a very large number of scenes, only part of the digital content in the markup language text needs to be used, so that the analysis efficiency is low and computer resources are wasted when all the digital content in the markup language text is analyzed. In order to solve the problem, embodiments of the present disclosure provide a markup language text parsing method, a markup language text parsing apparatus, an electronic device, and a computer-readable storage medium, so as to improve efficiency of markup language text parsing and save computer resources. The execution subject of the markup language text parsing method of the embodiment of the present disclosure may be the server 105, and the following details the technical solution of the embodiment of the present disclosure:
as shown in fig. 3, fig. 3 is a flowchart of a markup language text parsing method according to an embodiment of the present disclosure, including the following steps:
s310, acquiring a markup language text, and analyzing the digital content in the markup language text into corresponding text type data.
S320, when receiving an application request for any digital content, parsing the text type data corresponding to the digital content into corresponding digital type data.
The markup language text parsing method of the embodiment of the disclosure can parse the digital content in the markup language text into the corresponding text type data, rather than immediately parsing the digital content into the digital type data in the memory data structure. When an application request aiming at any digital content is received, namely the digital content is used, the text type data corresponding to the digital content is analyzed into the corresponding digital type data, namely the digital content is analyzed when being used. Because a large amount of time and computer resources are consumed when the digital content is analyzed into the digital type data in the memory data structure, when part of the digital content is used, the digital content to be used can be only analyzed into the digital type data, the efficiency of analyzing the markup language text is improved, and the digital content to be used can be quickly obtained. And computer resources are saved.
As shown in fig. 4, fig. 4 is a flowchart of a markup language text parsing method according to an embodiment of the present disclosure, including the following steps:
s410, acquiring a markup language text.
In the disclosed embodiment, the markup language is a computer word code that combines text and other information related to the text to reveal details about the structure of the document and the processing of the data. A markup language is a language that annotates text so that a computer can manipulate the text. The markup language text may be one file, and different markup language texts may correspond to different files. The markup language text includes: JavaScript object markup language text, extensible markup language text, hypertext markup language text, and the like. For example, JavaScript object markup language text can be a JSON file, extensible markup language text can be an xml file, hypertext markup language text can be an html file, and so on.
S420, analyzing the digital content in the markup language text into corresponding text type data.
The digital content in the markup language text refers to the content representing the number in the markup language text, and a lot of time and computer resources are consumed when the digital content is analyzed into the digital type data in the memory data structure, so that the digital content can be analyzed into the corresponding text type data. Text type data refers to the existence of text type in the memory data structure, and the digital content in the text type data cannot be directly used. Therefore, when the markup language text containing more digital contents is analyzed, the efficiency of analyzing the markup language text can be improved, and computer resources, such as central processing unit resources, can be saved.
The JavaScript object markup language text is exemplified here, but it is needless to say that the JavaScript object markup language text is applicable to other markup languages such as an extensible markup language text and a hypertext markup language text. Data in the JavaScript object markup language text exists in a key value pair (key: value), wherein a colon in the key value pair indicates that the latter is the former value, that is, the value indicates the value of the key, and the type of the value can be any one of the following data types: numbers (integer or floating point), logical values (true or false), strings, arrays, objects, NULLs, etc. For digital content, the type of value is a number. For example, the digital content in the JavaScript object markup language text includes: { "number": 12345.1234}, the digital content can be parsed into text type data number:12345.1234, see fig. 5.
In an exemplary embodiment of the present disclosure, the numeric values in the markup language text may be parsed into corresponding text type data. In the process of analyzing the markup language text, for the digital content in the markup language text, firstly, the correctness of the digital content can be judged, that is, whether the digital content is a correct numerical value is judged, and if so, the numerical value is analyzed into corresponding text type data. If not, it means that the digital content is not a numeric value, for example, if the digital content is "number": 123.123.123, then the digital content is not a numeric value, the digital content may be a character string, and the digital content may not be parsed into corresponding text type data. Therefore, the correctness of the digital content analysis in the markup language text can be ensured. The method for determining the digital content may specifically be that each character in the character string is determined cyclically, whether the character is a number is determined, and whether the symbol in the character string is a symbol included in a correct numerical value (for example, a negative sign, a decimal point, and the like) is determined.
In an exemplary embodiment of the present disclosure, when the markup language text includes array type data, for an element including digital content in the array type data, the digital content in the element is parsed into corresponding text type data.
As mentioned above, the type of the value of the data in the JavaScript object markup language text includes an array, and the element in the array type data may also contain numerical content. Thus, for array type data, each element in the array type data may be traversed in a loop, and for each element, if digital content is contained, the digital content in the element may be parsed into corresponding text type data. Referring specifically to fig. 6, the method includes the following steps:
s610, set i to 1.
S620, judging whether the ith element in the array contains digital content. If so, go to S630; if not, S640 is performed.
S630, resolving the digital content in the ith element into corresponding text type data.
And S640, judging whether the ith element is the last element. If so, the flow ends, and if not, S650 is performed.
S650, i ═ i + 1. And adding 1 to the value of i to obtain the ith element in the array as the next element, returning to the step S620, and repeatedly executing the steps.
Thus, each element in the array type data may be traversed through the various steps in FIG. 6 to parse the digital content in the element containing the digital content into corresponding text type data.
In an exemplary embodiment of the present disclosure, when the markup language text includes the object type data and each element in the object type text includes the digital text, parsing the digital text in each element into the corresponding text type data parses the digital content in the element into the corresponding text type data for the element including the digital content in the object type data.
Similarly, the type of the value of the data in the JavaScript object markup language text may also include an object, and for an element in the object type data, the numeric content may also be included. Thus, for object type data, each element in the object type data may be traversed in a loop, and for each element, if digital content is contained, the digital content in the element may be parsed into corresponding text type data. For the object type data, since the object type data is similar to the array type data, the object type data is not described in detail in a flow chart manner, and a flow chart corresponding to the array type data, that is, fig. 6, may be specifically referred to.
It can be seen that in parsing the markup language text, when the digital content is encountered, the digital content can be parsed into the corresponding text type data, i.e., all the digital content in the markup language text can be parsed into the corresponding text type data. Therefore, the analysis efficiency can be improved, and the computer resources can be saved.
S430, analyzing the empty content in the markup language text into corresponding empty type data.
Specifically, the empty content in the markup language text is NULL, for example, for JavaScript object markup language text, the type of the value in the key value pair is NULL. NULL type data can be parsed directly for NULLs in the markup language text.
S440, resolving Boolean content in the markup language text into corresponding Boolean type data.
In computer science, boolean content is a content with only two values, including: non-zero (typically 1 or-1) and zero, which may be equivalent to true and false, respectively. The present disclosure may parse boolean content into corresponding boolean type data.
S450, analyzing the character string content in the markup language text into corresponding character string type data.
Like character strings in other computer languages (e.g., C language), the character strings in the markup language text in the embodiments of the present disclosure may be a string of characters consisting of numbers, letters, and underlines. For example, the string content may be "name": zhang. The present disclosure may parse string content in the markup language text into corresponding string type data.
The parsing method of the non-digital content in the markup language text is the same as that of the related art, and will not be described in detail here.
And S460, after the markup language text is analyzed, displaying the obtained analysis data to a user.
In the embodiment of the present disclosure, the markup language text may include a plurality of types, for example, the type of the markup language text may be a video type, a news type, an article type, or the like. After the markup language text is analyzed, analysis data can be obtained, and the text type data corresponding to the digital content, the character string type data corresponding to the character string content, and the like are both analysis data. The parsed data is data that can be displayed to a user for viewing, and the parsed data can be displayed to the user, for example, parsed data corresponding to a video type markup language text can be displayed to the user, and parsed data corresponding to a news type markup language text can be displayed to the user. Referring to fig. 7, the various parsed data may be filtered and combined and then displayed to the user, and the user may browse relevant information in the terminal device.
S470, when receiving an application request for any digital content, parsing the text type data corresponding to the digital content into corresponding digital type data.
Typically, the digital content is not used when the parsed data is displayed for the user. Therefore, the digital content is not parsed into the digital type data in the parsing process of S420. In some scenarios, the digital content in the markup language text may be used, for example, the markup language text includes a plurality of behavior habits of the user, for example, how many times the user opens the web page, how many times the user sends the message, and the like, and if it is determined how many times the user sends the message, the digital content corresponding to the number of times the message is sent in the markup language text may be parsed, that is, the text type data corresponding to the number of times the message has been parsed in S420 is parsed, so as to obtain the corresponding digital type data. In this way, the server can determine the number of times the user sent the message based on the numeric type data. Of course, other behaviors of the user, such as how many times the user has opened a web page, may also be resolved at the time of use to conserve computer resources. Here, as for the number 12345.1234 of the text type data parsed in S420, in this step, the number 12345.1234 of the text type data is parsed into the number 12345.1234 of the number type data, as shown in fig. 8.
The markup language parsing method of the embodiment of the disclosure is faster than RapidJSON by 30% and faster than CPPJSON by 90% when parsing the JavaScript object markup language text and only using part of digital content in the JavaScript object markup language text.
The markup language text parsing method of the embodiment of the disclosure can judge correctness of digital contents in the markup language text to ensure correctness of markup language text parsing. The digital content is parsed into corresponding text type data after the determination is correct, rather than immediately parsing the digital content into digital type data in an in-memory data structure. After parsing the markup language text, the resulting parsed data is displayed to the user. When an application request aiming at any digital content is received, namely the digital content is used, the text type data corresponding to the digital content is analyzed into the corresponding digital type data, namely the digital content is analyzed when being used. Because a large amount of time and computer resources are consumed when the digital content is analyzed into the digital type data in the memory data structure, when part of the digital content is used, the digital content to be used can be only analyzed into the digital type data, the efficiency of analyzing the markup language text is improved, and the digital content to be used can be quickly obtained. And computer resources are saved.
It should be noted that although the various steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that these steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Further, in the present exemplary embodiment, there is also provided a markup language text parsing apparatus 900, as shown in fig. 9, including:
a text type data analysis module 910, configured to obtain a markup language text, and analyze digital content in the markup language text into corresponding text type data;
the digital type data parsing module 920 is configured to parse text type data corresponding to any digital content into corresponding digital type data when an application request for the digital content is received.
In an exemplary embodiment of the disclosure, the text type data parsing module is specifically configured to parse a numerical value in the markup language text into corresponding text type data.
In an exemplary embodiment of the present disclosure, the text type data parsing module includes:
and the array type data analysis unit is used for analyzing the digital content in the element into corresponding text type data aiming at the element containing the digital content in the array type data when the markup language text contains the array type data.
In an exemplary embodiment of the present disclosure, the text type data parsing module includes:
and the object type data analysis unit is used for analyzing the digital text in each element into corresponding text type data and analyzing the digital content in the element into corresponding text type data for the element containing the digital content in the object type data when the markup language text contains the object type data and each element in the object type text contains the digital text.
In an exemplary embodiment of the present disclosure, the markup language text apparatus further includes:
the empty content analysis module is used for analyzing the empty content in the markup language text into corresponding empty type data;
the Boolean content analysis module is used for analyzing the Boolean content in the markup language text into corresponding Boolean type data;
and the character string content analysis module is used for analyzing the character string content in the markup language text into corresponding character string type data.
In an exemplary embodiment of the present disclosure, the markup language text parsing apparatus further includes:
and the analysis data display module is used for displaying the obtained analysis data to a user after the markup language text is analyzed.
In an exemplary embodiment of the present disclosure, the markup language text includes: JavaScript object markup language text, extensible markup language text, or hypertext markup language text.
The specific details of each module or unit in the markup language text parsing apparatus have been described in detail in the corresponding markup language text parsing method, and therefore are not described herein again.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
In an exemplary embodiment of the present disclosure, there is also provided an electronic device including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to perform all or part of the steps of the markup language text parsing method in the present exemplary embodiment.
Fig. 10 shows a schematic structural diagram of a computer system of an electronic device for implementing an embodiment of the present disclosure. It should be noted that the computer system 1000 of the electronic device shown in fig. 10 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 10, the computer system 1000 includes a Central Processing Unit (CPU)1001 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)1002 or a program loaded from a storage section 1008 into a Random Access Memory (RAM) 1003. In the RAM 1003, various programs and data necessary for system operation are also stored. The CPU 1001, ROM 1002, and RAM 1003 are connected to each other via a bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
The following components are connected to the I/O interface 1005: an input section 1006 including a keyboard, a mouse, and the like; an output section 1007 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 1008 including a hard disk and the like; and a communication section 1009 including a network interface card such as a Local Area Network (LAN) card, a modem, or the like. The communication section 1009 performs communication processing via a network such as the internet. The driver 1010 is also connected to the I/O interface 1005 as necessary. A removable medium 1011 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 1010 as necessary, so that a computer program read out therefrom is mounted into the storage section 1008 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication part 1009 and/or installed from the removable medium 1011. When the computer program is executed by a Central Processing Unit (CPU)1001, various functions defined in the apparatus of the present application are executed.
In an exemplary embodiment of the disclosure, there is also provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of any one of the above.
It should be noted that the computer readable storage medium shown in the present disclosure can be, for example but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer-readable signal medium may include a propagated data signal with computer-readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, radio frequency, etc., or any suitable combination of the foregoing.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A method for markup language text parsing, the method comprising:
acquiring a markup language text, and analyzing digital content in the markup language text into corresponding text type data;
when an application request aiming at any digital content is received, the text type data corresponding to the digital content is analyzed into corresponding digital type data.
2. The method of claim 1, wherein parsing the digital content in the markup language text into corresponding text type data comprises:
and analyzing the numerical values in the markup language text into corresponding text type data.
3. The method of claim 1, wherein parsing the digital content in the markup language text into corresponding text type data comprises:
when the markup language text contains array type data, aiming at the element containing the digital content in the array type data, the digital content in the element is analyzed into corresponding text type data.
4. The method of claim 1, wherein parsing the digital content in the markup language text into corresponding text type data comprises:
when the markup language text contains object type data and each element in the object type text contains a digital text, analyzing the digital text in each element into corresponding text type data and analyzing the digital content in the element into corresponding text type data.
5. The text parsing method of claim 1, wherein after the obtaining markup language text, the method further comprises:
analyzing the empty content in the markup language text into corresponding empty type data;
analyzing Boolean content in the markup language text into corresponding Boolean type data;
and analyzing the character string content in the markup language text into corresponding character string type data.
6. The method of claim 1, further comprising:
after parsing the markup language text, displaying the resulting parsed data to a user.
7. The method of claim 1, wherein the markup language text comprises: JavaScript object markup language text, extensible markup language text, or hypertext markup language text.
8. A markup language text parsing apparatus, the apparatus comprising:
the text type data analysis module is used for acquiring a markup language text and analyzing the digital content in the markup language text into corresponding text type data;
and the digital type data analysis module is used for analyzing the text type data corresponding to the digital content into corresponding digital type data when receiving an application request aiming at any digital content.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method of any one of claims 1 to 7.
10. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the method of any of claims 1-7 via execution of the executable instructions.
CN201910678876.4A 2019-07-25 2019-07-25 Method and device for analyzing markup language text, storage medium and electronic equipment Active CN112287097B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910678876.4A CN112287097B (en) 2019-07-25 2019-07-25 Method and device for analyzing markup language text, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910678876.4A CN112287097B (en) 2019-07-25 2019-07-25 Method and device for analyzing markup language text, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN112287097A true CN112287097A (en) 2021-01-29
CN112287097B CN112287097B (en) 2023-10-27

Family

ID=74419626

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910678876.4A Active CN112287097B (en) 2019-07-25 2019-07-25 Method and device for analyzing markup language text, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN112287097B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030046317A1 (en) * 2001-04-19 2003-03-06 Istvan Cseri Method and system for providing an XML binary format
US20080028340A1 (en) * 1999-05-21 2008-01-31 E-Numerate Solutions, Inc. Tree view for reusable data markup language
CN109445890A (en) * 2018-10-09 2019-03-08 北京达佳互联信息技术有限公司 A kind of method for showing interface, device, terminal device and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080028340A1 (en) * 1999-05-21 2008-01-31 E-Numerate Solutions, Inc. Tree view for reusable data markup language
US20030046317A1 (en) * 2001-04-19 2003-03-06 Istvan Cseri Method and system for providing an XML binary format
CN109445890A (en) * 2018-10-09 2019-03-08 北京达佳互联信息技术有限公司 A kind of method for showing interface, device, terminal device and storage medium

Also Published As

Publication number Publication date
CN112287097B (en) 2023-10-27

Similar Documents

Publication Publication Date Title
CN111274760B (en) Rich text data processing method and device, electronic equipment and computer storage medium
CN109522018B (en) Page processing method and device and storage medium
CN112684968A (en) Page display method and device, electronic equipment and computer readable medium
CN111314388B (en) Method and apparatus for detecting SQL injection
CN109325197B (en) Method and device for extracting information
CN113760729A (en) Code detection method and device
CN114218890A (en) Page rendering method and device, electronic equipment and storage medium
CN111600920B (en) JS-based data request proxy method, device, equipment and readable storage medium
CN109902726B (en) Resume information processing method and device
CN113836469A (en) Website front-end development method and equipment
CN113761871A (en) Rich text rendering method and device, electronic equipment and storage medium
CN111125605B (en) Page element acquisition method and device
CN116860286A (en) Page dynamic update method, device, electronic equipment and computer readable medium
CN116781586A (en) gRPC flow analysis method, device, equipment and medium
CN112287097B (en) Method and device for analyzing markup language text, storage medium and electronic equipment
CN108664511B (en) Method and device for acquiring webpage information
CN111783006B (en) Page generation method and device, electronic equipment and computer readable medium
CN112433752B (en) Page analysis method, device, medium and electronic equipment
CN113641359A (en) Data processing method and device
CN113138767A (en) Code language conversion method, device, electronic equipment and storage medium
CN112818267A (en) Data processing method and device, computer readable storage medium and electronic equipment
CN114428823B (en) Data linkage method, device, equipment and medium based on multidimensional variable expression
CN113760706B (en) Webpage debugging method and device
CN110968768B (en) Information generation method and device
CN115328324A (en) Method and device for inputting characters at mobile terminal

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