Message parsing method and device, electronic device and computer readable medium

By generating configuration files, the probe program can parse messages from heterogeneous systems, solving the problem of high resolution of messages from heterogeneous systems, and realizing unified probe engine development and low-cost maintenance.

CN117041387BActive Publication Date: 2025-03-07THE PEOPLES BANK OF CHINA DIGITAL CURRENCY INST +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310964953.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-02
Publication Date
2025-03-07
Estimated Expiration
2043-08-02

AI Technical Summary

Technical Problem

The prior art is difficult to effectively support the packet analysis of heterogeneous systems, resulting in high development and maintenance costs and the inability to quickly adapt to the access of new systems.

Method used

By generating the configuration files of the corresponding mechanism based on the configuration file template, the probe program can capture and parse packets based on the configuration file, and packet analysis that supports heterogeneous systems is realized.

Benefits of technology

It reduces the development and maintenance costs of supervisory probe programs, realizes unified probe engine development, and meets the application needs of configuration-based message analysis rules for heterogeneous systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117041387B_ABST
    Figure CN117041387B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for message parsing, an electronic device and a computer-readable medium, and relates to the field of computer technology. A specific implementation of the method includes: obtaining probe behavior configuration information and message parsing rules according to a configuration file, wherein the configuration file is generated by modifying a preset configuration file template based on the message parsing requirements of an organization; capturing message data according to the probe behavior configuration information, wherein the message data includes a request message and a response message; parsing the message data according to the message parsing rules, and assembling the parsing results of the corresponding request message and response message to obtain a message parsing result. This implementation realizes message parsing that supports heterogeneous systems, making it possible to develop a unified probe engine, thereby reducing the development and maintenance costs of the regulatory probe program, and meeting the application requirements of heterogeneous systems for message parsing based on configured message parsing rules.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a message parsing method and device, electronic equipment and computer-readable medium. Background Art

[0002] In the financial technology industry, in order to establish and improve a comprehensive prevention and control mechanism for financial technology innovation risks, promote differentiated risk warning and efficient emergency response, it is necessary to use regulatory probes, external perception, information sharing and reporting, etc. to collect and analyze the innovation risks of financial technology in real time, and create a safer, more convenient and transparent financial system. Regulatory probes are a new type of financial regulatory tool. In essence, they are a Web script program that uses web programming languages ​​to implement script files that detect sensitive information on servers to enhance the automation, intelligence and accuracy of supervision.

[0003] The core idea of ​​the regulatory probe is to analyze the target messages in the network traffic to capture the transaction data within the institution, which requires adapting to the different message systems of different institutions. If a set of rule setting systems is developed for each regulated system, it will bring huge development and maintenance costs; and when a new system is connected, additional development time is required. Therefore, how to achieve message parsing that supports heterogeneous systems at the lowest cost is a technical problem that needs to be solved urgently. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides a message parsing method and device, an electronic device and a computer-readable medium, which can generate a configuration file of a corresponding organization based on a configuration file template, so that the probe program can capture and parse messages according to the configuration file, thereby realizing message parsing that supports heterogeneous systems, making it possible to develop a unified probe engine, thereby reducing the development and maintenance costs of regulatory probe programs, and meeting the application needs of heterogeneous systems for message parsing based on configured message parsing rules.

[0005] To achieve the above objective, according to one aspect of an embodiment of the present invention, a method for parsing a message is provided.

[0006] A method for message parsing, comprising: obtaining probe behavior configuration information and message parsing rules according to a configuration file, wherein the configuration file is generated by modifying a preset configuration file template based on an organization's message parsing requirements; capturing message data according to the probe behavior configuration information, wherein the message data comprises a request message and a response message; parsing the message data according to the message parsing rules, and assembling the parsing results of the corresponding request message and response message to obtain a message parsing result.

[0007] Optionally, capturing the message data according to the probe behavior configuration information includes: performing message identifier matching on the message data flow according to the probe behavior configuration information, and using the message data with successful matching as the captured message data.

[0008] Optionally, the message parsing rule includes a message identifier; before parsing the message data according to the message parsing rule, the method further includes: determining a message parsing rule corresponding to the message data according to the message identifier of the message data.

[0009] Optionally, the message parsing rules also include message keywords, data types and extraction positions; parsing the message data according to the message parsing rules includes: searching for the message keyword from the message data by string matching, and determining the value of the message keyword according to the data type, and determining the position of the message keyword and its value in the parsing result according to the extraction position, so as to parse the message data.

