Interface analysis method, device, equipment and medium

Through a layered architecture consisting of an interface layer, a parser layer, a business data layer, and a business service layer, the system achieves standardized processing of interface request data and decoupling of business processing. This solves the problems of high system complexity and poor stability during interface parsing, and improves the system's scalability and adaptability.

CN122179485APending Publication Date: 2026-06-09SHENZHEN YOUIBOT ROBOTICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610620682.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-08
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

In existing technologies, the interface parsing process suffers from high system complexity and maintenance costs due to differences in communication protocols between different external systems, and lacks a clear layered design, which affects the stability and reliability of interface interaction.

Method used

It adopts a layered architecture consisting of an interface layer, a parser layer, a business data layer, and a business service layer. The parser layer identifies the communication protocol type and generates target parsing rules, thereby achieving standardized processing of interface request data and decoupling of business processing.

Benefits of technology

It reduces system complexity, improves system stability, maintainability, and adaptability to multi-protocol environments, and ensures the consistency and reliability of response data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122179485A_ABST
    Figure CN122179485A_ABST
Patent Text Reader

Abstract

This invention relates to the field of computer technology and discloses an interface parsing method, apparatus, device, and medium applied to an interface parser. The method includes: receiving interface request data sent by an external system through an interface layer and transmitting the interface request data to a parser layer; identifying the communication protocol type through the parser layer and matching the corresponding protocol adaptation rules according to the identified communication protocol type to generate target interface parsing rules; performing standardization processing on the interface request data according to the target interface parsing rules through the parser layer to obtain standardized request data which is then written to a business data layer; obtaining the standardized request data through a business service layer and executing business processing logic to obtain a business processing result which is returned to the parser layer; encapsulating the business processing result through the parser layer and outputting the encapsulated target response data to the external system through the interface layer. This application can improve the system's adaptability to multi-protocol environments and its overall operational stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to an interface parsing method, apparatus, device, and medium. Background Technology

[0002] In the field of information system integration, business systems typically need to interact with multiple external systems through interfaces. Because different external systems vary significantly in communication protocol types, message structures, and field organization, the interface parsing process often requires designing separate parsing logic for each protocol. This results in strong coupling between the interface processing code and the specific protocol, leading to a complex overall system structure and high maintenance costs.

[0003] In related technologies, protocol identification, data parsing, field conversion, and business processing of interface requests are often mixed in the same process flow, lacking a clear layered design. This necessitates simultaneous modifications to the business processing logic when adding new protocol types or adjusting interface rules, resulting in insufficient scalability. Furthermore, differences in data formats between different protocols can easily introduce errors during parsing, affecting the stability and reliability of interface interactions. Therefore, there is an urgent need for an interface parsing method that can uniformly parse interface request data and decouple protocol processing from business processing, thereby improving the system's adaptability to multi-protocol environments and overall operational stability. Summary of the Invention

[0004] This invention provides an interface parsing method, apparatus, device, and medium to solve the technical problem of poor stability and reliability of interface interaction in related technologies.

[0005] Firstly, an interface parsing method is provided, applied to an interface parser, wherein the interface parser includes an interface layer, a parser layer, a business data layer, and a business service layer, and the method includes: The interface layer receives interface request data sent by external systems and transmits the interface request data to the parser layer. The parser layer identifies the communication protocol type corresponding to the interface request data, and generates the target interface parsing rules by matching the corresponding protocol adaptation rules according to the identified communication protocol type. The parser layer performs standardization processing on the interface request data according to the target interface parsing rules to obtain standardized request data, and then writes the standardized request data into the business data layer. The business service layer obtains the standardized request data from the business data layer, executes the corresponding business processing logic, and returns the business processing result to the parser layer. The parser layer encapsulates the business processing result and outputs the encapsulated target response data to the external system through the interface layer.

