Interface configuration processing method and device, computer device, and readable storage medium

By obtaining modification instructions through the interface management interface and generating temporary variable assignment statements, the problem of low interface development efficiency is solved, the reuse and flexibility of interfaces are realized, and the time spent on repetitive development is reduced.

CN119046365BActive Publication Date: 2026-07-21PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
PING AN TECH (SHENZHEN) CO LTD
Filing Date
2024-09-09
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

In existing technologies, interface development is inefficient, and it is difficult to avoid rewriting statements when adding new functions to existing functional interfaces, which leads to increased repetitive development time.

Method used

The target modification instructions are obtained through the interface management interface, and temporary variable assignment statements are generated. The return values ​​of the existing functional interfaces of the data service platform are assigned to the variables of the newly edited functional interface. The temporary variable assignment statements are used to realize the reuse of existing functional interfaces, reducing the amount and complexity of code writing.

Benefits of technology

It improves the reusability of interfaces, reduces repetitive development time, enhances the functionality and flexibility of interfaces, and avoids the problem of rewriting statements on existing interfaces.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119046365B_ABST
    Figure CN119046365B_ABST
Patent Text Reader

Abstract

The application provides an interface configuration processing method and device, computer equipment and a computer readable storage medium. The interface configuration processing method comprises: in response to a touch operation of an interface management control in an operation page of a data service platform, displaying an interface management interface; obtaining a target modification instruction of a new editing function interface of the interface management interface; generating a temporary variable assignment statement of the new editing function interface according to variable editing information carried by the target modification instruction, the temporary variable assignment statement being used to assign a return value of an existing function interface to a variable of the new editing function interface; obtaining an edited interface code of the new editing function interface according to the temporary variable assignment statement and the edited interface code of the new editing function interface; and updating an interface configuration code set of the data service platform based on the edited interface code. The application can improve the reuse degree of the overall interface, improve the reuse degree of the overall interface, and reduce the time of repeated development.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of database processing technology, specifically to an interface configuration processing method, apparatus, computer device, and computer-readable storage medium. Background Technology

[0002] With the continuous development of computer and internet technologies, the volume of data has shown an exponential growth trend. Currently, massive amounts of data are mainly managed through databases. The backend development work, such as database creation, management, and operation, is of great significance for data query businesses (such as insurance data query systems). In related technologies, different functional interfaces are developed to meet the needs of data query businesses. However, usually, once an interface is written, its functionality is fixed. If functionality needs to be added to an existing interface, the statements need to be rewritten, resulting in low interface development efficiency. Summary of the Invention

[0003] This application provides an interface configuration processing method, apparatus, computer device, and computer-readable storage medium, which can improve the reusability of the overall interface and reduce the time spent on repetitive development.

[0004] Firstly, this application provides an interface configuration processing method, the method comprising:

[0005] In response to touch operations on the interface management controls in the data service platform's operation page, the interface management interface is displayed;

[0006] In response to a touch operation of the modification trigger control in the interface management interface, obtain the target modification instruction for the new editing function interface of the interface management interface;

[0007] Based on the variable editing information carried by the target modification instruction, a temporary variable assignment statement is generated for the new editing function interface. The temporary variable assignment statement is used to assign the return value of the existing function interface of the data service platform to the variable of the new editing function interface.

[0008] Based on the temporary variable assignment statement and the edited interface code of the new editing function interface, the interface code of the new editing function interface after this edit is obtained;

[0009] Based on the revised interface code, the interface configuration code set of the data service platform is updated.

[0010] Secondly, this application provides an interface configuration processing apparatus, the interface configuration processing apparatus comprising:

[0011] The display unit is used to respond to touch operations of the interface management controls on the operation page of the data service platform and display the interface management interface;

[0012] The acquisition unit is used to respond to the touch operation of the modification trigger control in the interface management interface and acquire the target modification instruction of the new editing function interface of the interface management interface;

[0013] The generation unit is used to generate a temporary variable assignment statement for the new editing function interface based on the variable editing information carried by the target modification instruction. The temporary variable assignment statement is used to assign the return value of the existing function interface of the data service platform to the variable of the new editing function interface.

[0014] The processing unit is used to obtain the edited interface code of the new editing function interface based on the temporary variable assignment statement and the edited interface code of the new editing function interface.

[0015] The processing unit is also used to update the interface configuration code set of the data service platform based on the interface code after this editing.

[0016] In some embodiments, the generation unit is specifically used for:

[0017] The variable editing information carried by the target modification instruction is identified and processed to obtain the variable to be modified in the new editing function interface;

[0018] Obtain the parameter value category of the variable to be modified;

[0019] If the parameter value category is a function return value, then the assignment interface code of the variable to be modified is determined according to the variable editing information and the interface code record table of the data service platform;

[0020] Based on the assignment interface encoding, a temporary variable assignment statement is generated for the new editing function interface.

[0021] In some embodiments, the temporary variable assignment statement includes a parameter import code statement and an assignment code statement, and the generation unit is specifically used for:

[0022] Based on the preset field configuration strategy, determine the alias object for the parameter value of the variable to be modified;

[0023] Based on the alias object, generate the parameter import code statement for the variable to be modified;

[0024] Based on the alias object and the assignment interface code, an assignment code statement is generated for the variable to be modified, wherein the assignment code statement is used to take the return value of the function interface that matches the assignment interface code as the parameter value of the variable to be modified.

[0025] In some embodiments, the interface configuration processing apparatus further includes a recording unit, the recording unit being specifically used for:

[0026] Based on the interface code of the new editing function interface, the interface code record table of the data service platform is queried.

[0027] If the interface code of the new editing function interface exists in the interface code record, then compare the current edited interface code with the previous edited interface code of the new editing function interface;

[0028] If the interface code after the current edit is inconsistent with the interface code after the previous edit, the current interface editing information and the interface code of the new edit function interface are associated and saved in the interface history table of the new edit function interface. The current interface editing information includes at least one of the current interface code, the editing object of the current interface code, and the editing time of the current interface code.

[0029] In some embodiments, the recording unit is specifically used for:

[0030] If the interface code for the new editing function interface does not exist in the interface code record, then the interface code for the new editing function interface will be added to the interface code record.

[0031] In some embodiments, the interface configuration processing apparatus further includes a role management unit, which is specifically used for:

[0032] In response to a touch operation on the role management control, the role management interface is displayed;

[0033] Based on the role management interface, the database permission information of the target role is obtained, wherein the database permission information includes the scope of operation permission and the scope of data permission, and the scope of data permission includes at least one of the scope of data region and the scope of data time.

[0034] When a data operation request from the target role is received, query conditions for the data operation request are generated based on the data permission scope;

[0035] Based on the query conditions and the scope of operation permissions, the existing functional interfaces of the data service platform are invoked to complete the data operation request.

[0036] In some embodiments, the role management unit is specifically used for:

[0037] The target role and its data permission scope are associated and recorded in a preset permission record table;

[0038] When the number of roles with the same data permission range in the permission record table is greater than a preset threshold, the access interface code for the target data permission range is generated based on the target data permission range in which the number of roles is greater than the preset threshold.

[0039] Based on the access interface code of the target data permission scope, update the interface configuration code set.

[0040] Thirdly, this application also provides a computer device, the computer device including a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the interface configuration processing method when executing the computer program.

[0041] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, the computer program being loaded by a processor to execute the interface configuration processing method described above.

[0042] This application obtains the target modification instruction for the new editing function interface of the interface management interface, utilizes the variable editing information carried by the target modification instruction to generate temporary variable assignment statements for the new editing function interface, and uses the temporary variable assignment statements to assign the return values ​​of the existing function interfaces of the data service platform to the variables of the new editing function interface. This allows the introduction of existing function interfaces during the interface writing process, and the use of the return values ​​of existing function interfaces as some necessary parameters of the new editing function interface, thereby improving the overall reusability of the interface, reducing the amount of code writing and potential complexity, and avoiding the need to rewrite statements when adding functions to existing interfaces. This enables existing function interfaces to be used by new editing function interfaces with more complex business requirements, reducing the time spent on repetitive development. Attached Figure Description

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

[0044] Figure 1 This is a flowchart illustrating an interface configuration processing method provided in an embodiment of this application;

[0045] Figure 2 This is a schematic flowchart of an embodiment of step 103 in this application;

[0046] Figure 3 This is an example diagram of the interface code of the new editing function interface after this editing in the embodiments of this application;

[0047] Figure 4 This is a schematic flowchart of an embodiment of recording interface editing information in this application.

[0048] Figure 5 This is a schematic diagram of an embodiment of the interface configuration processing device provided in this application.

[0049] Figure 6 This is a schematic block diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

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

[0051] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.

[0052] In the description of the embodiments of this application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, features defined with "first" and "second" may explicitly or implicitly include one or more of the stated features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0053] To enable any person skilled in the art to implement and use this application, the following description is provided. In this description, details are set forth for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be implemented without using these specific details. In other instances, well-known processes will not be described in detail to avoid obscuring the description of the embodiments of this application with unnecessary detail. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in the embodiments of this application.

[0054] This application provides an interface configuration processing method, apparatus, computer device, and computer-readable storage medium.

[0055] The execution subject of the interface configuration processing method in this application embodiment can be the interface configuration processing device provided in this application embodiment, or the computer device provided in this application embodiment. The interface configuration processing device can be implemented in hardware or software.

[0056] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0057] Please see Figure 1 , Figure 1 This is a flowchart illustrating an interface configuration processing method provided in an embodiment of this application. The interface configuration processing method includes steps 101 to 105, wherein:

[0058] 101. Respond to touch operations of the interface management controls on the operation page of the data service platform, and display the interface management interface.

[0059] Among them, the data query system is a system that can perform business data queries, such as an insurance data query system.

[0060] The data service platform is the backend development and management platform for the data query system. It can include functions such as interface documentation generation, data source configuration management, customer account management, interface management, customer and interface authorization management, interface call monitoring, and interface log viewing.

[0061] The operation page is where developers of the data query system can perform development tasks such as interface creation and modification on the data service platform.

[0062] For example, by displaying the operation page of the data service platform, functional controls such as interface document generation, data source configuration management, customer account management, interface management, customer and interface authorization management, interface call monitoring, and interface log viewing are displayed on the operation page, so that backend developers can create and modify functions.

[0063] The data service platform can create multiple functional interfaces, and the set of functional interfaces is the collection of existing functional interfaces of the data service platform.

[0064] The interface configuration code set includes the code for multiple functional interfaces. Specifically, it is a collection of code for each existing functional interface of the data service platform. For example, assuming the data service platform's functional interface set includes interface 1, interface 2, interface 3, and interface 4, then the interface configuration code set includes the code for interface 1, interface 2, interface 3, and interface 4.

[0065] For example, developers of the data query system can edit function interfaces on the operation page of the data service platform. After the developers save the function interfaces edited on the data service platform, the function interfaces edited by the developers will be updated to the function interface set of the data service platform, and the interface code of the function interfaces edited by the developers will be updated to the interface configuration code set.

[0066] 102. In response to the touch operation of the modification trigger control in the interface management interface, obtain the target modification instruction of the new editing function interface of the interface management interface.

[0067] Among them, the new editing function interface is the function interface currently being edited. It can be a newly added function interface or an existing function interface of the data service platform (i.e., a function interface in the function interface set).

[0068] Among them, the modification instruction is used to modify the functional interface.

[0069] Among them, the target modification command is used to modify the interface of the new editing function.

[0070] The variable editing information carried by the target modification instruction is the editing information of the variable to be modified in the new editing function interface. The variable editing information can be in the form of text, code, etc.

