A method and apparatus for scaffolding renewal

By comparing and updating the scaffolding version information on the server when the project starts, the problem of scaffolding code not being able to be updated synchronously is solved, and a low-cost and efficient update process is achieved.

CN113656054BActive Publication Date: 2026-03-13CHINA CONSTRUCTION BANK
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-19
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

In existing technologies, the code for scaffolding initialization cannot be updated synchronously, resulting in high update and maintenance costs and low accuracy.

Method used

When the project starts, the scaffolding version information on the server is actively retrieved and compared with the local code. If they are different, the source code on the server is used for synchronous updates, and the project is restarted.

Benefits of technology

It enables automatic synchronization and updating of scaffolding code, reducing maintenance costs and improving the accuracy and efficiency of updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113656054B_ABST
    Figure CN113656054B_ABST
Patent Text Reader

Abstract

This application provides a scaffolding update method and apparatus. The method includes: starting a target project, wherein the scaffolding code of the target project is generated from the target scaffolding; obtaining the current version information of the target scaffolding on a server; comparing the obtained version information with the local scaffolding code of the target project; if the version information is different, synchronously updating the local scaffolding code using the source code of the target scaffolding on the server; and restarting the target project after the update is completed. This solution solves the problem of high update and maintenance costs and low accuracy caused by the inability to synchronously update scaffolding in existing projects, requiring manual updates, thus achieving a simple and efficient scaffolding update process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of software program technology, and in particular relates to a scaffolding update method and apparatus. Background Technology

[0002] In web front-end projects, most are now built using webpack. Every web front-end project needs initialization code. To facilitate the rapid setup of a unified web front-end project, a common approach is to create a scaffolding mechanism, whose function is to initialize the code. While this method achieves good results, it has a significant drawback: the code initialized by the scaffolding is only valid once. When the scaffolding is modified, it cannot be synchronized to the already initialized project.

[0003] There is currently no effective solution for how to synchronize scaffolding operations. Summary of the Invention

[0004] The purpose of this application is to provide a method and apparatus for updating scaffolding, which can realize the synchronous updating of scaffolding.

[0005] This application provides a scaffolding renewal method and apparatus, which are implemented as follows:

[0006] A method for scaffolding renewal, the method comprising:

[0007] Start the target project, wherein the scaffolding code of the target project is generated from the target scaffolding;

[0008] Retrieve the current version information of the target scaffolding on the server;

[0009] The obtained version information is compared with the version information of the local scaffolding code of the target project;

[0010] If the version information is different, the local scaffolding code will be updated synchronously using the source code of the target scaffolding on the server.

[0011] After the update is complete, restart the target project.

[0012] In one implementation, after the target project is launched, the following is also included:

[0013] Start a child process;

[0014] The self-check module is executed through a subprocess to compare the obtained version information with the version information of the local scaffolding code of the target project.

[0015] After the update is complete, close the child process.

[0016] In one implementation, the local scaffolding code is synchronously updated using the source code of the target scaffolding on the server, including:

[0017] The local scaffolding code is overwritten using the source code of the target scaffolding on the server.

[0018] In one implementation, the process includes the following steps before launching the target project:

[0019] The target scaffolding is used to generate scaffolding codes for multiple projects, wherein the target project is one of the multiple projects.

[0020] In one embodiment, the above method further includes:

[0021] Detect whether the target scaffolding in the server has defects;

[0022] If a defect is identified, the target scaffolding is updated to obtain the updated source code for the target scaffolding.

[0023] A scaffolding renewal device, comprising:

[0024] A startup module is used to start the target project, wherein the scaffolding code of the target project is generated from the target scaffolding;

[0025] The acquisition module is used to obtain the current version information of the target scaffolding on the server;

[0026] The comparison module is used to compare the acquired version information with the version information of the local scaffolding code of the target project.

[0027] The update module is used to synchronize and update the local scaffolding code based on the source code of the target scaffolding on the server when the version information is determined to be different.

[0028] The restart module is used to restart the target project after the update is complete.

[0029] In one embodiment, the scaffolding renewal device further includes:

[0030] The second startup module is used to start the child process after the target project is started;

[0031] The self-check module is used to execute the self-check module through a subprocess to compare the obtained version information with the version information of the local scaffolding code of the target project.

[0032] The shutdown module is used to close the subprocess after the update is complete.

[0033] In one implementation, the update module is specifically used to overwrite the local scaffolding code with the source code of the target scaffolding in the server.

[0034] An electronic device includes a processor and a memory for storing processor-executable instructions, wherein the processor, when executing the instructions, implements the steps of the method described above.

