File baseline management method based on Git
By building a baseline management architecture and data model, combined with Git repository version management, the problems of complex and inefficient manual operations in the Git version control system are solved, and the automated management and optimization of file baselines are realized.
Patent Information
- Application Number
- CN202511338869.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-18
- Publication Date
- 2026-01-02
AI Technical Summary
Existing Git version control systems rely on manual operation to identify source code change lists, which is complex and time-consuming. They cannot be automated with continuous integration tools, affecting efficiency, and lack optimization for the entire process from baseline generation to application.
Build a baseline management architecture, provide data models and interface operations, and combine Git repository version management capabilities to realize baseline management of files or folders, including creating, checking out and viewing baselines, and storing intermediate state metadata.
It enables efficient management of file baselines, supports automated operations, optimizes the entire process from baseline generation to application, and improves the efficiency and accuracy of software development.
Smart Images

Figure CN121255729A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of software engineering technology, and in particular to a Git-based file baseline management method. Background Technology
[0002] In current software engineering practices, source code management commonly employs version control systems based on the Git protocol. This system uses commit and push operations to submit the software source code written by developers on their local computers to a Git repository on a remote server, using a unique commit ID to identify each commit. This mechanism provides a solid foundation for version control during the software development process.
[0003] Data shows that the Git protocol provides a set of commands for identifying the list of source code changes. However, using these commands presents three significant problems: First, because Git stores source code commit records linearly in chronological order, containing the entire historical commit history of the source code repository, currently, without special methods, one can only manually identify the starting point of a commit record based on the commit logs. Second, it is highly dependent on manual operation, requiring users to enter a series of commands in the command line to query commit records and manually record relevant information. This not only increases operational complexity and may lead to human error, but the process is also very time-consuming. Third, when multiple commits contain changes to the same file, the command output information still needs to be manually verified and deduplicated. This manual approach cannot be integrated with continuous integration tools, resulting in key steps in the artifact building process that should be automated still requiring manual intervention, seriously affecting overall efficiency and the speed of artifact deployment, and contradicting the enterprise's goal of improving efficiency.
[0004] Chinese patent document CN107679692A discloses a "Security Baseline Management System and Method". The security baseline management system includes: a template manager for managing standard security baseline templates for different devices or systems, wherein the standard security baseline template includes baseline configuration items and a method for obtaining configuration items; a baseline manager for managing the security baselines of all managed objects and applying standard security baseline templates from a template library to each managed object; and a collector for collecting the security baseline configuration items of the template machine into the template library, and also for collecting the security baseline configuration items of the managed objects into the configuration library. The above technical solution is limited to the management of existing baselines and lacks optimization of the entire process from baseline generation to application. Summary of the Invention
[0005] This invention primarily addresses the problem that existing technical solutions are limited to managing existing baselines and lack optimization of the entire process from baseline creation to application. It provides a Git-based file baseline management method, leveraging Git's file baseline management capabilities to help users establish baselines for specific files or folders within a version, and to detect the file content contained within the baseline. This allows users to view the baseline's contents in a tree-like directory structure, facilitating continuous updates and optimization of the entire baseline process from creation to application.
[0006] The above-mentioned technical problems of the present invention are mainly solved by the following technical solution: The present invention includes the following steps: Establish a baseline management framework to carry out baseline management work; Based on the interface operation, provide the data model required for the baseline management interface; Respond to user interface operations and provide baseline management capabilities; Git repositories provide version control capabilities, allowing you to read and save baseline information about the final state; Store and retrieve intermediate state baseline metadata.
[0007] Building a baseline management architecture can effectively carry out baseline management work. Providing the required data model based on the interface operation can meet the interface display requirements. Responding to the interface operation to provide baseline management capabilities can realize the management of file baselines. The Git repository provides version management capabilities and reads and saves the baseline information of the final state. Version control and final state saving of baseline information can be performed. The data storage structure stores and reads intermediate state baseline metadata.
[0008] Preferably, the baseline management architecture includes a baseline management interface, a baseline management backend service, and a Git repository and data storage connected to the baseline management backend service. This constructs a complete baseline management architecture where the baseline management interface is user-friendly, the baseline management backend service coordinates operations, the Git repository provides version control capabilities, and the data storage stores intermediate baseline metadata, enabling the entire Git-based file baseline management process to proceed in an orderly manner and achieving efficient baseline management.
[0009] Preferably, the baseline management backend service provides the data model required for the baseline management interface, including a file version data metadata model and a baseline data metadata model that provide a file list tree structure metadata model for a specified version. The file version data metadata model includes file name, file type, and file content hash value. When constructing a baseline management architecture and carrying out baseline management work, the baseline management backend service can provide the data model required for the baseline management interface. The file version data metadata model can provide a file list tree structure metadata model for a specified version and covers file name, file type, and file content hash value. The baseline data metadata model can be used for data transformation required for subsequent baseline establishment and other operations, providing the necessary data foundation for the entire Git-based file baseline management.
[0010] Preferably, the baseline data metadata model converts the file list selected by the user on the interface into a data model used to establish the baseline, and writes this model into the database; based on the baseline name entered by the user, it queries the Git repository for the content contained in the baseline. Converting the user-selected file list into a suitable data model for establishing the baseline and writing it into the database facilitates data storage and management; querying the Git repository for the baseline content based on the user-entered baseline name facilitates obtaining the required baseline information. Simultaneously, by combining the work of building a baseline management architecture, providing the data model required for the baseline management interface, providing baseline management capabilities, and the Git repository providing version management capabilities and storing and retrieving intermediate state baseline metadata, Git-based file baseline management can be carried out more effectively.
[0011] Preferably, the baseline management backend service provides baseline management capabilities, including creating file baselines, detecting file baselines, and viewing baselines. This constructs a complete baseline management capability system, enabling the creation of file baselines to manage and record selected file versions, the detection of file baselines to facilitate users obtaining specified baseline content, and the viewing of baselines to help users understand the files included in the baseline.
[0012] Preferably, establishing a file baseline includes: selecting a file version, reading the file content of that version from the Git repository, generating a file version data metadata model, and rendering this data metadata model as a tree-like folder structure in the baseline management interface; selecting the files or folders needed to establish the baseline from the file tree, converting the selected file or folder information into a baseline data metadata model and saving it to the database, thus establishing the baseline. A complete baseline management architecture is constructed to carry out the work, providing the data model and management capabilities required by the baseline management interface. The Git repository is used for version management and baseline information storage. When establishing a file baseline, by selecting a file version, reading the file content to generate a data metadata model and rendering it as a tree-like folder structure, users can easily select the files or folders needed to establish the baseline, convert their information into a baseline data metadata model, and save it to the database, thereby realizing the establishment of the file baseline.
[0013] Preferably, the establishment of a baseline specifically includes the following steps: the baseline management backend service queries the data storage for the file content contained in the baseline based on the baseline name, generates a script file, calls the underlying Git interface in the script file, creates a GitTree object, and adds the selected files or folders as child nodes of the GitTree object. A complete baseline management architecture is constructed to carry out the work, providing the data model and management capabilities required for the baseline management interface. Version management and baseline information storage are performed using a Git repository. When establishing a file baseline, the system selects the file version, reads the file content to generate a data metadata model, and renders it as a tree-like folder structure. This allows users to easily select the files or folders needed to establish the baseline, converts their information into a baseline data metadata model, and saves it to the database, thus realizing the establishment of the file baseline.
[0014] Preferably, the detected file baseline includes reading baseline content from a Git repository based on the baseline name, generating a compressed file from the baseline content, and returning it as a file stream. Upon receiving this file stream, the baseline management interface writes it to the user's local file system. This allows for the construction of a baseline management architecture to perform baseline management tasks, providing the data model and baseline management capabilities required by the baseline management interface. It utilizes the version control capabilities provided by the Git repository to read and save the final state baseline information, and to store and read intermediate state baseline metadata. Simultaneously, it can generate a compressed file from the baseline content read from the Git repository based on the baseline name and return it as a file stream, enabling the baseline management interface to write the file stream to the user's local file system, thus realizing the detection of the file baseline.
[0015] Preferably, viewing a baseline involves querying a list of all baseline names from the Git repository, selecting the baseline name to be checked, and then the baseline management backend service queries the Git repository for the file content contained within that baseline name based on the selected baseline name. By utilizing the version control capabilities provided by the Git repository and reading and saving the final state baseline information, as well as storing and reading intermediate state baseline metadata, the baseline viewing operation can query a list of all baseline names from the Git repository. After selecting the baseline name to be checked, the file content contained within that baseline can be queried, allowing users to easily obtain specific information about a specified baseline.
[0016] Preferably, the retrieved file content is converted into a file version data metadata model, and the baseline management interface renders this file version data metadata model as a tree-like folder. When viewing a baseline, the retrieved file content can be converted into a file version data metadata model and rendered as a tree-like folder, making it easy for users to intuitively view the file content contained in the baseline.
[0017] The beneficial effects of this invention are: based on the file baseline management capability of Git, it helps users to establish baselines for some files or folders in a version based on Git, and check out the file content contained in the file baseline. The content contained in the file baseline can be viewed in the form of a tree directory, which helps to continuously update the file baseline and realize continuous optimization of the entire process from baseline generation to application. Attached Figure Description
[0018] Figure 1 This is a flowchart of the present invention.
[0019] Figure 2 This is a schematic diagram of the principle architecture of the present invention.
[0020] Figure 3 This is a schematic diagram of a Git-based file baseline management method according to the present invention.
[0021] Figure 4 This is a schematic diagram of a process for establishing a file baseline according to the present invention.
[0022] Figure 5 This is a schematic diagram of a baseline detection process according to the present invention.
[0023] Figure 6 This is a schematic diagram of a baseline viewing process according to the present invention. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this application will be further described in detail below through embodiments and in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are only one preferred embodiment of this application and are only used to explain this application. They do not limit the scope of protection of this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0025] The technical solution of the present invention will be further described in detail below through embodiments and in conjunction with the accompanying drawings.
[0026] Example 1: This example describes a Git-based file baseline management method, such as... Figure 1 As shown, it includes the following steps: A baseline management architecture is constructed to carry out baseline management work. This includes a baseline management interface, a baseline management backend service, and Git repositories and data storage connected to the baseline management backend service. A complete baseline management architecture is constructed, in which the baseline management interface is easy for users to operate, the baseline management backend service is responsible for coordinating work, the Git repository provides version control capabilities, and the data storage is used to store intermediate baseline metadata, enabling the entire Git-based file baseline management work to be carried out in an orderly manner and achieving efficient baseline management.
[0027] Based on the interface operation, the data model required for the baseline management interface is provided, including a file version data metadata model and a baseline data metadata model that provide a file list tree structure metadata model under a specified version. The file version data metadata model includes file name, file type, and file content hash value. When constructing the baseline management architecture to carry out baseline management work, the baseline management backend service can provide the data model required for the baseline management interface. The file version data metadata model can provide a file list tree structure metadata model under a specified version, and covers file name, file type, and file content hash value. The baseline data metadata model can be used for data transformation required for subsequent baseline establishment and other operations, providing the necessary data foundation for the entire Git-based file baseline management.
[0028] The principle of Git-based file baseline management method is as follows: Figure 3As shown, the baseline data metadata model converts the file list selected by the user on the interface into a data model used to establish the baseline, and writes this model into the database. Based on the baseline name entered by the user, it queries the Git repository for the content contained in the baseline. Converting the user-selected file list into a suitable data model for establishing the baseline and writing it into the database facilitates data storage and management. Querying the baseline content in the Git repository based on the baseline name entered by the user facilitates obtaining the required baseline information. Simultaneously, by combining the work of building a baseline management architecture, providing the data model required for the baseline management interface, providing baseline management capabilities, and the Git repository providing version management capabilities and storing and retrieving intermediate state baseline metadata, Git-based file baseline management can be carried out more effectively.
[0029] The interface responds to user actions and provides baseline management capabilities. The baseline management backend service offers baseline management capabilities, including creating file baselines, checking out file baselines, and viewing baselines. A complete baseline management capability system has been built, allowing users to create file baselines to manage and record selected file versions, check out file baselines to easily obtain specified baseline content, and view baselines to understand the files included in the baseline.
[0030] like Figure 4 As shown, establishing a file baseline includes: selecting a file version, reading the file content of that version from the Git repository, generating a file version data metadata model, and rendering this data metadata model as a tree-like folder structure in the baseline management interface; selecting the files or folders needed to establish the baseline in the file tree, converting the selected file or folder information into a baseline data metadata model and saving it to the database, thus establishing the baseline. A complete baseline management architecture is constructed to carry out the work, providing the data model and management capabilities required for the baseline management interface. It utilizes the Git repository for version management and baseline information storage. When establishing a file baseline, by selecting a file version, reading the file content, generating a data metadata model, and rendering it as a tree-like folder structure, users can easily select the files or folders needed to establish the baseline, convert their information into a baseline data metadata model, and save it to the database, thus realizing the establishment of the file baseline. Specifically, establishing a baseline includes the baseline management backend service querying the file content contained in the baseline from the data storage based on the baseline name, generating a script file, and calling the underlying Git interface in the script file to create a `gitTree` object, adding the selected files or folders as child nodes of the `git Tree` object. The system constructs a complete baseline management architecture to carry out its work, providing the data model and management capabilities required for the baseline management interface. It utilizes a Git repository for version management and baseline information storage. When establishing a file baseline, it generates a data meta-model by selecting the file version and reading the file content, and renders it into a tree-shaped folder structure. This allows users to easily select the files or folders required to establish the baseline, convert their information into a baseline data meta-model, and save it to the database, thus realizing the establishment of the file baseline.
[0031] like Figure 5 As shown, detecting a file baseline involves reading the baseline content from the Git repository based on the baseline name, generating a compressed file from the baseline content, and returning it as a file stream. The baseline management interface receives this file stream and writes it to the user's local file system. It can build a baseline management architecture to perform baseline management tasks, providing the data model and baseline management capabilities required by the baseline management interface. It utilizes the version control capabilities provided by the Git repository to read and save the final state baseline information, and stores and reads intermediate state baseline metadata. Simultaneously, it can generate a compressed file from the baseline content read from the Git repository based on the baseline name and return it as a file stream, enabling the baseline management interface to write the file stream to the user's local file system, thus realizing the detection of the file baseline.
[0032] like Figure 6 As shown, viewing a baseline involves retrieving a list of all baseline names from the Git repository, selecting the baseline name to be checked, and then the baseline management backend service retrieving the contents of the files contained within that baseline from the Git repository based on the selected baseline name. Utilizing the version control capabilities provided by the Git repository and reading and saving the final state baseline information, as well as storing and reading intermediate state baseline metadata, the baseline viewing operation can retrieve a list of all baseline names from the Git repository. After selecting the baseline name to be checked, the contents of the files contained within that baseline can be queried, allowing users to easily obtain specific information about a specified baseline. The retrieved file contents are converted into a file version data metadata model, and the baseline management interface renders this file version data metadata model as a tree-like folder structure. When viewing a baseline, the retrieved file contents can be converted into a file version data metadata model and rendered as a tree-like folder structure, allowing users to intuitively view the contents of the files contained within the baseline.
[0033] Git repositories provide version control capabilities, reading and saving baseline information for the final state; the data storage structure stores and reads intermediate state baseline metadata. Building a baseline management architecture effectively enables baseline management. Providing the necessary data model based on the user interface meets the interface display requirements, and responding to user interface operations by providing baseline management capabilities enables the management of file baselines. Git repositories provide version control capabilities and read and save the final state baseline information, allowing for version control and final state preservation of baseline information. The data storage structure stores and reads intermediate state baseline metadata.
[0034] Example 2 like Figure 2 As shown, the software architecture mainly consists of the following functional modules: 1) Baseline Management Interface It provides a graphical user interface to facilitate developers in performing baseline management tasks such as baseline creation and viewing through a visual graphical interface.
[0035] 2) Baseline Management Backend Service Based on the interface operation, provide the data model required for the baseline management interface, including: a) File version data metamodel Provides a file list tree structure meta-model for a specified version, including file name, file type (file or folder), and file content hash value.
[0036] b) Baseline Data Metamodel The list of files selected by the user on the interface is converted into a data model used to establish the baseline, and the model is written into the database. Based on the baseline name entered by the user, the content of the baseline is queried from the git repository, including the file name, file type (file or folder), and file content hash value.
[0037] The interface responds to user actions and provides baseline management capabilities, including: a) Establish a document baseline In response to the user's request to create a baseline on the baseline management interface, the baseline data metadata model is retrieved from the data storage according to the baseline name, the baseline is created, and the baseline information is written to the git repository.
[0038] b) Detect document baseline In response to the user's request to check out baseline content on the baseline management interface, the baseline content is read from the git repository according to the baseline name, and the baseline content is generated into a compressed package and returned as a file stream. After receiving the file stream, the baseline management interface writes the file stream to the user's local file system.
[0039] c) View the baseline In response to user requests to view baseline content on the baseline management interface, the files or folders contained in the baseline are displayed in a tree structure.
[0040] 3) Git repository Provides version management capabilities, allowing you to read and save baseline information for the final state.
[0041] 4) Data storage Provides the ability to store and retrieve intermediate state baseline metadata.
[0042] This patent is based on the principle of Git's file baseline management method, as follows: Figure 3 As shown.
[0043] The main operating steps include: 1) Establish a document baseline Establishing a file baseline mainly involves creating a file baseline. The process of establishing a file baseline is as follows: Figure 4 As shown.
[0044] The main operations for establishing a file baseline include: a) Select file version Select the file version (commitId) used to establish the file baseline from the version history of the git repository.
[0045] b) Generate a file tree Based on the file version selected in the previous step, the baseline management backend service reads the file content of that version from the git repository and generates a file version data metadata model. The baseline management interface then renders this data metadata model as a tree-shaped folder.
[0046] c) Select file / folder In the file tree, select the files or folders needed to establish the baseline. After selection, the system will automatically convert the selected file or folder information into a baseline data metadata model and save it to the database.
[0047] d) Establishing a baseline The baseline management backend service queries the data storage for the file content contained in the baseline based on the baseline name, automatically generates a script file, calls the underlying Git interface in the script file, creates a Git Tree object, and adds the selected file or folder as a child node of the Git Tree object.
[0048] 2) Detect document baseline The baseline detection process primarily involves reading the baseline content from the Git repository based on the baseline name, generating a compressed file from the baseline content, and returning it as a file stream. The baseline management interface receives this file stream and writes it to the user's local file system. The process of viewing the baseline content is as follows: Figure 5 As shown.
[0049] The main steps for baseline detection include: a) Select baseline name Retrieve a list of all baseline names from the git repository and select the baseline name to be checked.
[0050] b) Query baseline content Based on the baseline name selected in the previous step, the baseline management backend service queries the contents of the files contained in the Git repository according to the baseline name.
[0051] c) Generate a file stream The contents of the files retrieved in the previous step are generated into a compressed package and returned as a file stream.
[0052] d) Save the file stream The baseline management interface writes the file stream generated in the previous step to the user's local file system.
[0053] 3) View file baseline Viewing a baseline primarily involves displaying the files or folders contained within it in a tree structure based on the selected baseline name. The process of viewing baseline content is as follows: Figure 6 As shown.
[0054] The main steps for viewing the baseline include: a) Select baseline name Retrieve a list of all baseline names from the git repository and select the baseline name to be checked.
[0055] b) Query baseline content Based on the baseline name selected in the previous step, the baseline management backend service queries the contents of the files contained in the Git repository according to the baseline name.
[0056] c) Generate a file tree The file content retrieved in the previous step is converted into a file version data metadata model, which is then rendered as a tree-shaped folder structure in the baseline management interface.
[0057] Through the above design process, developers can use file baseline management tools to implement a complete file baseline management process, including: 1) Establish a document baseline 2) Detect document baseline 3) View file baseline The above definition process enables Git-based file baseline management capabilities, thus benefiting users: 1) Establish a baseline for specific files or folders within a version based on Git. 2) Detect the file content contained in the file baseline. 3) View the contents of the file baseline in a tree directory format.
[0058] Example 3 The Git-based file baseline management method provided in this application includes steps such as building a baseline management architecture, providing a data model, providing baseline management capabilities, using Git repositories for version management, and storing and retrieving intermediate state baseline metadata. Through the coordinated efforts of these steps, efficient, flexible, and secure file baseline management can be achieved, addressing the shortcomings of traditional file management methods in version control, data security, and large-scale project management.
[0059] Specifically, the baseline management architecture includes a baseline management interface, a baseline management backend service, a Git repository, and data storage. The baseline management interface serves as the user's window to interact with the system, facilitating various operations. The baseline management backend service coordinates and processes data. The Git repository manages version information and saves the final baseline state. The data storage stores intermediate baseline metadata. The baseline management backend service is connected to both the Git repository and the data storage, enabling data interaction and sharing. For example, the baseline management backend service can retrieve file version information from the Git repository and store processed data in the data storage.
[0060] Regarding the data model required for the baseline management interface, the baseline management backend service provides a file version data metadata model and a baseline data metadata model for a specified version, representing a file list tree structure metamodel. The file version data metadata model includes file name, file type, and file content hash value. The file name identifies the file, the file type helps distinguish different file types, and the file content hash value ensures the uniqueness and integrity of the file content. For example, for a text file named "example.txt" with a file type of "txt", the file content hash value can be calculated using a specific hash algorithm. The baseline data metadata model converts the file list selected by the user on the interface into a data model used to build the baseline and writes this model into the database. Simultaneously, based on the baseline name entered by the user, it queries the Git repository for the content contained in the baseline.
[0061] In terms of baseline management capabilities, this includes creating file baselines, checking out file baselines, and viewing baselines. When creating a file baseline, first, a file version is selected. The file content for that version is read from the Git repository, and a file version data metadata model is generated. The baseline management interface renders this data metadata model as a tree-like folder structure. For example, if a user selects a specific version of a project, the system will retrieve the content of all files under that version from the Git repository, generate the corresponding file version data metadata model, and then display it as a tree-like folder structure on the interface. Next, the user selects the files or folders needed to create the baseline from the file tree. After selection, the information of the selected files or folders is converted into a baseline data metadata model and saved to the database, thus establishing the baseline. Specifically, the baseline management backend service queries the data storage for the file content contained in the baseline based on the baseline name, generates a script file, and calls the underlying Git interface in the script file to create a Git Tree object, adding the selected files or folders as child nodes of the Git Tree object.
[0062] When a file baseline is detected, the baseline content is read from the Git repository based on the baseline name, and the baseline content is generated into a compressed package and returned as a file stream. After receiving the file stream, the baseline management interface writes the file stream to the user's local file system. For example, if a user needs to obtain the file content of a certain baseline, the system will find the corresponding file in the Git repository based on the baseline name, package it into a compressed package, and then send it to the user's local file system as a file stream.
[0063] When viewing a baseline, the system retrieves a list of all baseline names from the Git repository and selects the baseline name to be checked. The baseline management backend service then uses this selected baseline name to query the contents of the files contained within it from the Git repository. The retrieved file contents are then converted into a file version data metadata model. The baseline management interface renders this file version data metadata model as a tree-like folder structure for easy viewing and manipulation by the user.
[0064] The implementation principle of this embodiment is as follows: By constructing a reasonable baseline management architecture, utilizing the version management capabilities of the Git repository, and combining the provision of a data model with the implementation of baseline management capabilities, efficient, flexible, and secure file baseline management is achieved. Each step collaborates to form a complete management system, solving many shortcomings of traditional file management methods, improving the efficiency and accuracy of file management, ensuring data security and traceability, and providing strong support for the smooth progress of software development projects.
[0065] The specific embodiments described herein are merely illustrative examples illustrating the spirit of the invention. The above embodiments only express several implementation methods of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of protection of this application. It should be noted that those skilled in the art to which this application pertains can make various modifications or additions to the described specific embodiments or use similar methods to replace them, but without departing from the spirit of this application or exceeding the scope defined by the appended claims. For those skilled in the art, multiple variations and improvements can be made without departing from the concept of this application. Therefore, the scope of protection of this application should be determined by the appended claims.
Claims
1. A Git-based file baseline management method, characterized in that, Includes the following steps: Establish a baseline management framework to carry out baseline management work; Based on the interface operation, provide the data model required for the baseline management interface; Responds to user interface operations and provides baseline management capabilities; Provides version management capabilities, allowing you to read and save baseline information for the final state; Store and retrieve intermediate state baseline metadata.
2. The Git-based file baseline management method according to claim 1, characterized in that, The baseline management architecture includes a baseline management interface, a baseline management backend service, and a Git repository and data storage respectively connected to the baseline management backend service.
3. The Git-based file baseline management method according to claim 1, characterized in that, The baseline management backend service provides the data model required for the baseline management interface, including a file version data meta-model and a baseline data meta-model that provide a file list tree structure meta-model under a specified version. The file version data meta-model includes file name, file type and file content hash value.
4. The Git-based file baseline management method according to claim 3, characterized in that, The baseline data metadata model converts the file list selected by the user on the interface into a data model used to establish the baseline, and writes the model into the database; based on the baseline name entered by the user, it queries the Git repository for the contents of the baseline.
5. The Git-based file baseline management method according to claim 1, characterized in that, The baseline management backend service provides baseline management capabilities, including creating file baselines, detecting file baselines, and viewing baselines.
6. The Git-based file baseline management method according to claim 5, characterized in that, The process of establishing a file baseline includes: selecting a file version, reading the file content of that version from the git repository, generating a file version data meta-model, rendering the data meta-model as a tree-shaped folder in the baseline management interface; selecting the files or folders required for establishing the baseline in the file tree, converting the selected file or folder information into a baseline data meta-model and saving it to the database to establish the baseline.
7. The Git-based file baseline management method according to claim 6, characterized in that, The establishment of the baseline specifically includes the following steps: the baseline management backend service queries the file content contained in the baseline from the data storage according to the baseline name, generates a script file, calls the underlying Git interface in the script file, creates a Git Tree object, and adds the selected file or folder as a child node of the Git Tree object.
8. The Git-based file baseline management method according to claim 5, characterized in that, The detected file baseline includes reading the baseline content from the git repository according to the baseline name, generating a compressed package of the baseline content, and returning it in the form of a file stream. After receiving the file stream, the baseline management interface writes the file stream to the user's local file system.
9. A Git-based file baseline management method according to claim 5, characterized in that, The process of viewing the baseline involves querying a list of all baseline names from the git repository, selecting the baseline name to be detected, and then querying the contents of the files contained in the baseline from the git repository based on the selected baseline name.
10. A Git-based file baseline management method according to claim 9, characterized in that, The retrieved file content is converted into a file version data metadata model, and the baseline management interface renders the file version data metadata model as a tree-shaped folder.
Citation Information
Patent Citations
Safety baseline management system and method
CN107679692A
Cited By
Metadata version control method
CN121979865A