[0071] For example, firstly, the electronic device displays the operation page of the data service platform, which may include interface management controls. When a developer clicks the interface management control on the operation page, the electronic device jumps from displaying the operation page to displaying the interface management interface. At this point, the developer can edit interfaces (including adding new interfaces and modifying existing interfaces) on the interface management interface. When the developer enters modification information for the newly edited functional interface in the interface management interface and triggers the modification trigger control, the electronic device will receive the target modification instruction for the newly edited functional interface. There are several ways for the developer to trigger the target modification instruction for the newly edited functional interface in the interface management interface, including, for example:

[0072] ① In some embodiments, the interface management interface may include a modification information input area (wherein, the modification information input area is used to input modification description text of the functional interface) and a modification trigger control (where clicking the "modification trigger control" will trigger a modification instruction for the functional interface). In this case, the developer can input a modification description text for a newly edited functional interface in the modification information input area of ​​the interface management interface, and then click the modification trigger control. At this time, the electronic device, in response to the click operation of the modification trigger control, will trigger a modification instruction carrying the modification description text of the newly edited functional interface, which serves as the target modification instruction for the newly edited functional interface. The modification description text is used to indicate the variable editing information of the newly edited functional interface.

[0073] ② In some embodiments, the interface management interface may include a code input area (where the code input area is used to input the code for the transformation content of the function interface), and a transformation trigger control (where clicking on the "transformation trigger control" will trigger the transformation instruction for the function interface). At this time, the developer can input the code for the transformation content of the newly edited function interface in the code input area of the interface management interface, and then click on the transformation trigger control; at this time, the electronic device will trigger a transformation instruction carrying the code for the transformation content of the newly edited function interface in response to the click operation of the transformation trigger control, as the target transformation instruction for the newly edited function interface. Among them, the transformation content code is used to indicate the variable editing information of the newly edited function interface.

[0074] Furthermore, the interface management interface enables the support of SQL statements for data types of update, delete, and insert except for select queries, and does not check the beginning of the existing select string, allowing strings starting with select, insert, update, and delete to be used as SQL statements for execution; and SQL statements starting with with can be added, allowing multiple statements to be executed. When specifically implemented, a custom interceptor can be added to rewrite and reconstruct the executed SQL statements. For example, the traditional interface SQL statement writing method can only be as follows (starting with select):

[0075] select id,name,age,addr

[0076] from user

[0077] where name=’张三’

[0078] With the support of the interface management interface, strings starting with select, insert, update, and delete can all be used as SQL statements for execution. At this time, the interface SQL statement can be as follows (supporting starting with select, insert, update, and delete):

[0079] select id,name,age,addr

[0080] from user

[0081] where name=’张三’

[0082] update user set age=18

[0083] where name=3张三’

[0084] delete from user where name='Zhang San'

[0085] insert into user(id,name,age,addr)

