Data processing method and device, electronic equipment and storage medium
Through the adaptation processing of incoming and outgoing parameters interfaces, the problem that business code cannot be reused in different application scenarios in low-code development is solved, and flexible code reuse and development efficiency are achieved.
Patent Information
- Application Number
- CN202311575931.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-23
- Publication Date
- 2025-05-23
AI Technical Summary
In low-code development technology, when business application scenarios change, the fully developed business code cannot be reused in different business application scenarios, affecting development efficiency.
The input parameters are adapted through the in-registration interface, match the in-registration data with the business code, perform business logic operations, and process the business result data through the out-registration interface to adapt it to the out-registration interface of different application scenarios.
The business code with the same processing logic is reused in different business application scenarios, without modifying the business code according to different application scenarios, improving development efficiency.
Smart Images

Figure CN120029616A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data processing method, device, electronic device and storage medium. Background Art
[0002] Low-code development technology is a method of rapid application development that creates web and mobile applications by using a visual programming interface and drag-and-drop components. With low-code development technology, non-developers can quickly create applications. By providing visual tools and predefined components, the application development process is simplified. Developers can create applications by dragging and dropping, configuring settings, and selecting functions without writing complex code.
[0003] In related technologies, the main solution for achieving low-code development is to use dynamic scripts or static languages for full code development. However, when the business application scenario changes, the fully developed business code cannot be reused in different business application scenarios, affecting development efficiency. Summary of the invention
[0004] The embodiments of the present application provide a data processing method, device, electronic device and storage medium, which can enable business codes with the same processing logic to be reused in different business application scenarios, thereby improving development efficiency.
[0005] The technical solution of the embodiment of the present application is implemented as follows:
[0006] On the one hand, an embodiment of the present application provides a data processing method, including:
[0007] Get the input parameters entered through the client's input interface;
[0008] Query the input parameter interface associated with the input parameter;
[0009] Adapting the input parameters based on the input parameter interface to obtain input parameter data matching the business code;
[0010] Perform business logic operations on the input parameter data based on the business code to obtain business result data;
[0011] Based on the input parameter interface, the business result data is processed to obtain output parameter data adapted to the output parameter interface, and the output parameter data is displayed through the output parameter interface.
[0012] On the one hand, an embodiment of the present application provides a data processing device, including:
[0013] The acquisition module is used to obtain the input parameters entered through the client's input interface;
[0014] A query module, used to query an input parameter interface associated with the input parameter;
[0015] A processing module, used to adapt the input parameters based on the input parameter interface to obtain input parameter data matching the business code;
[0016] The processing module is further used to perform business logic operations on the input parameter data based on the business code to obtain business result data;
[0017] The processing module is also used to perform output parameter processing on the business result data based on the input parameter interface, obtain output parameter data adapted to the output parameter interface, and display the output parameter data through the output parameter interface.
[0018] In one aspect, an embodiment of the present application provides an electronic device, the electronic device comprising:
[0019] A memory for storing computer executable instructions;
[0020] The processor is used to implement the data processing method provided in the embodiment of the present application when executing the computer executable instructions stored in the memory.
[0021] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions for implementing the data processing method provided in the embodiment of the present application when executed by a processor.
[0022] On the one hand, an embodiment of the present application provides a computer program product, including computer executable instructions, which, when executed by a processor, implement the data processing method provided in the embodiment of the present application.
[0023] The embodiments of the present application have the following beneficial effects:
[0024] The input parameters submitted to the input parameter interface are adapted through the input parameter interface, so that the input parameters used for business logic operations are matched with the business code, and then the business logic operations are performed on the processed input parameters based on the business code to obtain business result data; further, the business result data obtained by processing the business code is processed through the input parameter interface, so that the business result data is converted into output parameter data that can be presented through the output parameter interface. In this way, different requirements for input parameters and output parameter data in different business application scenarios are realized, and parameter processing is implemented by the input parameter interface to ensure that the processed input parameters can be processed by the business code with the same processing logic, and the processed business output results can be presented through the output parameter interface with different requirements, so that the business code with the same processing logic can be reused in different business application scenarios, without the need to repeatedly modify the business code according to the requirements of the input parameters and output parameters of different business scenarios, thereby improving development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is a structural diagram of the data processing system architecture provided in an embodiment of the present application;
[0026] Figure 2 It is a schematic diagram of the structure of the server provided in the embodiment of the present application;
[0027] Figure 3A It is a flowchart of a data processing method provided in an embodiment of the present application;
[0028] Figure 3B It is a flowchart of a data processing method provided in an embodiment of the present application;
[0029] Figure 3C It is a flowchart of a data processing method provided in an embodiment of the present application;
[0030] Figure 4 It is a schematic diagram of the interface configuration provided by the embodiment of the present application;
[0031] Figure 5 It is a schematic diagram of executing the input parameter interface provided in an embodiment of the present application;
[0032] Figure 6 It is a schematic diagram of the parameter input interface provided in the embodiment of the present application;
[0033] Figure 7 It is a schematic diagram of the parameter output interface provided in the embodiment of the present application;
[0034] Figure 8 This is a schematic diagram of the basic configuration of the interface provided in the embodiment of the present application;
[0035] Figure 9 This is a schematic diagram of the interface input parameter configuration provided in an embodiment of the present application;
[0036] Figure 10 This is a schematic diagram of the business code configuration provided by the embodiment of the present application;
[0037] Figure 11 It is a schematic diagram of the configuration of the input script and output script provided in the embodiment of the present application. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0039] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0040] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meanings as those commonly understood by those skilled in the art. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0041] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.
[0042] 1) Input parameter definition: define the interface input parameters.
[0043] 2) Output parameter definition: define the result attributes returned by the interface.
[0044] 3) Hook technology: A code snippet for interception and processing provided to the outside world at a certain stage during the execution of the program.
[0045] 4) Data model: defines the data type of the parameter and other related metadata description information.
[0046] 5) View Model: Descriptive information of user interaction related metadata that defines parameters.
[0047] 6) Application Programming Interface (API): A set of subroutine definitions, protocols, and tools used to build application software. APIs are predefined functions that provide applications and developers with the ability to access a set of processes based on a certain software or hardware without having to directly access the source code or deeply understand the details of the internal working mechanism.
[0048] 7) Software Development Kit (SDK): It is a middleware that takes a set of APIs as input and another set of APIs as output.
[0049] 8) Integrated Development Environment (IDE): An application program that provides a program development environment, generally including tools such as code editors, compilers, debuggers, and graphical user interfaces. It is an integrated development software service suite that integrates code writing, analysis, compilation, and debugging functions. All software or software suites (groups) with this feature can be called an integrated development environment.
[0050] During the research on low-code technology, the applicant found that the current development model of low-code technology is not much different from the traditional development model, the degree of abstraction is low, the development efficiency is not high enough, and the development must be based on a proprietary SDK or proprietary IDE. The learning and development cost is high, and there is no set of standard, complete, fine-grained interface abstraction design, which leads to the need for repeated development of functions such as functional permissions, data permissions, parameter verification, and personalized result processing, lacking reusability, uniformity, and flexibility.
[0051] In order to solve the above text, the embodiments of the present application provide a data processing method, device, electronic device and storage medium, which adapt the input parameters submitted to the input parameter interface through the input parameter interface, so that the input parameters used for business logic operation are matched with the business code, and then the business logic operation is performed on the processed input parameters based on the business code to obtain business result data; further, the business result data obtained by the business code processing is processed through the input parameter interface, so that the business result data is converted into output parameter data that can be presented through the output parameter interface, thereby realizing different requirements for input parameters and output parameter data in different business application scenarios, and parameter processing is implemented by the input parameter interface, ensuring that the processed input parameters can be processed by the business code of the same processing logic, and the processed business processing logic can be presented through the output parameter interface with different requirements, so that the business code of the same processing logic can be reused in different business application scenarios, thereby improving development efficiency.
[0052] Based on the above data processing method, the present application embodiment also provides a data processing system, referring to Figure 1 , Figure 1 It is a schematic diagram of the architecture of the data processing system 100 provided in an embodiment of the present application. To implement a data processing application, the terminal 400 is connected to the server 200 via the network 300. The network 300 may be a wide area network or a local area network, or a combination of the two.
[0053] Terminal 400 is used to present an input parameter interface, obtain input parameters through the input parameter interface, present a parameter interface, present parameter data through the output parameter interface, and display the input parameter interface and / or the output parameter interface on the graphical interface 410. Server 200 is used to obtain input parameters entered through the client's input parameter interface, query the input parameter interface associated with the input parameters, adapt the input parameters based on the input parameter interface to obtain input parameter data matching the business code, perform business logic operations on the input parameter data based on the business code to obtain business result data, perform output parameter processing on the business result data based on the input parameter interface to obtain output parameter data adapted to the output parameter interface, and display the parameter data through the output parameter interface in the graphical interface 410 of terminal 400.
[0054] In some embodiments, the server 200 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. The terminal 400 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a car terminal, etc., but is not limited thereto. The terminal and the server may be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiments of the present application.
[0055] refer to Figure 2 , Figure 2 is a schematic diagram of the structure of the server 200 provided in an embodiment of the present application, Figure 2 The server 200 shown includes: at least one processor 210, a memory 250, at least one network interface 220 and a user interface 230. The various components in the server 200 are coupled together via a bus system 240. It is understood that the bus system 240 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 240 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 240 is not described in detail. Figure 2 Various buses are labeled as bus system 240 .
[0056] The processor 210 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0057] The user interface 230 includes one or more output devices 231 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 230 also includes one or more input devices 232, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
[0058] The memory 250 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 250 may optionally include one or more storage devices that are physically remote from the processor 210.
[0059] The memory 250 includes a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 250 described in the embodiments of the present application is intended to include any suitable type of memory.
[0060] In some embodiments, memory 250 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.
[0061] Operating system 251, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
[0062] A network communication module 252, used to reach other electronic devices via one or more (wired or wireless) network interfaces 220, exemplary network interfaces 220 include: Bluetooth, Wireless Compatibility Certification (WiFi), and Universal Serial Bus (USB), etc.;
[0063] In some embodiments, the data processing device provided in the embodiments of the present application can be implemented in software. Figure 2The data processing device 253 stored in the memory 250 is shown, which can be software in the form of a program and a plug-in, etc., including the following software modules: an acquisition module 2531, a query module 2532 and a processing module 2533. These modules are logical, so they can be arbitrarily combined or further split according to the functions implemented. The functions of each module will be described below.
[0064] In some embodiments, the terminal or server can implement the data processing method provided by the embodiment of the present application by running various computer executable instructions. For example, computer executable instructions can be commands, machine instructions or software instructions at the microprogram level. The computer program can be a native program or software module in the operating system; it can be a local (Native) application (APPlication, APP), that is, a program that needs to be installed in the operating system to run, such as a data processing APP; it can also be a small program that can be embedded in any APP, that is, a program that can be run only by downloading it to a browser environment. In short, the above-mentioned computer executable instructions can be instructions in any form, and the above-mentioned computer program can be an application, module or plug-in in any form.
[0065] The following describes an exemplary application of an electronic device provided by an embodiment of the present application. The electronic device provided by an embodiment of the present application can be implemented as a notebook computer, a tablet computer, a desktop computer, a set-top box, a mobile device (e.g., a mobile phone, a portable music player, a personal digital assistant, a dedicated messaging device, a portable gaming device), a smart phone, a smart speaker, a smart watch, a smart TV, a vehicle-mounted terminal, and other types of user terminals, and can also be implemented as a server. Below, an exemplary application when the device is implemented as a terminal is described. Below, the data processing method provided by an embodiment of the present application is described. As mentioned above, the electronic device that implements the image processing method of the embodiment of the present application can be a terminal, or a server, or can be implemented by a terminal and a server in collaboration. Therefore, the execution subject of each step will not be repeated hereinafter.
[0066] It should be noted that in the example of the data processing method below, the terminal and the server are used as the execution subjects in collaboration. Based on their understanding of the following text, those skilled in the art can apply the data processing method provided in the embodiment of the present application to a data processing method that includes other electronic devices as the execution subjects.
[0067] The following describes the data processing method provided by the embodiment of the present application, taking the server as the execution subject. Figure 3A , Figure 3A is a flow chart of the data processing method provided in the embodiment of the present application, which will be combined with Figure 3ASince the execution subject of the following steps is the server, the execution subject is omitted before each step.
[0068] In step 101, input parameters input through the client's input parameter interface are obtained.
[0069] In some embodiments, the input parameter interface is generated through the interface input parameter configuration, the interface input parameter configuration is obtained through the configuration interface of the client, the input parameter data model used for the interface input parameter configuration is adapted to the input parameter data model of the input parameter interface, and the input parameter view model used for the interface input parameter configuration is adapted to the interaction model of the input parameter interface. As can be seen from the foregoing, the input parameter data model is used to define the descriptive information of the relevant metadata such as the data type of the input parameter data, the input parameter view model is used to define the descriptive information of the user interaction-related metadata of the input parameter data, and the interaction model of the input parameter interface is used to define some user interaction elements in the input parameter interface.
[0070] As an example of step 101, in the interface configuration stage, the developer sets the interface input parameter configuration in the configuration interface of the client according to the target input parameter page, wherein the input parameter data model of the interface input parameter configuration corresponds to the input parameter data model of the target input parameter interface, and the input parameter view model of the interface input parameter configuration corresponds to the interaction model of the target input parameter interface. During the operation of the interface, the server 200 obtains the interface input parameter configuration, generates an input parameter interface according to the interface input parameter configuration, and presents the input parameter interface on the client through the terminal 400. The input parameter interface corresponds to the target input parameter interface. The terminal 400 obtains the input parameters typed by the user through the input parameter interface and sends them to the server 200, and the server 200 can obtain the input parameters sent by the client.
[0071] By setting the interface input parameter configuration according to the target input parameter interface, and generating the input parameter interface according to the interface input parameter configuration, the model of the input parameter interface corresponds to the model of the target input parameter interface. On the one hand, it ensures that the input parameter interface conforms to the pre-designed design, and on the other hand, it ensures that the input parameters obtained through the input parameter interface can be processed by the input parameter script and matched with the business code, so that the business code with the same processing logic can be reused in different business application scenarios, thereby improving development efficiency.
[0072] In step 102, an input parameter interface associated with an input parameter is queried.
[0073] In some embodiments, Figure 3A Step 102 in the embodiment can be implemented through step 1021, which is described in detail below.
[0074] In step 1021, the input parameter interface address included in the input parameter is read, and based on the input parameter interface address, an input parameter interface associated with the input parameter interface address is searched among multiple input parameter interfaces.
[0075] As an example of step 1021, the client includes multiple input parameter interfaces, and the input parameters include the input parameter interface address. When the server 200 queries the input parameter interface associated with the input parameter, the server 200 reads the input parameter interface address included in the input parameter, and queries the target input parameter interface that matches the input parameter interface address in multiple input parameter interfaces based on the input parameter interface address. In actual operation, the input parameter interface can be an interface executor.
[0076] Through step 1021, the target input parameter interface is queried and selected according to the input parameter interface address in the input parameter, so as to ensure that the internal configuration of the input parameter interface for data processing matches the processing requirements of the input parameter, thereby improving development efficiency.
[0077] In step 103, the input parameters are adapted based on the input parameter interface to obtain input parameter data that matches the business code.
[0078] In some embodiments, Figure 3A Step 103 in the embodiment can be implemented by step 1031, which is described in detail below.
[0079] In step 1031, the input parameter interface includes an input parameter script, and the input parameters are adapted by executing the input parameter script to obtain input parameter data of the adapted business code. The adaptation process includes at least one of the following processes: retention process, modification process, addition process and conversion process.
[0080] In some embodiments, the input parameter script is adapted to the interface input parameter configuration and the business code, and the input parameter script is obtained through the configuration interface of the client.
[0081] As an example of step 1031, in the interface configuration stage, the developer sets the input parameter script according to the interface input parameter configuration and the business code. The input parameter script enables the input data submitted through the input parameter interface to be processed by the business code after adaptation. In the interface use stage, the server 200 adapts the input parameters by executing the input parameter script to obtain the input parameter data that matches the business code. Matching the business code means that the parameter form, parameter type, etc. meet the processing specifications of the business code and can be processed by the business code for business logic. The specific method of adaptation processing is related to the specific scenario. For example, in the code conversion application scenario, if the input data is data that cannot be directly processed by the business code, the input parameter processing can be a conversion processing, and the input parameter script can convert the input data into input parameter data that can be directly processed by the business code. If the input data is data that can be directly processed by the business code, the input parameter processing can be a retention processing, and the input parameter script does not need to perform any processing on the input data, that is, at this time, the input parameter script is a content that does not perform any operation. The same applies to modification processing and new addition processing.
[0082] Through step 1031, the input parameters are processed by the input parameter script into input parameter data that can be executed by the business code. When the input parameters change due to changes in the input parameter interface, if the input parameters do not meet the processing requirements of the business code and cannot be effectively processed by the business code, only the input parameter script needs to be reconfigured to make the input parameters meet the processing requirements of the business code, without modifying the business code. Thus, the business code with the same processing logic can be reused in different business application scenarios, improving the development efficiency.
[0083] In some embodiments, the adaptation processing of the input parameters based on the input parameter interface in step 103 to obtain input parameter data matching the business code can also be implemented in the following way: perform preprocessing on the input parameters to obtain updated input parameters, and then perform adaptation processing on the updated input parameters based on the input parameter interface.
[0084] In some embodiments, the input parameters have multiple parameter forms. Extract the input parameters, perform preprocessing on the input parameters to obtain updated input parameters. The updated input parameters are adapted to the input parameter script, and the updated input parameters are used to replace the input parameters for adaptation processing.
[0085] As an example, the input parameters have multiple parameter forms, such as Query parameters, x-www-form-urlencoded request bodies, JSON request bodies, etc. The server 200 extracts the input parameters, performs preprocessing on the input parameters to obtain updated input parameters. The updated input parameters are adapted to the parameter form of the input parameter script, and the updated input parameters are used to replace the input parameters for adaptation processing. The server 200 extracts the parameters of the input parameters in different parameter forms and forms a unified parameter object and then passes it to the subsequent steps.
[0086] By preprocessing the input parameters, it is ensured that the input parameter script can perform adaptation processing on the input parameters, so that the business code with the same processing logic can be reused in different business application scenarios, improving the development efficiency.
[0087] In step 104, perform business logic operations on the input parameter data based on the business code to obtain business result data.
[0088] In one embodiment, the input parameter interface includes a variable storage function. Step 104 performing business logic operations on the input parameter data based on the business code to obtain business result data may include: binding the input parameter data to the variables in the variable storage function, where the variables correspond to the variables in the business code, and based on the business code, performing business logic operations on the input parameter data bound to the variables to obtain business result data.
[0089] During the interface configuration stage, the developer presets a variable storage function, which is used to bind the input parameter data to the variables in the variable storage function. In the business code, the variables in the business code are the same as the variables in the variable storage function or there is a binding relationship. During the interface usage stage, the server 200 binds the input parameter data to the variables in the variable storage function, that is, it realizes the binding of the input parameter data to the variables in the business code. At this time, the server 200 performs business logic operations on the input parameter data bound to the variables based on the business code to obtain business result data.
[0090] Set up a variable storage function and bind the input parameter data to the variables of the business code to implement variable transfer. This ensures that the business code can perform business logic operations on the input parameter data to obtain business result data without having to modify the variables in the business code based on the input parameter data. This allows the business code with the same processing logic to be reused in different business application scenarios, thereby improving development efficiency.
[0091] In some embodiments, before executing step 104, the input parameter data may be firstly checked for parameters, and step 104 may be executed if the check passes, so as to ensure the accuracy of the business logic operation and avoid the waste of resources caused by the business logic operation due to the input parameter data not meeting the check requirements. In a specific implementation, based on the check conditions of the input parameter data, a parameter check operation is performed on the input parameter data; if the check of the input parameter data is determined to be successful according to the parameter check operation, a business logic operation is performed on the input parameter data based on the business code to obtain the business result data.
[0092] In some embodiments, the verification conditions of the input parameter data can be carried in the input parameter interface. As an example, in the interface configuration stage, the developer configures the verification conditions of the input parameter data for the input parameter interface. The verification conditions of the input parameter data include but are not limited to parameter type standards, required field standards, and field definition verification rule matching standards, etc. The verification conditions of the input parameter data can be set according to actual needs. In the interface use stage, the server 200 performs parameter verification operations on the input parameter data based on the verification conditions of the input parameter data. If it is determined that the verification of the input parameter data is successful according to the parameter verification operation, the server 200 executes the step of performing business logic operations on the input parameter data based on the business code to obtain business result data. If the verification is unsuccessful, the server 200 does not perform business logic operations on the input parameter data.
[0093] By setting the verification conditions for the input data, parameter verification operations are performed on the input data to ensure the correctness and processability of the input data, and to ensure that the business code can perform business logic processing on the input data, thereby improving development efficiency.
[0094] In some embodiments, business logic operations are performed on the input parameter data based on the business code to obtain business result data, which can be achieved in the following way: user authority information in the input parameter data is obtained, and authentication operations are performed on the user authority information based on the authentication information. If it is determined according to the authentication operation that the authentication of the input parameter data is passed, business logic operations are performed on the input parameter data based on the business code to obtain business result data.
[0095] In some embodiments, user authority information includes user role information, user resource information and user registration information. When there is a correlation between the interface usage permission of the input parameter interface and the user authority, the user authority information in the input parameter data is obtained, and the user authority information is authenticated based on the authentication information.
[0096] As an example, the server 200 determines that the verification of the input parameter data is successful based on the parameter verification operation, then the server 200 obtains the user authority information in the input parameter data and performs an authentication operation on the input parameter data. When the server 200 performs an authentication operation on the user authority information based on the authentication information, if it is determined according to the authentication operation that the authentication of the input parameter data is passed, the server 200 executes the step of performing logical operations on the input parameter data based on the business code to obtain the business result data. If it is determined according to the authentication operation that the authentication of the input parameter data is not passed, the server 200 does not perform logical operations on the input parameter data. For example, in the interface configuration stage, the developer sets the corresponding authentication information for the input parameter interface A according to actual needs. The authentication information sets the user usage level corresponding to the input parameter interface A to be an advanced user. When the user uses the input parameter interface A, the user authority information in the input parameter data is obtained, and the user authority information is authenticated based on the authentication information. When the user using the input parameter interface A is an ordinary user, the current user is not allowed to call the input parameter interface A to perform logical operations on the input parameter data. When the user using the input parameter interface A is a senior user, the current user is allowed to call the input parameter interface A to perform logical operations on the input parameter data.
[0097] It should be noted that the authentication operation can be performed not only after the verification operation, but also after the adaptation processing. Since the authentication operation may involve the use of input parameters, the authentication operation will be more effective after the input parameters are fully processed.
[0098] By performing authentication after verification, the call of the input parameter interface is partially restricted and the number of calls to the input parameter interface is not too high, thereby ensuring the stability of the input parameter interface and improving development efficiency.
[0099] In step 105, the business result data is processed based on the input parameter interface to obtain output parameter data adapted to the output parameter interface, and the parameter data is displayed through the output parameter interface.
[0100] ReferenceFigure 3B , Figure 3B is a flow chart of a data processing method provided in an embodiment of the present application. In some embodiments, Figure 3A In step 105 of the above, the business result data is processed based on the input parameter interface to obtain the output parameter data adapted to the output parameter interface, which can be obtained by Figure 3B Step 1051 in is implemented, which is described in detail below.
[0101] In step 1051, the business result data is processed based on the input parameter interface to obtain output parameter data adapted to the output parameter interface.
[0102] In some embodiments, the input parameter interface includes an output parameter script. By executing the output parameter script, the business result data is processed to obtain output parameter data adapted to the output parameter interface. The output parameter processing includes at least one of the following processes: conversion processing and retention processing.
[0103] As an example of step 1051, in the interface configuration stage, the developer sets the parameter output script of the input parameter interface according to the interface parameter output configuration and the business code. The parameter output script can make the business result data obtained by the business code processing meet the display requirements of the parameter output interface after the parameter output processing, and can be presented by the parameter output interface. In the interface use stage, the server 200 performs parameter output processing on the business result data based on the parameter output script to obtain the parameter output data adapted to the parameter output interface. The adapted parameter output interface refers to the parameter form, parameter type, etc. that meet the data model and interaction model of the parameter output interface, and can be presented by the parameter output interface. The specific method of parameter output processing is related to the specific scenario. For example, in the code conversion application scenario, if the parameter output interface requires that the data type of the output data cannot be directly output by the business code, the parameter output processing is conversion processing, and the parameter output script converts the business result data into output data that meets the requirements of the parameter output interface. If the parameter output interface requires that the data type of the output data can be directly output by the business code, the parameter output processing is retention processing, and the parameter output script does not need to perform any processing on the business result data. At this time, the parameter output script is an empty content that does not perform any operation.
[0104] Through step 1051, the business result data is processed into output parameter data that can be presented by the output parameter interface through the output parameter script, so as to avoid the situation where the business result data does not conform to the data model and interaction model of the output parameter interface and cannot be presented by the output parameter interface when the output parameter interface changes. Instead, the business result data can be made to conform to the data model and interaction model of the output parameter interface by only reconfiguring the output parameter script, without modifying the business code. In this way, the business code with the same processing logic can be reused in different business application scenarios, thereby improving development efficiency.
[0105] In some embodiments, Figure 3A The parameter data can be displayed through the parameter output interface in step 105.Figure 3B Step 1052 in is implemented.
[0106] In step 1052, the parameter data is displayed through the parameter output interface.
[0107] In some embodiments, the interface parameter configuration is obtained by the terminal 400 through the configuration interface of the client and sent to the server 200. The server 200 generates a parameter output interface through the interface parameter configuration and sends it to the terminal 400, and presents the parameter interface through the terminal 400, and displays the parameter data through the result output box of the parameter output interface, wherein the parameter output data model used for the interface parameter configuration is adapted to the parameter output data model of the parameter output interface, and the parameter output view model used for the interface parameter configuration is adapted to the interaction model of the parameter output interface. The parameter output data model is used to define the description information of the relevant metadata such as the data type of the output parameter, and the parameter output view model is used to define the description information of the metadata related to the user interaction of the output parameter.
[0108] As an example of step 1052, in the interface configuration stage, the developer sets the interface output parameter configuration according to the target output parameter page. The output parameter data model of the interface output parameter configuration corresponds to the output parameter data model of the target output parameter interface. The output parameter view model of the interface output parameter configuration corresponds to the interaction model of the target output parameter interface. During the operation of the interface, the terminal 400 obtains the interface output parameter configuration through the client configuration interface and sends it to the server 200. The server 200 generates an output parameter interface according to the interface output parameter configuration and sends it to the terminal 400. The parameter interface is presented through the terminal 400. The output parameter interface corresponds to the target output parameter interface, and the parameter data is displayed through the result output box of the output parameter interface.
[0109] Through step 1052, the interface output parameter configuration is set according to the target output parameter interface, and the output parameter interface is generated according to the interface output parameter configuration, so that the model of the output parameter interface corresponds to the model of the target output parameter interface. On the one hand, it is ensured that the output parameter interface conforms to the pre-design, and on the other hand, it is ensured that the output parameter data processed by the business code and the output parameter script can be presented through the output parameter interface, so that the business code with the same processing logic can be reused in different business application scenarios, thereby improving development efficiency.
[0110] The following describes the data processing method provided by the embodiment of the present application, with the terminal and the server working together as the execution subject. Figure 3C , Figure 3C is a flow chart of the data processing method provided in the embodiment of the present application, which will be combined with Figure 3C The steps shown are explained.
[0111] In step 201, the server 200 obtains the interface input parameter configuration and interface output parameter configuration of the client.
[0112] As an example of step 201, in the interface configuration phase, the developer sets the interface input parameter configuration and interface output parameter configuration of the client, the interface input parameter configuration includes input parameter encoding, input parameter name, input parameter data type, input parameter data model and input parameter view model, and the interface output parameter configuration includes output parameter encoding, output parameter name, output parameter data type, output parameter data model and output parameter view model. In the interface use phase, the server 200 obtains the interface input parameter configuration and interface output parameter configuration of the client.
[0113] In step 202, the server 200 generates an input parameter interface based on the interface input parameter configuration.
[0114] In some embodiments, the interface input parameter configuration includes an input parameter data model and an input parameter view model, and the server 200 generates an input parameter interface based on the interface input parameter configuration.
[0115] As an example of step 202, the input parameter data model of the interface input parameter configuration is adapted to the input parameter data model of the input parameter interface, the input parameter view model of the interface input parameter configuration is adapted to the interaction model of the input parameter interface, the set interface output parameter configuration is obtained through the configuration interface, and the server 200 generates the input parameter interface in the client based on the interface input parameter configuration.
[0116] Through step 202, an input parameter interface is generated based on the interface input parameter configuration, ensuring that the data model and interaction model of the input parameter interface are consistent with the interface input parameter configuration. Since the input parameter script is pre-set based on the business code and the interface input parameter configuration, generating the input parameter interface in the client based on the interface input parameter configuration can ensure that the input parameters can be processed by the input parameter script, ensuring that when the input parameter interface changes, there is no need to modify the business code. It is only necessary to set the interface input parameter configuration according to the input parameter interface, and set the input parameter script based on the business code and the interface input parameter configuration, so as to ensure that the input data can ultimately be processed by the business code for business logic, so that the business code with the same processing logic can be reused in different business application scenarios, thereby improving development efficiency.
[0117] In step 203 , the server 200 sends an input parameter interface to the terminal 400 .
[0118] As an example, after generating an input parameter interface based on the interface input parameter configuration, the server 200 sends the input parameter interface to the terminal 400 .
[0119] In step 204, the terminal 400 presents a parameter input interface and obtains input parameters through the parameter input interface.
[0120] In some embodiments, after the server 200 generates an input parameter interface based on the interface input parameter configuration, the input parameter interface is sent to the terminal 400, and the terminal 400 obtains and presents the input parameter interface, and the terminal 400 obtains input parameters through the input parameter interface.
[0121] As an example, the terminal 400 presents a parameter input interface, and the user types input parameters in an input box of the parameter input interface. The terminal 400 obtains the input parameters typed by the user through the parameter input interface.
[0122] In step 205, the server 200 obtains input parameters.
[0123] As an example, after acquiring the input parameters entered by the user, the terminal 400 sends the input parameters to the server 200 .
[0124] In step 206, the server 200 queries the input parameter interface associated with the input parameter.
[0125] In some embodiments, the server 200 reads the input parameter included in the input parameter's input interface address, and based on the input parameter interface address, queries a target input parameter interface matching the input parameter interface address from a plurality of input parameter interfaces.
[0126] As an example of step 206, the server includes multiple input parameter interfaces, and the input parameters include the input parameter interface address. When the server 200 queries the input parameter interface associated with the input parameter, the server 200 reads the input parameter interface address included in the input parameter, and queries the target input parameter interface that matches the input parameter interface address in multiple input parameter interfaces based on the input parameter interface address. In actual operation, the input parameter interface can be an interface executor.
[0127] Through step 206, the server 200 queries and selects the target input parameter interface according to the input parameter interface address in the input parameter, ensuring that the internal configuration of the input parameter interface for data processing matches the processing requirements of the input parameter, thereby improving development efficiency.
[0128] In step 207, the server 200 performs adaptation processing on the input data based on the input parameter interface to obtain input parameter data that matches the business code.
[0129] In some embodiments, the input parameter interface includes an input parameter script, and the server 200 adapts the input parameters by executing the input parameter script to obtain input parameter data that matches the business code. The adaptation process includes at least one of the following processes: retention processing, modification processing, new addition processing and conversion processing.
[0130] Through step 207, the server 200 processes the input parameters into input parameter data that can be executed by the business code through the input parameter script, so as to avoid the situation where the input parameters do not meet the processing requirements of the business code and cannot be effectively processed by the business code when the input parameter interface changes and the input parameters change accordingly. Instead, the input parameters only need to be reconfigured to meet the processing requirements of the business code without modifying the business code, so that the business code with the same processing logic can be reused in different business application scenarios, thereby improving development efficiency.
[0131] In some embodiments, the server 200 can also implement the adaptation processing of the input data based on the input parameter interface in step 207 to obtain input parameter data that matches the business code in the following manner: extract the input parameters, perform input parameter pre-processing on the input parameters, obtain updated input parameters, adapt the updated input parameters to the input parameter script, and use the updated input parameters to replace the input parameters for adaptation processing.
[0132] In some embodiments, the input parameters have multiple parameter forms. The server 200 extracts the input parameters, performs input parameter pre-processing on the input parameters, obtains updated input parameters, the updated input parameters are adapted to the input script, and the updated input parameters are used to replace the input parameters for adaptation processing.
[0133] The input parameters are preprocessed by the server 200 to ensure that the input script can adapt the input parameters, so that the business code with the same processing logic can be reused in different business application scenarios, thereby improving development efficiency.
[0134] Before step 207, the server 200 may also obtain a set input parameter script, which is adapted to the interface input parameter configuration and the business code.
[0135] In some embodiments, the server 200 adapts the input parameters based on the input parameter script. Before obtaining the input parameter data that matches the business code, the server 200 can also display a configuration interface on the terminal 400 and obtain the set input parameter script through the configuration interface. After the server 200 obtains the input parameter script, it adapts the input parameters based on the input parameter script, and the input parameter script is adapted to the interface input parameter configuration and the business code.
[0136] By displaying the configuration interface and obtaining the set input script through the configuration interface, you only need to configure the input script to make the input parameters meet the processing requirements of the business code without modifying the business code. In this way, the business code with the same processing logic can be reused in different business application scenarios, thereby improving development efficiency.
[0137] In step 208, the server 200 performs business logic operations on the input parameter data based on the business code to obtain business result data.
[0138] In some embodiments, the input parameter interface includes a variable storage function, and the server 200 binds the input parameter data to the variables in the variable storage function, the variables correspond to the variables in the business code, and based on the business code, performs business logic operations on the input parameter data bound to the variables to obtain business result data.
[0139] Through step 208, the server 200 sets a variable storage function and binds the input parameter data to the variables of the business code, thereby realizing variable transfer and ensuring that the business code can perform business logic operations on the input parameter data to obtain business result data without modifying the variables in the business code according to the input parameter data. This enables the business code with the same processing logic to be reused in different business application scenarios, thereby improving development efficiency.
[0140] In some embodiments, after step 207, the server 200 may also implement the business logic operation based on the business code in step 208 to obtain business result data on the input parameter data by performing parameter verification operations.
[0141] In some embodiments, the input parameter interface includes verification conditions for the input parameter data. The server 200 adapts the input parameters based on the input parameter interface. After obtaining the input parameter data that matches the business code, the server 200 performs parameter verification operations on the input parameter data based on the verification conditions of the input parameter data.
[0142] The verification conditions of the input parameter data are set through the server 200, and parameter verification operations are performed on the input parameter data to ensure the correctness and processability of the input parameter data, ensure that the business code can perform business logic processing on the input parameter data, and improve development efficiency.
[0143] After performing parameter verification operations on the input data, the server 200 can also obtain user authority information in the input data, and the server 200 performs authentication operations on the user authority information based on the authentication information.
[0144] In some embodiments, when there is an association between the interface usage permission of the input parameter interface and the user authority, the server 200 obtains the user authority information in the input parameter data and performs an authentication operation on the user authority information based on the authentication information.
[0145] By performing an authentication operation after the verification operation by the server 200, it is ensured that the calling of the input parameter interface is partially restricted and the calling times of the input parameter interface is not too high, thereby ensuring the stability of the input parameter interface and improving development efficiency.
[0146] In step 209, the server 200 performs output parameter processing on the business result data based on the input parameter interface to obtain output parameter data adapted to the output parameter interface.
[0147] In some embodiments, the input parameter interface includes an output parameter script. The server 200 executes the output parameter script to perform output parameter processing on the business result data to obtain output parameter data adapted to the output parameter interface. The output parameter processing includes at least one of the following processes: conversion processing and retention processing.
[0148] Through step 209, the server 200 processes the business result data into output parameter data that can be presented by the output parameter interface through the output parameter script, so as to avoid the situation where the business result data does not conform to the data model and interaction model of the output parameter interface and cannot be presented by the output parameter interface when the output parameter interface changes. Instead, the business result data can be made to conform to the data model and interaction model of the output parameter interface by only reconfiguring the output parameter script, without modifying the business code. This allows the business code with the same processing logic to be reused in different business application scenarios, thereby improving development efficiency.
[0149] In step 210, the server 200 generates a parameter output interface based on the interface parameter output configuration.
[0150] In some embodiments, the interface output parameter configuration includes an output parameter data model and an output parameter view model, and the server 200 generates a parameter output interface based on the interface output parameter configuration.
[0151] As an example of step 210, the server 200 obtains the set interface output parameter configuration through the configuration interface, the output parameter data model of the interface output parameter configuration is adapted to the output parameter data model of the output parameter interface, the output parameter view model of the interface output parameter configuration is adapted to the interaction model of the output parameter interface, and the server 200 generates the output parameter interface based on the interface output parameter configuration.
[0152] Through step 210, the server 200 generates an output parameter interface in the client based on the interface output parameter configuration, ensuring that the data model and interaction model of the output parameter interface are consistent with the interface output parameter configuration. Since the output parameter script is pre-set based on the business code and the interface output parameter configuration, generating the output parameter interface based on the interface output parameter configuration can ensure that the business result data can be presented on the client after the output parameter processing through the output parameter script, ensuring that when the output parameter interface changes, there is no need to modify the business code. It is only necessary to set the interface output parameter configuration according to the output parameter interface, and set the output parameter script based on the business code and the interface output parameter configuration, so as to ensure that the business result data can finally be presented by the output parameter interface, so that the business code with the same processing logic can be reused in different business application scenarios, thereby improving development efficiency.
[0153] In step 211 , the server 200 sends a parameter interface to the terminal 400 .
[0154] As an example of step 211 , after the server 200 generates a parameter output interface based on the interface parameter output configuration, the parameter output interface is sent to the terminal 400 .
[0155] In step 212, the terminal 400 presents a parameter interface, and presents the parameter data through the parameter interface.
[0156] As an example of step 212, the terminal 400 presents a parameter output interface adapted to the interface parameter output configuration, and presents the parameter data through a result output column of the parameter output interface.
[0157] Before step 201, it also includes displaying a configuration interface on the terminal 400, obtaining the set interface input parameter configuration through the configuration interface, adapting the input parameter data model of the interface input parameter configuration to the input parameter data model of the input parameter interface, adapting the input parameter view model of the interface input parameter configuration to the interaction model of the input parameter interface, obtaining the set interface output parameter configuration through the configuration interface, adapting the output parameter data model of the interface output parameter configuration to the output parameter data model of the output parameter interface, and adapting the output parameter view model of the interface output parameter configuration to the interaction model of the output parameter interface.
[0158] By setting the interface input parameter configuration and the interface output parameter configuration, the interface interaction requirements of the client can be met to ensure that when the input parameter interface and / or the output parameter interface changes, there is no need to modify the business code. Instead, it is only necessary to set the interface input parameter configuration according to the input parameter interface, set the input parameter script based on the business code and the interface input parameter configuration, and / or set the interface output parameter configuration according to the output parameter interface, and set the output parameter script based on the business code and the interface output parameter configuration. This ensures that when the input parameter interface and the output parameter interface change, the business code can perform business logic processing on the input data and finally output it, so that the business code with the same processing logic can be reused in different business application scenarios to improve development efficiency.
[0159] The following is an exemplary application of the embodiment of the present application in an actual code conversion processing application scenario.
[0160] First, configure the development input interface.
[0161] refer to Figure 4 , Figure 4 It is a schematic diagram of the interface configuration provided in an embodiment of the present application.
[0162] The interface definition rules are as follows:
[0163] The basic interface information 401 includes name, code, group, type and result format. The name is used for human viewing and search management. The code is used for the interface address component and the routing parameter during the execution process. The group is used for group management of the interface, and is also the address component and execution routing parameter. The type is used for the language of the interface implementation, such as: SQL, Groo vy and other languages. The result format includes single data, list data, and paginated data. These three can meet various demand scenarios. The basic interface information can also include permission control, which is used to authenticate users.
[0164] The interface input parameter configuration 402 includes: parameter code, parameter name, data type, interface input parameter data model 4021, and interface input parameter view model 4022, wherein the parameter code is used to specify the key value of the parameter submitted by the client, the parameter name is used for human viewing and search management, and the data type is used to define the data type of the parameter, such as integer, date, string, etc.
[0165] The interface input parameter data model 4021 defines the data model of the current parameter. The embodiment of the present application defines three models: literal value type, dictionary value type, and object reference value type. The literal value type is an ordinary basic simple data type without additional attributes. The dictionary value type has two data pair attributes, namely, key and value. In addition, there are two attributes, child ID and parent ID, to support dictionary types with parent-child management. The object reference value type is used for reference values of other complex objects, such as menu ID, which is a reference to a menu object.
[0166] The interface input view model 4022 defines the UI interaction model of the current parameter. This view model is defined based on user interaction requirements, such as text input boxes, date selection boxes, etc. This value needs to be coordinated with the input interface. The interface input view model definition includes view component type, view mode, and matching operation. Among them, the view component types include text input: TEXT_INPUT, multi-line text input: TEXT_AREA, date selection: DATE_INPUT, time selection: DATETIME_INPUT, number input: NUMBER_INPUT, drop-down selection: DROP_SELECT, radio button: RADIO, multiple selection box: CHECKBOX. According to the needs of interaction, the component type will be gradually improved and enriched; the view mode defines three view modes: query mode, edit mode, and read-only mode. These three modes are used In order to cope with different demand scenarios, the user interface needs to present three states. The query mode is when the interface is used for retrieval scenarios, and the view component needs to display the specified user query input box according to the configured component type, such as string matching input box, value range input box, query multiple-select or single-select input box, etc. The edit mode is when the interface user submits a modification operation, then the user's modified or newly added input components are rendered, such as date, number, selection, etc. The read-only mode is when the content of the interface is presented to the user for viewing rather than editing. The component needs to present the state, generally in text format, or in a specified format. In query mode, a query matching operation parameter will be provided: equal: EQ, greater than: GT, greater than or equal to: GTE, less than: LT, less than or equal to: LTE, Like: LK, LikeCenter: LC, Like Left: LL, Like Right: LR, Range (left and right closed interval): BTW, Range (left and right closed interval): BTW11, Range (left closed and right open): BTW10, Range (left open and right open): BTW00, Range (left open and right closed): BTW01, Equal to one in the set: IN, Equal to all in the set: AIN, Empty (null or empty string): EPT, etc.
[0167] The core interface code configuration 403 includes inputting the core business code, such as SQL or Groovy script, without considering additional functions such as parameter processing and permission verification.
[0168] For SQL-type codes, the embodiment of the present application defines a parameter placeholder design, which is divided into two types of parameters: 1) ordinary value parameters, 2) boolean expression parameters (hereinafter referred to as Boolean parameters), and the special purpose of the boolean expression design: ordinary parameters are fixed values, and the query conditions have been solidified into the SQL script, and the dynamic construction of conditions cannot be realized. The design of Boolean expressions can solve this problem. Through boolean expressions, the client can pass different condition combination logics by itself, and the backend dynamically generates boolean expressions based on the parameters passed by the client to realize flexible client-defined condition query functions.
[0169] The parameter placeholder design expressions are as follows: ${paramName} default parameter placeholder, ${prefix:paramName:suffix}Bool parameter placeholder (both prefix and suffix), ${prefix:paramName:}Bool parameter placeholder (only prefix), ${:paramName:suffix}Bool parameter placeholder (only suffix), ${:paramName:}Bool parameter placeholder (no prefix, no suffix), ${prefix%paramName%suffix} value parameter placeholder (both prefix and suffix), ${prefix%paramName%} value parameter placeholder ((only prefix), ${%paramName%suffix} value parameter placeholder (only suffix), ${%paramName%} value parameter placeholder (no prefix, no suffix).
[0170] The input script 404 is a configurable script function used to process the parameters input by the user. The parameters can be recalculated and some special pre-execution processing logic can be performed, such as verification, default value processing, authentication, and even adding parameters.
[0171] The parameter output script 405 is a script function with configurable content, which is used to process the data of the business results before output, such as converting the format, performing desensitizing calculations on some data, etc.
[0172] The interface output parameter configuration 406 is used to define and standardize the interface output data field. The specific configuration of the interface output parameter configuration 406 corresponds to the interface input parameter configuration content, including the interface output parameter data model 4061 and the interface output parameter view model 4062. The interface output parameter data model 4061 defines the data model of the current parameter, and the interface output parameter view model 4062 defines the UI interaction model of the current parameter.
[0173] After configuring the input parameter interface, publish the input parameter interface.
[0174] refer to Figure 5 , Figure 5 It is a schematic diagram of the execution of the input parameter interface provided in the embodiment of the present application. After the input parameter interface is released, the input parameter interface execution call includes:
[0175] The server obtains the interface input parameter configuration, automatically generates the client input parameter interface based on the interface input parameter configuration, and presents the input UI in the input parameter interface.
[0176] refer to Figure 6 , Figure 6 It is a schematic diagram of the parameter input interface provided in an embodiment of the present application. Figure 6 The input box in is dynamically presented based on the input view model defined in the interface. Different input modes have different effects. For example, in the example figure, the same date field will present different input styles based on the matching operation of the query when querying (here is a range query), and the new one is just a specific date input box.
[0177] The input parameter interface is divided into three types: Query, Edit, and Read. Different user interaction interfaces are rendered based on the three types. A parameter only presents one interface configured by the current parameter.
[0178] Continue to refer to Figure 5 The client submits the user input parameters to the interface address through an API request, and the server has a general parameter extraction processor to uniformly process the input parameters.
[0179] According to the interface address requested by the user, the parameters are routed to the interface executor through the same entry router of the interface, and the correct type of interface executor 1 is selected for call execution.
[0180] The interface executor 1 executes the parameter input hook, that is, the parameter input script. The parameter input hook script can be an empty content that does nothing, or it can modify, add, and convert the parameter input parameters to achieve unified processing of the parameters.
[0181] Verify the parameters of the input parameters according to the unified standards (such as whether the parameter type is correct, whether the required fields are missing, whether the verification rules defined in the field match, etc.).
[0182] Perform unified authentication operations based on the configured interface. Note: There is an authentication attribute when configuring the basic information of the interface. The authentication attribute can be used to configure the permission information (such as roles, resources or other attributes) required by users to access this interface. In this step, authentication matching will be unified based on the user information in the current session and the required authentication configuration.
[0183] Bind the input parameters to the context (this context is a variable storage area for script execution, and storing parameters in the context is the context binding operation mentioned here). If it is an SQL type, the parameters are also injected and bound based on the dynamic input parameter definition. Note: the parameter binding here is based on the "input parameter definition" combined with the "parameter placeholder design" to bind and inject SQL parameters to achieve dynamic binding and execution of SQL parameters.
[0184] The dynamic script that has been configured and published in the execution configuration phase, that is, the business code, outputs the execution result, that is, the business result data.
[0185] Execute the output script for the execution result. If necessary, you can convert the result here, or it can be an empty script that does nothing.
[0186] Process the results according to a unified data format and output the unified results, i.e. the parameter data, to the client.
[0187] According to the view model of the output parameter definition, the output results are rendered and displayed, and the unified results are output through the output UI presented by the client. Note: The output parameter definition has defined the data model and view model of each parameter. The data model defines the "value" and other properties of the field such as description or title. The view model defines the view components presented to the user, such as: text input box, date component, etc. Based on these two models, the front end displays the output results.
[0188] refer to Figure 7 , Figure 7 It is a schematic diagram of the parameter output interface provided in the embodiment of the present application. Figure 7 The list content and form content in are dynamically presented based on the output view model. For example, the example shows the presentation of two read-only interfaces, namely the Read mode parameter interface, one is the list view page, and the other is the form view page. The fields in them are presented in different styles based on the output view model.
[0189] The following is an explanation of an exemplary application of the embodiments of the present application in an actual web page data processing application scenario.
[0190] In the embodiment of the present application, the business indicator data needs to be displayed on the portal in the form of a portal card. The data is in the business system. The business system uses the technical solution of the present application to implement interface configuration capabilities. The portal card has a custom format requirement. The business system needs to provide a data interface in the format required by the portal card. The portal card requirements change frequently, such as: statistical caliber parameters, display image effects, and new indicator dimensions.
[0191] refer to Figures 8 - 11 , Figure 8 is a schematic diagram of the basic configuration of the interface provided in the embodiment of the present application,Figure 8 The basic interface configuration provides configuration information such as interface ID, interface type, interface name, interface code, version, and module ID. Figure 9 is a schematic diagram of the interface input parameter configuration provided in an embodiment of the present application, Figure 9 The interface input parameter configuration provides configuration information options such as parameter name, parameter value type, data model, and view model. Figure 10 is a schematic diagram of the business code configuration provided in the embodiment of the present application, Figure 10 The business code configuration provides configuration information such as SQL code language type, data source, number limit, and execution conditions, and you can add execution scripts. Figure 11 It is a schematic diagram of the configuration of the input script and the output script provided in the embodiment of the present application. Figure 11 The sample code for the input and output scripts is provided in.
[0192] In the embodiment of the present application, the server obtains the basic configuration of the interface, the interface input parameter configuration, the business code, the interface output parameter configuration, the input parameter script and the output parameter script to configure the input parameter interface. The basic configuration of the interface is configured by Figure 8 The method shown is used for configuration. The interface input parameter configuration is done through Figure 9 The method shown is configured, and the business code is configured through Figure 10 The configuration is performed by the method shown in the figure. The input and output scripts are configured by Figure 11 After the input parameter interface configuration is completed, the server saves the input parameter interface configuration and publishes the input parameter interface, so that the input parameter interface is in operation, and in response to the user's operation of calling the input parameter interface through the portal card of the web page, the input parameter interface is called to process the data entered by the user through the input parameter interface.
[0193] The following further describes an exemplary structure of the data processing device 253 provided in the embodiment of the present application implemented as a software module. In some embodiments, for example Figure 2 As shown, the software modules stored in the data processing device 253 of the memory 250 may include:
[0194] The acquisition module 2531 is used to acquire input parameters input through the client's input parameter interface;
[0195] A query module 2532, used to query an input parameter interface associated with an input parameter;
[0196] The processing module 2533 is used to adapt the input parameters based on the input parameter interface to obtain the input parameter data matching the business code;
[0197] The processing module 2533 is further used to perform business logic operations on the input parameter data based on the business code to obtain business result data;
[0198] The processing module 2533 is also used to perform output parameter processing on the business result data based on the input parameter interface, obtain the output parameter data adapted to the output parameter interface, and display the parameter data through the output parameter interface.
[0199] In some embodiments, the input parameter interface is generated through the interface input parameter configuration, and the output parameter interface is generated based on the interface output parameter configuration. The interface input parameter configuration and the interface output parameter configuration are obtained through the configuration interface of the client. The input parameter data model used for the interface input parameter configuration is adapted to the input parameter data model of the input parameter interface, the input parameter view model used for the interface input parameter configuration is adapted to the interaction model of the input parameter interface, the output parameter data model used for the interface output parameter configuration is adapted to the output parameter data model of the output parameter interface, and the output parameter view model used for the interface output parameter configuration is adapted to the interaction model of the output parameter interface.
[0200] In some embodiments, the query module 2532 is further used to read the input parameter interface address included in the input parameters, and query the input parameter interface associated with the input parameter interface address from multiple input parameter interfaces based on the input parameter interface address.
[0201] In some embodiments, the processing module 2533 is also used to perform adaptation processing on the input parameters by executing the input parameter script to obtain the input parameter data adapted to the business code. The adaptation processing includes at least one of the following processing: retention processing, modification processing, new addition processing and conversion processing. The input parameter interface includes an input parameter script, and the input parameter script is adapted to the interface input parameter configuration and the business code.
[0202] In some embodiments, the processing module 2533 is also used to perform parameter processing on the business result data by executing the parameter output script to obtain parameter output data adapted to the parameter output interface, and the parameter output processing includes at least one of the following processes: conversion processing and retention processing.
[0203] In some embodiments, the processing module 2533 is further used to perform input parameter pre-processing on the input parameters to obtain updated input parameters, and perform adaptation processing on the updated input parameters based on the input parameter interface.
[0204] In some embodiments, the processing module 2533 is also used to perform parameter verification operations on the input parameter data based on the verification conditions of the input parameter data. If it is determined according to the parameter verification operation that the verification of the input parameter data is successful, a business logic operation is performed on the input parameter data based on the business code to obtain business result data.
[0205] In some embodiments, the processing module 2533 is also used to obtain user authority information in the input parameter data, the user authority information includes user role information, user resource information and user registration information, and perform authentication operations on the user authority information based on the authentication information. If it is determined according to the authentication operation that the authentication of the input parameter data is passed, a logical operation is performed on the input parameter data based on the business code to obtain business result data.
[0206] In some embodiments, the processing module 2533 is also used to bind the input parameter data to the variables in the variable storage function, the variables correspond to the variables in the business code, and based on the business code, the business logic operation is performed on the input parameter data bound to the variables to obtain business result data.
[0207] The embodiment of the present application provides a computer program product, which includes a computer program or a computer executable instruction, and the computer program or the computer executable instruction is stored in a computer-readable storage medium. The processor of the electronic device reads the computer executable instruction from the computer-readable storage medium, and the processor executes the computer executable instruction, so that the electronic device executes the data processing method described above in the embodiment of the present application.
[0208] The embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, the processor will be caused to execute the data processing method provided by the embodiment of the present application, for example, Figure 3A The data processing method is shown.
[0209] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
[0210] In some embodiments, computer executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.
[0211] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).
[0212] As an example, computer executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed at multiple sites and interconnected by a communication network.
[0213] To summarize, the present application sets the input data and output data processing processes respectively by means of an input parameter script and an output parameter script, generates an input parameter interface based on the client's interface input parameter configuration, generates an output parameter interface based on the client's interface output parameter configuration, adapts the input data submitted through the input parameter interface to obtain input parameter data matching the business code, performs output parameter processing on the business result data obtained by processing the business code to become output parameter data that can be presented through the output parameter interface, so that in different business application scenarios, business codes with the same processing logic can be reused without the need to make corresponding modifications to the input and output parameters in the business code, thereby reducing the amount of code modification during the interface development process and improving development efficiency.
[0214] Specifically, the embodiments of the present application can achieve the following technical effects:
[0215] 1) Rapid development, online and offline: With the technical solution of this application, there is no need for complicated processes such as offline development and online, saving time and effort.
[0216] 2) Reduce the burden of business-irrelevant technologies: The technical solution of this application highly abstracts the interface. To configure the interface, you only need to focus on the different business content of each interface without paying attention to business-irrelevant technical details such as permission control, parameter type processing, exception handling, etc., and no manual coding is required.
[0217] 3) Quickly respond to changes in business needs: When the client changes the interface return format, the technical solution of this application can quickly configure the reference hook script to quickly meet the needs. When the data source changes, the core business code can also be quickly modified to obtain new data fields and content.
[0218] 4) The technical solution of this application strikes a good balance between powerful functionality and ease of use, and can meet the rapid development of a large part of the needs, as well as the complex needs of extreme situations.
[0219] 5) In addition to low-code scenarios, this technology can also be used for data open interfaces between various systems, greatly reducing the cost of open interface development and improving system integration efficiency.
[0220] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.
Claims
1. A data processing method, It is characterized in that The method comprises: Get the input parameters entered through the client's input interface; Query the input parameter interface associated with the input parameter; Adapting the input parameters based on the input parameter interface to obtain input parameter data matching the business code; Perform business logic operations on the input parameter data based on the business code to obtain business result data; Based on the input parameter interface, the business result data is processed to obtain output parameter data adapted to the output parameter interface, and the output parameter data is displayed through the output parameter interface.
2. The method according to claim 1, It is characterized in that The input parameter interface is generated through the interface input parameter configuration, the output parameter interface is generated based on the interface output parameter configuration, and the interface input parameter configuration and the interface output parameter configuration are obtained through the configuration interface of the client; The input parameter data model used for interface input parameter configuration is adapted to the input parameter data model of the input parameter interface, and the input parameter view model used for interface input parameter configuration is adapted to the interaction model of the input parameter interface; The output parameter data model used for interface output parameter configuration is adapted to the output parameter data model of the output parameter interface, and the output parameter view model used for interface output parameter configuration is adapted to the interaction model of the output parameter interface.
3. The method according to claim 1, It is characterized in that The client includes a plurality of input parameter interfaces; the query input parameter interface associated with the input parameter includes: Read the input parameter interface address included in the input parameter; Based on the input parameter interface address, query an input parameter interface associated with the input parameter interface address among multiple input parameter interfaces.
4. The method according to any one of claims 1 to 3, It is characterized in that The input parameter interface includes an input parameter script, and the input parameter script is adapted to the interface input parameter configuration and the business code; the input parameter is adapted based on the input parameter interface to obtain input parameter data matching the business code, including: The input parameters are adapted by executing the input script to obtain input parameter data adapted to the business code, wherein the adaptation process includes at least one of the following processes: retention process, modification process, addition process and conversion process.
5. The method according to any one of claims 1 to 3, It is characterized in that The input parameter interface includes an output parameter script; the output parameter processing of the business result data based on the input parameter interface to obtain output parameter data adapted to the output parameter interface includes: The business result data is processed by executing the parameter output script to obtain parameter output data adapted to the parameter output interface, wherein the parameter output processing includes at least one of the following processing: conversion processing and retention processing.
6. The method according to any one of claims 1 to 3, It is characterized in that The adapting processing of the input parameter based on the input parameter interface to obtain input parameter data matching the business code includes: Performing input parameter preprocessing on the input parameters to obtain updated input parameters; The updated input parameters are adapted based on the input parameter interface.
7. The method according to any one of claims 1 to 3, It is characterized in that The input parameter interface includes verification conditions for the input parameter data; the business logic operation is performed on the input parameter data based on the business code to obtain business result data, including: Based on the verification condition of the input parameter data, perform a parameter verification operation on the input parameter data; If it is determined according to the parameter verification operation that the verification of the input parameter data is successful, a business logic operation is performed on the input parameter data based on the business code to obtain business result data.
8. The method according to claim 7, It is characterized in that The input parameter interface also includes authentication information; if it is determined according to the parameter verification operation that the verification of the input parameter data is successful, a business logic operation is performed on the input parameter data based on the business code to obtain business result data, including: Obtaining user authority information from the input data, wherein the user authority information includes user role information, user resource information, and user registration information; Based on the authentication information, performing an authentication operation on the user authority information; If it is determined according to the authentication operation that the authentication of the input parameter data is passed, a business logic operation is performed on the input parameter data based on the business code to obtain business result data.
9. The method according to any one of claims 1 to 3, It is characterized in that The input parameter interface includes a variable storage function; the variables in the variable storage function correspond to the variables in the business code; the business logic operation is performed on the input parameter data based on the business code to obtain business result data, including: Binding the input parameter data to the variables in the variable storage function; Based on the business code, business logic operations are performed on the input parameter data bound to the variable to obtain business result data.
10. A data processing device, It is characterized in that The data processing device comprises: The acquisition module is used to obtain the input parameters entered through the client's input interface; A query module, used to query an input parameter interface associated with the input parameter; A processing module, used to adapt the input parameters based on the input parameter interface to obtain input parameter data matching the business code; The processing module is further used to perform business logic operations on the input parameter data based on the business code to obtain business result data; The processing module is also used to perform output parameter processing on the business result data based on the input parameter interface, obtain output parameter data adapted to the output parameter interface, and display the output parameter data through the output parameter interface.
11. An electronic device, It is characterized in that The electronic device comprises: A memory for storing computer executable instructions; A processor, configured to implement the method according to any one of claims 1 to 9 when executing the computer executable instructions stored in the memory.
12. A computer-readable storage medium storing computer-executable instructions, It is characterized in that When the computer executable instructions are executed by a processor, the method according to any one of claims 1 to 9 is implemented.