A Deployment Package Processing Method, System, and Storage Medium Based on a Summary Difference Tree
By building a summary difference tree, the problem of inefficient incremental release in the existing technology is solved, efficient file comparison and old file deletion is achieved, and the deployment package processing process is simplified.
Patent Information
- Application Number
- CN202210204550.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-03
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2042-03-03
AI Technical Summary
The existing incremental release method requires comparing the differences between new and old folders, which is inefficient and wastes storage space, and cannot effectively delete files from old deployment packages on the server.
Using a method based on the summary difference tree, a summary tree is constructed by recursively reading the content of the deployment package folder, comparing the content of the summary tree to generate a summary difference tree, and realizing incremental release and file deletion.
Improves the efficiency of comparing new and old folders, reduces storage space requirements, supports deletion of files from old deployment packages on the server, and simplifies the incremental release process.
Smart Images

Figure CN114610335B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of deployment packages, and in particular to a method, system, and storage medium for processing deployment packages based on a summary difference tree. Background Art
[0002] Project releases are divided into full releases and incremental releases. A full release replaces all the deployment packages on the server with new ones, and an incremental release replaces only the parts of the deployment packages that have been modified.
[0003] Currently, there are two ways for incremental releases. One is to manually extract the modified files for release when it is known which files have been modified. This method is only applicable to small scales and when it is known which files have been modified. The second is to use a file comparison tool to compare and find out which files have been modified, and then extract them for release. This method requires comparing the differences between the new and old folders to extract files. Since it needs to recursively read the contents of both the new and old folders for comparison, the efficiency is very low, and it also requires storing the old deployment packages, wasting storage space, and does not support deleting files that should be deleted from the old deployment packages on the server. Summary of the Invention
[0004] In view of the problem that the above traditional incremental release method needs to compare the differences between the new and old folders to extract files, and since it needs to recursively read the contents of both the new and old folders for comparison, the efficiency is very low, and it also requires storing the old deployment packages, wasting storage space, this application proposes a method for processing deployment packages based on a summary difference tree.
[0005] In a first aspect, this application proposes a method for processing deployment packages based on a summary difference tree, including the following steps:
[0006] S1: Recursively read the contents of the folders of the deployment packages for two releases, and respectively construct summary trees with the corresponding deployment package folder directories as the structures and save them;
[0007] S2: Compare the contents of the two summary trees to construct a summary difference tree. Specifically, copy the tree structures of the folder nodes and their child nodes with different folder names in the two summary trees to the summary difference tree, and copy the tree structures of the file nodes with different file names in the two summary trees to the summary difference tree;
[0008] S3: Use the summary difference tree to perform an incremental release of the deployment package or delete files from the deployment package.
[0009] By adopting the above technical solution, first recursively read the content of the folders of the deployment packages released twice, respectively construct and save the summary trees with the directory structures of the corresponding deployment package folders as the structures, and then copy the tree structures of the folder nodes and their child nodes with different folder names in the two summary trees and the tree structures of the file nodes with different file names in the two summary trees to the summary difference tree. By generating the summary tree and saving the summary tree file, the file difference information of the old version can be stored. There is no need to retain the folder content of the old deployment package, and incremental release can also be carried out. By means of the summary difference tree algorithm, comparing the folder and file content one by one is avoided. Only by comparing the summary trees and generating the summary difference tree can the difference files be extracted, improving the comparison efficiency of the old and new folders. Moreover, this application also has the effect of supporting the deletion of the files that should be deleted from the old deployment package on the server.
[0010] Preferably, in the step S1, the constructing and saving the summary tree with the directory structure of the corresponding deployment package folder specifically includes: constructing an empty summary tree; recursively reading the content of the deployment package folder; if it is a folder, record the folder name in the empty summary tree and set an empty subtree container, and continue to recursively traverse the content in the folder; if it is a file type, generate the corresponding summary and store it in the node, thereby generating the summary tree; save the summary tree. By adopting the above technical solution, first construct an empty summary tree, and then recursively read the content of the deployment package folder and store the files and file types in the node, thereby simply and conveniently generating the summary tree.
[0011] Preferably, the step S2 specifically includes the following steps: recursively read the content of one of the summary trees; when the recursive node compares to the folder type, judge whether there is a folder node with the same folder name at the same position in the other summary tree. If so, recursively traverse the content of the child nodes of the folder node. If not, copy the tree structure of the node and its child nodes in the new summary tree to the summary difference tree; when the recursive node compares to the file type, judge whether there is a file with the same file name at the same position in the other summary tree. If there is a file with the same name, judge whether the summaries of the nodes are the same. If the summaries are the same, continue to recurse. If the summaries are different, copy the tree structure of the node to the summary difference tree. If there is no file with the same name, copy the tree structure of the node completely to the summary difference tree. This method can effectively generate the summary difference tree.
[0012] Preferably, the deployment package includes an old deployment package and a new deployment package, the summary tree includes an old summary tree and a new summary tree, the summary difference tree includes a first summary difference tree and a second summary difference tree, the first summary difference tree is obtained by comparing the new summary tree with the old summary tree, and the second summary difference tree is obtained by comparing the old summary tree with the new summary tree.
[0013] Preferably, in the step S3, the incremental release of the deployment package by using the summary difference tree specifically includes: creating a deployment package container; recursively reading the first summary difference tree, if the node of the tree recursively reached is a folder, creating a folder with the same name on the corresponding directory structure path of the deployment package container, if the node of the tree recursively reached is a file, copying the file at the corresponding directory structure path of the new deployment package to the corresponding directory structure path of the deployment package container to form an incremental deployment package; and performing incremental release on the incremental deployment package. By means of the summary difference tree algorithm, it is avoided to compare the contents of folders and files one by one. Only by comparing the summary trees and generating the summary difference tree can the different files be extracted, improving the comparison efficiency of the new and old folders.
[0014] Preferably, in the step S3, the file deletion of the deployment package by using the summary difference tree specifically includes: recursively traversing the second summary difference tree and constructing a deletion script, and uploading the deletion script to the server, so as to delete the files that should be deleted from the old deployment package on the server.
[0015] Preferably, use fs.writeFile to save the summary tree in the form of json, use fs.readdir to recursively read the folder content of the deployment package, and use fs.stat to determine whether the target item is a folder.
[0016] Preferably, the specific implementation of "if it is a file type, generate the corresponding summary and store it in this node" includes: if it is a file type, use the fs module of Node.js to read the file stream, and use the crypto module of Node.js to generate the md5 summary of the file, and then store the md5 summary in this node.
[0017] In a second aspect, the present application also proposes a deployment package processing system based on a summary difference tree, including:
[0018] A summary tree generation module, configured to recursively read the content of the folder of the deployment package, and construct and save a summary tree with the corresponding deployment package folder directory as the structure;
[0019] A summary tree comparison module, configured to compare the contents of the two summary trees and construct a summary difference tree;
[0020] A deployment package processing module, configured to perform incremental release on the deployment package or perform file deletion on the deployment package by using the summary difference tree.
[0021] In a third aspect, the present application also proposes a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the method described in the first aspect is implemented.
[0022] Compared with the prior art, the beneficial effects of the present application are as follows:
[0023] (1) By constructing an empty summary tree and recursively reading the folder content of the deployment package, if it is a folder, record the folder name in the empty summary tree and set an empty subtree container, and continue to recursively traverse the content in the folder; if it is a file type, generate the corresponding summary and store it in the node, thereby generating a summary tree and saving the summary tree, thus generating a summary tree.
[0024] (2) By generating a summary tree, storing the summary tree file can store the file difference information of the old version. There is no need to retain the folder content of the old deployment package, and incremental release can also be carried out. By the summary difference tree algorithm, comparing the folder and file content one by one is avoided. Only the summary tree needs to be compared to generate a summary difference tree, and then the difference files can be extracted, improving the comparison efficiency of the new and old folders. Moreover, the present application also has the effect of supporting the deletion of files that should be deleted from the old deployment package on the server. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated in and constitute a part of this specification. The drawings illustrate the embodiments and, together with the description, are used to explain the principles of the present application. Other embodiments and many of the intended advantages of the embodiments will be readily apparent as they become better understood by reference to the following detailed description. The elements of the drawings are not necessarily to scale with each other. The same reference numerals refer to corresponding like parts.
[0026] Figure 1 is a specific flowchart of step S1 of the deployment package processing method based on the summary difference tree in an embodiment of the present application.
[0027] Figure 2 is a flowchart of the construction of the summary tree in an embodiment of the present application.
[0028] Figure 3 is a flowchart of the incremental release of the new deployment package in an embodiment of the present application.
[0029] Figure 4 is a schematic diagram of the module structure of the deployment package processing system based on the summary difference tree in an embodiment of the present application.
[0030] Figure 5 is a schematic diagram of the structure of the computer system of the electronic device suitable for implementing the embodiments of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0031] To make the objectives, technical solutions, and advantages of this application clearer, the following will further describe this application in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all of them. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this application without creative efforts belong to the scope of protection of this application.
[0032] The following will introduce this application in detail with reference to the accompanying drawings.
[0033] Figure 1 The flowchart of the deployment package processing method based on the abstract difference tree to which the embodiments of this application can be applied is shown. This method specifically includes the following steps:
[0034] S1: Recursively read the contents of the folders of the deployment packages released twice, respectively construct abstract trees with the corresponding deployment package folder directories as structures, and save them;
[0035] Among them, the deployment package includes an old deployment package and a new deployment package, and the abstract tree includes an old abstract tree and a new abstract tree.
[0036] In a specific embodiment, referring to Figure 2 , the steps for establishing the abstract tree are as follows:
[0037] Step 201: Construct an empty abstract tree;
[0038] Step 202: Recursively read the contents of the deployment package folder; if it is a folder, record the folder name in the empty abstract tree, set an empty subtree container, and continue to recursively traverse the contents in the folder; if it is a file type, generate the corresponding abstract and store it in this node, thereby generating an abstract tree;
[0039] Step 203: Save the abstract tree.
[0040] In a specific embodiment, the data structure of the nodes of the abstract tree digest-tree is as follows:
[0041]
[0042] Among them, filename is the file (folder) name, digest is the abstract, isDir records whether it is a folder, and children is the subtree of the abstract tree.
[0043] Construct an empty abstract tree digest-tree during initialization.
[0044]
[0045] The algorithm adopted in this application relies on Node.js, but is not limited to being implemented in the Node.js language.
[0046] In a specific embodiment, the content of the folder is read recursively through fs.readdir, and it is determined whether the target item is a folder through fs.stat.
[0047] If it is a folder, the folder name is recorded in the filename of the node in the digest-tree, isDir is set to true, and an empty subtree container children: [] is set. Then, the content in this folder is recursively traversed through this method.
[0048] If it is a file type, the file stream is read sequentially through the fs module, and the md5 digest is generated through the crypto module. The md5 digest is stored in the digest of the node in the digest-tree, and filename: file name and isDir: false are filled in sequentially.
[0049] The key code for generating the digest-tree is as follows:
[0050]
[0051] Through layer-by-layer recursion, a complete digest tree digest-tree is finally generated.
[0052] Then, the digest-tree is saved as a json file using fs.writeFile.
[0053] Among them, MD5 is an algorithm that can generate a string with a fixed length of 128 bits after performing md5 on a string, or a file, or a compressed package. This string is basically unique. If someone modifies the source file, a new md5 string will be generated.
[0054] S2: Compare the contents of the two digest trees, and construct a digest difference tree. Specifically, the tree structures of the folder nodes and their child nodes with different folder names in the two digest trees are copied to the digest difference tree, and the tree structures of the file nodes with different file names in the two digest trees are copied to the digest difference tree;
[0055] In a specific embodiment, step S2 specifically includes:
[0056] Recursively read the content of one of the digest trees;
[0057] When the recursive node is compared to a folder type, it is determined whether there is a folder node with the same name as the folder name at the same position in the other summary tree. If so, the content of the child nodes of the folder node is recursively traversed. If not, the tree structure of the node and its child nodes in the new summary tree is copied to the summary difference tree;
[0058] When the recursive node is compared to a file type, it is determined whether there is a file with the same name as the file name at the same position in the other summary tree. If there is a file with the same name, it is determined whether the summaries of the nodes are the same. If the summaries are the same, the recursion continues. If the summaries are different, the tree structure of the node is copied to the summary difference tree. If there is no file with the same name, the tree structure of the node is completely copied to the summary difference tree.
[0059] In a specific embodiment, the content of the two summary tree files is read through fs.readFile, and the content is parsed into an object type through JSON.parse.
[0060] Among them, the summary difference tree includes a first summary difference tree and a second summary difference tree. The first summary difference tree is obtained by comparing the new summary tree with the old summary tree, and the first summary difference tree records the difference information of the newly added and modified parts of the new deployment package. The second summary difference tree is obtained by comparing the old summary tree with the new summary tree, and the second summary difference tree records the file information that should be deleted in the old deployment package but not in the new deployment package.
[0061] S3: Use the summary difference tree to perform incremental publishing of the deployment package or delete files from the deployment package.
[0062] In a specific embodiment, referring to Figure 3 , in step S3, using the summary difference tree to perform incremental publishing of the deployment package specifically includes:
[0063] Step 301: Create a new deployment package container;
[0064] Step 302: Recursively read the first summary difference tree. If the node of the tree reached is a folder, create a folder with the same name on the corresponding directory structure path of the deployment package container. If the tree node reached is a file, copy the file on the corresponding directory structure path of the new deployment package to the corresponding directory structure path of the deployment package container to form an incremental deployment package;
[0065] Among them, the corresponding directory structure path = [filename of the root node]... [filename of the parent node][filename of the file] of the digest-diff-tree.
[0066] Step 303: Perform incremental publishing of the incremental deployment package.
[0067] In a specific embodiment, the file deletion of the deployment package by using the digest difference tree in step S3 specifically includes: recursively traversing the second digest difference tree and constructing a deletion script, and uploading the deletion script to the server, so as to delete the files that should be deleted from the old deployment package on the server.
[0068] By recursively traversing the second digest difference tree, a server deletion script (denoted as del.sh) is constructed.
[0069] Each deletion script command is as follows:
[0070] rm [filename of the root node] of digest-diff-tree / ……[filename of the parent node] / [filename of the file].
[0071] Upload del.sh and execute the command. / del.sh to implement the deletion operation.
[0072] For further reference Figure 4 , as an implementation of the above method, the present application provides an embodiment of a deployment package processing system based on a digest difference tree. This system embodiment corresponds to Figure 1 the method embodiment shown, and this system can be specifically applied to various electronic devices.
[0073] For reference Figure 4 , the deployment package processing system based on a digest difference tree includes:
[0074] A digest tree generation module 401, configured to recursively read the content of the folder of the deployment package, and construct and save a digest tree with the directory structure of the corresponding deployment package folder;
[0075] A digest tree comparison module 402, configured to compare the content of the two digest trees and construct a digest difference tree;
[0076] A deployment package processing module 403, configured to perform incremental release of the deployment package or file deletion of the deployment package by using the digest difference tree.
[0077] Next, for reference Figure 5 , which shows a schematic structural diagram of a computer system 500 of an electronic device suitable for implementing the embodiments of the present application. Figure 5 The electronic device shown is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present application.
[0078] As shown in Figure 5As shown, computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage section 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0079] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed so that a computer program read from it can be installed into the storage section 508 as needed.
[0080] Specifically, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program codes for performing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above functions defined in the method of the present application are executed.
[0081] As another aspect, the present application also provides a computer-readable storage medium, which can be included in the electronic device described in the above embodiment; or can exist separately without being assembled into the electronic device. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed by the electronic device, the electronic device is caused to execute when implemented as shown in Figure 1 the method shown.
[0082] It should be noted that the computer-readable storage medium described in this application can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. The 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 of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, 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 above. In this application, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. And in this application, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries the computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable storage medium other than the computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0083] The computer program code for performing the operations of this application can be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).
[0084] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combinations of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0085] The specific embodiments of the present application have been described above, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should all be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
[0086] In the description of the present application, it should be understood that the orientation or positional relationship indicated by terms such as "upper", "lower", "inner", "outer", etc. is based on the orientation or positional relationship shown in the accompanying drawings, and is only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as a limitation to the present application. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" before an element does not exclude the presence of a plurality of such elements. The simple fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage. Any reference signs in the claims should not be construed as limiting the scope.
Claims
1. A deployment package processing method based on a summary difference tree, characterized in that, It includes the following steps: S1: Recursively read the content of the folder of the deployment package published twice, respectively construct a summary tree with the directory structure of the corresponding deployment package folder as the structure and save it; S2: Compare the content of the two summary trees, and construct a summary difference tree. Among them, copy the tree structures of the folder nodes and their child nodes with different folder names in the two summary trees to the summary difference tree, copy the tree structures of the nodes of the files with the same name but different summaries to the summary difference tree, and copy the tree structures of the file nodes with different file names in the two summary trees to the summary difference tree; S3: Use the summary difference tree to perform incremental publishing of the deployment package or delete files from the deployment package.
2. The deployment package processing method based on an abstract difference tree according to claim 1, characterized in that: In the step S1, the constructing a summary tree with the directory structure of the corresponding deployment package folder as the structure and saving it specifically includes: Construct an empty summary tree; Recursively read the content of the deployment package folder; if it is a folder, record the folder name in the empty summary tree and set an empty subtree container, and continue to recursively traverse the content in the folder; if it is a file type, generate the corresponding summary and save it into the node corresponding to the file in the summary tree, thereby generating a summary tree; Save the summary tree.
3. The deployment package processing method based on a summary difference tree according to claim 1, wherein: The step S2 specifically includes the following steps: Recursively read the content of one of the summary trees; When the recursive node is compared to a folder type, judge whether there is a folder node with the same name as this folder name at the same position in the other summary tree. If so, recursively traverse the content of the child nodes of this folder node. If not, copy the tree structures of this node and its child nodes in the new summary tree to the summary difference tree; When the recursive node is compared to a file type, judge whether there is a file with the same name as this file name at the same position in the other summary tree. If there is a file with the same name, judge whether the summaries of the nodes are the same. If the summaries are the same, continue to recurse. If the summaries are different, copy the tree structure of this node to the summary difference tree. If there is no file with the same name, copy the tree structure of this node completely to the summary difference tree.
4. A deployment package processing method based on an abstract difference tree according to claim 3, characterized in that: The deployment package includes an old deployment package and a new deployment package. The summary tree includes an old summary tree and a new summary tree. The summary difference tree includes a first summary difference tree and a second summary difference tree. The first summary difference tree is obtained by comparing the new summary tree with the old summary tree, and the second summary difference tree is obtained by comparing the old summary tree with the new summary tree.
5. The deployment package processing method based on the abstract difference tree according to claim 4, characterized in that: In the step S3, the using the summary difference tree to perform incremental publishing of the deployment package specifically includes: Create a new deployment package container; Recursively read the first summary difference tree. If the node of the tree reached is a folder, create a folder with the same name on the corresponding directory structure path of the deployment package container. If the tree node reached is a file, copy the file on the corresponding directory structure path of the new deployment package to the corresponding directory structure path of the deployment package container to form an incremental deployment package; Perform incremental publishing of the incremental deployment package.
6. The deployment package processing method based on the abstract difference tree according to claim 4, characterized in that: In the step S3, the using the summary difference tree to delete files from the deployment package specifically includes: Recursively traverse the second summary difference tree and construct a deletion script, and upload the deletion script to the server to delete the files that should be deleted from the old deployment package on the server.
7. A deployment package processing method based on an abstract difference tree according to claim 2, characterized in that: Use fs.writeFile to save the summary tree in json format, use fs.readdir to recursively read the content of the deployment package folder, and use fs.stat to determine whether the target item is a folder.
8. A deployment package processing method based on an abstract difference tree according to claim 2, characterized in that: If it is a file type, generating a corresponding summary and storing it in the node corresponding to the file in the summary tree specifically includes: If it is a file type, use the fs module of Node.js to read the file stream, use the crypto module of Node.js to generate an md5 summary of the file, and then store the md5 summary in the node corresponding to the file in the summary tree.
9. A deployment package processing system based on a summary difference tree, characterized in that, Includes: A summary tree generation module, configured to recursively read the content of the folder of the deployment package, and construct and save a summary tree with the directory structure corresponding to the deployment package folder; A summary tree comparison module, configured to compare the content of the two summary trees and construct a summary difference tree; wherein, copy the tree structures of the folder nodes and their child nodes with different folder names in the two summary trees to the summary difference tree, copy the tree structures of the file nodes with the same file name but different summaries to the summary difference tree, and copy the tree structures of the file nodes with different file names in the two summary trees to the summary difference tree; A deployment package processing module, configured to perform incremental release of the deployment package or delete files from the deployment package using the summary difference tree.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it implements the method described in any one of claims 1-8.
Citation Information
Patent Citations
Differential upgrading method and related equipment
CN110515646A
Merkel tree updating method, device and equipment and readable storage medium
CN111625258A