Item packaging method and device based on three-level cache, equipment and storage medium

By setting up three-level caches on local and remote servers and reusing cached data to improve packaging and compilation efficiency, the problem of slow CI remote packaging speed is solved and the development speed is improved.

CN118605876APending Publication Date: 2024-09-06深圳墨世科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410621642.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-20
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

During the business development process of the Android team, as the amount of code expanded, the CI remote packaging speed became slower and slower. It often took more than half an hour to complete the entire packaging process, seriously affecting the progress of R&D testing.

Method used

Using a three-level cache mechanism, the first cache and the second cache are set up on the local server, and the third cache is set up on the remote server as a backup cache. When responding to the packaging and compilation instructions, cached data is reused based on cache hit results and call dependencies for packaging. Compile.

Benefits of technology

By maximizing the reuse of cached data, the efficiency of packaging and compilation is significantly improved, and the development speed of the overall project is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118605876A
    Figure CN118605876A
Patent Text Reader

Abstract

The invention discloses a project packaging method, device and equipment based on three-level cache, and a storage medium. The method comprises the following steps: setting a first cache and a second cache in a local server; setting a third cache based on the address of the local server; and in response to a packaging and compiling instruction, reusing the first cache or the third cache based on a cache hit result of a current packaging task in the project engineering, and reusing the second cache based on a calling dependency relationship of the current packaging task to package and compile the current packaging task. According to the technical scheme, on the basis of a three-level cache mechanism, cache data are reused to the maximum extent in the remote packaging process of the local server, and the compiling efficiency of packaging and compiling is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer compilation technology, and in particular to a project packaging method, device, equipment and storage medium based on three-level cache. Background Art

[0002] In the process of business development of the Android team, in order to facilitate collaboration and code management, the code project is usually placed in the company's own code repository. At the same time, the CI (Continuous Integration) service provided by the code repository is used to customize the packaging output process of the packaging tasks in the entire project.

[0003] With the continuous increase of business functions and continuous iteration of versions, the amount of code is also expanding, and the speed of CI remote packaging is becoming slower and slower. It often takes more than half an hour to complete the entire packaging process, which seriously affects the progress of the entire R&D and testing. Summary of the invention

[0004] The present invention provides a project packaging method, device, equipment and storage medium based on three-level cache to improve the packaging compilation speed of packaging tasks in a project.

[0005] According to one aspect of the present invention, a project packaging method based on a three-level cache is provided, the method comprising:

[0006] A first cache and a second cache are set on a local server; wherein the first cache refers to a cache stored in a project directory or a compilation environment; and the second cache is used to store the output result of at least one historical packaging task in the project;

[0007] Setting a third cache based on the address of the local server; wherein the third cache serves as a backup cache for the first cache;

[0008] In response to the packaging and compilation instruction, based on the cache hit result of the current packaging task in the project, the first cache or the third cache is reused, and based on the calling dependency of the current packaging task, the second cache is reused to perform packaging and compilation on the current packaging task.

[0009] According to another aspect of the present invention, a project packaging device based on a three-level cache is provided, the device comprising:

[0010] A cache setting module, used to set a first cache and a second cache on a local server; wherein the first cache refers to a cache saved in a project directory or a compilation environment; and the second cache is used to store the output result of at least one historical packaging task in a project;

[0011] A backup cache setting module, used to set a third cache based on the address of the local server; wherein the third cache serves as a backup cache for the first cache;

[0012] The packaging module is used to respond to the packaging compilation instruction, reuse the first cache or the third cache based on the cache hit result of the current packaging task in the project engineering, and reuse the second cache of the current packaging task for packaging compilation based on the calling dependency of the current packaging task.

[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0014] at least one processor; and

[0015] a memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the project packaging method based on the three-level cache described in any embodiment of the present invention.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the project packaging method based on the three-level cache described in any embodiment of the present invention when executed.

[0018] According to another aspect of the present invention, a computer program product is provided, the computer program product comprising a computer program, and the computer program, when executed by a processor, implements the project packaging method based on three-level cache as described in any embodiment of the present invention.

