Functional component expansion method, device, equipment, storage medium and program product

By receiving custom function code and compiling it into components for injection into the low-code platform, the problem of insufficient extensibility of custom function components in the low-code development platform is solved, thus improving development efficiency.

CN114217789BActive Publication Date: 2026-02-27BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202111586782.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-23
Publication Date
2026-02-27
Estimated Expiration
2041-12-23

AI Technical Summary

Technical Problem

Low-code development platforms cannot meet all the development needs of developers and lack the ability to extend custom functional components, resulting in low development efficiency.

Method used

By receiving custom function code, determining the code compilation method, compiling and generating custom function components, and injecting them into the component library of the low-code development platform, an online data transmission interface is added to import the function code written by the user, thereby realizing the online expansion of custom function components.

Benefits of technology

It improves the efficiency of secondary use of custom functional components, fully leverages developers' application development capabilities, and enhances the development efficiency of low-code development platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114217789B_ABST
    Figure CN114217789B_ABST
Patent Text Reader

Abstract

The present disclosure provides a function component expansion method and device, electronic equipment, computer readable storage medium and computer program product, relating to the technical field of low-code development and cloud service. The method comprises: receiving a custom function code imported through a preset online data transmission interface; determining a code compilation mode according to the custom function code; compiling the custom function code according to the code compilation mode to obtain a compilation result; generating a custom function component according to the compilation result, and injecting the custom function component into a component library of a low-code development platform as an expansion function component. The method increases the online expansion capability of the custom function component for the low-code development platform, can fully exert the application development capability of the developer, and at the same time can fully rely on the low-code development capability provided by the low-code development platform to improve the development efficiency of the required function of the target application.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of application development processing, in particular to the technical field of low-code development and cloud service, and more particularly to a function component expansion method and device, electronic equipment, computer readable storage medium and computer program product. BACKGROUND

[0002] A low-code development platform (LCDP) is a development platform that can quickly generate an application program without writing code (zero code) or by writing a small amount of code. The method of developing an application program through visualization enables developers with different experience levels to create web pages and mobile applications through a graphical user interface using drag-and-drop components and model-driven logic.

[0003] Generally, a low-code development platform will have built-in function components (such as renderers) corresponding to multiple technology stacks to facilitate developers to directly call on the platform, but it still cannot meet the development needs of all developers.

[0004] Therefore, how to provide expansion functions of function components for a low-code development platform according to the actual needs of developers is a problem to be solved by those skilled in the art. SUMMARY

[0005] The embodiments of the present disclosure provide a function component expansion method, device, electronic equipment, computer readable storage medium and computer program product.

[0006] In a first aspect, the embodiments of the present disclosure provide a function component expansion method, comprising: receiving a custom function code imported through a preset online data transmission interface; determining a code compilation mode according to the custom function code; compiling the custom function code according to the code compilation mode to obtain a compilation result; generating a custom function component according to the compilation result, and injecting the custom function component as an expansion function component into a component library of a low-code development platform.

[0007] In a second aspect, the embodiments of the present disclosure provide a function component expansion device, comprising: a custom function code receiving unit configured to receive a custom function code imported through a preset online data transmission interface; a code compilation mode determining unit configured to determine a code compilation mode according to the custom function code; a code compiling unit configured to compile the custom function code according to the code compilation mode to obtain a compilation result; and a custom function component generating and injecting unit configured to generate a custom function component according to the compilation result, and inject the custom function component as an expansion function component into a component library of a low-code development platform.

[0008] In a third aspect, the embodiments of the present disclosure provide an electronic device, comprising: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to implement the function component expansion method described in any of the implementations of the first aspect when executed.

[0009] In a fourth aspect, the embodiments of the present disclosure provide a non-transitory computer-readable storage medium storing computer instructions for enabling a computer to implement the function component expansion method described in any of the implementations of the first aspect when executed.

[0010] In a fifth aspect, the embodiments of the present disclosure provide a computer program product comprising a computer program, which, when executed by a processor, can implement the function component expansion method described in any of the implementations of the first aspect.

[0011] To better meet the application development needs of developers, the present disclosure provides an online expansion scheme for customizing function components, that is, by adding an online data transmission interface to import custom function code written by a user, and then through correct code compilation, encapsulation and injection steps, a custom function component corresponding to the custom function code is injected into a component library, thereby improving the secondary use efficiency of the custom function component. That is, the above technical solution adds online expansion capability of custom function components to the low-code development platform, which can fully develop the application development capability of developers, and at the same time, can fully take advantage of the low-code development capability provided by the low-code development platform to improve the development efficiency of the required functions of the target application.

