Methods and apparatus for building multi-platform mini-programs

CN115934151BActive Publication Date: 2026-08-14BEIJING JINGDONG ZHENSHI INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-21
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0004]开发者人为进行构建阶段各环节的检查,容错率低,任一环节疏忽都可能导致最终生产包构建错误,最终影响小程序的部署和发布;构建多端小程序时,开发者需要分别按端进行小程序构建打包,人为串行操作,打包效率低下

Benefits of technology

[0040]上述发明中的一个实施例具有如下优点或有益效果:通过文件系统接口获取应用的项目工程代码文件的文件信息进行构建环境校验、利用命令行执行工具和版本号工具进行代码分支校验和确定构建版本信息,能够自动实现构建环境校验、代码分支校验和构建版本管理,避免由于人为操作而产生的容错率低的问题;通过利用多端小程序框架构建多端小程序,能够实现多端小程序的并行构建,大大提高构建效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115934151B_ABST
    Figure CN115934151B_ABST
Patent Text Reader

Abstract

This invention discloses a method and apparatus for building multi-platform mini-programs. One specific implementation of the method includes: obtaining file information of the application's project code files through a file system interface and performing build environment verification; parsing code branch information from the project code files using a command-line execution tool and performing code branch verification; if both build environment verification and code branch verification pass, parsing the application's current version information from the project code files using the command-line execution tool, and determining the build version information based on the current version information using a version number tool; and building the multi-platform mini-program of the application using a multi-platform mini-program framework based on the build version information. This implementation can automatically realize build environment verification, code branch verification, and build version management, enabling parallel building of multi-platform mini-programs, avoiding the low fault tolerance problem caused by manual operation, and greatly improving build efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method and apparatus for constructing multi-terminal mini-programs. Background Technology

[0002] Mini-program building involves compiling and packaging the source code of a mini-program application to obtain a deployment package. With the evolution of software standards, the application building phase often includes other steps, such as build environment verification, version management, and branch verification. Current multi-platform mini-program building solutions primarily involve developers manually managing untracked code, then manually performing build environment verification, version management, and branch verification, and finally building the mini-program sequentially to obtain production packages for each platform.

[0003] In the process of realizing this invention, the inventors discovered at least the following problems in the prior art:

[0004] Developers manually check each stage of the build process, which has a low tolerance for errors. Neglecting any stage can lead to errors in the final production package, ultimately affecting the deployment and release of the mini-program. When building a multi-platform mini-program, developers need to build and package the mini-program separately for each platform, which is a manual, sequential operation and has low packaging efficiency. Summary of the Invention

[0005] In view of this, embodiments of the present invention provide a method and apparatus for building multi-terminal mini-programs, which can automatically realize build environment verification, code branch verification and build version management, and can realize parallel building of multi-terminal mini-programs, avoiding the problem of low fault tolerance caused by human operation, and greatly improving build efficiency.

[0006] To achieve the above objectives, according to one aspect of the present invention, a method for constructing a multi-terminal mini-program is provided, comprising:

[0007] Obtain file information of the application's project code files through the file system interface to perform build environment verification;

[0008] The command-line execution tool is used to parse code branch information from the project code files and perform code branch verification.

[0009] If both the build environment verification and code branch verification pass, the current version information of the application is parsed from the project code file using a command-line execution tool, and the build version information is determined based on the current version information using a version number tool.

[0010] Based on the build version information, the multi-terminal mini-program of the application is built using a multi-terminal mini-program framework.

[0011] Optionally, after determining the build version information based on the current version information, the method further includes: generating a build version identifier based on the build version information.

[0012] Optionally, after determining the build version information based on the current version information, the method further includes: generating a change log based on the build version information.

[0013] Optionally, before obtaining the file information of the application's project code files through the file system interface, the method further includes:

[0014] Create a release script file in the application's project code directory to obtain the application's project code file; use a command-line execution tool to submit the application's project code file to the local repository, and retrieve the application's project code file from the local repository through the file system interface.

[0015] Optionally, file information of the application's project code files can be obtained through the file system interface to perform build environment verification, including:

[0016] The file information is retrieved line by line through the file system interface and regular expression matching is performed to verify whether the information content of the current line matches the environment variables of the production environment; if so, the environment verification passes, otherwise the environment verification fails.

[0017] Optionally, the build version information can be determined using a version number tool based on the current version information, including:

[0018] The version number tool is used to determine one or more candidate version information based on the current version information, and the candidate version information selected by the user from the one or more candidate version information is used as the build version information.

