Interface and packet collation method and apparatus

By automating the parsing and verification of interfaces and messages, the problems of low efficiency and high cost of manual verification are solved, and efficient and accurate interface and message verification is achieved.

CN115205004BActive Publication Date: 2025-12-19CHINA CONSTRUCTION BANK +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210828271.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-13
Publication Date
2025-12-19
Estimated Expiration
2042-07-13

AI Technical Summary

Technical Problem

Existing technologies cannot efficiently and automatically verify interfaces and messages, resulting in high labor costs, low efficiency, and a high risk of oversights.

Method used

By parsing the target interface file, the list of interface fields and requirement code information are obtained. Combined with the parsing of the target message file, a list of message fields is generated, and the field information is checked to achieve automated interface and message verification.

Benefits of technology

It improves the efficiency and accuracy of interface and message verification, and reduces labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115205004B_ABST
    Figure CN115205004B_ABST
Patent Text Reader

Abstract

The application provides an interface and message collation method and device, and relates to the technical field of data analysis. The interface and message collation method can perform a first analysis operation on a target interface file to obtain an interface field list and target requirement code information of the target interface file; based on the target requirement code information, a target message file corresponding to the target interface file is determined; a second analysis operation is performed on the target message file to obtain a message field list; the interface field list and the message field list are collated in terms of field information to obtain a collation result of the target interface file and the target message file. The method realizes efficient collation processing of interfaces and messages, can improve the processing efficiency and accuracy of the collation of interfaces and messages, and reduces the labor cost of the collation of interfaces and messages.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of data analysis, and in particular, to an interface and message checking method and device. BACKGROUND

[0002] At present, in the process of running a financial business system, it is inevitable to involve a demand interface for product components, and after corresponding program development, a message file matching the interface file is generated. After developing the message according to the interface, in order to prevent the message from not matching the demand interface, it is necessary to check the interface and the message.

[0003] Due to the complexity of the interface file and the message file, the checking method of the related art cannot replace manual checking of the interface and the message, and business personnel need to manually check whether the fields of the message and the interface match. When encountering the checking work of thousands of new interfaces, manual checking not only cannot keep up with the pace, but also is prone to omissions. At present, the manual cost of the checking process of the interface and the message is high, and the efficiency is low. SUMMARY

[0004] To solve the existing technical problems, embodiments of the present application provide an interface and message checking method and device, which can improve the processing efficiency of the checking of the interface and the message and reduce the manual cost of the checking of the interface and the message.

[0005] To achieve the above-mentioned purpose, the technical scheme of the embodiments of the present application is as follows:

[0006] In a first aspect, the embodiments of the present application provide an interface and message checking method, which comprises:

[0007] performing a first parsing operation on a target interface file to obtain an interface field list and target demand code information of the target interface file; the interface field list comprises interface field information of the target interface file; the target demand code information is an identifier of a development demand corresponding to the interface file;

[0008] determining a target message file corresponding to the target interface file based on the target demand code information;

[0009] performing a second parsing operation on the target message file to obtain a message field list; the message field list comprises message field information of the target message file;

[0010] checking the interface field list and the message field list for field information to obtain a checking result of the target interface file and the target message file.

[0011] The interface and message collation method provided by the embodiments of the present application can realize efficient collation processing of interfaces and messages, improve the processing efficiency and accuracy of the collation of interfaces and messages, and reduce the labor cost of the collation of interfaces and messages.

[0012] In an optional embodiment, the first parsing operation on the target interface file to obtain the interface field list and the target requirement code information of the target interface file comprises:

[0013] The unit information of the target interface file is read one by one, and the following processing operations are performed for each read unit information:

[0014] If the read unit information is a requirement code identifier, the corresponding target requirement code information is obtained based on the requirement code identifier; and

[0015] If the read unit information is the message type identifier, the interface field information of the target interface file is obtained based on the message type identifier to obtain the interface field list.

[0016] The method of the above embodiments reads the unit information of the target interface file one by one, automatically obtains the corresponding target requirement code information according to the preset requirement code identifier, and automatically obtains the interface field information of the target interface file according to the preset message type identifier to obtain the interface field list, further provides convenience for the collation of interfaces and messages, improves the processing efficiency and accuracy of the collation of interfaces and messages, and reduces the labor cost of the collation of interfaces and messages.

[0017] In an optional embodiment, the obtaining of the interface field information of the target interface file based on the message type identifier comprises:

[0018] Based on the message type identifier, an interface field information set corresponding to the message type identifier is obtained;

[0019] The interface field information of the target interface file is obtained according to the interface field information set corresponding to the message type identifier.

[0020] The method of the above embodiment can obtain the interface field information set corresponding to the message type identifier through the message type identifier, and obtain the interface field information of the target interface file according to the interface field information set corresponding to the message type identifier, so that the range of the interface field information can be accurately determined, the time consumption for determining the interface field information of the target interface file can be reduced, the processing efficiency and accuracy of the interface and message checking can be improved, and the labor cost of the interface and message checking can be reduced.

[0021] In an optional embodiment, the interface field information set includes an interface field information pair; the interface field information pair includes an interface field unit and a corresponding interface field attribute identifier; the interface field unit is composed of a nested element identifier string and an interface field string; and the obtaining of the interface field information of the target interface file according to the interface field information set corresponding to the message type identifier includes:

[0022] Each of the interface field information pairs is traversed in a depth-first search order, and the interface field information of the target interface file is constructed based on the interface field attribute identifier, the nested element identifier string and the interface field unit of each of the interface field information pairs.

[0023] In the method of the above embodiment, the interface field information set includes an interface field information pair; the interface field information pair includes an interface field unit and a corresponding interface field attribute identifier; the interface field unit is composed of a nested element identifier string and an interface field string; each of the interface field information pairs is traversed in a depth-first search order, and the interface field information of the target interface file is constructed based on the interface field attribute identifier, the nested element identifier string and the interface field unit of each of the interface field information pairs, so that the artificial intervention in the process of obtaining the interface field information of the target interface file is reduced, the processing efficiency and accuracy of the interface and message checking are improved, and the labor cost of the interface and message checking is reduced.

[0024] In an optional embodiment, the target message file is one or more; the target message file includes jump information; the jump information includes an identifier of a jump target message file; and the performing of the second parsing operation on the target message file to obtain a message field list includes:

[0025] A header file in the target message file is determined according to a preset header file identifier;

[0026] The target message file is parsed based on the jump information included in each of the target message files to obtain a message field list, starting from the header file.

[0027] The method of the above embodiment can automatically parse the target message file based on the preset header file identifier and the jump information included in each target message file, accurately and efficiently obtain the message field list, and further improve the processing efficiency and accuracy of interface and message checking, and reduce the labor cost of interface and message checking.