[0012] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become apparent through the following description. BRIEF DESCRIPTION OF DRAWINGS

[0013] Other features, objects and advantages of the present disclosure will become more apparent through reading the following detailed description of non-limiting embodiments made with reference to the accompanying drawings:

[0014] Figure 1 is an exemplary system architecture to which the present disclosure can be applied;

[0015] Figure 2 a flowchart of a function component expansion method provided by the embodiments of the present disclosure;

[0016] Figure 3 a flowchart of a method for compiling custom function code provided by the embodiments of the present disclosure;

[0017] Figure 4 A specific self-defined functional component solution principle schematic diagram provided by the embodiment of the present disclosure;

[0018] Figure 5 A functional component expansion device structure block diagram provided by the embodiment of the present disclosure;

[0019] Figure 6 A structure schematic diagram of an electronic device suitable for executing the functional component expansion method provided by the embodiment of the present disclosure. DETAILED DESCRIPTION

[0020] Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, which include various details of the embodiments of the present disclosure to assist in understanding, and should be considered as merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Also, for the sake of clarity and conciseness, the description below omits the description of well-known functions and structures. It should be noted that the embodiments in the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0021] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information comply with relevant laws and regulations and do not violate public order and good customs.

[0022] Figure 1 An exemplary system architecture 100 of the embodiment of the functional component expansion method, device, electronic device and computer readable storage medium of the present disclosure is shown.

[0023] As shown in Figure 1 The system architecture 100 can include a terminal device 101, a network 102 and a server 103. The network 102 is a medium for providing a communication link between the terminal device 101 and the server 103. The network 102 can include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0024] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send data or instructions, etc. The terminal device 101 and the server 103 can be installed with various applications for realizing information communication between the two, such as application development applications, code writing applications, instant messaging applications, etc.

[0025] The terminal device 101 and the server 103 can be hardware or software. When the terminal device 101 is hardware, it can be various electronic devices with a display screen, including but not limited to tablets, laptop computers, desktop computers, workstations, and the like; when the terminal device 101 is software, it can be installed in the above-mentioned electronic devices, and can be implemented as multiple software or software modules, or as a single software or software module, which is not specifically limited here. When the server 103 is hardware, it can be implemented as a distributed server cluster composed of multiple servers, or as a single server; when the server is software, it can be implemented as multiple software or software modules, or as a single software or software module, which is not specifically limited here.

[0026] The server 103 can provide various services through various built-in applications. Taking an application development application that can provide low-code development services of applications as an example, the server 103 can achieve the following effects when running the application development application: first, receiving custom function code (obtained by a code writing application installed on the terminal device 101) imported by the terminal device 101 through a preset online data transmission interface; then, determining a code compilation method according to the custom function code; next, compiling the custom function code according to the code compilation method to obtain a compilation result; finally, generating a custom function component according to the compilation result, and injecting the custom function component as an extended function component into the component library of the low-code development platform.

[0027] Further, the server 103 can respond to the calling or use request of any function component in the component library by the terminal device 101.

[0028] It should be noted that the custom function code can be pre-stored in the server 103 locally in various ways in addition to being obtained from the terminal device 101 through the network 102. Therefore, when the server 103 detects that these data have been stored locally (for example, before starting the processing of the function component extension task left over), it can choose to obtain these data directly from the local storage. In this case, the example system architecture 100 can also not include the terminal device 101 and the network 102.

[0029] The function component expansion method provided by the subsequent embodiments of the present disclosure is generally executed by the server 103 carrying the low-code development platform, and accordingly, the function component expansion apparatus is generally also arranged in the server 103. However, it should also be pointed out that when the terminal device 101 also has the required computing capability and computing resources, the terminal device 101 can also complete the above-mentioned operations performed by the server 103 through the application development application installed thereon, and then output the same result as the server 103. Especially in the case where there are multiple terminal devices with different computing capabilities, but the application development application judges that the terminal device where it is located has strong computing capability and has more remaining computing resources, the terminal device can be allowed to perform the above-mentioned operations, thereby appropriately reducing the computing pressure of the server 103, and accordingly, the function component expansion apparatus can also be arranged in the terminal device 101. In this case, the exemplary system architecture 100 can also not include the server 103 and the network 102. The complete version of the low-code development platform including all function components can be deployed on the server 103, and the basic version of the low-code development platform including only some commonly used function components can be deployed on the terminal device 101.

[0030] It should be understood that Figure 1 The number of terminal devices, networks and servers in

[0031] Reference should be made to Figure 2 , Figure 2 A flowchart of a function component expansion method provided by an embodiment of the present disclosure is shown, wherein the flow 200 includes the following steps:

[0032] Step 201: receiving a custom function code imported through a preset online data transmission interface;

[0033] This step is intended to receive, by the execution subject of the function component expansion method (for example, the server 103 shown in Figure 1 ), a custom function code imported through a preset online data transmission interface.

[0034] The custom function code is a function code self-written by a user who develops an application using a low-code development platform due to the lack of required function components, and is used to construct a custom function component for implementing the required function. The custom function code can be written in a code writing application installed on a user terminal (for example, the terminal device 101 shown in Figure 1 ), and then transmitted to the above-mentioned execution subject through the network.

[0035] The low-code development platform carried on the execution subject is pre-configured with an online data transmission interface for receiving online transmission of data, and the custom function code will be imported into the low-code development platform through the online data transmission interface, so that the low-code development platform can ultimately realize the construction of corresponding custom function components by analyzing the custom function code, and finally complete the online expansion of the function components.

[0036] Step 202: determining the code compilation mode according to the custom function code;

[0037] On the basis of step 201, this step aims to determine the code compilation mode according to the custom function code by the execution subject. Since the custom function code needs to be correctly compiled before it takes effect, and for code content in different languages, different syntaxes, different formats and different requirements, it often needs to be compiled in the corresponding way to get the correct and effective compilation result, so that the compilation result can build effective custom function components.

[0038] Therefore, this step aims to determine the correct code compilation mode according to the code content contained in the custom function code by the execution subject. Taking Java program code as an example, it needs to be compiled before it can run in the virtual machine. There are three compilation modes under the Java system: front-end compilation, just-in-time compilation and static pre-compilation. Different compilation modes correspond to different effects, which can be determined flexibly according to actual needs, which will not be expanded here.

[0039] Step 203: compiling the custom function code according to the code compilation mode to obtain the compilation result;

[0040] On the basis of step 202, this step aims to compile the custom function code according to the correct code compilation mode determined by the execution subject, in order to obtain the compilation result for building custom function components.

[0041] Step 204: generating custom function components according to the compilation result, and injecting the custom function components as extended function components into the component library of the low-code development platform.

[0042] On the basis of step 203, this step aims to generate custom function components that can be normally executed or run according to the compilation result by the execution subject, and inject the custom function components as an extended component function into the component library of the low-code development platform, so that the custom function components can be queried and called in the component library in the future, and ultimately realize the development requirements that cannot be provided originally through the custom function components on the low-code platform.

[0043] The custom function component that can be normally executed or run refers to that the custom function component can normally realize various functions expected to be realized, such as being used for application development, data interaction and the like together with other function components in the low-code development platform. Specifically, the custom function component can also be attached to the low-code development platform as an independent executable application, or integrated into the low-code development platform as a plug-in.

[0044] In addition, the custom function component is injected into the component library of the low-code development platform as an extended function component, so as to be distinguished from the basic function component in the component library through the "extended function component". The operation of "injecting" not only stores the custom function component into the component library, but also provides corresponding retrieval and query functions, for example, naming the custom function component with a unique name / number, and taking the name / number as binding identity information or index information, so that the custom function component can be accurately found in the component library through the identity information or index information subsequently. In addition, in addition to the above identity information, tags such as injection time, function characteristics, developer, and usage frequency can be attached to each component, so as to provide fuzzy query functions in the case that the inquirer does not hold the identity information or index information.

[0045] To better meet the application development needs of developers, the function component extension method provided by the embodiments of the present disclosure provides an online extension scheme of the custom function component, that is, by adding an online data transmission interface to import the custom function code written by the user, and then through correct code compilation, packaging and injection steps, the custom function component corresponding to the custom function code is injected into the component library, so as to improve the secondary use efficiency of the custom function component. That is, the low-code development platform is added with the online extension capability of the custom function component through the above technical scheme, which can fully exert the application development capability of the developer, and at the same time, can fully take advantage of the low-code development capability provided by the low-code development platform to improve the development efficiency of the required function of the target application.

[0046] Please refer to Figure 3 , Figure 3 A flowchart of a method for compiling custom function code provided by the embodiments of the present disclosure is shown in FIG. 3, wherein the flow 300 includes the following steps:

[0047] Step 301: determining the code compilation mode according to the custom function code;

[0048] Step 302: judging whether the custom function code contains external dependent content, if yes, executing step 303, otherwise executing step 309;

[0049] The external dependent content refers to preconditions for normal execution of some codes in the custom function code, such as a third-party SDK (Software Development Kit), an external function, an external interface, and the like.

[0050] The reason why the step needs to determine whether the custom function code contains external dependent content is that if the existing external dependent content does not exist in the local, the custom function code will not be able to normally complete the compilation or the compiled structure will not be able to build the expected custom function component due to the missing of the dependent content. Therefore, it is necessary to ensure that the external dependent content is installed in the compilation environment before compilation when the external dependent content is found, that is, to meet the premise of normal effect of the custom function code.

[0051] Step 303: Determine the target type and target version number of the external dependent content.

[0052] The step is based on the judgment result of step 302 that the custom function code contains external dependent content, and aims to further determine the target type and target version number of the external dependent content by the above execution subject. The target type is used to distinguish different dependent contents in type, and the target version number is used to specify the specific version number of the dependent content of the target type, so as to avoid the version content difference caused by different version numbers.

[0053] Step 304: Determine whether the low-code development platform integrates the dependent content of the target type, if yes, execute step 305, otherwise execute step 307.

[0054] On the basis of step 303, the step aims to determine by the above execution subject whether the low-code development platform integrates the dependent content of the target type, and selects different processing branches according to the judgment result.

[0055] Step 305: Determine whether the version number of the dependent content of the target type integrated by the low-code development platform is the target version number, if yes, execute step 308, otherwise execute step 306.

[0056] The step is based on the judgment result of step 304 that the low-code development platform integrates the dependent content of the target type, and aims to further determine by the above execution subject whether the version number is the target version number, so as to specify whether the same dependent content has been integrated on the low-code development platform through the target type and the target version number in sequence.

[0057] Step 306: Shield the integrated dependent content of the non-target version number.

[0058] The step is based on the fact that the version number of the integrated dependency content of the target type of the low-code development platform is not the target version number, that is, the low-code development platform has integrated the same type of dependency content, but the version number is different from the target version number, so there is actually a version difference. In order to avoid the functional difference caused by the version difference as much as possible, the step aims to shield the integrated non-target version number of the dependency content by the above execution subject, so as to avoid the conflict of the non-target version number of the dependency content to the target version number of the dependency content acquired and installed subsequently.

[0059] Step 307: Acquire external dependency content;

[0060] The step is based on the fact that the judgment result of step 304 is that the low-code development platform does not integrate the dependency content of the target type, and as the next step after step 306 is executed, it aims to acquire the external dependency content of the target type and the target version number by the above execution subject in the case of missing the external dependency content.

[0061] Step 308: Modify the external call to the external dependency content in the custom function code to the local call to the integrated dependency content;

[0062] The step is based on the fact that the version number of the integrated dependency content of the target type of the low-code development platform is the target version number, which means that the low-code development platform has integrated the same dependency content as the external dependency content. Therefore, in order to avoid executing the acquisition operation of the external dependency content and improve the calling speed, the step aims to modify the external call to the external dependency content in the custom function code to the local call to the integrated dependency content by the above execution subject.

[0063] Step 309: Compile the custom function code in the code compilation mode under the compilation environment containing normally running dependency content.

[0064] The step is based on the fact that the judgment result of step 302 is that the custom function code does not contain external dependency content, and as the next step of step 308, it aims to compile the custom function code in the code compilation mode under the compilation environment containing normally running dependency content by the above execution subject.

[0065] Specifically, the compiling environment contains normal running dependent content. In the case that the custom function code does not contain external dependent content, the normal running dependent content existing in the compiling environment is from the dependent content integrated by the low-code development platform itself. In the case that the custom function code contains external dependent content and the external dependent content needs to be obtained from outside, the normal running dependent content existing in the compiling environment includes the external dependent content obtained from outside in addition to the dependent content integrated by the low-code development platform itself.

[0066] For steps 202-203 in process 200, the embodiment provides a specific implementation manner through steps 301-309, which focuses on whether the custom function code contains external dependent content that affects subsequent compilation. Different processing branches are provided according to various possibilities to ensure that the compilation operation can be correctly completed and effective compilation results can be obtained in various cases.

[0067] The embodiment provides multiple processing branches according to the set multi-layer judgment. Each judgment provides two relatively processing branches according to the judgment result. However, it should be noted that the processing manner of each pair of processing branches is not unique and fixed, and it is not necessary to perform multi-layer judgment as in the embodiment. Each processing branch can actually form a different independent embodiment with process 200. The embodiment is only an optimal embodiment that covers multiple cases and considers comprehensively.

[0068] On the basis of any of the above embodiments, in order to deepen the understanding of how to determine the code compiling manner, the embodiment further takes the custom function code for constructing a custom renderer as an example to provide a specific implementation manner: first, determine the plugin code writing manner and the style code writing manner according to the custom function code; and then, determine the code compiling manner according to the plugin code writing manner and the style code writing manner. That is, according to the function of the renderer, the plugin code and the style code inside the component are relatively important. Therefore, the embodiment will determine the appropriate code compiling manner according to the writing manner of the plugin code and the style code to improve the correctness of the determined code compiling manner. Specifically, the writing manner of the plugin code and the style code can be different.

[0069] On the basis of any of the above embodiments, the embodiment further considers the subsequent component calling problem and provides a manner for accurately indexing to the custom function component, for example, determining the identification information (for example, a unique name, a number, a specific string, etc.) of the custom function component according to the custom function code, and then injecting the identification information as the extension index of the corresponding custom function component into the index library of the component library.

[0070] Further, when the execution subject receives the component query request containing the expansion index, the custom function component in the component library can be determined according to the expansion index, and then it is judged whether the same custom function component is mounted locally, and when the custom function component is not mounted locally, the custom function component is acquired to the local, and the custom function component acquired to the local is mounted to the local low-code development platform (for example, when the browser is used as an access carrier, the custom function component can be mounted to the local browser), so as to facilitate calling through the local.

[0071] To deepen the understanding, the disclosure also combines a specific application scenario, and specifically gives a scheme of providing an expansion function component for a low-code development platform through an online mode:

[0072] The embodiment pre-configures the low-code development platform with code editors for custom component development, compilation configuration, building, debugging, version management and the like, can meet various customization of users, including framework customization, component customization, style customization, editor plug-in customization, third-party dependency customization, NPM (Node Package Manager, which is a package management tool for node, written in JavaScript, built into node) source customization; can meet development.

[0073] As shown in the code editor, the following code can be written: Figure 4

[0074] Render: custom renderer code, which is the core code of the custom component, and the UI (User Interface) and interaction function of the custom renderer are implemented based on it;

[0075] Style: custom style code, developers can write their own desired style, and online writing supports SCSS (a professional CSS extension language, CSS is the English name of Cascading Style Sheets, and the Chinese name is: Cascading Style Sheets, which is a computer language used to represent HTML (a standard general-purpose markup language) or XML (a subset of the standard general-purpose markup language) file style);

[0076] Plugin: custom editor plug-in code, if the component is a commonly used business component and the use cost is lower, a visual editor plug-in can be written online, which can help you realize the rendering and interaction of the visual configuration panel.

[0077] The main functions of the compilation configuration are as follows:

[0078] ​Dependency management: Helps developers install their desired NPM dependency packages, such as element-ui (Element-User Interface) and others;

[0079] Custom.npmrc: Supports developers customizing the.npmrc file to support the installation of some internal NPM packages.

[0080] Build triggered by the front end, and the backend handles the build through background tasks, with the following main functions:

[0081] Start logging: Used for logging the background tasks of custom component builds;

[0082] Component filtering: Filters out disabled components;

[0083] Handle vue dependencies: After component filtering, if there are compilable components, the vue dependency processing for custom components of the vue framework is needed, if there are no custom components of the vue framework, all related dependencies of vue need to be deleted, if there are custom components of the vue framework, it needs to be determined whether it is vue2.x or vue3.x, and the corresponding dependencies are added respectively, but the two versions cannot exist at the same time;

[0084] Initialize the compilation environment: The compilation environment includes package.json, webpack build configuration, source code files to be compiled, main files, etc., which are all automatically generated online;

[0085] Process module files: First clean up the environment directory, collect custom components and plugin modular entry (input), assemble custom component and editor plugin module source code, i.e. require (demand) and callback (callback), generate custom component main file index.js and editor plugin file plugins.js;

[0086] Generate source code files: Custom component source code files include renderer source code, style source code, and editor plugin files, which are written directly through node (a file format under JavaScript language) file services;

[0087] Build framework factory class files: Including jqFactory, vue3Factory, and vueFactory, their main function is to convert source code of different technology stack frameworks into React (a JavaScript library for building user interfaces);

[0088] Generate package.json: First get the platform's own package.json, then merge the user-configured third-party library, delete the existing dependencies, and avoid loading multiple dependencies with the same name;

[0089] Create tsconfig.json: Mainly for processing TS-related files, fixed configuration;