[0010] Optionally, the message keyword includes a message status; the message data is parsed according to the message parsing rule, and the parsing results of the corresponding request message and response message are assembled to obtain a message parsing result, including: parsing the request message according to the message parsing rule to obtain a request message parsing result, and obtaining the message status of the request message; when the message status is a set final state and the message response is successful, parsing the response message corresponding to the request message to obtain a response message parsing result; assembling the request message parsing result and the response message parsing result to obtain a message parsing result.

[0011] Optionally, the method further includes: when the message status is not a set final status or the message status is not a successful message response, discarding the request message.

[0012] Optionally, it also includes: converting the format of the message parsing result and saving it in a message queue, wherein the converted format is a character separated value file format, and the first field of the converted message parsing result is the data type, the second field is the version number, and the third field and subsequent fields are the message keywords to be extracted from the message data and the corresponding message keyword values.

[0013] According to another aspect of an embodiment of the present invention, a device for parsing a message is provided.

[0014] A device for message parsing, comprising: a configuration acquisition module, used to obtain probe behavior configuration information and message parsing rules according to a configuration file, wherein the configuration file is generated by modifying a preset configuration file template based on the message parsing requirements of an organization; a message capture module, used to capture message data according to the probe behavior configuration information, wherein the message data includes a request message and a response message; and a message parsing module, used to parse the message data according to the message parsing rules, and assemble the parsing results of the corresponding request message and response message to obtain a message parsing result.

[0015] Optionally, the message capture module is further used to: perform message identifier matching on the message data flow according to the probe behavior configuration information, and use the message data with successful matching as the captured message data.

[0016] Optionally, the message parsing rule includes a message identifier; the device also includes a rule determination module, which is used to: before parsing the message data according to the message parsing rule, determine the message parsing rule corresponding to the message data according to the message identifier of the message data.

[0017] Optionally, the message parsing rules also include message keywords, data types and extraction positions; the message parsing module is also used to: search for the message keywords from the message data by string matching, and determine the value of the message keywords according to the data type, and determine the position of the message keywords and their values ​​in the parsing results according to the extraction position, so as to parse the message data.

[0018] Optionally, the message keywords include message status; the message parsing module is also used to: parse the request message according to the message parsing rules to obtain a request message parsing result, and obtain the message status of the request message; when the message status is a set final state and the message response is successful, parse the response message corresponding to the request message to obtain a response message parsing result; assemble the request message parsing result and the response message parsing result to obtain a message parsing result.

[0019] Optionally, the message parsing module is further used to: discard the request message when the message status is not a set final status or the message status is not a successful message response.

[0020] Optionally, it also includes a message conversion module, which is used to: convert the format of the message parsing result and save it in a message queue, wherein the converted format is a character separated value file format, and the first field of the converted message parsing result is the data type, the second field is the version number, and the third field and subsequent fields are the message keywords to be extracted from the message data and the corresponding message keyword values.

[0021] According to yet another aspect of an embodiment of the present invention, an electronic device for parsing a message is provided.

[0022] An electronic device for message parsing includes: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the message parsing method provided by an embodiment of the present invention.

[0023] According to yet another aspect of an embodiment of the present invention, a computer readable medium is provided.

[0024] A computer-readable medium stores a computer program, which, when executed by a processor, implements a message parsing method provided in an embodiment of the present invention.

[0025] An embodiment of the above invention has the following advantages or beneficial effects: by obtaining probe behavior configuration information and message parsing rules according to the configuration file, the configuration file is generated by modifying the preset configuration file template based on the message parsing requirements of the organization; capturing message data according to the probe behavior configuration information, the message data includes request messages and response messages; parsing the message data according to the message parsing rules, assembling the parsing results of the corresponding request messages and response messages to obtain the technical solution of the message parsing results, which can generate the configuration file of the corresponding organization based on the configuration file template, so that the probe program can capture and parse the message according to the configuration file, realizes message parsing that supports heterogeneous systems, and makes it possible to develop a unified probe engine, thereby reducing the development and maintenance costs of the regulatory probe program, and meeting the application needs of heterogeneous systems for message parsing based on configured message parsing rules.

[0026] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0028] Figure 1 Schematic diagram of main steps of a method for message parsing according to an embodiment of the present invention;