[0035] A computer-readable storage medium having computer instructions stored thereon, which, when executed, implement the steps of the above-described method.

[0036] The scaffolding update method and apparatus provided in this application actively retrieve the scaffolding version information from the server after the project starts and compare it with the local scaffolding. If differences are found, the local scaffolding code is updated using the source code in the server, and the project is restarted. This solves the problem that existing projects cannot update scaffolding synchronously and require manual updates, resulting in high update and maintenance costs and low accuracy. It achieves a simple and efficient technical effect for updating scaffolding. Attached Figure Description

[0037] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0038] Figure 1 This is a flowchart of one embodiment of the scaffolding renewal method provided in this application;

[0039] Figure 2 This is the code architecture diagram of the scaffolding generation project provided in this application;

[0040] Figure 3 This is a hardware structure block diagram of an electronic device for a scaffolding renewal method provided in this application;

[0041] Figure 4 This is a schematic diagram of the module structure of one embodiment of the scaffolding renewal device provided in this application. Detailed Implementation

[0042] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.

[0043] Figure 1 This is a flowchart illustrating one embodiment of the scaffolding update method provided in this application. While this application provides method operation steps or apparatus structures as shown in the following embodiments or figures, more or fewer operation steps or module units may be included in the method or apparatus based on conventional or non-inventive effort. 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 described in the embodiments and figures of this application. When the method or module structure is applied in actual devices or terminal products, it can be executed sequentially or in parallel according to the method or module structure shown in the embodiments or figures (e.g., in a parallel processor or multi-threaded processing environment, or even a distributed processing environment).

[0044] Specifically, such as Figure 1 As shown, the above-mentioned scaffolding renewal method may include the following steps:

[0045] Step 101: Start the target project, wherein the scaffolding code of the target project is generated through the target scaffolding;

[0046] For example, a scaffolding mechanism A generates scaffolding code for N projects. The target project is one of these N projects. Later, a hidden defect is discovered in scaffolding mechanism A, so it is upgraded and modified; the upgraded scaffolding is designated as scaffolding mechanism B. A problem arises: all N projects generated from A contain hidden defects and need to be upgraded simultaneously. To achieve synchronized upgrades for these N projects, this example proposes setting up a self-checking and self-updating mechanism when starting the project.

[0047] Step 102: Obtain the current version information of the target scaffolding on the server;

[0048] For example, deploying a scaffolding service involves deploying scaffolding A to server S and providing an interface; the API-VERSION interface (version request interface) provides the latest version information of scaffolding A; s-3: the API-SYNC interface (i.e., API synchronization interface) provides the latest source code of scaffolding A.

[0049] Step 103: Compare the obtained version information with the version information of the local scaffolding code of the target project;

[0050] Step 104: If the version information is different, then synchronize and update the local scaffolding code using the source code of the target scaffolding on the server.

[0051] Step 105: After the update is complete, restart the target project.

[0052] In the example above, after starting the project, the version information of the scaffolding is actively retrieved from the server and compared with the local scaffolding. If differences are found, the local scaffolding code is updated using the source code on the server, and the project is restarted. This solves the problem of high update and maintenance costs and low accuracy caused by the inability of the existing project's scaffolding to be updated synchronously and the need for manual updates. It achieves the technical effect of simple and efficient scaffolding updates.

[0053] To enable self-checking and self-updating of the scaffolding code, a subprocess can be started to perform the checks and updates. Specifically, the subprocess can be started after the target project starts; the subprocess executes a self-check module to compare the acquired version information with the version information of the scaffolding code locally in the target project; after the update is complete, the subprocess is closed. That is, the subprocess can be closed after the update is finished. The lifespan of the subprocess can be from project startup until it is determined that no update is needed, or from project startup until it is determined that the update is complete.

[0054] When synchronizing and updating local scaffolding code using the source code of the target scaffolding on the server, the local scaffolding code can be overwritten using the source code of the target scaffolding on the server. That is, the purpose of updating the local scaffolding code of the project is achieved through code overwriting.

[0055] In implementation, scaffolding code for multiple projects can be generated from the target scaffolding, wherein the target project is one of the multiple projects.

[0056] For the target scaffolding, it is possible to detect whether there are defects in the target scaffolding on the server; if defects are found, the target scaffolding is updated to obtain the updated source code. That is, if the target scaffolding needs to be updated, or if there are defects that need to be overcome, it can be updated, and the updated source code can be saved on the server for the project to query for updates.

[0057] The above method will be described below with reference to a specific embodiment. However, it is worth noting that this specific embodiment is only for better illustration of this application and does not constitute an improper limitation of this application.

[0058] For web front-end engineering projects, code generation can be divided into two categories. One category is code generated through scaffolding, which is characterized by being relatively basic, general, framework-based, and reusable across multiple projects. The other category is business logic code, which is characterized by being differentiated, personalized, tightly coupled with business logic, and not easily reusable.

[0059] For ease of description, the code generated by the scaffolding will be referred to as scaffolding code in this example. Scaffolding code is characterized by being generated only once; once generated in a project, it cannot be automatically updated. The relationship between scaffolding code and scaffolding in a project is like that between a copy of a file and the original file; if the original file changes, the copy will not automatically update synchronously.

[0060] like Figure 2 The diagram shows the scaffolding code architecture for a scaffolding project. Assume there's a scaffolding A that generates scaffolding code for N projects. Later, a hidden defect is discovered in scaffolding A, so it's upgraded, and the upgraded scaffolding is called scaffolding B. Now, a problem arises: all N projects generated by A have hidden defects and need to be upgraded simultaneously. Because scaffolding code is generated only once and cannot be synchronized, manual modification of the defects in the scaffolding code is required across all N projects. When N is large (e.g., N>10, N>20, N>50, etc.), the larger the value of N, the more times manual repairs are needed, leading to more repetitive work, higher costs, and a higher error rate, thus increasing maintenance costs. To address this problem, this example provides a front-end scaffolding synchronization technology to solve the scaffolding synchronization issue, allowing the scaffolding code generated by the scaffolding to be automatically synchronized during upgrades.

[0061] Specifically, it can include the following module structure:

[0062] 1) Internal modules of scaffolding:

[0063] c-1: Self-check module, used to provide the function of self-checking whether the version needs to be updated;

[0064] c-2: Self-updating module, used to provide the function of self-updating the latest version of the value.

[0065] 2) Scaffolding deployment service:

[0066] s-1: Deploy scaffolding A onto server S and provide an interface;

[0067] s-2: The API-VERSION interface provides the latest version information for scaffolding A;

[0068] s-3: The API-SYNC interface (i.e., the API synchronization interface) provides the latest source code for scaffold A.

[0069] 3) Scaffolding generation project:

[0070] p-1: N projects were generated from scaffolding A;

[0071] p-2: Any one of the N projects is X.

[0072] 4) Scaffolding synchronization process:

[0073] u-1: When project X starts, it uses nodejs (a JavaScript runtime environment based on the Chrome V8 engine) to start a child process, denoted as childProcess;

[0074] u-2: childProcess executes the self-test module;

[0075] u-3: The self-test module requests the API-VERSION interface of service S to obtain the version V of the scaffolding on server S;

[0076] u-4: Server version V is consistent with local version, terminate child thread childProcess;

[0077] u-5: The server version V is inconsistent with the local version, and the child thread childProcess continues to execute the self-update module;

[0078] u-6: The self-update module requests the API-SYNC interface of service S to obtain the source code of version V of the scaffolding on server S;

[0079] u-7: Overwrite the local scaffolding code with the source code of version V. At this point, the scaffolding code synchronization is complete, and the version is also synchronized.

[0080] u-8: The child thread childProcess is closed.

[0081] u-9: Restart project X.

[0082] The front-end scaffolding synchronization technology in the example above achieves the goal of automatically synchronizing the scaffolding code generated by the scaffolding, which significantly improves the accuracy of scaffolding updates and effectively reduces maintenance costs.

[0083] The methods and embodiments provided in the above-described embodiments of this application can be executed in a mobile terminal, computer terminal, or similar computing device. Taking operation on an electronic device as an example... Figure 3 This is a hardware structure block diagram of an electronic device for a scaffolding renewal method provided in this application. (See diagram for example.) Figure 3 As shown, the electronic device 10 may include one or more (only one is shown in the figure) processors 02 (processors 02 may include, but are not limited to, microprocessors MCUs or programmable logic devices FPGAs, etc.), a memory 04 for storing data, and a transmission module 06 for communication functions. Those skilled in the art will understand that... Figure 3 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, electronic device 10 may also include... Figure 3 The more or fewer components shown, or having the same Figure 3 The different configurations shown.

[0084] The memory 04 can be used to store software programs and modules of application software, such as the program instructions / modules corresponding to the scaffolding update method in this embodiment. The processor 02 executes various functional applications and data processing by running the software programs and modules stored in the memory 04, thereby implementing the aforementioned application's scaffolding update method. The memory 04 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 04 may further include memory remotely located relative to the processor 02, and these remote memories can be connected to the electronic device 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0085] The transmission module 06 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the electronic device 10. In one example, the transmission module 06 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission module 06 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0086] At the software level, the aforementioned scaffolding update device can be as follows: Figure 4 As shown, it includes:

[0087] The startup module 401 is used to start the target project, wherein the scaffolding code of the target project is generated through the target scaffolding;

[0088] Module 402 is used to obtain the current version information of the target scaffolding in the server;

[0089] The comparison module 403 is used to compare the acquired version information with the version information of the local scaffolding code of the target project.

[0090] The update module 404 is used to synchronize and update the local scaffolding code based on the source code of the target scaffolding on the server when the version information is determined to be different.

[0091] Restart module 405 is used to restart the target project after the update is completed.

[0092] In one embodiment, the scaffolding update device may further include: a second startup module, used to start a subprocess after starting the target project; a self-check module, used to execute the self-check module through the subprocess to compare the acquired version information with the local scaffolding code of the target project; and a shutdown module, used to shut down the subprocess after the update is completed.

[0093] In one implementation, the update module 404 can specifically be used to overwrite the local scaffolding code with the source code of the target scaffolding in the server.

[0094] In one implementation, scaffolding codes for multiple projects can be generated from the target scaffolding before the target project is started, wherein the target project is one of the multiple projects.

[0095] In one implementation, it is possible to detect whether the target scaffolding in the server has defects; if defects are found, the target scaffolding is updated to obtain the source code of the updated target scaffolding version.

[0096] This application also provides a specific implementation of an electronic device capable of implementing all steps of the scaffolding update method in the above embodiments. The electronic device specifically includes: a processor, a memory, a communication interface, and a bus; wherein the processor, memory, and communication interface communicate with each other via the bus; the processor is used to call a computer program in the memory, and when the processor executes the computer program, it implements all steps of the scaffolding update method in the above embodiments. For example, when the processor executes the computer program, it implements the following steps:

[0097] Step 1: Start the target project, wherein the scaffolding code of the target project is generated through the target scaffolding;

[0098] Step 2: Obtain the current version information of the target scaffolding on the server;

[0099] Step 3: Compare the obtained version information with the version information of the local scaffolding code of the target project;

[0100] Step 4: If the version information is different, the local scaffolding code is synchronized and updated using the source code of the target scaffolding on the server.

[0101] Step 5: After the update is complete, restart the target project.

[0102] As can be seen from the above description, this application embodiment actively obtains the scaffolding version information from the server after the project is started and compares it with the local scaffolding. If they are different, the local scaffolding code is updated through the source code in the server and the project is restarted. This solves the problem that the existing scaffolding in the project cannot be updated synchronously and requires manual updates, resulting in high update and maintenance costs and low accuracy. It achieves the technical effect of simple and efficient scaffolding updates.

[0103] Embodiments of this application also provide a computer-readable storage medium capable of implementing all steps of the scaffolding update method in the above embodiments. The computer-readable storage medium stores a computer program that, when executed by a processor, implements all steps of the scaffolding update method in the above embodiments. For example, when the processor executes the computer program, it implements the following steps:

[0104] Step 1: Start the target project, wherein the scaffolding code of the target project is generated through the target scaffolding;

[0105] Step 2: Obtain the current version information of the target scaffolding on the server;

[0106] Step 3: Compare the obtained version information with the version information of the local scaffolding code of the target project;

[0107] Step 4: If the version information is different, the local scaffolding code is synchronized and updated using the source code of the target scaffolding on the server.

[0108] Step 5: After the update is complete, restart the target project.

[0109] As can be seen from the above description, this application embodiment actively obtains the scaffolding version information from the server after the project is started and compares it with the local scaffolding. If they are different, the local scaffolding code is updated through the source code in the server and the project is restarted. This solves the problem that the existing scaffolding in the project cannot be updated synchronously and requires manual updates, resulting in high update and maintenance costs and low accuracy. It achieves the technical effect of simple and efficient scaffolding updates.

[0110] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on its differences from other embodiments. In particular, hardware + program embodiments are relatively simple in description because they are fundamentally similar to method embodiments; relevant parts can be referred to the descriptions in the method embodiments.

[0111] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0112] While this application provides the method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-inventive labor. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only execution order. In actual device or client product execution, the methods shown in the embodiments or drawings can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment).

[0113] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, a laptop computer, an in-vehicle human-machine interaction device, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or any combination of these devices.

[0114] While this specification provides method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-inventive means. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only execution order. In actual device or end product execution, the methods shown in the embodiments or drawings may be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment, or even a distributed data processing environment). The terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, product, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, product, or apparatus. Without further limitations, the presence of other identical or equivalent elements in the process, method, product, or apparatus that includes said elements is not excluded.