[0090] Create webpack.config.js: First handle externals, set amis, editor, layout, etc. as external dependencies to avoid repeated packaging; Then configure entry, output, module, plugins, etc. Note that for performance, components and editor plugins are separated to facilitate independent loading;

[0091] Generate.npmrc: Its role is to support user-defined NPM sources to facilitate users to import their own libraries;

[0092] Start building: Determine if installation is needed to avoid unnecessary loss, if needed, execute npminstall command for environment installation, then execute webpack for compilation;

[0093] Compile output processing: After compilation, encapsulate the compiled custom components and editor plugin files, respectively inject amisMakeModBridge and editorMakeModBridge (two injection functions) to support the current low-code development platform, and generate a unique key. Store the key in customComponentsSrc and customPluginsSrc, and finally store it in the database.

[0094] After building, to make custom components take effect immediately, the following processing is required:

[0095] Mount the compiled file: After the backend handles the build, the frontend listens for updates to customComponentsSrc and customPluginsSrc. If an update is detected, execute the mounting of the new JS script, that is, inject the JS script into the current page template through the script tag;

[0096] Load JS script: After mounting, amisMakeModBridge and editorMakeModBridge will be executed automatically, and the front end will register custom component renderers and custom editor plugins in amis renders and editor plugins, respectively, that is, registerCustomCmpts and registerCustomPlugins are executed, at which time the developer can call in the platform.

[0097] In addition to the online expansion method given above, a ready-to-use custom component development framework can be provided for developers who are more accustomed to developing with their own front-end IDE (Integrated Development Environment). This method can be referred to as local expansion, which mainly includes:

[0098] Basic development framework: The basic development framework mainly includes React, Vue, JQuery, TS, AMIS, AMIS Editor, and additionally provides local debugging templates based on react-router and react-scripts;

[0099] Development engineering structure specification: According to the technology stack and component category specification, automatic identification during construction is facilitated;

[0100] Build and package tools: After development is completed, run the npm run build command, and the construction process supports automatic identification of custom component source files and dependency relationships in the project, and provides specification checks, type analysis to generate JSON source files that can be recognized by the code development platform, and compression into a zip file;

[0101] The packaged custom component zip package can be directly imported into the local low-code development platform for use.

[0102] In simple terms, the local expansion method requires developers to encapsulate and package the local IDE according to the recognition standard provided by the low-code development platform, so that it can be correctly recognized by the low-code development platform after being imported, and then accurately play its functional characteristics.

[0103] For further reference Figure 5 , as an implementation of the method shown in the above figures, the present disclosure provides an embodiment of a functional component expansion device, which corresponds to the method embodiment shown in Figure 2 , and the device can be applied in various electronic devices.

[0104] As shown in Figure 5As shown, the function component expansion apparatus 500 of the embodiment can include: a custom function code receiving unit 501, a code compilation mode determining unit 502, a code compiling unit 503, and a custom function component generating and injecting unit 504. The custom function code receiving unit 501 is configured to receive custom function code imported through a preset online data transmission interface. The code compilation mode determining unit 502 is configured to determine a code compilation mode according to the custom function code. The code compiling unit 503 is configured to compile the custom function code according to the code compilation mode to obtain a compilation result. The custom function component generating and injecting unit 504 is configured to generate a custom function component according to the compilation result, and inject the custom function component as an expansion function component into a component library of a low-code development platform.

[0105] In the embodiment, the specific processing of the custom function code receiving unit 501, the code compilation mode determining unit 502, the code compiling unit 503, and the custom function component generating and injecting unit 504 in the function component expansion apparatus 500 and the technical effects brought by the specific processing can be respectively referred to Figure 2 The related description of steps 201-204 in the corresponding embodiment will not be repeated here.

[0106] In some optional implementation manners of the embodiment, the function component expansion apparatus 500 can further include:

[0107] The identity information determining unit is configured to determine identification information of the custom function component according to the custom function code.

[0108] The expansion index injecting unit is configured to inject the identification information as an expansion index of the corresponding custom function component into an index library of the component library.

[0109] In some optional implementation manners of the embodiment, the function component expansion apparatus 500 can further include:

[0110] The component query request processing unit is configured to, in response to receiving a component query request containing an expansion index, determine a custom function component in the component library according to the expansion index.

[0111] The local mounting unit is configured to, in response to the local not mounting the custom function component, obtain the custom function component to the local, and mount the custom function component obtained to the local to the local low-code development platform.

[0112] In some optional implementation manners of the embodiment, the function component expansion apparatus 500 can further include:

[0113] The external dependency content obtaining unit is configured to, in response to the custom function code containing external dependency content, obtain the external dependency content before compiling the custom function code in the code compilation manner, and control the external dependency content to normally run in a compilation environment.

[0114] The code compiling unit 503 can be further configured to:

[0115] compile the custom function code in the code compilation manner in the compilation environment containing the normally running external dependency content.

[0116] In some optional implementation manners of the embodiment, the external dependency content obtaining unit can be further configured to:

[0117] in response to the custom function code containing external dependency content, determine a target type and a target version number of the external dependency content;

[0118] in response to the low-code development platform not integrating dependency content of the target type, perform the step of obtaining the external dependency content;

[0119] in response to the low-code development platform integrating dependency content of the target type and having a version number different from the target version number, perform the step of obtaining the external dependency content after shielding the integrated dependency content of the non-target version number.

[0120] In some optional implementation manners of the embodiment, the function component expansion apparatus 500 can further include:

[0121] The calling modifying unit is configured to, in response to the custom function code containing external dependency content and the low-code development platform integrating the same dependency content, modify external calling of the external dependency content in the custom function code to local calling of the integrated dependency content before compiling the custom function code in the code compilation manner.

[0122] In some optional implementation manners of the embodiment, the code compiling unit 503 can be further configured to:

[0123] in response to the custom function code being used to build a custom renderer, determine a plug-in code writing manner and a style code writing manner according to the custom function code;

[0124] determine the code compilation manner according to the plug-in code writing manner and the style code writing manner.

[0125] The embodiment as the device embodiment corresponding to the above-mentioned method embodiment exists.

[0126] To better meet the application development needs of developers, the functional component extension device provided in this disclosure offers an online extension solution for custom functional components. This involves adding an online data transmission interface to import user-written custom functional code, and then, through correct code compilation, encapsulation, and injection steps, injecting the custom functional component corresponding to the custom functional code into the component library, thereby improving the efficiency of secondary retrieval of the custom functional component. In other words, this technical solution adds online extension capabilities for custom functional components to the low-code development platform, fully leveraging developers' application development capabilities and utilizing the low-code development capabilities provided by the platform to improve the efficiency of developing the required functions for the target application.

[0127] According to embodiments of the present disclosure, the present disclosure also provides an electronic device, the electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to implement the functional component extension method described in any of the above embodiments when executed.

[0128] According to embodiments of this disclosure, this disclosure also provides a readable storage medium storing computer instructions that enable a computer to implement the functional component extension method described in any of the above embodiments when executed.

[0129] According to embodiments of this disclosure, this disclosure also provides a computer program product that, when executed by a processor, can implement the functional component extension method described in any of the above embodiments.

[0130] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0131] like Figure 6As shown, the device 600 includes a computing unit 601 that can perform various appropriate actions and processes in accordance with a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from the storage unit 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the device 600 can also be stored in the RAM 603. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0132] Various components in the device 600 are connected to the I / O interface 605, including an input unit 606, such as a keyboard, a mouse, etc., an output unit 607, such as various types of displays, speakers, etc., a storage unit 608, such as a magnetic disk, an optical disk, etc., and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.

[0133] The computing unit 601 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 601 performs various methods and processes described above, such as the functional component expansion method. For example, in some embodiments, the functional component expansion method can be implemented as a computer software program that is tangibly embodied in a machine-readable medium, such as the storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the functional component expansion method described above can be performed. Alternatively, in other embodiments, the computing unit 601 can be configured to perform the functional component expansion method by any other appropriate means, such as by means of firmware.

[0134] The various embodiments of the systems and techniques described above can be implemented in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a load programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0135] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces the functions / operations specified in the flowcharts and / or the block diagrams. The program code can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package, or entirely on a remote machine or server.

[0136] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0137] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0138] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0139] The computer system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. A server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of large management difficulty and weak business scalability in traditional physical host and virtual private server (VPS, Virtual Private Server) services.

[0140] To better meet the application development needs of developers, the embodiment of the present disclosure provides an online expansion scheme of a custom function component, that is, by adding an online data transmission interface to import the custom function code written by the user, and then through correct code compilation, encapsulation and injection steps, the custom function component corresponding to the custom function code is injected into the component library, thereby improving the secondary use efficiency of the custom function component. That is, the above technical scheme adds the online expansion capability of the custom function component to the low-code development platform, which can fully develop the application development capability of the developer, and at the same time, can fully rely on the low-code development capability provided by the low-code development platform to improve the development efficiency of the required function of the target application.

[0141] It should be understood that the steps can be reordered, added, or deleted using the various forms of flow shown above. For example, the steps described in the present disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, which is not limited herein.