[0028] In an optional embodiment, during the parsing of any target message file, if jump information is encountered, the parsing operation of the any target message file is temporarily suspended, and a second parsing operation of the jump target message file corresponding to the encountered jump information is preferentially completed; the jump target message file includes a nested message element corresponding to the any nested message field element and having a message nesting level one lower than the any nested message field element.

[0029] The method of the above embodiment can automatically parse the target message file based on the preset header file identifier and the jump information included in each target message file, accurately and efficiently obtain the message field list, and further improve the processing efficiency and accuracy of interface and message checking, and reduce the labor cost of interface and message checking.

[0030] In an optional embodiment, the target message file includes at least one message field element; the message field element includes a message field element name, the jump information, and a field element format; and the parsing of the target message file based on the jump information included in each target message file from the header file to obtain a message field list includes:

[0031] The message field elements of each target message file are traversed in a depth-first search order from the header file, and new message field information is constructed based on the message field elements in the header file, the message field elements of each target message file, and the message field element names corresponding to the message field elements of each target message file, to obtain a message field list.

[0032] The method of the above embodiment, the target message file includes at least one message field element; the message field element includes a message field element name, the jump information and a field element format; according to whether the current message field element is a nested message field element and whether the current message field element is a message field element in the header file, the message field elements of each target message file are traversed in a depth-first search order, new message field information is constructed based on the message field elements in the header file, the message field elements of each target message file and the message field element names corresponding to the message field elements of each target message file, to obtain a message field list, human intervention in the process of obtaining the message field list is reduced, and the processing efficiency and accuracy of interface and message checking are further improved, and the labor cost of interface and message checking is reduced.

[0033] In a second aspect, the embodiments of the present application further provide an interface and message checking device, the device comprises:

[0034] An interface parsing unit is configured to perform a first parsing operation on a target interface file to obtain an interface field list and target requirement code information of the target interface file, wherein the interface field list includes interface field information of the target interface file, and the target requirement code information is an identifier of a development requirement corresponding to the interface file.

[0035] An association determining unit is configured to determine a target message file corresponding to the target interface file based on the target requirement code information.

[0036] A message parsing unit is configured to perform a second parsing operation on the target message file to obtain a message field list, wherein the message field list includes message field information of the target message file.

[0037] A field checking unit is configured to check the interface field list and the message field list in terms of field information to obtain a checking result of the target interface file and the target message file.

[0038] In an optional embodiment, the interface parsing unit is specifically configured to:

[0039] The unit information of the target interface file is read one by one, and the following processing operations are performed after each unit information is read:

[0040] If the read unit information is a requirement code identifier, the corresponding target requirement code information is obtained based on the requirement code identifier; and

[0041] If the unit information read is the message type identifier, interface field information of the target interface file is obtained based on the message type identifier, and the interface field list is obtained.

[0042] In an alternative embodiment, the interface parsing unit is specifically configured to:

[0043] Based on the message type identifier, an interface field information set corresponding to the message type identifier is obtained.

[0044] According to the interface field information set corresponding to the message type identifier, interface field information of the target interface file is obtained.

[0045] In an alternative embodiment, the interface field information set includes an interface field information pair; the interface field information pair includes an interface field unit and a corresponding interface field attribute identifier; the interface field unit is composed of a nested element identifier string and an interface field string; and the interface parsing unit is specifically configured to:

[0046] Each of the interface field information pairs is traversed in a depth-first search order, and the interface field information of the target interface file is constructed based on the interface field attribute identifier, the nested element identifier string and the interface field unit of each of the interface field information pairs.

[0047] In an alternative embodiment, the target message file is one or more; the target message file includes jump information; the jump information includes an identifier of a jump target message file; and the message parsing unit is specifically configured to:

[0048] A header file in the target message file is determined according to a preset header file identifier.

[0049] Starting from the header file, the target message file is parsed based on the jump information included in each of the target message files, and a message field list is obtained.

[0050] In an alternative embodiment, the message parsing unit is specifically configured to, in the process of parsing any target message file, if jump information is encountered, temporarily suspend the parsing operation of the any target message file, and jump to a jump target message file corresponding to the encountered jump information to preferentially complete a second parsing operation of the jump target message file; the jump target message file includes a nested message element corresponding to the any nested message field element and having a message nesting level one level lower than the any nested message field element.

[0051] In an alternative embodiment, the target message file comprises at least one message field element; the message field element comprises a message field element name, the jump information and a field element format; and the message parsing unit is specifically configured to:

[0052] Starting from the header file, traversing each message field element of each target message file in a depth-first search order, and constructing new message field information based on the message field elements in the header file, the message field elements of each target message file and the message field element names corresponding to the message field elements of each target message file, to obtain a message field list.

[0053] In a third aspect, the embodiments of the present application further provide a computer readable storage medium, which stores a computer program. When the computer program is executed by a processor, the interface and message collation method of the first aspect is implemented.

[0054] In a fourth aspect, the embodiments of the present application further provide an electronic device, which comprises a memory and a processor. The memory stores a computer program which can be run on the processor. When the computer program is executed by the processor, the processor implements the interface and message collation method of the first aspect.

[0055] In a fifth aspect, the embodiments of the present application provide a computer program product, which comprises computer instructions stored in a computer readable storage medium. When a processor of a computer device reads the computer instructions from the computer readable storage medium, the processor executes the computer instructions, so that the computer device executes the steps of any one of the interface and message collation methods.

[0056] The technical effects brought by any one of the implementation manners of the second to fifth aspects can refer to the technical effects brought by the implementation manners of the first aspect, which will not be described here. BRIEF DESCRIPTION OF DRAWINGS

[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0058] Figure 1 A flowchart of an interface and message collation method provided by the embodiments of the present application;

[0059] Figure 2 A flowchart of determining interface field information of an interface and message collation method provided by the embodiments of the present application;

[0060] Figure 3 A flowchart of a process of obtaining a message field list of a method for checking an interface and a message provided by an embodiment of the present application;

[0061] Figure 4 A structural diagram of a device for checking an interface and a message provided by an embodiment of the present application;

[0062] Figure 5 A structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0063] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.

[0064] Some terms in the embodiments of the present application are explained below to facilitate understanding by those skilled in the art.

[0065] (1) Depth-first search order: the depth-first search order is determined by the depth-first search algorithm. The process of the depth-first search algorithm is briefly that each possible branch path is deepened until it cannot be deepened any more, and each node can only be accessed once.

[0066] (2) Interface file: the interface file can be simply referred to as an interface, which is a description of the requirement interface provided by a product component. In the embodiments of the present application, the format of the interface file can be an Excel file in xlsx format.

[0067] (3) Message file: the message file can also be simply referred to as a message, which is a program file developed according to the requirement interface provided by a product component. In the embodiments of the present application, the format of the message file can be Extensible Markup Language (XML).