[0019] The technical solution of the embodiment of the present invention, by setting a first cache and a second cache on a local server, and a third cache on a remote server, responds to a packaging and compilation instruction, based on the cache hit result of the current packaging task in the project engineering, reuses the first cache set on the local server or the third cache set on the remote server, and reuses the second cache set on the local server based on the call dependency relationship of the current packaging task, and packages and compiles the current packaging task. Based on the three-level cache mechanism, the cache data is reused to the greatest extent in the process of remote packaging on the local server, thereby improving the compilation efficiency of packaging and compilation and improving the development speed of the overall project.

[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0022] Figure 1 This is a flowchart of a project packaging method based on three-level cache provided according to the first embodiment of the present invention;

[0023] Figure 2 is a flowchart of a project packaging method based on three-level cache provided according to the second embodiment of the present invention;

[0024] Figure 3 is a schematic diagram of the structure of a project packaging device based on three-level cache provided according to Embodiment 3 of the present invention;

[0025] Figure 4 It is a structural schematic diagram of an electronic device that implements the project packaging method based on three-level cache according to an embodiment of the present invention. DETAILED DESCRIPTION

[0026] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0028] Embodiment 1

[0029] Figure 1 A flowchart of a project packaging method based on a three-level cache is provided for the first embodiment of the present invention. This embodiment is applicable to the case of project packaging on a local server. The method can be executed by a project packaging device based on a three-level cache. The project packaging device based on a three-level cache can be implemented in the form of hardware and / or software. The project packaging device based on a three-level cache can be configured in various general-purpose computing devices, such as server devices. Figure 1 As shown, the method includes:

[0030] S110. Set a first cache and a second cache on a local server.

[0031] The local server may refer to a server locally configured with a component in CI responsible for executing tasks in the CI pipeline, such as a GitLab Runner component; the first cache may refer to a cache stored in a local project directory or in a local compilation environment, which may include a project directory cache and a compiler cache; the second cache may be used to store the output results of at least one historical packaging task in the project. Optionally, the cache path of the second cache may be adaptively set according to those skilled in the art.

[0032] Specifically, a first cache and a second cache may be set on a local server to cache a cache in a project directory or a compilation environment, and a cache in a compilation environment, respectively.

[0033] Optionally, in an embodiment of the present invention, the components in CI responsible for executing tasks in the CI pipeline can be configured on a local high-performance configured server, and by setting task labels in CI, it is specified that the packaging and compilation tasks that take the longest time to compile are run in the components configured in the local server, so as to give full play to the high performance advantages of the local server. It should be noted that currently, the packaging tasks in the code warehouse are basically run on the cloud server. When executing the packaging task script, the code will be re-pulled from the code warehouse and then compiled, which is equivalent to performing full compilation and packaging in a brand new environment. The cache cannot be reused, which reduces the speed of packaging and compilation.

[0034] S120: Setting a third cache based on the address of the local server.

[0035] The third cache may be used as a backup cache for the first cache.

[0036] Specifically, the third cache can be set based on the server address of the local server; optionally, a connection can be established with the local server in the remote server based on the server address of the local server, and the third cache can be established in the remote server as a backup cache for the first cache. It should be noted that the data cached in the third cache and the first cache can be the same data.

[0037] S130. In response to the packaging and compilation instruction, based on the cache hit result of the current packaging task in the project, reuse the first cache or the third cache, and reuse the second cache based on the call dependency relationship of the current packaging task, to package and compile the current packaging task.

[0038] Among them, the packaging compilation instruction is used to instruct the packaging compilation of the packaging task; the cache hit result may refer to the matching result between the current packaging task and the first cache; the call dependency may refer to the interface or object that needs to be called during the packaging compilation process of the current packaging task.

[0039] Specifically, in response to the packaging and compilation instructions issued by the user, based on the cache hit results of the current packaging task in the project, it can choose to reuse the first cache set in the local server or the third cache set in the remote server, and reuse the second cache based on the calling dependency relationship of the current packaging task, so as to package and compile the current packaging task.

