Interface access data processing method and system and related product

By converting the unrecognized fields to be processed in the initial metadata into the target format recognized by the interface, the target metadata is formed, which solves the problem that the interface testing tool cannot handle complex metadata, and improves the efficiency and accuracy of interface access.

CN118540370APending Publication Date: 2024-08-23KINGDEE SOFTWARE(CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410591926.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-11
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Existing interface testing tools cannot effectively understand and process complex metadata, resulting in metadata being unable to be used as interface access parameters for interface access.

Method used

By determining the unrecognized fields to be processed in the initial metadata, convert them into target fields in the target format to form target metadata to support interface access. The process includes parsing the key-value structure, building dynamic objects, and performing language conversion and source material lookup when necessary.

Benefits of technology

It effectively reduces the waiting time and error rate when converting massive field formats, enables metadata to be used as interface access parameters, and fills the gap in the existing technology where metadata content cannot be called by the interface.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118540370A
    Figure CN118540370A
Patent Text Reader

Abstract

The embodiment of the invention discloses an interface access data processing method and system and a related product, and the method comprises the steps: converting a to-be-processed field into a target field belonging to a target format, the target format being a field format which can be recognized by a to-be-accessed interface; replacing a to-be-processed field in the initial metadata with a target field to obtain target metadata; the target metadata supports interface access as parameters of the to-be-accessed interface. According to the embodiment of the invention, the to-be-processed field which cannot be identified by the to-be-accessed interface in the initial metadata can be determined, and the to-be-processed field is automatically converted into the target field which is accepted by the interface and belongs to the target format, so that the finally replaced target metadata can be used as the interface access parameter; the blank that the metadata content cannot be called by an interface in the prior art is filled. Compared with a manual analysis or conversion process, the automatic format conversion process of the to-be-processed fields can effectively reduce the waiting duration and the error rate when the mass fields are subjected to format conversion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of Internet technology, and in particular to an interface access data processing method, system and related products. Background Art

[0002] Metadata, also known as intermediary data or relay data, is data about data. The object being described is not included in the metadata. It mainly describes the properties of the data to support functions such as indicating storage location, historical data, resource search, and file records. It can be used to help understand the meaning of the described object, and to manage or retrieve the described object.

[0003] Metadata has a special data format and is extremely complex in structure. It contains not only field information but also a lot of other configuration information. Its construction and processing require a lot of logic. However, current interface testing tools cannot understand the complex logic inside the metadata when faced with input metadata, making it impossible to use metadata as interface access parameters for interface access. Summary of the invention

[0004] The embodiments of the present application provide an interface access data processing method, system and related products for configuring metadata that can be used as interface parameters to improve the applicability of metadata during interface access.

[0005] A first aspect of an embodiment of the present application provides an interface access data processing method, comprising:

[0006] Determine a field to be processed; the field to be processed is a field in the initial metadata that cannot be recognized by the interface to be accessed;

[0007] Converting the to-be-processed field into a target field in a target format, where the target format refers to a field format that can be recognized by the to-be-accessed interface;

[0008] The to-be-processed field in the initial metadata is replaced with the target field to obtain target metadata; the target metadata supports interface access as a parameter of the interface to be accessed.

[0009] Optionally, converting the to-be-processed field into a target field in a target format includes:

[0010] If the field to be processed is a field of a key-value pair structure, parsing the field type indicated by the key-value pair;

[0011] A calculation formula corresponding to a field of the field type in a target format is identified, and the field to be processed is written into the calculation formula to obtain a target field corresponding to the field to be processed in the target format.

[0012] Optionally, converting the to-be-processed field into a target field in a target format includes:

[0013] If the field to be processed is a field of a key-value pair structure, assigning the corresponding value of the specified key in the field to be processed to the dynamic object belonging to the target format, so as to construct a dynamic object corresponding to the field to be processed;

[0014] Use the constructed dynamic object as the target field.

[0015] Optionally, assigning the corresponding value of the specified key in the field to be processed to a dynamic object belonging to the target format includes:

[0016] If the editing language used by the field to be processed is different from the language used in the current test environment of the interface to be accessed, the corresponding value of the specified key in the field to be processed is converted into a value described in the language used, and the converted value is assigned to the dynamic object belonging to the target format.

[0017] Optionally, assigning the corresponding value of the specified key in the field to be processed to a dynamic object belonging to the target format includes:

[0018] If the corresponding value of the designated key is empty, the source data of the corresponding value of the designated key is determined, and the corresponding value of the designated key is searched from the source data and assigned to the dynamic object belonging to the target format.

[0019] Optionally, after obtaining the target metadata, the method further includes:

[0020] The dynamic object content in the target metadata is parsed, and the dynamic object content is edited according to a preset rich text editing rule, so that the dynamic object content is displayed in a rich text style.

[0021] Optionally, after obtaining the target metadata, the method further includes:

[0022] Performing an interface access test on the interface to be accessed by using the target metadata and at least one preset test case;

[0023] The interface access records generated by each access are cached; wherein each of the interface access records carries an identifier corresponding to the respective access request, and the cached results are used to edit a test case different from the preset test case for interface testing.

[0024] The method described in the first aspect of the present application can be implemented by using the content described in the second aspect of the present application during specific implementation.

[0025] A second aspect of an embodiment of the present application provides an interface access data processing system, including:

[0026] A determination unit, used to determine a field to be processed; the field to be processed is a field in the initial metadata that cannot be identified by the interface to be accessed;

[0027] A processing unit, configured to convert the field to be processed into a target field in a target format, wherein the target format refers to a field format that can be recognized by the interface to be accessed;

[0028] The processing unit is further used to replace the to-be-processed field in the initial metadata with the target field to obtain target metadata; the target metadata supports interface access as a parameter of the interface to be accessed.

[0029] A third aspect of an embodiment of the present application provides an electronic device, including:

[0030] CPU, memory and input / output interface;

[0031] The memory is a short-term storage memory or a persistent storage memory;

[0032] The central processing unit is configured to communicate with the memory and execute instruction operations in the memory to perform the method described in the first aspect of the embodiment of the present application or any specific implementation of the first aspect.

[0033] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, comprising instructions, which, when executed on a computer, enable the computer to execute a method as described in the first aspect of an embodiment of the present application or any specific implementation of the first aspect.

[0034] A fifth aspect of an embodiment of the present application provides a computer program product comprising instructions or a computer program. When the computer program product runs on a computer, the computer executes the method described in the first aspect of the embodiment of the present application or any specific implementation of the first aspect.

[0035] It can be seen from the above technical solutions that the embodiments of the present application have at least the following advantages:

[0036] The embodiment of the present application can determine the fields to be processed in the initial metadata that cannot be recognized by the interface to be accessed, and automatically convert the fields to be processed into target fields in the target format recognized by the interface, so that the target metadata finally replaced can be used as an interface access parameter to fill the gap in the prior art where metadata content cannot be called by the interface. Among them, the process of automatically converting the format of the fields to be processed can effectively reduce the waiting time and error rate when converting the format of massive fields compared to the process of manual analysis or conversion. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0038] It should be noted that, although the steps in the process diagrams (if any) involved in the embodiments are drawn in sequence as indicated by the arrows, unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the steps or stages in other steps.