[0068] In order to realize efficient checking of low interfaces and messages and improve the processing efficiency of checking of interfaces and messages, a method and device for checking an interface and a message are provided in the embodiments of the present application. In order to better understand the technical solutions provided by the embodiments of the present application, the basic principles of the solutions are briefly described here.

[0069] It should be noted that the terms "first", "second", and the like in the description and in the claims of the present application and the above-described accompanying drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0070] The technical solutions provided by the embodiments of the present application are described below in conjunction with the accompanying drawings.

[0071] At present, in the process of running a financial business system, it is inevitable to involve the demand interface for product components, and after corresponding program development, a message file matching the interface file is generated. After the interface development message is developed, in order to prevent the message from not matching the demand interface, the interface and the message need to be checked.

[0072] Due to the complexity of the interface file and the message file, the checking method of the related art cannot replace manual checking of the interface and the message, and the business personnel need to manually check whether the fields of the message and the interface match. When encountering the checking work of thousands of new interfaces, manual checking not only cannot keep up with the pace, but also is prone to omissions. At present, the manual cost of the checking process of the interface and the message is high, and the efficiency is low.

[0073] Therefore, the embodiments of the present application provide a checking method and device for an interface and a message, wherein the checking method for the interface and the message can perform a first parsing operation on a target interface file to obtain an interface field list and target demand code information of the target interface file; the interface field list includes interface field information of the target interface file; the target demand code information is an identifier of a development demand corresponding to the interface file; based on the target demand code information, a target message file corresponding to the target interface file is determined; a second parsing operation is performed on the target message file to obtain a message field list; the message field list includes message field information of the target message file; the interface field list and the message field list are checked for field information to obtain a checking result of the target interface file and the target message file. The method automatically parses the target interface file and the corresponding target message file to be checked respectively to obtain the interface field list of the target interface file and the message field list of the target message file, and checks the interface field list and the message field list for field information to obtain the checking result of the target interface file and the target message file, thereby realizing efficient checking of the interface and the message, improving the processing efficiency and accuracy of the checking of the interface and the message, and reducing the manual cost of the checking of the interface and the message.

[0074] The preferred embodiments of the present application are described below in conjunction with the accompanying drawings, it should be understood that the preferred embodiments described herein are only used to explain and illustrate the present application, and are not used to limit the present application, and the embodiments in the embodiments and the features in the embodiments can be combined with each other without conflict.

[0075] The interface and message checking method provided by the embodiments of the present application is further explained below. The interface and message checking method provided by the present application, as shown in Figure 1 includes the following steps:

[0076] S101, performing a first parsing operation on the target interface file to obtain an interface field list and target requirement code information of the target interface file.

[0077] The interface field list includes interface field information of the target interface file; the target requirement code information is an identifier of the development requirement corresponding to the interface file.

[0078] Exemplarily, the target interface file IO_Tar can be as shown in Table 1. Referring to Table 1, the target interface file IO_Tar includes target requirement code information "A0582667". The first parsing operation is performed on the target interface file IO_Tar shown in Table 1 to obtain the interface field list IO_List and the target requirement code information "A0582667" of the target interface file IO_Tar.

[0079] Table 1

[0080] Transaction code A0582667 Response message Interface field name Interface field attribute identification A01 C A02 GROUP ..A03 C ..A04 GROUP ....A05 C ....A06 C ..A07 C

[0081] In an optional embodiment, the first parsing operation is performed on the target interface file to obtain the interface field list and the target requirement code information of the target interface file, specifically, the unit information of the target interface file is read one by one, and the following processing operation is performed after reading each unit information:

[0082] If the read unit information is a requirement code identifier, the corresponding target requirement code information is obtained based on the requirement code identifier; and if the read unit information is a message type identifier, the interface field information of the target interface file is obtained based on the message type identifier to obtain the interface field list.

[0083] The requirement code identifier and the message type identifier are preset information. For example, the requirement code identifier can be "transaction code"; the message type identifier can be "response message" or "request message". It should be pointed out that for an interface file, the number of message type identifiers can be one or more. The following embodiments of the present application take the message type identifier "response message" contained in the target interface file as an example for description.

[0084] In implementation, if the format of the interface file is an Excel file, the cell information of the interface file can be a cell of the Excel file.

[0085] Exemplarily, the process of performing the first parsing operation on the target interface file IO_Tar shown in Table 1 to obtain the interface field list IO_List and the target requirement code information "A0582667" of the target interface file IO_Tar can be reading the cells of the target interface file IO_Tar one by one, and performing the following processing operations for each read cell: if the read cell is the preset requirement code identifier "transaction code", obtaining the corresponding target requirement code information based on the requirement code identifier "transaction code" to obtain "A0582667"; and if the read cell is the message type identifier "response message", obtaining the interface field information IO_cell of the target interface file IO_Tar based on the message type identifier "response message" to obtain the interface field list IO_List.

[0086] In implementation, the interface field list IO_List can be obtained by sequentially storing a plurality of interface field information IO_cell in a manner of one row per interface field information IO_cell.

[0087] In an optional embodiment, obtaining the interface field information of the target interface file based on the message type identifier can include the following steps. Figure 2

[0088] In step S201, the interface field information set corresponding to the message type identifier is obtained based on the message type identifier.

[0089] In implementation, when the read cell is the message type identifier, for example, "response message" in Table 1, the contents of each row below the message type identifier are all information areas corresponding to "response message", until an entire row of empty cells is encountered, indicating that the information area corresponding to "response message" ends. The interface field information set corresponding to the message type identifier is obtained according to the information area corresponding to "response message".

[0090] Exemplarily, in the process of obtaining the interface field information of the target interface file IO_Tar based on the message type identifier "response message", the interface field information set IO_Inf corresponding to the message type identifier "response message" is first obtained based on the message type identifier "response message".

[0091] In step S202, the interface field information of the target interface file is obtained according to the interface field information set corresponding to the message type identifier.

[0092] ​In an alternative embodiment, the interface field information set comprises interface field information pairs; each interface field information pair comprises an interface field unit and a corresponding interface field attribute identifier; the interface field unit is composed of a nested element identifier string and an interface field string; the interface field information of the target interface file is obtained according to the interface field information set corresponding to the message type identifier, comprising:

[0093] Each interface field information pair is traversed in a depth-first search order, and the interface field information of the target interface file is constructed based on the interface field attribute identifier, the nested element identifier string and the interface field unit of each interface field information pair.

[0094] In an embodiment of the present application, the process of constructing the interface field information of the target interface file based on the interface field attribute identifier, the nested element identifier string and the interface field unit of each interface field information pair can be as follows: each time an interface field information pair is traversed, the following operations are performed:

[0095] If the interface field attribute identifier is not a preset first identifier and the nested element identifier string is an empty character, the interface field string of the interface field unit in the current interface field information pair is taken as an interface field information; the first identifier represents that the corresponding interface field unit is a nested format field unit; each nested format field unit has at least one interface field unit as a corresponding nested element;

[0096] If the interface field attribute identifier is not the first identifier and the nested element identifier string is not an empty character, the interface field string of the interface field unit in the current interface field information pair is retrieved; the nested element identifier string represents whether the interface field unit where the nested element identifier string is located is a nested element;

[0097] If the interface field attribute identifier is the first identifier and the nested element identifier string is a null character, then: obtain the first interface field string of the interface field unit in the current interface field information pair; traverse the interface field information pairs corresponding to the nested elements of the interface field unit of the current interface field information pair in a depth-first search order, sequentially concatenate the interface field strings of the interface field units in the interface field information pairs corresponding to the nested elements obtained in the retrieval according to the superior-inferior relationship of the nested levels between the interface field units in the interface field information pairs corresponding to the nested elements obtained in the retrieval and the interface field unit of the current interface field information pair, to obtain first nested field combination information corresponding to the nested elements of the interface field unit of the current interface field information pair; sequentially concatenate the first interface field string and the first nested field combination information according to the superior-inferior relationship of the nested levels, as an interface field information; and the nested element identifier string is used to determine the nested format field unit of the previous nested level corresponding to the interface field unit where the nested element identifier string is located.

[0098] If the interface field attribute identifier is the first identifier and the nested element identifier string is not a null character, then retrieve the interface field string of the interface field unit in the current interface field information pair.

[0099] In specific implementation, the nested level of any nested format field unit is higher than the nested level of the nested element corresponding to any nested format field unit; and in the interface field information set, the interface field information pairs corresponding to the nested elements of any nested format field unit are sequentially placed after the interface field information pair corresponding to any nested format field unit. The nested level of the nested element corresponding to any nested format field unit can be the same nested level or a plurality of continuous nested levels.

[0100] Exemplarily, for the target interface file IO_Tar shown in Table 1, based on the message type identifier "response message", the interface field information set IO_Inf corresponding to the message type identifier "response message" is obtained, the interface field information set IO_Inf includes the interface field information pair IO_Inf_sub; the interface field information pair IO_Inf_sub includes the interface field unit IO_text and the corresponding interface field attribute identifier IO_text_pro, that is, the specific value of the interface field information pair IO_Inf_sub can be (IO_text, IO_text_pro); the interface field unit IO_text is composed of the nested element identifier string nest_str and the interface field string IO_te_str. For example, the interface field information set IO_Inf can be {(A01, C), (A02, GROUP), (..A03, C), (..A04, GROUP), (....A05, C), (....A06, C), (..A07, C)}. Wherein, when the value of the interface field unit IO_text is A02, the value of the corresponding interface field attribute identifier IO_text_pro is "GROUP", which means that A02 is a nested format field unit. Each nested format field unit has at least one interface field unit as a corresponding nested element. The nested element identifier string included in the interface field unit IO_text represents whether the interface field unit IO_text where the nested element identifier string is located is a nested element.

[0101] In the embodiments of the present application, the nested element identification string nest_str can be one or more “..”. The number of “..” contained in the nested element identification string nest_str in the nested element of the adjacent nested level corresponding to any nested format field unit is increased by 1 than the number of “..” contained in the nested element identification string nest_str in the any nested format field unit. For example, assuming that the nested level of the nested format field unit “A02” is 1, the nested elements corresponding to the nested format field unit “A02” include..A03,..A04,....A05,....A06 and..A07, and the nested levels of the 5 nested elements are 2, 2, 3, 3 and 2 in turn. The number of “..” contained in the nested element identification string in the nested elements “..A03”, “..A04” and “..A07” of the adjacent nested level corresponding to the nested format field unit “A02” is increased by 1 than the number of “..” contained in the nested element identification string in the nested format field unit “A02”; the number of “..” contained in the nested element identification string in the nested elements “....A05” and “....A06” of the adjacent nested level corresponding to the nested format field unit “..A04” is also increased by 1 than the number of “..” contained in the nested element identification string in the nested format field unit “..A04”.

[0102] For example, in combination with Table 1, the interface field information set IO_Inf is specifically {(A01, C), (A02, GROUP), (..A03, C), (..A04, GROUP), (....A05, C), (....A06, C), (..A07, C)}, and according to the interface field information set IO_Inf corresponding to the message type identification “response message”, the interface field information IO_cell of the target interface file IO_Tar can be obtained by the following process: traversing each interface field information pair IO_Inf_sub in the depth-first search order, and performing the following operations for each interface field information pair (IO_text i , IO_text_pro i ), wherein IO_text i contains the nested element identification string “nest_str i ” and the interface field string “IO_te_str i ”, and the following operations are performed:

[0103] If the interface field attribute identification IO_text_pro i is not the preset first identification “GROUP”, and the nested element identification string nest_str iIf it is an empty character, then the current interface field information pair (IO_text) will be returned. i IO_text_pro i The interface field unit IO_text in ) i The interface field string IO_te_str i As an interface field information; the first identifier "GROUP" indicates that the corresponding interface field unit is a nested format field unit; each nested format field unit has at least one interface field unit as a corresponding nested element;

[0104] If the interface field attribute is identified as IO_text_pro i The first identifier is not "GROUP", and the nested element identifier string is nest_str. i If it is not an empty character, then the current interface field information pair (IO_text) will be retrieved. i IO_text_pro i The interface field unit IO_text in ) i The interface field string IO_te_str i The nested element identifier string `nest_str` indicates whether the interface field unit containing the nested element identifier string is a nested element.

[0105] If the interface field attribute is identified as IO_text_pro i The first identifier is "GROUP", and the nested element identifier string is nest_str. i If it is an empty character, then: get the current interface field information pair (IO_text) i IO_text_pro i The interface field unit IO_text in ) i The interface field string IO_te_str i , as the first interface field string; for easier understanding, assume (IO_text i IO_text_pro i) is (A02, GROUP) in Table 1, the first interface field string is "A02", and the nested elements of the interface field unit A02 corresponding to the current interface field information pair (A02, GROUP) are traversed in the depth-first search order, the interface field information pairs (.A03, C), (.A04, GROUP), (....A05, C), (....A06, C) and (.A07, C) are retrieved, the interface field strings A03, A04, A05, A06 and A07 of the interface field units in the retrieved interface field information pairs (.A03, C), (.A04, GROUP), (....A05, C), (....A06, C) and (.A07, C) are sequentially spliced according to the upper and lower layer relationship of the nested levels between the retrieved interface field units (.A03,.A04,....A05,....A06 and.A07) and A02, and the first nested field combination information corresponding to the nested elements (.A03,.A04,....A05,....A06 and.A07) of the interface field unit of the current interface field information pair (A02, GROUP) is obtained, which can be, for example, "A3, A4: [A5, A6], A7"; the first interface field string "A02" and the first nested field combination information "A3, A4: [A5, A6], A7" are sequentially spliced according to the upper and lower layer relationship of the nested levels, and "A2: [A3, A4: [A5, A6], A7]" can be obtained as an interface field information; the nested element identification string is used to determine the nested format field unit of the previous nested level corresponding to the interface field unit where the nested element identification string is located;

