An assembly configuration method and related device

By maintaining framework base configuration files and compatibility configuration files for different development frameworks in a unified manner within the component library, compatibility issues between component libraries are resolved, learning costs are reduced, and product development efficiency is improved.

CN115495070BActive Publication Date: 2026-05-01HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
Filing Date
2022-09-29
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In product development, different technical teams use different development frameworks, which leads to compatibility issues between component libraries, increasing learning costs and reducing product development efficiency.

Method used

The component library maintains unified framework base configuration files for different development frameworks, and combines preset default configuration files and framework compatibility configuration files to package and configure components, thus solving the compatibility problem of component packaging configuration under different development frameworks.

Benefits of technology

It reduces the learning cost of component libraries, facilitates collaboration between different technical teams, and improves product development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115495070B_ABST
    Figure CN115495070B_ABST
Patent Text Reader

Abstract

The component configuration method and the related device provided by the present disclosure are applied to a component library. The component library stores a preset default configuration file, a framework basic configuration file corresponding to each development framework, and a framework compatible configuration file. By uniformly maintaining the framework basic configuration file corresponding to each development framework in the component library, the preset default configuration file and the framework compatible configuration file of the component under each development framework are combined to package and configure the component, the compatibility problem of the component packaging and configuration under different development frameworks is solved, the learning cost of the component library is reduced, and thus the collaboration between different technical teams is facilitated, and the product development efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a component configuration method and related equipment. Background Technology

[0002] Currently, with the rapid updates in product development technologies, product development may require the use of multiple different development frameworks, especially when product development involves multiple technical teams, each of which may use different development frameworks for the product projects they are responsible for developing.

[0003] In traditional product development, each technical team builds a component library for the development framework used in their respective projects, resulting in multiple component libraries for a single product. Furthermore, because different component libraries use different development frameworks, compatibility issues arise between them. This means that one technical team may need to learn from a component library built by another team, increasing the learning cost and reducing product development efficiency. Summary of the Invention

[0004] In view of the above problems, this disclosure provides a component configuration method and related equipment to overcome or at least partially solve the above problems, the technical solution of which is as follows:

[0005] A component configuration method is applied to a component library, the component library storing a preset default configuration file, framework base configuration files corresponding to each development framework, and framework compatibility configuration files, the method comprising:

[0006] Obtain a component packaging request, wherein the component packaging request includes the component name of the first component to be configured;

[0007] Obtain the first component corresponding to the component name from the component library;

[0008] Search the component library for the framework-compatible configuration file corresponding to the component name. If found, obtain the framework-compatible configuration file.

[0009] Using the component name, identify the framework name of the development framework to which the first component belongs;

[0010] Obtain the framework base configuration file corresponding to the framework name from the component library;

[0011] The first component is packaged and configured using the preset default configuration file, the framework base configuration file, and the framework compatibility configuration file to obtain the second component.

[0012] Optionally, the method further includes:

[0013] If no framework-compatible configuration file corresponding to the component name is found in the component library, the first component is packaged and configured using the preset default configuration file to obtain the third component.

[0014] Optionally, the framework's basic configuration file may include at least one third-party library and set a global variable name corresponding to the third-party library.

[0015] Optionally, the step of packaging and configuring the first component using the preset default configuration file, the framework base configuration file, and the framework compatibility configuration file includes:

[0016] Using the global variable name in the framework's basic configuration file, the third-party library corresponding to the global variable name is configured in the first component.

[0017] Optionally, the framework's basic configuration file defines the association between the component library's image repository and the external server.

[0018] Optionally, the step of packaging and configuring the first component using the preset default configuration file, the framework base configuration file, and the framework compatibility configuration file includes:

[0019] Using the association relationships in the framework's basic configuration file, for the images in the image repository introduced in the first component: replace the relative path address of the image in the image repository with the absolute path address corresponding to the external server.

[0020] Optionally, the step of packaging and configuring the first component using the preset default configuration file, the framework base configuration file, and the framework compatibility configuration file includes:

[0021] Using the framework's basic configuration file, configure the corresponding entry file for the first component.

[0022] A component configuration device is applied to a component library, the component library storing preset default configuration files, framework base configuration files corresponding to each development framework, and framework compatible configuration files. The device includes: a request acquisition unit, a first component acquisition unit, a framework compatible configuration file search unit, a framework compatible configuration file acquisition unit, a framework name recognition unit, a framework base configuration file acquisition unit, and a second component acquisition unit.

[0023] The request obtaining unit is used to obtain a component packaging request, wherein the component packaging request includes the component name of the first component to be configured;

[0024] The first component obtaining unit is configured to obtain the first component corresponding to the component name from the component library;

[0025] The framework-compatible configuration file lookup unit is used to search for the framework-compatible configuration file corresponding to the component name in the component library. If the file is found, the framework-compatible configuration file acquisition unit is triggered.

[0026] The framework-compatible configuration file obtaining unit is used to obtain the framework-compatible configuration file;

[0027] The framework name recognition unit is used to identify the framework name of the development framework to which the first component belongs by using the component name;

[0028] The framework basic configuration file obtaining unit is used to obtain the framework basic configuration file corresponding to the framework name in the component library;

[0029] The second component obtaining unit is used to package and configure the first component using the preset default configuration file, the framework basic configuration file, and the framework compatible configuration file to obtain the second component.

[0030] A computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the component configuration method described in any of the preceding claims.

[0031] An electronic device includes at least one processor, at least one memory connected to the processor, and a bus; wherein the processor and the memory communicate with each other via the bus; the processor is used to call program instructions in the memory to execute the component configuration method described above.

[0032] By employing the above technical solution, this disclosure provides a component configuration method and related equipment, applied to a component library. The component library stores a preset default configuration file, framework base configuration files corresponding to each development framework, and framework compatibility configuration files. The method involves obtaining a component packaging request, wherein the component packaging request includes the component name of a first component to be configured; obtaining the first component corresponding to the component name in the component library; searching for the framework compatibility configuration file corresponding to the component name in the component library; if found, obtaining the framework compatibility configuration file; identifying the framework name of the development framework to which the first component belongs using the component name; obtaining the framework base configuration file corresponding to the framework name in the component library; and packaging and configuring the first component using the preset default configuration file, framework base configuration file, and framework compatibility configuration file to obtain a second component. This disclosure solves the compatibility problem of component packaging configuration under different development frameworks by uniformly maintaining framework base configuration files corresponding to different development frameworks in the component library. It combines the preset default configuration file and the framework compatibility configuration files of components under each development framework to package and configure components, reducing the learning cost of the component library, thereby facilitating collaboration between different technical teams and improving product development efficiency.

[0033] The above description is merely an overview of the technical solution disclosed herein. In order to better understand the technical means of this disclosure and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this disclosure more apparent and understandable, specific embodiments of this disclosure are described below. Attached Figure Description

[0034] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this disclosure. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0035] Figure 1 A flowchart illustrating one implementation of the component configuration method provided in this disclosure is shown.

[0036] Figure 2 A flowchart illustrating another implementation of the component configuration method provided in this disclosure is shown.

[0037] Figure 3 A schematic diagram of the component configuration apparatus provided in an embodiment of this disclosure is shown;

[0038] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure is shown. Detailed Implementation

[0039] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0040] The component configuration method provided in this disclosure can be applied to a component library, which stores a preset default configuration file, a framework basic configuration file corresponding to each development framework, and a framework compatibility configuration file.

[0041] The component library is a collection of components organized according to a certain structure and order. The components in the component library are independent yet coupled. Components are standardized encapsulated data formed by decomposing, summarizing, and recombining elements in functional and visual expression, based on the purpose of reusability.

[0042] Optionally, in this embodiment of the disclosure, a package directory can be created in the component library, and all components can be stored in the package directory.

[0043] Optionally, embodiments of this disclosure may pre-develop a customizable packaging configuration tool based on the Rollup tool within the component library. This packaging configuration tool includes a preset default configuration file. This preset default configuration file is a native component that does not use any development framework and can be directly packaged by default. The preset default configuration file can be "rollup.component.build.js", and its storage directory can be " / script / rollup.component.build.js".

[0044] Among them, the framework base configuration file can be a general configuration file applicable to various components under the open framework.

[0045] Optionally, in this embodiment of the disclosure, the framework basic configuration files corresponding to each development framework can be pre-configured in the component library.

[0046] Specifically, in this embodiment of the disclosure, a `config` directory can be created in the root directory of the component library project, and the filename of the framework's basic configuration file can be the name of the framework. For example, the basic configuration file corresponding to the React framework is "rollup.react.js", and its storage directory can be " / script / config / rollup.react.js". The basic configuration file corresponding to the Vue framework is "rollup.vue.js", and its storage directory can be " / script / config / rollup.vue.js".

[0047] Optionally, the framework's base configuration file may import at least one third-party library and set a global variable name corresponding to that third-party library.

[0048] Understandably, development frameworks typically rely on third-party libraries. This embodiment of the disclosure can pre-set the global variable names used by these third-party libraries in components, so that during the packaging and configuration process, components can call the corresponding third-party libraries according to these global variable names. This eliminates the need to import third-party libraries separately for each component, reducing redundant configuration.

[0049] Optionally, the framework's basic configuration file defines the association between the component library's image repository and the external server.

[0050] In practice, some components may import images from the component library's image repository in Cascading Style Sheets (CSS). During the default packaging process, these images are packaged as base64 files, increasing the overall size of the component. Therefore, this embodiment of the disclosure requires replacing the relative path of the image in the CSS with an absolute path. For example, the relative path address of the background image in the CSS, "background-image:url('. / assets / coupon_2_normal.png')", is replaced with the absolute path address corresponding to the external server, "background-image:url('https: / / xxx.com / assets / coupon_2_normal.png)". This embodiment of the disclosure can pre-establish an association between the images in the component library's image repository and the external server. Through this association, the images in the component library's image repository can be accessed using the external domain name address provided by the external server.

[0051] Optionally, the framework base configuration file can configure a compileable entry file with the same name as the component.

[0052] This disclosure embodiment extracts the common configuration of components under the development framework and constructs a framework basic configuration file corresponding to the development framework, which makes it easier to maintain the framework basic configuration files of each development framework in the component library.

[0053] The framework compatibility configuration file is a separate configuration file developed in advance for components that require compatibility configuration under the development framework. This configuration file contains the additional configurations required by the component under the development framework, as well as the component's own specific configuration requirements.

[0054] The filename of the framework compatibility configuration file can be the same as the component name. For example, for the demo component, the framework compatibility configuration file for the demo component can be "demo.js", and the storage directory for the framework compatibility configuration file can be " / script / config / demo.js".

[0055] It is understandable that the configuration content in the framework compatibility configuration file corresponding to the component can be configured according to the requirements of the component.

[0056] The embodiments of this disclosure can write logic in the preset default configuration file of the packaging configuration tool so that the packaging configuration tool can execute the component configuration method provided in the embodiments of this disclosure.

[0057] like Figure 1 The diagram shows a flowchart of one implementation of the component configuration method provided in this disclosure. The component configuration method may include:

[0058] S100. Obtain a component packaging request, wherein the component packaging request includes the component name of the first component to be configured.

[0059] S200. Obtain the first component corresponding to the component name from the component library.

[0060] Specifically, in this embodiment of the disclosure, the component name of the first component can be searched in the package directory of the component library to determine whether a first component corresponding to the component name can be found. If it is found, the first component is obtained; if it is not found, a message that the component does not exist is returned.

[0061] S300. Locate the framework-compatible configuration file corresponding to the component name in the component library. If found, proceed to step S400.

[0062] S400, obtain the framework-compatible configuration file.

[0063] This embodiment of the disclosure can search for a framework-compatible configuration file with the same filename as the component name in the config directory of the component library, and obtain the found framework-compatible configuration file.

[0064] Optional, based on Figure 1 The method shown is as follows: Figure 2 As shown, this is a flowchart illustrating another implementation of the component configuration method provided in this disclosure. In this disclosure, if no framework-compatible configuration file corresponding to the component name is found in the component library, step S800 can be executed.

[0065] S800: Package and configure the first component using a preset default configuration file to obtain the third component.

[0066] Understandably, if no framework-compatible configuration file with the same filename as the first component is found, it is determined that the first component does not need to be configured separately. The default configuration file can be used to complete the packaging configuration of the first component and obtain the third component.

[0067] S500: Use the component name to identify the framework name of the development framework to which the first component belongs.

[0068] It is understandable that the first component can belong to different development frameworks. For example, the demo component can belong to the React development framework or the Vue development framework. Since there is a correspondence between component names and framework names, this embodiment of the disclosure can query the framework names of the development frameworks to which the first component belongs based on the component name of the first component.

[0069] S600. Obtain the framework base configuration file corresponding to the framework name from the component library.

[0070] This embodiment of the disclosure can query the framework base configuration file with the same file name as the framework name in the config directory and obtain the found framework base configuration file.

[0071] S700 uses the preset default configuration file, the framework base configuration file, and the framework compatibility configuration file to package and configure the first component, thereby obtaining the second component.

[0072] This embodiment of the disclosure can use the framework base configuration file and framework compatibility configuration file queried and returned by the packaging configuration tool, combined with the preset default configuration file, to package and configure the first component, thereby obtaining the configured second component.

[0073] This disclosure embodiment reduces the cost of component maintenance and development under different development frameworks by enabling compatibility with multiple development frameworks in a single component library and allowing for compatibility configuration extensions based on different components. It also saves technical personnel the cost of learning and using the component library, facilitates collaboration between different technical teams, and thus improves product development efficiency.

[0074] Optionally, in this embodiment of the disclosure, the global variable name in the framework's basic configuration file can be used to configure the third-party library corresponding to the global variable name into the first component.

[0075] This embodiment of the disclosure enables the configured second component to import and use the corresponding third-party library by setting the global variable name of the third-party library in the framework basic configuration file, without having to import the third-party library separately for each component. This improves the efficiency of component packaging configuration and reduces redundant configuration.

[0076] Optionally, in this embodiment of the disclosure, the association relationship in the framework's basic configuration file can be used to replace the relative path address of the image in the image repository introduced in the first component with the absolute path address corresponding to the external server.

[0077] This embodiment of the disclosure, through the association between the image repository of the component library defined in the framework's basic configuration file and the external server, can replace the relative path of the image referenced by the component with an absolute path, preventing the second component from occupying too much space, saving storage resources, and improving the efficiency of component packaging and configuration.

[0078] Optionally, in this embodiment of the disclosure, the framework basic configuration file can be used to configure the corresponding entry file for the first component.

[0079] The entry file is used to introduce components into the product project so that the product can call the component.

[0080] This disclosure provides a component configuration method applied to a component library. The component library stores a preset default configuration file, framework base configuration files corresponding to each development framework, and framework compatibility configuration files. The method involves obtaining a component packaging request, where the packaging request includes the component name of a first component to be configured; retrieving the first component corresponding to the component name from the component library; searching for the framework compatibility configuration file corresponding to the component name in the component library; if found, obtaining the framework compatibility configuration file; identifying the framework name of the development framework to which the first component belongs using the component name; retrieving the framework base configuration file corresponding to the framework name from the component library; and packaging and configuring the first component using the preset default configuration file, framework base configuration file, and framework compatibility configuration file to obtain a second component. This disclosure solves the compatibility problem of component packaging configuration under different development frameworks by uniformly maintaining framework base configuration files corresponding to different development frameworks in the component library. It combines the preset default configuration file and the framework compatibility configuration files for components under each development framework to package and configure components, reducing the learning cost of the component library, thereby facilitating collaboration between different technical teams and improving product development efficiency.

[0081] Although the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous.

[0082] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0083] Corresponding to the above method embodiments, this disclosure also provides a component configuration device, which can be applied to a component library. The component library stores a preset default configuration file, a framework basic configuration file corresponding to each development framework, and a framework compatibility configuration file. The structure of the component configuration device is as follows: Figure 3 As shown, the component configuration device may include: a request acquisition unit 100, a first component acquisition unit 200, a framework compatible configuration file search unit 300, a framework compatible configuration file acquisition unit 400, a framework name recognition unit 500, a framework basic configuration file acquisition unit 600, and a second component acquisition unit 700.

[0084] Request obtaining unit 100 is used to obtain a component packaging request, wherein the component packaging request includes the component name of the first component to be configured.

[0085] The first component acquisition unit 200 is used to obtain the first component corresponding to the component name in the component library.

[0086] The framework compatibility configuration file lookup unit 300 is used to search for the framework compatibility configuration file corresponding to the component name in the component library. If found, it triggers the framework compatibility configuration file acquisition unit 400.

[0087] Framework compatibility configuration file acquisition unit 400 is used to obtain the framework compatibility configuration file.

[0088] The framework name recognition unit 500 is used to identify the framework name of the development framework to which the first component belongs by using the component name.

[0089] The framework base configuration file acquisition unit 600 is used to obtain the framework base configuration file corresponding to the framework name in the component library.

[0090] The second component, unit 700, is used to package and configure the first component using a preset default configuration file, a framework base configuration file, and a framework compatibility configuration file to obtain the second component.

[0091] Optionally, the component configuration device may further include a third component acquisition unit.

[0092] The third component acquisition unit is used to package and configure the first component using a preset default configuration file when no framework-compatible configuration file corresponding to the component name is found in the component library, thereby obtaining the third component.

[0093] Optionally, the framework's base configuration file may import at least one third-party library and set a global variable name corresponding to that third-party library.

[0094] Optionally, the second component obtaining unit 700 can be specifically used to configure the third-party library corresponding to the global variable name in the first component by utilizing the global variable name in the framework's basic configuration file.

[0095] Optionally, the framework's basic configuration file defines the association between the component library's image repository and the external server.

[0096] Optionally, the second component obtaining unit 700 can specifically utilize the association relationship in the framework's basic configuration file to replace the relative path address of the image in the image repository imported in the first component with the absolute path address corresponding to the external server.

[0097] Optionally, the second component obtaining unit 700 can specifically utilize the framework basic configuration file to configure the corresponding entry file for the first component.

[0098] This disclosure provides a component configuration device applied to a component library. The component library stores a preset default configuration file, framework base configuration files corresponding to each development framework, and framework compatibility configuration files. The device obtains a component packaging request, wherein the component packaging request includes the component name of a first component to be configured. It then retrieves the first component corresponding to the component name from the component library; searches for the framework compatibility configuration file corresponding to the component name in the component library; if found, obtains the framework compatibility configuration file; identifies the framework name of the development framework to which the first component belongs using the component name; retrieves the framework base configuration file corresponding to the framework name from the component library; and packages and configures the first component using the preset default configuration file, framework base configuration file, and framework compatibility configuration file to obtain a second component. This disclosure solves the compatibility problem of component packaging configuration under different development frameworks by uniformly maintaining framework base configuration files corresponding to different development frameworks in the component library. It combines the preset default configuration file and the framework compatibility configuration files of components under each development framework to package and configure components, reducing the learning cost of the component library, thereby facilitating collaboration between different technical teams and improving product development efficiency.

[0099] Regarding the apparatus in the above embodiments, the specific manner in which each unit performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0100] The component configuration device includes a processor and a memory. The aforementioned request acquisition unit 100, first component acquisition unit 200, framework compatible configuration file lookup unit 300, framework compatible configuration file acquisition unit 400, framework name recognition unit 500, framework basic configuration file acquisition unit 600, and second component acquisition unit 700 are all stored in the memory as program units. The processor executes the aforementioned program units stored in the memory to implement the corresponding functions.

[0101] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured. By adjusting kernel parameters, different framework-specific configuration files can be maintained uniformly in the component library. This allows for the packaging and configuration of components by combining preset default configuration files with framework compatibility configuration files for each development framework. This solves the compatibility issues of component packaging configurations across different development frameworks, reduces the learning cost of the component library, facilitates collaboration between different technical teams, and improves product development efficiency.

[0102] This disclosure provides a computer-readable storage medium having a program stored thereon that, when executed by a processor, implements the component configuration method.

[0103] This disclosure provides a processor for running a program, wherein the program executes the component configuration method during runtime.

[0104] like Figure 4 As shown, this disclosure provides an electronic device 1000, which includes at least one processor 1001, at least one memory 1002 connected to the processor 1001, and a bus 1003. The processor 1001 and the memory 1002 communicate with each other via the bus 1003. The processor 1001 is used to call program instructions in the memory 1002 to execute the aforementioned component configuration method. The electronic device described herein can be a server, PC, PAD, mobile phone, etc.

[0105] This disclosure also provides a computer program product that, when executed on an electronic device, is adapted to perform a program with initialization component configuration method steps.

[0106] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus, electronic devices (systems), and computer program products according to embodiments of this disclosure. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable device, generate instructions for implementing the flowchart. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0107] In a typical configuration, an electronic device includes one or more processors (CPUs), memory, and a bus. The electronic device may also include input / output interfaces, network interfaces, etc.

[0108] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM, and memory includes at least one memory chip. Memory is an example of computer-readable media.

[0109] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0110] In the description of this disclosure, it should be understood that if the terms "upper", "lower", "front", "rear", "left" and "right" are used to indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the position or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this disclosure.

[0111] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.

[0112] Those skilled in the art will understand that embodiments of this disclosure can be provided as methods, systems, or computer program products. Therefore, this disclosure can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this disclosure can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0113] The above are merely embodiments of this disclosure and are not intended to limit the scope of this disclosure. Various modifications and variations can be made to this disclosure by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the scope of the claims of this disclosure.

Claims

1. A component configuration method, characterized in that, The method is applied to a component library, which stores a preset default configuration file, framework base configuration files corresponding to each development framework, and framework compatibility configuration files. The preset default configuration file is a native component that can be directly packaged by default and does not use any development framework. The framework base configuration file is a general configuration file applicable to various components under the open framework. The framework compatibility configuration file is a configuration file pre-developed for components that require compatibility configuration under the development framework, and it contains additional configurations required by the component under the development framework, as well as the component's own requirement configurations. The method includes: Obtain a component packaging request, wherein the component packaging request includes the component name of the first component to be configured; Obtain the first component corresponding to the component name from the component library; Search the component library for the framework-compatible configuration file corresponding to the component name. If found, obtain the framework-compatible configuration file. Using the component name, identify the framework name of the development framework to which the first component belongs; Obtain the framework base configuration file corresponding to the framework name from the component library; The first component is packaged and configured using the preset default configuration file, the framework base configuration file, and the framework compatibility configuration file to obtain the second component.

2. The method according to claim 1, characterized in that, Also includes: If no framework-compatible configuration file corresponding to the component name is found in the component library, the first component is packaged and configured using the preset default configuration file to obtain the third component.

3. The method according to claim 1, characterized in that, The framework's basic configuration file imports at least one third-party library and sets global variable names corresponding to those third-party libraries.

4. The method according to claim 3, characterized in that, The step of packaging and configuring the first component using the preset default configuration file, the framework base configuration file, and the framework compatibility configuration file includes: Using the global variable name in the framework's basic configuration file, the third-party library corresponding to the global variable name is configured in the first component.

5. The method according to claim 1, characterized in that, The framework's basic configuration file defines the association between the component library's image repository and the external server.

6. The method according to claim 5, characterized in that, The step of packaging and configuring the first component using the preset default configuration file, the framework base configuration file, and the framework compatibility configuration file includes: Using the association relationships in the framework's basic configuration file, for the images in the image repository introduced in the first component: replace the relative path address of the image in the image repository with the absolute path address corresponding to the external server.

7. The method according to claim 1, characterized in that, The step of packaging and configuring the first component using the preset default configuration file, the framework base configuration file, and the framework compatibility configuration file includes: Using the framework's basic configuration file, configure the corresponding entry file for the first component.

8. A component configuration device, characterized in that, The device is applied to a component library, which stores a preset default configuration file, framework base configuration files corresponding to each development framework, and framework compatible configuration files. The preset default configuration file is a native component that can be directly packaged by default and does not use any development framework. The framework base configuration file is a general configuration file applicable to various components under the open framework. The framework compatible configuration file is a configuration file developed separately for components that need to be compatible with the development framework. The framework compatible configuration file contains additional configurations required by the component under the development framework and the component's own requirement configuration. The device includes: a request acquisition unit, a first component acquisition unit, a framework compatible configuration file search unit, a framework compatible configuration file acquisition unit, a framework name recognition unit, a framework base configuration file acquisition unit, and a second component acquisition unit. The request obtaining unit is used to obtain a component packaging request, wherein the component packaging request includes the component name of the first component to be configured; The first component obtaining unit is configured to obtain the first component corresponding to the component name from the component library; The framework-compatible configuration file lookup unit is used to search for the framework-compatible configuration file corresponding to the component name in the component library. If the file is found, the framework-compatible configuration file acquisition unit is triggered. The framework-compatible configuration file obtaining unit is used to obtain the framework-compatible configuration file; The framework name recognition unit is used to identify the framework name of the development framework to which the first component belongs by using the component name; The framework basic configuration file obtaining unit is used to obtain the framework basic configuration file corresponding to the framework name in the component library; The second component obtaining unit is used to package and configure the first component using the preset default configuration file, the framework basic configuration file, and the framework compatible configuration file to obtain the second component.

9. A computer-readable storage medium having a program stored thereon, characterized in that, When the program is executed by the processor, it implements the component configuration method as described in any one of claims 1 to 7.

10. An electronic device, the electronic device comprising at least one processor, and at least one memory and a bus connected to the processor; wherein, The processor and the memory communicate with each other via the bus; The processor is used to invoke program instructions in the memory to execute the component configuration method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Component running method and device, equipment and computer storage medium

    CN108376091A

  • Application configuration method and device, equipment and storage medium

    CN114217845A