[0086] values(1,'Li Si',18,'XX Street);

[0087] with myuser(id,name)as (

[0089] select 1,'Zhang San'

[0090] union

[0091] select 2,'Li Si' )

[0093] SELECT id, name FROM myuser;

[0094] This avoids the limitation of the interface being restricted to SQL statements. Adding functions like INSERT, UPDATE, and DELETE to the interface expands its functionality beyond simple SELECT queries, enhancing its overall capabilities. This enriches the interface's functionality beyond simple table queries, allowing for CRUD operations, and enables combined use of related functions via temporary variable assignment statements, thus improving its reusability.

[0095] 103. Based on the variable editing information carried by the target modification instruction, generate temporary variable assignment statements for the new editing function interface.

[0096] The temporary variable assignment statement is used to assign the return value of the existing functional interface of the data service platform to the variable of the newly edited functional interface.

[0097] For example, such as Figure 2 As shown, step 103 may specifically include the following steps 1031A to 1034A:

[0098] 1031A. The variable editing information carried by the target modification instruction is identified and processed to obtain the variable to be modified in the new editing function interface.

[0099] Among them, the variables to be modified are those that need to be edited (such as added or updated) in the new editing function interface, which are identified based on the variable editing information.

[0100] For example, a trained variable recognition model can be used to identify variables based on the variable editing information carried in the target modification instruction, thereby obtaining the variables to be modified in the new editing function interface. For instance, taking the modification description text "Use the return value of the existing function interface get_user_id of the data service platform as the parameter value of variable id" entered by the developer in the modification information input area as an example, the trained variable recognition model can be used to identify the text "Use the return value of the existing function interface get_user_id of the data service platform as the parameter value of variable id" to obtain the variable "variable id" to be modified in the new editing function interface. As another example, taking the modification description text "Add variable name, use 'Zhang San' as the parameter value of variable name" entered by the developer in the modification information input area as an example, the trained variable recognition model can be used to identify the text "Add variable name, use 'Zhang San' as the parameter value of variable name" to obtain the variable "variable name" to be modified in the new editing function interface.

[0101] Understandably, the variable editing information can identify one or more variables to be modified, and for each variable whose parameter value category is a function return value, a temporary variable assignment statement can be generated.

[0102] 1032A. Obtain the parameter value category of the variable to be modified.

[0103] For example, firstly, the variable editing information is segmented to obtain the descriptive text of the variable to be modified. Then, using a trained parameter value classification model, the descriptive text of the variable to be modified is classified to obtain the parameter value category of the variable to be modified. For example, taking the modification description text entered by the developer in the modification information input area as "Use the return value of the existing functional interface get_user_id of the data service platform as the parameter value of variable id, add a new variable name, and use 'Zhang San' as the parameter value of variable name..." as an example, firstly, the trained variable recognition model is used to identify the variables to be modified, "variable id" and "variable name". The variable editing information is then segmented to obtain the descriptive text of the variable to be modified, resulting in the descriptive text of "variable id" as "Use the return value of the existing functional interface get_user_id of the data service platform as the parameter value of variable id" and the descriptive text of "variable name" as "Add a new variable name, and use 'Zhang San' as the parameter value of variable name". Then, on the one hand, for the "variable id", the trained parameter value classification model is used to classify it according to the descriptive text of "variable id" which states "the return value of the existing functional interface get_user_id of the data service platform is used as the parameter value of variable id", thus obtaining the parameter value category of "variable id" as a function return value. On the other hand, for the "variable name", the trained parameter value classification model is used to classify it according to the descriptive text of "variable name" which states "a new variable name is added, and 'Zhang San' is used as the parameter value of variable name", thus obtaining the parameter value category of "variable name" as a constant value.

[0104] 1033A. If the parameter value category is a function return value, then the assignment interface code of the variable to be modified is determined according to the variable editing information and the interface code record table of the data service platform.

[0105] In some embodiments, the interface code record table of the data service platform records the interface codes of existing functional interfaces and the functional information of those functional interfaces. In this case, firstly, the assignment interface name of the variable to be modified is identified based on the variable editing information; then, the interface code record table is queried to see if there is an interface code with the same assignment interface name. If there is an interface code with the same assignment interface name in the interface code record table, the assignment interface name is used as the assignment interface code of the variable to be modified; if there is no interface code with the same assignment interface name in the interface code record table, a new interface is created based on the variable editing information as the assignment interface of the variable to be modified, and the name of the newly created interface is used as the assignment interface code of the variable to be modified. For example, taking the variable editing information as the modification description text entered by the developer in the modification information input area, "Use the return value of the existing functional interface get_user_id of the data service platform as the parameter value of the variable id", the assignment interface name of the variable to be modified "variable id" is identified as "get_user_id" based on the variable editing information "Use the return value of the existing functional interface get_user_id of the data service platform as the parameter value of the variable id". Then, we can check whether the interface code "get_user_id" exists in the interface code record table of the data service platform (assuming that the interface code record table of the data service platform is shown in Table 1 below). If it exists, the assignment interface name "get_user_id" of the variable to be modified "variable id" identified according to the variable editing information can be used as the assignment interface code of the variable to be modified.

[0106] Table 1

[0107] get_user_id Function A get_user_addr Function B … …

[0108] In some embodiments, the interface coding record table of the data service platform associates the interface codes of existing functional interfaces with the functional information of those functional interfaces. In this case, firstly, the target functional information of the assignment interface for the variable to be modified is identified based on the variable editing information. Then, using the target functional information of the assignment interface for the variable to be modified, the interface code associated with the target functional information is retrieved from the interface coding record table and used as the assignment interface code for the variable to be modified. For example, taking the modification description text "Use the return value of the functional interface implementing function A as the parameter value of variable id" entered by the developer in the modification information input area as an example, the target functional information "function A" of the assignment interface for the variable "name" to be modified is identified based on the variable editing information "Use the return value of the functional interface implementing function A as the parameter value of variable id". The interface code "get_user_id" associated with the target functional information "function A" is retrieved from the interface coding record table and used as the assignment interface code for the variable to be modified.

[0109] 1034A. Based on the assignment interface code, generate the temporary variable assignment statement for the new editing function interface.

[0110] For example, the temporary variable assignment statement includes a parameter import code statement and an assignment code statement. Based on a preset field configuration strategy, an alias object for the parameter value of the variable to be modified is determined. Based on the alias object, a parameter import code statement for the variable to be modified is generated. Based on the alias object and the assignment interface code, an assignment code statement for the variable to be modified is generated. The assignment code statement is used to use the return value of the functional interface matching the assignment interface code as the parameter value of the variable to be modified. Thus, on the one hand, by declaring a temporary variable, the return value of the import interface (i.e., the functional interface matching the assignment interface code) can be assigned to the temporary variable, and the value of this temporary variable can be used as a parameter. This allows for the import of existing functional interfaces during interface writing, and the use of the return values ​​of existing functional interfaces as necessary parameters for the new editing functional interface, improving the overall reusability of the interface and reducing the amount of code written and potential complexity. This avoids the problem of rewriting statements when adding functionality to existing interfaces, enabling existing functional interfaces to be used by new editing functional interfaces with more complex business logic, reducing repetitive development time. On the other hand, parameter conversion allows for more flexible manipulation of parameters and return values ​​at the interface's entry and exit points without requiring changes to the potentially complex internal code of the interface, thus improving security and flexibility.

[0111] The preset field configuration strategy is a matching strategy between the alias object of the parameter value of the variable to be modified and the encoding of the assignment interface. For example, the preset field configuration strategy can be shown in Table 2 below:

[0112] Table 2

[0113] get_user_id aUser get_user_addr bUser … …

[0114] For example, such as Figure 3 As shown, Figure 3This is an example of the interface code after this edit of the new editing function interface. First, according to the preset field configuration strategy shown in Table 2 and the assignment interface code "get_user_id" for the variable to be modified "variable id", it can be determined that the alias object of the parameter value of the variable to be modified "variable id" is "aUser". Then, using the alias object "aUser" of the parameter value of "variable id", the parameter import code statement "importxxx.get_user_id as aUser" for the variable to be modified "variable id" is generated; and according to the alias object "aUser" of the parameter value of "variable id" and the assignment interface code "get_user_id", the assignment code statement "where id=aUser[0].id" for the variable to be modified "variable id" is generated. Therefore, the return value of the function interface matching the assignment interface code "get_user_id" can be assigned to the alias object "aUser" of the parameter value of "variable id" by importing the parameter code "import xxx.get_user_id as aUser". Then, the return value of the function interface matching the assignment interface code "get_user_id" can be used as the parameter value of the variable "variable id" to be modified by the assignment code statement. This allows the return value of the existing function interface of the data service platform to be assigned to the variable of the newly edited function interface.

[0115] Furthermore, in the parameter import code statement, the length of each line of characters is limited at the return value format type of the assigned interface code. This limits the length of each line of characters at the return value format type of the referenced interface (i.e., the functional interface matched by the assigned interface code). The return value of the functional interface matched by the assigned interface code (such as "get_user_id") will automatically wrap to a newline if it exceeds a certain length, thus achieving better display effect and convenient operation.

[0116] 104. Based on the temporary variable assignment statement and the edited interface code of the new editing function interface, obtain the interface code of the new editing function interface after this edit.

[0117] Among them, the edited interface code refers to the interface code that has been edited for the new edit function interface before the target modification instruction is triggered.

[0118] For example, a temporary variable assignment statement is added to the edited interface code of the newly edited functional interface, thereby forming the edited interface code of the newly edited functional interface. In some embodiments, the newly edited functional interface can be an existing functional interface of the data service platform (i.e., a functional interface in the functional interface set), and the edited interface code can be code in the interface configuration code set. In some embodiments, the newly edited functional interface can be a newly created functional interface, and the edited interface code can be code added to the newly edited functional interface in the interface management interface.

[0119] 105. Based on the interface code after this editing, update the interface configuration code set of the data service platform.

[0120] In some embodiments, the new editing function interface is an existing function interface of the data service platform. In this case, in step 105, the interface code of the new editing function interface after the current editing is replaced with the interface code of the new editing function interface after the last editing in the interface configuration code set of the data service platform, so as to update the interface configuration code set of the data service platform.

[0121] In some embodiments, the new edit function interface is a newly created function interface. In this case, in step 105, the edited interface code of the new edit function interface is added to the interface configuration code set of the data service platform to update the interface configuration code set of the data service platform.

[0122] Furthermore, to improve code security and mitigate risks such as accidental deletion of interfaces or inability to revert to previous versions, such as... Figure 4 As shown, the interface configuration processing method may further include the following steps 401 to 404:

[0123] 401. Based on the interface code of the new editing function interface, perform a query process on the interface code record table of the data service platform.

[0124] The interface code record table is used to associate and record each interface edit information of the functional interface with the interface code of the functional interface.

[0125] 402. If the interface code of the new editing function interface exists in the interface code record, then compare the interface code after this editing with the interface code after the last editing of the new editing function interface.

[0126] 403. If the interface code after this editing is inconsistent with the interface code after the last editing, the interface editing information of the new editing function interface is saved to the interface history table of the new editing function interface.

[0127] The interface editing information includes at least one of the following: the interface code of the new editing function interface, the interface code after this editing, the editing object of the interface code after this editing, and the editing time of the interface code after this editing.

[0128] 404. If the interface code for the new editing function interface does not exist in the interface code record, then the interface code for the new editing function interface shall be added to the interface code record.

[0129] For example, assuming the interface code record table is shown in Table 3 below and the interface history record table is shown in Table 4 below, taking "the interface code of the new editing function interface is "get_user_id"" as an example, in step 401, based on the interface code of the new editing function interface (i.e., "get_user_id"), the interface code record table is checked to see if the interface code "get_user_id" exists. Since the interface code "get_user_id" exists in the interface code record table, the process proceeds to step 402. First, the interface history record table of the new editing function interface is checked to see if the corresponding editing time is closest to the current time. The edited interface code is used as the previous edited interface code of the new edited function interface (i.e., code 1.1). Then, the previous edited interface code of the new edited function interface (i.e., code 1.1) is compared with the current edited interface code of the new edited function interface (i.e., code 1.2). If they are inconsistent, proceed to step 403, and associate the current interface editing information of the new edited function interface (e.g., the edited object "Li Mou" and the editing time "December 1, 2020") with the interface code of the new edited function interface (i.e., "get_user_id") and save it to the interface history table of the new edited function interface. If they are consistent, the current interface editing information of the new edited function interface is not further stored. Thus, in this embodiment, the interface history table records the historical version interface code, improves the security of code writing, and avoids the risk of accidental deletion of interfaces and the inability to revert to previous versions.

[0130] For example, assuming the interface code record table is as shown in Table 3 below, taking "the interface code of the new editing function interface is "get_age_id"" as an example, in step 401, based on the interface code of the new editing function interface (i.e., "get_age_id"), the interface code record table is queried to see if the interface code "get_age_id" exists. Since the interface code record table does not find the interface code "get_age_id", the process proceeds to step 404, where the interface code of the new editing function interface is added to the interface code record table. Furthermore, a new interface history table for the new editing function interface can be created, and the current interface editing information of the new editing function interface (such as the editing object "Zhao Mou" and the editing time "December 1, 2020") is associated with the interface code of the new editing function interface (i.e., "get_age_id") and saved in the interface history table of the new editing function interface.

[0131] Table 3

[0132] get_user_id get_user_addr …

[0133] Table 4

[0134] get_user_id Li January 1, 2020 Code 1.0 get_user_id Zhang February 1, 2020 Code 1.1 … … … …

[0135] Furthermore, an interface code record table can be displayed in the interface management interface. A group of operation buttons for the corresponding interface can be added near each interface code in the interface code record table, thereby realizing an entry point for viewing the history of newly added interfaces. This is used to display the interface history record table, and clicking on a specific entry can view the interface content.

[0136] Furthermore, to enhance the diversity of data operations and improve user experience, the data service platform's operation page includes a role management control. The interface configuration processing method may also include the following steps 501-504:

[0137] 501. In response to a touch operation on the role management control, display the role management interface.

[0138] 502. Obtain the database permission information of the target role based on the role management interface.

[0139] The database permission information includes operation permission scope and data permission scope, wherein the data permission scope includes at least one of data geographical scope and data time scope.

[0140] 503. When a data operation request for the target role is received, query conditions for the data operation request are generated based on the data permission scope.

[0141] 504. Based on the query conditions and the scope of operation permissions, call the existing functional interfaces of the data service platform to complete the data operation request.

[0142] For example, firstly, the electronic device displays the operation page of the data service platform, which may include role management controls. In step 501, when a developer clicks the role management control on the operation page, the electronic device jumps from displaying the operation page to displaying the role management interface. At this time, the developer can manage roles on the role management interface (including specifying the scope of the role's operation permissions, such as query, update, delete, add, etc., and specifying the scope of the role's data permissions, such as data geographical range, data time range, etc.). In step 502, when the developer enters database permission information for a target role (such as role 1) in the role management interface and triggers the save control, the electronic device will receive and store the database permission information of the target role (such as role 1). When the target role triggers a data operation request in the data query system, the data query system sends the data operation request of the target role to the electronic device. At this time, the electronic device will receive the data operation request of the target role, proceed to step 503, query the data permission scope of the target role from the database permission information of the target role stored in step 502, and generate the query conditions for the data operation request using the data permission scope of the target role, proceeding to step 504. In step 504, based on the query conditions of the data operation request and the operation permission scope of the target role, the existing functional interfaces of the data service platform are called to complete the data operation request.

[0143] This allows for the binding of database permission information for roles, improving the operability of interface data permissions and avoiding the problem of either having or not having interface data permissions. It enables users to choose how many or which permissions they have, increasing the diversity of interface data permissions, enriching the diversity of interface data usage, and meeting the needs of diverse data usage scenarios.

[0144] Furthermore, to improve query efficiency, increase interface reusability, and reduce code development redundancy for identical query conditions, the target role and its data permission range can be associated and recorded in a preset permission record table. When the number of roles with the same data permission range in the permission record table exceeds a preset threshold, an access interface code for the target data permission range is generated based on the target data permission range where the number of roles exceeds the preset threshold. The interface configuration code set is then updated based on the access interface code for the target data permission range. Here, the target data permission range refers to the data permission range in the permission record table where the number of corresponding roles exceeds the preset threshold. For example, the permission record table records the data permission ranges for roles 1, 2, 3, 4…, 100. Roles 1 to 10 all have the same data permission range (e.g., all within range a). Therefore, range a is used as the target data permission range. An access interface code for the target data permission range (i.e., range a) is generated using this target data permission range. Then, the access interface code for the target data permission range (i.e., range a) is added to the interface configuration code set of the data service platform to update the interface configuration code set. For example, the access interface code for the target data permission scope (such as names "Zhang San" and "Li Si") can be as follows:

[0145] with myuser(id,name)as (

[0147] select 1,'Zhang San'

[0148] union

[0149] select 2,'Li Si' )

[0151] SELECT id, name FROM myuser;

[0152] Further, refer to Figure 3 When writing interfaces in the interface management interface, if you are unsure about the boundaries of each code segment, you can use separators such as "---" or "###" to execute the code step by step to avoid confusion.

[0153] As can be seen from the above, by obtaining the target modification instruction for the new editing function interface in the interface management interface, and using the variable editing information carried by the target modification instruction, temporary variable assignment statements for the new editing function interface are generated. These temporary variable assignment statements are used to assign the return values ​​of the existing function interfaces of the data service platform to the variables of the new editing function interface. This allows the existing function interfaces to be introduced during the interface writing process, and the return values ​​of the existing function interfaces to be used as some necessary parameters of the new editing function interface. This improves the overall reusability of the interface, reduces the amount of code to be written and the potential complexity, and avoids the problem of rewriting statements when adding functions to existing interfaces. This enables existing function interfaces to be used by new editing function interfaces with more complex business requirements, reducing the time spent on repetitive development.

[0154] Furthermore, to better implement the interface configuration processing method in the embodiments of this application, an interface configuration processing apparatus is also provided in the embodiments of this application, such as... Figure 5 The diagram shown is a structural schematic of one embodiment of the interface configuration processing device provided in this application. The interface configuration processing device 500 includes:

[0155] Display unit 501 is used to respond to touch operations of interface management controls in the operation page of the data service platform and display the interface management interface;

[0156] The acquisition unit 502 is used to acquire the target modification instruction of the new editing function interface of the interface management interface in response to the touch operation of the modification trigger control in the interface management interface;

[0157] The generation unit 503 is used to generate a temporary variable assignment statement for the new editing function interface according to the variable editing information carried by the target modification instruction. The temporary variable assignment statement is used to assign the return value of the existing function interface of the data service platform to the variable of the new editing function interface.

[0158] Processing unit 504 is used to obtain the current edited interface code of the new editing function interface based on the temporary variable assignment statement and the edited interface code of the new editing function interface;

[0159] The processing unit 504 is also used to update the interface configuration code set of the data service platform based on the interface code after this editing.

[0160] In some embodiments, the generation unit 503 is specifically used for:

[0161] The variable editing information carried by the target modification instruction is identified and processed to obtain the variable to be modified in the new editing function interface;

[0162] Obtain the parameter value category of the variable to be modified;

[0163] If the parameter value category is a function return value, then the assignment interface code of the variable to be modified is determined according to the variable editing information and the interface code record table of the data service platform;

[0164] Based on the assignment interface encoding, a temporary variable assignment statement is generated for the new editing function interface.

[0165] In some embodiments, the temporary variable assignment statement includes a parameter import code statement and an assignment code statement, and the generation unit 503 is specifically used for:

[0166] Based on the preset field configuration strategy, determine the alias object for the parameter value of the variable to be modified;

[0167] Based on the alias object, generate the parameter import code statement for the variable to be modified;

[0168] Based on the alias object and the assignment interface code, an assignment code statement is generated for the variable to be modified, wherein the assignment code statement is used to take the return value of the function interface that matches the assignment interface code as the parameter value of the variable to be modified.

[0169] In some embodiments, the interface configuration processing apparatus further includes a recording unit (not shown in the figures), the recording unit being specifically used for:

[0170] Based on the interface code of the new editing function interface, the interface code record table of the data service platform is queried.

[0171] If the interface code of the new editing function interface exists in the interface code record, then compare the current edited interface code with the previous edited interface code of the new editing function interface;

[0172] If the interface code after the current edit is inconsistent with the interface code after the previous edit, the current interface editing information and the interface code of the new edit function interface are associated and saved in the interface history table of the new edit function interface. The current interface editing information includes at least one of the current interface code, the editing object of the current interface code, and the editing time of the current interface code.

[0173] In some embodiments, the recording unit is specifically used for:

[0174] If the interface code for the new editing function interface does not exist in the interface code record, then the interface code for the new editing function interface will be added to the interface code record.

[0175] In some embodiments, the interface configuration processing apparatus further includes a role management unit (not shown in the figures), the role management unit being specifically used for:

[0176] In response to a touch operation on the role management control, the role management interface is displayed;

[0177] Based on the role management interface, the database permission information of the target role is obtained, wherein the database permission information includes the scope of operation permission and the scope of data permission, and the scope of data permission includes at least one of the scope of data region and the scope of data time.

[0178] When a data operation request from the target role is received, query conditions for the data operation request are generated based on the data permission scope;

[0179] Based on the query conditions and the scope of operation permissions, the existing functional interfaces of the data service platform are invoked to complete the data operation request.

[0180] In some embodiments, the role management unit is specifically used for:

[0181] The target role and its data permission scope are associated and recorded in a preset permission record table;

[0182] When the number of roles with the same data permission range in the permission record table is greater than a preset threshold, the access interface code for the target data permission range is generated based on the target data permission range in which the number of roles is greater than the preset threshold.

[0183] Based on the access interface code of the target data permission scope, update the interface configuration code set.

[0184] In practice, each of the above units can be implemented as an independent entity or can be combined arbitrarily to be implemented as the same or several entities. For the specific implementation of each of the above units, please refer to the previous interface configuration processing method embodiment, which will not be repeated here.

[0185] Please see Figure 6 , Figure 6 This is a schematic block diagram illustrating the structure of a computer device provided in an embodiment of this application. The computer device can be a server.

[0186] like Figure 6 As shown, the computer device includes a processor, memory, and network interface connected via a system bus, wherein the memory may include non-volatile storage media and internal memory.

[0187] Non-volatile storage media can store operating systems and computer programs. These computer programs include program instructions that, when executed, cause the processor to perform any interface configuration processing method.

[0188] The processor provides computing and control capabilities, supporting the operation of the entire computer device.

[0189] Internal memory provides an environment for the execution of computer programs stored in non-volatile storage media. When these computer programs are executed by the processor, the processor can perform any interface configuration processing method.

[0190] This network interface is used for network communication, such as sending assigned tasks. Those skilled in the art will understand that... Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0191] It should be understood that the processor can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, a general-purpose processor can be a microprocessor or any conventional processor.

[0192] In one embodiment, the processor is configured to run a computer program stored in memory to perform the following steps:

[0193] In response to a touch operation of the interface management control on the operation page of the data service platform, the interface management interface is displayed; in response to a touch operation of the modification trigger control on the interface management interface, the target modification instruction for the new edit function interface of the interface management interface is obtained; based on the variable editing information carried by the target modification instruction, a temporary variable assignment statement for the new edit function interface is generated, wherein the temporary variable assignment statement is used to assign the return value of the existing function interface of the data service platform to the variable of the new edit function interface; based on the temporary variable assignment statement and the edited interface code of the new edit function interface, the interface code of the new edit function interface after this editing is obtained; based on the interface code after this editing, the interface configuration code set of the data service platform is updated.

[0194] In one embodiment, the processor is configured to run a computer program stored in memory to perform the following steps:

[0195] The variable editing information carried by the target modification instruction is identified and processed to obtain the variable to be modified in the new editing function interface; the parameter value category of the variable to be modified is obtained; if the parameter value category is a function return value, the assignment interface code of the variable to be modified is determined according to the variable editing information and the interface code record table of the data service platform; and a temporary variable assignment statement of the new editing function interface is generated according to the assignment interface code.

[0196] In one embodiment, the processor is configured to run a computer program stored in memory to perform the following steps:

[0197] According to the preset field configuration strategy, an alias object for the parameter value of the variable to be modified is determined; based on the alias object, a parameter import code statement for the variable to be modified is generated; according to the alias object and the assignment interface code, an assignment code statement for the variable to be modified is generated, wherein the assignment code statement is used to take the return value of the function interface that matches the assignment interface code as the parameter value of the variable to be modified.

[0198] In one embodiment, the processor is configured to run a computer program stored in memory to perform the following steps:

[0199] Based on the interface code of the new editing function interface, the interface code record table of the data service platform is queried. If the interface code of the new editing function interface exists in the interface code record, the interface code after the current editing is compared with the interface code after the previous editing. If the interface code after the current editing is inconsistent with the interface code after the previous editing, the current interface editing information and the interface code of the new editing function interface are associated and saved in the interface history table of the new editing function interface. The current interface editing information includes at least one of the interface code after the current editing, the editing object of the interface code after the current editing, and the editing time of the interface code after the current editing.

[0200] In one embodiment, the processor is configured to run a computer program stored in a memory to perform the following steps: if the interface code for the new editing function interface does not exist in the interface code record, then the interface code for the new editing function interface is added to the interface code record.

[0201] In one embodiment, the processor is configured to run a computer program stored in memory to perform the following steps:

[0202] In response to a touch operation on the role management control, a role management interface is displayed; based on the role management interface, database permission information of the target role is obtained, wherein the database permission information includes an operation permission range and a data permission range, and the data permission range includes at least one of a data geographic range and a data time range; when a data operation request from the target role is received, query conditions for the data operation request are generated according to the data permission range; based on the query conditions and the operation permission range, the existing functional interfaces of the data service platform are invoked to complete the data operation request.

[0203] In one embodiment, the processor is configured to run a computer program stored in memory to perform the following steps:

[0204] The target role and its data permission scope are associated and recorded in a preset permission record table; when the number of roles with the same data permission scope in the permission record table is greater than a preset number threshold, an access interface code for the target data permission scope is generated based on the target data permission scope where the number of roles is greater than the preset number threshold; and the interface configuration code set is updated based on the access interface code for the target data permission scope.

[0205] Those skilled in the art will understand that all or part of the steps in the above interface configuration processing method can be completed by instructions, or by controlling related hardware through instructions. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0206] Therefore, embodiments of this application provide a computer-readable storage medium storing a plurality of computer programs that can be loaded by a processor to execute any of the interface configuration processing methods provided in embodiments of this application.

[0207] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0208] In the above embodiments of the interface configuration processing device and computer-readable storage medium, the descriptions of each embodiment have different focuses. For parts not described in detail in a particular embodiment, please refer to the relevant descriptions in other embodiments. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process and beneficial effects of the interface configuration processing device, computer-readable storage medium, and their corresponding units described above can be referred to the description of the interface configuration processing method in the above embodiments, and will not be repeated here.

[0209] The foregoing has provided a detailed description of an interface configuration processing method, apparatus, computer device, and computer-readable storage medium provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. An interface configuration processing method, characterized in that, The method includes: In response to touch operations on the interface management controls in the data service platform's operation page, the interface management interface is displayed; In response to a touch operation of the modification trigger control in the interface management interface, obtain the target modification instruction for the new editing function interface of the interface management interface; Based on the variable editing information carried by the target modification instruction, a temporary variable assignment statement is generated for the new editing function interface. The temporary variable assignment statement is used to assign the return value of the existing function interface of the data service platform to the variable of the new editing function interface. Based on the temporary variable assignment statement and the edited interface code of the new editing function interface, the interface code of the new editing function interface after this edit is obtained; Based on the revised interface code, the interface configuration code set of the data service platform is updated.

2. The interface configuration processing method according to claim 1, characterized in that, The step of generating temporary variable assignment statements for the new editing function interface based on the variable editing information carried by the target modification instruction includes: The variable editing information carried by the target modification instruction is identified and processed to obtain the variable to be modified in the new editing function interface; Obtain the parameter value category of the variable to be modified; If the parameter value category is a function return value, then the assignment interface code of the variable to be modified is determined according to the variable editing information and the interface code record table of the data service platform; Based on the assignment interface encoding, a temporary variable assignment statement is generated for the new editing function interface.

3. The interface configuration processing method according to claim 2, characterized in that, The temporary variable assignment statement includes parameter import code statements and assignment code statements. The step of generating the temporary variable assignment statement for the new editing function interface based on the assignment interface encoding includes: Based on the preset field configuration strategy, determine the alias object for the parameter value of the variable to be modified; Based on the alias object, generate the parameter import code statement for the variable to be modified; Based on the alias object and the assignment interface code, an assignment code statement is generated for the variable to be modified, wherein the assignment code statement is used to take the return value of the function interface that matches the assignment interface code as the parameter value of the variable to be modified.

4. The interface configuration processing method according to claim 1, characterized in that, The method further includes: Based on the interface code of the new editing function interface, the interface code record table of the data service platform is queried. If the interface code of the new editing function interface exists in the interface code record, then compare the current edited interface code with the previous edited interface code of the new editing function interface; If the interface code after the current edit is inconsistent with the interface code after the previous edit, the current interface editing information and the interface code of the new edit function interface are associated and saved in the interface history table of the new edit function interface. The current interface editing information includes at least one of the current interface code, the editing object of the current interface code, and the editing time of the current interface code.

5. The interface configuration processing method according to claim 4, characterized in that, The method further includes: If the interface code for the new editing function interface does not exist in the interface code record, then the interface code for the new editing function interface will be added to the interface code record.

6. The interface configuration processing method according to claim 1, characterized in that, The operation page includes role management controls, and the method further includes: In response to a touch operation on the role management control, the role management interface is displayed; Based on the role management interface, the database permission information of the target role is obtained, wherein the database permission information includes the scope of operation permission and the scope of data permission, and the scope of data permission includes at least one of the scope of data region and the scope of data time. When a data operation request from the target role is received, query conditions for the data operation request are generated based on the data permission scope; Based on the query conditions and the scope of operation permissions, the existing functional interfaces of the data service platform are invoked to complete the data operation request.

7. The interface configuration processing method according to claim 6, characterized in that, The method further includes: The target role and its data permission scope are associated and recorded in a preset permission record table; When the number of roles with the same data permission range in the permission record table is greater than a preset threshold, the access interface code for the target data permission range is generated based on the target data permission range in which the number of roles is greater than the preset threshold. Based on the access interface code of the target data permission scope, update the interface configuration code set.

8. An interface configuration processing device, characterized in that, The interface configuration processing device includes: The display unit is used to respond to touch operations of the interface management controls on the operation page of the data service platform and display the interface management interface; The acquisition unit is used to respond to the touch operation of the modification trigger control in the interface management interface and acquire the target modification instruction of the new editing function interface of the interface management interface; The generation unit is used to generate a temporary variable assignment statement for the new editing function interface based on the variable editing information carried by the target modification instruction. The temporary variable assignment statement is used to assign the return value of the existing function interface of the data service platform to the variable of the new editing function interface. The processing unit is used to obtain the edited interface code of the new editing function interface based on the temporary variable assignment statement and the edited interface code of the new editing function interface. The processing unit is also used to update the interface configuration code set of the data service platform based on the interface code after this editing.

9. A computer device, characterized in that, The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is configured to execute the computer program and, when executing the computer program, implement the interface configuration processing method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, It stores a computer program, which is loaded by a processor to execute the interface configuration processing method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Interface code generation method, apparatus, terminal device and medium

    WO2018201895A1

  • Data query method and apparatus, computer device, and storage medium

    WO2022001625A1