[0019] Optionally, after determining one or more candidate version information based on the current version information using the version number tool, the method further includes:

[0020] The one or more candidate version information is displayed through an interactive command-line tool so that the user can select one.

[0021] According to a second aspect of the present invention, an apparatus for building multi-terminal mini-programs is provided, comprising:

[0022] The build environment verification module obtains file information from the application's project code files through the file system interface to perform build environment verification.

[0023] The code branch verification module uses a command-line execution tool to parse code branch information from the project's code files and perform code branch verification.

[0024] The build version determination module, after both the build environment verification and code branch verification have passed, uses a command-line execution tool to parse the current version information of the application from the project code file, and uses a version number tool to determine the build version information based on the current version information;

[0025] The multi-platform application building module builds the multi-platform mini-program of the application using the multi-platform mini-program framework based on the build version information.

[0026] Optionally, the device further includes a version identifier generation module, configured to: after determining the build version information based on the current version information, generate a build version identifier based on the build version information.

[0027] Optionally, the apparatus further includes a change log generation module, configured to: after determining the build version information based on the current version information, generate a change log based on the build version information.

[0028] Optionally, the device further includes a project code submission module, configured to: create a release script file in the project code directory of the application before obtaining the file information of the application's project code file through the file system interface, thereby obtaining the application's project code file; and submit the application's project code file to the local repository using a command-line execution tool;

[0029] The build environment verification module obtains the application's project code files from the local repository through the file system interface.

[0030] Optionally, the build environment verification module obtains file information of the application's project code files through a file system interface to perform build environment verification, including:

[0031] The file information is retrieved line by line through the file system interface and regular expression matching is performed to verify whether the information content of the current line matches the environment variables of the production environment; if so, the environment verification passes, otherwise the environment verification fails.

[0032] Optionally, the build version determination module uses a version number tool to determine the build version information based on the current version information, including:

[0033] The version number tool is used to determine one or more candidate version information based on the current version information, and the candidate version information selected by the user from the one or more candidate version information is used as the build version information.

[0034] Optionally, the build version determination module is further configured to: after determining one or more candidate version information using the version number tool based on the current version information, display the one or more candidate version information through an interactive command-line tool so that the user can select.

[0035] According to a third aspect of the present invention, an electronic device built with a multi-terminal mini-program is provided, comprising:

[0036] One or more processors;

[0037] Storage device for storing one or more programs.

[0038] When the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in the first aspect of the embodiments of the present invention.

[0039] According to a fourth aspect of the present invention, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method provided in the first aspect of the present invention.

[0040] One embodiment of the above invention has the following advantages or beneficial effects: by obtaining the file information of the application's project code files through the file system interface for build environment verification, and by using command-line execution tools and version number tools for code branch verification and determining build version information, it can automatically realize build environment verification, code branch verification and build version management, avoiding the problem of low fault tolerance caused by human operation; by using the multi-terminal mini-program framework to build multi-terminal mini-programs, it can realize the parallel construction of multi-terminal mini-programs, greatly improving the construction efficiency.

[0041] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description

[0042] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:

[0043] Figure 1 This is a schematic diagram of the main process of the method for building multi-terminal mini-programs according to an embodiment of the present invention;

[0044] Figure 2 A flowchart illustrating code management in an optional embodiment of the present invention is shown;

[0045] Figure 3 This is a schematic diagram of the process for verifying the construction environment in an optional embodiment of the present invention;

[0046] Figure 4 This is a schematic diagram of the code branch verification process in an optional embodiment of the present invention;

[0047] Figure 5 This is a schematic diagram of the build version management process in an optional embodiment of the present invention;

[0048] Figure 6 This is a schematic diagram of the process for generating a build version identifier in an optional embodiment of the present invention;

[0049] Figure 7 This is a schematic diagram of the process for generating application change logs in an optional embodiment of the present invention;

[0050] Figure 8 This is a schematic diagram of the multi-terminal compilation and construction process in an optional embodiment of the present invention;

[0051] Figure 9 This is a flowchart illustrating the method for constructing a multi-terminal mini-program in an optional embodiment of the present invention;

[0052] Figure 10 This is a schematic diagram of the main modules of the device for building multi-terminal mini-programs according to an embodiment of the present invention;

[0053] Figure 11 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;

[0054] Figure 12 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation

[0055] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0056] According to one aspect of the present invention, a method for constructing multi-terminal mini-programs is provided.

[0057] Figure 1 This is a schematic diagram of the main flow of the method for building multi-terminal mini-programs according to an embodiment of the present invention, as follows: Figure 1 As shown, the method for constructing a multi-terminal mini-program according to an embodiment of the present invention includes steps S101, S102, S103 and S104.

[0058] Step S101: Obtain the file information of the application's project code files through the file system interface and perform build environment verification.

[0059] This step retrieves the application's project code file via a file system interface and parses its file information. The application's project code file contains the application's source code. After determining the path to the application's project code file, it can be directly retrieved via the file system interface. To facilitate automation, a deployment script file can be created in the application's project code directory before retrieving the file information via the file system interface, thus obtaining the application's project code file.

[0060] Project code files can be stored in a specific location. For example, the application's project code files can be submitted to a local repository using a command-line execution tool, or they can be submitted to a repository staging area first and then to a local repository. The application's project code files can then be retrieved from the local repository through a file system interface.

[0061] Figure 2 This diagram illustrates a flowchart of code management in an optional embodiment of the present invention. Figure 2 In the illustrated embodiment, untracked code (i.e., code not yet committed to the staging area or local repository) is managed using Node.js scripts and Git commands. Node.js is a JavaScript runtime environment based on the Chrome V8 engine, employing an event-driven, non-blocking I / O model that allows JavaScript to run on a server-side development platform. Git is an open-source distributed version control system that handles project version management; it is open-source version control software. See also... Figure 2 First, create a new Node.js script file, that is, add a JavaScript file related to the script file in the project code directory. Then, import the command-line execution tool library execa. Use the git command "execa('git',['add','.'])" (or use other tools) to commit the project code files to the code repository staging area. Use the command "execa('git',['commit','-m','feat:last commit'])" to commit the project code files to the local repository.

[0062] When creating a mini-program, developers typically customize production environment variables based on actual needs. Build environment validation of the application's project code files verifies whether the information within these files matches the production environment variables. In practice, this can be achieved by retrieving file information line by line through a file system interface and performing regular expression matching to check if the current line's information matches the production environment variables. If it does, the build environment validation passes; otherwise, it fails. Retrieving file information line by line avoids omissions and improves the accuracy of build environment validation results. Regular expression matching allows for quick acquisition of strings that meet specific formats, improving validation efficiency. Of course, those skilled in the art can choose other methods to obtain strings that meet specific formats based on the actual situation.

[0063] Figure 3 This is a schematic diagram illustrating the process of verifying the construction environment in an optional embodiment of the present invention. Figure 3 In the optional embodiment shown, the file path information of the application's project code file is first determined. Then, based on the file path information, the file information content is obtained through the node.js file system API fs.readFileSync. Next, the file information content is obtained line by line through the file system API tool library "n-readlines". Then, regular expression matching is performed to check whether the information content of the current line matches the production environment "PRODUCTION" environment variable (this environment variable is usually set by the developer). If the verification is successful, the subsequent build process is carried out.

[0064] Step S102: Use a command-line execution tool to parse the code branch information from the project code file and perform code branch verification.

[0065] In this step, you can choose which command-line execution tool to use, as long as it can parse out the code branch information. Figure 4 This is a schematic diagram of the code branch verification process in an optional embodiment of the present invention. Figure 4 As shown, when performing code branch verification, the command-line execution library execa is first introduced. Then, the git command "git rev-parse --abbrev-ref HEAD" (or other command-line tools) is executed through execa to obtain the code branch information of the current project's code files. Next, it is verified whether the current branch is a valid build branch "master". If the current code branch information matches the preset build branch information, the current project's code files are considered a valid build branch, and the code branch verification passes.

[0066] Step S103: If both the build environment verification and code branch verification pass, use a command-line execution tool to parse the current version information of the application from the project code file, and use a version number tool to determine the build version information based on the current version information.

[0067] The current version information refers to the version information of the already built application, that is, the version information of the previous version of the project code file, such as the version number. This step determines the version information of the application currently being built based on the version information of the already built application. In practical applications, the build version information can be automatically determined based on the current version information according to a pre-set version number determination rule. For example, if the preset version number determination rule is "major version number automatically incremented by 1", then if the version number of the already built application is V1.0.0, the build version number of the application currently being built will be V2.0.0. As another example, if the preset version number determination rule is "minor version number automatically incremented by 1", then if the version number of the already built application is V1.0.0, the build version number of the application currently being built will be V1.1.0.

[0068] Optionally, determining build version information using a version number tool based on the current version information includes: determining one or more candidate version information using the version number tool based on the current version information, and using the candidate version information selected by the user from the one or more candidate version information as the build version information. For example, multiple version number determination rules are pre-set. After determining the current version information, a candidate version number is determined according to each of the pre-set version number determination rules. The determined candidate version numbers are displayed to the user, and the version number selected by the user from the candidate version numbers, or a version number modified based on one of the displayed candidate version numbers, is used as the build version number.

[0069] To facilitate user viewing and selection, after determining one or more candidate version information based on the current version information using the version number tool, the one or more candidate version information can be displayed through an interactive command-line tool for user selection.

[0070] Figure 5 This is a schematic diagram of the build version management process in an optional embodiment of the present invention. For example... Figure 5As shown, the process first retrieves the application's current version information using the `package.json` file (typically found in the root directory of every Node.js project, defining the various modules required and project configuration information such as name, version, license, and other metadata). Then, it generates candidate version information using the `semver` version number tool (a version control specification tool; other methods can also be used to generate candidate version information). Next, it displays the candidate version information using the `inquirer` interactive command-line tool. After the user selects the appropriate version, the build version information is obtained. The version selected by the user can be one of the candidate versions, a modified version based on a candidate version, or a user-defined version.

[0071] After determining the build version information based on the current version information, this embodiment of the invention can also generate a build version identifier based on the build version information. Figure 6 This is a schematic diagram of the process for generating a build version identifier in an optional embodiment of the present invention. For example... Figure 6 As shown, the command-line execution library execa is first introduced. Then, execa executes the `git push --follow-tags` command to generate build version identifiers. In this embodiment, the build version identifier refers to the build version tag information. A version tag is a concept in Git code management, pointing to a commit file in the code repository. By adding a tag corresponding to the latest commit of the deployed version after building a new version of the application, application rollback can be easily facilitated.

[0072] After determining the build version information based on the current version information, this embodiment of the invention can also generate a change log (application changelog information) based on the build version information. Figure 7 This is a schematic diagram of the process for generating application change logs in an optional embodiment of the present invention. For example... Figure 7As shown, the command-line execution library `execa` is first introduced, followed by the version control tool `standard-version`. Then, the application changelog information is generated by executing the command `execa('standard-version',['-r',newVersion,'--no-verify','-t',getTagPrefix(curBranch)],{stdio:'inherit'})`. For example, the code differences between the current project's codebase and the previous commit version are obtained using `git`, followed by the commit message, commit time, and other information. Finally, the information is written to a file with the `.md` format using the Node.js API `fs.writeStorageSync`. Besides `execa` and `standard-version`, those skilled in the art can also generate changelog information using other methods.

[0073] Step S104: Based on the build version information, construct the multi-platform mini-program of the application using a multi-platform mini-program framework. The multi-platform mini-program framework can be selected according to the actual situation, such as Chameleon, Taro, uni-app, mpvue, WePY, etc.

[0074] Figure 8 This is a schematic diagram of the multi-platform compilation and building process in an optional embodiment of the present invention. This embodiment uses the Taro multi-platform mini-program framework to build the multi-platform mini-program of the application. Taro is an open cross-platform and cross-framework solution that supports the development of various mini-programs and H5 applications using frameworks such as React / Vue / Nerv. In this embodiment, the command-line tool library execa is first introduced, and then the Taro CLI command "npm run build:xxx" is executed through execa to build the production packages of the multi-platform mini-program in parallel, such as the weapp production package, swan production package, and jd production package.

[0075] Figure 9 This is a flowchart illustrating the method for constructing a multi-terminal mini-program in an optional embodiment of the present invention. Figure 9As shown, this embodiment executes `git` commands via a script to commit untracked code; it reads the application build environment information file through the Node.js file system API and validates the build environment information using regular expressions; then, it obtains the current branch information using `git` commands and validates the code branch information; next, it reads the application's current version information, generates candidate version information using version management tools, and displays and obtains the build version information through an interactive command line; it adds version tag information using `git` commands; finally, it uses the Taro CLI command to perform parallel building of the mini-program across multiple platforms, thus achieving mini-program building. For the specific implementation methods of each step, please refer to the aforementioned related descriptions, which will not be repeated here.

[0076] This invention, through a file system interface, obtains file information of the application's project code files for build environment verification, and uses command-line execution tools and version number tools for code branch verification and build version information determination. It can automatically realize build environment verification, code branch verification, and build version management, avoiding the problem of low fault tolerance caused by human operation. By using a multi-terminal mini-program framework to build multi-terminal mini-programs, it can realize the parallel construction of multi-terminal mini-programs, greatly improving the construction efficiency.

[0077] According to a second aspect of the present invention, an apparatus for implementing the above-described method is provided. Figure 10 This is a schematic diagram of the main modules of the multi-terminal mini-program construction device according to an embodiment of the present invention, such as... Figure 10 As shown, the apparatus 1000 for building multi-terminal mini-programs according to an embodiment of the present invention includes:

[0078] The build environment verification module 1001 obtains file information of the application's project code files through the file system interface and performs build environment verification.

[0079] The code branch verification module 1002 uses a command-line execution tool to parse code branch information from the project code file and performs code branch verification.

[0080] The build version determination module 1003, after both the build environment verification and code branch verification have passed, uses a command-line execution tool to parse the current version information of the application from the project code file, and uses a version number tool to determine the build version information based on the current version information;

[0081] The multi-terminal application building module 1004 builds the multi-terminal mini-program of the application using the multi-terminal mini-program framework based on the build version information.

[0082] Optionally, the device further includes a version identifier generation module, configured to: after determining the build version information based on the current version information, generate a build version identifier based on the build version information.

[0083] Optionally, the apparatus further includes a change log generation module, configured to: after determining the build version information based on the current version information, generate a change log based on the build version information.

[0084] Optionally, the device further includes a project code submission module, configured to: create a release script file in the project code directory of the application before obtaining the file information of the application's project code file through the file system interface, thereby obtaining the application's project code file; and submit the application's project code file to the local repository using a command-line execution tool;

[0085] The build environment verification module obtains the application's project code files from the local repository through the file system interface.

[0086] Optionally, the build environment verification module obtains file information of the application's project code files through a file system interface to perform build environment verification, including:

[0087] The file information is retrieved line by line through the file system interface and regular expression matching is performed to verify whether the information content of the current line matches the environment variables of the production environment; if so, the environment verification passes, otherwise the environment verification fails.

[0088] Optionally, the build version determination module uses a version number tool to determine the build version information based on the current version information, including:

[0089] The version number tool is used to determine one or more candidate version information based on the current version information, and the candidate version information selected by the user from the one or more candidate version information is used as the build version information.

[0090] Optionally, the build version determination module is further configured to: after determining one or more candidate version information using the version number tool based on the current version information, display the one or more candidate version information through an interactive command-line tool so that the user can select.

[0091] According to a third aspect of the present invention, an electronic device built with a multi-terminal mini-program is provided, comprising:

[0092] One or more processors;

[0093] Storage device for storing one or more programs.

[0094] When the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in the first aspect of the embodiments of the present invention.

[0095] According to a fourth aspect of the present invention, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method provided in the first aspect of the present invention.

[0096] Figure 11 An exemplary system architecture 1100 is shown, which can be applied to the method or apparatus for building multi-terminal mini-programs according to embodiments of the present invention.

[0097] like Figure 11 As shown, system architecture 1100 may include terminal devices 1101, 1102, and 1103, network 1104, and server 1105. Network 1104 is used as a medium to provide communication links between terminal devices 1101, 1102, and 1103 and server 1105. Network 1104 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.

[0098] Users can use terminal devices 1101, 1102, and 1103 to interact with server 1105 via network 1104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 1101, 1102, and 1103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).

[0099] Terminal devices 1101, 1102, and 1103 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0100] Server 1105 can be a server that provides various services, such as a backend management server that supports shopping websites browsed by users using terminal devices 1101, 1102, and 1103 (for example only). The backend management server can analyze and process data such as received product information query requests, and feed back the processing results (such as target push information and product information - for example only) to the terminal devices.

[0101] It should be noted that the method for building multi-terminal mini-programs provided in this embodiment of the invention is generally executed by server 1105, and correspondingly, the apparatus for building multi-terminal mini-programs is generally located in server 1105. The method for building multi-terminal mini-programs provided in this embodiment of the invention can also be executed by terminal devices 1101, 1102, and 1103, and correspondingly, the apparatus for building multi-terminal mini-programs is located in terminal devices 1101, 1102, and 1103.

[0102] It should be understood that Figure 11The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0103] The following is for reference. Figure 12 It shows a schematic diagram of the structure of a computer system 1200 suitable for implementing a terminal device of the present invention. Figure 12 The terminal device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0104] like Figure 12 As shown, the computer system 1200 includes a central processing unit (CPU) 1201, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 1202 or programs loaded from storage section 1208 into random access memory (RAM) 1203. The RAM 1203 also stores various programs and data required for the operation of the system 1200. The CPU 1201, ROM 1202, and RAM 1203 are interconnected via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.

[0105] The following components are connected to I / O interface 1205: an input section 1206 including a keyboard, mouse, etc.; an output section 1207 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN card, modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to I / O interface 1205 as needed. Removable media 1211, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1210 as needed so that computer programs read from them can be installed into storage section 1208 as needed.

[0106] In particular, according to embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1209, and / or installed from removable medium 1211. When the computer program is executed by central processing unit (CPU) 1201, it performs the functions defined above in the system of this invention.

[0107] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0108] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0109] The modules described in the embodiments of the present invention can be implemented in software or hardware. The described modules can also be housed in a processor; for example, a processor can be described as including: a build environment verification module, a code branch verification module, a build version determination module, and a multi-terminal program build module. The names of these modules do not necessarily limit the module itself; for example, the build environment verification module can also be described as a "module for performing code branch verification."

[0110] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, which, when executed by the device, cause the device to: obtain file information of the application's project code file through a file system interface and perform build environment verification; parse code branch information from the project code file using a command-line execution tool and perform code branch verification; if both the build environment verification and code branch verification pass, parse the current version information of the application from the project code file using the command-line execution tool and determine the build version information based on the current version information using a version number tool; and construct a multi-terminal mini-program of the application using a multi-terminal mini-program framework based on the build version information.

[0111] According to the technical solution of the present invention, the file information of the application's project code file is obtained through the file system interface for build environment verification, and code branch verification and build version information are performed using command-line execution tools and version number tools. This can automatically realize build environment verification, code branch verification and build version management, avoiding the problem of low fault tolerance caused by human operation. By using a multi-terminal mini-program framework to build multi-terminal mini-programs, parallel construction of multi-terminal mini-programs can be realized, greatly improving the construction efficiency.

[0112] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for building multi-terminal mini-programs, characterized in that, include: Obtain file information of the application's project code files through the file system interface to perform build environment verification; The command-line execution tool is used to parse code branch information from the project code files and perform code branch verification. If both the build environment verification and code branch verification pass, the current version information of the application is parsed from the project code file using a command-line execution tool, and the build version information is determined based on the current version information using a version number tool. Based on the build version information, the multi-terminal mini-program of the application is built using a multi-terminal mini-program framework.

2. The method as described in claim 1, characterized in that, After determining the build version information based on the current version information, the method further includes: generating a build version identifier based on the build version information.

3. The method as described in claim 1, characterized in that, After determining the build version information based on the current version information, the method further includes: generating a change log based on the build version information.

4. The method as described in claim 1, characterized in that, Before obtaining file information of the application's project code files through the file system interface, the method further includes: Create a release script file in the application's project code directory to obtain the application's project code file; use a command-line execution tool to submit the application's project code file to the local repository, and retrieve the application's project code file from the local repository through the file system interface.

5. The method as described in claim 1, characterized in that, Obtain file information of the application's project code files through the file system interface, and perform build environment verification, including: The file information is retrieved line by line through the file system interface and regular expression matching is performed to verify whether the information content of the current line matches the environment variables of the production environment; if so, the environment verification passes, otherwise the environment verification fails.

6. The method as described in claim 1, characterized in that, The build version information is determined using a version number tool based on the current version information, including: The version number tool is used to determine one or more candidate version information based on the current version information, and the candidate version information selected by the user from the one or more candidate version information is used as the build version information.

7. The method as described in claim 6, characterized in that, After determining one or more candidate version information using the version number tool based on the current version information, the process further includes: The one or more candidate version information is displayed through an interactive command-line tool so that the user can select one.

8. A device for building multi-terminal mini-programs, characterized in that, include: The build environment verification module obtains file information from the application's project code files through the file system interface to perform build environment verification. The code branch verification module uses a command-line execution tool to parse code branch information from the project's code files and perform code branch verification. The build version determination module, after both the build environment verification and code branch verification have passed, uses a command-line execution tool to parse the current version information of the application from the project code file, and uses a version number tool to determine the build version information based on the current version information; The multi-platform application building module builds the multi-platform mini-program of the application using the multi-platform mini-program framework based on the build version information.

9. An electronic device built with a multi-terminal mini-program, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-7.

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

Citation Information

Patent Citations

  • Small program running method and device, electronic equipment and storage medium

    CN111222062A

  • Code version management method and device

    CN112947992A