[0142] The above specific embodiments do not constitute a limitation on the protection scope of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A method for extending a functional component, comprising: Receive custom function code imported through a preset online data transmission interface; In response to the custom function code used to build a custom renderer, the plugin code writing method and style code encoding method are determined based on the custom function code; The code compilation method is determined based on the plugin code writing method and the style code encoding method. In response to the fact that the custom function code contains external dependencies, determine the target type and target version number of the external dependencies; In response to the low-code development platform not integrating the target type of dependency content, external dependency content is obtained; in response to the low-code development platform integrating dependency content of the target type but with a version number different from the target version number, after disabling the integrated dependency content with a non-target version number, external dependency content is obtained; wherein, the target type is used to distinguish different dependency content by type, and the target version number is used to specify the specific version number of the dependency content of the target type; Control the external dependencies to run correctly in the compilation environment; In a compilation environment that includes external dependencies that allow for normal operation, the custom function code is compiled according to the code compilation method described above to obtain the compilation result; Custom functional components are generated based on the compilation results, and these custom functional components are injected into the component library of the low-code development platform as extended functional components.

2. The method according to claim 1, further comprising: The identification information of the custom function component is determined based on the custom function code; The identification information is injected into the index library of the component library as an extended index of the corresponding custom functional component.

3. The method according to claim 2, further comprising: In response to receiving a component query request containing the extended index, the custom functional component in the component library is determined based on the extended index; In response to the fact that the custom functional component is not mounted locally, the custom functional component is obtained locally and mounted locally on the local low-code development platform.

4. The method according to claim 1, wherein, Before compiling the custom function code according to the code compilation method, the method further includes: In response to the fact that the custom function code contains external dependencies and the low-code development platform integrates the same dependencies, the external calls to the external dependencies in the custom function code are modified to local calls that integrate the dependencies.

5. A functional component expansion device, comprising: The custom function code receiving unit is configured to receive custom function codes imported through a preset online data transmission interface; The code compilation method determination unit is configured to respond to the custom function code for building a custom renderer and determine the plugin code writing method and style code writing method based on the custom function code. The code compilation method is determined based on the plugin code writing method and the style code writing method; The external dependency content acquisition unit is configured to determine the target type and target version number of the external dependency content in response to the custom function code containing external dependency content; In response to the low-code development platform not integrating the target type of dependency content, the external dependency content is obtained; in response to the low-code development platform integrating dependency content of the target type but with a version number different from the target version number, the external dependency content is obtained after disabling the integrated dependency content with a non-target version number; wherein, the target type is used to distinguish different dependency content by type, and the target version number is used to specify the specific version number of the dependency content of the target type; the external dependency content is controlled to run normally in the compilation environment; The code compilation unit is configured to compile the custom function code in a compilation environment containing external dependencies that allow for normal operation, according to the code compilation method, to obtain the compilation result; The custom functional component generation and injection unit is configured to generate custom functional components based on the compilation results, and inject the custom functional components as extended functional components into the component library of the low-code development platform.

6. The apparatus according to claim 5, further comprising: The identity information determination unit is configured to determine the identification information of the custom function component based on the custom function code; The extended index injection unit is configured to inject the identification information as an extended index of the corresponding custom functional component into the index library of the component library.

7. The apparatus according to claim 6, further comprising: The component query request processing unit is configured to, in response to receiving a component query request containing the extended index, determine the custom functional component in the component library based on the extended index; The local mounting unit is configured to, in response to the fact that the custom functional component is not mounted locally, obtain the custom functional component locally, and mount the obtained custom functional component locally to the local low-code development platform.

8. The apparatus according to claim 5, further comprising: The calling method modification unit is configured to, before compiling the custom function code according to the code compilation method, in response to the custom function code containing external dependency content and the low-code development platform integrating the same dependency content, modify the external call to the external dependency content in the custom function code to a local call to the integrated dependency content.

9. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the functional component expansion method according to any one of claims 1-4.

10. A non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the functional component extension method according to any one of claims 1-4.

11. A computer program product comprising a computer program that, when executed by a processor, implements the steps of the functional component extension method according to any one of claims 1-4.

Citation Information

Patent Citations

  • Visual component extension method, visual component extension device, electronic equipment and storage medium

    CN107577515A

  • Method and system for establishing front end project through global command line

    CN108536431A

  • Component-based development method and system

    CN109146251A

  • Front-end source code compiling method and device, storage medium and computer device

    CN109766099A

  • Compiling method and device

    CN110134399A