[0040] Optionally, in response to a packaging and compilation instruction, based on the cache hit result of the current packaging task in the project project, the first cache or the third cache is reused, and based on the calling dependency of the current packaging task, the second cache is reused to package and compile the current packaging task in the project project, including: in the case of a hit in the first cache, the first cache is reused to package and compile the current packaging task in the project project; in the case of a miss in the first cache, a call request is sent to the third cache, and in the case of a successful response to the call request, the third cache is reused to package and compile the current packaging task in the project project; during the packaging and compilation process of the current packaging task, if it is determined that the current packaging task has the output result of calling a historical packaging task, then according to the task branch to which the current packaging task belongs, the output result of the corresponding historical packaging task in the second cache corresponding to the task branch is reused.

[0041] The task branch may refer to a task chain composed of packaging tasks with call dependency relationships in a project, that is, packaging tasks under the same task branch have direct or indirect call dependency relationships with each other.

[0042] Specifically, in response to the packaging and compilation instruction issued by the user, a match can be performed in the first cache according to the task identifier of the current packaging task. When the task identifier of the current packaging task hits the first cache, the first cache is reused to package and compile the current packaging task in the project. When the task identifier of the current packaging task does not hit the first cache, a request to call the third cache is sent to the remote server. When the remote server responds to the request successfully, the third cache is reused to package and compile the current packaging task in the project. During the packaging and compilation process of the current packaging task, if the current packaging task needs to call the output result of the historical packaging task, that is, the packaging and compilation process of the current packaging task needs to call the output result of the historical packaging task, then according to the task branch to which the current packaging task belongs, the output result of the historical packaging task that the current packaging task needs to call in the second cache corresponding to the task branch is reused.

[0043] By selecting to reuse the first cache of the local server or the third cache of the remote server, and the second cache of the local server, the cache hit rate is improved, and the packaging and compilation efficiency of the packaging task can be improved compared to executing the packaging and compilation task on the cloud server.

[0044] Optionally, after the packaging and compilation of the current packaging task is completed, the first cache, the second cache, and the third cache may be synchronously updated according to the output result of the packaging and compilation of the current packaging task to ensure the availability of the cache data.

[0045] Optionally, in response to a packaging and compilation instruction, based on the cache hit result of the current packaging task in the project project, the first cache or the third cache is reused, and based on the calling dependency of the current packaging task, the second cache is reused, and before the current packaging task is packaged and compiled, it also includes: prohibiting the first cache from being cleaned up by configuring the deletion environment variable in the project project.

[0046] The deleting environment variable may be used to instruct the first cache in the local server to be cleaned up, for example, GIT_CLEAN_FLAGS.

[0047] Specifically, by configuring the deletion environment variable in the project to be disabled, the local server can be prohibited from repeatedly cleaning the first cache, saving the time of deleting and recreating the first cache. At the same time, each packaging can fully reuse the local cache after the last compilation, greatly improving the overall compilation and packaging speed.

[0048] The technical solution of the embodiment of the present invention, by setting a first cache and a second cache on a local server, and a third cache on a remote server, responds to a packaging and compilation instruction, based on the cache hit result of the current packaging task in the project engineering, reuses the first cache set on the local server or the third cache set on the remote server, and reuses the second cache set on the local server based on the call dependency relationship of the current packaging task, and packages and compiles the current packaging task. Based on the three-level cache mechanism, the cache data is reused to the greatest extent in the process of remote packaging on the local server, thereby improving the compilation efficiency of packaging and compilation and improving the development speed of the overall project.

[0049] Embodiment 2

[0050] Figure 2 This is a flowchart of a project packaging method based on three-level cache provided in the second embodiment of the present invention. This embodiment further refines the above embodiment and provides specific steps for setting the first cache and the second cache on the local server. It should be noted that for the part not described in detail in the embodiment of the present invention, please refer to the relevant description of other embodiments, which will not be repeated here. Figure 2 As shown, the method includes:

[0051] S210. Based on the historical packaging tasks in the project project, a project directory cache is generated in the project directory to which the historical packaging tasks belong, and a compiler cache is generated in the running directory to which the compiler that executes the packaging tasks belongs.

[0052] Among them, the project directory cache records the intermediate files generated during the execution of historical packaging tasks. It should be noted that the intermediate files can refer to files generated during the packaging compilation process that do not involve specific packaging task information and can be applied to various packaging tasks; the compiler cache can refer to the output cache of the historical packaging task closest to the current moment, that is, the packaging compilation results of the historical packaging task closest to the current moment.

[0053] Specifically, according to the process of packaging and compiling the historical packaging tasks in the project, the intermediate files generated in the packaging and compiling process can be extracted and stored in the project directory to which the historical packaging tasks belong to generate a project directory cache; and the compiler cache can be generated in the directory to which the compiler that executes the packaging task belongs. It should be noted that in the embodiment of the present invention, the compiler that executes the packaging task has an incremental compilation function.

[0054] Optionally, after generating a compiler cache in the running directory to which the compiler that executes the historical packaging task belongs, it also includes: after the historical packaging task corresponding to the compiler cache is packaged and compiled, if the project code corresponding to the historical packaging task changes again, the compiler, based on the incremental compilation function, directly reuses the compiler cache to re-package and compile the historical packaging task with the project code changes.

[0055] Optionally, the first cache also includes a third-party cache, which is used to store dependencies required in the packaging task, which may refer to specific dependencies required for a certain packaging task, or may refer to dependencies required for all packaging tasks. Optionally, if the dependency required for the packaging task does not exist in the third-party cache, it is necessary to download the dependency from the network to the third cache. Optionally, the cache address of the third-party cache can be adaptively set according to those skilled in the art.

[0056] S220: Based on at least one task branch in the project and a preset second cache sharing mechanism, set a second cache for each task branch.

[0057] Among them, the task branch refers to the calling dependency relationship between the packaging tasks in the project engineering, and the packaging tasks under the same task branch have direct or indirect calling dependencies; the second cache sharing mechanism means that the packaging tasks in the same task branch support the reuse of the second cache corresponding to the task branch.

[0058] Specifically, based on at least one task branch in the project and a preset second cache sharing mechanism, a second cache may be set for each task branch.

[0059] Optionally, you can set up scheduled update tasks for tasks that are used frequently in the project, such as scheduled packaging and compilation once every morning to increase the amount of cached data in the second cache, maximize the cache hit rate, and improve packaging and compilation efficiency.

[0060] The technical solution of the embodiment of the present invention generates a project directory cache under the project directory to which the historical packaging tasks belong based on the historical packaging tasks in the project engineering, and sets a second cache for each task branch based on at least one task branch in the project engineering and a pre-set second cache sharing mechanism, thereby improving the hit rate of the cache data, realizing maximum cache reuse in the packaging and compilation process, and improving the efficiency of packaging and compilation.

[0061] Embodiment 3

[0062] Figure 3 The schematic diagram of the structure of a project packaging device based on three-level cache provided by the third embodiment of the present invention. Figure 3 As shown, the device comprises:

[0063] The cache setting module 310 is used to set a first cache and a second cache on the local server; wherein the first cache refers to a cache stored in a project directory or a compilation environment; the second cache is used to store the output result of at least one historical packaging task in the project engineering;

[0064] A backup cache setting module 320, configured to set a third cache based on the address of the local server; wherein the third cache serves as a backup cache for the first cache;

[0065] The packaging module 330 is used to respond to the packaging compilation instruction, reuse the first cache or the third cache based on the cache hit result of the current packaging task in the project, and reuse the second cache current packaging task for packaging compilation based on the call dependency of the current packaging task.

[0066] The technical solution of the embodiment of the present invention, by setting a first cache and a second cache on a local server, and a third cache on a remote server, responds to a packaging and compilation instruction, based on the cache hit result of the current packaging task in the project engineering, reuses the first cache set on the local server or the third cache set on the remote server, and reuses the second cache set on the local server based on the call dependency relationship of the current packaging task, and packages and compiles the current packaging task. Based on the three-level cache mechanism, the cache data is reused to the greatest extent in the process of remote packaging on the local server, thereby improving the compilation efficiency of packaging and compilation and improving the development speed of the overall project.

[0067] Optionally, the first cache includes a project directory cache and a compiler cache.

[0068] Optionally, the cache setting module 310 includes:

[0069] The first cache unit is used to generate a project directory cache in the project directory to which the historical packaging tasks belong based on the historical packaging tasks in the project engineering, and to generate a compiler cache in the running directory to which the compiler that executes the packaging tasks belongs; wherein the project directory cache records the intermediate files generated during the execution of the historical packaging tasks, and the compiler cache refers to the output cache of the historical packaging tasks closest to the current moment.

[0070] Optionally, the cache setting module 310 further includes:

[0071] The incremental compilation unit is used to re-package and compile the historical packaging tasks corresponding to the compiler cache based on the incremental compilation function when the project code corresponding to the historical packaging tasks corresponding to the compiler cache changes.

[0072] Optionally, the cache setting module 310 includes:

[0073] The second cache unit is used to set a second cache for each task branch based on at least one task branch in the project engineering and a pre-set second cache sharing mechanism; wherein the task branch refers to the calling dependency relationship between the packaged tasks in the project engineering, and the second cache sharing mechanism refers to the packaged tasks in the same task branch supporting the reuse of the second cache corresponding to the task branch.

[0074] Optionally, the device further comprises:

[0075] The environment variable configuration module is used to prohibit the first cache from being cleaned up by configuring the deletion environment variable in the project engineering.

[0076] Optionally, the packaging module 330 is specifically used to: respond to the packaging compilation instruction, determine whether the current packaging compilation task of the project engineering hits the first cache; if it hits the first cache, reuse the first cache to package and compile the current packaging task in the project engineering; if it does not hit the first cache, send a call request to the third cache, and if the call request is successfully responded to, reuse the third cache to package and compile the current packaging task in the project engineering; during the packaging compilation process of the current packaging task, if it is determined that the current packaging task has the output result of calling the historical packaging task, then according to the task branch to which the current packaging task belongs, reuse the output result of the corresponding historical packaging task in the second cache corresponding to the task branch.

[0077] The project packaging device based on three-level cache provided in the embodiment of the present invention can execute the project packaging method based on three-level cache provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0078] Embodiment 4

[0079] Figure 4 A schematic diagram of an electronic device 410 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0080] like Figure 4 As shown, the electronic device 410 includes at least one processor 411, and a memory connected to the at least one processor 411 in communication, such as a read-only memory (ROM) 412, a random access memory (RAM) 413, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 411 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 412 or the computer program loaded from the storage unit 418 to the random access memory (RAM) 413. In the RAM 413, various programs and data required for the operation of the electronic device 410 can also be stored. The processor 411, the ROM 412, and the RAM 413 are connected to each other via a bus 414. An input / output (I / O) interface 415 is also connected to the bus 414.

[0081] Multiple components in the electronic device 410 are connected to the I / O interface 415, including: an input unit 416, such as a keyboard, a mouse, etc.; an output unit 417, such as various types of displays, speakers, etc.; a storage unit 418, such as a disk, an optical disk, etc.; and a communication unit 419, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 419 allows the electronic device 410 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0082] The processor 411 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 411 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 411 executes the various methods and processes described above, such as a project packaging method based on a three-level cache.

[0083] In some embodiments, the project packaging method based on the three-level cache can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 418. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 410 via the ROM 412 and / or the communication unit 419. When the computer program is loaded into the RAM 413 and executed by the processor 411, one or more steps of the project packaging method based on the three-level cache described above can be performed. Alternatively, in other embodiments, the processor 411 can be configured to execute the project packaging method based on the three-level cache in any other appropriate manner (for example, by means of firmware).