[0039] Figure 1 A schematic diagram of a system architecture of the interface access data processing method according to an embodiment of the present application;

[0040] Figure 2 A flowchart of the method for processing interface access data according to an embodiment of the present application;

[0041] Figure 3 Another flowchart of the method for processing interface access data according to an embodiment of the present application;

[0042] Figure 4 Another flowchart of the method for processing interface access data according to an embodiment of the present application;

[0043] Figure 5 A schematic diagram of a logical architecture of the interface access data processing method according to an embodiment of the present application;

[0044] Figure 6 A schematic diagram of a structure of an interface access data processing system according to an embodiment of the present application;

[0045] Figure 7 A schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.

[0047] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims and drawings of the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0048] In the following description, similar expressions such as "a specific implementation" or "a specific example" are involved, which describe a subset of all possible embodiments, but it can be understood that "a specific implementation" or "a specific example" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict. In the following description, the term multiple refers to at least two. In some specific examples, the numerical value mentioned in this application reaches the threshold value (if any), which may include the case where the former is greater than the latter of the threshold value; if similar expressions such as "any" or "at least one" are mentioned, it can specifically refer to any one of the listed examples or any combination of these examples.

[0049] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0050] See also Figure 1 , Figure 1 A schematic diagram of an application environment applicable to the embodiment of the present application is shown. The method provided in the embodiment of the present application can be applied to Figure 1The interactive system 100 shown includes a terminal device 101 and a server 102, wherein the server 102 is connected to the terminal device 101 in communication, wherein the server 102 may be a traditional server or a cloud server, which is not specifically limited here. The terminal device 101 may be various electronic devices having a display screen and supporting data input, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and wearable electronic devices, etc.; specifically, data input may be based on the voice module on the terminal device 101 to input voice, based on the character input module to input characters, or based on the image input module to input images, etc., or may be based on the gesture recognition module installed on the terminal device 101, so that the user can implement gesture input and other interactive methods. The terminal device 101 may be installed with a client application, and the user may communicate with the server 102 based on the client application (such as APP, applet, etc.), or may also implement the aforementioned data input based on the client application.

