Processing method, device, electronic device and storage medium
By classifying and caching the resource object of the API bound to interactive form in a low-code platform, the problem of low API network transmission efficiency is solved, and API scheduling efficiency and API resource retrieval performance across network areas are improved.
Patent Information
- Application Number
- CN202111242841.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-25
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2041-10-25
AI Technical Summary
In low-code platforms, the network transmission efficiency of APIs is low, which affects the usage experience of interactive forms, especially in poor API resource retrieval performance across network areas.
When the target application executes a trigger event, the API bound to the interactive form is classified according to the resource object and the resource data corresponding to each group of APIs is cached to realize the response API scheduling based on the cache data.
The number of network transmission and network IO is reduced, the efficiency of low-code platforms to apply form scheduling APIs, and the impact of network transmission efficiency during API scheduling is significantly improved.
Smart Images

Figure CN113867921B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of software technology, and more specifically, to a processing method, device, electronic device and storage medium. Background Art
[0002] In the design of the low-code platform, the front-end interactive form will be bound to the back-end API (Application Program Interface), such as the RESTful API, to obtain the ability to operate certain business resources or complex calculations.
[0003] Since APIs are usually called across networks, the response speed of the API is not only related to the processing efficiency of the API implementation program itself, but also to the network transmission efficiency of the API. If the API caller and the callee are located in different networks, such as if there are firewalls, gateways and other devices between them, the network transmission efficiency of the API will be greatly reduced, which will ultimately affect the user experience of the interactive form. Summary of the invention
[0004] In view of this, the present application provides a processing method, device, electronic device and storage medium, and the technical solution is as follows:
[0005] On the one hand, the present application provides a processing method, the method comprising:
[0006] In the case where the target application is executed and a trigger event is triggered, the application program interface API bound to the interactive form under the target application is classified according to the resource object, and the APIs classified into one group correspond to the same resource object;
[0007] Obtain and cache the resource data of resource objects corresponding to each set of APIs to achieve:
[0008] When the target application is in a published state and its application instance is started, respond to the API dispatch initiated by the target interaction form based on the cached resource data.
[0009] Preferably, the classifying the application program interface API bound to the interactive form under the target application according to the resource object includes:
[0010] Obtaining API configuration properties of the interactive form under the target application;
[0011] Determine at least one API associated with the interactive form based on the API configuration attribute;
[0012] The at least one API is categorized according to resource objects.
[0013] Preferably, the obtaining and caching of resource data of resource objects corresponding to each group of APIs includes:
[0014] Perform pre-aggregation operations on each group of APIs to obtain API requests corresponding to each group of APIs;
[0015] Obtain resource data of resource objects corresponding to each group of APIs through API requests corresponding to each group of APIs;
[0016] Update the resource data cache corresponding to each group of APIs to the cache area corresponding to each group of APIs.
[0017] Preferably, the API dispatch initiated by the target interaction form based on the cached resource data response includes:
[0018] If the API request corresponding to the API scheduled through the target interaction form belongs to the resource retrieval class and belongs to one of the groups of APIs, resource data matching the API request corresponding to the scheduled API is retrieved from the cached resource data corresponding to the group of APIs.
[0019] Preferably, the API dispatch initiated by the target interaction form based on the cached resource data response further includes:
[0020] If the API request corresponding to the API scheduled by the target interaction form belongs to the resource retrieval class and does not belong to any of the API groups, then the resource data of the corresponding resource object is obtained through the API request corresponding to the scheduled API;
[0021] The resource data cache corresponding to the scheduled API is updated to the cache area corresponding to the scheduled API.
[0022] Preferably, the API dispatch initiated by the target interaction form based on the cached resource data response further includes:
[0023] If the API request corresponding to the API scheduled by the target interaction form does not belong to the resource retrieval class, resource data of the corresponding resource object is obtained through the API request corresponding to the scheduled API.
[0024] Preferably, the scheduled APIs include, in sequence, a first API and a second API belonging to the same group of APIs, and the interaction form bound to the first API is a parent form of the interaction form bound to the second API;
[0025] The retrieving resource data matching the API request corresponding to the scheduled API from the cached resource data corresponding to a group of APIs includes:
[0026] Retrieving first resource data matching the API request corresponding to the first API from cached resource data corresponding to a group of APIs to which the first API belongs;
[0027] Retrieve second resource data matching the API request corresponding to the second API from the first resource data.
[0028] Another aspect of the present application provides a processing device, the device comprising:
[0029] A classification module, for classifying the application program interface API bound to the interactive form under the target application according to the resource object when the target application is executed to trigger the event, and the APIs classified into one group correspond to the same resource object;
[0030] The processing module is used to obtain and cache resource data of resource objects corresponding to each group of APIs to achieve: when the target application is in a published state and its application instance is started, respond to the API scheduling initiated by the target interaction form based on the cached resource data.
[0031] Another aspect of the present application provides an electronic device, the electronic device comprising:
[0032] A memory, used to store applications and data generated by the operation of the applications;
[0033] A processor, configured to execute the application program to implement the following functions:
[0034] When a trigger event is executed on the target application, the application program interface API bound to the interactive form under the target application is classified according to the resource object, and the APIs classified into one group correspond to the same resource object; resource data of the resource objects corresponding to each group of APIs are obtained and cached to achieve: when the target application is in a published state and its application instance is started, respond to the API scheduling initiated by the target interactive form based on the cached resource data.
[0035] Another aspect of the present application provides a storage medium, wherein the storage medium stores computer executable instructions, wherein the computer executable instructions are used to execute:
[0036] When a trigger event is executed on the target application, the application program interface API bound to the interactive form under the target application is classified according to the resource object, and the APIs classified into one group correspond to the same resource object; resource data of the resource objects corresponding to each group of APIs are obtained and cached to achieve: when the target application is in a published state and its application instance is started, respond to the API scheduling initiated by the target interactive form based on the cached resource data.
[0037] Through the above technical solution, the processing method provided by the present application, when the target application is executed and triggers an event, the API bound to its interaction form is classified according to the resource object, and the APIs classified into one group correspond to the same resource object, so the resource data of each group of APIs can be obtained and cached according to the resource object. Therefore, after the target application is published and its application instance is started, it can respond to the API scheduling initiated by the target interaction form based on the cached resource data, which can reduce the number of network transmissions and network IO, and significantly improve the efficiency of low-code platform application form scheduling API. In addition, the present application can also reduce the impact of network transmission efficiency on low-code applications during API scheduling, and the performance of API resource retrieval across network areas is significantly improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0039] Figure 1 A hardware structure block diagram of an electronic device provided in an embodiment of the present application;
[0040] Figure 2 A method flow chart of the processing method provided in the embodiment of the present application;
[0041] Figure 3 A method flow chart of another processing method provided in an embodiment of the present application;
[0042] Figure 4 A method flow chart of another processing method provided in an embodiment of the present application;
[0043] Figure 5 A schematic diagram of a processing scenario provided in an embodiment of the present application;
[0044] Figure 6 A schematic diagram of the structure of a processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0046] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0047] To facilitate understanding of this application, the following first explains the background of binding the front-end interactive form to the back-end API in the low-code platform:
[0048] At present, the development of an application, such as a web application, usually involves front-end development and back-end development: the front-end art design application product prototype, that is, the interactive form image in the front-end page, and the front-end developers write a lot of code to convert the interactive form image into a web page in HTML format that can be recognized by the browser. At this time, the web page developed by the front-end does not have the ability to interact, which requires the back-end developers to write a lot of code to develop the back-end program (also called microservice).
[0049] The back-end program can perform complex business logic operations, such as adding, deleting, modifying, and checking data in the database. In addition, in order to achieve the connection between the back-end and the front-end, the back-end developers need to expose the back-end program as an API, and then the front-end developers bind the interactive form in the web page format to the API. For each application, the entire application development process requires front-end and back-end developers to develop and write a lot of code to achieve it. The development process is cumbersome, inefficient, and costly.
[0050] In order to simplify development, a large number of components are pre-developed and packaged in the low-code platform. The components can be reused and application development can be achieved by dragging and dropping components. Taking the front-end design of interactive forms as an example, there is no need to convert the design drawings and development programs. The front-end developers can complete the design of interactive forms by dragging components related to the interactive form, such as input boxes, drop-down boxes, or long text edit boxes, based on certain logical relationships or certain design layouts. This can reduce the development time of interactive forms from the usual one week to just a few hours. Of course, the back-end program development and the binding of interactive forms to APIs are also achieved by the back-end developers dragging components.
[0051] Since APIs are usually called across networks, the response speed of the API is not only related to the processing efficiency of the API implementation program itself, but also to the network transmission efficiency of the API. If the API caller and the callee are located in different networks, such as if there are firewalls, gateways and other devices between them, the network transmission efficiency of the API will be greatly reduced, which will ultimately affect the user experience of the interactive form.
[0052] Research has found that the existing technical methods to improve API network transmission efficiency mainly include the following methods:
[0053] 1) Establish a cache mechanism at the gateway layer to provide API callers with fast resource acquisition capabilities by caching API resources that are relatively unchanged and frequently accessed within a certain period. This method solves the efficiency problem of repeated retrieval of basic resource data to a certain extent, but the ability to obtain resources from the buffer can only be obtained when the same API parameters are passed for the second time. Moreover, for multiple API parameters of the same resource, completely different cache objects may be generated, which will cause a great waste of memory space.
[0054] 2) Optimize program execution efficiency on the API program side and improve server-side responsiveness. This method is only effective for computing applications. Once a large amount of data is transmitted across the network, even if the API program has high computational efficiency, the long network transmission time will greatly affect the performance of the front-end interaction.
[0055] 3) Optimize the index on the database side and establish a data cache mechanism to improve the efficiency of API program data retrieval. This method is very effective in improving database retrieval efficiency, but when the network transmission speed is limited, the data retrieval results generated by a large number of API requests in a short period of time will take a lot of time to be transmitted to the front-end interactive application. This long form response will greatly affect the user experience.
[0056] Correspondingly, in order to supplement the deficiencies of the above methods, the present application provides a processing method that can reduce the impact of network transmission efficiency on low-code applications during API calls, and significantly improves the API resource retrieval performance across network areas.
[0057] The processing method provided in this application can be applied to electronic devices, see Figure 1 The hardware structure block diagram of the electronic device shown in the figure may include: a processor 11, a communication interface 13, a memory 12 and a communication bus 14;
[0058] In the embodiment of the present application, the number of the processor 11 , the communication interface 13 , the memory 12 , and the communication bus 14 is at least one, and the processor 11 , the communication interface 13 , and the memory 12 communicate with each other through the communication bus 14 .
[0059] The processor 11 may be a central processing unit (CPU), a graphics processing unit (GPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0060] The memory 12 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), etc., such as at least one disk memory.
[0061] The memory 12 stores the application and the data generated by the application, and the processor 11 executes the application to realize the following functions:
[0062] When a trigger event is executed on the target application, the application program interface API bound to the interactive form under the target application is classified according to the resource object, and the APIs classified into one group correspond to the same resource object; the resource data of the resource objects corresponding to each group of APIs are obtained and cached to achieve: when the target application is in a published state and its application instance is started, respond to the API scheduling initiated by the target interactive form based on the cached resource data.
[0063] It should be noted that the refinement and expansion of the functions implemented by the processor executing the application program can be found in the description below.
[0064] This application embodiment provides a processing method, see Figure 2 The method flow chart shown in the figure comprises the following steps:
[0065] S101, when a trigger event is executed on a target application, classify the application program interface API bound to the interactive form under the target application according to the resource object, and the APIs classified into one group correspond to the same resource object.
[0066] In the embodiment of the present application, the low-code platform creates an interactive form by dragging components, and binds the API to the interactive form to obtain the operation or computing power of dynamic resources. Through application publishing, the application is installed and deployed, the application can be started in the formal environment, and the application user can use the application.
[0067] The target application is a designated application developed by the low-code platform. When a trigger event is executed on the target application, such as a release operation or a test operation, the API bound to the interactive form under the target application is classified according to the resource object. Taking the target application as an example, when the target application is released, the API interface analysis process is automatically triggered, and the API bound to the interactive form under the target application is classified according to the resource object, and an API request resource model is created. The API request resource model represents the corresponding relationship between the parameters and resource objects corresponding to the APIs classified into a group.
[0068] For an application developed by a low-code platform, its front end has at least one interactive form, and each interactive form is bound to at least one API. For an API, it can be bound only to an interactive form on the front end of a certain application, or to the interactive forms on the front ends of multiple applications. For an application, the API can also be bound to one or more interactive forms on its front end.
[0069] For ease of understanding, let's take an example to illustrate that the applications developed by the low-code platform include application 1 and application 2. The front end of application 1 includes two independent interactive forms 1-1 and 1-2, and application 2 includes two interactive forms 2-1 and 2-2 with a hierarchical relationship, where interactive form 1-1 binds API1 and API2, interactive form 1-2 binds API2 and API3, interactive form 2-1 binds API1, API3 and API4, and interactive form 2-2 binds API5. It should be noted that API1, API2, API3, API4 and API5 can belong to the same type of API, for example, they are all retrieval APIs, and different APIs correspond to different data items (or parameters designed by the front-end developers), that is, different APIs can correspond to different retrieval conditions.
[0070] For ease of understanding, taking Application 2 as the target application, when Application 2 is released, the API interface analysis process of Application 2 is automatically triggered, and the API bound to the interactive form under Application 2 is classified according to the resource object, and a request resource model of Application 2 is created. When binding the API to the interactive form, the low-code platform has specified the resource object and the corresponding search scope for the API, such as the enterprise internal organization list API (the first 20 are displayed by default), a resource page list API (the 10 records on the first page are displayed by default), etc.
[0071] Assume that the resource objects and search scopes specified for API1, API3 and API4 bound to interactive form 2-1 under application 2, and API5 bound to interactive form 2-2 are: API1 is specified with search scope A-1 of resource object A, API3 is specified with search scope A-2 of resource object A, API4 is specified with search scope B-1 of resource object B, and API5 is specified with search scope B-1-1 of resource object B, that is, interactive form 2-2 is a subordinate form of interactive form 2-1, API4 can be set to trigger API5, and the search scope B-1-1 of API5 is part of the search scope B-1 of API4.
[0072] The APIs bound to the interactive forms 2-1 and 2-2 under application 2 are classified according to resource objects. Since the resource objects of API1 and API3 are both resource objects A, and the resource objects of API4 and API5 are both resource objects B, API1 and API3 can be classified into one group, and API4 and API5 can be classified into one group.
[0073] S102, obtaining and caching resource data of resource objects corresponding to each group of APIs, to achieve:
[0074] When the target application is in a published state and its application instance is started, the API dispatch initiated by the target interaction form is responded to based on the cached resource data.
[0075] In an embodiment of the present application, based on the groups of APIs classified under the target application, network requests can be sent to the remote API services corresponding to each group of APIs, and resource data of the resource objects corresponding to each group of APIs returned by the remote APIs can be obtained, and then the resource data successfully returned by the remote API service can be cached using a cache strategy. The cache strategy can be set based on the application scenario, and the cache strategy can include a cache address, cache time, time for timeout retransmission, etc., which is not limited in the embodiment of the present application.
[0076] For ease of understanding, continue to use application 2 as the target application as an example, API1 and API3 are classified into one group, and API4 and API5 are classified into one group. Therefore, for API1 and API3 classified into one group, a network request can be sent to the remote API service corresponding to resource object A to obtain and cache the resource data of resource object A under the search scope A-1 and A-2. Similarly, for API4 and API5 classified into one group, since the search scope B-1-1 of API5 is part of the search scope B-1 of API4, a network request can be sent to the remote API service corresponding to resource object B to obtain and cache the resource data of resource object B under the search scope B-1.
[0077] When the target application is published and its application instance is started, the application user can initiate API scheduling based on the front-end interactive form. The existing API scheduling process is as follows:
[0078] When using the target application, the application user can select a specific data item in the front-end interactive form, which will trigger the interactive form to call the bound API and send the parameters corresponding to the selected data item to the API (the parameters are designed by the front-end developer). The back-end program corresponding to the API will perform business logic operations based on the set of parameters. Taking the common search operation as an example, the back-end program retrieves the data corresponding to the set of parameters in the database, and the API returns the retrieved data to the front-end, which displays it in the defined form, such as in a list or chart. In this way, the interaction between the front-end and back-end of a published application is completed.
[0079] Continuing to take application 2 as the target application as an example, after caching the resource data of resource object A under the search scope A-1 and A-2, and the resource data of source object B under the search scope B-1, the user of application 2 can retrieve the resource data of the corresponding search scope from the cached resource data regardless of which one of API1, API3, API4 and API5 is called. Therefore, after applying this application, the cache of resource data can be completed before the application user calls the API, and a group of APIs with the same resource objects can be called only once to obtain the resource data corresponding to the group of APIs, so that the application user can search based on the cached resource data when calling the API.
[0080] The processing method provided in the embodiment of this application can reduce the number of network transmissions and network IOs, and significantly improve the efficiency of low-code platform application form scheduling APIs. In addition, this application can also reduce the impact of network transmission efficiency on low-code applications during API scheduling, and significantly improve the performance of API resource retrieval across network regions.
[0081] As an implementation method for classifying the application program interface API bound to the interactive form under the target application according to the resource object, the embodiment of the present application provides another processing method, see Figure 3 The method flow chart shown in the figure comprises the following steps:
[0082] S201, when a trigger event is executed on a target application, obtain API configuration properties of an interactive form under the target application.
[0083] In the embodiment of the present application, when the front-end developer binds the API to the interactive form, the relevant information configured for the API is the API configuration attribute. Therefore, based on the API configuration attributes of the interactive form under the target application, the information of the API bound to the interactive form, such as the API name, API address, etc., can be determined, and the relationship between the API bound to the interactive form and the API bound to other interactive forms can also be determined, such as two interactive forms with a hierarchical relationship, where an API bound to one interactive form triggers an API bound to another interactive form.
[0084] S202: Determine at least one API associated with the interactive form based on the API configuration attribute.
[0085] In the embodiment of the present application, based on the API attributes of the interaction form under the target application, one or more APIs associated with the interaction form can be determined, including all APIs bound to the interaction form and all APIs bound to other interaction forms that have a hierarchical relationship with the interaction form.
[0086] For ease of understanding, let's continue to take application 2 as the target application as an example. The interactive forms under application 2 include interactive forms 2-1 and 2-2. Since interactive forms 2-1 and 2-2 have a hierarchical relationship and interactive form 2-2 is a subordinate form of interactive form 2-1, interactive form 2-1 is analyzed first:
[0087] For interactive form 2-1, it can be determined that its bound APIs include API1, API3 and API4, and API5 bound to interactive form 2-1 is triggered by API4, so it can be determined that at least one API associated with interactive form 2-1 includes API1, API3, API4 and API5.
[0088] Further analyzing the interactive form 2-2, since the API5 bound to the interactive form 2-2 is an API associated with the interactive form 2-1, when the interactive form 2-2 is only bound to one API, namely, API5, there is no need to further analyze the interactive form 2-2.
[0089] S203, classifying at least one API according to the resource object, wherein the APIs classified into one group correspond to the same resource object.
[0090] In the embodiment of the present application, for at least one API associated with different interaction forms, at least one API is classified by using a classification algorithm to create an API request resource model. The classification algorithm is based on a machine learning model and can classify the API by learning relevant rules of resource objects.
[0091] For ease of understanding, continue to take application 2 as the target application as an example. For the APIs associated with interaction form 2-1, apply a classification algorithm to API1, API3, API4, and API5, and classify API1 and API3 into one group, and classify API4 and API5 into another group.
[0092] S204, obtaining and caching resource data of resource objects corresponding to each group of APIs, to achieve:
[0093] When the target application is in a published state and its application instance is started, the API dispatch initiated by the target interaction form is responded to based on the cached resource data.
[0094] The processing method provided in the embodiment of the present application can determine at least one API associated with the interactive form through the API configuration properties of the interactive form under the target application, and further classify at least one API according to the resource object, so as to complete the classification of the API bound to the interactive form under the target application by the resource object, thereby automatically triggering API interface analysis when executing application release.
[0095] As an implementation method for obtaining and caching resource data of resource objects corresponding to each group of APIs, the present application embodiment provides another processing method, see Figure 4 The method flow chart shown in the figure comprises the following steps:
[0096] S301, when a trigger event is executed on a target application, classify the application program interface API bound to the interactive form under the target application according to the resource object, and the APIs classified into one group correspond to the same resource object.
[0097] S302: Perform a pre-aggregation operation on each group of APIs to obtain API requests corresponding to each group of APIs.
[0098] In the embodiment of the present application, the API pre-aggregation process is automatically triggered according to the API request resource model. The API pre-aggregation model performs pre-aggregation operations on each group of APIs based on the API request resource model, and pre-aggregates the parameters corresponding to each API in each group of APIs into one API request, thereby merging the API requests corresponding to at least one API in a group of APIs into one remote call API request.
[0099] For ease of understanding, continue to take application 2 as the target application as an example, classify API1 and API3 into one group, and classify API4 and API5 into one group. Therefore, a pre-aggregation operation can be performed on API1 and API3 to pre-aggregate the parameters corresponding to API1 and API3 into one API request, and a pre-aggregation operation can be performed on API4 and API5 to pre-aggregate the parameters corresponding to API4 and API5 into one API request.
[0100] S303: Obtain resource data of resource objects corresponding to each group of APIs through API requests corresponding to each group of APIs.
[0101] For ease of understanding, we continue to take application 2 as the target application as an example, pre-aggregate the parameters corresponding to API1 and API3 into one API request, and send the API request to the remote API service corresponding to resource object A to obtain the resource data of resource object A under the search scope A-1 and A-2; pre-aggregate the parameters corresponding to API4 and API5 into one API request, and send the API request to the remote API service corresponding to resource object B to obtain the resource data of resource object B under the search scope B-1.
[0102] S304, updating the resource data cache corresponding to each group of APIs to the cache area corresponding to each group of APIs, so as to achieve:
[0103] When the target application is in a published state and its application instance is started, the API dispatch initiated by the target interaction form is responded to based on the cached resource data.
[0104] In an embodiment of the present application, an API pre-aggregation cache area can be set up, in which corresponding cache areas can be divided for each group of APIs, and then the resource data cache corresponding to each API is updated into the corresponding cache area.
[0105] The processing method provided in the embodiment of the present application can perform pre-aggregation operations on the classified APIs to obtain the API requests corresponding to each group of APIs, and further obtain the resource data of the resource objects corresponding to each API through the API requests, and cache and update them in the cache area corresponding to each group of APIs. As a result, the present application can realize a remote resource data retrieval once by pre-aggregating multiple API requests, reduce the number of network transmissions and network IO, and significantly improve the efficiency of the low-code platform application form scheduling API.
[0106] As an implementation of API dispatch initiated by a target interaction form based on cached resource data response, it may include the following steps:
[0107] If the API request corresponding to the API scheduled through the target interaction form belongs to the resource retrieval class and belongs to one of the groups of APIs, then resource data matching the API request corresponding to the scheduled API is retrieved from the cached resource data corresponding to the group of APIs.
[0108] In an embodiment of the present application, when an application user initiates a resource request for a target application form in a low-code application, the API scheduling engine schedules the API request based on a decision algorithm, thereby enabling resource retrieval with multiple API retrieval conditions through the API scheduling engine.
[0109] Determine whether the API request scheduled by the target interaction form belongs to the resource retrieval class, that is, determine whether the resource operation behavior of the API request is a retrieval operation; further, if it belongs to the resource retrieval class, further determine whether the scheduled API belongs to a group of APIs corresponding to the target interaction form, that is, determine whether the resource requested by the API has been cached. If so, retrieve the resource data matching the API request from the resource data corresponding to the group of APIs to which the cached and scheduled API belongs.
[0110] For ease of understanding, let's continue to use application 2 as the target application as an example. Assuming that the target interactive form is interactive form 2-1, the application user selects a specific data item in interactive form 2-1 to trigger interactive form 2-1 to call API 1, and sends corresponding parameters to API 1, which then retrieves resource data of resource object A in range A-1 from the cached resource data.
[0111] In the process of retrieving resource data matching the API request from the cached resource data corresponding to the group of APIs to which the scheduled API belongs, resource retrieval can be performed based on the cube retrieval strategy. Specifically, the scheduled APIs include a first API and a second API belonging to the same group of APIs in sequence, and the interaction form bound to the first API is the parent form of the interaction form bound to the second API, then the following steps can be adopted:
[0112] Retrieve first resource data matching the API request corresponding to the first API from cached resource data corresponding to a group of APIs to which the first API belongs; and retrieve second resource data matching the API request corresponding to the second API from the first resource data.
[0113] For example, the first API call (i.e., the first API) is used to retrieve the "list of customers whose gender is male", and the API request is "GET / api / customer?gender=male", which will retrieve the customer list from the API pre-aggregation cache; the second API call (i.e., the second API) is used to retrieve the "list of customers whose gender is male and whose occupation is engineer", and the API request is "GET / api / customers?gender=male&occupation=engineer", which will retrieve the "list of customers whose occupation is engineer" from the previous search results.
[0114] In addition, if the API request corresponding to the API scheduled through the target interaction form belongs to the resource retrieval class and does not belong to any group of APIs, the resource data of the corresponding resource object is obtained through the API request corresponding to the scheduled API; the resource data cache corresponding to the scheduled API is updated to the cache area corresponding to the scheduled API.
[0115] In the embodiment of the present application, if the resource operation behavior of the API request scheduled by the target interaction form is a retrieval operation, and the resource requested by the API is not cached, the API request is sent to the corresponding remote API service to obtain the resource data of the corresponding resource object, and the resource data cache is updated to the cache area corresponding to the scheduled API. At this time, the API call duration will depend on the execution time of the remote service and the network transmission time.
[0116] In addition, if the API request corresponding to the API scheduled through the target interaction form does not belong to the resource retrieval class, resource data of the corresponding resource object is obtained through the API request corresponding to the scheduled API.
[0117] In the embodiment of the present application, if the resource operation behavior of the API request scheduled by the target interaction form is not a retrieval operation, the API request is sent to the corresponding remote API service to obtain the resource data of the corresponding resource object. At this time, the API call duration will depend on the execution time of the remote service and the network transmission time.
[0118] See also Figure 5 The processing scenario shown in the figure. Low-code platform users create interactive forms by dragging and dropping on the low-code platform, and bind APIs to obtain the operation or computing capabilities of dynamic resources. When the application is released, the API interface analysis process is automatically triggered to create an API request resource model:
[0119] The API attribute configuration is obtained from the application form attribute configuration of the interactive form, and then the API information and related API information of the interactive form are obtained in the API attribute configuration, so as to determine at least one API associated with the interactive form. Furthermore, a classification algorithm is used to classify at least one API of the interactive form according to resource objects, so as to create an API request resource model.
[0120] Automatically trigger the API pre-aggregation process based on the API request resource model:
[0121] Based on the API request resource model, the API pre-aggregation engine sends an API request to the remote API service and obtains the returned resource data; further, the cache strategy is used to cache and update the resource data successfully returned by the remote API service to the API pre-aggregation cache area.
[0122] When the application is published and the application instance is started, the application user initiates an API call based on the interactive form. When the application user initiates a form resource request in the low-code application, the API scheduling engine schedules the API request based on the decision algorithm:
[0123] If it is determined that the resource operation behavior of the API request is a retrieval operation and the resource exists in the API pre-aggregation cache, then the resource retrieval is performed on the API pre-aggregation cache. Specifically, the resource retrieval can be performed based on the cube retrieval strategy; if it is determined that the resource operation behavior of the API request is not a retrieval operation or the resource operation behavior of the API request is not a retrieval operation but the resource does not exist in the API pre-aggregation cache, then the remote API service request is executed. At this time, the scheduling duration of the API will depend on the execution time of the remote service and the network transmission time.
[0124] Corresponding to the processing method provided in the above embodiment, the embodiment of the present application provides a processing device, such as Figure 6 As shown, the processing device includes:
[0125] The classification module 10 is used to classify the application program interface API bound to the interactive form under the target application according to the resource object when the target application is executed and triggers the event, and the APIs classified into one group correspond to the same resource object;
[0126] The processing module 20 is used to obtain and cache resource data of resource objects corresponding to each group of APIs to achieve: when the target application is in a published state and its application instance is started, respond to the API scheduling initiated by the target interaction form based on the cached resource data.
[0127] In another embodiment of the processing device disclosed in the present application, the classification module 10 classifies the application program interface API bound to the interactive form under the target application according to the resource object, including:
[0128] Obtaining API configuration attributes of an interactive form under a target application; determining at least one API associated with the interactive form based on the API configuration attributes; and classifying the at least one API according to a resource object.
[0129] In another embodiment of the processing device disclosed in the present application, the processing module 20 obtains and caches resource data of resource objects corresponding to each group of APIs, including:
[0130] Perform pre-aggregation operations on each group of APIs to obtain API requests corresponding to each group of APIs; obtain resource data of resource objects corresponding to each group of APIs through API requests corresponding to each group of APIs; and update the resource data cache corresponding to each group of APIs to the cache area corresponding to each group of APIs.
[0131] In another embodiment of the processing device disclosed in the present application, the processing module 20 responds to the API dispatch initiated by the target interaction form based on the cached resource data, including:
[0132] If the API request corresponding to the API scheduled through the target interaction form belongs to the resource retrieval class and belongs to one of the groups of APIs, then resource data matching the API request corresponding to the scheduled API is retrieved from the cached resource data corresponding to the group of APIs.
[0133] In another embodiment of the processing device disclosed in the present application, the processing module 20 responds to the API dispatch initiated by the target interaction form based on the cached resource data, and further includes:
[0134] If the API request corresponding to the API scheduled through the target interaction form belongs to the resource retrieval class and does not belong to any group of APIs, the resource data of the corresponding resource object is obtained through the API request corresponding to the scheduled API; the resource data cache corresponding to the scheduled API is updated to the cache area corresponding to the scheduled API.
[0135] In another embodiment of the processing device disclosed in the present application, the processing module 20 responds to the API dispatch initiated by the target interaction form based on the cached resource data, and further includes:
[0136] If the API request corresponding to the API scheduled through the target interaction form does not belong to the resource retrieval class, resource data of the corresponding resource object is obtained through the API request corresponding to the scheduled API.
[0137] In another embodiment of the processing device disclosed in the present application, the scheduled APIs sequentially include a first API and a second API belonging to the same group of APIs, and the interaction form bound to the first API is a parent form of the interaction form bound to the second API;
[0138] The processing module 20 retrieves resource data matching the API request corresponding to the scheduled API from the cached resource data corresponding to a group of APIs, including:
[0139] Retrieve first resource data matching the API request corresponding to the first API from cached resource data corresponding to a group of APIs to which the first API belongs; and retrieve second resource data matching the API request corresponding to the second API from the first resource data.
[0140] The detailed functions of each module in the embodiment of the present application can be found in the corresponding disclosed part of the above-mentioned information processing method embodiment, which will not be repeated here.
[0141] Corresponding to the above processing method, the present application further discloses a storage medium, in which computer executable instructions are stored, and the computer executable instructions are used to execute:
[0142] When a trigger event is executed on the target application, the application program interface API bound to the interactive form under the target application is classified according to the resource object, and the APIs classified into one group correspond to the same resource object; the resource data of the resource objects corresponding to each group of APIs are obtained and cached to achieve: when the target application is in a published state and its application instance is started, respond to the API scheduling initiated by the target interactive form based on the cached resource data.
[0143] The above is a detailed introduction to a processing method, device, electronic device and storage medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
[0144] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0145] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device that includes a series of elements is inherent to the elements, or also includes elements inherent to these processes, methods, articles or devices. In the absence of further restrictions, the elements defined by the sentence "including a..." do not exclude the presence of other identical elements in the process, method, article or device that includes the elements.
[0146] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A processing method, the method comprising: In the case where the target application is executed and a trigger event is triggered, the application program interface API bound to the interactive form under the target application is classified according to the resource object, and the APIs classified into one group correspond to the same resource object; Obtain and cache the resource data of resource objects corresponding to each set of APIs to achieve: When the target application is in a published state and its application instance is started, respond to the API dispatch initiated by the target interaction form based on the cached resource data.
2. According to the method of claim 1, the step of classifying the application program interface API bound to the interactive form under the target application according to the resource object comprises: Obtaining API configuration properties of the interactive form under the target application; Determine at least one API associated with the interactive form based on the API configuration attribute; The at least one API is categorized according to resource objects.
3. According to the method of claim 1, the step of obtaining and caching resource data of resource objects corresponding to each set of APIs comprises: Perform pre-aggregation operations on each group of APIs to obtain API requests corresponding to each group of APIs; Obtain resource data of resource objects corresponding to each group of APIs through API requests corresponding to each group of APIs; Update the resource data cache corresponding to each group of APIs to the cache area corresponding to each group of APIs.
4. The method according to claim 1, wherein responding to an API dispatch initiated by a target interaction form based on the cached resource data comprises: If the API request corresponding to the API scheduled through the target interaction form belongs to the resource retrieval class and belongs to one of the groups of APIs, resource data matching the API request corresponding to the scheduled API is retrieved from the cached resource data corresponding to the group of APIs.
5. The method according to claim 4, wherein responding to the API dispatch initiated by the target interaction form based on the cached resource data further comprises: If the API request corresponding to the API scheduled by the target interaction form belongs to the resource retrieval class and does not belong to any of the API groups, then the resource data of the corresponding resource object is obtained through the API request corresponding to the scheduled API; The resource data cache corresponding to the scheduled API is updated to the cache area corresponding to the scheduled API.
6. The method according to claim 4, wherein responding to the API dispatch initiated by the target interaction form based on the cached resource data further comprises: If the API request corresponding to the API scheduled by the target interaction form does not belong to the resource retrieval class, resource data of the corresponding resource object is obtained through the API request corresponding to the scheduled API.
7. The method according to claim 4, wherein the scheduled APIs sequentially include a first API and a second API belonging to the same group of APIs, and the interaction form bound to the first API is a parent form of the interaction form bound to the second API; The retrieving resource data matching the API request corresponding to the scheduled API from the cached resource data corresponding to a group of APIs includes: Retrieving first resource data matching the API request corresponding to the first API from cached resource data corresponding to a group of APIs to which the first API belongs; Retrieve second resource data matching the API request corresponding to the second API from the first resource data.
8. A processing device, comprising: A classification module, for classifying the application program interface API bound to the interactive form under the target application according to the resource object when the target application is executed to trigger the event, and the APIs classified into one group correspond to the same resource object; The processing module is used to obtain and cache resource data of resource objects corresponding to each group of APIs to achieve: when the target application is in a published state and its application instance is started, respond to the API scheduling initiated by the target interaction form based on the cached resource data.
9. An electronic device, comprising: A memory, used to store applications and data generated by the operation of the applications; A processor, configured to execute the application program to implement the following functions: When a trigger event is executed on the target application, the application program interface API bound to the interactive form under the target application is classified according to the resource object, and the APIs classified into one group correspond to the same resource object; resource data of the resource objects corresponding to each group of APIs are obtained and cached to achieve: when the target application is in a published state and its application instance is started, respond to the API scheduling initiated by the target interactive form based on the cached resource data.
10. A storage medium having computer executable instructions stored therein, wherein the computer executable instructions are used to execute: When a trigger event is executed on the target application, the application program interface API bound to the interactive form under the target application is classified according to the resource object, and the APIs classified into one group correspond to the same resource object; resource data of the resource objects corresponding to each group of APIs are obtained and cached to achieve: when the target application is in a published state and its application instance is started, respond to the API scheduling initiated by the target interactive form based on the cached resource data.
Citation Information
Patent Citations
GraphQL based micro service configuration design method and device and storage equipment
CN109587212A
Multi-source data aggregation search method and device, equipment and storage medium
CN113032419A