[0084] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0085] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0086] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0087] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0088] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0089] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0090] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0091] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A project packaging method based on three-level cache, characterized in that: The method comprises: A first cache and a second cache are set on a local server; wherein the first cache refers to a cache stored in a project directory or a compilation environment; and the second cache is used to store the output result of at least one historical packaging task in the project; Setting a third cache based on the address of the local server; wherein the third cache serves as a backup cache for the first cache; In response to the packaging and compilation instruction, based on the cache hit result of the current packaging task in the project, the first cache or the third cache is reused, and the second cache is reused based on the call dependency relationship of the current packaging task to package and compile the current packaging task.

2. The method according to claim 1, characterized in that The first cache includes a project directory cache and a compiler cache. Accordingly, setting the first cache on the local server includes: Based on the historical packaging tasks in the project engineering, a project directory cache is generated in the project directory to which the historical packaging tasks belong, and a compiler cache is generated in the running directory to which the compiler that executes the packaging tasks belongs; wherein the project directory cache records the intermediate files generated during the execution of the historical packaging tasks, and the compiler cache refers to the output cache of the historical packaging tasks closest to the current moment.

3. The method according to claim 2, characterized in that After the compiler cache is generated in the running directory of the compiler that executes the historical packaging task, it also includes: When the project code corresponding to the historical packaging task corresponding to the compiler cache changes, the compiler directly reuses the compiler cache based on the incremental compilation function to re-package and compile the historical packaging task with the project code change.

4. The method according to claim 1, characterized in that: The second cache is set on the local server, further comprising: Based on at least one task branch in the project engineering and a pre-set second cache sharing mechanism, a second cache is set for each task branch; wherein the task branch refers to the calling dependency relationship between the packaged tasks in the project engineering, and the second cache sharing mechanism refers to the packaged tasks in the same task branch supporting the reuse of the second cache corresponding to the task branch.

5. The method according to claim 1, characterized in that In response to the packaging and compilation instruction, based on the cache hit result of the current packaging task in the project, the first cache or the third cache is reused, and the second cache is reused based on the call dependency relationship of the current packaging task, before packaging and compiling the current packaging task, the method further includes: By configuring the delete environment variable in the project, the first cache cannot be cleaned up.

6. The method according to claim 1, characterized in that In response to a packaging and compilation instruction, based on a cache hit result of a current packaging task in the project, the first cache or the third cache is reused, and based on a call dependency relationship of the current packaging task, the second cache is reused to package and compile the current packaging task, including: In response to the packaging and compilation instruction, determining whether the current packaging and compilation task of the project engineering hits the first cache; In the case of hitting the first cache, reusing the first cache to package and compile the current packaging task in the project; If the first cache is not hit, a call request is sent to the third cache, and if the call request is successfully responded, the third cache is reused to package and compile the current packaging task in the project; During the packaging and compilation process of the current packaging task, if it is determined that the current packaging task has called the output result of the historical packaging task, the output result of the corresponding historical packaging task in the second cache corresponding to the task branch is reused according to the task branch to which the current packaging task belongs.

7. A project packaging device based on three-level cache, characterized in that: include: A cache setting module, used to set a first cache and a second cache on a local server; wherein the first cache refers to a cache saved in a project directory or a compilation environment; and the second cache is used to store the output result of at least one historical packaging task in a project; A backup cache setting module, used to set a third cache based on the address of the local server; wherein the third cache serves as a backup cache for the first cache; The packaging module is used to respond to the packaging compilation instruction, reuse the first cache or the third cache based on the cache hit result of the current packaging task in the project engineering, and reuse the second cache of the current packaging task for packaging compilation based on the calling dependency of the current packaging task.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the project packaging method based on the three-level cache as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the project packaging method based on three-level cache according to any one of claims 1 to 6 when executed.

10. A computer program product, characterized in that It includes a computer program, which, when executed by a processor, implements the project packaging method based on three-level cache as described in any one of claims 1 to 6.