[0106] If the interface field attribute identification IO_text_pro i is the first identification "GROUP", and the nested element identification string nest_str i is not an empty character, the interface field string of the interface field unit in the current interface field information pair is retrieved.

[0107] The method of the above embodiment, the interface field information set comprises interface field information pairs; the interface field information pair comprises an interface field unit and a corresponding interface field attribute identifier; the interface field unit is composed of a nested element identifier string and an interface field string; according to the interface field attribute identifier and the nested element identifier string, each interface field information pair is traversed in a depth-first search order, and the interface field string of any nested format field unit and the interface field string of the nested element corresponding to the any nested format field unit are sequentially spliced according to the upper and lower layer relationship of the nested level, so as to reduce human intervention in the process of obtaining the interface field information of the target interface file, make the interface field information accurately reflect the upper and lower layer relationship of the nested level between the nested format field unit and the nested element thereof, improve the processing efficiency and accuracy of the interface and the message checking, and reduce the artificial cost of the interface and the message checking.

[0108] S102, determining a target message file corresponding to the target interface file based on the target requirement code information.

[0109] In specific implementation, the interface file is searched according to the target requirement code information, the message file containing the target requirement code information is determined as the target message file corresponding to the target interface file. The interface file can be searched according to whether the file name of the interface file contains the target requirement code information.

[0110] S103, performing a second parsing operation on the target message file to obtain a message field list.

[0111] The message field list comprises message field information of the target message file.

[0112] In some optional embodiments, the target message file is one or more; the target message file comprises jump information; the jump information comprises an identifier of a jump target message file; the second parsing operation on the target message file to obtain the message field list comprises: Figure 3

[0113] Step S301, determining a header file in the target message file according to a preset header file identifier.

[0114] ​In practice, the first line of the program code of the message file is usually an introduction of the format name of the message file. In the target message file, there is a first line of the target message file containing a preset header file identifier, for example, the header file identifier corresponding to the message type identifier "response message" in the target message file can be "ENTITY_RESP", and according to the preset header file identifier "ENTITY_RESP", the header file in the target message file can be determined, for example, the header file can be the target message file with the file name "FMT_A05826677_ENTITY_RESP" shown in Table 2.

[0115] For example, the content of the header file determined according to the header file identifier "ENTITY_RESP" can be as shown in Table 2:

[0116] Table 2

[0117]

[0118] In the embodiments of the present application, the jump information included in the target message file is a SubName statement in the target message file. For example, "SubName=“A05826677_A2_RESP”" shown in Table 2 is jump information, indicating that it is intended to jump to the message file with the file name A05826677_A2_RESP as shown in Table 3.

[0119] Table 3

[0120]

[0121]

[0122] In some embodiments of the present application, the message type identifier of the interface file is multiple; in the process of performing the second parsing operation on the target message file to obtain the message field list, the header file identifier can also be selected according to the message type identifier of the interface file, and the header file in the target message file is determined according to the selected header file identifier.

[0123] In step S302, based on the jump information included in each target message file, the target message file is parsed starting from the header file to obtain the message field list.

[0124] In some optional embodiments, in the process of parsing any target message file, if the jump information is encountered, the parsing operation of any target message file is temporarily suspended, and the second parsing operation on the jump target message file corresponding to the encountered jump information is preferentially completed by jumping to the jump target message file. The jump target message file includes a nested message element corresponding to any nested message field element and having a nesting level one lower than any nested message field element.

[0125] For example, in the process of parsing the target message file with the file name "FMT_A05826677_ENTITY_RESP" shown in Table 2, if the jump information "SubName="A05826677_A2_RESP"" of the nested message field element "A2" is encountered, the parsing operation of the target message file with the file name "FMT_A05826677_ENTITY_RESP" is temporarily suspended, and the second parsing operation of the jump target message file with the file name "A05826677_A2_RESP" corresponding to the encountered jump information "SubName="A05826677_A2_RESP"" is prioritized to be completed. The jump target message file with the file name "A05826677_A2_RESP" includes the nested message elements corresponding to any nested message field element "A2" and one level lower than any nested message field element "A4" in the message nesting level, such as A3, A4, and A7 shown in Table 3. The nested message field element "A2" is the message field element Item with the field element name A2 shown in Table 2 and Table 3, which satisfies the preset identification condition.

[0126] In some optional embodiments, the target message file includes at least one message field element; the message field element includes a message field element name, jump information, and a field element format; starting from the header file, based on the jump information included in each target message file, the target message file is parsed to obtain a message field list, including:

[0127] Starting from the header file, the message field elements of each target message file are traversed in a depth-first search order, and based on the message field elements in the header file, the message field elements of each target message file, and the message field element names corresponding to the message field elements of each target message file, new message field information is constructed to obtain the message field list.

[0128] In an embodiment of the present application, based on the message field elements in the header file, the message field elements of each target message file, and the message field element names corresponding to the message field elements of each target message file, the process of constructing new message field information to obtain the message field list can be to perform the following processing after traversing each message field element:

[0129] If the current message field element retrieved does not satisfy the preset identification condition, and the current message field element is a message field element in the header file, the message field element name corresponding to the current message field element retrieved is stored as new message field information; the identification condition represents that the corresponding message field element is a nested message field element; each nested message field element has at least one target message file as a corresponding nested message element; the message nesting level of any nested message field element is higher than the message nesting level of the nested message element corresponding to any nested message field element;

[0130] If the current message field element retrieved does not satisfy the preset identification condition, and the current message field element is not a message field element in the header file, the message field element name corresponding to the current message field element is retrieved.

[0131] If the current message field element retrieved satisfies the identification condition, and the current message field element is a message field element in the header file, the message field element name corresponding to the current message field element is obtained as a basic message field string; the nested message elements corresponding to the current message field element are traversed in a depth-first search order, the message field element names of the message field elements included in the nested message elements retrieved are sequentially spliced according to the upper and lower layer relationship of the message nesting level between the message field elements included in the nested message elements and the current message field element, to obtain a nested field element unit corresponding to the nested message elements of the current message field element; the basic message field string and the nested field element unit are sequentially spliced according to the upper and lower layer relationship of the message nesting level between the current message field element and the nested message elements of the current message field element, to obtain new message field information.