[0006] Secondly, an interface parsing device is provided, comprising: The receiving module is used to receive interface request data sent by an external system through the interface layer, and transmit the interface request data to the parser layer; The protocol identification module is used to identify the communication protocol type corresponding to the interface request data through the parser layer, and to generate the target interface parsing rules by matching the identified communication protocol type with the corresponding protocol adaptation rules. The rule matching module is used to perform standardization processing on the interface request data according to the target interface parsing rules through the parser layer to obtain standardized request data, and write the standardized request data into the business data layer; The protocol encapsulation module is used to obtain the standardized request data from the business data layer through the business service layer, execute the corresponding business processing logic, and return the business processing result to the parser layer. The parser layer encapsulates the business processing result and outputs the encapsulated target response data to the external system through the interface layer.

[0007] Thirdly, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the interface resolution method described above when executing the computer program.

[0008] Fourthly, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps of the above-described interface parsing method.

[0009] In the aforementioned interface parsing method, apparatus, computer device, and storage medium, the method is applied to an interface parser, which includes an interface layer, a parser layer, a business data layer, and a business service layer. The method includes: receiving interface request data sent by an external system through the interface layer and transmitting the interface request data to the parser layer; identifying the communication protocol type corresponding to the interface request data through the parser layer, and matching the corresponding protocol adaptation rules according to the identified communication protocol type to generate target interface parsing rules; performing standardization processing on the interface request data according to the target interface parsing rules through the parser layer to obtain standardized request data, and writing the standardized request data to the business data layer; obtaining the standardized request data from the business data layer through the business service layer, executing the corresponding business processing logic, returning the business processing result to the parser layer, encapsulating the business processing result, and outputting the encapsulated target response data to the external system through the interface layer. In this invention, by setting up a layered architecture of interface layer, parser layer, business data layer, and business service layer in the interface parser, effective decoupling between interface access, protocol parsing, data conversion, and business processing is achieved. By uniformly identifying the communication protocol type of interface request data at the parser layer and performing standardization processing based on matching protocol adaptation rules, interface requests under different communication protocols can be converted into a unified data format and written to the business data layer. This avoids the business service layer directly handling multi-protocol differences, reducing system complexity. Furthermore, the business processing results are encapsulated by the parser layer before being output to external systems, effectively ensuring the consistency of response data with external protocol requirements. Therefore, the interface parsing process possesses good versatility and scalability. When adding new protocol types or adjusting interface rules, there is no need to modify the business processing logic, which helps improve system stability, maintainability, and adaptability in multi-protocol environments. Attached Figure Description

[0010] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 This is a schematic diagram of an application environment for an interface parsing method according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating an interface parsing method according to an embodiment of the present invention; Figure 3 yes Figure 2 A schematic diagram of a specific implementation method for step S20; Figure 4 This is a schematic diagram of the interface parsing device in one embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention; Figure 6 This is another structural schematic diagram of a computer device according to one embodiment of the present invention. Detailed Implementation

[0012] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0013] The interface parsing method provided in this embodiment of the invention can be applied to, for example... Figure 1In this application environment, the client communicates with the server via a network. The server can receive interface request data sent by an external system through the interface layer via the client, and transmit the interface request data to the parser layer. The parser layer identifies the communication protocol type corresponding to the interface request data, matches the corresponding protocol adaptation rules according to the identified communication protocol type, and generates target interface parsing rules. The parser layer performs standardization processing on the interface request data according to the target interface parsing rules to obtain standardized request data, and writes the standardized request data into the business data layer. The business service layer obtains the standardized request data from the business data layer, executes the corresponding business processing logic, and returns the business processing result to the parser layer. The parser layer encapsulates the business processing result and outputs the encapsulated target response data to the external system through the interface layer. In this invention, by setting up a layered architecture of interface layer, parser layer, business data layer, and business service layer in the interface parser, effective decoupling between interface access, protocol parsing, data conversion, and business processing is achieved. By uniformly identifying the communication protocol type of interface request data at the parser layer and performing standardization processing based on matching protocol adaptation rules, interface requests under different communication protocols can be converted into a unified data format and written to the business data layer. This avoids the business service layer directly handling multi-protocol differences, reducing system complexity. Furthermore, the business processing results are encapsulated by the parser layer before being output to external systems, effectively ensuring the consistency of response data with external protocol requirements. Therefore, the interface parsing process possesses good versatility and scalability. When adding new protocol types or adjusting interface rules, there is no need to modify the business processing logic, which helps improve system stability, maintainability, and adaptability in multi-protocol environments. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. The invention will be described in detail below through specific embodiments.

