CN118377476A - Online development and loading method and device of component, electronic equipment and storage medium - Google Patents

Online development and loading method and device of component, electronic equipment and storage medium Download PDF

Info

Publication number
CN118377476A
CN118377476A CN202410510353.XA CN202410510353A CN118377476A CN 118377476 A CN118377476 A CN 118377476A CN 202410510353 A CN202410510353 A CN 202410510353A CN 118377476 A CN118377476 A CN 118377476A
Authority
CN
China
Prior art keywords
component
code
target
codes
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410510353.XA
Other languages
Chinese (zh)
Inventor
邱云
牛杰
周晓东
唐辉
余蛟龙
张平
何雨芮
杨辰
葛晓波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Eoi Information Technology Co ltd
Original Assignee
Shanghai Eoi Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Eoi Information Technology Co ltd filed Critical Shanghai Eoi Information Technology Co ltd
Priority to CN202410510353.XA priority Critical patent/CN118377476A/en
Publication of CN118377476A publication Critical patent/CN118377476A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Stored Programmes (AREA)

Abstract

The application discloses an online development and loading method and device of a component, electronic equipment and a storage medium. The method comprises the following steps: determining component information corresponding to a target component, and determining component codes corresponding to the target component according to the component information, wherein the component codes are codes developed based on specification quotation and export package corresponding to function key word combination, and the component codes comprise dependent codes and codes to be converted; executing the dependent code and obtaining a dependent execution result, determining a first global variable, and adding the dependent execution result to the first global variable to obtain a target global variable; converting the code to be converted according to the function key word combination to obtain a target conversion code; the method and the device can realize online loading of the target component corresponding to the component code developed online according to the user requirement and improve the efficiency of online loading of the component.

Description

Online development and loading method and device of component, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer application technologies, and in particular, to a method and apparatus for online development and loading of a component, an electronic device, and a storage medium.
Background
Currently, a large-screen visualization platform comprises a plurality of visualization components, and along with the expansion of field application of the visualization components, the requirement for on-site on-line adjustment of component functions is generally met.
In the related art, the code of the whole platform is usually obtained first, then the code development, namely the function adjustment, is carried out on the component, and the version of the whole platform where the component is located needs to be updated again after the function adjustment of the component, so that the complexity of on-site on-line operation is higher, the loading time of the component is longer, and the efficiency is poorer, and therefore, the on-line development and loading method of the component with high efficiency is lacking at present.
Disclosure of Invention
The invention provides an on-line development and loading method and device of a component, electronic equipment and a storage medium, which are used for solving the problem that the on-line development and loading method of the component with high efficiency is lacking at present.
According to an aspect of the present invention, there is provided an on-line development and loading method of a component, wherein the method includes:
Determining component information corresponding to a target component in response to loading operation corresponding to the target component, and determining component codes corresponding to the target component according to the component information, wherein the component codes are codes developed based on specification references and export packages corresponding to function key combinations, the component codes comprise dependent codes and codes to be converted, and third party packages on which the target component depends are defined in the dependent codes;
Executing the dependent code and obtaining a dependent execution result, determining a first global variable, and adding the dependent execution result to the first global variable to obtain a target global variable;
Determining a function keyword combination in the code to be converted, and converting the code to be converted according to the function keyword combination to obtain a target conversion code;
And determining a target execution code based on the target global variable and the target conversion code, and executing the target execution code to obtain the target component with the completed loading.
According to another aspect of the present invention, there is provided an on-line development and loading apparatus of a component, wherein the apparatus includes:
The code acquisition module is used for responding to loading operation corresponding to a target component, determining component information corresponding to the target component and determining component codes corresponding to the target component according to the component information, wherein the component codes are codes developed based on specification reference and export package corresponding to function key word combinations, the component codes comprise dependent codes and codes to be converted, and a third party package on which the target component depends is defined in the dependent codes;
The dependency processing module is used for executing the dependency code and obtaining a dependency execution result, determining a first global variable, and adding the dependency execution result to the first global variable to obtain a target global variable;
the code conversion module is used for determining a function keyword combination in the code to be converted, and converting the code to be converted according to the function keyword combination to obtain a target conversion code;
And the code execution module is used for determining target execution codes based on the target global variable and the target conversion codes, executing the target execution codes and obtaining the target assembly after loading.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the on-line development and loading method of components of any one of the embodiments of the invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute the on-line development and loading method of components according to any of the embodiments of the present invention.
According to the technical scheme, component information corresponding to a target component is determined by responding to loading operation corresponding to the target component, and component codes corresponding to the target component are determined according to the component information, wherein the component codes are codes developed based on specification quotes and export packages corresponding to function key word combinations, the component codes comprise dependent codes and codes to be converted, and a third party package on which the target component depends is defined in the dependent codes; executing the dependent code and obtaining a dependent execution result, determining a first global variable, and adding the dependent execution result to the first global variable to obtain a target global variable; determining a function keyword combination in the code to be converted, and converting the code to be converted according to the function keyword combination to obtain a target conversion code; and determining a target execution code based on the target global variable and the target conversion code, and executing the target execution code to obtain the target component with the completed loading. According to the technical scheme of the embodiment of the invention, the target components corresponding to the component codes developed on line according to the user requirements can be loaded on line, and the effect of improving the on-line loading efficiency of the components can be achieved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for online development and loading of a component according to a first embodiment of the present invention;
FIG. 2 is a flow chart of a method for online development and loading of a component according to a second embodiment of the present invention;
FIG. 3 is a flow chart of a method for online development and loading of a component provided in accordance with a third embodiment of the present invention;
FIG. 4 is a schematic structural diagram of an on-line development and loading device for a component according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device implementing an on-line development and loading method of components according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of an online development and loading method of a component according to an embodiment of the present invention, where the method may be performed by an online development and loading device of the component, and the online development and loading device of the component may be implemented in hardware and/or software, and the online development and loading device of the component may be configured in a computer. As shown in fig. 1, the method includes:
s110, determining component information corresponding to a target component in response to loading operation corresponding to the target component, and determining component codes corresponding to the target component according to the component information, wherein the component codes are codes developed based on specification reference and export package corresponding to function key word combination, the component codes comprise dependent codes and codes to be converted, and a third party package on which the target component depends is defined in the dependent codes.
Wherein the target component may be understood as a target loading component. The target component is the object of the load operation. In the embodiment of the present invention, the target component may be preset according to a scene requirement, which is not specifically limited herein. Alternatively, the target component may include a web front-end component such as an icon, a map, a table, and a decoration having a three-dimensional (3D) rendering effect.
The loading operation may be understood as an operation of loading the target component. In the embodiment of the present invention, the loading operation may be preset according to a scene requirement, which is not specifically limited herein. Optionally, the loading operation may be a trigger operation for a display flag corresponding to the target component, where the trigger operation may include a single click operation or a double click operation.
The component information may be understood as attribute information of the target component. In the embodiment of the present invention, the component information may be preset according to a scene requirement, which is not specifically limited herein. Optionally, the component information may include a component identification and a component version. Wherein the component identity may be understood as a unique identity characterizing the target component. The component version may be understood as a version of the target component.
The component code may be understood as code corresponding to the target component. In an embodiment of the present invention, the component code includes dependent code and code to be converted. Alternatively, the code to be converted may include common data structure code, non-common data structure code, component configuration code, and renderer code. That is, the component code corresponding to the target component may include dependency code, common data structure code, non-common data structure code, component configuration code, and renderer code five-part code.
Wherein, the common data structure code defines a code definition common to the target components for uniform updating of the code definition. And defining a third party package on which the target component depends in the dependent code, wherein the third party package is loaded through the amd specification. Default configuration parameters for the target component are defined in the non-common data structure code. The component configuration code defines a parameter panel configuration of the target component. The renderer code of the target component is defined therein, and may refer to other partial codes (at least one of the dependency code, the common data structure code, the non-common data structure code, and the component configuration code), which is equivalent to the entry file.
The function key combination may be understood as a combination of keys related to the function of the target component. In an embodiment of the present invention, the functional keyword combination includes at least two keywords. Alternatively, the function key combination may include an import function key and an export function key.
The dependent code may be understood as code defining a third party package on which the target component depends.
The code to be converted may be understood as a code to be converted. Alternatively, the code to be converted may be code to be converted based on the function key combination. In the embodiment of the invention, the code to be converted can be a code which cannot be directly identified by a platform browser. The purpose of converting the code to be converted may be to convert the code to be converted into target conversion code that can be identified by a platform browser.
The third party package may be understood as a package comprising developed completed component functions.
S120, executing the dependent code and obtaining a dependent execution result, determining a first global variable, and adding the dependent execution result to the first global variable to obtain a target global variable.
Wherein the dependent execution result may be understood as an execution result of the dependent code. Optionally, the dependent execution result may include a variable and/or an object. Illustratively, the dependent execution result may be a react variable.
The first global variable may be understood as a global variable that is executable by the platform browser. Illustratively, the first global variable may be modules.
The target global variable may be understood as a global variable obtained by adding the dependent execution result to the first global variable. In the case where the dependent execution result is compact, the first global variable is modules,
The target global variable may be windows.
S130, determining a function keyword combination in the code to be converted, and converting the code to be converted according to the function keyword combination to obtain a target conversion code.
In the embodiment of the invention, the component code refers to and derives the code developed by the package based on the specification corresponding to the function key combination. Thus, the component code includes a combination of functional keywords. Optionally, the function key combination includes an import function key and/or an export function key.
The import function keyword may be understood as a keyword having an import function. Illustratively, the import function key may be import.
The export function key may be understood as a key having an import function. Illustratively, the export function key may be export.
The target conversion code may be understood as a code obtained by converting the code to be converted based on the function key combination. In the embodiment of the invention, the target conversion code is a code which can be identified by a platform browser.
And S140, determining a target execution code based on the target global variable and the target conversion code, and executing the target execution code to obtain the target component with the loaded target component.
Wherein the target execution code may be understood as code executed in a group. In the embodiment of the invention, the target execution code comprises all functions in the component code.
Optionally, the executing the target execution code obtains the target component with the completed loading, including:
Executing the target execution code to obtain a code execution result;
and determining a third global variable, storing the code execution result through the third global variable, and calling the third global variable which has stored the code execution result to obtain the target component after loading.
Wherein the code execution result may be understood as an execution result of the target execution code.
The third global variable may be understood as a global variable that is executable by the platform browser. Illustratively, the third global variable may be modules.
In the embodiment of the present invention, after the loading completes the target component, the method further includes: rendering displays the target component.
According to the technical scheme, component information corresponding to a target component is determined by responding to loading operation corresponding to the target component, and component codes corresponding to the target component are determined according to the component information, wherein the component codes are codes developed based on specification quotes and export packages corresponding to function key word combinations, the component codes comprise dependent codes and codes to be converted, and a third party package on which the target component depends is defined in the dependent codes; executing the dependent code and obtaining a dependent execution result, determining a first global variable, and adding the dependent execution result to the first global variable to obtain a target global variable; determining a function keyword combination in the code to be converted, and converting the code to be converted according to the function keyword combination to obtain a target conversion code; and determining a target execution code based on the target global variable and the target conversion code, and executing the target execution code to obtain the target component with the completed loading. According to the technical scheme of the embodiment of the invention, the target components corresponding to the component codes developed on line according to the user requirements can be loaded on line, and the effect of improving the on-line loading efficiency of the components can be achieved.
Example two
Fig. 2 is a flowchart of an online development and loading method of a component according to a second embodiment of the present invention, where the embodiment is directed to converting the code to be converted according to the functional key combination in the foregoing embodiment, so as to refine the target conversion code. As shown in fig. 2, the method includes:
S210, determining component information corresponding to a target component in response to loading operation corresponding to the target component, and determining component codes corresponding to the target component according to the component information, wherein the component codes are codes for referencing and exporting package development based on specifications corresponding to function key word combinations, and the component codes comprise dependent codes and codes to be converted.
S220, executing the dependent code and obtaining a dependent execution result, determining a first global variable, and adding the dependent execution result to the first global variable to obtain a target global variable.
S230, determining the function keyword combination in the code to be converted.
Optionally, the function key combination includes an import function key and/or an export function key. Illustratively, the import function key may be import. The export function key may be export.
S240, aiming at the code to be converted, converting the imported function keywords into defined variable keywords, and converting the imported position keywords corresponding to the imported function keywords into second global variables.
Wherein, the definition variable keyword may be understood as a keyword of a definition variable. In the embodiment of the invention, the definition variable keywords can be keywords identifiable by a platform browser. Illustratively, the defined variable key may be const.
The import location key may be understood as a key associated with the import function key that characterizes the import location. In the case where the import function key is import, the import location key may be from.
The second global variable may be understood as a global variable that is executable by the platform browser. The first global variable and the second global variable may be the same type of global variable. Illustratively, the second global variable may be modules.
Specifically, under the condition of the imports existing in the component codes, the import function keywords imports are converted into definition variable keywords const which can be operated by the platform browser; the import location key from is converted into a second global variable modules.
S250, determining an export command corresponding to the export function key word, and converting the export command into an export expression loadable by the platform browser.
Wherein the export command may be understood as an export command associated with the export function key. Optionally, the export command includes at least one of an declaration variable, a declaration function, and an export command corresponding to a default key.
Illustratively, in the case where the export function key is export, the export command corresponding to the declaration variable may be export (const|var|let), the export command corresponding to the declaration function may be export function xxx, and the export command corresponding to the default key may be export default.
The derived expression may be understood as an expression that is executable by a platform browser.
Specifically, converting the export command into the export expression may include the following:
Converting export (const|var|let) to export;
Converting export function xxx to export. Xxx=function xxx () { };
Export defaults are converted to export.
S260, determining the target conversion code according to the definition variable key word, the second global variable and the derived expression.
Specifically, the target conversion code corresponding to the code to be converted is obtained according to the definition variable keyword, the second global variable and the derived expression.
S270, determining a target execution code based on the target global variable and the target conversion code, and executing the target execution code to obtain the target component with the loaded target component.
According to the technical scheme of the embodiment of the invention, the imported function keywords are converted into the defined variable keywords by aiming at the codes to be converted, and the imported position keywords corresponding to the imported function keywords are converted into the second global variables; determining an export command corresponding to the export function keyword, and converting the export command into an export expression loadable by a platform browser; and determining the target conversion code according to the definition variable key, the second global variable and the derived expression. The method and the system realize the effect of converting component codes developed based on the specification reference and export package corresponding to the function key combination into target conversion codes loadable by a platform browser.
Example III
Fig. 3 is a flowchart of an online development and loading method of a component according to a third embodiment of the present invention, where in this embodiment, the adding is performed in response to a loading operation corresponding to a target component in the foregoing embodiment. As shown in fig. 3, the method includes:
S310, determining original edition components in a target platform, and acquiring original edition codes corresponding to the original edition components on line in a component development function of the target platform.
Wherein the target platform may be understood as a platform on which the target component is loaded.
The master component may be understood as a component of a historical version corresponding to the target component. The master code may be understood as the code to which the master component corresponds.
The component development function may be understood as a tool that defines code corresponding to an available component in the target platform. Based on the component development function, the original edition code corresponding to the original edition component can be directly and only obtained independently of the bottom layer code of the target platform, and the code development of the original edition code is realized.
S320, determining the component code in response to an online development operation for the original edition code.
Wherein the online development operation can be understood as an operation of developing the original code online. In an embodiment of the present invention, the online development operation may be an operation of adjusting the original code.
The component code may be understood as code obtained after online development of the original code.
S330, determining the component information corresponding to the component code, associating the component information with the component code, and storing the component information in a database, wherein the component information comprises a component identifier and/or a component version.
Wherein the database may be understood as a database storing the component code.
The component information may be understood as attribute information based on the target component to which the component code corresponds. In the embodiment of the present invention, the component information may be preset according to a scene requirement, which is not specifically limited herein. Optionally, the component information may include a component identification and a component version. Wherein the component identity may be understood as a unique identity characterizing the target component. The component version may be understood as a version of the target component.
Wherein said associating said component information with said component code may comprise: the component identity, the component version, and the component code are associated.
Optionally, the determining, according to the component information, the component code corresponding to the target component includes:
and acquiring the component codes corresponding to the component identifiers and the component versions from the database through a back-end interface.
Specifically, in response to a loading operation corresponding to a target component, determining the component identifier and the component version corresponding to the target component, and acquiring the associated component code with the component identifier and the component version from the database through a back-end interface.
S340, determining component information corresponding to a target component in response to loading operation corresponding to the target component, and determining component codes corresponding to the target component according to the component information, wherein the component codes are codes for referencing and exporting package development based on specifications corresponding to function key word combinations, and the component codes comprise dependent codes and codes to be converted.
S350, executing the dependent code and obtaining a dependent execution result, determining a first global variable, and adding the dependent execution result to the first global variable to obtain a target global variable.
S360, determining a function keyword combination in the code to be converted, and converting the code to be converted according to the function keyword combination to obtain a target conversion code.
And S370, determining a target execution code based on the target global variable and the target conversion code, and executing the target execution code to obtain the loaded target component.
According to the technical scheme, original edition codes corresponding to original edition components are obtained on line in a component development function of a target platform by determining the original edition components in the target platform; determining the component code in response to an online development operation for the original code; and determining the component information corresponding to the component code, associating the component information with the component code, and storing the component information and the component code in a database, wherein the component information comprises a component identifier and/or a component version. The method solves the problem that the operation flow of a method for realizing component loading is quite complicated by acquiring the platform code of a platform where the component is positioned firstly, determining the corresponding component code of the component based on the platform code and then reissuing the version of the platform after developing the component code.
The invention can carry out online development (function adjustment) on the component based on the component development function defined in the platform, and can carry out version management, namely if the function of the component needs to be updated, the online development and loading of the component can be realized by only modifying the code of the component based on the component development function defined in the platform, thereby improving the convenience of online development of the component, improving the online loading efficiency of the component and improving the user experience.
The invention provides an overall flow of an online development and loading method of a component. The method comprises the following steps:
Alternatively, the target component of the present invention may be a web front-end component. Specifically, when defining the web front-end component, the invention can split the function of the component into five partial codes of a public data structure, a dependency, a non-public data structure, component configuration and a renderer, and define the partial codes respectively, wherein the public data structure defines the code definition common to the target component and is used for uniformly updating the code definition. A third party package on which the target component depends is defined in the dependent code, wherein the third party package is loaded through the amd specification. Default configuration parameters for the target component are defined in the non-common data structure code. The component configuration code defines the parameter panel configuration of the target component. The renderer code defines the rendering code of the target component, the renderer code can refer to other partial codes (at least one code of dependence, public data structure, non-public data structure and component configuration), and the renderer is equivalent to an entry file; component code can reference and export packages with the import and exporter specifications of the JavaScript language standard (ECMAScript 6, es 6).
Specifically, the flow of loading the target component online may be as follows, where the execution body may be a platform front end:
1. acquiring a component code defined in a database through a back-end interface according to a component identifier (e.g. id) and a component version of a target component;
2. after obtaining the component code, firstly loading the dependent code of the target component through requirejs, and putting the dependent execution result corresponding to the loaded dependent code into a global variable (namely the first global variable) to obtain a target global variable (for example, window. Modules [' exact ], wherein modules is the first global variable, and the exact variable is the dependent execution result);
3. compiling four partial codes (i.e. to-be-converted codes) of a common data structure, a non-common data structure, a component configuration and a renderer respectively:
If an import exists in the code to be converted (i.e., the import function key), converting the import into a runnable variable (i.e., defining a variable key, such as const), and converting from corresponding to the import into a global variable modules (i.e., the second global variable);
if export (i.e. the derived functional key) exists in the code to be converted, conversion is performed based on the following rule:
Converting export (const|var|let) to export;
Converting export function xxx to export. Xxx=function xxx () { };
Converting export defaults into export. Defaults=;
4. Executing the converted component code by a code execution function (e.g., eval function), and storing the code execution result by a third global variable; and calling a third global variable of the stored code execution result, and loading and rendering the target component.
The application discloses a method for online development and loading of a web front-end component, which can define a target component in a component development function of a platform, conduct online development on the target component, conduct multi-version management, realize that when a user has a component function updating requirement, component codes can be directly developed (or modified) in the platform, and enable the regulated codes to take effect.
Example IV
Fig. 4 is a schematic structural diagram of an on-line development and loading device for a component according to a fourth embodiment of the present invention. As shown in fig. 4, the apparatus includes: code acquisition module 410, dependency processing module 420, code conversion module 430, and code execution module 440. Wherein,
A code obtaining module 410, configured to determine component information corresponding to a target component in response to a loading operation corresponding to the target component, and determine a component code corresponding to the target component according to the component information, where the component code is a code for referencing and exporting packet development based on a specification corresponding to a function key combination, the component code includes a dependent code and a code to be converted, and a third party packet on which the target component depends is defined in the dependent code; the dependency processing module 420 is configured to execute the dependency code and obtain a dependency execution result, determine a first global variable, and add the dependency execution result to the first global variable to obtain a target global variable; the code conversion module 430 is configured to determine a function keyword combination in the code to be converted, and convert the code to be converted according to the function keyword combination to obtain a target conversion code; and a code execution module 440, configured to determine a target execution code based on the target global variable and the target conversion code, and execute the target execution code to obtain the target component after loading.
According to the technical scheme, component information corresponding to a target component is determined by responding to loading operation corresponding to the target component, and component codes corresponding to the target component are determined according to the component information, wherein the component codes are codes developed based on specification quotes and export packages corresponding to function key word combinations, the component codes comprise dependent codes and codes to be converted, and a third party package on which the target component depends is defined in the dependent codes; executing the dependent code and obtaining a dependent execution result, determining a first global variable, and adding the dependent execution result to the first global variable to obtain a target global variable; determining a function keyword combination in the code to be converted, and converting the code to be converted according to the function keyword combination to obtain a target conversion code; and determining a target execution code based on the target global variable and the target conversion code, and executing the target execution code to obtain the target component with the completed loading. According to the technical scheme of the embodiment of the invention, the target components corresponding to the component codes developed on line according to the user requirements can be loaded on line, and the effect of improving the on-line loading efficiency of the components can be achieved.
Optionally, the code to be converted includes common data structure code, non-common data structure code, component configuration code, and renderer code.
Optionally, the function keyword combination includes an import function keyword and/or an export function keyword; the transcoding module 430 includes: an import conversion unit, an export conversion unit, and a conversion combination unit; wherein,
The import conversion unit is used for converting the import function key words into definition variable key words aiming at the code to be converted, and converting the import position key words corresponding to the import function key words into second global variables;
The export conversion unit is used for determining an export command corresponding to the export function key word and converting the export command into an export expression loadable by a platform browser;
The conversion combination unit is used for determining the target conversion code according to the definition variable keyword, the second global variable and the derived expression.
Optionally, the export command includes at least one of an declaration variable, a declaration function, and an export command corresponding to a default key.
Optionally, the on-line development and loading device of the component further comprises: the original edition code acquisition module, the online development module and the code storage module; wherein,
The original edition code acquisition module is used for determining original edition components in a target platform before responding to loading operation corresponding to the target components and acquiring original edition codes corresponding to the original edition components on line in a component development function of the target platform;
The online development module is used for responding to online development operation for the original edition code and determining the component code;
The code storage module is used for determining the component information corresponding to the component code, associating the component information with the component code and storing the component information and the component code in a database, wherein the component information comprises a component identifier and/or a component version.
Optionally, the code obtaining module 410 is configured to:
and acquiring the component codes corresponding to the component identifiers and the component versions from the database through a back-end interface.
Optionally, the code execution module 440 is configured to:
Executing the target execution code to obtain a code execution result;
and determining a third global variable, storing the code execution result through the third global variable, and calling the third global variable which has stored the code execution result to obtain the target component after loading.
The on-line development and loading device for the components provided by the embodiment of the invention can execute the on-line development and loading method for the components provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example five
Fig. 5 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 5, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as on-line development and loading of components.
In some embodiments, the online development and loading method of the components may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the online development and loading method of the components described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the online development and loading method of the components in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may 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. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background 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 background, 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: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically 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. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. An on-line development and loading method of a component, comprising:
Determining component information corresponding to a target component in response to loading operation corresponding to the target component, and determining component codes corresponding to the target component according to the component information, wherein the component codes are codes developed based on specification references and export packages corresponding to function key combinations, the component codes comprise dependent codes and codes to be converted, and third party packages on which the target component depends are defined in the dependent codes;
Executing the dependent code and obtaining a dependent execution result, determining a first global variable, and adding the dependent execution result to the first global variable to obtain a target global variable;
Determining a function keyword combination in the code to be converted, and converting the code to be converted according to the function keyword combination to obtain a target conversion code;
And determining a target execution code based on the target global variable and the target conversion code, and executing the target execution code to obtain the target component with the completed loading.
2. The method of claim 1, wherein the code to be converted comprises common data structure code, non-common data structure code, component configuration code, and renderer code.
3. Method according to claim 1, characterized in that the function key combination comprises import and/or export function keys; the code to be converted is converted according to the function key word combination to obtain a target conversion code, which comprises the following steps:
Aiming at the code to be converted, converting the imported function keywords into defined variable keywords, and converting the imported position keywords corresponding to the imported function keywords into second global variables;
determining an export command corresponding to the export function keyword, and converting the export command into an export expression loadable by a platform browser;
and determining the target conversion code according to the definition variable key, the second global variable and the derived expression.
4. The method of claim 3, wherein the export command comprises at least one of a declaration variable, a declaration function, and an export command corresponding to a default key.
5. The method of claim 1, further comprising, prior to said responding to the corresponding load operation for the target component:
Determining original edition components in a target platform, and acquiring original edition codes corresponding to the original edition components on line in a component development function of the target platform;
Determining the component code in response to an online development operation for the original code;
and determining the component information corresponding to the component code, associating the component information with the component code, and storing the component information and the component code in a database, wherein the component information comprises a component identifier and/or a component version.
6. The method according to claim 5, wherein determining the component code corresponding to the target component according to the component information includes:
and acquiring the component codes corresponding to the component identifiers and the component versions from the database through a back-end interface.
7. The method of claim 1, wherein the executing the target execution code results in the target component being loaded, comprising:
Executing the target execution code to obtain a code execution result;
and determining a third global variable, storing the code execution result through the third global variable, and calling the third global variable which has stored the code execution result to obtain the target component after loading.
8. An on-line development and loading device for a component, comprising:
The code acquisition module is used for responding to loading operation corresponding to a target component, determining component information corresponding to the target component and determining component codes corresponding to the target component according to the component information, wherein the component codes are codes developed based on specification reference and export package corresponding to function key word combinations, the component codes comprise dependent codes and codes to be converted, and a third party package on which the target component depends is defined in the dependent codes;
The dependency processing module is used for executing the dependency code and obtaining a dependency execution result, determining a first global variable, and adding the dependency execution result to the first global variable to obtain a target global variable;
the code conversion module is used for determining a function keyword combination in the code to be converted, and converting the code to be converted according to the function keyword combination to obtain a target conversion code;
And the code execution module is used for determining target execution codes based on the target global variable and the target conversion codes, executing the target execution codes and obtaining the target assembly after loading.
9. An electronic device, the electronic device comprising:
at least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the on-line development and loading method of the component of any one of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to perform the method of on-line development and loading of the component of any one of claims 1-7 when executed.
CN202410510353.XA 2024-04-26 2024-04-26 Online development and loading method and device of component, electronic equipment and storage medium Pending CN118377476A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410510353.XA CN118377476A (en) 2024-04-26 2024-04-26 Online development and loading method and device of component, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410510353.XA CN118377476A (en) 2024-04-26 2024-04-26 Online development and loading method and device of component, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN118377476A true CN118377476A (en) 2024-07-23

Family

ID=91911282

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410510353.XA Pending CN118377476A (en) 2024-04-26 2024-04-26 Online development and loading method and device of component, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN118377476A (en)

Similar Documents

Publication Publication Date Title
CN113342345A (en) Operator fusion method and device of deep learning framework
CN112540806A (en) Applet page rendering method and device, electronic equipment and storage medium
CN114792355B (en) Virtual image generation method and device, electronic equipment and storage medium
CN114428674A (en) Task scheduling method, device, equipment and storage medium
CN115761130A (en) Three-dimensional scene rapid construction method and device, electronic equipment and storage medium
CN113032258B (en) Electronic map testing method and device, electronic equipment and storage medium
CN116185389A (en) Code generation method and device, electronic equipment and medium
CN116245982A (en) Animation file generation method and device, electronic equipment and storage medium
CN116303461A (en) Component library creation method and device, electronic equipment and storage medium
CN113691403B (en) Topology node configuration method, related device and computer program product
CN116069319A (en) Form rendering method and device, electronic equipment and storage medium
CN116257611A (en) Question-answering model training method, question-answering processing device and storage medium
CN118377476A (en) Online development and loading method and device of component, electronic equipment and storage medium
CN115454971A (en) Data migration method and device, electronic equipment and storage medium
CN112835007B (en) Point cloud data conversion method and device, electronic equipment and storage medium
CN116468824B (en) Animation redirection method, device, electronic equipment and storage medium
CN113342413B (en) Method, apparatus, device, medium, and article for processing components
CN114741072B (en) Page generation method, device, equipment and storage medium
CN115794830A (en) Data value determination method and device, electronic equipment and storage medium
CN117278648A (en) Protocol dynamic adaptation method, device, electronic equipment and storage medium
CN117596141A (en) Message assembling method, device, equipment and storage medium
CN117608944A (en) Method and device for calculating weight migration volume ratio, electronic equipment and storage medium
CN117193726A (en) Parallel design method and device of software, electronic equipment and medium
CN117406964A (en) Data architecture model design method, device, electronic equipment and storage medium
CN117389522A (en) Detailed design model changing method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination