Method for visually generating interface
Through the method of visually generating interfaces, the problems of high cost of interface technology and complex implementation are solved, the creation and release of codeless interfaces are realized, business model changes are supported, the cost and time of interface generation and modification are reduced, and the project response speed is improved. Code stability.
Patent Information
- Application Number
- CN202410947809.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2024-12-03
AI Technical Summary
The existing interface technology is costly and the interface implementation is complex. In the face of frequent demand changes, project delays and code stability are reduced.
Using the method of visually generating interfaces, by obtaining the data interaction requirements of the services to be accessed, setting up the interface framework, determining the business model and interface status fields, generating matching interfaces, supporting actively providing data, passively providing and passive receiving data, and configuring interface fields The relationship with the basic fields of the model realizes the visual generation of the interface.
Interface creation and release can be completed without writing code, supports various business models, fine-tuning and adjustment of interfaces at low cost, and provides interface preview functions, which significantly reduces the threshold for interface generation and modification, and improves project response speed and code stability.
Smart Images

Figure CN119065651A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of interface generation, and in particular to a method for visually generating an interface. Background Art
[0002] At present, information systems generally face the need to interconnect data interfaces with multiple other systems. Most existing solutions are based on the requirements of the interface by investing a lot of time and development resources to deal with new interface requirements. The interface document writer, the interface developer, and the interface tester belong to three roles, which greatly increases the communication cost. Moreover, the interface code is a complete blind box for testers. When problems are encountered, they cannot be handled without development assistance. Faced with frequent changes in requirements, the interface modification cycle is long, which can easily lead to project delays and reduced code stability. It can be seen from the above description that the existing interface technology is costly and the interface is quite complicated to implement. In view of this, the applicant has developed a method for visually generating interfaces to solve the above problems. Summary of the invention
[0003] The present invention provides a method for visually generating an interface, which solves the problem in the prior art that the existing interface technology is high in cost and the interface is quite complicated to implement.
[0004] The technical solution of the present invention is achieved in this way:
[0005] A method for visually generating an interface comprises the following steps: in response to an access request of a service to be accessed, obtaining the data interaction requirements of the service to be accessed; according to the data interaction requirements, setting the interface type corresponding to the interface framework, determining the business model corresponding to the interface to be generated and generating an interface status field in a business data table corresponding to the interface to be generated, so as to confirm the data transmission status, and then visually generating an interface matching the service to be accessed.
[0006] As a preferred technical solution, the attributes input when the service to be accessed requests interactive data are obtained from the data interaction requirements; according to the attributes input when requesting interactive data, the interface type corresponding to the interface framework of the input component is set, and the attributes include: actively providing data, passively providing data, and passively receiving data.
[0007] As a preferred technical solution, when the interface type of the interface to be generated is to actively provide data, setting the sending timing includes scheduled sending and sending through business document status, and setting a sending template to cope with different complex situations.
[0008] As a preferred technical solution, the business model corresponding to the interface to be generated is determined through a data table in a business database.
[0009] As a preferred technical solution, generating the interface status field in the business data table corresponding to the interface to be generated includes setting one or more of the fixed data filtering parameters, sorting conditions, transmission quantity limit, offset, additional query parameters and log activation and retention days information of the interface data to be generated.
[0010] As a preferred technical solution, after determining the interface status field in the business data table, it is also necessary to determine the correspondence between the interface field in the interface to be generated and the model basic field, wherein the model basic field is the field in the business database data table, and the interface field in the interface to be generated is a fixed value, a variable set by the interface configuration, and any one of a Python expression.
[0011] As a preferred technical solution, for each of the interface fields, the following operations are performed:
[0012] 1) Determine the data value corresponding to the corresponding model basic field or other field types mentioned above;
[0013] 2) Determine the field name in the interface.
[0014] As a preferred technical solution, a mapping value is set for the value of the interface field to cope with the situation where the value set and encoding across systems are not completely the same.
[0015] As a preferred technical solution, when the interface field is empty, whether to retain it in the interface message is set.
[0016] Compared with the prior art, this solution has the following beneficial effects:
[0017] 1) It allows implementers to create and publish interfaces without writing any code;
[0018] 2.) It can be used for all business models permitted by any authority;
[0019] 3) It can support the completion of data retrieval logic on any other business model associated with the business model of the publishing interface;
[0020] 4) Interface fine-tuning and moderate adjustments can be completed at a very low cost;
[0021] 5) The interface calls and response messages of this solution can be previewed in advance. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0023] Figure 1 It is a flow chart of a method for visually generating an interface provided by an embodiment of the present invention;
[0024] Figure 2 It is a screenshot of the configuration main page provided by the example of the present invention;
[0025] Figure 3 This is a screenshot of the interface field configuration page provided by the example of the present invention;
[0026] Figure 4 This is a screenshot of the options provided by the interface message preview function provided by the example of the present invention;
[0027] Figure 5 This is a message preview details example provided by the example of the present invention, including a request message and a response message. DETAILED DESCRIPTION
[0028] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0029] Reference Figure 1 In order to solve the current situation that the cost of direct data interface interaction in information systems is high, the steps for interface modification are complicated, and the interface content and implementation methods are not transparent to on-site implementation personnel, a flexible and low-cost configuration method is provided in the example of the present invention, which is demonstrated below through the accompanying drawings and specific steps.
[0030] Step 1: Set the interface to be generated, refer to Figure 2The upper part of the interface includes: filling in the interface name, that is, accurately and concisely naming the interface, which is usually determined according to the interface document; filling in the interface code, that is, a meaningful and globally unique marking string; determining the interface address, which is required when actively calling other system interfaces, and does not need to be processed in other cases. There are three options: the first is a link, that is, a legal URL link; the second is a field, which means that you can select a field on the corresponding model of the business data system as the source of the interface address; the third is multi-company, that is, maintaining different links for different company businesses in the group information system; determining the log information, that is, indicating whether to retain the log and setting the number of days to retain it.
[0031] Step 2: Determine the interface configuration type and interface model, refer to Figure 2 The content on the left side of the interface includes: determining the configuration type, that is, confirming whether the interface is passively providing data, passively receiving data, or actively providing data, which is used to determine the calling and being called relationship between the interface target system; determining the interface model, that is, determining the business basis for the interface to transmit data, that is, what data to transmit.
[0032] Select the data model required by the actual interface;
[0033] Step 3: System and interface status fields, that is, determine which system to interact with. System-related data needs to be maintained in advance. The interface status fields are referenced Figure 2 The Create Interface Status field button is generated in the upper left corner of the interface.
[0034] Step 4: Determine other optional configurations, mainly for reference Figure 2 The content on the right side of the lower half of the interface includes: determining the filtering conditions, that is, in many business scenarios, when the interface data is interacted, not all data is interacted, and the filtering conditions can be maintained to filter out unnecessary data; determining the sorting rules, that is, it is applicable to business scenarios that require data sorting; determining the organization, which is used for multi-organization data filtering in group information systems; displaying the number of data, that is, limiting the amount of data transmitted by the interface at one time to prevent excessive data from affecting business or downtime; determining whether it is a test mode, which is used in the interface testing phase. After checking the test mode, there will be no real impact on the system data; additional query parameters, that is, you can configure the query parameters used in the interface request message when passively providing data, allowing the target system to customize the query data conditions.
[0035] Step 5: Determine the transmission interface, refer to Figure 3, including: determining the value type, which can be selected from field value, fixed value, variable, and Python value. The field value is to obtain a value from the fields of the business data model. The fixed value is a static value. The variable can obtain a value from the variables maintained in advance. Python is to write the logic in Python code to dynamically generate a value and then pass it in; determining the field value, which is required when the value type is the field value, and select one from the fields of the defined business database table according to business requirements. Other value types do not need to be filled in; determining the interface field name, that is, the name of this field in the interface message; determining whether it can be not transmitted when there is no value, which is an optional item and is used in some interfaces where the field needs to be not transmitted if there is no value, and can flexibly handle various situations; determining the manual mapping value. In each information system, different coding systems may be used. For example, gender can be represented by 0 and 1, or can be represented by the Chinese characters male and female. To handle the situation where the value stored in the business database table is not what the other system wants, this option is added to flexibly handle the cross-system transmission of fields. The mapping value is maintained through the data structure dictionary in Python. For example, in the above example, {'0': 'female', '1':'male'} can be maintained to solve the problem of different coding systems.
[0036] Step 6: Preview the interface message, referring to Figure 4 and Figure 5 , Figure 2 the generate preview message button in the upper left corner of the interface, and options will pop up. Select the data source for generating the message preview. You can manually select a piece of data existing in the system, or let the system randomly select a piece of existing data and click OK to generate the preview message. As attached Figure 5 , and the implementer can copy the message and replace information such as the account password to quickly test the interface.
[0037] Step 7: Put it into use
[0038] Special step: If the interface requirements change, after the implementer modifies the interface configuration according to the requirements, just click the save button in the upper right corner, and the interface changes will take effect. There is no need for development intervention and no need to restart the system, and the process from requirement change to modification and release of the interface can be completed.
[0039] This solution provides a solution through visual configuration to register and generate interfaces with less time and resources, and provides corresponding previews and guidance, which greatly reduces the threshold for generating new interfaces. In many cases, it no longer relies on technical development to complete the task of adding interfaces, allowing on-site implementation personnel and even project customers to customize new interfaces and modify existing interfaces, achieving the goal of significantly reducing costs and increasing efficiency. When faced with frequent changes in interface requirements, the interface generated by configuration itself requires almost no code-side modifications. While ensuring the stability of the interface code, it can quickly respond to changing requirements, which can effectively shorten project time. In addition, this solution provides functions such as interface preview and generation of selected data generation messages, which enable implementation personnel to painlessly obtain interface messages and save a lot of time.
[0040] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for visually generating an interface, characterized in that: The following steps are involved: In response to an access request of a service to be accessed, obtaining a data interaction requirement of the service to be accessed; According to the data interaction requirements, the interface type corresponding to the interface framework is set, the business model corresponding to the interface to be generated is determined, and the interface status field in the business data table corresponding to the interface to be generated is generated to confirm the data transmission status, and then the interface matching the service to be accessed is generated visually.
2. A method for visually generating an interface according to claim 1, characterized in that: Acquire, from the data interaction requirement, the attributes input when the to-be-accessed service requests the interactive data; According to the attributes input when requesting interactive data, the interface type corresponding to the interface framework of the input component is set, and the attributes include: actively providing data, passively providing data, and passively receiving data.
3. A method for visually generating an interface according to claim 2, characterized in that: When the interface type of the interface to be generated is to actively provide data, setting the sending time includes scheduled sending and sending through business document status, and setting a sending template to cope with different complex situations.
4. A method for visually generating an interface according to claim 1, characterized in that: The business model corresponding to the interface to be generated is determined through a data table in a business database.
5. The method for visually generating an interface according to claim 1, characterized in that: Generating the interface status field in the business data table corresponding to the interface to be generated includes setting one or more of the fixed data screening parameters, sorting conditions, transmission quantity limit, offset, additional query parameters and log activation and retention days information of the interface data to be generated.
6. A method for visually generating an interface according to claim 1, characterized in that: After determining the interface status field in the business data table, it is also necessary to determine the correspondence between the interface field in the interface to be generated and the model basic field, wherein the model basic field is the field in the business database data table, and the interface field in the interface to be generated is any one of a fixed value, a variable set by the interface configuration, and a Python expression.
7. A method for visually generating an interface according to claim 6, characterized in that: For each of the interface fields, perform the following operations: 1) Determine the data value corresponding to the corresponding model basic field or other field types mentioned above; 2) Determine the field name in the interface.
8. A method for visually generating an interface according to claim 7, characterized in that: Set mapping values for interface field values to handle situations where value sets and encodings are not exactly the same across systems.
9. A method for visually generating an interface according to claim 7, characterized in that: When the interface field is empty, set whether to keep it in the interface message.