[0115] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, in implementing the embodiments of this specification, the functions of each module can be implemented in one or more software and / or hardware components, or a module that performs the same function can be implemented by a combination of multiple sub-modules or sub-units. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between devices or units, and may be electrical, mechanical, or other forms.

[0116] Those skilled in the art will also know that, besides implementing the controller using purely computer-readable program code, the same functions can be achieved by logically programming the method steps, making the controller function as logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers (PLCs), and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the devices within it used to implement various functions can also be considered structures within that hardware component. Alternatively, the devices used to implement various functions can be considered as both software modules implementing the method and structures within a hardware component.

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

[0118] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0119] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0120] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0121] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

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

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

[0124] The embodiments described in this specification can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. The embodiments of this specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0125] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, system embodiments are basically similar to method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. In the description of this specification, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the embodiments in this specification. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described can be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0126] The above description is merely an embodiment of the present specification and is not intended to limit the embodiments of the present specification. For those skilled in the art, various modifications and variations can be made to the embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the embodiments of the present specification should be included within the scope of the claims of the embodiments of the present specification.

Claims

1. A method of updating a scaffold, characterized by, The method comprises: starting a target project, wherein the scaffold code of the target project is generated by a target scaffold, wherein the function of the scaffold is to initialize code, and a plurality of project scaffold codes are generated by one scaffold, and the scaffold can automatically synchronize the scaffold codes generated by the scaffold when the scaffold is upgraded; obtaining current version information of the target scaffold in a server, wherein the scaffold service is deployed, the target scaffold is deployed to the server, and an interface is provided; the interface API-VERSION is used to provide the latest version information of the target scaffold, and an API synchronization interface is used to provide the latest source code of the target scaffold; comparing the obtained version information with the version information of the local scaffold code of the target project; if the version information is different, synchronously updating the local scaffold code by using the source code of the target scaffold in the server; after the updating ends, restarting the target project.

2. The method of claim 1, wherein, After starting the target project, the method further comprises: starting a sub-process; performing a self-checking module by using the sub-process to compare the obtained version information with the version information of the local scaffold code of the target project; after the updating ends, closing the sub-process.

3. The method of claim 1, wherein, Synchronously updating the local scaffold code by using the source code of the target scaffold in the server comprises: covering the local scaffold code by using the source code of the target scaffold in the server.

4. The method of claim 1, wherein, Before starting the target project, the method further comprises: generating scaffold codes of a plurality of projects by using the target scaffold, wherein the target project is one of the plurality of projects.

5. The method of claim 1, wherein, The method further comprises: detecting whether the target scaffold in the server has a defect; in a case where it is determined that the target scaffold has a defect, updating the target scaffold to obtain source code of the target scaffold after version updating.

6. A scaffold updating device, characterized in that The method comprises: a starting module configured to start a target project, wherein the scaffold code of the target project is generated by a target scaffold, wherein the function of the scaffold is to initialize code, and a plurality of project scaffold codes are generated by one scaffold, and the scaffold can automatically synchronize the scaffold codes generated by the scaffold when the scaffold is upgraded; an obtaining module configured to obtain current version information of the target scaffold in a server, wherein the scaffold service is deployed, the target scaffold is deployed to the server, and an interface is provided; the interface API-VERSION is used to provide the latest version information of the target scaffold, and an API synchronization interface is used to provide the latest source code of the target scaffold; a comparing module configured to compare the obtained version information with the version information of the local scaffold code of the target project; an updating module configured to synchronously update the local scaffold code by using the source code of the target scaffold in the server in a case where it is determined that the version information is different; a restarting module configured to restart the target project after the updating ends.

7. The apparatus of claim 6, wherein, The method further comprises: a second starting module configured to start a sub-process after starting the target project; The self-checking module is configured to execute the self-checking module through the sub-process to compare the obtained version information with version information of the local scaffolding code of the target project; The closing module is configured to close the sub-process after the updating is completed.

8. The apparatus of claim 6, wherein, The updating module is specifically configured to cover the local scaffolding code by using source code of a target scaffolding in the server. 9.An electronic device comprising a processor and a memory storing processor-executable instructions that, when executed by the processor, perform steps of the method of any one of claims 1 to 5. 10.A computer-readable storage medium having stored thereon computer instructions that, when executed, perform steps of the method of any one of claims 1 to 5.

Citation Information

Patent Citations

  • Dependent package version management method and device, equipment and storage medium

    CN111522577A