[0014] Please see Figure 2 As shown, Figure 2 This is a flowchart illustrating an interface parsing method provided in an embodiment of the present invention. The method is applied to an interface parser, which includes an interface layer, a parser layer, a business data layer, and a business service layer, and includes the following steps: S10: Receive interface request data sent by an external system through the interface layer, and transmit the interface request data to the parser layer.

[0015] For example, interface request data sent by external systems can be received through the interface layer. This interface request data may include request message content, connection port information, source address information, and session-related information, etc., which are not limited in this application. The interface layer, as the unified entry point for the interface parser, is only responsible for listening to, receiving, and initially carrying external system requests. It does not involve identifying communication protocol types or parsing business meanings, thereby avoiding the introduction of complex parsing logic during the access phase.

[0016] Furthermore, the interface request data can be directly transmitted to the parser layer, so that subsequent communication protocol identification, protocol adaptation rule matching, and data standardization processing can all be completed in the parser layer, which is conducive to separating the interface access logic from the parsing processing logic.

[0017] This approach allows for flexible expansion or adjustment of the parsing capabilities of the parser layer without affecting the stable operation of the interface layer. It provides a foundation for supporting multiple communication protocols and different interface rules, while also improving the overall maintainability and scalability of the interface parser.

[0018] S20: The parser layer identifies the communication protocol type corresponding to the interface request data, and generates the target interface parsing rule by matching the corresponding protocol adaptation rule according to the identified communication protocol type.

[0019] For example, this embodiment aims to identify the protocol and determine the parsing rules for interface request data, providing a clear basis for subsequent data standardization processing. Specifically, the parser layer can analyze the interface request data. For instance, based on features such as connection port information, message structure characteristics, message header fields, or session identifier information carried by the interface request data, the corresponding communication protocol type can be identified, thereby determining the specific communication method used by the current interface request. This embodiment enables the parser layer to accurately distinguish interface requests from different sources in an environment where multiple protocols coexist, avoiding parsing errors caused by mixed protocols.

[0020] After identifying the communication protocol type, the parser layer further matches the corresponding protocol adaptation rule from a pre-configured set of protocol adaptation rules based on the identified communication protocol type, and generates the target interface parsing rule by combining the interface identification information. The target interface parsing rule describes the field structure, parsing path, and mapping relationship that the current interface request should follow during the parsing process, thus providing a unified and configurable rule foundation for the standardized processing of interface request data, which is beneficial for the flexible expansion and centralized management of the protocol parsing process.

[0021] Among them, such as Figure 3As shown, in step S20, the interface request data includes access port information, message header field features, and session identifier information. The step of identifying the communication protocol type corresponding to the interface request data through the parser layer, and generating target interface parsing rules by matching the identified communication protocol type with the corresponding protocol adaptation rules, includes the following steps: S21: The parser layer identifies the communication protocol type based on the access port information, the packet header field features, and the session identifier information to obtain the protocol identification result.

[0022] S22: Based on the protocol identification result, the parser layer determines at least one protocol adaptation rule that matches the communication protocol type from the preset protocol adaptation rule set.

[0023] S23: The parser layer generates the target interface parsing rule based on the at least one protocol adaptation rule and the external system identifier and interface identifier pointed to by the interface request data.

[0024] For example, step S20 can achieve accurate identification of the communication protocol type and determination of parsing rules by comprehensively analyzing the multi-dimensional feature information contained in the interface request data. The interface request data includes not only specific business data content, but also feature data related to the communication protocol, such as access port information, message header field characteristics, and session identification information, providing a foundation for protocol identification.

[0025] Furthermore, in step S21, the access port information, message header field features, and session identifier information can be obtained by the parser layer, and the communication protocol type used by the interface request data can be determined based on the above information to obtain the protocol identification result. For example, different types of communication connections can be distinguished by port number, message format features can be determined by message header field, or the existence of a session management mechanism can be identified by session identifier, thereby improving the accuracy of protocol identification. In step S22, the parser layer selects at least one protocol adaptation rule that matches the communication protocol type from a preset protocol adaptation rule set according to the protocol identification result. The protocol adaptation rule is used to describe the message structure, parsing method, and interaction constraints under the corresponding communication protocol, providing a technical basis for subsequent parsing processing. In step S23, the parser layer further combines the at least one protocol adaptation rule with the external system identifier and interface identifier pointed to by the interface request data to associate and refine the parsing rules, generating a target interface parsing rule for the current interface request. This approach enables different external systems or interfaces under the same communication protocol to adopt differentiated parsing rules, thereby improving the flexibility and adaptability of the interface parsing process.

[0026] Based on the above embodiments, the rules stored in the protocol adaptation rule base are generated based on database table configuration; wherein, the database tables include: a system table, used to record the external system identifier, network address, protocol type, and protocol-specific configuration parameters; a standard interface table, used to define the standard interface specifications supported internally by the interface parser, including interface identifier, interface type, and data direction; a configuration interface table, used to establish the binding relationship between the external system and the standard interface, and to store interface message samples of the external system; a standard field table, used to define the specifications of fields included in the preset business data model; and a configuration field table, used to record the mapping relationship between the field positions in the interface message samples and the fields in the standard field table.

[0027] For example, the protocol adaptation rule base is not generated through hard coding, but rather dynamically generated based on the configuration results of the database tables, thereby achieving centralized management and flexible adjustment of interface parsing rules. By setting up a system table, the identification information, network address information, communication protocol type, and protocol-specific configuration parameters of external systems are uniformly recorded, enabling the parser layer to accurately identify external system attributes during operation and load the corresponding protocol processing parameters accordingly. Simultaneously, a standard interface table defines the standard interface specifications supported internally by the interface parser, clarifying the interface identifier, interface type, and data direction of each interface, providing a basic interface model for the unified parsing of different external system interfaces.

[0028] Furthermore, by configuring an interface table, a binding relationship is established between external systems and standard interfaces, and sample interface messages corresponding to external systems are stored, enabling the parser layer to configure parsing rules based on the actual message structure. On this basis, a standard field table is used to define the name, type, and hierarchy specifications of each field in the preset business data model, serving as the basis for a unified internal data structure; the configuration field table is used to record the specific location of each field in the sample interface message and establish a mapping relationship between them and the fields in the standard field table. Through this multi-table collaborative configuration method, a protocol adaptation rule base can be automatically generated, giving the interface parsing process excellent configurability. When external systems or interface rules change, only the database configuration needs to be adjusted to update the rules, thereby significantly improving the scalability and maintenance efficiency of the interface parser.

[0029] S30: The parser layer performs standardization processing on the interface request data according to the target interface parsing rules to obtain standardized request data, and writes the standardized request data into the business data layer.

[0030] For example, the parser layer parses each field in the interface request data item by item according to the target interface parsing rules, thereby determining the data content related to business processing in the external system message. The standardization process may include parsing the field positions in the interface request data, extracting field values, and converting field data types, so that interface request data from different communication protocols or different message structures can be uniformly understood.

[0031] Furthermore, during standardization processing, the parser layer can also perform validation on the extracted data based on the field constraints defined in the target interface parsing rules. This includes validating the data type, required attributes, or value range of fields to ensure the generated data conforms to the specifications of the preset business data model. After completing field parsing and validation, the parser layer maps external fields in the interface request data to internally unified standard fields, constructs standardized request data, and writes this standardized request data into the business data layer. This step ensures that the data stored in the business data layer no longer depends on specific communication protocols or external system formats, thus providing a stable and standardized data foundation for subsequent unified processing by the business service layer.

[0032] In some embodiments, the step of performing standardization processing on the interface request data according to the target interface parsing rules by the parser layer to obtain standardized request data includes: locating and extracting external fields in the interface request data by the parser layer based on preset field path information in the target interface parsing rules to obtain extracted external field information; performing data type validation and mandatory field validation on the external field information by the parser layer to obtain validation results; if the validation result is successful, converting the external field information into internal standard fields according to field mapping relationships by the parser layer, and constructing the standardized request data based on the internal standard fields.

[0033] For example, the parser layer locates and extracts the required external fields from the interface request data based on the predefined field path information in the target interface parsing rules. Extracting these external fields ensures the integrity and accuracy of the data foundation for subsequent processing. Next, the parser layer performs data type validation and mandatory field validation on the extracted external fields. Data type validation confirms whether the field content matches the expected type, such as string, number, or boolean value; mandatory field validation confirms whether any critical fields are missing. Only when the validation results show that they pass will the parser layer convert the external field information into internal standard fields according to the field mapping relationship and construct standardized request data based on these internal standard fields. Finally, the standardized request data forms a unified and standardized format, facilitating subsequent business processing or data operations within the system.

[0034] In some embodiments, the field path information is used to indicate the positional relationship of the external field in the interface request data, and the field path information includes at least a path expression method based on structured messages or a byte offset expression method based on binary messages.

[0035] For example, the field path information is used to explicitly indicate the specific location of an external field in the interface request data, thereby providing a basis for the parser layer to accurately extract the field data. Since different external systems use different communication protocols and message organization methods, interface request data may be in structured message form or binary message form. Therefore, describing the field location through field path information helps improve the universality and accuracy of the field parsing process.

[0036] Specifically, when the interface request data is a structured message, the field path information can be described using a path representation to indicate the access path of the target field in the hierarchical structure, enabling the parser layer to locate and extract the corresponding field value step by step according to the path. When the interface request data is a binary message, the field path information can be described using a byte offset representation to indicate the starting position and length information of the target field in the binary data stream, enabling the parser layer to complete field parsing based on the offset relationship. By simultaneously supporting different forms of field path information, the interface parsing method can be compatible with multiple message structures, enhancing its adaptability to different communication protocols and external system interfaces.

[0037] S40: The standardized request data is obtained from the business data layer through the business service layer, and the corresponding business processing logic is executed to obtain the business processing result and return it to the parser layer. The parser layer encapsulates the business processing result and outputs the encapsulated target response data to the external system through the interface layer.

[0038] For example, standardized request data can be obtained from the business data layer through the business service layer, enabling the business service layer to execute business processing logic based on a unified data structure without being aware of the communication protocol type or external message structure used by the interface request, thereby reducing the dependence of the business processing process on interface differences.

[0039] After business processing is completed, the resulting business result is returned to the parser layer, which encapsulates the result according to the corresponding target interface parsing rules. This encapsulation process may include mapping the internal business processing result to the field structure required by the external system and generating a response data format that conforms to the external system's requirements according to the communication protocol type. Subsequently, the encapsulated target response data is sent to the external system through the interface layer, completing a full interface interaction process. This step effectively separates business processing logic from interface protocol processing logic, improves the consistency and reliability of interface responses, and enhances the system's adaptability in multi-protocol and multi-system environments.

[0040] In some embodiments, the step of obtaining the standardized request data from the business data layer through the business service layer, executing the corresponding business processing logic, and returning the business processing result to the parser layer includes: reading the standardized request data corresponding to the target interface parsing rule from the business data layer through the business service layer; calling the business processing unit matching the target interface parsing rule based on the standardized request data through the business service layer to execute the corresponding business processing logic and generate the business processing result; and organizing the business processing result according to a unified data structure through the business service layer and transmitting it to the parser layer.

[0041] For example, the business service layer assumes specific business processing responsibilities in the interface parsing process. By reading standardized request data corresponding to the target interface parsing rules from the business data layer, the business service layer can obtain request data that has already undergone protocol-independent processing, thereby avoiding the introduction of dependencies on external system communication protocols or message formats during business processing.

[0042] After acquiring standardized request data, the business service layer, based on this data, invokes a business processing unit that matches the target interface's parsing rules to execute business processing logic. This business processing unit encapsulates specific business calculations or business process control; its input data uses a unified data structure, ensuring that different interface requests are processed consistently. Upon completion of the business processing, a corresponding business processing result is generated.

[0043] Subsequently, the business service layer organizes the business processing results according to a unified data structure and transmits the organized results to the parser layer. This allows the parser layer to perform subsequent encapsulation and protocol adaptation processing on the business processing results without being aware of the specific business processing details, thereby achieving effective separation between business processing logic and interface parsing logic and improving the overall scalability and maintainability of the system.

