Small program multi-instance reuse deployment method and device, equipment, medium and product

By using a unified configuration mechanism and command-line selection, multiple instances of a mini-program can be deployed using the same code structure, which solves the problems of code redundancy, high maintenance costs and error susceptibility in existing technologies, and is suitable for high concurrency requirements in multi-instance deployment scenarios.

CN120848874AInactive Publication Date: 2025-10-28CHENGDU YUBUO TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511349025.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-22
Publication Date
2025-10-28
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing methods for deploying mini-program instances suffer from code redundancy, high maintenance costs, error-proneness, and difficulty in achieving automated deployment, especially in multi-instance deployment scenarios.

Method used

A configuration selection menu is popped up through the command line tool, the target mini program instance is determined based on user interaction operations, the structured file is read and the configuration information is injected into the core configuration file, irrelevant configuration items are removed, and the build directory is output to enable multiple instances to share the same code structure.

Benefits of technology

It solves the redundancy, inefficiency and error-prone problems in multi-instance deployment scenarios, reduces development and maintenance costs, improves code consistency and release accuracy, and is suitable for high-concurrency scenarios such as platform-based, SaaS-based or multi-channel operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120848874A_ABST
    Figure CN120848874A_ABST
Patent Text Reader

Abstract

The invention discloses an applet multi-instance reuse deployment method, device and equipment, a medium and a product, and relates to the technical field of applet front-end development. The method comprises the following steps: popping up a configuration selection menu containing independent configuration instances of a plurality of to-be-selected applets through a command line tool, and then determining an instance selected by a user and reading a structured file of the instance according to man-machine interaction operation of the user, the method comprises the following steps of: firstly, using a configuration injection script to inject configuration information in a file into a core configuration file of an applet project, finally removing invalid data in the applet project, and outputting the content obtained after removal processing into a construction directory so as to be used for uploading, previewing or CI / CD construction and release of the applet project. Therefore, a construction mode that a plurality of applet instances share the same set of native code structure can be realized, so that the problems of redundancy, low efficiency, error proneness and the like in a multi-instance deployment scene are solved, and practical application and popularization are facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of mini-program front-end development technology, specifically relating to a method, apparatus, device, medium, and product for multi-instance reuse deployment of mini-programs. Background Technology

[0002] Mini-programs are applications that can be used without downloading or installing them, realizing the dream of "applications at your fingertips." Users can open the application simply by scanning a QR code or searching for it. Mini-programs also embody the "use and go" concept, so users don't need to worry about installing too many applications.

[0003] Currently, multiple mini-programs run simultaneously in ecosystems such as WeChat to cover different markets, brands, or channels. These mini-programs usually maintain a consistent code structure, but differ in configurations (such as name, AppID, icon, theme color, entry page, business description, and some other configuration differences).

[0004] To eliminate the above differences and improve user experience, the two main deployment methods for existing mini-program instances are as follows: one is to maintain an independent code repository or branch for each mini-program, and the other is to clone the main project multiple times, modify the configuration and upload them separately. However, these methods have the following drawbacks: (1) code redundancy, that is, each mini-program maintains a separate code, making upgrades difficult; (2) high maintenance cost, that is, multiple instances need to be synchronized for each update; (3) prone to errors, that is, more manual operations, and configurations are easy to be missed; (4) not conducive to automated building, that is, it is difficult to integrate with CI / CD (i.e., the abbreviation for Continuous Integration and Continuous Deployment or Continuous Delivery, which are practices used in modern software development to automate the software delivery process) process. Summary of the Invention

