CN112287097B - Method and device for analyzing markup language text, storage medium and electronic equipment - Google Patents
Method and device for analyzing markup language text, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN112287097B CN112287097B CN201910678876.4A CN201910678876A CN112287097B CN 112287097 B CN112287097 B CN 112287097B CN 201910678876 A CN201910678876 A CN 201910678876A CN 112287097 B CN112287097 B CN 112287097B
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/34—Browsing; 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 disclosure provides a method and a device for analyzing a markup language text, electronic equipment 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; and when receiving an application request for any digital content, analyzing the text type data corresponding to the digital content into corresponding digital type data. The method and the device can improve the efficiency of the text analysis of the markup language and save computer resources.
Description
Technical Field
The present disclosure relates to the field of computer technology, 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. Wherein parsing digital content in markup language text into digital type data in a memory data structure is very resource consuming. In the related art, when digital contents in a markup language text are parsed into digital type data, the parsing efficiency is low, and computer resources are wasted.
It should be noted that the information disclosed in the above background section is only for enhancing 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 device, an electronic device, and a computer-readable storage medium, and thus, to overcome the problems of low markup language text parsing efficiency and waste of computer resources due to 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;
and when receiving an application request for any digital content, analyzing the text type data corresponding to the digital content into corresponding digital type data.
In an exemplary embodiment of the disclosure, the parsing the digital content in the markup language text into corresponding text type data includes:
and analyzing the numerical value in the markup language text into corresponding text type data.
In an exemplary embodiment of the disclosure, the parsing the digital content in the markup language text into corresponding text type data includes:
when the markup language text contains the array type data, aiming at the element containing the digital content in the array type data, analyzing the digital content in the element into the corresponding text type data.
In an exemplary embodiment of the disclosure, the parsing the digital content in the markup language text into corresponding text type data includes:
when the object type data is contained in the markup language text, and when each element in the object type text contains digital text, aiming at the element containing digital content in the object type data, 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 includes:
resolving empty content in the markup language text into corresponding empty type data;
analyzing the 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, the obtained parsed data is displayed to a user.
In one 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 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 present 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 to the corresponding text type data aiming at the element containing the digital content in the array type data when the array type data is contained in the markup language text.
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 aiming at the element containing the digital content in the object type data when the object type data is contained in the markup language text and each element in the object type text contains the digital text.
In an exemplary embodiment of the present disclosure, the markup language text device 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 analyzing the markup language text.
In one 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 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 advantages:
in the text parsing method provided in an exemplary embodiment of the present disclosure, instead of immediately parsing digital content into digital type data in a memory data structure, digital content in a markup language text may be parsed into corresponding text type data. When an application request for any digital content is received, that is, when the digital content is used, text type data corresponding to the digital content is parsed into corresponding digital type data, that is, is not parsed until the digital content is used. Because a great deal of time and computer resources are consumed when the digital content is analyzed into the digital type data in the memory data structure, when partial digital content is used, only the digital content to be used can be analyzed into the digital type data, so that on one hand, the efficiency of the analysis of the markup language text is improved, and the digital content to be used is obtained quickly; on the other hand, the 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 disclosure and together with the description, serve to explain the principles of the disclosure. It will be apparent to those of ordinary skill in the art that the drawings in the following description are merely examples of the disclosure and that other drawings may be derived from them without undue effort.
FIG. 1 illustrates a schematic diagram of a system architecture of an exemplary application environment in which a markup language text parsing method and apparatus of embodiments of the present disclosure may be applied;
FIG. 2 is a diagram of the structure before and after parsing the JavaScript object markup language text in the related art;
FIG. 3 is a flow chart of a markup language text parsing method of an embodiment of the present disclosure;
FIG. 4 is yet another flow chart of a markup language text parsing method of an embodiment of the present disclosure;
FIG. 5 is a block diagram of JavaScript object markup language text parsing before and after parsing in accordance with an embodiment of the disclosure;
FIG. 6 is a flow chart of parsing array 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 disclosure;
fig. 8 is a block diagram of JavaScript object notation language text before and after parsing in use in an embodiment of the disclosure;
FIG. 9 is a block diagram of a markup language text parsing apparatus according to an embodiment of the present disclosure;
fig. 10 shows a schematic diagram of a computer system suitable for use in implementing embodiments of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many 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 the 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 present disclosure. One skilled in the relevant art will recognize, however, that the aspects of the disclosure may be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. 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 a repetitive description thereof 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 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 illustrates a schematic diagram of a system architecture of an exemplary application environment in which a markup language text parsing method and apparatus of embodiments of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include one or more of the terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others. The terminal devices 101, 102, 103 may be various electronic devices with display screens 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, the server 105 may be a server cluster formed by a plurality of servers.
The markup language text parsing method provided by the embodiments of the present disclosure is generally executed by the server 105, and accordingly, the markup language text parsing apparatus is generally disposed in the server 105. However, it will be readily understood by those skilled in the art that the markup language text parsing method provided in the embodiment of the present disclosure may be performed by the terminal devices 101, 102, 103, and accordingly, the markup language text parsing apparatus may be provided in the terminal devices 101, 102, 103, which is not particularly limited in the present 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 through 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 so on.
In the related art, when parsing the markup language text, the digital content is parsed 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 parsing of the JavaScript object markup language text can be seen in fig. 2. In many situations, only a part of digital content in the markup language text is needed, so that all the digital content in the markup language text is analyzed, the analysis efficiency is low, and computer resources are wasted. In order to solve the problem, the embodiment of the disclosure provides a markup language text parsing method, a markup language text parsing device, an electronic device and a computer readable storage medium, so as to improve the efficiency of markup language text parsing and save computer resources. The execution body of the markup language text parsing method in the embodiment of the present disclosure may be the server 105, and the following details of the technical solution in the embodiment of the present disclosure are described below:
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 steps of:
s310, a markup language text is acquired, and digital content in the markup language text is analyzed into corresponding text type data.
S320, when receiving an application request for any digital content, analyzing the text type data corresponding to the digital content into corresponding digital type data.
The method for analyzing the markup language text can analyze the digital content in the markup language text into corresponding text type data instead of immediately analyzing the digital content into the digital type data in the memory data structure. When an application request for any digital content is received, that is, when the digital content is used, text type data corresponding to the digital content is parsed into corresponding digital type data, that is, when the digital content is used, the text type data is parsed. Because a great deal of time and computer resources are consumed when the digital content is parsed into the digital type data in the memory data structure, when partial digital content is used, the digital content to be used can be parsed into the digital type data only, the efficiency of the markup language text parsing is improved, and the digital content to be used can be obtained quickly. And, computer resources are saved.
As shown in fig. 4, fig. 4 is a further flowchart of a markup language text parsing method according to an embodiment of the present disclosure, including the steps of:
s410, obtaining the markup language text.
In the disclosed embodiment, a markup language is a computer literal code that combines text with other information related to the text, revealing details about the structure of the document and the data processing. The markup language is a language in which text is annotated so that a computer can manipulate the text. The markup language text may be a file, and the files corresponding to different markup language texts are different. The markup language text includes: javaScript object markup language text, extensible markup language text, hypertext markup language text, and the like. For example, the JavaScript object markup language text can be a JSON file, the extensible markup language text can be an xml file, the hypertext markup language text can be an html file, etc.
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 parsed into the digital type data in the memory data structure, so that the digital content can be parsed into the corresponding text type data. Text type data refers to the existence of text types in a memory data structure, and of course, digital contents in the text type data cannot be directly used. Thus, when the markup language text containing more digital content is analyzed, the efficiency of the markup language text analysis can be improved, and computer resources can be saved, for example, the resources of a central processing unit can be saved.
The JavaScript object notation text is taken as an example for illustration, and of course, other notation such as extensible notation text and hypertext notation text are applicable. The data in the JavaScript object notation language text exists in a key-value pair (key: value), wherein a colon in the key-value pair indicates that the latter is the value of the former, namely 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 numbers), logical values (true or false), strings, arrays, objects, NULL, etc. For digital content, the type of value is digital. For example, the digital content in JavaScript object notation language text includes: { "number":12345.1234}, the digital content can be parsed into text type data number 12345.1234, see FIG. 5.
In one exemplary embodiment of the present disclosure, values in the markup language text may be parsed into corresponding text type data. In the process of analyzing the markup language text, the correctness of the digital content can be judged for the digital content in the markup language text, namely, 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 indicates that the digital content is not a numerical value, e.g., if the digital content is "number" 123.123.123, then the digital content is not a numerical value, the digital content may be a string, and the digital content may not be parsed into corresponding text type data. Thus, the accuracy of the analysis of the digital content in the markup language text can be ensured. The method for determining the digital content may specifically be to perform a loop determination on each character in the character string, determine whether the character is a number, and determine whether a symbol in the character string is a symbol (for example, a negative sign, a decimal point, etc.) included in a correct numerical value.
In an exemplary embodiment of the present disclosure, when the array type data is included in the markup language text, 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 described above, the types of the values of the data in the JavaScript object markup language text include an array, and for the elements in the array type data, numerical content can also be included. Thus, for array type data, each element in the array type data may be looped through, and for each element, if digital content is included, the digital content in that element may be parsed into corresponding text type data. Referring specifically to fig. 6, the method comprises the following steps:
s610, i=1 is set.
S620, judging whether the ith element in the array contains digital content. If so, S630 is performed; if not, S640 is performed.
S630, the digital content in the ith element is analyzed into corresponding text type data.
S640, judging whether the ith element is the last element. If so, the flow ends, and if not, S650 is executed.
S650, i=i+1. By adding 1 to the value of i, the i-th element in the array is the next element, returning to S620, and repeating the above steps.
Thus, each element in the array type data can be traversed through the steps in fig. 6 to parse the digital content in the element containing the digital content into the corresponding text type data.
In one exemplary embodiment of the present disclosure, when object type data is included in the markup language text, and each element in the object type text includes digital text, for an element including digital content in the object type data, parsing the digital text in each element into corresponding text type data parses the digital content in the element into corresponding text type data.
Likewise, the type of the value of the data in the JavaScript object notation language text can also include an object, and for the element in the object type data, numerical content can also be included. Thus, for object type data, each element in the object type data may be looped through, and for each element, if digital content is included, the digital content in that element may be parsed into corresponding text type data. For the object type data, since the details are not described in the form of flowcharts like the array type data, reference is specifically made to the flowcharts corresponding to the array type data, i.e., fig. 6.
It can be seen that in parsing the markup language text, when digital content is encountered, the digital content can be parsed into corresponding text type data, i.e., all digital content in the markup language text can be parsed into corresponding text type data. Therefore, the analysis efficiency can be improved, and the computer resources can be saved.
S430, resolving the empty content in the markup language text into corresponding empty type data.
Specifically, the NULL content in the markup language text is NULL, for example, for JavaScript object markup language text, the type of the median value of the key value pair is NULL. For NULL in the markup language text, it can be parsed directly into NULL type data.
S440, analyzing the 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.
As with the strings in other computer languages (e.g., C language), the strings in the markup language text in the disclosed embodiments can be a string of characters consisting of numbers, letters, and underlining. For example, the string content may be "name": zhang. The method and the device can analyze the character string content in the markup language text into corresponding character string type data.
The parsing method for the non-digital content in the markup language text is the same as that in the prior art, and will not be described in detail here.
And S460, after the markup language text is parsed, the obtained parsed data is displayed 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 parsed, parsing data can be obtained, and the text type data corresponding to the digital content and the character string type data corresponding to the character string content are parsing data. The parsing data is data that can be displayed for a user to view, and the parsing data can be displayed to the user, for example, parsing data corresponding to a video type of markup language text can be displayed to the user, and parsing data corresponding to a news type of markup language text can be displayed to the user. Referring to fig. 7, various analysis data can be filtered and combined and then displayed to a user, and the user can browse related information in the terminal device.
And S470, when receiving an application request for any digital content, analyzing the text type data corresponding to the digital content into corresponding digital type data.
In general, digital content is not used when parsing data is displayed for a user. Therefore, the digital content is not parsed into the digital type data in the parsing process of S420. In some scenarios, digital content in the markup language text may be used, for example, the markup language text includes multiple behavior habits of the user, for example, how many times the user opens a web page, how many times the user sends a message, etc., and if it is to be determined how many times the user sends a message, the digital content corresponding to the number of times the message is sent in the markup language text may be parsed, that is, text type data corresponding to the number of times the message is sent that has been parsed in S420 is parsed, so as to obtain corresponding digital type data. In this way, the server can determine the number of times the user sent the message based on the digital type data. Of course, other actions of the user, such as how many times the user has opened the web page, may also be parsed at the time of use to save computer resources. In this step, the text type data number 12345.1234 obtained by parsing in S420 is parsed into digital type data number 12345.1234, see fig. 8.
The markup language parsing method of the embodiment of the present disclosure is 30% faster than RapidJSON and 90% faster than cpjson in the case of using only a part of digital content therein when parsing JavaScript object markup language text.
The method for analyzing the markup language text can judge the correctness of the digital content in the markup language text so as to ensure the correctness of the analysis of the markup language text. After the determination is correct, the digital content is parsed into corresponding text type data, rather than immediately parsing the digital content into digital type data in a memory data structure. After parsing the markup language text, the resulting parsed data is displayed to a user. When an application request for any digital content is received, that is, when the digital content is used, text type data corresponding to the digital content is parsed into corresponding digital type data, that is, when the digital content is used, the text type data is parsed. Because a great deal of time and computer resources are consumed when the digital content is parsed into the digital type data in the memory data structure, when partial digital content is used, the digital content to be used can be parsed into the digital type data only, the efficiency of the markup language text parsing is improved, and the digital content to be used can be obtained quickly. And, computer resources are saved.
It should be noted that although the steps of the methods in the present disclosure are depicted in the accompanying drawings in a particular order, this does not require or imply that the steps must be performed in that particular order, or that all illustrated steps be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform, etc.
Further, in this example embodiment, there is also provided a markup language text parsing apparatus 900, referring to fig. 9, including:
a text type data parsing module 910, configured to obtain a markup language text, and parse 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 receiving an application request for the digital content.
In an exemplary embodiment of the present 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 to the corresponding text type data aiming at the element containing the digital content in the array type data when the array type data is contained in the markup language text.
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 aiming at the element containing the digital content in the object type data when the object type data is contained in the markup language text and each element in the object type text contains the digital text.
In an exemplary embodiment of the present disclosure, the markup language text device 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 analyzing the markup language text.
In one 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 above-mentioned markup language text parsing apparatus have been described in detail in the corresponding markup language text parsing method, so that the details are not repeated herein.
It should be noted that although in the above detailed description several modules or units of a 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 in accordance with embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
In an exemplary embodiment of the present disclosure, there is also provided an electronic apparatus 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 for implementing an electronic device of 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 impose any limitation on the functions and the application scope of the embodiments of the present disclosure.
As shown in fig. 10, the computer system 1000 includes a Central Processing Unit (CPU) 1001, which can execute 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 required for system operation are also stored. The CPU 1001, ROM 1002, and RAM 1003 are connected to each other by 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 portion 1007 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), etc., and a speaker, etc.; a storage portion 1008 including a hard disk or 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 drive 1010 is also connected to the I/O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like, is installed as needed in the drive 1010, so that a computer program read out therefrom is installed as needed in the storage section 1008.
In particular, according to embodiments of the present disclosure, the processes described above with reference to 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 shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 1009, and/or installed from the removable medium 1011. When executed by a Central Processing Unit (CPU) 1001, the computer program performs various functions defined in the apparatus of the present application.
In an exemplary embodiment of the present 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 of the above.
The computer readable storage medium shown in the present disclosure may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. 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 context of this 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 the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. 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, and the like, 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 adaptations, 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 is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected 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 parsing a markup language text, the method comprising:
acquiring a markup language text, and analyzing digital content in the markup language text into corresponding text type data;
when receiving an application request for any digital content, the text type data corresponding to the digital content is parsed into corresponding digital type data, namely, the text type data is parsed when in use.
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 value 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 the array type data, aiming at the element containing the digital content in the array type data, analyzing the digital content in the element into the 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 data contains digital text, aiming at the element containing digital content in the object type data, 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 of the markup language text, the method further comprises:
resolving empty content in the markup language text into corresponding empty type data;
analyzing the 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 according to claim 1, wherein the method further comprises:
after parsing the markup language text, the obtained parsed data is displayed 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 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 any digital content into corresponding digital type data when receiving an application request for the digital content, namely analyzing the text type data when in use.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the method of any of claims 1-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.
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 CN112287097A (en) | 2021-01-29 |
CN112287097B true 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 (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109445890A (en) * | 2018-10-09 | 2019-03-08 | 北京达佳互联信息技术有限公司 | A kind of method for showing interface, device, terminal device and storage medium |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7249328B1 (en) * | 1999-05-21 | 2007-07-24 | E-Numerate Solutions, Inc. | Tree view for reusable data markup language |
US7500017B2 (en) * | 2001-04-19 | 2009-03-03 | Microsoft Corporation | Method and system for providing an XML binary format |
-
2019
- 2019-07-25 CN CN201910678876.4A patent/CN112287097B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
---|---|
CN112287097A (en) | 2021-01-29 |
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 | |
CN109814866B (en) | Processing method and device for converting page application into native application | |
CN112187558B (en) | Data verification method and device and electronic equipment | |
CN112684968A (en) | Page display method and device, electronic equipment and computer readable medium | |
CN110377289A (en) | A kind of data analysis method, device, medium and electronic equipment | |
CN113760729A (en) | Code detection method and device | |
CN111314388A (en) | Method and apparatus for detecting SQL injection | |
CN111367791B (en) | Method, device, medium and electronic equipment for generating test case | |
CN111125605B (en) | Page element acquisition method and device | |
CN112596738B (en) | Method and device for determining front-end page to be tested, storage medium and electronic equipment | |
CN113987118A (en) | Corpus acquisition method, apparatus, device and storage medium | |
CN113760721A (en) | Page testing method and device | |
CN116860286A (en) | Page dynamic update method, device, electronic equipment and computer readable medium | |
CN112287097B (en) | Method and device for analyzing markup language text, storage medium and electronic equipment | |
CN112818267A (en) | Data processing method and device, computer readable storage medium and electronic equipment | |
CN110110032B (en) | Method and device for updating index file | |
CN111783006B (en) | Page generation method and device, electronic equipment and computer readable medium | |
CN118194837A (en) | Report file generation method and device | |
CN113138767B (en) | Code language conversion method, device, electronic equipment and storage medium | |
CN112433752B (en) | Page analysis method, device, medium and electronic equipment | |
CN111079185B (en) | Database information processing method and device, storage medium and electronic equipment | |
CN111027281B (en) | Word segmentation method, device, equipment and storage medium | |
CN113760698A (en) | Method and device for converting test case file data | |
CN110209959B (en) | Information processing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |