Data analysis method and device, electronic equipment and storage medium
By using a data parsing method based on the ragel finite state machine, efficient parsing of SIP signaling was achieved, solving the problem of low resource utilization in existing technologies and improving system performance and user experience.
Patent Information
- Application Number
- CN202411024394.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2044-07-29
AI Technical Summary
Existing technologies have low resource utilization during SIP signaling parsing and cannot effectively utilize the advantages of multi-core processors, resulting in low SIP signaling parsing efficiency. This is especially true in high-concurrency scenarios, where it increases latency and affects the user's call experience.
A data parsing method based on the ragel finite state machine is adopted to obtain structured SIP signaling through a single scan and match. SIP signaling elements are extracted using state transitions and preset extraction rules, including actions such as assignment, jump, and marking positions, to avoid repeatedly traversing the string.
It improves SIP signaling parsing efficiency, reduces resource consumption, and enhances system reliability and user experience.
Smart Images

Figure CN118842855B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of audio and video communication technology, and in particular to a data parsing method, apparatus, electronic device and storage medium. Background Technology
[0002] With the widespread adoption of smartphones and the rapid development of internet technology, traditional telephone services are being quickly replaced by cloud-based VoIP phones, simultaneously spurring explosive growth in the audio and video application market. Behind this transformation, the SIP (Session Initiation Protocol) plays a crucial role. As a core standard for unified communications, it supports the smooth operation of countless real-time audio and video interactions.
[0003] Modern audio and video services are mostly built on cloud-native architectures, deployed in the cloud using microservices and containerization technologies. This not only brings the flexibility of horizontal scaling but also ensures high system availability. However, despite the abundant computing resources provided by cloud platforms, challenges remain in SIP signaling parsing. Traditional SIP signaling parsing requires repeatedly traversing the strings in the SIP message and comparing them to obtain the values of each header field. This places a significant burden on the CPU, making it difficult to effectively utilize the advantages of multi-core processors and hardware acceleration features, resulting in low resource utilization and low SIP signaling parsing efficiency.
[0004] In addition, audio and video communication is extremely sensitive to latency, especially in high-concurrency scenarios. Inefficient SIP signaling parsing can significantly increase latency, directly affecting the user's call experience.
[0005] Therefore, there is an urgent need for an efficient data parsing method to improve the efficiency of SIP signaling parsing. Summary of the Invention
[0006] This application aims to at least partially address one of the technical problems in the related art.
[0007] Therefore, the first objective of this application is to propose a data parsing method to improve the efficiency of SIP signaling parsing.
[0008] The second objective of this application is to provide a data parsing device.
[0009] The third objective of this application is to propose an electronic device.
[0010] The fourth objective of this application is to provide a computer-readable storage medium.
[0011] The fifth objective of this application is to provide a computer program product.
[0012] To achieve the above objectives, a data parsing method is proposed in the first aspect of this application, comprising:
[0013] Retrieve pending SIP messages;
[0014] Perform state transitions on SIP messages to determine the state corresponding to the strings in the SIP message. The state is determined based on different SIP header field value types.
[0015] Based on preset extraction rules, the state-related actions are executed to extract SIP signaling elements from SIP messages. These actions include assignment, jump, and marking position.
[0016] Until the string reaches its final state, obtain the structured SIP signaling composed of all SIP signaling elements.
[0017] To achieve the above objectives, a second aspect of this application provides a data parsing apparatus, comprising:
[0018] The acquisition module is used to acquire SIP messages to be processed.
[0019] The conversion module is used to perform state conversion on SIP messages and determine the state corresponding to the strings in the SIP message. The state is determined based on different SIP header field value types.
[0020] The execution module is used to perform state-related actions based on preset extraction rules to extract SIP signaling elements from SIP messages. These actions include assignment, jump, and marking positions.
[0021] The judgment module is used to obtain the structured SIP signaling composed of all SIP signaling elements until the string reaches its final state.
[0022] To achieve the above objectives, a third aspect of this application provides an electronic device comprising:
[0023] At least one processor; and
[0024] A memory that is communicatively connected to at least one processor; wherein,
[0025] The memory stores instructions that can be executed by at least one processor, which enables the at least one processor to perform the methods of the above embodiments.
[0026] To achieve the above objectives, a fourth aspect of this application provides a computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to perform the method according to the above embodiments.
[0027] To achieve the above objectives, a fifth aspect of this application provides a computer program product, including a computer program that, when executed by a processor, implements the methods of the above embodiments.
[0028] The data parsing method, apparatus, electronic device, and storage medium provided in this application, after acquiring the SIP message to be processed, perform state transitions on the SIP message to determine the state corresponding to the strings in the SIP message. Then, based on preset extraction rules, state-related actions are executed to extract SIP signaling elements from the SIP message until the strings reach their final state, thus obtaining structured SIP signaling composed of all SIP signaling elements. Therefore, it is unnecessary to repeatedly traverse the strings in the SIP message; structured SIP signaling can be obtained with a single scan and match. This improves the parsing efficiency of SIP signaling while reducing resource consumption.
[0029] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0030] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:
[0031] Figure 1 This is a schematic diagram of the structure of a data parsing device provided in an embodiment of this application;
[0032] Figure 2 A flowchart illustrating a data parsing method provided in an embodiment of this application;
[0033] Figure 3 This is a flowchart illustrating another data parsing method provided in an embodiment of this application;
[0034] Figure 4 A schematic diagram of a ragel finite state machine provided for an embodiment of this application;
[0035] Figure 5 This is a flowchart illustrating another data parsing method provided in an embodiment of this application;
[0036] Figure 6 This is a flowchart illustrating another finite state machine definition provided in an embodiment of this application.
[0037] Figure 7 This is a schematic diagram of the structure of a data parsing device provided in an embodiment of this application. Detailed Implementation
[0038] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0039] The data parsing method and apparatus of embodiments of this application are described below with reference to the accompanying drawings.
[0040] The data parsing method of this application embodiment is applicable to application scenarios in communication systems using SIP-based audio and video communication protocols that require logical processing of signaling. The data parsing method of this application embodiment is executed by the data parsing device (hereinafter referred to as the parsing device) provided in this application embodiment, such as... Figure 1 As shown, this device can be configured in the syntax and encoding layers of the SIP protocol layer to improve the accuracy of location determination. Furthermore, this parsing device is a SIP signaling parsing finite state machine, generated based on the ragel finite state machine.
[0041] Figure 2 This is a flowchart illustrating a data parsing method provided in an embodiment of this application.
[0042] like Figure 2 As shown, this data parsing method includes the following steps:
[0043] Step 201: Obtain the SIP message to be processed.
[0044] In this application, in audio and video communication services, the application layer generates SIP messages and sends the SIP messages to the parsing device, thereby enabling the parsing device to obtain the SIP messages to be processed.
[0045] Step 202: Perform state transition on the SIP message to determine the state corresponding to the string in the SIP message. The state is determined based on different SIP header field value types.
[0046] The SIP header field value types include string header fields, address header fields, and format-specific header fields. Furthermore, each state can correspond to a sub-state machine.
[0047] In this application, during the generation of the parsing device, it is necessary to define a SIP signaling parsing finite state machine, including defining the states of the SIP signaling parsing finite state machine and the actions performed in each state. Different states are defined based on different SIP header field value types.
[0048] Address header fields include Contact, From, To, Route, Record-Route, etc. A state can be defined for each address header field; the characteristic of a state corresponding to an address header field is that its field value contains a SIP-URI sub-state machine.
[0049] Specific format header fields include Call-ID, Content-Length, CSeq, Expires, Max-Forwards, and Min-Expires. An additional state can be defined for a specific format header field; the characteristic of this state is that the field values are numeric.
[0050] String header fields include all other header fields mentioned above, as well as extended header fields. An additional state can be defined for a specific format header field; the characteristic of the state corresponding to a string header field is that the field value is treated as a string.
[0051] Therefore, the parsing device can perform state transitions on the SIP message and determine the state corresponding to the string in the SIP message.
[0052] Step 203: Execute state-related actions based on preset extraction rules to extract SIP signaling elements from SIP messages. These actions include assignment, jump, and marking positions.
[0053] The extraction rules are generated by rewriting the generation expression of the SIP message and are used to extract the values corresponding to each header field.
[0054] RFC3261 defines SIP messages using the ABNF paradigm, while this application uses a ragel equivalent. The process of generating extraction rules:
[0055] 1) Extract the ABNF paradigm defined in the SIP message format of the RFC.
[0056] 2) Use ragel to rewrite the extracted ABNF normal form to form the expression of the SIP signaling parsing finite state machine (i.e., extraction rules). The rewriting rules target symbols that differ between ragel and ABNF syntax expressions, such as optional symbols, union symbols, repetition symbols, range symbols, and grammar reserved words used in SIP's ABNF normal form, including the following:
[0057] a) Optional symbol: In ABNF, “[]” is used to indicate that any expression in the [] is optional and appears 0 or more times. It is rewritten as “()?” in ragel.
[0058] b) Union symbol: ABNF uses the " / " symbol to list all possible expressions, which is rewritten as the "|" of ragel.
[0059] c) Repetition symbol: ABNF uses "1*expr" and "*expr" to indicate at least one occurrence, one occurrence, and multiple occurrences, which are rewritten as "expr+" and "expr*" in ragel.
[0060] d) Range symbol: ABNF uses "%x-" to represent a range value in hexadecimal, which is rewritten as "%x.." in ragel.
[0061] e) Other reserved words are rewritten, such as alphnum being rewritten as alnum, HEXDIG being rewritten as xdigit, etc.
[0062] Furthermore, during the generation of the parsing device, code fragments (i.e., actions) executed during state transitions (i.e., state-associated actions) are added to the ragel expression to handle the logic and operations during state transitions. These include marking positions, assigning values, and jumping, to obtain the values of the corresponding header fields (i.e., SIP signaling elements) through action segmentation. Specifically, marking positions records the current position for subsequent jumps back to that position. Assigning values extracts the values of header fields. Jumping jumps to the state corresponding to the address class header field.
[0063] In this application, the action associated with the execution state is performed and SIP signaling elements are extracted from the SIP message based on the extraction rules.
[0064] Step 204: Until the string reaches its final state, obtain the structured SIP signaling consisting of all SIP signaling elements.
[0065] In this application, SIP messages end with a fixed character. The strings within the SIP message are parsed sequentially from beginning to end. When a string reaches the fixed character, the final state is reached, indicating that the SIP message parsing is complete. This allows the acquisition of structured SIP signaling composed of all SIP signaling elements. The structured SIP signaling includes each header field and its corresponding value.
[0066] In this application, after acquiring the SIP message to be processed, a state transition is performed on the SIP message to determine the state corresponding to the strings in the SIP message. Then, based on preset extraction rules, state-related actions are executed to extract SIP signaling elements from the SIP message until the strings reach their final state, thus obtaining structured SIP signaling composed of all SIP signaling elements. Therefore, it is unnecessary to repeatedly traverse the strings in the SIP message; structured SIP signaling can be obtained with a single scan and match. This improves the parsing efficiency of SIP signaling while reducing resource consumption.
[0067] Figure 3 This is a flowchart illustrating a data parsing method provided in an embodiment of this application.
[0068] like Figure 3 As shown, this data parsing method includes the following steps:
[0069] Step 301: Obtain the SIP message to be processed.
[0070] Step 302: Perform state transition on the SIP message to determine the state corresponding to the string in the SIP message. The state is determined based on different SIP header field value types.
[0071] Step 303: Execute state-related actions based on preset extraction rules to extract SIP signaling elements from SIP messages. The actions include assignment, jump, and marking position.
[0072] Step 304: Until the string reaches its final state, obtain the structured SIP signaling consisting of all SIP signaling elements.
[0073] The specific implementation process of steps 301-304 in this application can be found in the detailed description of any embodiment of this application, and will not be repeated here.
[0074] Step 305: If the string does not reach its final state within the preset time period, an exception message is generated.
[0075] In this application, if the string still hasn't reached its final state within a preset time period, it indicates a parsing process failure. Therefore, exception information can be generated, or fault-tolerant measures can be implemented to avoid the system being stuck in the data parsing process indefinitely, thus improving system reliability.
[0076] The exception message may include pending SIP messages, data parsing logs, etc., so as to analyze the cause of the exception based on the exception message.
[0077] In this application, after acquiring the SIP message to be processed, a state transition is performed on the SIP message to determine the state corresponding to the string in the SIP message. Then, based on preset extraction rules, state-related actions are executed to extract SIP signaling elements from the SIP message until the string reaches its final state, obtaining structured SIP signaling composed of all SIP signaling elements. If the string does not reach its final state within a preset time, an exception message is generated. Therefore, it is unnecessary to repeatedly traverse the strings in the SIP message; structured SIP signaling can be obtained with a single scan and match. This improves the parsing efficiency of SIP signaling while reducing resource consumption.
[0078] To facilitate understanding of the data parsing method of this application, further illustrative examples are provided below.
[0079] The basic principle of this proposal is to utilize the ragel finite state machine technique to complete text parsing in a single scan. For example... Figure 4 As shown, a finite state machine parses any string in a single serial scan, determining whether it is a regular string, a decimal string, or a hexadecimal string. Similarly, the parsing process of SIP signaling can be organized into a finite state machine, with assignment actions embedded within it. The SIP signaling to be parsed can be completed in a single scan of the state machine, greatly improving the efficiency of SIP signaling parsing.
[0080] To implement SIP signaling parsing using ragel finite state machine technology, the following steps are required: Figure 5 As shown, the ragel compiler is used to generate a SIP signaling parsing finite state machine (hereinafter referred to as the SIP finite state machine), and a high-level language compiler is used to parse SIP messages to obtain structured SIP signaling. The ragel compiler environment includes a definition module for defining the states of the SIP finite state machine and their corresponding actions, an integration module for defining the SIP finite state machine interface, and a compilation module for compiling the SIP finite state machine and its interface to generate a high-level language-described SIP finite state machine. The high-level language compiler environment includes an input module for acquiring network input (i.e., the SIP messages to be processed), a parsing module for calling the generated SIP finite state machine to parse the SIP messages and obtain the parsing results (i.e., structured SIP signaling), and an output module for outputting the parsing results. Using the finite state machine method, the parsing results are output to the upper layer of the SIP protocol stack.
[0081] The detailed description of the above steps is as follows:
[0082] 1. Define the SIP finite state machine
[0083] The core process of defining a SIP finite state machine is as follows: Figure 6 As shown, by extracting the ABNF paradigm (extended Backus paradigm) from RFC3261, using ragel to equivalently rewrite the ABNF paradigm (i.e., generating extraction rules), and appending ragel actions to the sub-state machine expression, the finite state machine definition file is output.
[0084] 1) Extract the ABNF paradigm defined in the SIP message format of the RFC.
[0085] 2) Use the ragel equivalent to rewrite the extracted ABNF normal form to form the ragel finite state machine expression.
[0086] The rewriting rules address the different notations used in ragel and ABNF syntax, such as optional notations, union notations, repetition notations, range notations, and reserved words used in SIP's ABNF paradigm. These include the following:
[0087] a) Optional symbol: In ABNF, “[]” is used to indicate that any expression in the [] is optional and appears 0 or more times. It is rewritten as “()?” in ragel.
[0088] b) Union symbol: ABNF uses the " / " symbol to list all possible expressions, which is rewritten as the "|" of ragel.
[0089] c) Repetition symbol: ABNF uses "1*expr" and "*expr" to indicate at least one occurrence, one occurrence, and multiple occurrences, which are rewritten as "expr+" and "expr*" in ragel.
[0090] d) Range symbol: ABNF uses "%x-" to represent a range value in hexadecimal, which is rewritten as "%x.." in ragel.
[0091] e) Other reserved words are rewritten, such as alphnum being rewritten as alnum, HEXDIG being rewritten as xdigit, etc.
[0092] 3) Based on the different types of SIP header field values, the SIP header field sub-state machines are classified into string header field sub-state machines, address header field sub-state machines, specific format header field sub-state machines, and extended header field sub-state machines:
[0093] a) Address-type header field sub-state machine, such as header fields Contact, From, To, Route, etc.
[0094] The sub-state machine of Record-Route. This type of sub-state machine is characterized by field values containing...
[0095] SIP-URI sub-state machine.
[0096] b) Specific format header field sub-state machine, such as header fields Call-ID, Content-Length, CSeq, etc.
[0097] Sub-state machines for Expires, Max-Forwards, and Min-Expires. A characteristic of this category of sub-state machines is that the field values are numeric.
[0098] c) Character class header field sub-state machine, including other header fields besides those mentioned above and extended header fields.
[0099] The field values of this category's sub-state machine are processed as strings.
[0100] 4) According to the above classification of SIP header field sub-state machines, add code segments to be executed during state transitions, i.e., actions, to the ragel expression. These actions are used to handle the logic and operations during state transitions, such as marking positions, assigning values, and jumping. The values of the corresponding header field are obtained through action segments.
[0101] Here is a simple example using the Go programming language:
[0102] a) Mark the position by assigning the current position p to the global variable mark.
[0103] action mark{
[0104] mark=p
[0105] }
[0106] b) Assign a value to get the parsed Method field value.
[0107] action Method{
[0108] msg.Method=string(data[mark:p])
[0109] }
[0110] c) Jump to the address class header field sub-state machine addr.
[0111] action goto_addr{
[0112] fgoto addr;
[0113] }
[0114] 5) The above definition outputs the SIP finite state machine ragel description file sip.rl. The file contains the definition of the state machine, state transition rules (i.e. extraction rules), and actions associated with the states. It is then compiled by ragel to generate high-level language code.
[0115] 2. Define the SIP finite state machine interface
[0116] Define a high-level language interface method. Within this method, call the finite state machine `sip.rl`. If the state machine finishes execution and the current scan position "cs" reaches the final state "$!", then the parsing was successful. The interface method description file outputs `msg.rl`, which is subsequently compiled into high-level language code using `ragel`.
[0117] 3. Compile the SIP finite state machine and its interface.
[0118] Using the `ragel` command, compile the SIP finite state machine description file `sip.rl` and the interface file `msg.rl` defined above to generate high-level language source files (i.e., the executable file of the SIP finite state machine). For example, generating Go language source files `sip.go` and `msg.go` completes the conversion of the SIP finite state machine and its interface from `ragel` to a high-level language method.
[0119] 4. Obtain network input (i.e., SIP messages)
[0120] Corresponding to the transport and network layers, SIP messages are obtained through high-level language network programming methods. The data packets include network port listening, data reading, error handling, etc.
[0121] 5. SIP signaling parsing
[0122] The SIP protocol stack syntax and encoding layer, the final carrier of this proposal, uses a high-level language method of the SIP finite state machine interface to pass SIP messages to the SIP signaling finite state machine for scanning and parsing, thereby obtaining structured SIP signaling.
[0123] 6. Output of parsing results
[0124] The SIP protocol stack's user, transaction, and transport layers acquire and parse the structured SIP signaling, then execute the next operation. For request messages, this may involve routing and authentication; for response messages, it may involve error handling and status updates.
[0125] This proposal utilizes ragel finite state machine technology. ragel is a finite state machine compiler that compiles regular expression-based state machines into parsers for traditional languages (C, C++, D, Java, Ruby, etc.), offering the following advantages:
[0126] High performance: The finite state machines generated by ragel have highly optimized code, enabling state transitions and matching at very high speeds during runtime. This makes ragel ideal for handling high-performance and high-throughput applications, such as network protocol parsing and lexical analyzers.
[0127] Flexibility: ragel offers a rich syntax and operators, enabling users to flexibly define and design finite state machines. Different states and transition conditions can be defined according to requirements to implement various complex logics and matching rules.
[0128] Readability: ragel's syntax is concise and clear, making it easy to understand and read. Through ragel's syntax, the structure and behavior of finite state machines can be intuitively expressed, making the code easy to maintain and debug.
[0129] Cross-platform support: ragel supports multiple programming languages and platforms, including C, C++, Java, Go, etc. This allows developers to use ragel to generate corresponding finite state machine code in different environments, improving code portability and reusability.
[0130] To implement the above embodiments, this application also proposes a data parsing apparatus.
[0131] Figure 7 This is a schematic diagram of the structure of a data parsing device provided in an embodiment of this application.
[0132] like Figure 7 As shown, the data parsing device includes an acquisition module 710, a conversion module 720, an execution module 730, and a judgment module 740.
[0133] The acquisition module 710 is used to acquire SIP messages to be processed;
[0134] The conversion module 720 is used to perform state conversion on SIP messages and determine the state corresponding to the strings in the SIP message. The state is determined based on different SIP header field value types.
[0135] The execution module 730 is used to execute state-related actions based on preset extraction rules to extract SIP signaling elements from SIP messages. The actions include assignment, jump, and marking position.
[0136] The judgment module 740 is used to obtain the structured SIP signaling composed of all SIP signaling elements until the string reaches its final state.
[0137] Furthermore, in one possible implementation of this application embodiment, the SIP header field value type includes string header fields, address header fields, and specific format header fields.
[0138] Furthermore, in one possible implementation of this application embodiment, a rewriting module is also included, used for:
[0139] The generation expression of the SIP message is rewritten to generate extraction rules.
[0140] Furthermore, in one possible implementation of this application embodiment, an exception module is also included, used for:
[0141] If the response string does not reach its final state within the preset time period, an exception message will be generated.
[0142] It should be noted that the foregoing explanation of the data parsing method embodiment also applies to the data parsing device of this embodiment, and will not be repeated here.
[0143] In this application, after acquiring the SIP message to be processed, a state transition is performed on the SIP message to determine the state corresponding to the strings in the SIP message. Then, based on preset extraction rules, state-related actions are executed to extract SIP signaling elements from the SIP message until the strings reach their final state, thus obtaining structured SIP signaling composed of all SIP signaling elements. Therefore, it is unnecessary to repeatedly traverse the strings in the SIP message; structured SIP signaling can be obtained with a single scan and match. This improves the parsing efficiency of SIP signaling while reducing resource consumption.
[0144] To implement the above embodiments, this application also proposes an electronic device, including: a processor and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the method provided in the foregoing embodiments.
[0145] To implement the above embodiments, this application also proposes a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the methods provided in the foregoing embodiments.
[0146] To implement the above embodiments, this application also proposes a computer program product, including a computer program that, when executed by a processor, implements the methods provided in the foregoing embodiments.
[0147] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in this application all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0148] It should be noted that personal information collected from users should be used for legitimate and reasonable purposes and should not be shared or sold outside of these legitimate uses. Furthermore, such collection / sharing should only be conducted after receiving the user's informed consent, including but not limited to notifying the user to read the user agreement / user notice and sign an agreement / authorization that includes authorization of relevant user information before the user uses the function. In addition, any necessary steps must be taken to protect and safeguard access to such personal information data and ensure that others with access to personal information data comply with their privacy policies and procedures.
[0149] This application is intended to provide an implementation scheme for users to selectively prevent the use or access to their personal information data. Specifically, this application is intended to provide hardware and / or software to prevent or block access to such personal information data. Once personal information data is no longer needed, risks can be minimized by restricting data collection and deleting data. Furthermore, where applicable, such personal information is de-identified to protect user privacy.
[0150] In the foregoing descriptions of the embodiments, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0151] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0152] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.
[0153] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0154] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0155] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0156] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0157] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.
Claims
1. A data parsing method, characterized in that, The method includes: Retrieve pending SIP messages; The SIP message is state-transformed to determine the state corresponding to the string in the SIP message, wherein the state is determined based on different SIP header field value types; The state-related actions are executed based on preset extraction rules to extract SIP signaling elements from the SIP message, wherein the actions include assignment, jump, and marking position; Until the string reaches its final state, obtain the structured SIP signaling composed of all the SIP signaling elements.
2. The method as described in claim 1, characterized in that, The SIP header field value types include string header fields, address header fields, and specific format header fields.
3. The method as described in claim 1, characterized in that, Also includes: The generation expression of the SIP message is rewritten to generate the extraction rule.
4. The method as described in claim 1, characterized in that, Also includes: If the string does not reach its final state within the preset time period, an exception message is generated.
5. A data parsing device, characterized in that, The device includes: The acquisition module is used to acquire SIP messages to be processed. A conversion module is used to perform state conversion on the SIP message and determine the state corresponding to the string in the SIP message, wherein the state is determined based on different SIP header field value types; An execution module is used to perform the state-related actions based on preset extraction rules to extract SIP signaling elements from the SIP message, wherein the actions include assignment, jump, and marking position; The judgment module is used to obtain structured SIP signaling composed of all the SIP signaling elements until the string reaches its final state.
6. The apparatus as claimed in claim 5, characterized in that, The SIP header field value types include string header fields, address header fields, and specific format header fields.
7. The apparatus as claimed in claim 5, characterized in that, It also includes a rewrite module for: The generation expression of the SIP message is rewritten to generate the extraction rule.
8. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-4.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-4.
10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of any one of claims 1-4.
Citation Information
Patent Citations
A 16-bit implementation method of the SIP protocol stack
CN101056305A
SIP Information Extraction
US20100142377A1