[0005] The purpose of this invention is to provide a method, apparatus, computer device, computer-readable storage medium, and computer program product for reusing and deploying multiple instances of a mini-program, in order to solve the problems of redundancy, inefficiency, and error-proneness in existing mini-program instance deployment methods in multi-instance deployment scenarios.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions: Firstly, a method for reusing and deploying multiple instances of a mini-program is provided, including: When the build command is received, a configuration selection menu pops up via the command line tool. The configuration selection menu contains multiple independent configuration instances of the app to be selected. Based on the user's human-computer interaction, determine the independent configuration instance of the target mini-program selected by the user in the configuration selection menu, and read the structured file of the independent configuration instance of the target mini-program. The configuration injection script is loaded by the build tool, and the configuration information in the structured file is injected into the core configuration file of the mini-program project using the configuration injection script. Remove irrelevant configuration items or other mini-program references from the mini-program project; The removed content is output to the build directory of the mini-program project for use in uploading, previewing, or CI / CD building and publishing of the mini-program project.

[0007] Based on the above-mentioned invention, a novel solution is provided for reusing the construction of multiple instances of mini-programs using a unified configuration mechanism. First, a configuration selection menu containing multiple independent configuration instances of mini-programs is displayed via a command-line tool. Then, based on the user's human-computer interaction, the selected instance is determined and its structured file is read. Next, a configuration injection script injects the configuration information from the file into the core configuration file of the mini-program project. Finally, invalid data in the mini-program project is removed, and the resulting content is output to the build directory for use in uploading, previewing, or CI / CD building and publishing of the mini-program project. By extracting the differentiated configurations required for mini-program operation into independent configuration files and combining a command-line selection mechanism with a custom build script, corresponding configurations are dynamically injected during the build phase, and independent build results are output. This allows multiple mini-program instances to share the same native code structure, thus solving problems such as redundancy, inefficiency, and error susceptibility in multi-instance deployment scenarios. It is particularly suitable for the deployment needs of multiple mini-programs in high-concurrency scenarios such as platform-based, SaaS-based, or multi-channel operations, facilitating practical application and promotion.

[0008] In one possible design, the independent configuration instance includes an AppID, project name, homepage path, and / or configuration icon, and the structured file is in JSON format.

[0009] In one possible design, the command-line tool is an interactive command-line tool created based on the Inquirer library.

[0010] In one possible design, the build tool is either the static module bundler webpack or the Node.js development tool.

[0011] In one possible design, the core configuration files include the project.config.json configuration file, the app.json configuration file, and the sitemap.json configuration file.

[0012] In one possible design, the irrelevant configuration items include configuration items with unselected configuration items and / or configuration items with redundant variables.

[0013] Secondly, a multi-instance reuse deployment device for mini-programs is provided, including a configuration menu pop-up unit with sequential communication connections, a configuration confirmation reading unit, a configuration information injection unit, an invalid data clearing unit, and a directory output building unit. The configuration menu pop-up unit is used to pop up a configuration selection menu via a command-line tool when a start build command is received. The configuration selection menu contains multiple independent configuration instances of the mini-programs to be selected. The configuration determination and reading unit is used to determine the independent configuration instance of the target mini-program selected by the user in the configuration selection menu based on the user's human-computer interaction operation, and read the structured file of the independent configuration instance of the target mini-program. The configuration information injection unit is used to load a configuration injection script through a build tool and use the configuration injection script to inject the configuration information in the structured file into the core configuration file of the mini-program project. The invalid data removal unit is used to remove irrelevant configuration items or other mini-program reference information from the mini-program project; The build directory output unit is used to output the content obtained after removal processing to the build directory of the mini-program project, so as to be used for uploading, previewing or CI / CD building and publishing of the mini-program project.

[0014] Thirdly, the present invention provides a computer device, comprising a storage module, a processing module, and a transceiver module that are sequentially and communicatively connected, wherein the storage module is used to store a computer program, the transceiver module is used to send and receive messages, and the processing module is used to read the computer program and execute the mini-program multi-instance reuse deployment method as described in the first aspect or any possible design in the first aspect.

[0015] Fourthly, the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, perform the applet multi-instance reuse deployment method as described in the first aspect or any possible design in the first aspect.

[0016] Fifthly, the present invention provides a computer program product, including a computer program or instructions, wherein when the computer program or instructions are executed by a computer, they implement the mini-program multi-instance reuse deployment method as described in the first aspect or any possible design in the first aspect.

[0017] The beneficial effects of the above scheme are: (1) This invention creatively provides a new solution for reusing multiple instances of mini-programs using a unified configuration mechanism. First, a configuration selection menu containing multiple independent configuration instances of mini-programs is popped up through a command-line tool. Then, based on the user's human-computer interaction, the user selects an instance and reads the structured file of that instance. Then, a configuration injection script is used to inject the configuration information in the file into the core configuration file of the mini-program project. Finally, invalid data in the mini-program project is removed, and the content obtained after removal is output to the build directory for use in uploading, previewing, or CI / CD building and publishing of the mini-program project. Thus, by extracting the differentiated configuration required for the operation of the mini-program into an independent configuration file and combining the command-line selection mechanism with a custom build script, the corresponding configuration is dynamically injected and the independent build result is output during the build phase. This can realize the construction method of multiple mini-program instances sharing the same native code structure, thereby solving the problems of redundancy, inefficiency, and error in multi-instance deployment scenarios. It is particularly suitable for the deployment needs of multiple mini-programs in high-concurrency scenarios such as platform, SaaS, or multi-channel operation. (2) It can significantly reduce the development and maintenance costs of multiple mini-programs; (3) It can maintain code consistency and facilitate unified upgrades and version control; (4) It can avoid errors caused by manually modifying the configuration; (5) It can effectively solve the problems of low code reuse rate (i.e., in the traditional way, each mini-program needs to maintain a separate code, which is repetitive and the versions are inconsistent), easy to make mistakes when manually modifying the configuration (i.e., in the traditional way, the configuration is frequently switched manually in files such as app.json and project.config.json, which has a high error rate), inability to adapt to automated processes (i.e., the traditional way cannot connect to CI / CD and it is difficult to realize the automatic release of multiple instances) and lack of isolation and cleanup mechanisms (i.e., in the traditional way, multiple mini-program configurations are manually maintained, which is easy to cause confusion and redundancy). (6) With this invention, developers only need to maintain one set of business code, and can quickly build and publish different mini-program instances by selecting configurations, which can significantly improve project maintenance efficiency and publishing accuracy while maintaining more than 95% code logic reuse, making it easier for practical application and promotion. Attached Figure Description

[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0019] Figure 1 This is a flowchart illustrating the method for reusing and deploying multiple instances of a mini-program as provided in this embodiment of the application.

[0020] Figure 2 This is an example screenshot of launching and selecting a target applet provided in an embodiment of this application.

[0021] Figure 3 This is a schematic diagram of the structure of the mini-program multi-instance reuse deployment device provided in the embodiments of this application.

[0022] Figure 4 A schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the present invention will be briefly introduced below in conjunction with the accompanying drawings and descriptions of the embodiments or the prior art. Obviously, the following description of the structure of the accompanying drawings is only some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained based on these embodiments without creative effort. It should be noted that the description of these embodiments is for the purpose of helping to understand the present invention, but does not constitute a limitation of the present invention.

[0024] It should be understood that although the terms "first" and "second", etc., may be used herein to describe various objects, these objects should not be limited by these terms. These terms are only used to distinguish one object from another. For example, the first object may be referred to as the second object, and similarly, the second object may be referred to as the first object, without departing from the scope of the exemplary embodiments of the invention.

[0025] It should be understood that the term "and / or" that may appear in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, B exists alone, or A and B exist simultaneously. Another example is A, B and / or C, which can mean that any one of A, B, and C or any combination thereof exists. The term " / and" that may appear in this document describes another relationship between related objects, indicating that two relationships can exist. For example, A / and B can mean: A exists alone or A and B exist simultaneously. In addition, the character " / " that may appear in this document generally indicates that the related objects before and after it are in an "or" relationship.