[0132] If the current message field element retrieved satisfies the identification condition, and the current message field element is not a message field element in the header file, the message field element name corresponding to the current message field element is retrieved.

[0133] In implementation, the field element format can be an array including multiple sub-format information. For example, the sub-format information can include the ItemType and the ItemDesc shown in Table 2. The preset identification condition can be: for a message field element, assuming the message field element is Item_n, the value of the ItemType of the message field element Item_n is "fmt", and for the first message field element Item_one in the target message file corresponding to the SubName statement of the message field element Item_n, the value of the ItemDesc of the message field element Item_one contains the "nested format" string. For example, the message field element containing "XmlName="A2"" shown in Table 2 and Table 3 satisfies the preset identification condition.

[0134] For example, referring to Table 2, the target message file with the file name "FMT_A05826677_ENTITY_RESP" includes at least one message field element Item; the message field element Item includes a message field element name XmlName, a jump information SubName, and a field element format Item__pro; the target message file with the file name "FMT_A05826677_ENTITY_RESP" is a header file, and starting from the header file, the target message file is parsed based on the jump information included in each target message file to obtain a message field list, including the following processes:

[0135] Starting from the header file with the file name "FMT_A05826677_ENTITY_RESP", the message field elements of each target message file are traversed in a depth-first search order until each message field element in the target message file is searched once. Each time a message field element is traversed, assuming the message field element is marked as Item j , the following processes are performed:

[0136] If the current message field element Item j searched does not satisfy the preset identification condition, and the current message field element Item j is a message field element in the header file with the file name "FMT_A05826677_ENTITY_RESP", the message field element name XmlName j corresponding to the current message field element Item j, are stored as new message field information; the identification condition represents that the corresponding message field element is a nested message field element; each nested message field element has at least one target message file as the corresponding nested message element; the message nesting level of any nested message field element is higher than the message nesting level of the nested message element corresponding to any nested message field element, for example, the message nesting level of the message field element containing the "XmlName="A2"" statement in Table 2 and Table 3 is higher than the message nesting level of the message field element whose element name is A3, A4 or A7;

[0137] If the current message field element Item j retrieved does not satisfy the preset identification condition, and the current message field element Item j is not a message field element in the header file whose file name is "FMT_A05826677_ENTITY_RESP", then the corresponding message field element name XmlName j of the current message field element Item j retrieved is obtained as the basic message field string;

[0138] If the current message field element Item j retrieved satisfies the identification condition, and the current message field element Item j is a message field element in the header file, then the corresponding message field element name of the current message field element Item j is obtained as the basic message field string; for the convenience of understanding, it is assumed that the current message field element Item jFor the message field element in Table 2 containing "SubName="A05826677_A2_RESP", the message field element in Table 2 containing "SubName="A05826677_A2_RESP" is marked as message field element A2 below, and the basic message field string is obtained according to the message field element name of the first message field element Item_one in the jump target message file shown in Table 3, which is "A2". According to the depth-first search order, the nested message elements corresponding to the message field element A2 are traversed, the message field element names of the message field elements included in the retrieved nested message elements are spliced in sequence according to the upper and lower layer relationship of the message nesting level between the message field elements included in the nested message elements and the message field element A2, and the nested field element unit corresponding to the nested message elements of the message field element A2 is obtained, for example, "A3, A4: [A5, A6], A7". The basic message field string "A2" and the nested field element unit "A3, A4: [A5, A6], A7" are spliced in sequence according to the upper and lower layer relationship of the message nesting level between the message field element A2 and the nested message elements of the message field element A2, for example, "A2: [A3, A4: [A5, A6], A7]" can be obtained as a new message field information for storage.

[0139] If the current message field element Item j satisfies the identification condition, and the current message field element Item j is not a message field element in the header file, the message field element name XmlName j corresponding to the current message field element Item j is retrieved.

[0140] The method of the above embodiment, the target message file includes at least one message field element; the message field element includes a message field element name, jump information and a field element format; according to whether the current message field element is a nested message field element and whether the current message field element is a message field element in the header file, the message field elements of each target message file are traversed in a depth-first search order, and the message field element name of any nested message field element and the message field element name of the nested message element corresponding to the any nested message field element are spliced in sequence according to the upper and lower layer relationship of the message nesting level, reducing human intervention in the process of obtaining the message field information contained in the message field list, making the message field information accurately reflect the upper and lower layer relationship of the message nesting level between the nested message field element and its nested message element, further improving the processing efficiency and accuracy of the interface and message checking, and reducing the labor cost of the interface and message checking.

[0141] It should be noted that in the embodiments of the present application, the number of header file identifiers can also be multiple, for example, another header file identifier "ENTITY_REQ" can also be preset for the message type identifier "request message". When there are multiple headers in the message file corresponding to the multiple message type identifiers in the interface file, the headers are determined one by one in the order of reading the multiple message type identifiers in the interface file in the process of parsing the interface file, and for each determined header, the target message file is parsed based on the jump information included in each target message file. The process of parsing the target message file according to each header in the multiple headers of the message file is similar to the process of parsing the target message file according to the only one header of the message file, and the specific process will not be repeated here.

[0142] S104, checking the field information of the interface field list and the message field list to obtain the checking result of the target interface file and the target message file.

[0143] In specific implementation, the field information of the interface field list and the message field list is checked to obtain the checking result of the target interface file and the target message file. When the interface field information in the interface field list and the message field information in the message field list are the same one by one, the checking result of the target interface file and the target message file is consistent.

[0144] In some embodiments of the present application, when the checking result of the target interface file and the target message file is inconsistent, the position information where the inconsistency occurs can also be output.

[0145] The interface and message checking method provided in the above embodiments can automatically parse the target interface file and the corresponding target message file to be checked respectively, obtain the interface field list of the target interface file and the message field list of the target message file, check the field information of the interface field list and the message field list, and obtain the checking result of the target interface file and the target message file, thereby realizing efficient checking of the interface and the message, improving the processing efficiency and accuracy of the interface and the message checking, and reducing the labor cost of the interface and the message checking.

[0146] Based on the same inventive concept, the present application also provides an interface and message checking device. Since the device is the device corresponding to the interface and message checking method of the embodiments of the present application, and the principle of solving problems of the device is similar to that of the method, the implementation of the device can be referred to the implementation of the above method, and the repeated parts will not be repeated.

[0147] Figure 4A structure diagram of an interface and message collation device provided by an embodiment of the present application is shown. The interface and message collation device, as shown in Figure 4 includes an interface analysis unit 401, an association determination unit 402, a message analysis unit 403, and a field collation unit 404.

[0148] The interface analysis unit 401 is configured to perform a first analysis operation on a target interface file to obtain an interface field list and target requirement code information of the target interface file. The interface field list includes interface field information of the target interface file. The target requirement code information is an identifier of a development requirement corresponding to the interface file.

[0149] The association determination unit 402 is configured to determine a target message file corresponding to the target interface file based on the target requirement code information.

[0150] The message analysis unit 403 is configured to perform a second analysis operation on the target message file to obtain a message field list. The message field list includes message field information of the target message file.

[0151] The field collation unit 404 is configured to collate the interface field list and the message field list to obtain a collation result of the target interface file and the target message file.

[0152] In an optional embodiment, the interface analysis unit 401 is specifically configured to:

[0153] read unit information of the target interface file one by one, and perform the following processing operation after reading each unit information:

[0154] if the read unit information is a requirement code identifier, obtain the target requirement code information based on the requirement code identifier; and

[0155] if the read unit information is a message type identifier, obtain the interface field information of the target interface file based on the message type identifier to obtain the interface field list.

[0156] In an optional embodiment, the interface analysis unit 401 is specifically configured to:

[0157] obtain an interface field information set corresponding to the message type identifier based on the message type identifier;

[0158] obtain the interface field information of the target interface file according to the interface field information set corresponding to the message type identifier.

[0159] In an optional embodiment, the interface field information set comprises interface field information pairs; each interface field information pair comprises an interface field unit and a corresponding interface field attribute identifier; the interface field unit comprises a nested element identifier string and an interface field string; the interface parsing unit 401 is specifically configured to:

[0160] Each interface field information pair is traversed in a depth-first search order, and interface field information of the target interface file is constructed based on the interface field attribute identifier, the nested element identifier string and the interface field unit of each interface field information pair.

[0161] In an optional embodiment, the interface parsing unit 401 is specifically configured to perform the following operations for each interface field information pair:

[0162] If the interface field attribute identifier is not a preset first identifier, and the nested element identifier string is an empty character, the interface field string of the interface field unit in the current interface field information pair is taken as an interface field information; the first identifier indicates that the corresponding interface field unit is a nested format field unit; each nested format field unit has at least one interface field unit as a corresponding nested element;

[0163] If the interface field attribute identifier is not the first identifier, and the nested element identifier string is not an empty character, the interface field string of the interface field unit in the current interface field information pair is retrieved; the nested element identifier string indicates whether the interface field unit where the nested element identifier string is located is a nested element;

[0164] If the interface field attribute identifier is the first identifier, and the nested element identifier string is an empty character, the first interface field string of the interface field unit in the current interface field information pair is obtained; the interface field information pairs corresponding to the nested elements of the interface field unit of the current interface field information pair are traversed in a depth-first search order, the interface field string of the interface field unit in the retrieved interface field information pair corresponding to the nested element is sequentially spliced according to the upper and lower layer relationship of the nested levels between the interface field unit in the retrieved interface field information pair corresponding to the nested element and the interface field unit of the current interface field information pair, to obtain first nested field combination information corresponding to the nested elements of the interface field unit of the current interface field information pair; the first interface field string and the first nested field combination information are sequentially spliced according to the upper and lower layer relationship of the nested levels, as an interface field information; the nested element identifier string is used to determine the nested format field unit of the previous nested level corresponding to the interface field unit where the nested element identifier string is located;

[0165] If the interface field attribute identifier is the first identifier and the nested element identifier string is not empty, the interface field string of the interface field unit in the current interface field information pair is retrieved.

[0166] In an optional embodiment, the target message file is one or more; the target message file includes jump information; the jump information includes an identifier of a jump target message file; and the message parsing unit 403 is specifically configured to:

[0167] According to the preset header file identifier, a header file in the target message file is determined;

[0168] Starting from the header file, the target message file is parsed based on the jump information included in each target message file to obtain the message field list.

[0169] In an optional embodiment, the message parsing unit 403 is specifically configured to: in the process of parsing any target message file, if the jump information is encountered, the parsing operation of any target message file is temporarily suspended, and a second parsing operation of a jump target message file corresponding to the encountered jump information is preferentially completed by jumping to the jump target message file; the jump target message file includes a nested message element corresponding to any nested message field element and having a message nesting level one level lower than that of any nested message field element.

[0170] In an optional embodiment, the target message file includes at least one message field element; the message field element includes a message field element name, jump information and a field element format; and the message parsing unit 403 is specifically configured to:

[0171] Starting from the header file, the message field elements of each target message file are traversed in a depth-first search order, and a new message field information is constructed based on the message field elements in the header file, the message field elements of each target message file and the message field element names corresponding to the message field elements of each target message file, so as to obtain the message field list.

[0172] In an optional embodiment, the message parsing unit 403 is specifically configured to:

[0173] Starting from the header file, when the message field elements of each target message file are traversed in a depth-first search order, the following processing is performed for each traversed message field element:

[0174] If the current message field element searched does not satisfy the preset identification condition, and the current message field element is a message field element in the header file, a message field element name corresponding to the current message field element searched is stored as new message field information; the identification condition represents that the corresponding message field element is a nested message field element; each nested message field element has at least one target message file as a corresponding nested message element; the message nesting level of any nested message field element is higher than the message nesting level of the nested message element corresponding to any nested message field element;

[0175] If the current message field element searched does not satisfy the preset identification condition, and the current message field element is not a message field element in the header file, a message field element name corresponding to the current message field element is searched.

[0176] If the current message field element searched satisfies the identification condition, and the current message field element is a message field element in the header file, a message field element name corresponding to the current message field element is obtained as a basic message field string; nested message elements corresponding to the current message field element are traversed in a depth-first search order, and message field element names of message field elements included in the nested message elements searched are sequentially spliced according to the upper and lower layer relationship of the message nesting level between the nested message elements and the current message field element to obtain a nested field element unit corresponding to the nested message elements of the current message field element; the basic message field string and the nested field element unit are sequentially spliced according to the upper and lower layer relationship of the message nesting level between the current message field element and the nested message elements of the current message field element, and stored as new message field information.

[0177] If the current message field element searched satisfies the identification condition, and the current message field element is not a message field element in the header file, a message field element name corresponding to the current message field element is searched.

[0178] Based on the same inventive concept as the method embodiments, an electronic device is also provided in the embodiments of the present application. The electronic device can be used for interface and message collation processing. In an embodiment, the electronic device can be a server or a terminal device. In this embodiment, the structure of the electronic device can be as shown in Figure 5 The electronic device can be used for interface and message collation processing. In an embodiment, the electronic device can be a server or a terminal device. In this embodiment, the structure of the electronic device can be as shown in

[0179] The memory 501 is configured to store computer programs executed by the processor 502. The memory 501 can mainly include a program storage area and a data storage area. The program storage area can store an operating system and programs required for running instant messaging functions, etc. The data storage area can store various instant messaging information and operation instruction sets, etc.