[0051] Similarly, the server 102 may also be deployed with a server-side application, which may cooperate with the aforementioned client application to implement the present method. For example, the terminal device 101 sends a request carrying initial metadata to the server 102 through the client application, and this request may be to query a certain data in a certain table in the database by calling an interface; the server 102 performs format conversion on the fields to be processed in the input initial metadata to obtain the target fields that can be called by the interface to be accessed, so that the target metadata finally updated can be used as the input parameter of the interface to be accessed to successfully perform interface access, and return the access result to the terminal device 101. It should be noted that the above-mentioned application environment is only an example made for the convenience of understanding, and it can be understood that the embodiments of the present application are not limited to the above-mentioned application environment.

[0052] The method of the present application will be described in further detail below.

[0053] See also Figure 2 In a first aspect, the present application provides a specific embodiment of an interface access data processing method, the embodiment comprising the following operation steps:

[0054] Step 21: Determine the fields to be processed.

[0055] The fields to be processed are fields in the initial metadata that cannot be identified by the interface to be accessed. In actual situations, metadata can describe the request parameters required by the interface, including parameter name, type, whether it is required, etc. Based on this information, the correct request body or query parameters can be constructed to access the interface; it should be noted that the "access interface" mentioned in the embodiment of the present application can specifically refer to the test interface. However, the inventors found that the structure of metadata is extremely complex, including that the metadata identifier requires special annotation, its basic data field needs to fill in the primary key field value, its basic data and other fields need to go through the legality verification process of whether they exist in the database, etc., and the construction format of some of the fields (i.e., the fields to be processed) cannot be understood and used by the existing interface testing scheme, resulting in the interface access process being blocked; therefore, it is necessary to provide a solution that can handle such fields to be processed, so as to process the fields to be processed into the required format fields that can be recognized and used by the interface.

[0056] Step 22: Convert the field to be processed into a target field in a target format.

[0057] The target format refers to the field format that can be recognized by the interface to be accessed. This target format can specifically refer to the field format that can be understood or required by the current interface environment, and can specifically refer to the json format. For example, the target format of a date field can be "xxxx-xx-xx", and the target format of a String field can be a String object or a numeric format. The target format can be determined based on the field format (or parameter type) expected by the interface to be accessed, and is not limited here.

[0058] Step 23: Replace the to-be-processed fields in the initial metadata with the target fields to obtain target metadata, which supports interface access as a parameter of the interface to be accessed.

[0059] In other words, the converted target metadata can be used as the formatted data required by the interface to request the access interface normally.

[0060] In summary, the embodiments of the present application can determine the fields to be processed in the initial metadata that cannot be recognized by the interface to be accessed, and automatically convert the fields to be processed into target fields in the target format recognized by the interface, so that the target metadata finally replaced can be used as an interface access parameter to fill the gap in the prior art where metadata content cannot be called by the interface. Among them, the process of automatically converting the format of the fields to be processed can effectively reduce the waiting time and error rate when converting the format of massive fields compared to the process of manual analysis or conversion.

[0061] Based on the above example descriptions, some specific possible implementation examples will be provided below. In actual applications, the implementation contents between these examples can be combined or implemented separately as needed according to the corresponding functional principles and application logic. If implemented in combination, the execution order between the combined examples can be determined according to their respective processing logics, which can be determined by the actual scenario.

[0062] The present application provides another specific embodiment of an interface access data processing method, which includes the following operation steps:

[0063] Step 21: Determine the fields to be processed.

[0064] Step 22: Convert the field to be processed into a target field in a target format.

[0065] As a possible implementation, if the field to be processed is a common field, such as a field of a numeric type int, long, etc., or a string String, these fields can be converted into the target format field required by the interface. For example, if the interface expects an object, rather than a basic data type such as int, long, etc. (this is very common in Java, because interfaces can usually only reference objects), and the current input is an int or long value, i.e., the field to be processed, then the int or long value needs to be encapsulated into their corresponding wrapper classes (such as Integer for int, Long for long) to form the object actually required by the interface. Similarly, if the interface expects a number or other type of object, the currently input String needs to be parsed or converted into the corresponding type to meet the requirements of the interface. Of course, if the field to be processed itself is a general field, such as if it meets the interface expectations, the field to be processed can be directly passed to the interface as a parameter without format conversion.

[0066] based on Figure 2 As an example content of , as a possible implementation method, the operation process of step 22 may include: if the field to be processed is a field of a key-value pair structure, parsing the field type referred to by the key-value pair; identifying the calculation formula corresponding to the field of the field type in the target format, writing the field to be processed into the calculation formula to obtain the target field corresponding to the field to be processed in the target format.

[0067] The above field value types can include time type, numeric type or Boolean type. For ease of understanding, the map data is explained below. Map (or key-value pair set) data is a key-value data structure, that is, each set of data is stored in the form of key and value, and is used to save data with mapping relationships. Therefore, the Map collection saves two sets of values, one set of values ​​is used to save the key in the Map, and the other set of values ​​is used to save the value in the Map. The key and value can be any reference type of data. The map field is relatively complex. If it is not formatted, the interface environment may not be able to understand and use the content normally.

[0068] See also Figure 3 For example, if the field to be processed is a map type field, the field type referred to by the key-value pair can be parsed. Further, the map field can be annotated according to the parsed field type. After that, the map field is converted according to the field type or the identifier corresponding to the field type to obtain a map object required or understandable by the interface, for example:

[0069] a) If the field type is identified as a time type containing a date, it can be marked with a "DATE" identifier. After that, the map field can be formatted according to this field type or identifier, such as converted into a time representation field in json format. For example, the calculation formula f (specific date) corresponding to "DATE" can be found, and the value "2023 / 10 / 23,14:15:30" in the field to be processed can be substituted into the formula to output the target field corresponding to the value in json format; in some examples, the target field can be a specific representation style such as "xxxx / xx / xx T xx:xx:xx" or a Unix timestamp, where "T" is the separator between the date and the clock. For example, the converted target field can be: "2023-10-23T14:15:30" or "1697641800ms".

[0070] b) If the field type is identified as a numeric type, it can be marked with a "numeric value" identifier. After that, the map field can be formatted numerically according to this field type or identifier, such as converting it into a numeric representation field in json format. For example, the statement Long.parse("specific value") can be regarded as a calculation formula corresponding to "numeric value". In some examples, the long type target field value converted here conforms to the following range: -2^31 to (2^31-1). For example: You can run the statement Long.parse("123456") to parse (or convert) the string parameter (i.e. value) "123456" into a long type numeric value.

[0071] c) If the recognized field type is boolean, it can be marked with the "Boolean" identifier. After that, the map field can be formatted according to this field type or identifier. In some examples, the statement Boolean.parse("boolean value") can be regarded as the calculation formula corresponding to "Boolean". For example, the statement Boolean.parse("true") can be run to parse (or convert) the string parameter "true" into a boolean type value.

[0072] d) Other field types, etc. will perform default json conversion. In some examples, the field type identifier at this time can be recorded as "Other", and the statement String.valueOf("text field") can be regarded as a calculation formula corresponding to "Other". Exemplarily, the text calculated by this conversion can be in languages such as English. For example, the statement String.valueOf("张三") can be run to parse (or convert) the string parameter "张三" into a string type value, such as "zhangsan".

[0073] As can be seen from the above description, referring to the calculation formula of the corresponding field type to convert the field to be processed in the key-value pair structure into the target field represented in the target format helps the interface environment to better understand and use the content of the field to be processed, thus ensuring the normal operation of the interface task.

[0074] Based on Figure 2 the example content, as another possible implementation, the operation process of step 22 may include: If the field to be processed is a field in the key-value pair structure, assign the corresponding value of the specified key in the field to be processed to a dynamic object belonging to the target format to construct a dynamic object corresponding to the field to be processed, and use the constructed dynamic object as the target field. This specified key can refer to the key selected by the user or the system, and is often specified as the target to be treated specifically.

[0075] Please refer to Figure 4, you can choose to set the value of the field to be processed in the key-value pair structure to a dynamic object. This dynamic object usually refers to an object whose properties or behaviors can be changed at runtime. For example, an empty (or non-empty) entity object (or dynamic object) can be constructed or obtained from the background through the entity identifier (i.e., key) in the map; the entity information in the map (including the field value) is obtained through the key in the map, and then the entity information such as the field value is written to the field of the entity object to construct the object expected by the interface for the interface to call. It should be noted that compared with the map object, the dynamic object can be the data carrier or carrier mode of the entire system platform; the dynamic object can encapsulate information such as field mapping relationship and table mapping relationship, so the dynamic object can carry more data and is more suitable for data types under the system platform such as forms (such as time interval type or multi-language type, etc.), which are not clearly carried by ordinary map objects; in addition, the dynamic object can also encapsulate some verification rules, such as checking the mandatory nature of certain fields, which are also not carried by ordinary maps, so in some specific examples, it is necessary to construct a dynamic object.

[0076] In actual situations, the process of field conversion involves the environment language and source data (or basic resources). Therefore, the following will specifically explain the corresponding processing flow when the field to be processed of the key-value pair structure is converted into a dynamic object, if the environment language and source data are involved.

[0077] As described above, converting the fields to be processed of the key-value pair structure into dynamic objects can make up for the limitations of converting the fields to be processed into map objects, ensuring that the fields to be processed can be more completely understood and called by the interface with the advantage of the dynamic object's carrying capacity, thereby exerting a greater application effect.

[0078] In some specific examples, the above-mentioned specific operation process of "assigning the corresponding value of the specified key in the field to be processed to the dynamic object belonging to the target format" may include: if the editing language used by the field to be processed is different from the language used in the current test environment of the interface to be accessed, converting the corresponding value of the specified key in the field to be processed into a value described in the used language, and assigning the converted value to the dynamic object belonging to the target format.

[0079] Exemplarily, the language used in the current test environment, such as Java, can be learned. If the editing language used in the field to be processed is different from the language used in the current test environment, the corresponding value of the specified key in the field to be processed can be converted into a value described in the aforementioned language. At the same time, a localized ILocaleString dynamic object suitable for the aforementioned language can be created. After that, the converted value is assigned to this dynamic object to meet the unified requirements of the interface for the parameter language. Here, the conversion process of the corresponding value of the specified key (i.e., key) can be achieved through the preset relationship between the key and the language used; for example, a preset "key and language relationship table" can be obtained, and the relationship table can record "key1-English, key2-French...keyn-English", etc., to indicate that the corresponding value of a key (i.e., value) in the current test environment should be described in the preset language used for it.

[0080] As described above, converting the corresponding value of the designated key into a value described in the used language can improve the applicability of the field to be processed in the current test environment and avoid the field to be processed being excluded due to incorrect language usage.

[0081] In some specific examples, the above-mentioned specific operation process of "assigning the corresponding value of the specified key in the field to be processed to the dynamic object belonging to the target format" may include: if the corresponding value of the specified key is empty, determining the source data of the corresponding value of the specified key, and searching the corresponding value of the specified key from the source data and assigning it to the dynamic object belonging to the target format.

[0082] Of course, if the corresponding value of the specified key is not empty, this non-empty value can be directly assigned to the dynamic object of the target format.

[0083] Exemplarily, the corresponding value of the specified key can be queried in the database based on the index information related to the source of the key-value pair, and the corresponding value found can be assigned to the dynamic object; this index information can be the data table code and / or the type of the value (such as time type or numerical type), etc. This index information can be the pointing information carried in the request initiated by the user, and the source material of a value can be one or more fields in the source material.

[0084] If the source data has time differences, such as changes in historical versions, you can set the filter condition "Is it the current version" to specifically filter out a version of the source data that meets the current query requirements, thereby improving the query effect on unique values. For example, if the request is for data in a certain version of a data table, if you use the filter condition "Is it the current version", you can filter out data in this version rather than other versions of the table and write them into the dynamic object, thereby avoiding errors caused by differences in data versions.

[0085] As described above, even if the corresponding value of the specified key is empty, an active query is attempted through the source data, which is equivalent to providing an attempt mechanism to promote the completeness of the content of the field to be processed and increase the usefulness of the field to be processed. On the other hand, the existence of the source data can prove the authenticity and reliability of the content of the field to be processed to a certain extent, making the content of the field to be processed traceable.

[0086] Step 23: Replace the to-be-processed fields in the initial metadata with the target fields to obtain target metadata, which supports interface access as a parameter of the interface to be accessed.

[0087] based on Figure 2 In some specific examples, after step 23, the interface access data processing method of the embodiment of the present application may also include the following operations (result display): parsing the dynamic object content in the target metadata, and editing the dynamic object content according to preset rich text editing rules, so that the dynamic object content is displayed in a rich text style.

[0088] For example, the dynamic object in the target metadata can be parsed to obtain the field identifier and the field value of each field in the dynamic object, and then output and display them in json format. In some examples, the above rich text editing rules can specify at least one of the following:

[0089] Text formatting standards: Specifically, the formats of titles, paragraphs, lists, etc. should follow certain standards to facilitate reading and editing; for example, titles should be written in bold, a space should be inserted between numbers and text, and lists should use ordered or unordered lists, etc.

[0090] Unified text style: Titles at the same level should use the same style to maintain consistency; time-type field content should use a certain font and size, etc.

[0091] Consistent use of punctuation marks: For example, in rich text editing, it is recommended to use English punctuation marks; commas are used to distinguish multiple sentences in a sentence, while periods are replaced by spaces, and semicolons are replaced by commas plus spaces.

[0092] Among them, a rich text box can be used to construct a json content display area, and it can be indented according to the json format, so that the metadata results can be displayed clearly and beautifully on the front end. The aforementioned rich text box can refer to an input box on a web page where formatted text can be entered. In the rich text box, different fonts and colors can be set, paragraphs and margins can be controlled, and pictures, emoticons, etc. can be inserted.

[0093] As described above, the embodiments of the present application can standardize the display style of data content, thereby improving the readability and application efficiency of the data content.

[0094] based on Figure 2 Example content, in some specific examples, after step 23, the interface access data processing method of the embodiment of the present application may also include the following operations (caching interface access records): performing an interface access test on the access interface through target metadata and at least one preset test case; caching the interface access records generated for each access; wherein each interface access record carries an identifier corresponding to its own access request, and the cached result is used to edit a test case different from the preset test case for interface testing.

[0095] Exemplarily, the access records generated by each access (which may contain interface information, interface parameters or parameters contained in the test case) can be serialized and arranged, and the serialized information can be stored in the page cache and / or application cache, wherein the cached information can be valid for 8 hours by default. In addition, each interface access record can be isolated. For example, the user ID and / or each access record ID can be used as a key to store each interface access record differently, so as to achieve the effect of isolating users or access data, so that multiple test users or multiple test processes will not affect each other. On the other hand, a "copy" control can be set for the cache interface. This setting is based on the consideration that the difference between each test case is generally not large, such as only more or less certain parameters, so the "copy" control is provided to help the case cataloging personnel to obtain the basic data that can quickly catalog new test cases from the page cache and / or application cache by clicking "copy"; in short, by copying the previous test case content and making fine adjustments, the new test case can be filled into the interface access page, thereby effectively improving the handling efficiency of the test case and making the interface testing work easier.

[0096] Caching the interface access records as above makes it easier for relevant personnel to monitor and maintain interface tasks, thereby improving work efficiency.

[0097] It should be noted that in the interface access link, the interface to be accessed can be identified based on the application identifier and interface identifier filled in by the user, or the number and type of access parameters. In addition, the interface can be accessed through the calling method of the microservice interface, such as the dispatch service assistant DispatchServiceHelper; where (1) if the interface access process does not involve cross-container, that is, the access process is for the current container, the interface call can be made directly through reflection to generate the class, such as: the organization management interface can be called, and its implementation class can be found according to the application identifier appid and interface address filled in the page, and the implementation class object can be created through the JAVA launch mechanism. (2) If it involves cross-container, the remote call dubbo-style request forwarding can be performed according to the application identifier id and interface access address filled in the page, in order to make a cross-container interface call.

[0098] In summary, if Figure 5 As shown, the embodiments of the present application may include functional layers such as a page core logic processing layer and a page display layer. Core logic processing layer: can be used to perform format conversion processing on the metadata filled in the operation page to process the metadata content into the data type required by the interface, so that the interface can be accessed correctly, and the access records can be cached and the cache record information can be used quickly. Specifically, the core logic processing layer includes core data rule conversion (or format conversion), interface access record caching, interface dynamic access and other functions. The rule conversion logic includes: numerical type field processing, map field processing, dynamic object processing, general field processing and other conversion logic.

[0099] Page display layer: The interface results can be displayed in JSON format; the interface access records can be displayed in a list serialized manner, and a quick copy button is provided to facilitate users to copy and reuse access records more conveniently.

[0100] As can be seen from the above description, the embodiment of the present application can perform rule conversion according to the field type of metadata to construct the format field required by the interface for microservice interface call, thereby more perfectly supporting the interface test of metadata as parameters and return values, filling the gap that metadata is currently not applicable to interface access; dynamic objects can be constructed according to the metadata information input by the user for interface access, better supporting the interface test of complex map objects as parameters; dynamic objects can be parsed for result display, improving the efficiency of testers in checking the results returned by the interface; microservice interface testing can be used as an executable link in the test link, thereby greatly reducing the risk of collaboration. In short, due to the complexity of metadata, such as the need for metadata identification of dynamic objects and different attributes of various data types, existing interface testing tools such as postman, whether interface parameters or result display, are difficult to be compatible with dynamic objects, and cannot save complex object records and one-click copy; in contrast, the embodiment of the present application can break through the obstacle that the original test cannot construct dynamic objects and complex map object data, and can transform an API interface testing tool suitable for metadata, making the process of constructing data easier; in addition, it can make the display of results clearer and data copying easier.

[0101] Compared to Figure 2 The examples shown illustrate that the above-mentioned additional or detailed example contents or possible implementation methods do not necessarily have to be executed during the specific implementation. If more than two examples or possible implementation methods are added, these examples or possible implementation methods can be implemented in combination or separately. If implemented in combination, the execution order between the combined examples can be determined according to their respective processing logic, which can be determined according to the actual scenario.

[0102] See also Figure 6 According to a second aspect of the present application, a specific embodiment of an interface access data processing system is provided, the system comprising:

[0103] The determination unit 601 is used to determine the fields to be processed; the fields to be processed are fields in the initial metadata that cannot be identified by the interface to be accessed;

[0104] A processing unit 602 is used to convert the field to be processed into a target field in a target format, where the target format refers to a field format that can be recognized by the interface to be accessed;

[0105] The processing unit 602 is further used to replace the to-be-processed fields in the initial metadata with the target fields to obtain the target metadata; the target metadata supports interface access as a parameter of the interface to be accessed.

[0106] In some examples, the processing unit 602 is specifically configured to:

[0107] If the field to be processed is a field of a key-value pair structure, parse the field type referred to by the key-value pair;

[0108] The calculation formula corresponding to the field of the identification field type in the target format is written into the calculation formula to obtain the target field corresponding to the field to be processed in the target format.

[0109] In some examples, the processing unit 602 is specifically configured to:

[0110] If the field to be processed is a field of a key-value pair structure, assign the corresponding value of the specified key in the field to be processed to the dynamic object of the target format to construct a dynamic object corresponding to the field to be processed;

[0111] Use the constructed dynamic object as the target field.

[0112] In some examples, the processing unit 602 is specifically configured to:

[0113] If the editing language used by the field to be processed is different from the language used in the current test environment of the interface to be accessed, the corresponding value of the specified key in the field to be processed is converted into a value described in the used language, and the converted value is assigned to a dynamic object belonging to the target format.

[0114] In some examples, the processing unit 602 is specifically configured to:

[0115] If the corresponding value of the designated key is null, the source data of the corresponding value of the designated key is determined, and the corresponding value of the designated key is searched from the source data and assigned to the dynamic object belonging to the target format.

[0116] In some examples, the processing unit 602 is further used to: parse the dynamic object content in the target metadata, and edit the dynamic object content according to a preset rich text editing rule, so that the dynamic object content is displayed in a rich text style.

[0117] In some examples, the processing unit 602 is further used to: perform an interface access test on the access interface through the target metadata and at least one preset test case;

[0118] The interface access records generated by each access are cached; wherein each interface access record carries an identifier corresponding to its own access request, and the cached results are used to edit a test case different from a preset test case for interface testing.

[0119] In the embodiment of the present application, the operations performed by the various units of the interface access data processing system are similar to the operations described in the first aspect or any specific method embodiment of the first aspect, and will not be described in detail here. Of course, the specific implementation process of each operation in the first aspect of the present application can also refer to the relevant description of the second aspect.

[0120] See also Figure 7 The electronic device 700 of the embodiment of the present application may include one or more central processing units (CPU) 701 and a memory 705 , in which one or more application programs or data are stored.

[0121] The memory 705 may be a volatile storage or a persistent storage. The program stored in the memory 705 may include one or more modules, each of which may include a series of instruction operations in the electronic device. Furthermore, the central processor 701 may be configured to communicate with the memory 705 and execute a series of instruction operations in the memory 705 on the electronic device 700.

[0122] The electronic device 700 may also include one or more power supplies 702, one or more wired or wireless network interfaces 703, one or more input and output interfaces 704, and / or one or more operating systems, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0123] The central processor 701 can execute the operations performed by the aforementioned first aspect or any specific method embodiment of the first aspect, and the details will not be repeated here.

[0124] The present application provides a computer-readable storage medium, comprising instructions, which, when executed on a computer, enable the computer to execute the method described in the first aspect or any specific implementation of the first aspect.

[0125] The present application provides a computer program product comprising instructions or a computer program. When the computer program product is run on a computer, the computer is enabled to execute the method described in the first aspect or any specific implementation of the first aspect.

[0126] It is understood that in various embodiments of the present application, the sequence number of each step does not mean the order of execution, and the execution order of each step 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 application. The operation content added or refined in each example scheme of the above method, system or device (if any) does not necessarily have to be executed in the specific implementation. If more than two operations are added, these operations can be implemented in combination or separately, depending on the actual scenario.

[0127] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system (if any) and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0128] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system or device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0129] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0130] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0131] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product (computer program product) is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a business server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.

Claims

1. A method for processing interface access data, characterized in that: include: Determine the fields to be processed; The to-be-processed fields are fields in the initial metadata that cannot be identified by the to-be-accessed interface; Converting the to-be-processed field into a target field in a target format, where the target format refers to a field format that can be recognized by the to-be-accessed interface; Replacing the to-be-processed field in the initial metadata with the target field to obtain target metadata; The target metadata supports interface access as a parameter of the interface to be accessed.

2. The interface access data processing method according to claim 1, characterized in that: The converting the to-be-processed field into a target field in a target format includes: If the field to be processed is a field of a key-value pair structure, parsing the field type indicated by the key-value pair; A calculation formula corresponding to a field of the field type in a target format is identified, and the field to be processed is written into the calculation formula to obtain a target field corresponding to the field to be processed in the target format.

3. The interface access data processing method according to claim 1, characterized in that: The converting the to-be-processed field into a target field in a target format includes: If the field to be processed is a field of a key-value pair structure, assigning the corresponding value of the specified key in the field to be processed to the dynamic object belonging to the target format, so as to construct a dynamic object corresponding to the field to be processed; Use the constructed dynamic object as the target field.

4. The interface access data processing method according to claim 3, characterized in that: The assigning the corresponding value of the specified key in the to-be-processed field to the dynamic object belonging to the target format includes: If the editing language used by the field to be processed is different from the language used in the current test environment of the interface to be accessed, the corresponding value of the specified key in the field to be processed is converted into a value described in the language used, and the converted value is assigned to the dynamic object belonging to the target format.

5. The interface access data processing method according to claim 3, characterized in that: The assigning the corresponding value of the specified key in the to-be-processed field to the dynamic object belonging to the target format includes: If the corresponding value of the designated key is empty, the source data of the corresponding value of the designated key is determined, and the corresponding value of the designated key is searched from the source data and assigned to the dynamic object belonging to the target format.

6. The method for processing interface access data according to claim 3, characterized in that: After obtaining the target metadata, the method further includes: The dynamic object content in the target metadata is parsed, and the dynamic object content is edited according to a preset rich text editing rule, so that the dynamic object content is displayed in a rich text style.

7. The method for processing interface access data according to any one of claims 1 to 6, characterized in that: After obtaining the target metadata, the method further includes: Performing an interface access test on the interface to be accessed by using the target metadata and at least one preset test case; The interface access records generated by each access are cached; wherein each of the interface access records carries an identifier corresponding to the respective access request, and the cached results are used to edit a test case different from the preset test case for interface testing.

8. An interface access data processing system, characterized in that: include: A determination unit, used for determining a field to be processed; The to-be-processed fields are fields in the initial metadata that cannot be identified by the to-be-accessed interface; A processing unit, configured to convert the field to be processed into a target field in a target format, wherein the target format refers to a field format that can be recognized by the interface to be accessed; The processing unit is further used to replace the to-be-processed field in the initial metadata with the target field to obtain target metadata; The target metadata supports interface access as a parameter of the interface to be accessed.

9. An electronic device, characterized in that: include: CPU, memory and input / output interface; The memory is a short-term storage memory or a persistent storage memory; The central processing unit is configured to communicate with the memory and execute instructions in the memory to perform the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The method comprises instructions, which, when executed on a computer, cause the computer to execute the method according to any one of claims 1 to 7.

11. A computer program product comprising instructions or a computer program, characterized in that When the computer program product is run on a computer, the computer is caused to execute the method according to any one of claims 1 to 7.