[0026] Example like Figure 1As shown, the multi-instance reuse deployment method for mini-programs provided in the first aspect of this embodiment can be executed, but is not limited to, by computer devices with certain computing resources, such as servers, personal computers (PCs, referring to a type of multi-purpose computer suitable for personal use in terms of size, price, and performance; desktops, laptops, mini-laptops, tablets, and ultrabooks are all considered personal computers), smartphones, personal digital assistants (PDAs), or wearable devices. Figure 1 As shown, the method for reusing and deploying multiple instances of a mini-program includes, but is not limited to, the following steps S1 to S5.

[0027] S1. Upon receiving the start build command, a configuration selection menu pops up via the command-line tool. The configuration selection menu includes, but is not limited to, multiple independent configuration instances of the app to be selected.

[0028] In step S1, each mini-program's independent configuration instance is the mini-program deployment instance to be selected. Specifically, the independent configuration instance includes, but is not limited to, AppID, project name, homepage path, and / or configuration icon. The multiple independent configuration instances of mini-programs can be stored as structured files in a specified directory (e.g., the " / configs" directory), wherein the structured files can be, but are not limited to, JSON format files. The command-line tool can be, but is not limited to, an interactive command-line tool created based on the Inquirer library. The Inquirer library is a Node.js library used to create interactive command-line tools, commonly used to collect user input; therefore, it can routinely display the configuration selection menu for the user to make selections, such as... Figure 2 As shown. Furthermore, the start-up build command can be routinely triggered by the user when building a mini-program project.

[0029] S2. Based on the user's human-computer interaction operation, determine the independent configuration instance of the target mini-program selected by the user in the configuration selection menu, and read the structured file of the independent configuration instance of the target mini-program.

[0030] In step S2, as Figure 2 As shown, the target mini-program can be exemplified by the "**White Collar" mini-program. The structured file of the independent configuration instance of this mini-program is pre-stored in the " / configs" directory and can be accessed normally.

[0031] S3. Load the configuration injection script through the build tool, and use the configuration injection script to inject the configuration information in the structured file into the core configuration file of the mini-program project.

[0032] In step S3, specifically, the build tool can be, but is not limited to, the static module bundler webpack or Node.js development tools; these tools are all existing tools. For example, the static module bundler webpack is a code compilation tool for modern JavaScript applications, with entry points, exit points, and plugins. When processing an application, it internally builds a dependency graph, which maps to each module required by the project and generates one or more bundle files. Therefore, the configuration injection script can be loaded routinely during the build process. The configuration injection script is used to inject the configuration information in the structured file into the core configuration file of the mini-program project, and can be routinely written. For example, when the build tool uses the static module bundler webpack, the configuration injection script is a user-defined Loader script. This Loader script is equivalent to a project plugin in the static module bundler webpack, capable of uniformly processing specified files. It is also a function, meaning the source code passes through this function and is transformed into the desired target. The core configuration files are those located in the root directory of the mini-program project, including, but not limited to, project.config.json, app.json, and sitemap.json. These configuration files are all existing files. For example, app.json is the global configuration file for the corresponding mini-program, project.config.json is the project configuration file for the corresponding mini-program, and so on. S4. Remove irrelevant configuration items or other mini-program reference information from the mini-program project.

[0033] In step S4, the purpose of the removal process is to ensure that the construction result is clean and minimized; specifically, the irrelevant configuration items include, but are not limited to, configuration items with unselected configuration items and / or configuration items with redundant variables.

[0034] S5. Output the removed content to the build directory of the mini-program project so that it can be used for uploading, previewing or CI / CD building and publishing of the mini-program project.

[0035] In step S5, the construction directory of the mini-program project is specifically, but not limited to, the dist / instance-name directory (which can be in the form of ".temp / <instance name>").

[0036] Therefore, based on the multi-instance reuse deployment method for mini-programs described in steps S1 to S5 above, a new solution is provided to achieve multi-instance reuse construction of mini-programs using a unified configuration mechanism. First, a configuration selection menu containing multiple independent configuration instances of mini-programs is displayed via a command-line tool. Then, based on the user's human-computer interaction, the selected instance is determined and its structured file is read. Next, a configuration injection script is used to inject the configuration information from the file into the core configuration file of the mini-program project. Finally, invalid data in the mini-program project is removed, and the resulting content is output to the build directory for use in uploading, previewing, or CI / CD building and publishing of the mini-program project. By extracting the differentiated configurations required for mini-program operation into independent configuration files and combining the command-line selection mechanism with a custom build script, corresponding configurations are dynamically injected during the build phase, and independent build results are output. This allows multiple mini-program instances to share the same native code structure, thus solving problems such as redundancy, inefficiency, and error susceptibility in multi-instance deployment scenarios. It is particularly suitable for the deployment needs of multiple mini-programs in high-concurrency scenarios such as platform-based, SaaS-based, or multi-channel operations, facilitating practical application and promotion.

[0037] like Figure 3 As shown, the second aspect of this embodiment provides a virtual device for implementing the multi-instance reuse deployment method of the mini-program described in the first aspect, including a configuration menu pop-up unit, a configuration determination reading unit, a configuration information injection unit, an invalid data clearing unit, and a directory output building unit with sequential communication connections; The configuration menu pop-up unit is used to pop up a configuration selection menu via a command-line tool when a start build command is received. The configuration selection menu contains multiple independent configuration instances of the mini-programs to be selected. The configuration determination and reading unit is used to determine the independent configuration instance of the target mini-program selected by the user in the configuration selection menu based on the user's human-computer interaction operation, and read the structured file of the independent configuration instance of the target mini-program. The configuration information injection unit is used to load a configuration injection script through a build tool and use the configuration injection script to inject the configuration information in the structured file into the core configuration file of the mini-program project. The invalid data removal unit is used to remove irrelevant configuration items or other mini-program reference information from the mini-program project; The build directory output unit is used to output the content obtained after removal processing to the build directory of the mini-program project, so as to be used for uploading, previewing or CI / CD building and publishing of the mini-program project.

[0038] The working process, working details and technical effects of the aforementioned device provided in the second aspect of this embodiment can be found in the method for reusing and deploying multiple instances of a mini-program described in the first aspect, and will not be repeated here.

[0039] like Figure 4 As shown, the third aspect of this embodiment provides a computer device for executing the mini-program multi-instance reuse deployment method as described in the first aspect. The device includes a storage module, a processing module, and a transceiver module connected in sequence. The storage module stores a computer program, the transceiver module sends and receives messages, and the processing module reads the computer program and executes the mini-program multi-instance reuse deployment method as described in the first aspect. Specifically, the storage module may include, but is not limited to, random-access memory (RAM), read-only memory (ROM), flash memory, first-in-first-out (FIFO) memory, and / or first-in-last-out (FILO) memory, etc.; the processing module may, but is not limited to, use a microprocessor of the STM32F105 series. Furthermore, the computer device may also include, but is not limited to, a power supply module, a display screen, and other necessary components.

[0040] The working process, working details and technical effects of the aforementioned computer device provided in the third aspect of this embodiment can be found in the method for reusing and deploying multiple instances of a mini-program described in the first aspect, and will not be repeated here.

[0041] This fourth aspect of the embodiment provides a computer-readable storage medium storing instructions comprising the method for deploying multiple instances of a mini-program as described in the first aspect. Specifically, the computer-readable storage medium stores instructions that, when executed on a computer, perform the method for deploying multiple instances of a mini-program as described in the first aspect. The computer-readable storage medium refers to a carrier for storing data, and may include, but is not limited to, computer-readable storage media such as floppy disks, optical disks, hard disks, flash memory, USB flash drives, and / or Memory Sticks. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.

[0042] The working process, working details and technical effects of the aforementioned computer-readable storage medium provided in the fourth aspect of this embodiment can be found in the method for reusing and deploying multiple instances of a mini-program as described in the first aspect, and will not be repeated here.

[0043] This fifth aspect of the embodiment provides a computer program product, including a computer program or instructions, which, when executed by a computer, implements the applet multi-instance reuse deployment method as described in the first aspect. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.

[0044] Finally, it should be noted that the above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for reusing and deploying multiple instances of a mini-program, characterized in that, include: When the build command is received, a configuration selection menu pops up via the command line tool. The configuration selection menu contains multiple independent configuration instances of the app to be selected. Based on the user's human-computer interaction, determine the independent configuration instance of the target mini-program selected by the user in the configuration selection menu, and read the structured file of the independent configuration instance of the target mini-program. The configuration injection script is loaded by the build tool, and the configuration information in the structured file is injected into the core configuration file of the mini-program project using the configuration injection script. Remove irrelevant configuration items or other mini-program references from the mini-program project; The removed content is output to the build directory of the mini-program project for use in uploading, previewing, or CI / CD building and publishing of the mini-program project.

2. The method for reusing and deploying multiple instances of a mini-program according to claim 1, characterized in that, The independent configuration instance includes AppID, project name, homepage path and / or configuration icon, and the structured file adopts JSON format.

3. The method for reusing and deploying multiple instances of a mini-program according to claim 1, characterized in that, The command-line tool is an interactive command-line tool created based on the Inquirer library.

4. The method for reusing and deploying multiple instances of a mini-program according to claim 1, characterized in that, The build tools used are either the static module packaging tool webpack or the Node.js development tool.

5. The method for reusing and deploying multiple instances of a mini-program according to claim 1, characterized in that, The core configuration files include project.config.json, app.json, and sitemap.json.

6. The method for reusing and deploying multiple instances of a mini-program according to claim 1, characterized in that, The irrelevant configuration items include those with unselected configuration items and / or configuration items with redundant variables.

7. A multi-instance reuse deployment device for mini-programs, characterized in that, It includes a configuration menu pop-up unit with sequential communication connections, a configuration confirmation reading unit, a configuration information injection unit, an invalid data clearing unit, and a directory output building unit; The configuration menu pop-up unit is used to pop up a configuration selection menu via a command-line tool when a start build command is received. The configuration selection menu contains multiple independent configuration instances of the mini-programs to be selected. The configuration determination and reading unit is used to determine the independent configuration instance of the target mini-program selected by the user in the configuration selection menu based on the user's human-computer interaction operation, and read the structured file of the independent configuration instance of the target mini-program. The configuration information injection unit is used to load a configuration injection script through a build tool and use the configuration injection script to inject the configuration information in the structured file into the core configuration file of the mini-program project. The invalid data removal unit is used to remove irrelevant configuration items or other mini-program reference information from the mini-program project; The build directory output unit is used to output the content obtained after removal processing to the build directory of the mini-program project, so as to be used for uploading, previewing or CI / CD building and publishing of the mini-program project.

8. A computer device, characterized in that, It includes a storage module, a processing module, and a transceiver module that are sequentially connected in communication. The storage module is used to store computer programs, the transceiver module is used to send and receive messages, and the processing module is used to read the computer programs and execute the mini-program multi-instance reuse deployment method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that... The computer-readable storage medium stores instructions that, when executed on a computer, perform the applet multi-instance reuse deployment method as described in any one of claims 1 to 6.

10. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or the instructions are executed by the computer, they implement the mini-program multi-instance reuse deployment method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Script-based Web application program construction method and terminal

    CN117270881A

  • Method, device and equipment for pre-compiling multiple applets and medium

    CN117742722A

  • Small program deployment method and device, computer equipment and storage medium

    CN118860417A