[0044] In some embodiments, the step of encapsulating the business processing result by the parser layer and outputting the encapsulated target response data to the external system through the interface layer includes: the parser layer generating an internal response data structure based on the business processing result; the parser layer converting the internal response data structure into a response field structure corresponding to the external system according to the field mapping relationship in the target interface parsing rules; the parser layer performing protocol encapsulation on the response field structure according to the communication protocol type to generate the target response data and sending it to the interface layer; and the interface layer sending the target response data to the external system.

[0045] For example, after receiving the business processing result returned by the business service layer, the parser layer first constructs an internal response data structure based on the business processing result. This internal response data structure adopts a unified data organization format within the interface parser, used to provide a structured description of key data in the business processing result, ensuring consistency and standardization in subsequent processing.

[0046] Subsequently, the parser layer, based on the pre-configured field mapping relationships in the target interface parsing rules, converts each of the internal standard fields in the internal response data structure into a response field structure corresponding to the external system. This process enables the internal business processing results to adapt to the field naming conventions, field hierarchy structures, and data organization forms of different external systems, thereby avoiding the business service layer directly processing differences between external systems.

[0047] After completing the field conversion, the parser layer further encapsulates the response field structure according to the communication protocol type, such as adding protocol header information, session identifiers, or verification information, to generate target response data that conforms to the external system's communication protocol requirements. This target response data is then transmitted to the interface layer. Finally, the interface layer sends the encapsulated target response data to the external system, completing the output of the response data. Through the above encapsulation and output process, a unified conversion and reliable transmission of business processing results to external system response data are achieved.

[0048] As can be seen, the above scheme achieves effective decoupling between interface access, protocol parsing, data conversion, and business processing by setting up a layered architecture of interface layer, parser layer, business data layer, and business service layer in the interface parser. By uniformly identifying the communication protocol type of the interface request data at the parser layer and performing standardization processing based on matching protocol adaptation rules, interface requests under different communication protocols can be converted into a unified data format and written to the business data layer. This avoids the business service layer directly handling multi-protocol differences, reducing system complexity. Furthermore, the business processing results are encapsulated by the parser layer before being output to external systems, effectively ensuring the consistency of response data with external protocol requirements. Therefore, the interface parsing process has good versatility and scalability. When adding new protocol types or adjusting interface rules, there is no need to modify the business processing logic, which helps improve system stability, maintainability, and adaptability in multi-protocol environments.

[0049] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0050] In one embodiment, an interface parsing device is provided, which corresponds one-to-one with the interface parsing methods described in the above embodiments. For example... Figure 4 As shown, the interface parsing device includes a receiving module 101, a protocol identification module 102, a rule matching module 103, and a protocol encapsulation module 104. Detailed descriptions of each functional module are as follows: The receiving module 101 is used to receive interface request data sent by an external system through the interface layer, and transmit the interface request data to the parser layer; The protocol identification module 102 is used to identify the communication protocol type corresponding to the interface request data through the parser layer, and generate the target interface parsing rule by matching the corresponding protocol adaptation rule according to the identified communication protocol type. The rule matching module 103 is used to perform standardization processing on the interface request data according to the target interface parsing rules through the parser layer to obtain standardized request data, and write the standardized request data into the business data layer; The protocol encapsulation module 104 is used to obtain the standardized request data from the business data layer through the business service layer, execute the corresponding business processing logic, and return the business processing result to the parser layer. The parser layer encapsulates the business processing result and outputs the encapsulated target response data to the external system through the interface layer.

[0051] The protocol identification module 102 is used to identify the communication protocol type based on the access port information, the packet header field features, and the session identifier information through the parser layer to obtain a protocol identification result; to determine at least one protocol adaptation rule matching the communication protocol type from the protocol adaptation rule base according to the protocol identification result through the parser layer; and to generate the target interface parsing rule through the parser layer according to the at least one protocol adaptation rule and the external system identifier and interface identifier pointed to by the interface request data.

[0052] The rule matching module 103 is used to locate and extract external fields in the interface request data based on the preset field path information in the target interface parsing rules through the parser layer, and obtain the extracted external field information; the parser layer performs data type validation and mandatory field validation on the external field information in sequence to obtain the validation result; if the validation result is successful, the parser layer converts the external field information into internal standard fields according to the field mapping relationship, and constructs the standardized request data based on the internal standard fields.

[0053] The protocol encapsulation module 104 is used to read standardized request data corresponding to the target interface parsing rule from the business data layer through the business service layer; to call the business processing unit matching the target interface parsing rule based on the standardized request data through the business service layer to execute the corresponding business processing logic and generate a business processing result; and to organize the business processing result according to a unified data structure through the business service layer and transmit it to the parser layer.

[0054] The protocol encapsulation module 104 is used to generate an internal response data structure by the parser layer based on the business processing result; convert the internal response data structure into a response field structure corresponding to the external system by the parser layer according to the field mapping relationship in the target interface parsing rules; encapsulate the response field structure according to the communication protocol type by the parser layer to generate the target response data and send it to the interface layer; and send the target response data to the external system by the interface layer.

[0055] This invention provides an interface parsing device. By setting up a layered architecture of interface layer, parser layer, business data layer, and business service layer in the interface parser, it effectively decouples interface access, protocol parsing, data conversion, and business processing. By uniformly identifying the communication protocol type of interface request data at the parser layer and performing standardization processing based on matching protocol adaptation rules, interface requests under different communication protocols can be converted into a unified data format and written to the business data layer. This avoids the business service layer directly handling multi-protocol differences, reducing system complexity. Furthermore, the business processing result is encapsulated by the parser layer before being output to the external system, effectively ensuring the consistency of the response data with external protocol requirements. Therefore, the interface parsing process has good versatility and scalability. When adding new protocol types or adjusting interface rules, there is no need to modify the business processing logic. Specific limitations of the interface parsing device can be found in the limitations of the interface parsing method above, and will not be repeated here. Each module in the above-mentioned interface parsing device can be implemented entirely or partially through software, hardware, or a combination thereof. The above modules can be embedded in the processor of the computer device in hardware form or independent of it, or they can be stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of the above modules.

[0056] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When the computer program is executed by the processor, it implements the functions or steps of an interface resolution method on the server side.

[0057] In one embodiment, a computer device is provided, which may be a client, and its internal structure diagram may be as follows: Figure 6As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with an external server via a network connection. When the computer program is executed by the processor, it implements the client-side functions or steps of an interface resolution method.

[0058] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps: The interface layer receives interface request data sent by external systems and transmits the interface request data to the parser layer. The parser layer identifies the communication protocol type corresponding to the interface request data, and generates the target interface parsing rules by matching the corresponding protocol adaptation rules according to the identified communication protocol type. The parser layer performs standardization processing on the interface request data according to the target interface parsing rules to obtain standardized request data, and then writes the standardized request data into the business data layer. The business service layer obtains the standardized request data from the business data layer, executes the corresponding business processing logic, and returns the business processing result to the parser layer. The parser layer encapsulates the business processing result and outputs the encapsulated target response data to the external system through the interface layer.

[0059] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor: The interface layer receives interface request data sent by external systems and transmits the interface request data to the parser layer. The parser layer identifies the communication protocol type corresponding to the interface request data, and generates the target interface parsing rules by matching the corresponding protocol adaptation rules according to the identified communication protocol type. The parser layer performs standardization processing on the interface request data according to the target interface parsing rules to obtain standardized request data, and then writes the standardized request data into the business data layer. The business service layer obtains the standardized request data from the business data layer, executes the corresponding business processing logic, and returns the business processing result to the parser layer. The parser layer encapsulates the business processing result and outputs the encapsulated target response data to the external system through the interface layer.

[0060] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.

[0061] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0062] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0063] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. An interface parsing method, characterized in that, Applied to an interface resolver, the interface resolver comprising an interface layer, a resolver layer, a business data layer, and a business service layer, the method includes: The interface layer receives interface request data sent by external systems and transmits the interface request data to the parser layer. The parser layer identifies the communication protocol type corresponding to the interface request data, and generates the target interface parsing rules by matching the corresponding protocol adaptation rules according to the identified communication protocol type. The parser layer performs standardization processing on the interface request data according to the target interface parsing rules to obtain standardized request data, and then writes the standardized request data into the business data layer. The business service layer obtains the standardized request data from the business data layer, executes the corresponding business processing logic, and returns the business processing result to the parser layer. The parser layer encapsulates the business processing result and outputs the encapsulated target response data to the external system through the interface layer.

2. The method according to claim 1, characterized in that, The interface request data includes access port information, message header field characteristics, and session identifier information. The parser layer identifies the communication protocol type corresponding to the interface request data and generates target interface parsing rules by matching the identified communication protocol type with corresponding protocol adaptation rules. This includes: The parser layer identifies the communication protocol type based on the access port information, the packet header field features, and the session identifier information to obtain the protocol identification result; Based on the protocol identification result, the parser layer determines at least one protocol adaptation rule that matches the communication protocol type from the protocol adaptation rule base. The parser layer generates the target interface parsing rule based on the at least one protocol adaptation rule and the external system identifier and interface identifier pointed to by the interface request data.

3. The method according to claim 2, characterized in that, The rules stored in the protocol adaptation rule base are generated based on database table configurations; wherein, the database tables include: The system table is used to record the external system identifier, network address, protocol type, and protocol-specific configuration parameters; The standard interface table is used to define the standard interface specifications supported internally by the interface parser, including interface identifier, interface type, and data direction; Configure an interface table to establish the binding relationship between the external system and the standard interface, and store the interface message examples of the external system; Standard field table, used to define the specifications of fields included in the preset business data model; Configure a field table to record the mapping relationship between the field positions in the interface message sample and the fields in the standard field table.

4. The method according to claim 1, characterized in that, The step of performing standardization processing on the interface request data according to the target interface parsing rules through the parser layer to obtain standardized request data includes: The parser layer locates and extracts external fields from the interface request data based on the preset field path information in the target interface parsing rules, thereby obtaining the extracted external field information. The parser layer sequentially performs data type validation and mandatory field validation on the external field information to obtain the validation results. If the verification result is successful, the external field information is converted into internal standard fields according to the field mapping relationship through the parser layer, and the standardized request data is constructed based on the internal standard fields.

5. The method according to claim 4, characterized in that, The field path information is used to indicate the positional relationship of the external field in the interface request data. The field path information includes at least a path expression method based on structured messages or a byte offset expression method based on binary messages.

6. The method according to claim 1, characterized in that, The step of obtaining the standardized request data from the business data layer through the business service layer, executing the corresponding business processing logic, and returning the business processing result to the parser layer includes: The business service layer reads standardized request data corresponding to the target interface parsing rules from the business data layer. The business service layer executes the corresponding business processing logic by calling the business processing unit that matches the target interface parsing rule based on the standardized request data, and generates the business processing result. The business service layer organizes the business processing results according to a unified data structure and transmits them to the parser layer.

7. The method according to claim 1, characterized in that, The process of encapsulating the business processing result by the parser layer and outputting the encapsulated target response data to the external system through the interface layer includes: The parser layer generates an internal response data structure based on the business processing result; The parser layer converts the internal response data structure into a response field structure corresponding to the external system based on the field mapping relationship in the target interface parsing rules. The parser layer encapsulates the response field structure according to the communication protocol type, generates the target response data, and sends it to the interface layer. The target response data is sent to the external system through the interface layer.

8. An interface parsing device, characterized in that, include: The receiving module is used to receive interface request data sent by an external system through the interface layer, and transmit the interface request data to the parser layer; The protocol identification module is used to identify the communication protocol type corresponding to the interface request data through the parser layer, and to generate the target interface parsing rules by matching the identified communication protocol type with the corresponding protocol adaptation rules. The rule matching module is used to perform standardization processing on the interface request data according to the parser layer based on the target interface parsing rules, obtain standardized request data, and write the standardized request data into the business data layer; The protocol encapsulation module is used to obtain the standardized request data from the business data layer through the business service layer, execute the corresponding business processing logic, and return the business processing result to the parser layer. The parser layer encapsulates the business processing result and outputs the encapsulated target response data to the external system through the interface layer.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the interface resolution method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the interface resolution method as described in any one of claims 1 to 7.