A configuration method and device of a service module

By configuring a common template file and dynamically matching the packaging method when the front-end project starts up abnormally, the problem of high coupling between modules is solved, enabling flexible business module configuration and efficient project development, which is suitable for projects of different sizes.

CN119576316BActive Publication Date: 2025-12-12CHINA CONSTRUCTION BANK +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411625997.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-12-12
Estimated Expiration
2044-11-14

AI Technical Summary

Technical Problem

In existing technologies, the high degree of coupling between modules leads to increased code complexity, difficulty in system maintenance and expansion, insufficient configuration flexibility, inability to meet rapidly changing business needs, and limited scalability.

Method used

When an abnormal startup of the front-end project is detected, the business modules are obtained and a general template file is configured. The business sub-modules to be packaged are dynamically matched according to the project scale and business requirements. They are split and merged by packaging the entire module or by specifying the module, thereby achieving decoupling between modules.

Benefits of technology

It effectively reduces the coupling between business modules, improves code reusability and maintainability, supports rapidly changing business requirements, and is suitable for project development and maintenance of different sizes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119576316B_ABST
    Figure CN119576316B_ABST
Patent Text Reader

Abstract

The application discloses a kind of configuration method and device of service module, it is related to front-end technical field, the method includes: when monitoring that front-end engineering project starts exception, the service module under the project is obtained, service module is defined according to business requirement;Business requirement at least includes business submodule update demand, business submodule addition demand;For service module configuration general template file;Receive the packaging request configured according to the scale of project, judge whether there is configuration parameter in packaging request, according to the matching result of judgment result, it contains updated business submodule or new business submodule, determine packaging mode, according to packaging mode, based on general template file, from business main module to the business submodule of packaging is split and / or merged, then page is packaged, obtain packaging file.The application can effectively realize the decoupling and flexible configuration between service module, can satisfy rapidly changing business requirement, and the expansibility is stronger.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of front-end technology, and in particular to a method and apparatus for configuring a business module. Background Technology

[0002] In the front-end technology field, modular development is a common practice that improves code reusability and maintainability by breaking down functionality into independent modules. However, traditional modular development methods often suffer from high coupling between modules. Highly coupled modules increase code complexity and also affect system scalability and maintainability. Furthermore, tight coupling between modules hinders the dynamic loading and configuration of submodules, making it difficult to meet rapidly changing business needs.

[0003] Currently, existing technologies decouple modules by defining unified interfaces and specifications. These solutions typically involve the design of a main module and sub-modules, with the main module responsible for overall management and scheduling, and the sub-modules responsible for specific business logic. While these solutions reduce the coupling between modules to some extent, they still have some problems, such as insufficient configuration flexibility and limited scalability.

[0004] There is currently no effective solution to the above problems. Summary of the Invention

[0005] This specification provides a method and apparatus for configuring a business module to address the problems of high coupling between modules, insufficient flexibility in module configuration, and limited scalability in the prior art.

[0006] Firstly, embodiments of this specification provide a method for configuring a business module, the method comprising:

[0007] When an abnormal startup of the front-end project is detected, the business modules under the front-end project are obtained. The business modules include multiple business sub-modules and corresponding main business modules. The business modules are defined according to business requirements. The business requirements include at least business sub-module update requirements and business sub-module addition requirements. When the business requirement is a business sub-module update requirement, the multiple business sub-modules are configured to include the updated business sub-module. When the business requirement is a business sub-module addition requirement, the multiple business sub-modules are configured to include the added business sub-module.

[0008] Configure the same common template file for the business modules, and the common template file is the base file for splitting or merging the business modules;

[0009] The packaging request configured according to the size of the front-end project is received, it is judged whether the configuration parameter exists in the packaging request, and the to-be-packaged business sub-modules are matched from the plurality of business sub-modules according to the judgment result, and the packaging mode corresponding to the to-be-packaged business sub-modules is determined; the to-be-packaged business sub-modules include the updated business sub-modules or the added business sub-modules;

[0010] According to the packaging mode, the to-be-packaged business sub-modules are split and / or merged from the business main module based on the universal template file, and then page packaging is performed to obtain a packaging file.

[0011] In some embodiments, when the business demand is a business sub-module update demand, the plurality of business sub-modules include the updated business sub-modules, including:

[0012] The plurality of business sub-modules are converted into a plurality of independent business module plug-ins, and the target business sub-module carried by the business sub-module update demand is converted into a target business sub-module plug-in.

[0013] When the business demand is a business sub-module update demand, the to-be-updated business sub-module plug-in in the plurality of business module plug-ins is replaced with the target business sub-module plug-in, and the target business sub-module plug-in is used as an updated business sub-module.

[0014] In some embodiments, when the business demand is a business sub-module addition demand, the plurality of business sub-modules include the added business sub-modules, including:

[0015] The added business sub-module carried by the business sub-module addition demand is converted into an added business sub-module plug-in.

[0016] When the business demand is a business sub-module addition demand, the added business sub-module plug-in is loaded into the business main module, and the added business sub-module plug-in is used as an added business sub-module.

[0017] In some embodiments, the same universal template file is configured for the business module, including:

[0018] The internal file of the business module is configured, and the internal file includes a temp file;

[0019] The output file corresponding to the internal file is used as the universal template file of the business module, and the output file includes an outTemp file;

[0020] The execution instruction of the universal template file is called, and the business module has the same universal template file based on the execution instruction.

[0021] In some embodiments, the packaging request configured according to the size of the front-end project to which the front-end project belongs comprises:

[0022] When the size of the front-end project to which the front-end project belongs is small, the packaging request is configured as a full-amount packaging request, and the full-amount packaging request does not contain configuration parameters;

[0023] When the size of the front-end project to which the front-end project belongs is large, the packaging request is configured as a specified module packaging request, and the specified module packaging request contains configuration parameters.

[0024] In some embodiments, the determination of whether the packaging request contains configuration parameters comprises:

[0025] The configuration parameter separation instruction is called from a preset configuration file, and the configuration parameter separation instruction contains a string separation function;

[0026] Whether the configuration parameters can be separated from the packaging request is determined by using the string separation function;

[0027] If yes, it is determined that the packaging request contains configuration parameters;

[0028] If no, it is determined that the packaging request does not contain configuration parameters.

[0029] In some embodiments, the matching of the to-be-packaged business sub-module from the plurality of business sub-modules according to the determination result and the determination of the packaging mode corresponding to the to-be-packaged business sub-module comprise:

[0030] When it is determined that the packaging request contains configuration parameters, a split instruction is called from a preset configuration file, and the split instruction contains a string split function;

[0031] The configuration parameters are split into a plurality of sub-configuration parameters by using the string split function;

[0032] According to the plurality of sub-configuration parameters, a specified module is matched from the plurality of business sub-modules as the to-be-packaged business sub-module, and it is determined that the packaging mode corresponding to the to-be-packaged business sub-module is a specified module packaging;

[0033] When it is determined that the packaging request does not contain configuration parameters, the plurality of business sub-modules are taken as the to-be-packaged business sub-modules, and it is determined that the packaging mode corresponding to the to-be-packaged business sub-module is full-amount packaging.

[0034] In some embodiments, the splitting or merging of the to-be-packaged business sub-module from the business main module based on the universal template file according to the packaging mode and the page packaging comprise:

[0035] When the packaging mode is full-amount packaging, based on the general template file, a plurality of service sub-modules are split from a service main module for merging, and the plurality of service sub-modules after merging are packaged into one independent page as a packaging file.

[0036] When the packaging mode is specified module packaging, based on the general template file, a specified module is split from the service main module, and the specified module after splitting is packaged into a corresponding independent page as a packaging file.

[0037] In a second aspect, the embodiments of the present specification also provide a configuration device of a service module, the device comprising:

[0038] The obtaining module is configured to obtain a service module under a front-end engineering project when monitoring that the front-end engineering project starts abnormally, wherein the service module comprises a plurality of service sub-modules and a corresponding service main module, and the service module is defined according to a service requirement; the service requirement at least comprises a service sub-module update requirement and a service sub-module addition requirement; when the service requirement is the service sub-module update requirement, the plurality of service sub-modules comprise a service sub-module after updating; and when the service requirement is the service sub-module addition requirement, the plurality of service sub-modules comprise a newly added service sub-module.

[0039] The configuration module is configured to configure the same general template file for the service module, wherein the general template file is a basic file for splitting or merging of the service module.

[0040] The determining module is configured to receive a packaging request configured according to a size of the front-end engineering project, judge whether there is a configuration parameter in the packaging request, and according to a judgment result, match a service sub-module to be packaged from the plurality of service sub-modules, and determine a packaging mode corresponding to the service sub-module to be packaged; the service sub-module to be packaged comprises the service sub-module after updating or the newly added service sub-module.

[0041] The packaging module is configured to split and / or merge the service sub-module to be packaged from the service main module based on the general template file according to the packaging mode, and then perform page packaging to obtain a packaging file.

[0042] In a third aspect, the embodiments of the present specification also provide a computer device, comprising a memory, a processor, and a computer program / instruction stored on the memory, wherein the processor executes the computer program / instruction to implement the steps of the configuration method of the service module.

[0043] In a fourth aspect, the embodiments of the present specification also provide a computer readable storage medium having a computer program / instruction stored thereon, wherein the computer program / instruction is executed by a processor to implement the steps of the configuration method of the service module.

[0044] In a fifth aspect, the embodiments of the present disclosure further provide a computer program product, wherein the computer program / instructions realize the steps of the configuration method of the service module when executed by a processor.

[0045] This specification provides a configuration method and apparatus for a business module. First, upon detecting a startup anomaly in a front-end project, the business modules under the front-end project are obtained. Each business module includes multiple business sub-modules and a corresponding main business module. The business modules are defined according to business requirements, which at least include sub-module update requirements and sub-module addition requirements. When the business requirement is a sub-module update requirement, the multiple business sub-modules are configured to include the updated sub-module. When the business requirement is a sub-module addition requirement, the multiple business sub-modules are configured to include the newly added sub-module. Then, a common template file is configured for each business module. This common template file serves as the base file for splitting or merging the business modules. Next, a packaging request configured according to the scale of the front-end project is received. It is determined whether the packaging request contains configuration parameters, and based on the determination result, the business sub-module to be packaged is matched from the multiple business sub-modules, and the packaging method corresponding to the business sub-module to be packaged is determined. The business sub-module to be packaged includes either the updated business sub-module or the newly added business sub-module. Finally, based on the packaging method and the general template file, the business sub-modules to be packaged are split and / or merged from the main business module, and then the pages are packaged to obtain the packaged file. In this embodiment, when a front-end project startup exception is detected, the business modules under the project are automatically obtained, and the decoupling between business modules is performed, which can effectively solve the problem of front-end project startup exception. By setting business modules, they can be defined according to business requirements. The configuration of business sub-modules can include updated business sub-modules and newly added business sub-modules, making the configuration of business modules more flexible and able to meet rapidly changing business needs. By configuring a general template file for business modules, the foundation for splitting or merging business modules can be laid. By configuring the packaging request according to the scale of the front-end project, it is applicable to projects of different scales, which can improve the development and maintenance efficiency of projects of different scales. By judging whether there are configuration parameters in the packaging request, the business sub-modules to be packaged and the corresponding packaging method can be accurately determined. The business sub-modules to be packaged also include updated business sub-modules or newly added business sub-modules, thereby meeting the user's business needs. Ultimately, based on the packaging method and a common template file, the business sub-modules to be packaged can be split and / or merged from the main business module before the pages are packaged. This enables independent packaging and deployment of business modules, effectively reducing the coupling between multiple business sub-modules and the main business module, improving code reusability and maintainability, and providing strong scalability to support the integration of new businesses. Attached Figure Description

[0046] In order to make the technical solutions in the present application or prior art clearer, the drawings needed in the embodiments or prior art description will be briefly introduced below. Obviously, the drawings described below are only some of the embodiments of the present application, and for those skilled in the art, other drawings can be obtained without creative labor based on these drawings. In the drawings:

[0047] Figure 1 is a flow diagram of a method for configuring a service module according to an embodiment of the present application;

[0048] Figure 2 is a schematic diagram of an embodiment of the method for configuring a service module according to an embodiment of the present application in a scenario example;

[0049] Figure 3 is a schematic diagram of an embodiment of the method for configuring a service module according to an embodiment of the present application in a scenario example;

[0050] Figure 4 is a schematic diagram of an embodiment of the method for configuring a service module according to an embodiment of the present application in a scenario example;

[0051] Figure 5 is a schematic diagram of an embodiment of the method for configuring a service module according to an embodiment of the present application in a scenario example;

[0052] Figure 6 is a structural composition diagram of a configuration device for a service module according to an embodiment of the present application;

[0053] Figure 7 is a structural composition diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0054] In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should be within the scope of protection of the present application.

[0055] In the field of front-end technology, modular development is a common practice. By splitting functions into independent modules, code reusability and maintainability can be improved. However, the traditional modular development method often has the problem of high coupling between modules.

[0056] To solve this problem, some existing technical solutions attempt to achieve decoupling between modules by defining unified interfaces and specifications. These solutions usually include the design of a main module and sub-modules, with the main module responsible for overall management and scheduling, and the sub-modules responsible for specific business logic. Although these solutions reduce the coupling between modules to some extent, there are still some problems, such as inflexible configuration, limited scalability, etc.

[0057] However, the existing technology has the following problems: high coupling between modules, leading to difficult system maintenance and expansion; inflexible configuration, unable to meet rapidly changing business needs; limited scalability, unable to support the rapid integration of new businesses well.

[0058] To solve the above problems existing in the prior art, the present application considers introducing a configuration method and device of a business module, which can effectively decouple multiple business sub-modules and a business main module, effectively reduce the coupling between multiple business sub-modules and the business main module, and improve the scalability and maintainability of the system. At the same time, it also supports dynamic loading and configuration of multiple business sub-modules, meeting the rapidly changing business needs.

[0059] It should be noted that the information and data related to the user involved in the embodiments of the present application are information and data authorized by the user or sufficiently authorized by relevant parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data comply with relevant laws, regulations and standards, necessary security measures are taken, do not violate public order and good customs, and provide corresponding operation portal for users or relevant parties to choose authorization or refusal.

[0060] It should also be noted that in the embodiments of the present application, some industry existing solutions, components, models, etc. may be mentioned, which should be considered as exemplary, and the purpose is only to illustrate the feasibility of the implementation of the technical solutions of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0061] Figure 1is a flowchart of a method for configuring a service module provided by an embodiment of the present specification. Although the present specification provides method operation steps or device structures as described in the following embodiments or drawings, more or some of the operation steps or module units can be included in the method or device based on conventional or non-creative labor. In steps or structures that do not have essential causal relationships in logic, the execution order of these steps or the module structure of the device is not limited to the execution order or module structure shown in the embodiments or drawings of the present specification. When the method or module structure is applied in actual devices, servers or terminal products, it can be sequentially executed or executed in parallel (for example, in a parallel processor or a multi-threaded processing environment, even including a distributed processing, server cluster implementation environment) according to the method or module structure shown in the embodiments or drawings. For specific implementation, see Figure 1 As shown, the method can include the following.

[0062] S101: When an abnormality in a front-end engineering project is monitored, a service module under the front-end engineering project is obtained, the service module includes a plurality of service sub-modules and a corresponding service main module, and the service module is defined according to a service requirement; the service requirement at least includes a service sub-module update requirement and a service sub-module addition requirement; when the service requirement is the service sub-module update requirement, the plurality of service sub-modules include an updated service sub-module; and when the service requirement is the service sub-module addition requirement, the plurality of service sub-modules include an added service sub-module.

[0063] S102: A same universal template file is configured for the service module, and the universal template file is a basic file for splitting or merging of the service module.

[0064] S103: A packaging request configured according to a size of the front-end engineering project is received, it is judged whether there is a configuration parameter in the packaging request, and according to a judgment result, a to-be-packaged service sub-module is matched from the plurality of service sub-modules, and a packaging mode corresponding to the to-be-packaged service sub-module is determined; the to-be-packaged service sub-module includes the updated service sub-module or the added service sub-module.

[0065] S104: According to the packaging mode, based on the universal template file, the to-be-packaged service sub-module is split and / or merged from the service main module, and then page packaging is performed to obtain a packaging file.

[0066] Based on the above embodiment, by automatically acquiring the business module under the front-end engineering project when monitoring the abnormal start of the front-end engineering project, and decoupling between modules, the problem of abnormal start of the front-end project can be effectively solved. The business module is configured according to the business requirement definition, and the business sub-module can contain the updated business sub-module and the newly added business sub-module, so that the business module configuration is more flexible and can meet the rapidly changing business requirements. The same general template file is configured for the business module, which lays the foundation for the splitting or merging of the business module. On this basis, the packaging request configured according to the size of the front-end engineering project is received, and it is judged whether there is a configuration parameter in the packaging request, so that the to-be-packaged business sub-module and the corresponding packaging method can be accurately determined. The to-be-packaged business sub-module also contains the updated business sub-module or the newly added business sub-module, so that the business requirements of the user can be met, and the development and maintenance efficiency of projects of different sizes can be improved. Finally, according to the packaging method, the to-be-packaged business sub-module is split and / or merged from the business main module based on the general template file, and then the page is packaged, which can realize the independent packaging and deployment of the business module, effectively reduce the coupling degree of the multiple business sub-modules and the business main module in the business module, improve the reusability and maintainability of the code, and has strong scalability and can support the integration of new businesses.

[0067] In some embodiments, the configuration method of the above business module can be applied to the server side, wherein the server can be connected with the user terminal.

[0068] In the embodiment, the above-mentioned server can specifically include a background server applied to the network service platform side, capable of realizing data transmission, data processing and the like. Specifically, the server may, for example, be an electronic device with data operation, storage and network interaction functions. Alternatively, the server can also be a software program running in the electronic device to provide support for data processing, storage and network interaction. In the embodiment, the number of servers is not specifically limited. The server can be one server, or several servers, or a server cluster formed by several servers.

[0069] The above-mentioned user terminal can specifically include a front end applied to the user side, capable of realizing data acquisition, data transmission and the like. Specifically, the user terminal may, for example, be a desktop computer, a tablet computer, a notebook computer, a smart phone and the like. Alternatively, the user terminal can also be a software application capable of running in the above-mentioned electronic device.

[0070] The above-mentioned user can be a developer of the network service platform, and the target user of the present specification can refer to the developer.

[0071] Before implementation, the target user can determine the business requirement when configuring the business module, and send the business requirement to the server through the user terminal. The target user can also configure a packaging request according to the size of the front-end engineering project, and send it to the server, so that the server can timely perform packaging and other processing.

[0072] In the implementation, the server can first monitor whether the front-end engineering project has a startup exception, such as whether the front-end engineering project cannot start or starts slowly. If the front-end engineering project has a startup exception, the configuration method of the business module provided by the application embodiment can be automatically triggered to automatically obtain a plurality of business sub-modules and corresponding business master modules under the front-end engineering project, so as to effectively decouple the plurality of business sub-modules and the business master module, while supporting flexible configuration and expansion of the plurality of business sub-modules, and meeting the rapidly changing business requirements. Specifically, first, the business module under the front-end engineering project can be obtained, which can include a plurality of business sub-modules and corresponding business master modules. Then, according to the received business requirement sent by the target user, the obtained business module is defined, so that the business module configuration is more flexible and can meet the rapidly changing business requirements. Then, the server can configure a general template file for the business module, so that the business module has consistent or identical general template files, thereby laying a foundation for the splitting or merging of the business module. Then, the server can receive a packaging request. Since the packaging request is configured according to the size of the front-end engineering project, the server packaging process (such as page packaging) is suitable for projects of different sizes. Then, it is judged whether there is a configuration parameter in the packaging request, so that the to-be-packaged business sub-module can be matched from the plurality of business sub-modules according to the judgment result, and the packaging method corresponding to the to-be-packaged business sub-module is determined. The to-be-packaged business sub-module includes the updated business sub-module or the newly added business sub-module, so that the business requirements of the user can be met. Finally, according to the packaging method, the to-be-packaged business sub-module is split and / or merged from the business master module based on the general template file, and then the page is packaged to obtain a packaging file. This can effectively decouple the plurality of business sub-modules and the business master module, reduce the coupling degree of the plurality of business sub-modules and the business master module, and improve the scalability and maintainability of the system.

[0073] In some embodiments, the front-end engineering project in S101 above can refer to a web application or website project built using a series of engineering methods and technologies in the entire life cycle from requirement analysis, design, coding to testing, deployment online and maintenance. When it is monitored that the front-end engineering project has an abnormal start, the business modules under the front-end engineering project can be automatically acquired for decoupling between modules, so that the front-end engineering project can be normally started. The size of the front-end engineering project can be large or small, and different ways of configuration decoupling (such as full packaging, specified module packaging, etc.) can be performed on the business modules under the front-end engineering project according to the size of the front-end engineering project.

[0074] In some embodiments, when the business requirement is a business sub-module update requirement in S101 above, the multiple business sub-modules include an updated business sub-module, which in specific implementation can include:

[0075] S11: converting the multiple business sub-modules into multiple independent business module plug-ins, and converting a target business sub-module carried by the business sub-module update requirement into a target business sub-module plug-in;

[0076] S12: when the business requirement is a business sub-module update requirement, replacing a to-be-updated business sub-module plug-in in the multiple business module plug-ins with the target business sub-module plug-in, and taking the target business sub-module plug-in as an updated business sub-module.

[0077] In some embodiments, when the business requirement is a business sub-module update requirement in S101 above, the multiple business sub-modules include an updated business sub-module, which in specific implementation can include:

[0078] S13: converting a newly-added business sub-module carried by the business sub-module addition requirement into a newly-added business sub-module plug-in;

[0079] S14: when the business requirement is a business sub-module addition requirement, loading the newly-added business sub-module plug-in to the business main module, and taking the newly-added business sub-module plug-in as a newly-added business sub-module.

[0080] In the above embodiments, in order to improve the flexibility of business module configuration and meet the rapidly changing business requirements, the server can receive a business requirement sent by a target user in real time, and the business requirement can include at least one of a business sub-module update requirement and a business sub-module addition requirement. When the business requirement is a business sub-module update requirement or a business sub-module addition requirement, a plug-in extension mechanism can be introduced to convert the corresponding business module into a plug-in, each plug-in can be independently developed, tested and deployed, but all converted plug-ins are managed through the business main module, thereby realizing modular management, rapid business expansion and customization.

[0081] Specifically, the plurality of service sub-modules can be first converted into a plurality of independent service module plug-ins, a target service sub-module carried by a service sub-module update requirement can be converted into a target service sub-module plug-in, or a newly added service sub-module carried by a service sub-module addition requirement can be converted into a newly added service sub-module plug-in. Then, when the service requirement is a service sub-module update requirement, the to-be-updated service sub-module plug-in can be replaced with the target service sub-module plug-in, so as to update the to-be-updated service sub-module plug-in, that is, the to-be-updated service sub-module A can be updated into the target service sub-module plug-in A1. When the service requirement is a service sub-module addition requirement, the newly added service sub-module plug-in can be loaded into the service main module. This plug-in loading manner will not affect the normal operation of the service main module.

[0082] For example, in an e-commerce platform, the service main module can be a main application program, and the plurality of service sub-modules can be payment function modules, commodity management function modules, user management function modules, etc. The payment function modules, the commodity management function modules, and the user management function modules can be converted into a plurality of independent plug-ins. If there is a requirement to add or update a function module, only the corresponding plug-in needs to be loaded or replaced, and the operation of the main application program will not be affected in this process. Of course, when a service sub-module is not needed, the plug-in corresponding to the service sub-module can be unloaded, so that the scalability and maintainability of the system can be effectively improved, the flexible configuration of the service modules can be realized, and the rapidly changing service requirements can be met.

[0083] In some embodiments, referring to Figure 2 As shown in FIG. 7, the same general template file is configured for the service module in S102, and in the specific implementation, the following steps can be included:

[0084] S21: Configure an internal file of the service module, and the internal file includes a temp file;

[0085] S22: Take an output file corresponding to the internal file as a general template file of the service module, and the output file includes an outTemp file;

[0086] S23: Call an execution instruction of the general template file, and make the service module have the same general template file based on the execution instruction.

[0087] In this embodiment, the general template file of the configured service template is the basis for ensuring the smooth splitting or merging of the service module. The general template file can include a temp file inside, the outTemp file (output file) corresponding to the temp file can be defined as the general template file of all global service modules, and then the node instruction or command is called to make the general template files of all service modules consistent, so that a set of basic templates can be shared during development and packaging.

[0088] Specifically, the internal file of the business module, i.e., the temp file, can be configured first, then the output file corresponding to the internal file, i.e., the outTemp file, is used as the general template file of the business module, and finally the execution instruction of the general template file, such as the node instruction or command, can be called, so that the business module has the same general template file based on the execution instruction. Thus, the basic development template (i.e., the general template file) of all modules can be kept consistent, and the same basic template can be shared during development and packaging. At this time, the corresponding execution command is configured, which can be directly executed during development and packaging, ensuring that the general template file of each module is consistent for each module.

[0089] In some embodiments, the packaging request configured according to the size of the front-end engineering project in S103 can include, in specific implementation:

[0090] When the size of the front-end engineering project is small, the packaging request is configured as a full-amount packaging request, and the full-amount packaging request does not include configuration parameters.

[0091] When the size of the front-end engineering project is large, the packaging request is configured as a specified module packaging request, and the specified module packaging request includes configuration parameters.

[0092] In this embodiment, the target user (such as a developer) can configure a packaging request according to the size of the front-end engineering project, and then send the packaging request to the server for different processing. Thus, different sizes of projects can avoid using the same packaging processing method, which further causes problems such as slow project startup or inconvenient code deployment.

[0093] Specifically, when the size of the front-end engineering project is small, the packaging request can be configured as a full-amount packaging request, and the full-amount packaging request can be set to not include configuration parameters, so that the server can perform full-amount packaging on the to-be-packaged business sub-module when it is determined that the packaging request does not include configuration parameters, and the code deployment is more convenient. When the size of the front-end engineering project is large, the packaging request can be configured as a specified module packaging request, and the specified module packaging request can be set to include configuration parameters, so that the server can perform specified module packaging on the to-be-packaged business sub-module when it is determined that the packaging request includes configuration parameters, preventing the situation of memory overflow or very slow project startup caused by direct merge packaging.

[0094] The configured packaging request can be represented by the build command, specifically: vue-cli-service build--mode prod----packPage=xxx. In the command, vue-cli-service build is a command provided by Vue CLI, which is used to package resource files and prepare application deployment. Mode prod specifies the running mode as production mode (production). The two dashes in package=xxx indicate that a parameter is passed to the build tool. Package=xxx is a custom parameter used to pass specific configurations or data during the build process. The purpose of the command is to build the Vue project in production mode and pass a custom parameter package=xxx. The custom parameter package=xxx can be used to specify the target package name, version number, or any other information needed during the build process. In this specification, the business sub-module to be packaged and the corresponding packaging method can be customized, providing high flexibility and strong scalability.

[0095] In some embodiments, referring to Figure 3 The determination of whether the packaging request contains a configuration parameter in S103 can include the following steps in actual implementation:

[0096] S31: Call a configuration parameter separation instruction from a preset configuration file, wherein the configuration parameter separation instruction contains a string separation function;

[0097] S32: Determine whether the configuration parameter can be separated from the packaging request by using the string separation function;

[0098] S321: If yes, it is determined that the packaging request contains a configuration parameter;

[0099] S322: If no, it is determined that the packaging request does not contain a configuration parameter.

[0100] In some embodiments, referring to Figure 4 The determination of the business sub-module to be packaged and the determination of the packaging method corresponding to the business sub-module to be packaged in S103 according to the determination result can include the following steps in actual implementation:

[0101] S41: When it is determined that the packaging request contains a configuration parameter, call a split instruction from a preset configuration file, wherein the split instruction contains a string split function;

[0102] S42: Split the configuration parameter into multiple sub-configuration parameters by using the string split function;

[0103] S43: According to the plurality of sub-configuration parameters, a specified module is matched from the plurality of service sub-modules as a to-be-packaged service sub-module, and it is determined that the packaging mode corresponding to the to-be-packaged service sub-module is specified module packaging.

[0104] S44: When it is determined that there is no configuration parameter in the packaging request, the plurality of service sub-modules are taken as to-be-packaged service sub-modules, and it is determined that the packaging mode corresponding to the to-be-packaged service sub-module is full-amount packaging.

[0105] In the above embodiment, the service sub-modules that need to be packaged can be effectively separated as the to-be-packaged service sub-modules through parameter configuration interception. The specific process of parameter configuration interception is that: in the config file, the command[i].startsWith('--packPage = ') command is used to judge and perform parameter xxx interception and analysis, for example: --packPack = acct, and the corresponding service sub-module that needs to be packaged is obtained through command[i].split[‘=’][1], and when this parameter is not configured, it is full-amount packaging, and index is used as the entry.

[0106] Specifically, a configuration parameter separation instruction can be called from a preset configuration file, and the configuration parameter separation instruction can include a string parsing function. The string separation function can be used to judge and perform parameter interception and analysis, that is, the string separation function can be used to determine whether the configuration parameter can be separated from the packaging request. If yes, it is determined that the packaging request has the configuration parameter, otherwise, it is determined that the packaging request does not have the configuration parameter.

[0107] When it is determined that the packaging request has the configuration parameter, a splitting instruction can be called from the preset configuration file, and the splitting instruction can include a string splitting function. The string splitting function can be used to further split the separated configuration parameter, and a plurality of sub-configuration parameters are obtained. Finally, according to the module name in the plurality of configuration sub-parameters, a service sub-module corresponding to the module name is matched from the plurality of service sub-modules as a specified module, and the specified module is the to-be-packaged service sub-module. At this time, since there is a configuration parameter, the size of the front-end engineering project is large, and it can be determined that the corresponding packaging mode is specified module packaging, that is, each specified module is independently packaged. When it is determined that the packaging request does not have the configuration parameter, the plurality of service sub-modules can be taken as to-be-packaged service sub-modules. Since there is no configuration parameter, the size of the front-end engineering project is small, and it can be determined that the corresponding packaging mode is full-amount packaging.

[0108] The preset configuration file is, for example, a config file, which can contain setting and configuration information and different programs, and can store the data in different formats. The configuration parameter separation instruction can be command[i].startsWith('--packPage = '). The startsWith() is a string parsing function, which can be used to judge the interception and analysis of the configuration parameter.

[0109] The split instruction can be command[i].split[‘=’]. The split[] is a string splitting function, which can be used to split the configuration parameter to obtain the business sub-module to be packaged.

[0110] The parameter configuration interception can effectively separate the business sub-module to be packaged. The business sub-module to be packaged can be dynamically selected according to the business requirement, or can be a preset fixed module. After separating the business sub-module to be packaged, the business sub-module to be packaged can be marked for subsequent packaging processing.

[0111] In some embodiments, the S104 can include the following steps:

[0112] When the packaging mode is full-amount packaging, a plurality of business sub-modules are split from the business main module based on the general template file, and then the plurality of business sub-modules are combined and packaged into an independent page as a packaged file.

[0113] When the packaging mode is specified module packaging, a specified module is split from the business main module based on the general template file, and then the split specified module is packaged into a corresponding independent page as a packaged file.

[0114] In this embodiment, the general template file is a basic file for splitting or combining the business module. After determining the business sub-module to be packaged and the corresponding packaging mode, the business sub-module to be packaged after splitting and / or combining can be packaged into an independent page based on the general template file according to the packaging mode. Thus, the decoupling and flexible configuration of the module are realized.

[0115] Specifically, if the packaging mode is full packaging, a plurality of business sub-modules can be split from the business main module based on the general template file, merged, and then packaged into one independent page. If the packaging mode is specified module packaging, the specified module can be split from the business main module based on the general template file, and then packaged into a corresponding independent page, that is, each specified module corresponds to an independent page, thereby avoiding the situation of memory overflow or very slow project startup. That is, full packaging can package a plurality of business sub-modules into one independent page, and specified module packaging can package each specified module into an independent page, which can be updated by module. Therefore, it can be applied to projects of different sizes and improve the development and maintenance efficiency of projects of different sizes.

[0116] Each embodiment in the specification is described in a progressive manner, and the same or similar parts between each embodiment can be referred to each other, and each embodiment mainly describes the difference from other embodiments. Specifically, the description of the foregoing related processing related embodiments can be referred to, and will not be described here.

[0117] The above describes the present application, however, it is worth noting that the specific embodiments are only for better illustrating the present application, and the specific embodiments of the specification are described. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that in the embodiments and still achieve the desired result. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multi-task processing and parallel processing are possible or can be advantageous.

[0118] In one specific implementation scenario, referring to Figure 5 As shown, the configuration method of the business module provided in the specification can be applied to automatically generate a packaging file. The specific implementation process can include the following content.

[0119] Step one, basic template writing assembly, configure general template

[0120] In the present application, configuring the general template file is the basis for ensuring the smooth splitting and merging of modules. First, configure the general template file of all business modules, which includes the temp file inside, define outTemp (output template) as the general template of all business modules, execute through the node command, so that the basic development template of all modules is consistent, and the same set of basic templates can be shared during development and packaging. At this time, the corresponding execution command is configured, and it can be directly executed during development and packaging, ensuring the consistency of the template file of each module and laying a foundation for the splitting and merging of each module.

[0121] Step two, start the configuration command, add configuration parameters --packPage = xxx

[0122] In the present application, the packaging configuration command, namely the build command, specifically the vue-cli-service build--modeprod----packPage = xxx, is the key to triggering the packaging process. The command accepts a series of parameters, which determine which modules need to be packaged and the packaging method.

[0123] Step three, intercept the parameters to determine whether the configuration parameters are included

[0124] When the packaging configuration command is executed, the command[i].startsWith('--packPage = ') is used to determine and analyze the parameter xxx by intercepting and analyzing the parameter xxx in the config file according to '--packPage = xxx'. For example, if --packPage = acct, the corresponding module to be packaged is obtained by command[i].split[‘=’][1]. When the parameter is not configured, it is full packaging with index as the entry. These parameters can specify the modules to be packaged, the packaging method (full or specified module), etc. By intercepting the parameters, the modules to be packaged can be effectively separated. These modules can be dynamically selected according to business requirements or pre-set fixed modules. The system will mark these modules for subsequent packaging processing.

[0125] Step four, page packaging

[0126] If the configuration parameters are included, the configuration parameters are read dynamically, and this is the specified module packaging method. Otherwise, the default value is configured, and this is the full packaging method. The configuration item is obtained, that is, the business sub-module to be packaged and the corresponding packaging method are obtained. Based on the configured universal template file, the page is packaged after splitting and merging to generate or obtain the packaged file.

[0127] The page packaging method of the present application allows different modules to be packaged into independent pages, thereby realizing the decoupling and flexible configuration of the modules. Through page packaging, full packaging (packaging all modules into one page) and specified module packaging (packaging only specific modules) can be realized. Generally, in the case of small projects and not much content in each business sub-module, the sub-modules are in the same project, and full packaging can be considered, which is convenient for code deployment. If in a large project, each business sub-module is relatively independent and has independent deployment requirements, or the content is too much to cause memory overflow when merged and packaged, or the project starts very slowly, then partial packaging according to modules is suitable.

[0128] Compared with existing technologies, the present invention can achieve the following technical effects:

[0129] (1) Reduced coupling between modules: Decoupling between multiple business sub-modules and the main business module is achieved, reducing the coupling between multiple business sub-modules and the main business module, improving the scalability and maintainability of the system, and eliminating the need for them to be bound together.

[0130] (2) More flexible configuration: Supports dynamic packaging configuration of business sub-modules. Each business sub-module can be packaged and deployed independently or in combination, meeting the rapidly changing business needs. Each packaging can be configured.

[0131] (3) Support for plug-in extension: Through the plug-in extension mechanism, developers are allowed to customize business sub-modules according to business needs and integrate them as plug-ins into the main business module. They can be packaged in blocks and deployed in the same location. Access to the corresponding module can be intercepted through ng configuration, realizing rapid business extension and customization.

[0132] (4) Improved development efficiency: The solution provided by this invention simplifies the interaction process between modules, reduces the development difficulty and workload for developers, and improves development efficiency.

[0133] Although this specification provides the following examples or appendices Figure 6 The method or apparatus structure shown may include more or fewer combined operation steps or module units based on conventional or non-inventive methods. In steps or structures where there is no logically necessary causal relationship, the execution order of these steps or the module structure of the apparatus is not limited to the execution order or module structure shown in the embodiments or drawings of this specification. When the method or module structure is applied in actual devices, servers, or terminal products, it can be executed sequentially or in parallel according to the method or module structure shown in the embodiments or drawings (e.g., in a parallel processor or multi-threaded processing environment, or even a distributed processing or server cluster implementation environment). Based on the above-described method for configuring a business module, this specification also proposes an embodiment of a business module configuration apparatus. Figure 6 As shown, the device may specifically include the following modules:

[0134] The obtaining module 601 can be used to obtain a business module under a front-end engineering project when it is monitored that the front-end engineering project is started abnormally, the business module includes a plurality of business sub-modules and a corresponding business main module, and the business module is defined according to a business requirement; the business requirement at least includes a business sub-module update requirement and a business sub-module addition requirement; when the business requirement is the business sub-module update requirement, a business sub-module that is updated is included in the plurality of business sub-modules; and when the business requirement is the business sub-module addition requirement, a newly added business sub-module is included in the plurality of business sub-modules.

[0135] The configuring module 602 can be used to configure the same universal template file for the business module, and the universal template file is a basic file for splitting or merging of the business module.

[0136] The determining module 603 can be used to receive a packaging request configured according to a size of the front-end engineering project, judge whether a configuration parameter exists in the packaging request, and according to a judgment result, match a to-be-packaged business sub-module from the plurality of business sub-modules and determine a packaging mode corresponding to the to-be-packaged business sub-module; the to-be-packaged business sub-module includes the updated business sub-module or the newly added business sub-module.

[0137] The packaging module 604 can be used to split and / or merge the to-be-packaged business sub-module from the business main module based on the universal template file according to the packaging mode, and then perform page packaging to obtain a packaging file.

[0138] In some embodiments, the obtaining module 601 can be specifically used to convert the plurality of business sub-modules into a plurality of independent business module plug-ins, and convert a target business sub-module carried by the business sub-module update requirement into a target business sub-module plug-in; when the business requirement is the business sub-module update requirement, replace a to-be-updated business sub-module plug-in in the plurality of business module plug-ins with the target business sub-module plug-in, and take the target business sub-module plug-in as the updated business sub-module.

[0139] In some embodiments, the obtaining module 601 can be specifically used to convert a newly added business sub-module carried by the business sub-module addition requirement into a newly added business sub-module plug-in; when the business requirement is the business sub-module addition requirement, load the newly added business sub-module plug-in to the business main module, and take the newly added business sub-module plug-in as the newly added business sub-module.

[0140] In some embodiments, the configuration module 602 can be specifically configured to configure internal files of the service module, the internal files including temp files; take output files corresponding to the internal files as general template files of the service module, the output files including outTemp files; invoke execution instructions of the general template files, and make the service module have the same general template files based on the execution instructions.

[0141] In some embodiments, the determination module 603 can be specifically configured to configure the packaging request as a full-amount packaging request when the front-end engineering project belongs to a small scale, the full-amount packaging request not including configuration parameters; and configure the packaging request as a specified module packaging request when the front-end engineering project belongs to a large scale, the specified module packaging request including configuration parameters.

[0142] In some embodiments, the determination module 603 can be further configured to invoke a configuration parameter separation instruction from a preset configuration file, the configuration parameter separation instruction including a string separation function; determine whether the configuration parameter can be separated from the packaging request by using the string separation function; if yes, determine that the packaging request includes configuration parameters; and if no, determine that the packaging request does not include configuration parameters.

[0143] In some embodiments, the determination module 603 can be further configured to, when it is determined that the packaging request includes configuration parameters, invoke a splitting instruction from a preset configuration file, the splitting instruction including a string splitting function; split the configuration parameters into a plurality of sub-configuration parameters by using the string splitting function; and according to the plurality of sub-configuration parameters, match a specified module from a plurality of service sub-modules as a to-be-packaged service sub-module, and determine that a packaging manner corresponding to the to-be-packaged service sub-module is a specified module packaging; and when it is determined that the packaging request does not include configuration parameters, take the plurality of service sub-modules as to-be-packaged service sub-modules, and determine that a packaging manner corresponding to the to-be-packaged service sub-modules is full-amount packaging.

[0144] In some embodiments, the packaging module 604 can be specifically configured to, when the packaging manner is full-amount packaging, split a plurality of service sub-modules from a service main module based on the general template file, merge the plurality of service sub-modules, and then package the merged plurality of service sub-modules into an independent page as a packaging file; and when the packaging manner is specified module packaging, split a specified module from the service main module based on the general template file, and then package the specified module into a corresponding independent page as a packaging file.

[0145] From the above, the configuration device of the service module provided by the embodiment of the present specification can effectively realize the decoupling between service modules, improve the maintainability and scalability of the system, and improve the reusability and maintainability of the code. The configuration of the service module is flexible, which can meet the rapidly changing business requirements. The scalability is strong, and the rapid integration of new services can be well supported.

[0146] The embodiment of the present specification also provides an electronic device based on the above-mentioned configuration method of the service module, which comprises a processor and a memory for storing programs / instructions executable by the processor. When the processor is implemented, the following steps can be performed according to the programs / instructions: when it is monitored that the front-end engineering project starts abnormally, the service module under the front-end engineering project is acquired, the service module comprises a plurality of service sub-modules and a corresponding service main module, and the service module is defined according to business requirements; the business requirements at least include service sub-module update requirements and service sub-module addition requirements; when the business requirements are service sub-module update requirements, the plurality of service sub-modules containing updated service sub-modules are configured; when the business requirements are service sub-module addition requirements, the plurality of service sub-modules containing added service sub-modules are configured; the same general template file is configured for the service module, the general template file is a basic file for splitting or merging the service module; a packaging request configured according to the size of the front-end engineering project is received, it is judged whether there is a configuration parameter in the packaging request, and according to the judgment result, a to-be-packaged service sub-module is matched from the plurality of service sub-modules, and a packaging method corresponding to the to-be-packaged service sub-module is determined; the to-be-packaged service sub-module contains the updated service sub-module or the added service sub-module; according to the packaging method, the to-be-packaged service sub-module is split and / or merged from the service main module based on the general template file, and then the page is packaged to obtain a packaging file.

[0147] In order to be able to more accurately complete the above-mentioned instructions, referring to Figure 7 The embodiment of the present specification also provides another specific electronic device, wherein the electronic device comprises a network communication port 701, a processor 702 and a memory 703. The above structure is connected by internal cables, so that each structure can perform specific data interaction.

[0148] The network communication port 701 can be used to obtain a business module under the front-end engineering project when monitoring that the front-end engineering project is abnormally started, the business module includes a plurality of business sub-modules and a corresponding business main module, and the business module is defined according to a business requirement; the business requirement at least includes a business sub-module update requirement and a business sub-module addition requirement; when the business requirement is the business sub-module update requirement, the plurality of business sub-modules include an updated business sub-module; and when the business requirement is the business sub-module addition requirement, the plurality of business sub-modules include an added business sub-module.

[0149] The processor 702 can be used to configure the same universal template file for the business module, the universal template file is a basic file for splitting or merging of the business module; receive a packaging request configured according to a size of the front-end engineering project; determine whether there is a configuration parameter in the packaging request, and match a to-be-packaged business sub-module from the plurality of business sub-modules according to a determination result and determine a packaging mode corresponding to the to-be-packaged business sub-module; the to-be-packaged business sub-module includes the updated business sub-module or the added business sub-module; split and / or merge the to-be-packaged business sub-module from the business main module based on the universal template file according to the packaging mode, and then perform page packaging to obtain a packaging file.

[0150] The memory 703 can be used to store corresponding instruction programs.

[0151] In this embodiment, the network communication port 701 can be bound with different communication protocols, so as to be a virtual port for sending or receiving different data. For example, the network communication port can be a port responsible for web data communication, can also be a port responsible for FTP data communication, and can also be a port responsible for mail data communication. In addition, the network communication port can also be an entity communication interface or a communication chip. For example, it can be a wireless mobile network communication chip such as GSM, CDMA, etc.; it can also be a Wifi chip; and it can also be a Bluetooth chip.

[0152] In this embodiment, the processor 702 can be implemented in any appropriate manner. For example, the processor can take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (such as software or firmware) executable by the (micro)processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, and the like. The present specification is not limited.

[0153] In the embodiment, the memory 703 can include multiple levels, and can be any memory capable of storing binary data in a digital system; in an integrated circuit, a circuit without a physical form having a storage function is also called a memory, such as RAM, FIFO, etc.; in a system, a storage device with a physical form is also called a memory, such as a memory stick, a TF card, etc.

[0154] The embodiment of the present specification also provides a computer storage medium based on the configuration method of the business module, the computer storage medium stores computer programs / instructions, and when the computer programs / instructions are executed, the following functions and effects are realized: when it is monitored that a front-end engineering project is abnormally started, a business module under the front-end engineering project is acquired, the business module includes a plurality of business sub-modules and a corresponding business main module, and the business module is defined according to a business requirement; the business requirement at least includes a business sub-module update requirement and a business sub-module addition requirement; when the business requirement is the business sub-module update requirement, a business sub-module containing an updated business sub-module in the plurality of business sub-modules is configured; when the business requirement is the business sub-module addition requirement, a business sub-module containing an added business sub-module in the plurality of business sub-modules is configured; a same universal template file is configured for the business module, the universal template file is a basic file for splitting or merging of the business module; a packaging request configured according to a size of the front-end engineering project is received, it is judged whether there is a configuration parameter in the packaging request, and according to a judgment result, a to-be-packaged business sub-module is matched from the plurality of business sub-modules, and a packaging mode corresponding to the to-be-packaged business sub-module is determined; the to-be-packaged business sub-module contains the updated business sub-module or the added business sub-module; according to the packaging mode, the to-be-packaged business sub-module is split and / or merged from the business main module based on the universal template file, and then page packaging is performed to obtain a packaging file.

[0155] In the embodiment, the storage medium includes but is not limited to a random access memory (RAM), a read-only memory (ROM), a cache, a hard disk drive (HDD), or a memory card. The memory can be used to store computer program instructions. The network communication unit can be an interface set according to a standard specified by a communication protocol, and is used for network connection communication.

[0156] In the embodiment, the functions and effects realized by the program instructions stored in the computer storage medium can be explained by comparing with other embodiments, and will not be described here.

[0157] The embodiment of the present specification further provides a computer program product based on the configuration method of the business module, comprising a non-transitory computer-readable storage medium storing computer programs / instructions, the computer programs / instructions being operable to make a computer execute the following steps: when monitoring that a front-end engineering project is abnormally started, acquiring a business module under the front-end engineering project, the business module comprising a plurality of business sub-modules and a corresponding business main module, and the business module being defined according to a business requirement; the business requirement at least comprising a business sub-module update requirement and a business sub-module addition requirement; when the business requirement is the business sub-module update requirement, configuring the plurality of business sub-modules to contain an updated business sub-module; when the business requirement is the business sub-module addition requirement, configuring the plurality of business sub-modules to contain an added business sub-module; configuring the same universal template file for the business module, the universal template file being a basic file for splitting or merging of the business module; receiving a packaging request configured according to a size of the front-end engineering project, judging whether there is a configuration parameter in the packaging request, and according to a judgment result, matching a to-be-packaged business sub-module from the plurality of business sub-modules and determining a packaging mode corresponding to the to-be-packaged business sub-module; the to-be-packaged business sub-module containing the updated business sub-module or the added business sub-module; according to the packaging mode, based on the universal template file, splitting and / or merging the to-be-packaged business sub-module from the business main module, and then performing page packaging to obtain a packaging file.

[0158] Although the present specification provides method operation steps as described in the embodiments or flowcharts, more or fewer operation steps can be included based on conventional or non-inventive means. The order of steps listed in the embodiments is only one of the many step execution orders, and does not represent the only execution order. When the device or client product is executed in practice, the method order shown in the embodiments or the drawings can be executed in sequence or in parallel (for example, in a parallel processor or multi-thread processing environment, or even in a distributed data processing environment). The terms "include", "contain" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, product or equipment including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or includes elements inherent to such process, method, product or equipment. Without more limitations, it does not exclude the presence of other same or equivalent elements in the process, method, product or equipment including the elements. The terms "first", "second" and the like are used to represent names, and do not represent any particular order.

[0159] Those skilled in the art will also appreciate that, in addition to being implemented in purely computer readable program code means, the controller can be implemented using logic gates, switches, application specific integrated circuits, programmable logic controllers and embedded microcontrollers to perform the same functions as described by the method steps. The controller can therefore be considered to be a hardware component and the means for performing the various functions described therein can be considered to be structures within the hardware component. Alternatively, the means for performing the various functions can be considered to be both software modules which implement the method and structures within the hardware component.

[0160] The specification can be described in the general context of computer- executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, classes, etc., that perform particular tasks or implement particular abstract data types. Computer-executable instructions, associated data structures, and the like, can also be stored in distributed environments, such as over a network, and can be executed by remote processing devices that are coupled to the network. The program modules can be stored in local and remote computer storage media including memory storage devices.

[0161] As can be seen from the foregoing description of the embodiments, those skilled in the art can clearly understand that the specification can be implemented by means of software plus necessary universal hardware platforms. Based on such an understanding, the technical solutions of the specification can essentially be embodied in a form of a software product. The computer software product can be stored in a storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, and the like, and includes a plurality of instructions to cause a computer device (which can be a personal computer, a mobile terminal, a server, or a network device, etc.) to execute the methods described in each of the embodiments or some parts of the embodiments.

[0162] The embodiments in the specification are described in a progressive manner, and the same or similar parts among the embodiments can be referred to each other. Each of the embodiments focuses on the differences from other embodiments. The specification can be used in many general or specific computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.

[0163] Although the specification is described through the embodiments, those skilled in the art know that the specification has many modifications without departing from the spirit of the specification, and it is intended that the appended claims encompass such modifications without departing from the spirit of the specification.

Claims

1. A method of configuring a service module, characterized by, The application relates to a method for configuring a front-end engineering project, and belongs to the technical field of front-end engineering. When an abnormal front-end engineering project start is monitored, a business module under the front-end engineering project is acquired, the business module comprises a plurality of business submodules and a corresponding business main module, and the business module is defined according to a business requirement; the business requirement at least comprises a business submodule update requirement and a business submodule addition requirement; when the business requirement is the business submodule update requirement, an updated business submodule is configured in the plurality of business submodules; and when the business requirement is the business submodule addition requirement, a new business submodule is configured in the plurality of business submodules. A same general template file is configured for the business module, and the general template file is a basis file for splitting or merging of the business module. A packaging request configured according to a scale of the front-end engineering project is received, it is judged whether a configuration parameter exists in the packaging request, and according to a judgment result, a to-be-packaged business submodule is matched from the plurality of business submodules, and a packaging mode corresponding to the to-be-packaged business submodule is determined; the to-be-packaged business submodule comprises the updated business submodule or the new business submodule. According to the packaging mode, the to-be-packaged business submodule is split and / or merged from the business main module based on the general template file, and then page packaging is carried out to obtain a packaging file.

2. The method of claim 1, wherein, When the business requirement is the business submodule update requirement, the plurality of business submodules are converted into a plurality of independent business module plug-ins, and a target business submodule carried by the business submodule update requirement is converted into a target business submodule plug-in. When the business requirement is the business submodule update requirement, a to-be-updated business submodule plug-in in the plurality of business module plug-ins is replaced by the target business submodule plug-in, and the target business submodule plug-in is taken as the updated business submodule. When the business requirement is the business submodule addition requirement, a new business submodule carried by the business submodule addition requirement is converted into a new business submodule plug-in.

3. The method of claim 1, wherein, When the business requirement is the business submodule addition requirement, the new business submodule plug-in is loaded into the business main module, and the new business submodule plug-in is taken as the new business submodule. The method comprises the following steps: The internal file of the business module is configured, and the internal file comprises a temp file; 4. The method of claim 1, wherein, An output file corresponding to the internal file is taken as the general template file of the business module, and the output file comprises an outTemp file; An execution instruction of the general template file is called, and the business module has the same general template file based on the execution instruction. When the scale of the front-end engineering project is small, the packaging request is configured as a full-amount packaging request, and no configuration parameter exists in the full-amount packaging request. ​ 5. The method of claim 1, wherein, ​ ​ When the size of the front-end engineering project is large, the packaging request is configured as a specified module packaging request, and the specified module packaging request includes a configuration parameter.

6. The method of claim 1, wherein, The determination of whether the configuration parameter exists in the packaging request includes: The configuration parameter separation instruction is called from the preset configuration file, and the configuration parameter separation instruction includes a string separation function; The string separation function is used to determine whether the configuration parameter can be separated from the packaging request; If yes, it is determined that the configuration parameter exists in the packaging request; If no, it is determined that the configuration parameter does not exist in the packaging request.

7. The method of claim 1, wherein, The matching of the to-be-packaged business sub-module from the plurality of business sub-modules according to the determination result and the determination of the packaging mode corresponding to the to-be-packaged business sub-module include: When it is determined that the configuration parameter exists in the packaging request, the split instruction is called from the preset configuration file, and the split instruction includes a string split function; The configuration parameter is split into a plurality of sub-configuration parameters by using the string split function; According to the plurality of sub-configuration parameters, a specified module is matched from the plurality of business sub-modules as a to-be-packaged business sub-module, and it is determined that the packaging mode corresponding to the to-be-packaged business sub-module is a specified module packaging; When it is determined that the configuration parameter does not exist in the packaging request, the plurality of business sub-modules are used as to-be-packaged business sub-modules, and it is determined that the packaging mode corresponding to the to-be-packaged business sub-module is full-quantity packaging.

8. The method of claim 1, wherein, The splitting or merging of the to-be-packaged business sub-module from the business main module based on the universal template file according to the packaging mode, and then the page packaging include: When the packaging mode is full-quantity packaging, the plurality of business sub-modules are split from the business main module based on the universal template file, and then the plurality of business sub-modules are merged, and the merged plurality of business sub-modules are packaged into an independent page as a packaging file; When the packaging mode is specified module packaging, the specified module is split from the business main module based on the universal template file, and then the split specified module is packaged into a corresponding independent page as a packaging file.

9. An arrangement for configuring a service module, characterized by It includes: The acquisition module is configured to acquire the business module under the front-end engineering project when it is monitored that the front-end engineering project starts abnormally, the business module includes a plurality of business sub-modules and a corresponding business main module, and the business module is defined according to a business requirement; the business requirement at least includes a business sub-module update requirement and a business sub-module addition requirement; when the business requirement is the business sub-module update requirement, the plurality of business sub-modules include an updated business sub-module; and when the business requirement is the business sub-module addition requirement, the plurality of business sub-modules include an added business sub-module; The configuration module is configured to configure the same universal template file for the business module, and the universal template file is a basis file for splitting or merging the business module; A determining module is configured to receive a packaging request configured according to a size of a front-end engineering project, judge whether there is a configuration parameter in the packaging request, and match a to-be-packaged business submodule from the plurality of business submodules according to a judgment result and determine a packaging mode corresponding to the to-be-packaged business submodule; the to-be-packaged business submodule includes the updated business submodule or the added business submodule; A packaging module is configured to split and / or combine the to-be-packaged business submodule from the business main module based on the universal template file according to the packaging mode, and then perform page packaging to obtain a packaged file.

10. A computer device comprising a memory, a processor, and a computer program / instructions stored on the memory, wherein, The processor executes the computer program / instruction to implement the steps of the method of any one of claims 1 to 8.

11. A computer readable storage medium having stored thereon computer programs / instructions, characterized in that, The computer program / instruction is executed by the processor to implement the steps of the method of any one of claims 1 to 8.

12. A computer program product containing computer programs / instructions, characterized in that, The computer program / instruction is executed by the processor to implement the steps of the method of any one of claims 1 to 8.

Citation Information

Patent Citations

  • Abnormal service function module processing method and device, equipment and medium

    CN115269334A

  • Business processing method and device based on micro-front-end single-bin architecture and architecture

    CN118170426A