Interface data processing method and system based on visual page and electronic equipment
Through the interface data processing method based on visual pages, the problem of low efficiency of interface data processing of various development language types is solved, and the interface data is quickly acquired and processed, reducing the learning cost and operation threshold.
Patent Information
- Application Number
- CN202411752768.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-03-21
AI Technical Summary
When the prior art faces interface data of multiple development language types, multiple data processing tools are required, resulting in high learning costs for technicians and low data processing efficiency.
The interface data processing method based on the visual page is adopted. By obtaining the interface registration page and rule arrangement page of the visual page, selecting the target interface, receiving the response parameter structure and user input rule arrangement instructions, generating a JSON format data processing rule script, and using JSONPath to perform data processing of the interface response parameter value.
It reduces the time for technicians to learn data processing tools, improves data processing efficiency, and unifies data processing rules in different interface formats through JSON and JSONPath, reducing learning difficulty and cost.
Smart Images

Figure CN119668588A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of interface management, and in particular to a method, system and electronic device for processing interface data based on a visualization page. Background Art
[0002] As the business processes and needs of enterprises continue to change and evolve, in the process of data interaction, it is necessary to process the data returned by the interface, quickly adjust and optimize the interface data, so that the interface data matches the business needs without secondary interface development, otherwise it will lead to data errors and business risks. Therefore, interface data processing is one of the cores of business drive and process operation, and its accuracy, completeness and practicality are crucial to business processes.
[0003] At present, the processing rules of interface data are customized through data processing tools. However, data processing tools are faced with interface data of one development language type, which has a small scope of application. When interface data exists in multiple development language types, multiple data processing tools are often required, and these new tools usually require technical personnel to spend learning costs to learn, which leads to a slow data processing development process and low data processing efficiency. Summary of the invention
[0004] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.
[0005] In view of the above-mentioned shortcomings of the prior art, the present application discloses an interface data processing method, system and electronic device based on a visual page to reduce the time for technicians to learn data processing tools, thereby improving data processing efficiency.
[0006] The present application discloses an interface data processing method based on a visualization page, comprising: obtaining a visualization page, wherein the visualization page comprises an interface registration page and a rule arrangement page; selecting a target interface on the interface registration page, receiving a response parameter structure corresponding to the target interface, and converting the response parameter structure into a JSON format; displaying a preset rule arrangement component through the rule arrangement page, and receiving a rule arrangement instruction input by a user for the rule arrangement component to determine a data processing rule, and converting the data processing rule into a JSON format; generating a rule script using JSONPath according to the response parameter structure and data processing rule converted into the JSON format, and performing data processing on the response parameter value of the target interface using the rule script to obtain a response result.
[0007] In one embodiment of the present application, a response parameter structure corresponding to the target interface is received in the following manner: a user inputs interface registration information of an external interface through an interface registration page, or obtains interface registration information by parsing an interface file of the external interface, wherein the interface registration information includes a request parameter structure and a response parameter structure; a test request parameter is generated according to the request parameter structure, and the external interface is called according to the test request parameter to obtain a test response parameter of the external interface, so as to determine an interface test result of the external interface according to a comparison result between the test response parameter and the response parameter structure; if the interface test result is that the interface test passes, the external interface is determined as a registered interface, wherein the target interface is any registered interface.
[0008] In one embodiment of the present application, the visualization page also includes an interface selection page, and the method also includes: displaying a registered interface list through the interface selection page, and receiving an interface selection instruction, wherein the registered interface list includes one or more registered interfaces; and determining a target interface from each of the registered interfaces according to the interface selection instruction.
[0009] In one embodiment of the present application, the visualization page also includes an interface arrangement page, and the method also includes: displaying the registered interface list through the interface arrangement page, and receiving an interface arrangement instruction; arranging at least a portion of the registered interfaces according to the interface arrangement instruction to obtain an interface sequence, and taking the first-order registered interface in the interface sequence as the current interface; in response to the current interface, obtaining a current request parameter corresponding to the current interface, and determining the subordinate interface corresponding to the current interface from the interface sequence; inputting the current request parameter corresponding to the current interface into the current interface, and obtaining the current response parameter and response result corresponding to the current interface; generating the current request parameter corresponding to the subordinate interface according to the current response parameter and response result corresponding to the current interface, and determining the subordinate interface as the new current interface.
[0010] In one embodiment of the present application, the visualization page also includes an interface association page, and the method also includes: displaying the request parameter structure and response parameter structure corresponding to the registered interface through the interface arrangement page, and receiving an interface association instruction; establishing an association relationship between the response parameter structure of the first interface and the request parameter structure of the second interface according to the interface association instruction, wherein the first interface and the second interface are different registered interfaces; arranging at least a part of the registered interfaces according to the association relationship to obtain an interface sequence; and displaying the response result corresponding to the interface sequence through the interface arrangement page.
[0011] In one embodiment of the present application, after the response parameter value of the target interface is processed using the rule script to obtain a response result, the method further includes: converting the response result into JSON format, and generating response data based on the response parameter structure, data processing rules and response result converted into JSON format; executing a preset response strategy based on the response data, the preset response strategy including at least one of a first response strategy, a second response strategy and a third response strategy, wherein the first response strategy includes transmitting the response data to a lower-level interface, the second response strategy includes storing the response data in a file format, and the third response strategy includes storing the response data in a preset database.
[0012] In one embodiment of the present application, a preset rule orchestration component is displayed through the rule orchestration page, and a rule orchestration instruction input by a user for the rule orchestration component is received, including: displaying the response parameter structure through the rule orchestration page; receiving a parameter selection instruction, and determining a target parameter structure from the response parameter structure according to the parameter selection instruction, wherein the target parameter result corresponds to the response parameter value; displaying multiple rule orchestration components through the rule orchestration page, and monitoring drag events corresponding to the rule orchestration components; generating a type selection instruction according to the monitored drag event, and determining a target rule component from the rule orchestration component according to the type selection instruction; displaying the target rule component through the rule orchestration page, and receiving a rule orchestration instruction corresponding to the target rule component.
[0013] In one embodiment of the present application, the data processing rule includes at least one of the following: if the rule orchestration component corresponding to the data processing rule is a parameter filtering component, the response parameter value is screened according to the parameter filtering condition in the data processing rule; if the rule orchestration component corresponding to the data processing rule is a parameter conversion component, the response parameter value is converted according to the target conversion value in the data processing rule; if the rule orchestration component corresponding to the data processing rule is a conditional conversion component, the parameter to be converted is determined from the response parameter value according to the parameter selection condition in the data processing rule, and the parameter to be converted is converted according to the target conversion value in the data processing rule.
[0014] The present application discloses an interface data processing system based on a visualization page, comprising: an acquisition module, used for acquiring a visualization page, wherein the visualization page comprises an interface registration page and a rule arrangement page; a receiving module, used for selecting a target interface on the interface registration page, receiving a response parameter structure corresponding to the target interface, and converting the response parameter structure into a JSON format; an arrangement module, used for displaying a preset rule arrangement component through the rule arrangement page, and receiving a rule arrangement instruction input by a user for the rule arrangement component to determine a data processing rule, and converting the data processing rule into a JSON format; a processing module, used for generating a rule script using JSONPath according to the response parameter structure and data processing rule converted into the JSON format, and performing data processing on the response parameter value of the target interface using the rule script to obtain a response result.
[0015] The present application discloses an electronic device, comprising: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device executes the above method.
[0016] Beneficial effects of this application:
[0017] The response parameter structure and data processing rules of the target interface are obtained through the visualization page, and the rule script is generated using JSONPath according to the response parameter structure and data processing rules that have been converted into JSON format, and the rule script is used to process the response parameter value of the target interface to obtain the response result. In this way, compared with development through data processing tools, obtaining the response parameter structure and data processing rules through the visualization page reduces the operation threshold. At the same time, JSON and JSONPath are used to unify data in different interface formats, and the data processing rules are unified when facing different interface types, thereby reducing the learning difficulty of interface data processing from two aspects, reducing the learning cost, and thus improving the efficiency of interface data processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a flowchart of an interface data processing method based on a visualization page in an embodiment of the present application;
[0019] Figure 2 is a schematic diagram of a basic configuration component in an embodiment of the present application;
[0020] Figure 3 is a schematic diagram of a parameter setting component in an embodiment of the present application;
[0021] Figure 4 It is a flowchart of an interface registration method in an embodiment of the present application;
[0022] Figure 5 This is a schematic diagram of the structure of an interface selection page in an embodiment of the present application;
[0023] Figure 6 is a schematic diagram of the structure of another interface selection page in an embodiment of the present application;
[0024] Figure 7 It is a schematic diagram of the structure of a preset layout template in an embodiment of the present application;
[0025] Figure 8 is a structural diagram of another preset arrangement template in an embodiment of the present application;
[0026] Fig. 9 is a structural diagram of another preset arrangement template in an embodiment of the present application;
[0027] Fig.10 It is a flowchart of another method for processing interface data based on a visualization page in an embodiment of the present application;
[0028] Fig.11 It is a structural diagram of an interface data processing system based on a visualization page in an embodiment of the present invention;
[0029] Fig.12 It is a schematic diagram of the structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0030] The following describes the embodiments of the present invention through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and sub-samples in the embodiments can be combined with each other without conflict.
[0031] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0032] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.
[0033] The terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so as to describe the embodiments of the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.
[0034] Unless otherwise stated, the term "plurality" means two or more.
[0035] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B indicates: A or B.
[0036] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.
[0037] Combination Figure 1 As shown, the embodiment of the present disclosure provides an interface data processing method based on a visualization page, including:
[0038] Step S101, obtaining a visualization page;
[0039] Among them, the visualization page includes the interface registration page and the rule arrangement page;
[0040] Step S102, selecting a target interface on the interface registration page, receiving a response parameter structure corresponding to the target interface, and converting the response parameter structure into a JSON format;
[0041] Step S103, displaying a preset rule arrangement component through a rule arrangement page, and receiving a rule arrangement instruction input by a user for the rule arrangement component to determine a data processing rule, and converting the data processing rule into a JSON format;
[0042] Step S104, using JSONPath to generate a rule script according to the response parameter structure converted into JSON format and the data processing rules, and using the rule script to perform data processing on the response parameter value of the target interface to obtain a response result.
[0043] The interface data processing method based on the visualization page provided by the embodiment of the present disclosure is adopted, and the response parameter structure and data processing rules of the target interface are respectively obtained through the visualization page. According to the response parameter structure and data processing rules that have been converted into JSON format, JSONPath is used to generate a rule script, and the rule script is used to process the response parameter value of the target interface to obtain a response result. In this way, compared with development through data processing tools, obtaining the response parameter structure and data processing rules through the visualization page reduces the operation threshold. At the same time, JSON and JSONPath are used to unify data in different interface formats, and the data processing rules are unified when facing different interface types, thereby reducing the learning difficulty of interface data processing from two aspects, reducing the learning cost, and thus improving the efficiency of interface data processing.
[0044] Optionally, a response parameter structure corresponding to the target interface is received in the following manner: a user inputs interface registration information of the external interface through an interface registration page, or, by parsing the interface file of the external interface, obtains interface registration information, wherein the interface registration information includes a request parameter structure and a response parameter structure; a test request parameter is generated according to the request parameter structure, and the external interface is called according to the test request parameter to obtain a test response parameter of the external interface, so as to determine an interface test result of the external interface based on a comparison result between the test response parameter and the response parameter structure; if the interface test result is that the interface test passes, the external interface is determined as a registered interface, wherein the target interface is any registered interface.
[0045] In some embodiments, the interface registration page is used to obtain interface registration information, wherein the interface registration page includes a basic setting component and a parameter setting component, the basic setting component is as follows: Figure 2 As shown, the parameter setting components are as follows Figure 3 As shown; each external interface is identified and information is collected according to the interface registration information, so as to connect the interface to the business system.
[0046] In some embodiments, the interface registration page includes: a basic setting component for receiving basic interface information and adding the basic interface information to the interface registration information, wherein the basic interface information includes one or more of interface identifier, interface type, interface service, service provider, interface request method, proxy path, interface registration status, logging status, and remarks information; a parameter setting component for receiving a request parameter structure and a response parameter structure, wherein the request parameter structure includes one or more of a request parameter name, a parameter default value, a request parameter type, and a request parameter description, and the response parameter structure includes a response parameter name, a response parameter identifier, and a response parameter type; a parameter operation component for receiving parameter modification instructions, wherein the parameter modification instructions are used to modify the request parameter structure and the response parameter structure.
[0047] In some embodiments, in response to an external interface accessing a business system, basic interface information such as the interface type, protocol, and data format will be automatically recorded. For example, for an interface based on HTTP (HyperText Transfer Protocol), the registration module will determine request methods such as GET and POST, formats such as JSON and XML (Extensible Markup Language) for returned data, and specific fields and data structures that may be included; through interface registration, the characteristics and capabilities of each interface can be fully understood, providing an accurate basis for subsequent data processing and conversion. This is like establishing a detailed archive for each interface, allowing the system to quickly find the corresponding processing methods and rules when processing data.
[0048] In some embodiments, the selected target interface must be an interface that has completed registration, which means that the target interface has completed the testing phase of the registration process and is in a state that can be called and used, ensuring that in subsequent business processes, when these interfaces are selected for related operations, they can provide services stably and will not fail to call or cause unexpected errors due to reasons such as the interface has not yet completed development, testing, or has not yet been formally deployed, thereby ensuring the stability, reliability of the entire system and the accuracy and efficiency of data processing.
[0049] In some embodiments, the interface registration information also includes interface management permissions and interface access logs, for example, determining which users or systems can access the interface, and the level of access permissions (read-only, read-write, etc.), thereby ensuring the security and legality of the data.
[0050] Combination Figure 4 As shown, the embodiment of the present disclosure provides an interface registration method, including:
[0051] Step S401, obtaining interface registration information corresponding to the external interface;
[0052] Among them, the interface registration information includes interface basic information, request parameter structure and response parameter structure;
[0053] Step S402, generating test request parameters according to the request parameter structure in the interface registration information;
[0054] Step S403, calling the external interface according to the test request parameters and the acquired interface basic information to obtain the test response parameters;
[0055] Step S404, determine whether the test response parameters meet the response parameter results, if yes, jump to step S405, if no, jump to step S406;
[0056] Step S405: determine the external interface as a registered interface.
[0057] Step S406: determine the interface test result as a test failure.
[0058] Optionally, the visualization page also includes an interface selection page, and the method also includes: displaying a registered interface list through the interface selection page, and receiving an interface selection instruction, wherein the registered interface list includes one or more registered interfaces; and determining a target interface from each registered interface according to the interface selection instruction.
[0059] In some embodiments, the interface selection page displays a list of registered interfaces, wherein the interface selection page that displays the list of registered interfaces is as follows: Figure 5 As shown; the user drags out the interface component through the interface selection page, and then selects the target interface to be arranged. After selecting the interface, the interface selection page is as shown Figure 6 shown.
[0060] In some embodiments, when a user selects from a list of registered interfaces, the system will respond quickly, call up the detailed information of the interface and display it to the user, wherein the detailed information may include the name, description, business module to which the interface belongs, current status (such as whether it is available, whether it is being called, etc.), and the time of the last call, etc.; when the interface information is selected, the encapsulation module at the bottom of the system will start immediately. This module is like a "packaging factory" for data, which organizes and packages various information of different interfaces in a pre-set unified format. In view of the different types of interfaces, the interface component here needs to convert the received interface information into a unified data format such as JSON format and transmit it to the downstream interface arrangement page to ensure data consistency and facilitate downstream components to process data; the data is packaged in JSON format. This unified format may include specific field naming specifications, data type definitions, and data structure hierarchies, etc., so that the downstream arrangement process only needs to process one data format, which greatly reduces the complexity and difficulty of processing.
[0061] Optionally, a preset rule orchestration component is displayed through a rule orchestration page, and a rule orchestration instruction input by a user for the rule orchestration component is received, including: displaying a response parameter structure through the rule orchestration page; receiving a parameter selection instruction, and determining a target parameter structure from the response parameter structure according to the parameter selection instruction, wherein the target parameter result corresponds to the response parameter value; displaying multiple rule orchestration components through the rule orchestration page, and monitoring drag events corresponding to the rule orchestration components; generating a type selection instruction according to the monitored drag event, and determining a target rule component from the rule orchestration components according to the type selection instruction; displaying the target rule component through the rule orchestration page, and receiving a rule orchestration instruction corresponding to the target rule component.
[0062] In some embodiments, the user drags out the target rule component through the rule arrangement page and arranges the data processing rules according to the data requirements. The user can define various rules according to the specific business needs and data processing requirements through an intuitive graphical interface or a specific configuration file. The user can set it to select only the data whose specific field values meet certain conditions, or perform a specific mathematical operation conversion on the value of a certain field; the response parameter structure has been converted to JSON format on the interface selection page, and the data processing rules arranged by the user are also converted to JSON format. JSON format has the outstanding characteristics of significant versatility, good readability and easy parsing. The processing methods for JSON format data are rich, diverse, mature and efficient. This is also the important reason why the component interface packages the data in JSON format Because the response parameter structure and data processing rules are both in JSON format, JSONPath is used to encapsulate the parameter JSON data and rule JSON data to obtain JSONPath rules, which can directly match, respond, filter and other data processing on the response data. Among them, the powerful tool JSONPath is fully utilized. Through the careful encapsulation of the underlying layer, the rules are cleverly converted into JSONPath syntax rules that meet specific conditions. Then, the packaged interface data is used as input, and accurate conversion operations are performed according to these converted rules. JSONPath not only provides a concise and intuitive way to locate and extract specific elements in JSON data, but can also be flexibly applied to various complex data conversion scenarios to efficiently process interface data.
[0063] Optionally, the data processing rule includes: if the rule arrangement component corresponding to the data processing rule is a parameter filtering component, data filtering is performed on the response parameter value according to the parameter filtering condition in the data processing rule.
[0064] In some embodiments, the user can configure the corresponding filtering rules according to the response structure configured by the proxy component and the clear prompts given by the system; when the user faces the response structure determined by the proxy component, the user can intuitively understand the format and content layout of the data, and through the friendly user interface prompts, the user can easily define the filtering rules, wherein the preset layout template corresponding to the filtering rules is as follows Figure 7 As shown, the filtering rules include filtering according to the value of a specific field, excluding data that does not meet the conditions, filtering according to the range of data, retaining only data within a specific interval, etc.; for example, the filtering rule is to filter out data whose order status (order_state) is incomplete (1) and the commodity price (trade_price) is 1000.
[0065] Optionally, the data processing rule includes: if the rule arrangement component corresponding to the data processing rule is a parameter conversion component, then performing data conversion on the response parameter value according to a target conversion value in the data processing rule.
[0066] In some embodiments, the parameter conversion type is a one-to-one simple conversion, that is, a specific value can be directly converted to another pre-set value, which is a direct and efficient conversion method. The preset layout template corresponding to the parameter conversion type is as follows: Figure 8 As shown; the data processing rules corresponding to the parameter conversion type include converting a specific product code from the old naming system to the new naming system, converting a specific unit from the imperial system to the metric system, etc. For example, modifying user_name (user name) will change the original user name of zhangsan to Zhangsan.
[0067] Optionally, the data processing rule includes: if the rule arrangement component corresponding to the data processing rule is a conditional conversion component, then determining the parameter to be converted from the response parameter value according to the parameter selection condition in the data processing rule, and performing data conversion on the parameter to be converted according to the target conversion value in the data processing rule.
[0068] In some embodiments, the conditional conversion type allows the conversion of values according to specific conditions. The user can set multiple conditions and specify different conversion results for each condition. The preset layout template corresponding to the conditional conversion type is as follows: Fig. 9 As shown; for example, different conversions are performed according to the value range of a field in the data. If the value of the field is less than a threshold, it is converted to a specific value. If the field is within a certain range, it is converted to another value. If the field is greater than a certain value, another different conversion is performed. Therefore, this conditional conversion method is suitable for complex scenarios that require different processing according to different situations. For example, the conversion of trade_price (commodity price) will round up prices that are greater than 1999 and less than or equal to 2001.
[0069] Optionally, after obtaining a response result by performing data processing on the response parameter value of the target interface using a rule script, the method further includes: converting the response result into JSON format, and generating response data based on the response parameter structure converted into JSON format, the data processing rules and the response result; executing a preset response strategy based on the response data, the preset response strategy including at least one of a first response strategy, a second response strategy and a third response strategy, wherein the first response strategy includes transmitting the response data to a lower-level interface, the second response strategy includes storing the response data in a file format, and the third response strategy includes storing the response data in a preset database.
[0070] In some embodiments, the processed data is also encapsulated in JSON format. By accessing the proxy address configured by the proxy component, the user can easily obtain the filtered and converted data, which facilitates the subsequent steps to uniformly analyze the processed data, response parameter structure, and data processing rules; when the proxy component completes the processing of interface information and the encapsulation and transmission of data, its configured proxy address is the key channel for the processed data.
[0071] Combination Fig.10 As shown, the embodiment of the present disclosure provides an interface data processing method based on a visualization page, including:
[0072] Step S1001, obtaining interface registration information corresponding to the external interface through the interface registration page;
[0073] Step S1002, convert the interface registration information into JSON format, and jump to steps S1003 and S1007;
[0074] Step S1003, displaying a list of registered interfaces through an interface selection page, and determining a target interface from the registered interfaces according to the received interface selection instruction;
[0075] Step S1004, displaying the response parameter structure corresponding to the target interface through the rule arrangement page, and displaying the preset arrangement template;
[0076] Step S1005, arranging the preset arrangement template according to the received rule arrangement instruction to obtain data processing rules;
[0077] Step S1006, converting the data processing rules into JSON format;
[0078] Step S1007, using JSONPath to generate a rule script according to the response parameter structure and data processing rules converted into JSON format;
[0079] Step S1008: Use the rule script to perform data processing on the response parameter value of the target interface to obtain a response result.
[0080] The interface data processing method based on the visualization page provided by the embodiment of the present disclosure is adopted, and the response parameter structure and data processing rules of the target interface are respectively obtained through the visualization page. According to the response parameter structure and data processing rules that have been converted into JSON format, JSONPath is used to generate a rule script, and the rule script is used to process the response parameter value of the target interface to obtain a response result. In this way, compared with development through data processing tools, obtaining the response parameter structure and data processing rules through the visualization page reduces the operation threshold. At the same time, JSON and JSONPath are used to unify data in different interface formats, and the data processing rules are unified when facing different interface types, thereby reducing the learning difficulty of interface data processing from two aspects, reducing the learning cost, and thus improving the efficiency of interface data processing.
[0081] Optionally, the visualization page also includes an interface arrangement page, and the method also includes: displaying a list of registered interfaces through the interface arrangement page, and receiving an interface arrangement instruction; arranging at least a portion of the registered interfaces according to the interface arrangement instruction to obtain an interface sequence, and using the first-order registered interface in the interface sequence as the current interface; in response to the current interface, obtaining a current request parameter corresponding to the current interface, and determining a subordinate interface corresponding to the current interface from the interface sequence; inputting a current request parameter corresponding to the current interface into the current interface, and obtaining a current response parameter and a response result corresponding to the current interface; generating a current request parameter corresponding to the subordinate interface according to the current response parameter and the response result corresponding to the current interface, and determining the subordinate interface as the new current interface.
[0082] In some embodiments, the registered interfaces include interface A, interface B and interface C, wherein interface B depends on the response result of interface A, and interface C depends on the response result of interface B; the user registers these three interfaces into the system, and inputs an interface arrangement instruction to specify the interface dependency, wherein the interface sequence includes interface A-interface B-interface C; firstly, interface A is processed, including obtaining the request parameters of interface A, calling interface A, obtaining the response parameters and results, and storing the response parameters and results of interface A; then, interface B is processed, including generating the request parameters of interface B according to the response result of interface A, calling interface B, obtaining the response parameters and results, and storing the response parameters and results of interface B; finally, interface C is processed, including generating the request parameters of interface C according to the response result of interface B, calling interface C, obtaining the response parameters and results, and storing the response parameters and results of interface C; and the response results of interfaces A, B and C are displayed to the user.
[0083] Optionally, the visualization page also includes an interface association page, and the method also includes: displaying the request parameter structure and response parameter structure corresponding to the registered interface through the interface arrangement page, and receiving an interface association instruction; establishing an association relationship between the response parameter structure of the first interface and the request parameter structure of the second interface according to the interface association instruction, wherein the first interface and the second interface are different registered interfaces; arranging at least a part of the registered interfaces according to the association relationship to obtain an interface sequence; and displaying the response result corresponding to the interface sequence through the interface arrangement page.
[0084] In some embodiments, the registered interfaces include interface A, interface B and interface C. The user registers these three interfaces to the system and views their request parameter structures and response parameter structures; the user inputs interface association instructions, wherein the interface association instructions include that the result field in the response parameter structure of interface A should be used as the input field in the request parameter structure of interface B, and the output field in the response parameter structure of interface B should be used as the data field in the request parameter structure of interface C; the system automatically arranges the interface sequence according to these association instructions: interface A->interface B->interface C; the system sequentially calls interface A to obtain the response result, and uses the value of its result field as the value of the request parameter input of interface B, calls interface B to obtain the response result, and uses the value of its output field as the value of the request parameter data of interface C, and calls interface C to obtain the final response result; the response results of each interface are displayed on the page, and the user can view and analyze these results.
[0085] Combination Fig.11 As shown, the embodiment of the present disclosure provides an interface data processing system based on a visualization page, including an acquisition module 1101 , a receiving module 1102 , an arrangement module 1103 and a processing module 1104 .
[0086] The acquisition module 1101 is used to acquire a visualization page, which includes an interface registration page and a rule arrangement page.
[0087] The receiving module 1102 is used to select a target interface on the interface registration page, receive a response parameter structure corresponding to the target interface, and convert the response parameter structure into a JSON format.
[0088] The orchestration module 1103 is used to display preset rule orchestration components through a rule orchestration page, and receive rule orchestration instructions input by a user for the rule orchestration components to determine data processing rules and convert the data processing rules into JSON format.
[0089] The processing module 1104 is used to generate a rule script using JSONPath according to the response parameter structure converted into JSON format and the data processing rules, and use the rule script to perform data processing on the response parameter value of the target interface to obtain a response result.
[0090] The interface data processing system based on the visualization page provided by the embodiment of the present disclosure is adopted, and the response parameter structure and data processing rules of the target interface are respectively obtained through the visualization page. According to the response parameter structure and data processing rules that have been converted into JSON format, JSONPath is used to generate a rule script, and the response parameter value of the target interface is processed by the rule script to obtain a response result. In this way, compared with development through data processing tools, obtaining the response parameter structure and data processing rules through the visualization page reduces the operation threshold. At the same time, JSON and JSONPath are used to unify data in different interface formats, and the data processing rules are unified when facing different interface types, thereby reducing the learning difficulty of interface data processing from two aspects, reducing the learning cost, and thus improving the efficiency of interface data processing.
[0091] An embodiment of the present disclosure further provides an electronic device, including: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device executes the above method.
[0092] Fig.12 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Fig.12 The computer system 1200 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0093] like Fig.12 As shown, the computer system 1200 includes a central processing unit (CPU) 1201, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1202 or the program loaded from the storage part 1208 to the random access memory (RAM) 1203, such as executing the method in the above embodiment. In the random access memory 1203, various programs and data required for system operation are also stored. The central processing unit 1201, the read-only memory 1202 and the random access memory 1203 are connected to each other through a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.
[0094] The following components are connected to the input / output interface 1205: an input section 1206 including a keyboard, a mouse, etc.; an output section 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the input / output interface 1205 as needed. A removable medium 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1210 as needed so that a computer program read therefrom is installed into the storage section 1208 as needed.
[0095] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1209, and / or installed from a removable medium 1211. When the computer program is executed by a central processing unit (CPU) 1201, various functions defined in the system of the present application are executed.
[0096] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent possible changes only. Unless explicitly required, separate components and functions are optional, and the order of operation can be changed. Parts and sub-samples of some embodiments may be included in or replace parts and sub-samples of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and the claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of listings containing one or more associated ones. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of a stated sub-sample, whole, step, operation, element, and / or component, but do not exclude the presence or addition of one or more other sub-samples, wholes, steps, operations, elements, components and / or groups of these. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.
[0097] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. Technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present disclosure. Technicians can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0098] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units can be 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 some sub-samples can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other 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. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.
[0099] The flowchart and block diagram in the accompanying drawings show the possible architecture, functions and operations of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and a part of the module, program segment or code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
Claims
1. A method for processing interface data based on a visualization page, characterized in that: include: Obtaining a visualization page, wherein the visualization page includes an interface registration page and a rule arrangement page; Selecting a target interface on the interface registration page, receiving a response parameter structure corresponding to the target interface, and converting the response parameter structure into a JSON format; Displaying a preset rule arrangement component through the rule arrangement page, and receiving a rule arrangement instruction input by a user for the rule arrangement component to determine a data processing rule, and converting the data processing rule into a JSON format; A rule script is generated using JSONPath according to the response parameter structure and data processing rules converted into JSON format, and the rule script is used to perform data processing on the response parameter value of the target interface to obtain a response result.
2. The method according to claim 1, characterized in that Receive the response parameter structure corresponding to the target interface in the following way: The user inputs the interface registration information of the external interface through the interface registration page, or obtains the interface registration information by parsing the interface file of the external interface, wherein the interface registration information includes a request parameter structure and a response parameter structure; Generate test request parameters according to the request parameter structure, and call the external interface according to the test request parameters to obtain test response parameters of the external interface, so as to determine the interface test result of the external interface according to the comparison result between the test response parameters and the response parameter structure; If the interface test result is that the interface test passes, the external interface is determined as a registered interface, wherein the target interface is any registered interface.
3. The method according to claim 2, characterized in that The visualization page also includes an interface selection page, and the method further includes: Displaying a registered interface list through the interface selection page and receiving an interface selection instruction, wherein the registered interface list includes one or more registered interfaces; A target interface is determined from the registered interfaces according to the interface selection instruction.
4. The method according to claim 3, characterized in that The visualization page also includes an interface arrangement page, and the method further includes: Displaying the registered interface list through the interface arrangement page and receiving an interface arrangement instruction; Arrange at least a portion of the registered interfaces according to the interface arrangement instruction to obtain an interface sequence, and use the first-ranked registered interface in the interface sequence as the current interface; In response to the current interface, obtaining a current request parameter corresponding to the current interface, and determining a subordinate interface corresponding to the current interface from the interface sequence; Input the current request parameters corresponding to the current interface into the current interface, and obtain the current response parameters and response results corresponding to the current interface; The current request parameters corresponding to the lower-level interface are generated according to the current response parameters and the response result corresponding to the current interface, and the lower-level interface is determined as a new current interface.
5. The method according to claim 4, characterized in that The visualization page also includes an interface association page, and the method further includes: Displaying the request parameter structure and response parameter structure corresponding to the registered interface through the interface arrangement page, and receiving an interface association instruction; Establishing an association relationship between a response parameter structure of a first interface and a request parameter structure of a second interface according to the interface association instruction, wherein the first interface and the second interface are different registered interfaces; Arrange at least a portion of the registered interfaces according to the association relationship to obtain an interface sequence; The response results corresponding to the interface sequence are displayed through the interface arrangement page.
6. The method according to any one of claims 1 to 5, characterized in that: After performing data processing on the response parameter value of the target interface using the rule script to obtain a response result, the method further includes: Convert the response result into JSON format, and generate response data according to the response parameter structure converted into JSON format, data processing rules and response result; A preset response strategy is executed according to the response data, and the preset response strategy includes at least one of a first response strategy, a second response strategy and a third response strategy, wherein the first response strategy includes transmitting the response data to a lower-level interface, the second response strategy includes storing the response data in the form of a file, and the third response strategy includes storing the response data in a preset database.
7. The method according to any one of claims 1 to 5, characterized in that: Displaying a preset rule arrangement component through the rule arrangement page and receiving a rule arrangement instruction input by a user for the rule arrangement component includes: Displaying the response parameter structure through the rule arrangement page; receiving a parameter selection instruction, and determining a target parameter structure from the response parameter structure according to the parameter selection instruction, wherein the target parameter result corresponds to the response parameter value; Displaying a variety of rule arrangement components through the rule arrangement page, and monitoring drag events corresponding to the rule arrangement components; Generate a type selection instruction according to the detected drag event, and determine a target rule component from the rule arrangement component according to the type selection instruction; The target rule component is displayed through the rule arrangement page, and a rule arrangement instruction corresponding to the target rule component is received.
8. The method according to claim 7, characterized in that The data processing rules include at least one of the following: If the rule arrangement component corresponding to the data processing rule is a parameter filtering component, data screening is performed on the response parameter value according to the parameter filtering condition in the data processing rule; If the rule arrangement component corresponding to the data processing rule is a parameter conversion component, performing data conversion on the response parameter value according to the target conversion value in the data processing rule; If the rule arrangement component corresponding to the data processing rule is a conditional conversion component, the parameter to be converted is determined from the response parameter value according to the parameter selection condition in the data processing rule, and data conversion is performed on the parameter to be converted according to the target conversion value in the data processing rule.
9. An interface data processing system based on a visualization page, characterized in that: include: An acquisition module, used to acquire a visualization page, wherein the visualization page includes an interface registration page and a rule arrangement page; A receiving module, used for selecting a target interface on the interface registration page, receiving a response parameter structure corresponding to the target interface, and converting the response parameter structure into a JSON format; An orchestration module, used to display a preset rule orchestration component through the rule orchestration page, and receive a rule orchestration instruction input by a user for the rule orchestration component to determine a data processing rule, and convert the data processing rule into a JSON format; The processing module is used to generate a rule script using JSONPath according to the response parameter structure converted into JSON format and the data processing rule, and use the rule script to perform data processing on the response parameter value of the target interface to obtain a response result.
10. An electronic device, characterized in that: include: Processor and memory; The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device executes the method according to any one of claims 1 to 8.