[0029] Figure 2 It is a schematic diagram of the implementation process of message parsing according to an embodiment of the present invention;

[0030] Figure 3 is a schematic diagram of a configuration style of a parsing rule according to an embodiment of the present invention;

[0031] Figure 4is a schematic diagram of a data transmission format between different systems according to an embodiment of the present invention;

[0032] Figure 5 2 is a schematic diagram of main modules of a device for message parsing according to an embodiment of the present invention;

[0033] Figure 6 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0034] Figure 7 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0035] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0036] In order to solve the technical problems existing in the prior art, the present invention provides a method and device for message parsing. The core idea is to map the common attributes in the message parsing requirements to a configuration file in a custom format. First, it can adapt to the message naming rules of heterogeneous systems, and second, it can facilitate operator modification and machine interpretation. The specific implementation process is:

[0037] (1) The operator obtains the configuration template

[0038] The configuration template is a data file in JSON format, which defines how to configure the message field information to be captured and parsed. Operators are technicians who use or actually deploy probes. They need to communicate with business personnel to clarify which messages and message fields need to be analyzed, and then the technicians fill in the necessary field content according to the template;

[0039] (2) Modify the template according to system naming rules and other constraints to generate a configuration file that is suitable for the current system

[0040] The system naming rule refers to the message naming rule used by the organization that deploys the probe. The constraints include the data format of the message, the data type of the message field, the location of the message field, etc. For example, if the organization name in the template is ABC, the organization should replace it according to the actual situation;

[0041] The operator (probe user or deployer) modifies the template using any text editor through the configuration module according to the template content. The modified configuration file will be read and parsed by the probe. The behavior of the probe will capture the target message and parse the target field according to the content of the configuration file;

[0042] (3) When the probe program starts, the probe's own crawling behavior is set according to the configuration file

[0043] The configuration template is in JSON format, which contains key information such as organization code, message format, message keywords, field attributes, field location, field type, etc. The probe uses this information to parse the target message.

[0044] Figure 1 FIG. 1 is a schematic diagram of the main steps of the message parsing method according to an embodiment of the present invention. Figure 1 As shown, the message parsing method of the embodiment of the present invention mainly includes the following steps S101 to S103.

[0045] Step S101: Probe behavior configuration information and message parsing rules are obtained according to a configuration file, and the configuration file is generated by modifying a preset configuration file template based on the message parsing requirements of the organization. According to an embodiment of the present invention, different organizations have different message parsing requirements. By analyzing the message parsing requirements of the organization to be message captured and parsed, common attributes are extracted, and a series of lists consisting of keywords and attributes are abstracted, and a configuration file template is further formed. Regardless of the format of any organization's message, it is a descriptive string similar to a Key-Value set. Through this layer of abstraction, no matter how complex the message or the message in different formats, it can be unified under this model, making it possible to develop a unified probe engine. In an embodiment of the present invention, the configuration file template is a data file in JSON format, and the file defines how to configure the message field information to be captured and parsed. The message formats of each organization are currently divided into two types, JSON and XML. The configuration file format in the present invention adopts JSON format, which can achieve a balance between readability and machine-readable automation.

[0046] Each institution will have its own unique institution identification (for example, ICBC uses the abbreviation icbc as its institution identification), message naming rules, data format, data type of message field, location of message field, etc. These are the message parsing requirements of each institution. By modifying the configuration file template according to the message parsing requirements of the institution, the configuration file of the probe program for message parsing corresponding to the institution can be obtained. The configuration file mainly defines the behavior of the probe and the message parsing rules.

[0047] Step S102: Capture message data according to the probe behavior configuration information, the message data including request messages and response messages. In an embodiment of the present invention, when the probe program is started, the behavior of the probe program is initialized according to the probe behavior configuration information in the configuration file, and the capture behavior is performed according to the probe behavior configuration information. Specifically, when capturing message data according to the probe behavior configuration information, it may include: matching message identifiers of message data streams according to the probe behavior configuration information, and using successfully matched message data as captured message data.

[0048] According to an embodiment of the present invention, when the probe program captures message data, it can filter the message data stream according to the identification rules of the configured message identifier to obtain the message data to be captured. Specifically, for example, if the message data of a certain organization is to be captured and analyzed, it can be determined whether the message data is the message data of the organization to be captured based on the message identifier of the message data. If so, it is captured and analyzed, otherwise, the message data is discarded. Among them, the message identifier can generally generate different identifiers according to different organizations, for example, the organization identifier is included in the message identifier.

[0049] Step S103: Parse the message data according to the message parsing rules, and assemble the parsing results of the corresponding request message and response message to obtain the message parsing result. According to an embodiment of the present invention, when setting the message parsing rules in the configuration file, the message parsing rules can include message identifiers to form an association relationship between the message identifiers and the message parsing rules. In addition, before parsing the message data according to the message parsing rules, it is also necessary to determine the message parsing rules corresponding to the message data according to the message identifier of the message data. In this way, the corresponding message parsing rules can be obtained for parsing the message data.

[0050] According to an embodiment of the present invention, the message parsing rule also includes a message keyword, a data type, and an extraction position. And, parsing the message data according to the message parsing rule includes: searching the message keyword from the message data by string matching, determining the value of the message keyword according to the data type, and determining the position of the message keyword and its value in the parsing result according to the extraction position, so as to parse the message data. Since the probe uses the "pattern matching" principle to screen messages, the three elements of message keywords, data types, and extraction positions are identified in the message parsing rule for configuration. Message keywords are used for string matching, data types are used to distinguish message fields, and extraction positions indicate the position of the captured fields in the output record. In an embodiment of the present invention, message keywords include, for example, a certain institution's deposit message keyword "transferIn", an outgoing message keyword "transferOut", a transaction amount keyword "amount", a message status keyword "status", etc.; data types are such as string strings, number values, etc.; extraction positions are such as pos=2, etc.

[0051] According to another embodiment of the present invention, the message keyword includes the message status. Among them, the message status indicates the current state of the message, which mainly includes two parts. One part is whether the message is already in the preset final state, for example: if it corresponds to transfer processing, the final state should be transfer completed; if it corresponds to order processing, the final state should be order received, etc. The other part is the response result of the message, and the response result of the message has three states: success, failure and timeout. According to an embodiment of the present invention, when the message data is parsed according to the message parsing rules, the corresponding request message and response message parsing results are assembled to obtain the message parsing result, which may specifically include:

[0052] Parsing the request message according to the message parsing rule to obtain a request message parsing result, and obtaining the message status of the request message;

[0053] When the message state is the set final state and the message response is successful, parsing the response message corresponding to the request message to obtain a response message parsing result;

[0054] The request message parsing result and the response message parsing result are assembled to obtain a message parsing result.

[0055] According to another embodiment of the present invention, when the message state is not the set final state or the message state is not a successful message response, the request message is discarded. In the embodiment of the present invention, only the message with a successful response and a final state needs to be paid attention to. For the message that does not respond successfully or is not a final state, the analysis is meaningless.

[0056] According to another embodiment of the present invention, after performing message parsing, the message parsing result can also be format-converted and saved in a message queue, wherein the converted format is a character-separated value file format, and the first field of the converted message parsing result is a data type, the second field is a version number, and the third field and subsequent fields are message keywords to be extracted from the message data and the corresponding message keyword values. Since additional information may need to be added when data is transmitted between different systems, different systems will correspond to different data formats. When data is transmitted from one system to another, data format conversion will be performed, for example: In this embodiment of the present invention, the character-separated value file format CSV format is used in order to transmit message summaries between the probe program and the message queue Kafka.

[0057] In one embodiment of the present invention, when the message parsing result of a probe program is saved in the message queue of Kafka, the data format information that needs to be stored is shown in Table 1 below.

[0058] Table 1

[0059]

[0060] The data volume in Table 1 refers to the number of characters in the data in the example. In the embodiment of the present invention, the string in the example is directly transmitted to Kafka as a record.

[0061] Figure 2 FIG. 1 is a schematic diagram of the implementation flow of message parsing according to an embodiment of the present invention. Figure 2As shown, in an embodiment of the present invention, the process of message parsing mainly includes two parts, one part is implemented by the configuration module, and the other part is implemented by the probe program. Among them, the configuration module is used to obtain the configuration file template, and then modify the configuration file template according to the message parsing requirements of the organization to generate the configuration file corresponding to the organization. The operations performed by the probe program mainly include: reading the configuration file and initializing the probe behavior; extracting the message data stream; matching the message identifier of the message data stream, if the match fails, the message data packet is discarded, if the match is successful, the corresponding message parsing rule is found according to the message identifier of the message data, and then the message parsing rule is used to parse the message data. First, extract the keywords and corresponding values ​​of the request message, wherein the message keywords include the message status; judge whether the message status is the final state and the response is successful, if so, extract the keywords and corresponding values ​​of the response message, and then assemble them with the keywords and corresponding values ​​of the request message to obtain the message parsing result, otherwise the message data packet is discarded.

[0062] Figure 3 FIG. 1 is a schematic diagram of a configuration style of a parsing rule according to an embodiment of the present invention. Figure 3 As shown, in an embodiment of the present invention, the probe program captures the message data according to the message identifier (for example, using the organization identifier org as the message identifier) ​​icbc and the message format json, and then parses the captured message data. For the captured message data, first match the incoming message and the outgoing message according to the keyword message type, each message has a message number id, and the data type type of the message number id is a string string. Then, obtain the keywords and corresponding values ​​of each message, wherein the keywords include the message number id, the transaction amount amount, and the status status, and each keyword corresponds to a data type, and the keywords and corresponding values ​​are to be in the field position in the message parsing result.

[0063] Figure 4 FIG. 1 is a schematic diagram of the data transmission format between different systems according to an embodiment of the present invention. Figure 4 As shown, the data format transmitted between the probe program and the Kafka message queue on the institutional side is the character separated value file format (CSV), the data format transmitted between the Kafka message queue on the institutional side and the on-chain service system is, for example, the JSON format, and the data format transmitted between the on-chain service system and the blockchain is, for example, the JSON format. Among them, the on-chain service system is used to upload the data under the blockchain to the blockchain. The data format transmitted between the blockchain and the Kafka message queue on the central bank side is, for example, the JSON format, and the data format transmitted between the Kafka message queue on the central bank side and the database is, for example, the JSON format.

[0064] Figure 5Schematic diagram of the main modules of the apparatus for message parsing according to an embodiment of the present invention. Figure 5 As shown, the message parsing device 500 of the embodiment of the present invention mainly includes a configuration acquisition module 501, a message capture module 502 and a message parsing module 503.

[0065] The configuration acquisition module 501 is used to acquire the probe behavior configuration information and the message parsing rules according to the configuration file, wherein the configuration file is generated by modifying the preset configuration file template based on the message parsing requirements of the organization;

[0066] A message capture module 502, configured to capture message data according to the probe behavior configuration information, wherein the message data includes a request message and a response message;

[0067] The message parsing module 503 is used to parse the message data according to the message parsing rule, and assemble the parsing results of the corresponding request message and response message to obtain a message parsing result.

[0068] According to an embodiment of the present invention, the message capture module 502 may also be used for:

[0069] The message data flow is matched with message identifiers according to the probe behavior configuration information, and the message data with successful matching is used as the captured message data.

[0070] According to another embodiment of the present invention, the message parsing rule includes a message identifier;

[0071] The message parsing device 500 may further include a rule determination module (not shown in the figure) for:

[0072] Before parsing the message data according to the message parsing rule, the message parsing rule corresponding to the message data is determined according to the message identifier of the message data.

[0073] According to yet another embodiment of the present invention, the message parsing rule further includes a message keyword, a data type, and an extraction location;

[0074] The message parsing module 503 may also be used for:

[0075] The message keyword is searched from the message data by string matching, and the value of the message keyword is determined according to the data type, and the position of the message keyword and its value in the parsing result is determined according to the extraction position to parse the message data.

[0076] According to yet another embodiment of the present invention, the message keyword includes a message status;

[0077] The message parsing module 503 may also be used for:

[0078] Parsing the request message according to the message parsing rule to obtain a request message parsing result, and obtaining the message status of the request message;

[0079] When the message state is the set final state and the message response is successful, parsing the response message corresponding to the request message to obtain a response message parsing result;

[0080] The request message parsing result and the response message parsing result are assembled to obtain a message parsing result.

[0081] According to yet another embodiment of the present invention, the message parsing module 503 may also be used for:

[0082] When the message status is not the set final status or the message status is not a successful message response, the request message is discarded.

[0083] According to another embodiment of the present invention, the message parsing device 500 may further include a message conversion module (not shown in the figure) for:

[0084] The message parsing result is format converted and saved in a message queue, wherein the converted format is a character separated value file format, and the first field of the converted message parsing result is the data type, the second field is the version number, and the third field and subsequent fields are the message keywords to be extracted from the message data and the corresponding message keyword values.

[0085] According to the technical solution of the embodiment of the present invention, the probe behavior configuration information and message parsing rules are obtained according to the configuration file, and the configuration file is generated by modifying the preset configuration file template based on the message parsing requirements of the organization; the message data is captured according to the probe behavior configuration information, and the message data includes request messages and response messages; the message data is parsed according to the message parsing rules, and the parsing results of the corresponding request messages and response messages are assembled to obtain the message parsing results. The technical solution can generate a configuration file of the corresponding organization based on the configuration file template, so that the probe program can capture and parse the message according to the configuration file, and realizes support for message parsing of heterogeneous systems, making it possible to develop a unified probe engine, thereby reducing the development and maintenance costs of the regulatory probe program, and meeting the application needs of heterogeneous systems for message parsing based on configured message parsing rules.

[0086] Figure 6 An exemplary system architecture 600 is shown to which the message parsing method or message parsing apparatus according to the embodiments of the present invention can be applied.

[0087] like Figure 6As shown, system architecture 600 may include terminal devices 601, 602, 603, network 604 and server 605. Network 604 is used to provide a medium for communication links between terminal devices 601, 602, 603 and server 605. Network 604 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0088] Users can use terminal devices 601, 602, 603 to interact with server 605 through network 604 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 601, 602, 603, such as message parsing applications, web browser applications, commercial banking applications, probe program tools, etc. (only examples).

[0089] The terminal devices 601 , 602 , and 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.

[0090] Server 605 can be a server that provides various services, such as a background management server that provides support for message parsing requests sent by users using terminal devices 601, 602, and 603 (only as an example). The background management server can obtain probe behavior configuration information and message parsing rules for the received message parsing request and other data according to the configuration file, and the configuration file is generated by modifying the preset configuration file template based on the message parsing requirements of the organization; capture message data according to the probe behavior configuration information, and the message data includes request messages and response messages; parse the message data according to the message parsing rules, assemble the parsing results of the corresponding request messages and response messages, and feed back the processing results (such as message parsing results - only as an example) to the terminal device.

[0091] It should be noted that the message parsing method provided in the embodiment of the present invention is generally executed by the server 605 , and accordingly, the message parsing device is generally set in the server 605 .

[0092] It should be understood that Figure 6 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0093] Reference below Figure 7 , which shows a schematic diagram of the structure of a computer system 700 of a terminal device or a server suitable for implementing an embodiment of the present invention. Figure 7 The terminal device or server shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0094] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0095] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.

[0096] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the system of the present invention are executed.

[0097] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0098] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0099] The units or modules involved in the embodiments of the present invention may be implemented in software or hardware. The units or modules described may also be provided in a processor. For example, they may be described as follows: a processor includes a configuration acquisition module, a message capture module, and a message parsing module. The names of these units or modules do not, in certain cases, constitute limitations on the units or modules themselves. For example, the configuration acquisition module may also be described as a "module for acquiring probe behavior configuration information and message parsing rules according to a configuration file."

[0100] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by a device, the device includes: obtaining probe behavior configuration information and message parsing rules according to a configuration file, wherein the configuration file is generated by modifying a preset configuration file template based on the message parsing requirements of the organization; capturing message data according to the probe behavior configuration information, wherein the message data includes a request message and a response message; parsing the message data according to the message parsing rules, and assembling the parsing results of the corresponding request message and response message to obtain a message parsing result.

[0101] According to the technical solution of the embodiment of the present invention, the probe behavior configuration information and message parsing rules are obtained according to the configuration file, and the configuration file is generated by modifying the preset configuration file template based on the message parsing requirements of the organization; the message data is captured according to the probe behavior configuration information, and the message data includes request messages and response messages; the message data is parsed according to the message parsing rules, and the parsing results of the corresponding request messages and response messages are assembled to obtain the message parsing results. The technical solution can generate a configuration file of the corresponding organization based on the configuration file template, so that the probe program can capture and parse the message according to the configuration file, and realizes support for message parsing of heterogeneous systems, making it possible to develop a unified probe engine, thereby reducing the development and maintenance costs of the regulatory probe program, and meeting the application needs of heterogeneous systems for message parsing based on configured message parsing rules.

