A multi-warehouse management method, device, equipment and medium using configuration files
Through the configuration file management method, multiple warehouses are set up in parallel, which solves the problem of inconsistent version control of the main warehouse and the sub-warehouse, realizes unified management of code versions, improves the efficiency and reliability of code management, and meets the needs of full source code construction .
Patent Information
- Application Number
- CN202311499270.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-10
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2043-11-10
AI Technical Summary
In multi-team collaborative software development, the version control of the main warehouse and the sub warehouse is not unified, resulting in code version conflicts and cannot meet the needs of full source code construction.
Through the configuration file management method, multiple warehouses are set in parallel, the original configuration file and user permission information of the target warehouse are obtained, the user's personal configuration file is generated, and the latest version of the personal configuration file is pulled into the target directory of the target warehouse to achieve the division The tiling permission management of warehouses can avoid inconsistent versions of the main warehouse and sub warehouse.
Improves the efficiency and reliability of code management, ensures consistency and synchronization of code versions, simplifies workflows, and promotes team collaboration and code reuse.
Smart Images

Figure CN117311767B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer network technology, and in particular to a multi-warehouse management method, device, equipment and medium using a configuration file. Background Art
[0002] In the multi-team collaborative software development process, when the code project is large and the dependencies between components are strong, it is usually necessary to unify the directory tree under the full source code construction requirements while performing version control. For code security, especially when involving external collaborative development, fine-grained code permission control management is required.
[0003] In the prior art, a centralized version control tool is usually used to manage multiple warehouses and pull from each warehouse after the warehouse is divided. In the software development process, a code project is composed of multiple code warehouses, and the code warehouses are divided into primary and secondary. The sub-warehouse and the main warehouse work together to complete the software development. The sub-warehouse exists as a directory or module of the main warehouse. The sub-warehouse outputs the development results separately, and the main warehouse integrates the development results output by the sub-warehouse to manage multiple warehouses. However, if the main warehouse is not updated, the update status of the sub-warehouse cannot be obtained in time, resulting in inconsistent version control, code version conflicts during the pulling process, and the inability to meet the construction requirements of the full source code. Summary of the invention
[0004] In view of this, the present invention provides a multi-warehouse management method, device, equipment and medium using a configuration file to solve the problem of inconsistent version control of the main warehouse and sub-warehouses in the centralized multi-warehouse management of the prior art, resulting in code version conflicts.
[0005] In a first aspect, the present invention provides a multi-warehouse management method using a configuration file, wherein multiple warehouses are set in parallel, the method comprising:
[0006] Obtaining the original configuration file of the target warehouse and user authority information, where the user authority information is used to indicate whether the user has authority to the target warehouse;
[0007] Generate a user's personal configuration file based on the original configuration file of the target warehouse and the user authority information;
[0008] Parsing the user's personal configuration file to obtain a target directory of a target warehouse;
[0009] The latest version of the user's personal configuration file is obtained, and the latest version of the user's personal configuration file is pulled into a target directory of a target warehouse.
[0010] The present invention realizes flat permission management of sub-warehouses by setting up multiple warehouses in parallel, replacing the scheme of using main warehouses and sub-warehouses for version control. It generates the user's personal configuration file according to the original configuration file and user permissions of the target warehouse, and then pulls the latest version of the configuration file according to the parsed result of the user's personal configuration file, thereby realizing version update in version control, and fundamentally avoiding the situation of inconsistent versions of the main warehouse and sub-warehouse, thereby improving the efficiency and reliability of code management.
[0011] In an optional implementation, obtaining user authority information of a target warehouse includes:
[0012] Obtain the original configuration file of each warehouse, and traverse all warehouses recorded in the original configuration file of each warehouse;
[0013] Scan the user's permissions for all warehouses and obtain the user permission information for all warehouses;
[0014] Extract the user permission information of the target warehouse from the user permission information of all warehouses.
[0015] The present invention obtains user authority information of all warehouses by traversing the warehouses recorded in the original configuration file, so as to filter out the user authority of the target warehouse from the user authority information of all warehouses.
[0016] In an optional implementation, generating a user's personal configuration file based on the original configuration file of the target warehouse and the user authority information includes:
[0017] If the user authority information indicates that the user has the authority of the target warehouse, the personal configuration file rules returned by each warehouse after receiving the authority confirmation command are obtained, and the original configuration file of the target warehouse is adjusted according to the personal configuration file rules to generate the user's personal configuration file;
[0018] If the user authority information indicates that the user does not have the authority to the target warehouse, a prompt message is output, wherein the prompt message indicates that access is denied.
[0019] The present invention outputs the user's personal profile or prompt information according to whether the user has the authority of the target warehouse, so as to process the personal profile or prompt the user or administrator.
[0020] In an optional implementation, the target directory of the target warehouse includes a URL address and a target path of the target warehouse.
[0021] The present invention extracts the target directory of the target warehouse to obtain the URL address and target path of the target warehouse, so as to perform the next step operation on the configuration file according to the URL address and target path of the target warehouse.
[0022] In an optional implementation, obtaining the latest version of the user's personal profile and pulling the latest version of the user's personal profile to a target directory of a target warehouse includes:
[0023] Obtaining the directory tree structure of the original configuration file and the latest version of the user's personal configuration file through a first preset update command;
[0024] Pull the latest version of the user's personal configuration file to the target directory according to the directory tree structure of the original configuration file.
[0025] The present invention obtains the directory tree structure of the original configuration file through the first preset update command, and pulls the user's personal configuration file to achieve the pulling of the configuration file, thereby realizing version control.
[0026] In an optional implementation, before pulling the user's personal profile to the target directory, the method further includes:
[0027] When a call update command operation triggered by the user is detected, the user's personal profile is updated through a second preset update command.
[0028] The present invention updates the configuration file to ensure that the configuration file is the latest version, thereby avoiding conflicts caused by the pulled configuration file not being updated in time.
[0029] In an optional implementation, before pulling the user's personal profile to the target directory, the method further includes:
[0030] Use the preset cleanup command to clean up temporary files during the configuration file compilation process.
[0031] The present invention releases the storage space occupied by the temporary files by cleaning up the temporary files, thereby simplifying the developer's workflow.
[0032] In a second aspect, the present invention provides a multi-warehouse management device using a configuration file, wherein multiple warehouses are arranged in parallel, and the device comprises:
[0033] An acquisition module is used to acquire the original configuration file of the target warehouse and user authority information, wherein the user authority information is used to indicate whether the user has the authority to the target warehouse;
[0034] A configuration file generation module, used to generate a user's personal configuration file based on the original configuration file of the target warehouse and the user authority information;
[0035] A parsing module, used for parsing the user's personal configuration file to obtain a target directory of a target warehouse;
[0036] The pulling module is used to obtain the latest version of the user's personal configuration file, and pull the latest version of the user's personal configuration file to a target directory of a target warehouse.
[0037] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the multi-warehouse management method using a configuration file of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0038] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the multi-warehouse management method using a configuration file according to the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 is a flowchart of a multi-warehouse management method using a configuration file according to an embodiment of the present invention;
[0041] Figure 2 is a flowchart of another multi-warehouse management method using a configuration file according to an embodiment of the present invention;
[0042] Figure 3 is a flowchart of another multi-warehouse management method using a configuration file according to an embodiment of the present invention;
[0043] Figure 4 is a structural block diagram of a multi-warehouse management device using a configuration file according to an embodiment of the present invention;
[0044] Figure 5 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution 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 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0046] In the related art, multi-warehouse management is completed by the collaboration of the main warehouse and the sub-warehouse. Generally, the sub-warehouses are used to output the development results separately and then integrate them. However, when the code is in an immature stage, it is difficult to develop and integrate, and the efficiency is low. Currently, the most commonly used version control tool comes with a submodule. The submodule is a submodule in the git tool. The submodule can merge, pull, and arrange the directory for each warehouse after the warehouse is divided. However, since its version information also needs to be stored as part of the warehouse, if the sub-warehouse version recorded in the main warehouse is still in the old state, it is almost impossible to notice that the sub-warehouse has been updated without updating the main warehouse, resulting in inconsistent version control. Code version conflicts are prone to occur during high-frequency uploads and pulls, and the full source code construction requirements cannot be met.
[0047] According to an embodiment of the present invention, an embodiment of a multi-warehouse management method using a configuration file is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in an order different from that shown here.
[0048] In this embodiment, a multi-warehouse management method using a configuration file is provided, which is applied to a distributed version control system. Multiple warehouses in the distributed version control system are set up in parallel, and cooperate with private code warehouse systems such as Gitlab and BitBucket to perform flat permission management for each warehouse to achieve fine-grained permission control. The method is executed by a multi-warehouse management tool. Figure 1 is a flowchart of a multi-warehouse management method using a configuration file according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0049] Step S101, obtaining the original configuration file of the target warehouse and user authority information, where the user authority information is used to indicate whether the user has authority over the target warehouse.
[0050] In an embodiment of the present invention, a multiple-repos control (mrctl) tool is constructed by using a script. The multiple-repos control tool reads the original configuration file of the target warehouse and performs a permission scan for each user to obtain user permission information.
[0051] The format of the original configuration file can be xml, ini, yml, etc. The original configuration file records the address of each sub-warehouse, the relative path in the directory tree (i.e., the mapping relationship with the overall project), version information and permission information, and performs special version control on each warehouse. In a distributed file system, the directory tree refers to a structure that displays the nested directory organization in the file system to achieve synchronization and version management of the directory tree.
[0052] The user permission information includes whether the user has access rights, editing rights, and other permissions to the target warehouse.
[0053] Step S102: Generate a personal configuration file of the user based on the original configuration file of the target warehouse and the user authority information.
[0054] In the embodiment of the present invention, the user's permission information is obtained through the git command, and the original configuration file of the target warehouse is adjusted according to the user's permission information to generate a user-personalized configuration file. The user's personal configuration file at least includes the remote warehouse main address, the default pulled branch, the default pulled version, and the address of each permission warehouse and its relative path.
[0055] Step S103, parsing the user's personal configuration file to obtain a target directory of the target warehouse.
[0056] In an embodiment of the present invention, a multi-warehouse management tool is used to parse the user's personal configuration file. For example, the multi-warehouse management tool is written in Python, and the user's personal configuration file is in json format. A Python tool is used to parse the user's personal configuration file to obtain the target directory pulled by the target warehouse.
[0057] Step S104, obtaining the latest version of the user's personal profile, and pulling the latest version of the user's personal profile to the target directory of the target warehouse.
[0058] In an embodiment of the present invention, the user's personal profile records user authority information, and the user's personal profile is updated to the latest version using the "mrctlupdate" command, and the latest version of the user's personal profile is pulled to the target directory of the target warehouse to ensure that the user's personal profile pulled to the target directory of the target warehouse is the latest version.
[0059] The multi-warehouse management method using configuration files provided in this embodiment realizes flat permission management of sub-warehouses by setting up multiple warehouses in parallel, replacing the scheme of using main warehouses and sub-warehouses for version control. The user's personal configuration file is generated according to the original configuration file and user permissions of the target warehouse, and the latest version of the configuration file is pulled according to the parsed result of the user's personal configuration file, thereby realizing version update in version control, and fundamentally avoiding the situation of inconsistent versions of the main warehouse and sub-warehouse, thereby improving the efficiency and reliability of code management.
[0060] This method can manage multiple git repositories at the same time, ensure the consistency and synchronization of the code, simplify the workflow, provide version control and branch management functions, promote team collaboration, facilitate code reuse and sharing, and make code management more efficient and reliable.
[0061] In this embodiment, a multi-warehouse management method using a configuration file is provided. Figure 2 is a flowchart of a multi-warehouse management method using a configuration file according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0062] Step S201, obtaining the original configuration file of the target warehouse and user authority information, where the user authority information is used to indicate whether the user has authority over the target warehouse.
[0063] Specifically, the user authority information of the target warehouse is obtained in the above step S201, including:
[0064] Step S2011, obtaining the original configuration file of each warehouse, and traversing all warehouses recorded in the original configuration file of each warehouse.
[0065] Step S2012, scan the user's permissions to all warehouses to obtain user permission information for all warehouses.
[0066] Step S2013, extracting the user authority information of the target warehouse from the user authority information of all warehouses.
[0067] In the embodiment of the present invention, the multi-warehouse management tool is written in Python, and uses the open function to create a new blank configuration file and read the original configuration file of each warehouse. The original configuration file includes the main address of the remote warehouse, the default pulled branch (the default is main, the main branch), and the default pulled version (the default is the latest version).
[0068] Traverse all warehouses recorded in the original configuration files of each warehouse, obtain the user's permissions to all warehouses through the git command, obtain the user permission information of all warehouses, extract the user permissions corresponding to the target warehouse from the user permission information of all warehouses, and obtain the user permission information of the target warehouse.
[0069] By traversing the warehouses recorded in the original configuration file, the user permission information of all warehouses is obtained, so as to filter out the user permission of the target warehouse from the user permission information of all warehouses.
[0070] Step S202: Generate a personal configuration file of the user based on the original configuration file of the target warehouse and the user authority information.
[0071] Specifically, the above step S202 includes:
[0072] Step S2021, if the user authority information shows that the user has authority over the target warehouse, obtain the personal profile rules returned by each warehouse after receiving the authority confirmation command, and adjust the original profile of the target warehouse according to the personal profile rules to generate the user's personal profile.
[0073] Step S2022: If the user authority information indicates that the user does not have the authority to the target warehouse, a prompt message is output, and the prompt message is that access is denied.
[0074] In an embodiment of the present invention, the user permission information is determined by a git command. Specifically, the git command may be "gitls-remote <warehouse address>". If the user permission information indicates that the user has the permission of the target warehouse, the warehouse returns the personal configuration file rule, that is, the rule text of the personal configuration file, after receiving the command. The user's personal configuration file is generated according to the rule text of the personal configuration file and the original configuration file of the target warehouse. Finally, the close statement in Python is called to save.
[0075] Specifically, common methods of generating configuration files include manual creation, copying existing files, using program commands, and using configuration file generation tools. By adjusting the original configuration file of the target, the user's personal configuration file can be generated by using the following program command method, or other methods can be used to generate the configuration file, which is not limited here.
[0076] Manual creation: Use a text editor to manually create a configuration file. First, open the terminal, then use the command line editor to create a new file, and then add the required configuration content to the file. Finally, save the configuration file with the specified file name and extension.
[0077] Copy an existing file: If a similar configuration file already exists, you can use it as a template to generate a new configuration file. You can use the cp command to copy the existing file and then modify the copied file.
[0078] Using program commands: Some programs provide command line options to generate default configuration files. You can generate configuration files by running the program's command line options and modify them as needed.
[0079] Use configuration file generation tools: There are some specific tools that can help generate configuration files, such as GNU Autoconf and GNU Automake, etc. These tools can generate configuration files based on a set of rules or templates.
[0080] If the user permission information shows that the user does not have permission to the target warehouse, the relevant text "access denied" is output, that is, the access denied prompt information.
[0081] By outputting the user's personal profile or prompt information according to whether the user has the authority of the target warehouse, it is convenient to process the personal profile or prompt the user or administrator.
[0082] Step S203, parsing the user's personal configuration file to obtain a target directory of the target warehouse.
[0083] For details, please see Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.
[0084] Step S204, obtaining the latest version of the user's personal profile, and pulling the latest version of the user's personal profile to the target directory of the target warehouse.
[0085] Specifically, the above step S204 includes:
[0086] Step S2041, obtaining the directory tree structure of the original configuration file and the latest version of the user's personal configuration file through a first preset update command.
[0087] Step S2042: pull the latest version of the user's personal configuration file to the target directory according to the directory tree structure of the original configuration file.
[0088] In the embodiment of the present invention, the target directory of the target warehouse includes the URL address and the target path of the target warehouse. The first preset update command is the "mrctl update" command, which updates the user's personal configuration file to the latest version.
[0089] Take the user's personal profile in JSON format as an example, the structure of each permission warehouse may be:
[0090] {
[0091] repo_name: "Mini Program",
[0092] url: "https: / / github.com / wechat / miniprogram",
[0093] path:“src / components / miniprogram”
[0094] }
[0095] Simply use Python to parse the configuration file, get the URL address and path target path of the Mini Program, and then directly call the git command such as "git clone https: / / github.com / wechat / miniprogram src / components / miniprogram" to pull the latest version of the user's personal configuration file to the specified URL address and target path, and traverse and read the information of all repositories.
[0096] The target directory of the target warehouse is extracted to obtain the URL address and target path of the target warehouse, so as to perform the next operation on the configuration file according to the URL address and target path of the target warehouse.
[0097] The multi-warehouse management method using the configuration file provided in this embodiment obtains the directory tree structure of the original configuration file through the first preset update command, and pulls the user's personal configuration file to realize the pulling of the configuration file, thereby realizing version control.
[0098] In this embodiment, a multi-warehouse management method using a configuration file is provided. Figure 3 is a flowchart of a multi-warehouse management method using a configuration file according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:
[0099] Step S301, obtaining the original configuration file of the target warehouse and user authority information, where the user authority information is used to indicate whether the user has authority over the target warehouse.
[0100] For details, please see Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0101] Step S302: Generate a personal configuration file of the user based on the original configuration file of the target warehouse and the user authority information.
[0102] For details, please see Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.
[0103] Step S303, parsing the user's personal configuration file to obtain a target directory of the target warehouse.
[0104] For details, please see Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.
[0105] Step S304: when a user-triggered call update command operation is detected, the user's personal profile is updated through a second preset update command.
[0106] In the embodiment of the present invention, when the user authority changes, the user actively calls the update command. When the user-triggered call update command operation is detected, the user's personal configuration file needs to be updated, and the "mrctl fetch" second preset update command is used to obtain the latest version of the personal configuration file to replace the current personal configuration file, that is, the update of the personal configuration file is completed.
[0107] When the user needs to push the version code, that is, when the user-triggered push version code command is detected, the "mrctl push" command is used to pull the latest version of each sub-warehouse and check the code conflict. If there is no code conflict, it is submitted to avoid code conflicts.
[0108] By updating the configuration file, you can ensure that the configuration file is the latest version, thereby avoiding conflicts caused by the configuration file not being updated in time.
[0109] Step S305, cleaning up temporary files in the process of compiling the configuration file by using a preset cleaning command.
[0110] In the embodiment of the present invention, temporary files in the process of compiling the configuration file are cleaned up by using the "mrctl clean" command.
[0111] You can also pass different parameters through the "mrctl build" command to build projects in different modes.
[0112] Step S306, obtaining the latest version of the user's personal profile, and pulling the latest version of the user's personal profile to the target directory of the target warehouse.
[0113] For details, please see Figure 1 Step S104 of the illustrated embodiment will not be described in detail here.
[0114] The multi-warehouse management method using configuration files provided in this embodiment clears temporary files to release the storage space occupied by temporary files, thereby simplifying the developer's workflow.
[0115] In this embodiment, a multi-warehouse management device using a configuration file is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. As used below, the term "module" may be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0116] This embodiment provides a multi-warehouse management device using a configuration file, such as Figure 4 As shown, including:
[0117] The acquisition module 401 is used to acquire the original configuration file of the target warehouse and the user authority information, where the user authority information is used to indicate whether the user has the authority to the target warehouse.
[0118] The configuration file generation module 402 is used to generate a user's personal configuration file based on the original configuration file of the target warehouse and the user authority information.
[0119] The parsing module 403 is used to parse the user's personal configuration file to obtain the target directory of the target warehouse.
[0120] The pulling module 404 is used to obtain the latest version of the user's personal configuration file and pull the latest version of the user's personal configuration file to the target directory of the target warehouse.
[0121] In some optional implementations, the acquisition module 401 includes:
[0122] The first acquisition unit is used to acquire the original configuration file of each warehouse and traverse all warehouses recorded in the original configuration file of each warehouse.
[0123] The scanning unit is used to scan the user's permissions to all warehouses and obtain the user permission information of all warehouses.
[0124] The extraction module is used to extract the user permission information of the target warehouse from the user permission information of all warehouses.
[0125] In some optional implementations, the configuration file generating module 402 includes:
[0126] The configuration file generating unit is used to obtain the personal configuration file rules returned by each warehouse after receiving the permission confirmation command if the user permission information shows that the user has the permission of the target warehouse, and adjust the original configuration file of the target warehouse according to the personal configuration file rules to generate the user's personal configuration file.
[0127] The output unit is used to output a prompt message if the user authority information indicates that the user does not have the authority to the target warehouse, and the prompt message is that the access is denied.
[0128] In some optional implementations, the pulling module 404 includes:
[0129] The second acquisition unit is used to acquire the directory tree structure of the original configuration file and the latest version of the user's personal configuration file through the first preset update command.
[0130] The pulling unit is used to pull the latest version of the user's personal configuration file to the target directory according to the directory tree structure of the original configuration file.
[0131] In some optional embodiments, the device further comprises:
[0132] The updating module is used to update the user's personal profile through a second preset updating command when detecting an updating command call operation triggered by the user.
[0133] In some optional embodiments, the device further comprises:
[0134] The cleanup module is used to clean up temporary files during the configuration file compilation process through preset cleanup commands.
[0135] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0136] The multi-warehouse management device using the configuration file in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0137] The embodiment of the present invention also provides a computer device having the above Figure 4 A multi-warehouse management device utilizing a configuration file is shown.
[0138] See also Figure 5 , Figure 5 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 5As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.
[0139] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0140] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0141] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0142] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0143] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 5 The example of connecting through bus is taken in the following.
[0144] The input device 30 can receive input digital or character information and generate key signal input related to user settings and function control of the computer device, such as a touch screen, etc. The output device 40 can include a display device, etc.
[0145] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0146] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A multi-warehouse management method using a configuration file, characterized in that: Applied to a distributed version control system, where multiple repositories are set up in parallel, the method includes: Obtain the original configuration file and user permission information of the target warehouse. The user permission information is used to indicate whether the user has the permission of the target warehouse. The original configuration file is used to record the address of each sub-warehouse, the relative path in the directory tree, version information and permission information; Generate a user's personal configuration file based on the original configuration file of the target warehouse and the user authority information; Parsing the user's personal configuration file to obtain a target directory of the target warehouse, wherein the user's personal configuration file records user authority information; Obtain the latest version of the user's personal profile, and pull the latest version of the user's personal profile to a target directory of a target warehouse; Get the user permission information of the target warehouse, including: Obtain the original configuration file of each warehouse, and traverse all warehouses recorded in the original configuration file of each warehouse, wherein the original configuration file includes the primary address of the remote warehouse, the default pulled branch, and the default pulled version; Scan the user's permissions for all warehouses and obtain the user permission information for all warehouses; Extract the user permission information of the target warehouse from the user permission information of all warehouses.
2. The method according to claim 1, characterized in that The generating of a user's personal configuration file based on the original configuration file of the target warehouse and the user authority information includes: If the user authority information indicates that the user has the authority of the target warehouse, the personal configuration file rules returned by each warehouse after receiving the authority confirmation command are obtained, and the original configuration file of the target warehouse is adjusted according to the personal configuration file rules to generate the user's personal configuration file; If the user authority information indicates that the user does not have the authority to the target warehouse, a prompt message is output, wherein the prompt message indicates that access is denied.
3. The method according to claim 1, characterized in that: The target directory of the target warehouse includes the URL address and target path of the target warehouse.
4. The method according to claim 1, characterized in that: The step of obtaining the latest version of the user's personal profile and pulling the latest version of the user's personal profile to a target directory of a target warehouse includes: Obtaining the directory tree structure of the original configuration file and the latest version of the user's personal configuration file through a first preset update command; Pull the latest version of the user's personal configuration file to the target directory according to the directory tree structure of the original configuration file.
5. The method according to claim 1, characterized in that Before pulling the user's personal profile to the target directory, the method further includes: When a call update command operation triggered by the user is detected, the user's personal profile is updated through a second preset update command.
6. The method according to claim 1, characterized in that Before pulling the user's personal profile to the target directory, the method further includes: Use the preset cleanup command to clean up temporary files during the configuration file compilation process.
7. A multi-warehouse management device using a configuration file, characterized in that: Applied to a distributed version control system, where multiple warehouses are set in parallel, the device includes: An acquisition module is used to acquire the original configuration file of the target warehouse and user authority information. The user authority information is used to indicate whether the user has the authority to the target warehouse. The original configuration file is used to record the address of each sub-warehouse, the relative path in the directory tree, version information and authority information; A configuration file generation module, used to generate a user's personal configuration file based on the original configuration file of the target warehouse and the user authority information; A parsing module, used to parse the user's personal configuration file to obtain a target directory of a target warehouse, wherein the user's personal configuration file records user authority information; A pulling module is used to obtain the latest version of the user's personal configuration file, and pull the latest version of the user's personal configuration file to a target directory of a target warehouse; Among them, the acquisition module is specifically used to: obtain user permission information of the target warehouse, including: obtaining the original configuration file of each warehouse, and traversing all warehouses recorded in the original configuration file of each warehouse, wherein the original configuration file includes the primary address of the remote warehouse, the default pulled branch, and the default pulled version; scanning the user's permissions to all warehouses to obtain the user permission information of all warehouses; extracting the user permission information of the target warehouse from the user permission information of all warehouses.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the multi-warehouse management method using a configuration file according to any one of claims 1 to 6 by executing the computer instructions.
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 computer to execute the multi-warehouse management method using a configuration file according to any one of claims 1 to 6.
