Industrial data analysis method, device, electronic device and storage medium
By acquiring and processing element tags and namespace information of industrial data, dividing and parsing industrial data blocks, the problem of low industrial data parsing efficiency is solved, and more efficient data interaction and parsing are achieved.
Patent Information
- Application Number
- CN202311147148.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-06
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2043-09-06
AI Technical Summary
During the industrial software development process, the analysis efficiency of industrial data is low, mainly due to the inconsistent sources of industrial data and the naming of different stages, which leads to relatively independent data and difficult to interact and analyze efficiently.
By obtaining industrial data, element tag symbols, and naming space information, the elemental tag symbols are used to divide industrial data as multiple data blocks, and each data block is analyzed and processed. The results of the identification of the name space information are further processed and the analysis efficiency is improved.
This method can quickly and accurately divide and analyze industrial data blocks, improve the accuracy and data analysis efficiency of target recognition results, and solve the problem of low industrial data analysis efficiency.
Smart Images

Figure CN117391066B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of information processing technology, and in particular, relates to an industrial data analysis method, device, electronic device and readable storage medium. Background Art
[0002] Currently, eXtensible Markup Language (XML) is a data representation method that is widely used in areas such as network services, databases, and file processing.
[0003] In the process of industrial software development, industrial data involves various stages such as design, manufacturing, operation and maintenance, and management. The software modules in each stage are coupled to a certain extent. The industrial data in each stage interact frequently, and the industrial data often needs to be parsed during the interaction process.
[0004] At present, in the process of parsing industrial data, since the sources of industrial data at each stage are not completely consistent and the data are named differently, the industrial data at each stage are relatively independent, resulting in low efficiency in parsing industrial data. Summary of the invention
[0005] The embodiments of the present application provide a method, device, equipment and readable storage medium for parsing industrial data, which can solve the current problem of low efficiency in parsing industrial data.
[0006] In a first aspect, an embodiment of the present application provides a method for parsing industrial data, the method comprising:
[0007] Obtain industrial data, element tags and namespace information. Element tags include industrial tags and element delimiters.
[0008] Based on the element tags, the industrial data is divided into multiple data blocks;
[0009] For each data block, parsing the data block to obtain at least one first recognition result;
[0010] The first identification information is processed according to the namespace information to obtain a target identification result.
[0011] In a second aspect, an embodiment of the present application provides an industrial data analysis device, the device comprising:
[0012] An acquisition module is used to acquire industrial data, element tags and namespace information, where the element tags include industrial tags and element delimiters;
[0013] A partitioning module is used to partition the industrial data based on element tags to obtain multiple data blocks;
[0014] A parsing module, configured to parse each data block to obtain at least one first recognition result;
[0015] The processing module is used to process the first identification information according to the namespace information to obtain a target identification result.
[0016] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, it implements the method in the first aspect or any possible implementation of the first aspect.
[0017] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored thereon. When the computer program instructions are executed by a processor, the method in the first aspect or any possible implementation of the first aspect is implemented.
[0018] In an embodiment of the present application, industrial data, element tags and namespace information are obtained, and the element tags include industrial tags and element delimiters; based on the element tags, the industrial data is divided to obtain multiple data blocks. Since the industrial tags in the element tags can be used to characterize the type of a certain block of data stream, and the element delimiters in the element tags can identify the delimiting points of the data stream, multiple data blocks can be quickly and accurately divided based on the element tags; then each data block divided by the element tags is parsed, and the data blocks obtain at least one first recognition result; according to the namespace information, the first recognition information is further processed to obtain a target recognition result, thereby improving the accuracy of the target recognition result and improving the data parsing efficiency of the industrial data. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0020] Figure 1 is a flow chart of an industrial data analysis method provided by an embodiment of the present application;
[0021] Figure 2 is a schematic diagram of a data block provided in an embodiment of the present application;
[0022] Figure 3 This is a schematic diagram of the structure of an industrial data analysis device provided in an embodiment of the present application;
[0023] Figure 4It is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0024] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only configured to explain the present application and are not configured to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0025] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0026] The industrial data analysis method provided in the embodiment of the present application can be applied to at least the following application scenarios, which are described below.
[0027] XML is widely used in network services, databases, and file processing. In situations where high interoperability, flexibility, and scalability are required and high heterogeneity is exhibited, XML has become the de facto standard for data transmission.
[0028] In the process of industrial software development, due to the complexity of industrial data, it involves design, manufacturing, operation and management, etc. In addition, the software modules in each stage are coupled to a certain extent and often interact through data files.
[0029] However, due to the relative independence of data files and the lack of data source information, for example, the data at different stages have different names for the same object, data is difficult to transmit effectively. Moreover, when the size of the XML files to be processed increases, most Web service implementations cannot scale well, and their performance limitations will increase significantly on multi-core processors.
[0030] Based on the above application scenarios, the industrial data analysis method provided in the embodiments of the present application is described in detail below.
[0031] Figure 1 A flowchart of an industrial data parsing method provided in an embodiment of the present application.
[0032] like Figure 1 As shown, the industrial data analysis method may include steps 110 to 140, and the method is applied to an industrial data analysis device, as shown below:
[0033] Step 110, acquiring industrial data, element tags and namespace information, wherein the element tags include industrial tags and element delimiters;
[0034] Step 120, dividing the industrial data based on the element tag to obtain multiple data blocks;
[0035] Step 130, for each of the data blocks, parse the data block to obtain at least one first recognition result;
[0036] Step 140: Process the first identification information according to the namespace information to obtain a target identification result.
[0037] In an embodiment of the present application, industrial data, element tags and namespace information are obtained, and the element tags include industrial tags and element delimiters; based on the element tags, the industrial data is divided to obtain multiple data blocks. Since the industrial tags in the element tags can be used to characterize the type of a certain data stream, and the element delimiters in the element tags can identify the delimiting points of the data stream, multiple data blocks can be quickly and accurately divided based on the element tags; then each data block divided by the element tags is parsed, and the data blocks obtain at least one first recognition result; according to the namespace information, the first recognition information is further processed to obtain a target recognition result, thereby improving the accuracy of the target recognition result and improving the data parsing efficiency.
[0038] The contents of step 110 to step 140 are described below respectively:
[0039] This involves step 110 .
[0040] Acquire industrial data, element tags and namespace information, wherein the element tags include industrial tags and element delimiters;
[0041] In a possible embodiment, before step 110, the following steps may also be included:
[0042] Define industrial tags, where the industrial tags include: product tags, method tags, time tags, personnel tags, and location tags.
[0043] During the element tag definition phase, unify the tags according to the characteristics of the industrial system as: product tags, method tags, time tags, personnel tags, and location tags.
[0044] "system", "product", "method", "person", "place", "time". "system" is the root node;
[0045] "product" is a child node; "product" is a product tag
[0046] "method", "person", "place", "time" are sub - child nodes.
[0047] "method" is a method tag, "time" is a time tag, "person" is a personnel tag; "place" is a location tag.
[0048] Involve step 120.
[0049] Based on the element tag, partition the industrial data to obtain multiple data blocks;
[0050] Based on the element tag, partition the industrial data. Divide a relatively large continuous XML file into multiple independent XML data blocks according to certain rules, and then process the divided data blocks through multi - thread parallel processing.
[0051] Among them, the element boundary start symbol is determined by a string containing the special character "<" such as "< / ", "<?", "<!", or "<[CDATA[". During its determination process, since there is a "<" character in the comment or character data block, it will affect the determination of the start symbol. Then, a pre - processing method is used to determine the selected "<" character, find and distinguish the element boundary start symbol from the entity symbol, and the entity symbol is the "<" character in the comment or character data block.
[0052] Among them, generally for any XML document, it can be partitioned according to the given number of blocks. This kind of partitioning is only based on the XML document location for partitioning, rather than relying on business logic for partitioning, and it is difficult to effectively organize the data flow of complex industrial systems.
[0053] Among them, taking the pipe bender system as an example, the XML tags are expressed as:
[0054] <system>
[0055] <name> Pipe Bending Machine System< / name>
[0056] <product>
[0057] <name> Pipe Bending Machine< / name>
[0058] < / product>
[0059] <method>
[0060] <name> Interference analysis< / name>
[0061] <jointlengthl1> 0.39< / jointlengthl1>
[0062] <jointlengthl2> 0.42< / jointlengthl2>
[0063] ···
[0064] < / method>
[0065] <person>
[0066] <name> Wang< / name>
[0067] <age> 30< / age>
[0068] ···
[0069] < / person>
[0070] <time>
[0071] <name> 2023-3-1< / name>
[0072] < / time>
[0073] <place>
[0074] <name> Workshop 1< / name>
[0075] < / place>
[0076] < / system>
[0077] After defining the tags uniformly, we divide the data into blocks with "product", "method", "person", "place" and "time" as the boundaries. First, we find the "<" character, which is the start symbol. However, there are two cases of the "<" character: one is the start character of the start element or the end element, and the other is the entity character in the comment or character data block. Therefore, we need to identify the entity characters in the comment or character data block.
[0078] The divided data blocks include:
[0079] First data block:
[0080] <system>
[0081] <name> Pipe Bending Machine System< / name>
[0082] <product>
[0083] Second data block:
[0084] <method>
[0085] <name> Interference analysis< / name>
[0086] <jointlengthl1> 0.39< / jointlengthl1>
[0087] <jointlengthl2> 0.42< / jointlengthl2>
[0088] ···
[0089] < / method>
[0090] The third data block:
[0091] <person>
[0092] <name> Wang< / name>
[0093] <age> 30< / age>
[0094] ···
[0095] < / person>
[0096] Fourth data block:
[0097] <time>
[0098] <name> 2023-3-1< / name>
[0099] < / time>
[0100] The fifth data block:
[0101] <place>
[0102] <name> Workshop 1< / name>
[0103] < / place>
[0104] < / product> < / system>
[0105] The element tag includes an element start tag and an element end tag, and the data block includes an element start tag, a content item and an element end tag.
[0106] Exemplarily, the fourth data block is involved:
[0107] <time>
[0108] <name> 2023-3-1< / name>
[0109] < / time>
[0110] The data block includes an element start symbol, content items, and an element end symbol; the element start symbol is " <time>"Content Item" <name> 2023-3-1< / name> ;" and the element terminator "< / time> ”
[0111] The basic structure of XML data stream is element starter, content item and element ender. In element starter and element ender, it determines the element name and each attribute (including namespace declaration) and their start and end positions.
[0112] This involves step 130 .
[0113] For each of the data blocks, parsing the data block to obtain at least one first recognition result;
[0114] The XML stream is read into the data blocks divided as above, and is preliminarily parsed in a data parallel manner to identify the structure of the input XML stream.
[0115] Since the processing of chunks is independent of their order in the XML stream, the interpretation of the data chunks is ambiguous at this point and will result in at least one first recognition result for each chunk.
[0116] In a possible embodiment, the step of parsing each data block to obtain at least one first recognition result is performed in parallel based on multiple threads.
[0117] At the beginning of execution, a thread is launched for each core, and at any time each thread will be processing a block of data at some stage.
[0118] At the same time, data blocks can also be processed by different threads at different stages. When the data block is ready for the next stage, it will be processed by the next available thread to improve parsing efficiency.
[0119] In a possible embodiment, step 130 may specifically include the following steps:
[0120] For each of the data blocks, the data block is parsed based on the Deterministic Finite Automaton (DFA) technology to obtain at least one first recognition result.
[0121] When an XML data stream is received, multiple chunks of data are parsed independently and in parallel, so this stage is an example of data parallelism.
[0122] XML parsing is sequential in nature, so an initial parser that starts parsing at an arbitrary point in the XML stream will not know which state to start from. To solve this problem, Deterministic Finite Automaton (DFA) technology is used to transfer to the next state according to a pre-given transition function.
[0123] This involves step 140 .
[0124] The first identification information is processed according to the namespace information to obtain a target identification result.
[0125] In a possible embodiment, step 140 may specifically include the following steps:
[0126] selecting a second recognition result from at least one first recognition information of each data block according to the mark recognition result of the first data block; the plurality of data blocks including the first data block;
[0127] The second recognition result is corrected according to the namespace information to obtain the target recognition result.
[0128] Each data block is accompanied by a sequence of multiple structural parts, such as element start symbols.
[0129] For the first data block at the beginning of the document, i.e., the first data block, since the tag recognition result of the first data block has only one possible parsing result, the end state of the single tag recognition result is then used as the start state of the second data block to select the correct interpretation. The single correct interpretation in the second data block is then used to select the correct interpretation in the third data block, and so on. This chaining will occur as a continuous process at this stage.
[0130] The namespace information may be XML file name information. According to the namespace information, the second recognition result can be corrected to obtain a final target recognition result. The correction process is described in detail below:
[0131] In a possible embodiment, the data block includes an element start symbol, a content item, and an element end symbol. The above-mentioned step of correcting the second recognition result according to the namespace information to obtain the target recognition result may specifically include the following steps:
[0132] Determine location information of the element tag and the content item in the data block;
[0133] Determine the callback information in the data block according to the position information;
[0134] Based on the callback information, the second recognition result is corrected to obtain the target recognition result.
[0135] This phase mainly processes the namespace, including identifying the namespace prefix and performing prefix lookup within the block.
[0136] The output of the previous stage is a sequence of structure parts consisting of start tags, content items and end tags associated with each data block. Each has its associated grammatical units, such as element names and attributes, defined by their start and end character positions, that is, the position information that determines the element tag and the content item in the data block.
[0137] Using this position information, this stage performs additional namespace processing. After such processing, most of the data required for the XML SAX callback exists, so this stage converts the syntax units and their position information on the XML stream into buffered data with the representation required by the XML SAX callback. The output of this stage consists of a structure that will eventually be used in the callback, i.e., the callback information in the data block is determined based on the position information.
[0138] Based on the callback information, the second recognition result is corrected to obtain the target recognition result. Specifically, the namespace prefix references between other remaining data blocks can be parsed, and the actual callback of the SAX event can be called.
[0139] Since such inter-block namespace references are order-dependent by definition, and it is assumed that SAX callbacks should be called strictly in order, this phase is sequential. Different threads can exist in this phase, but only one thread can run at any time.
[0140] To correctly handle namespace lookups and issue SAX namespace callbacks, when a start tag is encountered, a new element is pushed onto the stack and SAX StartPrefixMapping callbacks are issued for all namespaces of the element; when an end tag is encountered, the element stack is popped and SAX EndPrefixMapping callbacks are issued for all namespaces of the element.
[0141] The unresolved inter-chunk namespace prefix is found by traversing the namespace declaration corresponding to each element of the element stack from top to bottom. Once the prefix required by the callback is resolved to its namespace Uniform Resource Identifier (URI), the callback can be called accordingly. A URI is a string used to identify the name of an Internet resource.
[0142] In an embodiment of the present application, industrial data, element tags and namespace information are obtained, and the element tags include industrial tags and element delimiters; based on the element tags, the industrial data is divided to obtain multiple data blocks. Since the industrial tags in the element tags can be used to characterize the type of a certain data stream, and the element delimiters in the element tags can identify the delimiting points of the data stream, multiple data blocks can be quickly and accurately divided based on the element tags; then each data block divided by the element tags is parsed, and the data blocks obtain at least one first recognition result; according to the namespace information, the first recognition information is further processed to obtain a target recognition result, thereby improving the accuracy of the target recognition result and improving the data parsing efficiency.
[0143] Combine the following Figure 2 The four stages of the analytical method for industrial data are described:
[0144] The first stage reads the XML stream according to the data blocks divided as above, and preliminarily parses it in a data-parallel manner to identify the structure of the input XML stream. Because the processing of blocks is independent of their order in the XML stream, the interpretation of the data blocks is ambiguous at this time, which will result in multiple recognition results for each block.
[0145] The first stage first determines the basic structure of the XML data stream, that is, determines the element start, element content, and element end. In the element start and element end, it determines the element name and each attribute (including namespace declaration), and determines their start and end positions.
[0146] When an XML data stream is received, it is divided into data blocks according to module one. Parallelism is obtained by parsing multiple data blocks independently and in parallel, so this stage is an example of data parallelism. XML parsing is sequential in nature, so the initial parser that starts parsing at an arbitrary point in the XML stream will not know which state to start from. To solve this problem, the meta-DFA technology is used here, which can transfer to the next state according to a pre-given transition function.
[0147] In the second stage, a single thread sequentially scans the above data blocks to resolve the ambiguity generated by the recognition process.
[0148] Since each chunk has multiple sequences of structural parts attached to it, such as element starters, the goal of the second phase is to resolve these ambiguous results into a single, unambiguous sequence. For the first chunk at the beginning of the document, there is only one possible parse result because there is no ambiguity, and the end state of this single unambiguous parse is then used as the start state of the second chunk to select the correct interpretation. The single correct interpretation in the second chunk is then used to select the correct interpretation in the third chunk, and so on. This chaining occurs as a continuous process in this phase.
[0149] The third phase takes the explicit data stream from the second phase and processes the data chunks again in a data-parallel, out-of-order queue fashion. Its purpose is to perform namespace processing, including identifying namespace prefixes and performing intra-chunk namespace lookups.
[0150] The third phase mainly processes the namespace, including identifying namespace prefixes and performing prefix lookups within the block. The output of the second phase is a sequence of structure parts consisting of start tags, content items, and end tags associated with each data block. Each has its associated grammatical units, such as element names and attributes, defined by their start and end character positions. Using this position information, this phase performs additional namespace processing. After such processing, most of the data required by the XML SAX callback exists, so this phase converts the grammatical units and their position information on the XML stream into buffered data with the representation required by the XML SAX callback. The output of this phase consists of structures that will eventually be used in the callback.
[0151] In the fourth phase a single thread processes the data chunk again to perform the remaining inter-chunk namespace lookups and then actually calls the callback.
[0152] The fourth phase resolves the remaining inter-chunk namespace prefix references and calls the actual callbacks for the SAX events. Since such inter-chunk namespace references are order-dependent by definition, and it is assumed that SAX callbacks should be called strictly in order, this phase is sequential. Different threads may exist for this phase, but there will be no more than one thread at any time.
[0153] The data blocks in the first stage and the third stage are processed in parallel, so different data blocks of the input stream can be processed independently in the multi-core processor in the above two stages.
[0154] The second and fourth stages are processed sequentially, which means that more than one core cannot be assigned to any of them at any one time. As mentioned above, this combination of sequential and mixed parallelism of parallel stages provides greater scheduling flexibility.
[0155] In an embodiment of the present application, industrial data, element tags and namespace information are obtained, and the element tags include industrial tags and element delimiters; based on the element tags, the industrial data is divided to obtain multiple data blocks. Since the industrial tags in the element tags can be used to characterize the type of a certain data stream, and the element delimiters in the element tags can identify the delimiting points of the data stream, multiple data blocks can be quickly and accurately divided based on the element tags; then each data block divided by the element tags is parsed, and the data blocks obtain at least one first recognition result; according to the namespace information, the first recognition information is further processed to obtain a target recognition result, thereby improving the accuracy of the target recognition result and improving the data parsing efficiency.
[0156] Based on the above Figure 1 The industrial data analysis method shown in the figure, the embodiment of the present application also provides an industrial data analysis device, such as Figure 3 As shown, the device 300 may include:
[0157] An acquisition module 310 is used to acquire industrial data, element tags and namespace information, where the element tags include industrial tags and element delimiters;
[0158] A partitioning module 320, for partitioning the industrial data based on the element tags to obtain a plurality of data blocks;
[0159] A parsing module 330, configured to parse each data block to obtain at least one first recognition result;
[0160] The processing module 340 is used to process the first identification information according to the namespace information to obtain a target identification result.
[0161] In a possible implementation, the device 300 may further include:
[0162] The definition module is used to define industrial tags, which include: product tags, method tags, time tags, personnel tags and location tags.
[0163] In a possible implementation manner, the element tag includes an element start tag and an element end tag, and the data block includes an element start tag, a content item, and an element end tag.
[0164] In a possible implementation, the parsing module 330 is specifically configured to:
[0165] For each data block, the data block is parsed based on the deterministic finite automaton (DFA) technology to obtain at least one first recognition result.
[0166] In a possible implementation, the processing module 340 is specifically configured to:
[0167] selecting a second identification result from at least one first identification information of each data block according to the tag identification result of the first data block; the plurality of data blocks including the first data block;
[0168] According to the namespace information, the second recognition result is corrected to obtain a target recognition result.
[0169] In a possible implementation, the data block includes an element start symbol, a content item, and an element end symbol. The processing module 340 is specifically configured to:
[0170] Determine the location information of element tags and content items in the data block;
[0171] Determine callback information in the data block according to the position information;
[0172] Based on the callback information, the second recognition result is corrected to obtain a target recognition result.
[0173] In a possible implementation, the step of parsing each data block to obtain at least one first recognition result is performed in parallel based on multiple threads.
[0174] In an embodiment of the present application, industrial data, element tags and namespace information are obtained, and the element tags include industrial tags and element delimiters; based on the element tags, the industrial data is divided to obtain multiple data blocks. Since the industrial tags in the element tags can be used to characterize the type of a certain data stream, and the element delimiters in the element tags can identify the delimiting points of the data stream, multiple data blocks can be quickly and accurately divided based on the element tags; then each data block divided by the element tags is parsed, and the data blocks obtain at least one first recognition result; according to the namespace information, the first recognition information is further processed to obtain a target recognition result, thereby improving the accuracy of the target recognition result and improving the data parsing efficiency.
[0175] Figure 4 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.
[0176] The electronic device may include a processor 401 and a memory 402 storing computer program instructions.
[0177] Specifically, the processor 401 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0178] The memory 402 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 402 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 402 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 402 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 402 is a non-volatile solid-state memory. In a specific embodiment, the memory 402 includes a read-only memory (ROM). In appropriate cases, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM) or a flash memory or a combination of two or more of these.
[0179] The processor 401 reads and executes computer program instructions stored in the memory 402 to implement any industrial data analysis method in the embodiments shown in the figure.
[0180] In one example, the electronic device may further include a communication interface 403 and a bus 410. Figure 4 As shown, the processor 401, the memory 402, and the communication interface 403 are connected via a bus 410 and communicate with each other.
[0181] The communication interface 403 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0182] Bus 410 includes hardware, software or both, and the parts of electronic equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 410 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.
[0183] The electronic device can execute the industrial data analysis method in the embodiment of the present application, thereby realizing the combination Figure 1 to Figure 2 Describes an analytical method for industrial data.
[0184] In addition, in combination with the industrial data analysis method in the above embodiment, the present application embodiment can provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by the processor, the Figure 1 to Figure 2 An analytical method for industrial data in .
[0185] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0186] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0187] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0188] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A method for analyzing industrial data, characterized in that: The method comprises: Acquire industrial data, element tags and namespace information, wherein the element tags include industrial tags and element delimiters; Based on the element tag, the industrial data is divided to obtain a plurality of data blocks; the data blocks include an element start tag, a content item and an element end tag; For each of the data blocks, parsing the data block to obtain at least one first recognition result, which includes: for each of the data blocks, parsing the data block based on a deterministic finite automaton (DFA) technology to obtain at least one first recognition result; According to the namespace information, the first recognition result is processed to obtain a target recognition result, which includes: according to the tag recognition result of the first data block, a second recognition result is selected from at least one first recognition information of each data block; the multiple data blocks include the first data block; according to the namespace information, the second recognition result is corrected to obtain the target recognition result; the correction processing of the second recognition result according to the namespace information to obtain the target recognition result includes: determining the position information of the element tag and the content item in the data block; determining the callback information in the data block according to the position information; based on the callback information, the second recognition result is corrected to obtain the target recognition result, which includes: parsing the prefix reference of the namespace between the remaining data blocks, and calling the actual callback information of the SAX event, when encountering a start tag, pushing a new element into the element stack, and issuing SAX StartPrefixMapping callback information for all the namespaces of the element; when encountering an end tag, popping the element stack, and issuing SAX for all the namespaces of the element EndPrefixMapping callback information, by traversing the namespace corresponding to each element of the element stack to find the unresolved prefix of the namespace between data blocks, once the prefix required by the callback is resolved to the namespace uniform resource identifier, the callback information is called for correction processing.
2. The method according to claim 1, characterized in that Before obtaining the industrial data, element tags and namespace information, the method further includes: Industrial tags are defined, and the industrial tags include: product tags, method tags, time tags, personnel tags, and location tags.
3. The method according to claim 1, characterized in that The element tag includes an element start tag and an element end tag, and the data block includes an element start tag, a content item and an element end tag.
4. The method according to claim 1, characterized in that The step of parsing each data block to obtain at least one first recognition result is performed in parallel based on multiple threads.
5. An industrial data analysis device, characterized in that: The device comprises: An acquisition module, used to acquire industrial data, element tags and namespace information, wherein the element tags include industrial tags and element delimiters; A partitioning module, used to partition the industrial data based on the element tag to obtain a plurality of data blocks; the data blocks include an element start tag, a content item and an element end tag; A parsing module, configured to parse each of the data blocks to obtain at least one first recognition result, including: parsing each of the data blocks based on a deterministic finite automaton (DFA) technology to obtain at least one first recognition result; A processing module is used to process the first recognition result according to the namespace information to obtain a target recognition result, which includes: selecting a second recognition result from at least one first recognition information of each data block according to the tag recognition result of the first data block; the multiple data blocks include the first data block; correcting the second recognition result according to the namespace information to obtain the target recognition result; the correcting the second recognition result according to the namespace information to obtain the target recognition result includes: determining the position information of the element tag and the content item in the data block; determining the callback information in the data block according to the position information; correcting the second recognition result based on the callback information to obtain the target recognition result, which includes: parsing the prefix reference of the namespace between the remaining data blocks, and calling the actual callback information of the SAX event, when encountering a start tag, pushing a new element into the element stack, and issuing a SAX for all the namespaces of the element. StartPrefixMapping callback information; when an end tag is encountered, the element stack is popped up, and SAXEndPrefixMapping callback information is issued for all the namespaces of the element, and the prefix of the unresolved namespace between data blocks is found by traversing the namespace corresponding to each element of the element stack. Once the prefix required by the callback is resolved to the namespace uniform resource identifier, the callback information is called for correction processing.
6. An electronic device, characterized in that: The device comprises: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the industrial data analysis method according to any one of claims 1 to 4 is implemented.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the industrial data analysis method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Data block dividing method in XML parsing and XML parsing method
CN103020176A
Division program, combination program and information processing method
US20070150809A1
Event-level parallel methods and apparatus for XML parsing
US20110153604A1
Parallel XML parsing using meta-DFAs
US8782514B1