[0102] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A message parsing method, characterized in that: include: Probe behavior configuration information and message parsing rules are obtained according to a configuration file, wherein the configuration file is generated by modifying a preset configuration file template based on the message parsing requirements of an organization, wherein the configuration file template is formed by analyzing the message parsing requirements of an organization to capture and parse messages, extracting common attributes, and abstractly obtaining a series of lists consisting of keywords and attributes; Capturing message data according to the probe behavior configuration information, the message data including a request message and a response message; Parsing the message data according to the message parsing rule, and assembling the parsing results of the corresponding request message and response message to obtain a message parsing result; The message parsing rules also include message keywords, data types and extraction locations; Parsing the message data according to the message parsing rule includes: searching the message keyword from the message data by string matching, determining the value of the message keyword according to the data type, and determining the position of the message keyword and its value in the parsing result according to the extraction position, so as to parse the message data; The message keywords include message status; parsing the message data according to the message parsing rules, and assembling the parsing results of the corresponding request message and response message to obtain the message parsing result, including: parsing the request message according to the message parsing rules to obtain the request message parsing result, and obtaining the message status of the request message; when the message status is the set final state and the message response is successful, parsing the response message corresponding to the request message to obtain the response message parsing result; assembling the request message parsing result and the response message parsing result to obtain the message parsing result.

2. The method according to claim 1, characterized in that The message data captured according to the probe behavior configuration information includes: The message data flow is matched with message identifiers according to the probe behavior configuration information, and the message data with successful matching is used as the captured message data.

3. The method according to claim 1 or 2, characterized in that: The message parsing rule includes a message identifier; Before parsing the message data according to the message parsing rule, the method further includes: A message parsing rule corresponding to the message data is determined according to the message identifier of the message data.

4. The method according to claim 1, characterized in that Also includes: When the message status is not the set final status or the message status is not a successful message response, the request message is discarded.

5. The method according to claim 1, characterized in that Also includes: The message parsing result is format converted and saved in a message queue, wherein the converted format is a character separated value file format, and the first field of the converted message parsing result is the data type, the second field is the version number, and the third field and subsequent fields are the message keywords to be extracted from the message data and the corresponding message keyword values.

6. A message parsing device, characterized in that: include: A configuration acquisition module is used to acquire probe behavior configuration information and message parsing rules according to a configuration file. The configuration file is generated by modifying a preset configuration file template based on the message parsing requirements of the organization. The configuration file template is formed by analyzing the message parsing requirements of the organization to be message captured and parsed, extracting common attributes, and abstracting a series of lists consisting of keywords and attributes; A message capture module, used to capture message data according to the probe behavior configuration information, wherein the message data includes a request message and a response message; A message parsing module, used to parse the message data according to the message parsing rules, and assemble the parsing results of the corresponding request message and response message to obtain a message parsing result; The message parsing rule also includes a message keyword, a data type and an extraction position; the message parsing module is further used to: search for the message keyword from the message data by string matching, determine the value of the message keyword according to the data type, and determine the position of the message keyword and its value in the parsing result according to the extraction position, so as to parse the message data; The message keywords include message status; the message parsing module is further used to: parse the request message according to the message parsing rule to obtain the request message parsing result, and obtain the message status of the request message; when the message status is the set final state and the message response is successful, parse the response message corresponding to the request message to obtain the response message parsing result; The request message parsing result and the response message parsing result are assembled to obtain a message parsing result.

7. The device according to claim 6, characterized in that The message capture module is also used for: The message data flow is matched with message identifiers according to the probe behavior configuration information, and the message data with successful matching is used as the captured message data.

8. The device according to claim 6 or 7, characterized in that The message parsing rule includes a message identifier; The device also includes a rule determination module, which is used to: Before parsing the message data according to the message parsing rule, the message parsing rule corresponding to the message data is determined according to the message identifier of the message data.

9. The device according to claim 6, characterized in that The message parsing module is also used for: When the message status is not the set final status or the message status is not a successful message response, the request message is discarded.

10. The device according to claim 6, characterized in that It also includes a message conversion module for: The message parsing result is format converted and saved in a message queue, wherein the converted format is a character separated value file format, and the first field of the converted message parsing result is the data type, the second field is the version number, and the third field and subsequent fields are the message keywords to be extracted from the message data and the corresponding message keyword values.

11. An electronic device for message parsing, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.

12. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Detection method and device for service quality of network equipment

    CN107453884A

  • Automatic parsing method and apparatus of application protocol message

    CN108040040A

  • Communication packet capturing device based on single-chip microcomputer and communication packet capturing method

    CN115665017A