[0180] The memory 501 can be a volatile memory, for example, a random-access memory (RAM). The memory 501 can also be a non-volatile memory, for example, a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), or the memory 501 can be any other medium capable of carrying or storing desired program codes in the form of instructions or data structures and capable of being accessed by a computer, but is not limited to this. The memory 501 can be a combination of the above memories.

[0181] The processor 502 can include one or more central processing units (CPUs) or digital processing units, etc. The processor 502 is configured to implement the above interface and packet checking method when calling the computer programs stored in the memory 501.

[0182] The communication module 503 is configured to communicate with electronic devices and other terminals or servers.

[0183] The specific connection medium between the above memory 501, the communication module 503 and the processor 502 is not limited in the embodiments of the present application. In the embodiments of the present application, the memory 501 and the processor 502 are connected through a bus 504. The bus 504 is represented by a thick line in the embodiments of the present application. The connection mode between other components is only schematically illustrated and is not limited. The bus 504 can be divided into an address bus, a data bus, a control bus, etc. For convenience of representation, only one thick line is used to represent the bus 504 in the embodiments of the present application, but it does not mean that there is only one bus or only one type of bus. Figure 5 Figure 5 Figure 5

[0184] The embodiments of the present application also provide a computer storage medium, which stores computer executable instructions. The computer executable instructions are used to implement the interface and packet checking method described in any of the embodiments of the present application.

[0185] ​​​The embodiments of the present application also provide a computer program product or computer program, which comprises computer instructions stored in a computer readable storage medium. When a processor of a computer device reads the computer instructions from the computer readable storage medium, the processor executes the computer instructions, so that the computer device executes the interface and packet collation method in any of the above embodiments.

[0186] The program product can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium may, for example, be but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination thereof. More specific examples (non-exhaustive list) of the readable storage medium include an electrical connection having one or more wires, a portable disc, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0187] The above merely provides the specific implementation of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of the changes or replacements within the technical range disclosed by the present application, which shall be covered within the protection scope of the present application.

Claims

1. A method for checking an interface and a packet, characterized by, The method comprises the following steps: performing a first parsing operation on a target interface file to obtain an interface field list and target requirement code information of the target interface file; the interface field list comprises interface field information of the target interface file; the target requirement code information is an identifier of a development requirement corresponding to the interface file; based on the target requirement code information, a target message file corresponding to the target interface file is determined; performing a second parsing operation on the target message file to obtain a message field list; the message field list comprises message field information of the target message file; comparing the interface field list and the message field list to obtain a comparison result of the target interface file and the target message file.

2. The method of claim 1, wherein, The first parsing operation on the target interface file to obtain the interface field list and the target requirement code information of the target interface file comprises: reading unit information of the target interface file one by one, and performing the following processing operations for each read unit information: if the read unit information is a requirement code identifier, the corresponding target requirement code information is obtained based on the requirement code identifier; and if the read unit information is a message type identifier, the interface field information of the target interface file is obtained based on the message type identifier to obtain the interface field list.

3. The method of claim 2, wherein, The interface field information of the target interface file based on the message type identifier comprises: based on the message type identifier, an interface field information set corresponding to the message type identifier is obtained; the interface field information of the target interface file is obtained according to the interface field information set corresponding to the message type identifier.

4. The method of claim 3, wherein, The interface field information set comprises an interface field information pair; the interface field information pair comprises an interface field unit and a corresponding interface field attribute identifier; the interface field unit is composed of a nested element identifier string and an interface field string; the interface field information of the target interface file is obtained according to the interface field information set corresponding to the message type identifier, comprising: traverse each interface field information pair in a depth-first search order, and construct the interface field information of the target interface file based on the interface field attribute identifier, the nested element identifier string and the interface field unit of each interface field information pair.

5. The method of claim 1, wherein, The target message file is one or more; the target message file comprises jump information; the jump information comprises an identifier of a jump target message file; the second parsing operation on the target message file to obtain the message field list comprises: determining a header file in the target message file according to a preset header file identifier; starting from the header file, parsing the target message file based on the jump information included in each target message file to obtain a message field list.

6. The method of claim 5, wherein, In the process of parsing any target message file, if jump information is encountered, the parsing operation of the any target message file is temporarily suspended, and the second parsing operation of the jump target message file corresponding to the encountered jump information is preferentially completed by jumping to the jump target message file; The jump target message file includes a nested message element corresponding to any nested message field element and having a message nesting level one lower than the any nested message field element.

7. The method of claim 5, wherein, The target message file includes at least one message field element; the message field element includes a message field element name, the jump information and field element format; the target message file is parsed based on the jump information included in each target message file starting from the header file to obtain a message field list, including: Each message field element of each target message file is traversed in a depth-first search order starting from the header file, and new message field information is constructed based on the message field elements in the header file, the message field elements of each target message file and the message field element names corresponding to the message field elements of each target message file to obtain a message field list.

8. An interface and message collation device, comprising: The device includes: An interface parsing unit configured to perform a first parsing operation on a target interface file to obtain an interface field list and target requirement code information of the target interface file; the interface field list includes interface field information of the target interface file; and the target requirement code information is an identifier of a development requirement corresponding to the interface file; An association determining unit configured to determine a target message file corresponding to the target interface file based on the target requirement code information; A message parsing unit configured to perform a second parsing operation on the target message file to obtain a message field list; the message field list includes message field information of the target message file; A field checking unit configured to check the interface field list and the message field list for field information to obtain a checking result of the target interface file and the target message file.

9. The apparatus of claim 8, wherein, The interface parsing unit is specifically configured to: read unit information of the target interface file one by one, and perform the following processing operations upon reading each unit information: if the read unit information is a requirement code identifier, obtain the target requirement code information corresponding to the requirement code identifier; and, if the read unit information is a message type identifier, obtain interface field information of the target interface file based on the message type identifier to obtain the interface field list.

10. The apparatus of claim 9, wherein, The interface parsing unit is specifically configured to: obtain an interface field information set corresponding to the message type identifier based on the message type identifier; obtain interface field information of the target interface file according to the interface field information set corresponding to the message type identifier.

11. A computer readable storage medium having stored therein a computer program, characterized in that: The computer program is executed by a processor to implement the method in any one of claims 1-7.

12. An electronic device, comprising: A computer program product, comprising a memory and a processor, wherein the memory stores a computer program capable of running on the processor, and when the computer program is executed by the processor, the method in any one of claims 1-7 is implemented.

13. A computer program product, characterised in that, A computer program product, comprising computer instructions stored in a computer readable storage medium; when a processor of a computer device reads the computer instructions from the computer readable storage medium, the processor executes the computer instructions, so that the computer device executes the steps of the method in any one of claims 1-7.

Citation Information

Patent Citations

  • Packet generation method and device

    CN108933787A

  • A structured data checking method

    CN109542869A