Program file management method and device, storage medium and electronic equipment

By acquiring and parsing package and process information of Python packages, and comparing and managing them, the problem of inconvenient Python package management during containerization is solved, achieving fine-grained control and reducing maintenance costs.

CN114296780BActive Publication Date: 2026-05-29GUANGZHOU BOGUAN TELECOMM TECH LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU BOGUAN TELECOMM TECH LTD
Filing Date
2021-12-27
Publication Date
2026-05-29

Smart Images

  • Figure CN114296780B_ABST
    Figure CN114296780B_ABST
Patent Text Reader

Abstract

The present disclosure belongs to the technical field of computers and relates to a program file management method and device, a storage medium and an electronic device. The method comprises: obtaining package information of a program package and process information corresponding to the program package, and performing analysis processing on the process information to obtain updated process information; obtaining current information of a current process, and comparing the current information with the updated process information to obtain a first comparison result; performing elimination processing on the updated process information according to the first comparison result to obtain target information, so as to manage the program package through the package information and the target information. The present disclosure improves the efficiency of problem positioning and tracking, can control the package information of different services in a more flexible manner under the premise of smaller maintenance cost, realizes fine management of the program package, reduces the maintenance cost, maintenance workload and time cost, and also provides a more convenient solution for special version designation and version gray test scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a method and apparatus for managing program files, a computer-readable storage medium, and an electronic device. Background Technology

[0002] Software or applications within containers can move and run consistently in any environment and on any infrastructure, unaffected by the operating system of that environment or infrastructure. Taking Python as an example, Python programs often rely heavily on third-party packages in addition to their built-in basic modules. The flexible use of third-party packages brings many conveniences to development. However, the conflict between how third-party packages are managed and the containerized deployment of processes gradually becomes apparent during containerization, rendering the original package deployment and management methods no longer suitable.

[0003] Currently, the project primarily employs two methods for Python package management. One is based on a self-developed application framework, where Python packages are deployed uniformly on physical machines, and all processes share the same packages. The other is based on the Flask framework, deploying HTTP (Hypertext Transfer Protocol) service processes, where each service independently creates and deploys a virtual environment, and each service exclusively uses third-party Python packages. However, the first method does not offer the advantage of reduced maintenance costs, and once the runtime environment is isolated following containerization, this approach is clearly unsuitable for the deployment and operation processes following containerization. The second method is too time-consuming and also increases the workload of application maintenance.

[0004] Therefore, there is an urgent need in the field to develop a new method and apparatus for managing program files.

[0005] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0006] The purpose of this disclosure is to provide a method for managing program files, a device for managing program files, a computer-readable storage medium, and an electronic device, thereby overcoming, to at least some extent, the technical problem of poor package management due to limitations in related technologies.

[0007] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part by practice of this disclosure.

[0008] According to a first aspect of the present invention, a method for managing program files is provided, the method comprising:

[0009] Obtain the package information of the program package and the process information corresponding to the program package, and parse the process information to obtain the updated process information;

[0010] Obtain the current information of the current process, and compare the current information with the updated process information to obtain a first comparison result;

[0011] Based on the first comparison result, the updated process information is processed to remove targets, so that the package can be managed using the package information and the target information.

[0012] In an exemplary embodiment of the present invention, after parsing the process information to obtain the updated process information, the method further includes:

[0013] Store the package information and the updated process information.

[0014] In an exemplary embodiment of the present invention, managing the package using the package information and the target information includes:

[0015] Determine the scope of application of the package, and classify the package as a general package or a custom package based on the scope of application;

[0016] The general package or the custom package is managed using the package information and the target information.

[0017] In an exemplary embodiment of the present invention, managing the general package or the custom package through the package information and the target information includes:

[0018] Obtain the environment parameters of the general package or the custom package, and determine the current environment of the general package or the custom package based on the environment parameters;

[0019] In the current environment, the general package is managed based on the package information and the target information;

[0020] In the current environment, the custom package is managed based on the package information and the target information.

[0021] In an exemplary embodiment of the present invention, the package information includes package name information, and the management of the general package based on the package information and the target information includes:

[0022] The package information is queried based on the package name information or the target information, and the package information is displayed.

[0023] In an exemplary embodiment of the present invention, after displaying the package information, managing the general package according to the package information and the target information includes:

[0024] Based on the target information, the general package is configured and modified according to the package information to obtain a general configuration record, so as to update the package information of the general package according to the general configuration record.

[0025] In an exemplary embodiment of the present invention, the step of modifying the configuration of the general package according to the package information to obtain a general configuration record includes:

[0026] Add a new general configuration record corresponding to the package information;

[0027] Modify the package information to obtain a general configuration record;

[0028] Delete the package information to obtain the general configuration record.

[0029] In one exemplary embodiment of the present invention, the current environment includes a testing environment and a production environment.

[0030] The management of the general package based on the package information and the target information includes:

[0031] Based on the test environment and the production environment, the package information is distinguished to obtain first test package information and first production package information;

[0032] The first test package information and the first production package information are compared to obtain a second comparison result, and the first test package information and the first production package information are labeled according to the second comparison result.

[0033] In an exemplary embodiment of the present invention, the step of comparing the first test package information and the first production package information to obtain a second comparison result includes:

[0034] The first test package information and the first production package information are sorted separately, and the sorted first test package information and the first production package information are converted into the target format to obtain the first test package information and the first production package information.

[0035] A second comparison result is obtained by comparing the first test package information and the first production package information in the target format.

[0036] In an exemplary embodiment of the present invention, managing the general package according to the package information and the target information includes:

[0037] Based on the target information, the package information is concatenated to obtain a general text file.

[0038] In one exemplary embodiment of the present invention, the method further includes:

[0039] Receive the installation instructions from the general text file, and construct a general image file of the general package based on the general text file.

[0040] In one exemplary embodiment of the present invention, the packet information includes packet name information.

[0041] The management of the custom package based on the package information and the target information includes:

[0042] Obtain the service name information corresponding to the custom package;

[0043] Based on the service name information, query the package information according to the package name information or the target information, and display the package information.

[0044] In an exemplary embodiment of the present invention, managing the custom package according to the package information and the target information includes:

[0045] Based on the target information, obtain the service name information corresponding to the custom package;

[0046] Based on the service name information, the custom package is configured and modified according to the package information to obtain a definition configuration record, and the package information of the custom package is updated according to the definition configuration record.

[0047] In an exemplary embodiment of the present invention, the step of modifying the configuration of the custom package according to the package information to obtain a defined configuration record includes:

[0048] Add a definition configuration record corresponding to the package information;

[0049] Modify the package information to obtain the defined configuration record;

[0050] Delete the package information to obtain the defined configuration record.

[0051] In one exemplary embodiment of the present invention, the current environment includes a testing environment and a production environment.

[0052] The management of the custom package based on the package information and the target information includes:

[0053] The package information is differentiated based on the test environment and the production environment to obtain the second test package information and the second production package information, and the service name information corresponding to the custom package is obtained.

[0054] Based on the service name information, the second test package information and the second production package information are compared to obtain a third comparison result, and the second test package information and the second production package information are labeled according to the third comparison result.

[0055] In an exemplary embodiment of the present invention, the step of comparing the second test package information and the second production package information to obtain a third comparison result includes:

[0056] The second test package information and the second production package information are sorted separately, and the sorted second test package information and the second production package information are converted into the target format to obtain the second test package information and the second production package information.

[0057] A third comparison result is obtained by comparing the second test package information and the second production package information in the target format.

[0058] In one exemplary embodiment of the present invention, the packet information is divided into general packet information and definition packet information.

[0059] The management of the custom package based on the package information and the target information includes:

[0060] Based on the target information, obtain the service name information corresponding to the custom package;

[0061] Based on the service name information, the general package information and the defined package information are merged to obtain the target package information;

[0062] The target package information is concatenated to obtain a definition text file.

[0063] In one exemplary embodiment of the present invention, the method further includes:

[0064] Receive the installation instructions from the definition text file, and construct the definition image file of the custom package based on the definition text file.

[0065] In an exemplary embodiment of the present invention, after managing the package using the package information and the target information, the method further includes:

[0066] Remove the package information.

[0067] According to a second aspect of the present invention, a program file management device is provided, comprising:

[0068] The information parsing module is configured to obtain the package information of the program package and the process information corresponding to the program package, and to parse the process information to obtain the updated process information.

[0069] The information comparison module is configured to obtain the current information of the current process and compare the current information with the updated process information to obtain a first comparison result;

[0070] The file management module is configured to perform a process removal process on the updated process information based on the first comparison result to obtain target information, so as to manage the program package through the package information and the target information.

[0071] According to a third aspect of the present invention, an electronic device is provided, comprising: a processor and a memory; wherein the memory stores computer-readable instructions, which, when executed by the processor, implement the program file management method in any of the above exemplary embodiments.

[0072] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, wherein when the computer program is executed by a processor, it implements the program file management method in any of the above exemplary embodiments.

[0073] As can be seen from the above technical solutions, the program file management method, program file management device, computer storage medium, and electronic device in the exemplary embodiments of this disclosure have at least the following advantages and positive effects:

[0074] In the methods and apparatus provided by the exemplary embodiments of this disclosure, the obtained package information and parsed process information help developers understand the actual reference status of the package during process runtime, and help developers distinguish whether the package information is truly effective, thus improving the efficiency of problem localization and tracking. Furthermore, managing packages through package information and target information allows for more flexible control of package information for different services with lower maintenance costs, achieving fine-grained management of packages, reducing maintenance costs, workload, and time costs, and providing a more convenient solution for scenarios such as special version designation and version gray-scale testing.

[0075] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0076] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0077] Figure 1 This schematic diagram illustrates a flowchart of a method for managing program files according to an exemplary embodiment of the present disclosure;

[0078] Figure 2 The schematic diagram illustrates a flowchart of a method for managing packages in an exemplary embodiment of this disclosure;

[0079] Figure 3 This schematically illustrates a flowchart of a method for managing packages using package information and target information in an exemplary embodiment of this disclosure;

[0080] Figure 4 The schematic diagram illustrates a flowchart of a method for obtaining a general configuration record in an exemplary embodiment of this disclosure;

[0081] Figure 5 This schematically illustrates a flowchart of a method for annotating first test package information and first production package information in an exemplary embodiment of this disclosure;

[0082] Figure 6 This schematic diagram illustrates a flowchart of a method for obtaining a second comparison result in an exemplary embodiment of this disclosure;

[0083] Figure 7 This schematically illustrates a flowchart of a method for displaying package information of a custom package in an exemplary embodiment of this disclosure;

[0084] Figure 8 This schematically illustrates a flowchart of a method for obtaining a defined configuration record in an exemplary embodiment of this disclosure;

[0085] Figure 9 This schematically illustrates a flowchart of a method for further defining a configuration record in an exemplary embodiment of this disclosure;

[0086] Figure 10 This schematic diagram illustrates a process flow of a method for annotating second test package information and second production package information in an exemplary embodiment of this disclosure;

[0087] Figure 11 This schematic diagram illustrates a flowchart of a method for obtaining a third comparison result in an exemplary embodiment of this disclosure;

[0088] Figure 12This schematic diagram illustrates a flowchart of a method for obtaining a defined text file in an exemplary embodiment of this disclosure;

[0089] Figure 13 This schematic diagram illustrates a process flow diagram of a method for obtaining packet information and target information in an application scenario according to an exemplary embodiment of this disclosure;

[0090] Figure 14 This schematic diagram illustrates the architecture of a configuration backend for managing packages in an application scenario according to an exemplary embodiment of this disclosure;

[0091] Figure 15 This schematic diagram illustrates a process flow of a method for constructing a generic image file and defining an image file in an application scenario according to an exemplary embodiment of this disclosure;

[0092] Figure 16 This schematic diagram illustrates the structure of a program file management device according to an exemplary embodiment of the present disclosure;

[0093] Figure 17 This schematically illustrates an electronic device for implementing a method for managing program files according to an exemplary embodiment of the present disclosure;

[0094] Figure 18 The illustration schematically depicts a computer-readable storage medium for implementing a method for managing program files, as shown in an exemplary embodiment of the present disclosure. Detailed Implementation

[0095] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more of the specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.

[0096] The terms “a,” “an,” “the,” and “the” are used in this specification to indicate the presence of one or more elements / components / etc.; the terms “including” and “having” are used to indicate an open-ended inclusion and to mean that there may be other elements / components / etc. in addition to the listed elements / components / etc.; the terms “first” and “second” are used only as markings and are not a limitation on the number of objects.

[0097] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities.

[0098] Containerization refers to packaging software code and all necessary components, such as libraries, frameworks, and other dependencies, together and isolating them in their own "containers." This allows the software or application within the container to move and run consistently across any environment and infrastructure, unaffected by the operating system of that environment or infrastructure. Essentially, it's a fully functional and easily portable computing environment.

[0099] Program execution often involves third-party packages. Taking Python as an example, in addition to its built-in basic modules, Python programs often rely heavily on third-party Python packages during operation.

[0100] The flexible use of third-party Python packages can effectively reuse code, avoid the duplication of development of similar or identical code modules, reduce the burden of development work, and decrease the workload of business development. While the abundance and complexity of third-party Python packages bring many conveniences to development work, the contradiction between the management methods of third-party Python packages and the containerized deployment of processes gradually becomes apparent during the containerization process, rendering the original package deployment and management methods no longer applicable.

[0101] Specifically, the following problems have arisen: there is a lack of precise package information queries down to the process level, making it impossible to obtain real-time information about the packages and corresponding versions currently used by a process; it is impossible to specify different packages and versions for different services, resulting in a lack of fine-grained control over service dependencies; the management of third-party Python package information is inconvenient for container image building; using a unified third-party Python package configuration for heterogeneous service processes will cause a certain degree of redundancy, and code dependencies will become bloated.

[0102] Currently, the project primarily employs two methods for Python package management. For processes based on the self-developed application framework, Python packages are deployed uniformly on physical machines, and all processes share the same Python packages. For HTTP service processes deployed using the Flask framework, each service independently creates and deploys a virtual environment, and each service exclusively uses third-party Python packages.

[0103] The biggest advantage of using Python package management with shared dependencies across processes is its intuitiveness and convenience. When a large-scale update of Python package versions or the addition of new dependencies is needed, the update operation for third-party Python packages only needs to be performed on machines in the associated group to complete the dependency update, without needing to modify the configuration of third-party packages individually for each service. Processes using this method of Python package management often depend on most of the same third-party packages, achieving a balance between maintenance costs and dependency accuracy.

[0104] Managing third-party Python packages by establishing virtual environments effectively isolates the runtime environments of different services. When a program depends on significantly different third-party Python packages, it is often necessary to specify the package and version number for each service, providing a customizable package management approach. By configuring this in the project code using a requirements.txt file, the deployment and updates of third-party Python packages can be integrated into the project's CI / CD workflow, achieving the goal of customizing packages and versions with minimal maintenance costs.

[0105] While both management approaches played a crucial role in the era of physical machine deployment, resolving issues related to the deployment and management of Python packages in application processes, the containerization of applications has led to changes in deployment environments and methods, as well as new demands for managing third-party Python packages. These existing approaches have encountered several pressing problems in practice.

[0106] For solutions that share Python environments and third-party packages, the most significant impact of containerization is that applications are built through stacked image layers. This makes it impossible to maintain the previous independent relationship between third-party Python packages and applications; dependencies on third-party Python packages must be established during the image building process. Due to the change in build methods, each application and its runtime environment need to be built separately. Therefore, the advantage of sharing third-party Python packages in reducing maintenance costs no longer applies. The key basis of the shared third-party Python package solution is that applications depend on the same runtime environment. When the runtime environment is isolated by container building, this solution is clearly unsuitable for the deployment, operation, and other processes after containerization.

[0107] Managing third-party Python packages through virtual environments is closer to the needs of application process containerization in terms of Python package management, but it still cannot fully meet the requirements of service development and deployment processes. Configuring dependencies through a `requirements.txt` file means that different projects manage their own third-party Python package dependencies in a decentralized manner. If you want to modify a specific third-party Python package across all projects, you have to manually modify each one, trigger automatic builds and deployments, and re-upload the code files. For thousands of application services, executing this process once can be extremely time-consuming. Furthermore, the coupling between application code and third-party Python package configuration increases the workload of application maintenance for the build and deployment process.

[0108] In view of the problems existing in the related technologies, this disclosure proposes a method for managing program files. Figure 1 A flowchart illustrating the program file management method is shown, such as... Figure 1 As shown, the method for managing program files includes at least the following steps:

[0109] Step S110. Obtain the package information of the program package and the process information corresponding to the program package, and parse the process information to obtain the updated process information.

[0110] Step S120. Obtain the current information of the current process and compare the current information with the updated process information to obtain the first comparison result.

[0111] Step S130. Based on the first comparison result, the updated process information is removed to obtain target information, so as to manage the program package through package information and target information.

[0112] In the exemplary embodiments disclosed herein, the obtained package information and the parsed process information help developers understand the actual reference status of the package during process runtime, and help them distinguish whether the package information is truly effective, thus improving the efficiency of problem localization and tracking. Furthermore, managing packages through package and target information allows for more flexible control of package information for different services with lower maintenance costs, achieving fine-grained package management, reducing maintenance costs, workload, and time, and providing a more convenient solution for scenarios such as specific version designation and version gray-scale testing.

[0113] The following section provides a detailed explanation of each step in the process of managing program files.

[0114] In step S110, the package information of the program package and the process information corresponding to the program package are obtained, and the process information is parsed to obtain the updated process information.

[0115] In an exemplary embodiment of this disclosure, the package may be a Python package generated from a Python project.

[0116] A Python project is a software project developed using the Python language. When developing a Python project, the technical staff determines the code files, resource files, and dependencies of the Python project.

[0117] The code files include the code content of the Python project itself, which is code independently developed by technical personnel based on the Python project; the resource files include file resources corresponding to the Python project, such as image resources, audio resources, video resources, and web page resources, which are resources required for the Python project to run; the dependency relationship is used to indicate other code content and / or other resources that the Python project depends on when it is deployed, that is, the code file has a dependency relationship with the dependency information, and in addition to the code file, the dependency information is also required for the Python project to be installed and run normally.

[0118] Therefore, by packaging the code files, resource files, and dependencies separately, you can obtain the corresponding Python packages.

[0119] Furthermore, since Python programs rely heavily on third-party Python packages in addition to their built-in basic modules, the flexible use of these packages can effectively reuse code, avoid repeatedly developing modules with identical or similar functions, reduce the burden of development work, and decrease the workload of business development. The rich and diverse array of third-party Python packages brings numerous conveniences to development work.

[0120] Therefore, the Python package can refer to a third-party Python package used in the development of a Python project.

[0121] Package information for packages such as Python packages may include the package name and version information of the Python package, or other information. This exemplary embodiment does not impose any special limitations on this.

[0122] When the package is a Python package, the application process accesses the general Python package information collection SDK (Software Development Kit) in the basic framework and obtains the package information of the Python package through pkg_resources (resource collection module).

[0123] Since an application process includes multiple Python packages, it is possible to obtain process information such as the service name, IP (Internet Protocol) address, process ID (Identity document), process UUID (Universally Unique Identifier), and startup time of the current application process.

[0124] The process IDs can be determined sequentially. For example, when a service starts 10 processes, the 10 processes can be assigned process IDs from 1 to 10 according to their startup time. When the service starts another 10 processes, the new 10 processes will still be assigned process IDs from 1 to 10.

[0125] A process UUID is a unique, random identifier that identifies a process. When a service starts 10 processes, each of these 10 processes has a different process UUID. When the service starts another 10 processes, the process UUIDs of these new 10 processes will not only be completely different, but will also be completely different from the process UUIDs of the previous 10 processes.

[0126] After obtaining the packet information and process information, the process information can be parsed and processed.

[0127] For example, when an application process restarts, its startup time can be compared with that of the previously started application process. If the startup time of the restarted application process is longer than that of the previously started application process, the process information of the restarted application process can be overwritten with the process information of the previously started application process to obtain the updated process information.

[0128] In addition to the above, there are other methods for parsing and processing different process information, and this exemplary embodiment does not impose any special limitations on them.

[0129] In an optional embodiment, the storage package information and the updated process information are stored.

[0130] After parsing and processing the process information, the packet information and process information can be stored in the database for persistent storage, providing a data source for subsequent processing flows.

[0131] The database used to store the package information and process information can be a MongoDB database or other databases; this exemplary embodiment does not impose any special limitations on this.

[0132] It is worth noting that when parsing and processing the obtained process information, the startup time in the process information stored in the database can be compared to overwrite and update the process information stored in the database.

[0133] In step S120, the current information of the current process is obtained, and the current information and the updated process information are compared to obtain the first comparison result.

[0134] In an exemplary embodiment of this disclosure, the current information of all currently running application processes can be obtained at regular intervals. This current information may include the process ID and process UUID of the application process.

[0135] Furthermore, the current information is compared with the updated process information stored in the database to obtain the first comparison result.

[0136] In step S130, the updated process information is removed based on the first comparison result to obtain target information, so as to manage the program package through package information and target information.

[0137] In an exemplary embodiment of this disclosure, when the first comparison result indicates that there is no updated process information stored in the database in the current information, it indicates that the process information is invalid data caused by service shutdown, and this part of the updated process information can be removed to obtain valid target information.

[0138] When the first comparison result shows that the current information is completely consistent with the updated process information stored in the database, it indicates that there is no redundant data in the updated process information stored in the database. Therefore, the updated process information is the target information.

[0139] After obtaining the target information, packages such as Python packages can be managed using both package information and target information.

[0140] In an optional embodiment, Figure 2 A flowchart illustrating the method for managing packages is shown, such as... Figure 2 As shown, the method includes at least the following steps: in step S210, the scope of application of the package is determined, and the package is determined as a general package and a custom package according to the scope of application.

[0141] For example, a Python package can be considered a general-purpose package if it works for all services; a Python package can be considered a custom package if it works for one or two other services, but not all services. Furthermore, custom packages are configured based on the service names.

[0142] In step S220, general packages or custom packages are managed using package information and target information.

[0143] In an optional embodiment, Figure 3 A flowchart illustrating a method for managing packages using package information and target information is shown, such as... Figure 3 As shown, the method includes at least the following steps: In step S310, the environment parameters of the general package or the custom package are obtained, and the current environment of the general package or the custom package is determined according to the environment parameters.

[0144] This environment parameter can be the `dv` (develop) parameter. Generally, the `dv` parameter is used to distinguish between the application environments of general-purpose packages and custom packages. This is because some Python packages need to be used in a test environment for a period of time before they can be used in a production environment.

[0145] For example, when dv is 1, it can be determined that the Python package is currently being used in a test environment; when dv is 2, it can be determined that the Python package is currently being used in a production environment.

[0146] Furthermore, it manages general packages and custom packages in different current environments.

[0147] In step S320, under the current environment, the general package is managed according to the package information and the target information.

[0148] Management of general packages can include query functionality.

[0149] In an optional embodiment, the package information includes package name information. The package information is queried based on the package name information or target information, and then displayed.

[0150] The package name information refers to the name information of the general package.

[0151] Therefore, the package name information can be used to list the common packages in the application process for fuzzy search to quickly locate and filter the information of the target common package.

[0152] In addition, the search function of the service name in the target information can be used to filter out all currently running processes, so as to facilitate querying the reference information of the common packages of each process.

[0153] In addition to searching by service name, you can also search by package name and version number. You can filter the application status of the version information of the general package in all processes that meet the current conditions by different search methods such as whether the version number of a general package is equal to, greater than, less than, or exists.

[0154] Furthermore, the retrieved package name information, version information, version number restriction type, and other target information can be displayed, as well as other remarks and other content. This exemplary embodiment does not impose any special limitations on this.

[0155] Management of general packages can also include configuration modification functionality.

[0156] In an optional embodiment, based on the target information, a general configuration record is obtained by modifying the configuration of the general package according to the package information, so as to update the package information of the general package according to the general configuration record.

[0157] Since the target information represents the effective updated process information, the configuration of the general package can be modified based on this target information.

[0158] In an optional embodiment, Figure 4 A flowchart illustrating the method for obtaining a general configuration record is shown, such as... Figure 4 As shown, the method includes at least the following steps: In step S410, a new general configuration record corresponding to the package information is added.

[0159] After providing package name, version, version number restriction type, and remarks, a configuration record can be added directly in the configuration backend as a general configuration record for the general package and stored in the database. This general configuration record contains any new information added to the package.

[0160] In step S420, the package information is modified to obtain the general configuration record.

[0161] After displaying the retrieved package information, the query results can be edited to obtain general configuration records for common packages, which are then stored in the database. Editing methods can include modifying package name information, version information, version number restriction type, and remarks.

[0162] In step S430, the package information is deleted to obtain the general configuration record.

[0163] After displaying the retrieved package information, you can delete the query results to obtain general configuration records. For example, deleting a specific package name will retrieve a general configuration record, which can then be removed from the database.

[0164] In this exemplary embodiment, a general configuration record can be obtained through editing methods such as adding, modifying, and deleting, providing diverse implementations for the modification function of package information and meeting the development needs of developers for programs such as Python.

[0165] After obtaining the general configuration record, the package information of the general package can be updated according to the general configuration record, either stored in the database or removed from the database.

[0166] The management of general packages can also include environment comparison functionality.

[0167] In an optional embodiment, the current environment includes a testing environment and a production environment. Figure 5 A flowchart illustrating the method for labeling the information of the first test package and the first production package is shown, as follows: Figure 5 As shown, the method includes at least the following steps: In step S510, the package information is distinguished according to the test environment and the production environment to obtain the first test package information and the first production package information.

[0168] For example, when the general package contains both Python packages used in the test environment and Python packages used in the production environment, the package information of the general package can be distinguished according to the test environment and the production environment to obtain the first test package information and the first production package information.

[0169] In step S520, the first test package information and the first production package information are compared to obtain a second comparison result, and the first test package information and the first production package information are labeled according to the second comparison result.

[0170] In an optional embodiment, Figure 6 A flowchart illustrating the method for obtaining the second comparison result is shown, as follows: Figure 6 As shown, the method includes at least the following steps: In step S610, the first test package information and the first production package information are sorted respectively, and the sorted first test package information and the first production package information are converted into a format to obtain the first test package information and the first production package information in the target format.

[0171] When sorting the information of the first test package and the first production package, the sorting can be done in lexicographical order, that is, in the order of A, B, and C to obtain the sorted information of the first test package and the first production package.

[0172] Furthermore, since the first test package information and the first production package information stored in the database are displayed in tabular form, the tabular first test package information and the first production package information can be converted into JSON (JavaScript Object Notation) format first test package information and first production package information.

[0173] In step S620, the first test package information and the first production package information of the target format are compared to obtain a second comparison result.

[0174] After obtaining the first test package information and the first production package information in the target format, we can perform text comparison to determine the configuration items that are different in the first test package information and the first production package information as the second comparison result.

[0175] In this exemplary embodiment, the comparison of the first test package information and the first production package information is achieved through sorting and format conversion, providing a data foundation for labeling the first test package information and the first production package information.

[0176] After identifying the different configuration items in the first test package information and the first production package information, these different configuration items can be marked to facilitate developers in maintaining the first test package information and the first production package information in the test environment and the production environment.

[0177] Management of general packages can also include configuration export functionality.

[0178] In an optional embodiment, the packet information is concatenated based on the target information to obtain a general text file.

[0179] Since the target information represents the effective updated process information, the configuration export processing of the general package can be implemented based on this target information.

[0180] Since the package information stored in the database is in a field format, this field-formatted package information can be concatenated into a generic text file containing "package name == version number". This generic text file can be a requirements file.

[0181] When an application has a dependency, the requirements file, i.e., requirements.txt, can be returned via an HTTP interface through the application.

[0182] In step S330, the custom package is managed based on the package information and target information in the current environment.

[0183] Management of custom packages can include configuration query functionality.

[0184] In an optional embodiment, the packet information includes packet name information. Figure 7 A flowchart illustrating a method for displaying package information for a custom package is shown, such as... Figure 7 As shown, the method includes at least the following steps: In step S710, the service name information corresponding to the custom package is obtained.

[0185] Since custom packages are configured based on service names, the service name information of the custom package can be obtained, allowing package information to be managed under the service name.

[0186] In step S720, based on the service name information, the package information is queried according to the package name information or the target information, and the package information is displayed.

[0187] The package name information refers to the name of the custom package.

[0188] Within the package information under the service name information, the custom packages in the application process are listed by package name information to perform fuzzy search and quickly locate and filter the information of the target custom package.

[0189] In addition, the search function of the service name in the target information can be used to filter out all currently running processes, so as to facilitate querying the reference status of custom packages for each process.

[0190] In addition to searching by service name, you can also search by package name and version number. You can filter the application status of the version information of the custom package in all processes that meet the current conditions by different search methods such as whether the version number of a custom package is equal to, greater than, less than, or exists.

[0191] Furthermore, the retrieved package name information, version information, version number restriction type, and other target information can be displayed, as well as other remarks and other content. This exemplary embodiment does not impose any special limitations on this.

[0192] In this exemplary embodiment, by using the service name information of the custom package, the function of querying custom packages based on package name information or target information can be realized, which leverages the configuration advantages of custom packages. Compared with the unified management of general packages, it can realize the targeted management of custom packages under the same service name information.

[0193] Management of custom packages can also include configuration modification functionality.

[0194] In an optional embodiment, Figure 8 The flowchart illustrating the method for obtaining the defined configuration record is shown below. Figure 8As shown, the method includes at least the following steps: In step S810, based on the target information, the service name information corresponding to the custom package is obtained.

[0195] Since the target information represents the valid updated process information, the configuration of the custom package can be modified based on this target information.

[0196] Since custom packages are configured based on service names, the service name information of the custom package can be obtained, allowing for package information management under the service name information.

[0197] In step S820, based on the service name information, the custom package is configured and modified according to the package information to obtain a definition configuration record, so as to update the package information of the custom package according to the definition configuration record.

[0198] In the package information under the service name information, the configuration record is obtained by modifying the configuration of the custom package.

[0199] In an optional embodiment, Figure 9 A flowchart illustrating the method for further obtaining the defined configuration record is shown, such as... Figure 9 As shown, the method includes at least the following steps: In step S910, a new definition configuration record corresponding to the package information is added.

[0200] After providing information such as package name, version, version number restriction type, and remarks, you can directly add a configuration record as a definition configuration record for the custom package in the configuration backend, and store it in the database. This definition configuration record contains the newly added information corresponding to the package information of the custom package.

[0201] In step S920, the package information is modified to obtain the defined configuration record.

[0202] After displaying the retrieved package information, the query results can be edited to obtain the definition configuration record of the custom package, which is then stored in the database. Editing methods can include modifying package name information, version information, version number restriction type, and remarks information.

[0203] In step S930, the package information is deleted to obtain the defined configuration record.

[0204] After displaying the retrieved package information, you can delete the query results to obtain general configuration records. For example, deleting a specific package name will retrieve the definition configuration record and remove it from the database.

[0205] In this exemplary embodiment, configuration records can be defined through editing methods such as adding, modifying, and deleting, providing diverse implementations for modifying package information, improving the editing functions of different Python packages and other custom packages, and meeting the development needs of developers for Python or other program projects.

[0206] After obtaining the definition configuration record, you can update the package information of the custom package according to the definition configuration record, and store it in the database or remove it from the database.

[0207] The management of custom packages can also include an environment comparison function.

[0208] In an optional embodiment, the current environment includes a testing environment and a production environment. Figure 10 A flowchart illustrating the method for labeling information from the second test package and the second production package is shown, as follows: Figure 10 As shown, the method includes at least the following steps: In step S1010, the package information is distinguished according to the test environment and the production environment to obtain the second test package information and the second production package information, and the service name information corresponding to the custom package is obtained.

[0209] For example, when a custom package contains both Python packages used in the test environment and Python packages used in the production environment, the package information of the custom package can be distinguished according to the test environment and the production environment to obtain the second test package information and the second production package information.

[0210] Since custom packages are configured based on service names, the service name information of the custom package can be obtained, allowing for package information management under the service name information.

[0211] In step S1020, based on the service name information, the second test package information and the second production package information are compared to obtain a third comparison result, and the second test package information and the second production package information are labeled according to the third comparison result.

[0212] Furthermore, a third comparison result is obtained by comparing the second test package information and the second production package information under the service name information.

[0213] In an optional embodiment, Figure 11 A flowchart illustrating the method for obtaining the third comparison result is shown, as follows: Figure 11 As shown, the method includes at least the following steps: in step S1110, the second test package information and the second production package information are sorted respectively, and the sorted second test package information and the second production package information are converted into a format to obtain the second test package information and the second production package information in the target format.

[0214] When sorting the second test package information and the second production package information, the sorting can be done in lexicographical order, that is, in the order of AZ, to obtain the sorted second test package information and the second production package information.

[0215] Furthermore, since the second test package information and the second production package information stored in the database are displayed in tabular form, the tabular second test package information and the second production package information can be converted into JSON format second test package information and second production package information.

[0216] In step S1120, the second test package information and the second production package information in the target format are compared to obtain a third comparison result.

[0217] After obtaining the second test package information and the second production package information in the target format, we can perform text comparison to determine the configuration items that are different in the second test package information and the second production package information as the third comparison result.

[0218] In this exemplary embodiment, the comparison of the second test package information and the second production package information is achieved through sorting and format conversion, providing a data foundation for labeling the second test package information and the second production package information.

[0219] After identifying the different configuration items in the second test package information and the second production package information, these different configuration items can be marked to facilitate developers in maintaining the second test package information and the second production package information in the test environment and the production environment.

[0220] Management of custom packages can also include configuration export functionality.

[0221] In an optional embodiment, the packet information is divided into general packet information and definition packet information. Figure 12 The flowchart illustrating the method for obtaining the definition text file is shown, such as... Figure 12 As shown, the method includes at least the following steps: In step S1210, based on the target information, the service name information corresponding to the custom package is obtained.

[0222] Since the target information represents valid updated process information, the configuration export process of custom packages can be implemented based on this target information.

[0223] Since custom packages are configured based on service names, the service name information of the custom package can be obtained, allowing for package information management under the service name information.

[0224] In step S1220, the target package information is obtained by merging the general package information and the definition package information based on the service name information.

[0225] Since exporting the package information of a custom package may involve the package information of a general package, it is possible to obtain the general package information of the general package and the definition package information of the custom package, and then merge the general package information and the definition package information under the service name information to obtain the target package information.

[0226] When merging general package information and definition package information, the principle of prioritizing the definition package information of custom packages can be followed.

[0227] Specifically, the general package information and the defined package information can be compared. When there are differences or conflicts between the general package information and the defined package information, the defined package information is used to overwrite the general package information to obtain the target package information.

[0228] In step S1230, the target package information is concatenated to obtain a definition text file.

[0229] Since the package information stored in the database is in field format, the target package information in field format can be concatenated into a definition text file of "package name == version number". This definition text file can be a requirements file.

[0230] When an application has a dependency, the requirements file, i.e., requirements.txt, can be returned via an HTTP interface through the application.

[0231] In this exemplary embodiment, a definition text file is obtained by merging general package information and definition package information and then concatenating them. The merging method follows the configuration priority of the package information, and the concatenated definition text file provides a data foundation for subsequent image building.

[0232] After generating a general text file or a definition text file, the automatic build process of the container base image can be triggered to ensure that the base image can be updated in a timely manner and that the service process uses the latest Python packages.

[0233] In an optional embodiment, installation instructions from a generic text file are received, and a generic image file of a generic package is constructed based on the generic text file.

[0234] The installation command for this generic text file can be the pip install command.

[0235] For example, Python projects often have a requirements.txt file that records all the dependencies of the current program and their exact version numbers. Therefore, a generic requirements.txt file can be automatically generated and installed using the pip command.

[0236] The installation command for installing the universal image file of the universal package is pip install.

[0237] The pip install command installs a generic text file containing generic packages for generic configuration, which is then used to build a generic image text file, thus completing the image layer construction of the generic package configuration.

[0238] Among them, mirroring is a form of file storage and a type of redundancy. It means that data on one disk has an exact copy on another disk.

[0239] In an optional embodiment, an installation instruction from a definition text file is received, and a definition image file of a custom package is built based on the definition text file.

[0240] The installation instructions for this definition text file can be the pip install command.

[0241] Since Python projects often have a `requirements.txt` file that records all the dependencies of the current program and their exact version numbers, a custom `requirements.txt` file can also be automatically generated and installed using the `pip` command.

[0242] The installation command for installing the definition image file of the general package is pip install.

[0243] The `pip install` command installs the definition text file of a custom package with custom configuration, thereby building the definition image text and completing the image layer construction of the custom package configuration.

[0244] In addition to obtaining package information when the application process starts, it can also automatically remove package information when the application process is destroyed.

[0245] In an optional embodiment, the package information is removed.

[0246] Removing package information when the application process is destroyed can update the package version of the service process in real time, further improving the accuracy of the data and achieving the effect of eventual consistency check and guarantee.

[0247] The management of program files in this embodiment of the present disclosure will be described in detail below with reference to an application scenario.

[0248] Figure 13 The flowchart illustrates a method for obtaining packet and target information in an application scenario, as shown below. Figure 13As shown, the application process accesses a common Python package information collection SDK within the basic framework, obtaining package information for Python packages through pkg_resources. This package information includes package name and version information.

[0249] Then, combining the process information such as the service name, IP address, process ID, process UUID, and startup time of the application process using this Python package, the data is reported to the data collection service.

[0250] The collection and recording of reported packet and process information is conducted via a web (World Wide Web) service. Once the data collection service receives packet and process information from the application, it can parse and process the process information.

[0251] For example, when an application process restarts, its startup time can be compared with that of the previously started application process. If the startup time of the restarted application process is longer than that of the previously started application process, the process information of the restarted application process can be overwritten with the process information of the previously started application process to obtain the updated process information.

[0252] After parsing and processing to obtain the updated process information, the updated process information can be stored in a MongoDB database for persistence, providing a data source for subsequent modules.

[0253] In addition, the data collection service can also directly provide data query solutions, allowing the data query backend to directly access the data collection service, thus decoupling the data query backend from the database and reducing maintenance costs in the event of database migration.

[0254] In addition to the data collection service, scheduled tasks were also deployed to check the timeliness of package information in the database.

[0255] At regular intervals, the system can retrieve current information about all currently running application processes. This information may include the application process's process ID and process UUID.

[0256] Furthermore, the current information is compared with the updated process information stored in the database to obtain the first comparison result.

[0257] When the first comparison result is that the updated process information or some process information stored in the database does not exist in the current information, it indicates that the process information is invalid data caused by the service going offline. This part of the updated process information can be removed to obtain the valid target information.

[0258] When the first comparison result shows that the current information is completely consistent with the updated process information stored in the database, it indicates that there is no redundant data in the updated process information stored in the database. Therefore, the updated process information is the target information.

[0259] In addition, the data query backend provides functionality for displaying and retrieving package information for third-party Python packages in the database. The backend displays detailed target information for all running processes, such as IP address, process ID, and start time. It also lists the package information for the Python packages each process depends on. For a single process, the list of third-party Python packages can be quickly located using fuzzy search by package name, and the information for the target Python package can be filtered. For the entire process list, a search function based on service name allows filtering of all currently running processes, facilitating the query of Python package references for each process. Besides locating by service name, it also provides search options based on package name and version number. Users can filter all processes matching a given Python package version number (equal to, greater than, less than, or present) and the corresponding Python package version usage information.

[0260] Figure 14 This diagram illustrates the architecture of a configuration backend for managing application packages in an application scenario. Figure 14 As shown, the configuration backend architecture includes a database and a configuration backend. The database contains general configurations for the test environment, general configurations for the production environment, service configurations for the test environment, and service configurations for the production environment. The configuration backend provides four functionalities: configuration query, configuration modification, environment comparison, and configuration export.

[0261] When the package is a Python package, determine the scope of application of the Python package, and classify the Python package as a general package or a custom package based on the scope of application.

[0262] A Python package is considered a general-purpose package when it works for all services; it is considered a custom package when it works for one or two other services, but not all services. Furthermore, custom packages are configured based on the service names.

[0263] Manage general or custom packages using package information and target information.

[0264] Obtain the environment parameters of the general package or custom package, and determine the current environment of the general package or custom package based on the environment parameters.

[0265] This environment parameter can be the `dv` parameter. Generally, the `dv` parameter is used to distinguish between the application environments of general-purpose packages and custom packages. This is because some Python packages need to be used in a test environment for a period of time before they can be used in a production environment.

[0266] For example, when dv is 1, it can be determined that the Python package is currently being used in a test environment; when dv is 2, it can be determined that the Python package is currently being used in a production environment.

[0267] Furthermore, it manages general packages and custom packages in different current environments.

[0268] In the current environment, general packages are managed based on package information and target information.

[0269] Management of general packages can include query functionality.

[0270] Query and display package information based on package name or target information.

[0271] The package name information refers to the name information of the general package.

[0272] Therefore, the package name information can be used to list the common packages in the application process for fuzzy search to quickly locate and filter the information of the target common package.

[0273] In addition, the search function of the service name in the target information can be used to filter out all currently running processes, so as to facilitate querying the reference information of the common packages of each process.

[0274] In addition to searching by service name, you can also search by package name and version number. You can filter the application status of the version information of the general package in all processes that meet the current conditions by different search methods such as whether the version number of a general package is equal to, greater than, less than, or exists.

[0275] Furthermore, the retrieved package name information, version information, version number restriction type, and other target information can be displayed, as well as other remarks and other content. This exemplary embodiment does not impose any special limitations on this.

[0276] Management of general packages can also include configuration modification functionality.

[0277] The general package information is modified to obtain a general configuration record, which is then used to update the package information of the general package.

[0278] Add a new general configuration record corresponding to the package information.

[0279] After providing package name, version, version number restriction type, and remarks, a configuration record can be added directly in the configuration backend as a general configuration record for the general package and stored in the database. This general configuration record contains any new information added to the package.

[0280] Modify the package information to obtain the general configuration record.

[0281] After displaying the retrieved package information, the query results can be edited to obtain general configuration records for common packages, which are then stored in the database. Editing methods can include modifying package name information, version information, version number restriction type, and remarks.

[0282] Deleting package information yields a general configuration record.

[0283] After displaying the retrieved package information, you can delete the query results to obtain general configuration records. For example, deleting a specific package name will retrieve a general configuration record, which can then be removed from the database.

[0284] After obtaining the general configuration record, the package information of the general package can be updated according to the general configuration record, either stored in the database or removed from the database.

[0285] The management of general packages can also include environment comparison management.

[0286] Based on the testing environment and the production environment, the package information is differentiated to obtain the first test package information and the first production package information.

[0287] When the general package contains both Python packages used in the test environment and Python packages used in the production environment, the package information of the general package can be distinguished according to the test environment and the production environment to obtain the first test package information and the first production package information.

[0288] The information of the first test package and the information of the first production package are compared to obtain a second comparison result, and the information of the first test package and the information of the first production package are labeled according to the second comparison result.

[0289] The first test package information and the first production package information are sorted separately, and the sorted first test package information and the first production package information are converted into the target format first test package information and first production package information.

[0290] When sorting the information of the first test package and the first production package, the sorting can be done in lexicographical order, that is, in the order of A, Z, to obtain the sorted information of the first test package and the first production package.

[0291] Furthermore, since the first test package information and the first production package information stored in the database are displayed in tabular form, the tabular first test package information and the first production package information can be converted into JSON format first test package information and first production package information.

[0292] A second comparison result is obtained by comparing the first test package information and the first production package information in the target format.

[0293] After obtaining the first test package information and the first production package information in the target format, we can perform text comparison to determine the configuration items that are different in the first test package information and the first production package information as the second comparison result.

[0294] After identifying the different configuration items in the first test package information and the first production package information, these different configuration items can be marked to facilitate developers in maintaining the first test package information and the first production package information in the test environment and the production environment.

[0295] Management of general packages can also include configuration export functionality.

[0296] The package information is concatenated to obtain a general text file.

[0297] Since the package information stored in the database is in a field format, this field-formatted package information can be concatenated into a generic text file containing "package name == version number". This generic text file can be a requirements file.

[0298] When an application has a dependency, the requirements file, i.e., requirements.txt, can be returned via an HTTP interface through the application.

[0299] On the other hand, the management of custom packages can include configuration query functionality.

[0300] Retrieve the service name information corresponding to the custom package.

[0301] Since custom packages are configured based on service names, the service name information of the custom package can be obtained, allowing package information to be managed under the service name.

[0302] Based on service name information, query package information according to package name information or target information, and display the package information.

[0303] The package name information refers to the name of the custom package.

[0304] Within the package information under the service name information, the custom packages in the application process are listed by package name information to perform fuzzy search and quickly locate and filter the information of the target custom package.

[0305] In addition, the search function of the service name in the target information can be used to filter out all currently running processes, so as to facilitate querying the reference status of custom packages for each process.

[0306] In addition to searching by service name, you can also search by package name and version number. You can filter the application status of the version information of the custom package in all processes that meet the current conditions by different search methods such as whether the version number of a custom package is equal to, greater than, less than, or exists.

[0307] Furthermore, the retrieved package name information, version information, version number restriction type, and other target information can be displayed, as well as other remarks and other content. This exemplary embodiment does not impose any special limitations on this.

[0308] Management of custom packages can also include configuration modification functionality.

[0309] Retrieve the service name information corresponding to the custom package.

[0310] Since custom packages are configured based on service names, the service name information of the custom package can be obtained, allowing for package information management under the service name information.

[0311] Based on the service name information, the configuration of the custom package is modified according to the package information to obtain the definition configuration record, and the package information of the custom package is updated according to the definition configuration record.

[0312] In the package information under the service name information, the configuration record is obtained by modifying the configuration of the custom package.

[0313] Add a new definition configuration record corresponding to the package information.

[0314] After providing information such as package name, version, version number restriction type, and remarks, you can directly add a configuration record as a definition configuration record for the custom package in the configuration backend, and store it in the database. This definition configuration record contains the newly added information corresponding to the package information of the custom package.

[0315] Modify the package information to obtain the defined configuration record.

[0316] After displaying the retrieved package information, the query results can be edited to obtain the definition configuration record of the custom package, which is then stored in the database. Editing methods can include modifying package name information, version information, version number restriction type, and remarks information.

[0317] Deleting package information retrieves the defined configuration record.

[0318] After displaying the retrieved package information, you can delete the query results to obtain general configuration records. For example, deleting a specific package name will retrieve the definition configuration record and remove it from the database.

[0319] After obtaining the definition configuration record, you can update the package information of the custom package according to the definition configuration record, and store it in the database or remove it from the database.

[0320] The management of custom packages can also include an environment comparison function.

[0321] The package information is differentiated between the test environment and the production environment to obtain the second test package information and the second production package information, and the service name information corresponding to the custom package is obtained.

[0322] When a custom package contains both Python packages used in the test environment and Python packages used in the production environment, the package information of the custom package can be distinguished according to the test environment and the production environment to obtain the second test package information and the second production package information.

[0323] Since custom packages are configured based on service names, the service name information of the custom package can be obtained, allowing for package information management under the service name information.

[0324] Based on the service name information, the second test package information and the second production package information are compared to obtain a third comparison result, and the second test package information and the second production package information are labeled according to the third comparison result.

[0325] Furthermore, a third comparison result is obtained by comparing the second test package information and the second production package information under the service name information.

[0326] The second test package information and the second production package information are sorted separately, and the sorted second test package information and the second production package information are converted into the target format to obtain the second test package information and the second production package information.

[0327] When sorting the second test package information and the second production package information, the sorting can be done in lexicographical order, that is, in the order of AZ, to obtain the sorted second test package information and the second production package information.

[0328] Furthermore, since the second test package information and the second production package information stored in the database are displayed in tabular form, the tabular second test package information and the second production package information can be converted into JSON format second test package information and second production package information.

[0329] A third comparison result is obtained by comparing the second test package information and the second production package information in the target format.

[0330] After obtaining the second test package information and the second production package information in the target format, we can perform text comparison to determine the configuration items that are different in the second test package information and the second production package information as the third comparison result.

[0331] After identifying the different configuration items in the second test package information and the second production package information, these different configuration items can be marked to facilitate developers in maintaining the second test package information and the second production package information in the test environment and the production environment.

[0332] Management of custom packages can also include configuration export functionality.

[0333] Retrieve the service name information corresponding to the custom package.

[0334] Since custom packages are configured based on service names, the service name information of the custom package can be obtained, allowing for package information management under the service name information.

[0335] Based on the service name information, the general package information and the defined package information are merged to obtain the target package information.

[0336] Since exporting the package information of a custom package may involve the package information of a general package, it is possible to obtain the general package information of the general package and the definition package information of the custom package, and then merge the general package information and the definition package information under the service name information to obtain the target package information.

[0337] When merging general package information and definition package information, the principle of prioritizing the definition package information of custom packages can be followed.

[0338] Specifically, the general package information and the defined package information can be compared. When there are differences or conflicts between the general package information and the defined package information, the defined package information is used to overwrite the general package information to obtain the target package information.

[0339] The target package information is concatenated to obtain the definition text file.

[0340] Since the package information stored in the database is in field format, the target package information in field format can be concatenated into a definition text file of "package name == version number". This definition text file can be a requirements file.

[0341] When an application has a dependency, the requirements file, i.e., requirements.txt, can be returned via an HTTP interface through the application.

[0342] Figure 15 The flowchart illustrates the methods for building and defining a generic image file in an application scenario, as shown below. Figure 15 As shown, in step S1510, requirements.txt is retrieved.

[0343] The requirements.txt file can include general text files and definition text files, which can be retrieved through the configuration backend.

[0344] After generating a general text file or a definition text file, the automatic build process of the container base image can be triggered to ensure that the base image can be updated in a timely manner and that the service process uses the latest Python packages.

[0345] In step S1520, a general third-party package configuration image layer is constructed.

[0346] It receives installation instructions from a generic text file and builds a generic image file of the generic package based on the generic text file.

[0347] The installation command for this generic text file can be the pip install command.

[0348] Since Python projects often have a `requirements.txt` file that records all the dependencies of the current program and their precise version numbers, a generic `requirements.txt` file can be automatically generated and installed using the `pip` command.

[0349] The installation command for installing the universal image file of the universal package is pip install.

[0350] The pip install command installs a generic text file containing generic packages for generic configuration, which is then used to build a generic image text file, thus completing the image layer construction of the generic package configuration.

[0351] In step S1530, a service-customized third-party image layer is constructed.

[0352] It receives installation instructions from a definition text file and builds a definition image file of a custom package based on the definition text file.

[0353] The installation instructions for this definition text file can be the pip install command.

[0354] Since Python projects often have a `requirements.txt` file that records all the dependencies of the current program and their exact version numbers, a custom `requirements.txt` file can also be automatically generated and installed using the `pip` command.

[0355] The installation command for installing the definition image file of the general package is pip install.

[0356] The `pip install` command installs the definition text file of a custom package with custom configuration, thereby building the definition image text and completing the image layer construction of the custom package configuration.

[0357] The current approach involves centralized management of package information, with a configuration backend that centrally manages package information for both general and custom packages. Configuration files are retrieved as needed during image building and applied to the build process.

[0358] In addition, package information for general packages and custom packages can be managed in a distributed manner. Each service maintains its own package information for third-party Python packages. When a query or modification is needed, the corresponding package information can be pulled from each project, the changes can be made, and then the information can be pushed back to the project, making the package information managed as part of the project files.

[0359] This approach can proactively push the requirements.txt file during the image layer building process, making the image layer building process more automated and intelligent.

[0360] The program file management method in the exemplary embodiments of this disclosure allows developers to better understand and control service operation and code dependencies by reporting package and process information. Reporting Python package information using the SDK helps developers understand the actual reference status of Python packages during process runtime, helps them distinguish whether Python package configuration items are truly effective, and improves the efficiency of problem localization and tracing. In existing solutions, determining the version of Python packages that services depend on relies primarily on querying physical dependencies. However, after containerization, the login process in container environments is more complex, making it even more inconvenient to query Python package versions. By reporting service information and providing display and retrieval functions in the query backend, the operation time and steps of the query can be greatly reduced, and a more comprehensive and unified view of the aggregated information can be achieved.

[0361] Compared to services directly deployed on physical machines sharing Python packages, this disclosure allows for fine-grained management of Python packages that services and processes depend on. The third-party Python package configuration backend provides configuration methods at different granularities, enabling more flexible control over package information for different services with lower maintenance costs. It also provides a more convenient solution for scenarios such as specifying special versions and conducting version canary testing. Furthermore, the ability to first deploy new versions of Python packages on a small scale before large-scale rollout contributes to improved system availability and stability.

[0362] The package information management backend plays a crucial role in decoupling configuration and CI / CD processes. The CI / CD process does not rely on fixed configuration files, and configuration modifications can easily trigger the CI / CD process for container images. By adopting a method of isolating general third-party packages and custom package image layers for image building, image layer construction can be automatically triggered when Python package configurations are modified, improving image layer build efficiency. This also completely decouples the configuration modification process from project code modifications, reducing maintenance costs and improving the architecture and deployment efficiency of package information.

[0363] Furthermore, in an exemplary embodiment of this disclosure, a program file management device is also provided. Figure 16 A schematic diagram of the structure of the program file management device is shown, such as... Figure 16 As shown, the program file management device 1600 may include: an information parsing module 1610, an information comparison module 1620, and a file management module 1630. Wherein:

[0364] The information parsing module 1610 is configured to obtain the package information of the program package and the process information corresponding to the program package, and to parse the process information to obtain updated process information; the information comparison module 1620 is configured to obtain the current information of the current process, and to compare the current information with the updated process information to obtain a first comparison result; the file management module 1630 is configured to perform a removal process on the updated process information based on the first comparison result to obtain target information, so as to manage the program package through package information and target information.

[0365] In an exemplary embodiment of the present invention, after parsing the process information to obtain the updated process information, the method further includes:

[0366] Store the package information and the updated process information.

[0367] In an exemplary embodiment of the present invention, managing the package using the package information and the target information includes:

[0368] Determine the scope of application of the package, and classify the package as a general package or a custom package based on the scope of application;

[0369] The general package or the custom package is managed using the package information and the target information.

[0370] In an exemplary embodiment of the present invention, managing the general package or the custom package through the package information and the target information includes:

[0371] Obtain the environment parameters of the general package or the custom package, and determine the current environment of the general package or the custom package based on the environment parameters;

[0372] In the current environment, the general package is managed based on the package information and the target information;

[0373] In the current environment, the custom package is managed based on the package information and the target information.

[0374] In an exemplary embodiment of the present invention, the package information includes package name information, and the management of the general package based on the package information and the target information includes:

[0375] The package information is queried based on the package name information or the target information, and the package information is displayed.

[0376] In an exemplary embodiment of the present invention, after displaying the package information, managing the general package according to the package information and the target information includes:

[0377] Based on the target information, the general package is configured and modified according to the package information to obtain a general configuration record, so as to update the package information of the general package according to the general configuration record.

[0378] In an exemplary embodiment of the present invention, the step of modifying the configuration of the general package according to the package information to obtain a general configuration record includes:

[0379] Add a new general configuration record corresponding to the package information;

[0380] Modify the package information to obtain a general configuration record;

[0381] Delete the package information to obtain the general configuration record.

[0382] In one exemplary embodiment of the present invention, the current environment includes a testing environment and a production environment.

[0383] The management of the general package based on the package information and the target information includes:

[0384] Based on the test environment and the production environment, the package information is distinguished to obtain first test package information and first production package information;

[0385] The first test package information and the first production package information are compared to obtain a second comparison result, and the first test package information and the first production package information are labeled according to the second comparison result.

[0386] In an exemplary embodiment of the present invention, the step of comparing the first test package information and the first production package information to obtain a second comparison result includes:

[0387] The first test package information and the first production package information are sorted separately, and the sorted first test package information and the first production package information are converted into the target format to obtain the first test package information and the first production package information.

[0388] A second comparison result is obtained by comparing the first test package information and the first production package information in the target format.

[0389] In an exemplary embodiment of the present invention, managing the general package according to the package information and the target information includes:

[0390] Based on the target information, the package information is concatenated to obtain a general text file.

[0391] In one exemplary embodiment of the present invention, the method further includes:

[0392] Receive the installation instructions from the general text file, and construct a general image file of the general package based on the general text file.

[0393] In one exemplary embodiment of the present invention, the packet information includes packet name information.

[0394] The management of the custom package based on the package information and the target information includes:

[0395] Obtain the service name information corresponding to the custom package;

[0396] Based on the service name information, query the package information according to the package name information or the target information, and display the package information.

[0397] In an exemplary embodiment of the present invention, managing the custom package according to the package information and the target information includes:

[0398] Based on the target information, obtain the service name information corresponding to the custom package;

[0399] Based on the service name information, the custom package is configured and modified according to the package information to obtain a definition configuration record, and the package information of the custom package is updated according to the definition configuration record.

[0400] In an exemplary embodiment of the present invention, the step of modifying the configuration of the custom package according to the package information to obtain a defined configuration record includes:

[0401] Add a definition configuration record corresponding to the package information;

[0402] Modify the package information to obtain the defined configuration record;

[0403] Delete the package information to obtain the defined configuration record.

[0404] In one exemplary embodiment of the present invention, the current environment includes a testing environment and a production environment.

[0405] The management of the custom package based on the package information and the target information includes:

[0406] The package information is differentiated based on the test environment and the production environment to obtain the second test package information and the second production package information, and the service name information corresponding to the custom package is obtained.

[0407] Based on the service name information, the second test package information and the second production package information are compared to obtain a third comparison result, and the second test package information and the second production package information are labeled according to the third comparison result.

[0408] In an exemplary embodiment of the present invention, the step of comparing the second test package information and the second production package information to obtain a third comparison result includes:

[0409] The second test package information and the second production package information are sorted separately, and the sorted second test package information and the second production package information are converted into the target format to obtain the second test package information and the second production package information.

[0410] A third comparison result is obtained by comparing the second test package information and the second production package information in the target format.

[0411] In one exemplary embodiment of the present invention, the packet information is divided into general packet information and definition packet information.

[0412] The management of the custom package based on the package information and the target information includes:

[0413] Based on the target information, obtain the service name information corresponding to the custom package;

[0414] Based on the service name information, the general package information and the defined package information are merged to obtain the target package information;

[0415] The target package information is concatenated to obtain a definition text file.

[0416] In one exemplary embodiment of the present invention, the method further includes:

[0417] Receive the installation instructions from the definition text file, and construct the definition image file of the custom package based on the definition text file.

[0418] In an exemplary embodiment of the present invention, after managing the package using the package information and the target information, the method further includes:

[0419] Remove the package information.

[0420] The specific details of the above-mentioned program file management device 1600 have been described in detail in the corresponding program file management method, so they will not be repeated here.

[0421] It should be noted that although several modules or units of the program file management device 1600 have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0422] Furthermore, in an exemplary embodiment of this disclosure, an electronic device capable of implementing the above-described method is also provided.

[0423] The following reference Figure 17 To describe an electronic device 1700 according to such an embodiment of the present invention. Figure 17 The electronic device 1700 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.

[0424] like Figure 17As shown, the electronic device 1700 is presented in the form of a general-purpose computing device. The components of the electronic device 1700 may include, but are not limited to: at least one processing unit 1710, at least one storage unit 1720, a bus 1730 connecting different system components (including storage unit 1720 and processing unit 1710), and a display unit 1740.

[0425] The storage unit stores program code that can be executed by the processing unit 1710, causing the processing unit 1710 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of the present invention.

[0426] Storage unit 1720 may include readable media in the form of volatile storage units, such as random access memory (RAM) 1721 and / or cache memory 1722, and may further include read-only memory (ROM) 1723.

[0427] Storage unit 1720 may also include a program / utility 1724 having a set (at least one) program module 1725, such program module 1725 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.

[0428] Bus 1730 can represent one or more of several types of bus structures, including memory cell bus or memory cell controller, peripheral bus, graphics acceleration port, processing unit, or local bus using any of the multiple bus structures.

[0429] Electronic device 1700 can also communicate with one or more external devices 1900 (e.g., keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with electronic device 1700, and / or any device that enables electronic device 1700 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 1750. Furthermore, electronic device 1700 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 1760. As shown, network adapter 1760 communicates with other modules of electronic device 1700 via bus 1730. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 1700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0430] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.

[0431] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible embodiments, various aspects of the invention may also be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of the invention described in the "Exemplary Methods" section above.

[0432] refer to Figure 18 As shown, a program product 1800 for implementing the above-described method according to an embodiment of the present invention is described. It may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, the readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0433] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0434] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.

[0435] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0436] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0437] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.

Claims

1. A method for managing program files, characterized in that, The method includes: Obtain the package information of the program package and the process information corresponding to the program package, and parse the process information to obtain the updated process information; Obtain the current information of the current process, and compare the current information with the updated process information to obtain a first comparison result; The updated process information is removed based on the first comparison result to obtain target information, so as to manage the program package through the package information and the target information; wherein, if the first comparison result indicates that the updated partial process information does not exist in the current information, the partial process information is removed. The management of the package using the package information and the target information includes: Determine the scope of application of the package, and classify the package as a general package or a custom package based on the scope of application; The general package and the custom package are managed respectively using the package information and the target information.

2. The method for managing program files according to claim 1, characterized in that, After parsing and processing the process information to obtain the updated process information, the method further includes: Store the package information and the updated process information.

3. The method for managing program files according to claim 1, characterized in that, The package is a Python package; the determination of the package as a general package and a custom package according to the scope of application includes: if the Python package is applicable to all services, it is a general package; if the Python package is not applicable to all services, it is a custom package.

4. The method for managing program files according to claim 1, characterized in that, The management of the general package and the custom package using the package information and the target information includes: Obtain the environment parameters of the general package or the custom package, and determine the current environment of the general package or the custom package based on the environment parameters; In the current environment, the general package is managed based on the package information and the target information; In the current environment, the custom package is managed based on the package information and the target information.

5. The method for managing program files according to claim 4, characterized in that, The packet information includes packet name information. The management of the general package based on the package information and the target information includes: The package information is queried based on the package name information or the target information, and the package information is displayed.

6. The method for managing program files according to claim 4, characterized in that, After displaying the package information, the management of the general package based on the package information and the target information includes: Based on the target information, the general package is configured and modified according to the package information to obtain a general configuration record, so as to update the package information of the general package according to the general configuration record.

7. The method for managing program files according to claim 6, characterized in that, The step of modifying the configuration of the general package based on the package information to obtain a general configuration record includes: Add a new general configuration record corresponding to the package information; Modify the package information to obtain a general configuration record; Delete the package information to obtain the general configuration record.

8. The method for managing program files according to claim 4, characterized in that, The current environment includes both testing and production environments. The management of the general package based on the package information and the target information includes: Based on the test environment and the production environment, the package information is distinguished to obtain first test package information and first production package information; The first test package information and the first production package information are compared to obtain a second comparison result, and the first test package information and the first production package information are labeled according to the second comparison result.

9. The method for managing program files according to claim 8, characterized in that, The comparison of the first test package information and the first production package information to obtain a second comparison result includes: The first test package information and the first production package information are sorted separately, and the sorted first test package information and the first production package information are converted into the target format to obtain the first test package information and the first production package information. A second comparison result is obtained by comparing the first test package information and the first production package information in the target format.

10. The method for managing program files according to claim 4, characterized in that, The management of the general package based on the package information and the target information includes: Based on the target information, the package information is concatenated to obtain a general text file.

11. The method for managing program files according to claim 10, characterized in that, The method further includes: Receive the installation instructions from the general text file, and construct a general image file of the general package based on the general text file.

12. The method for managing program files according to claim 4, characterized in that, The packet information includes packet name information. The management of the custom package based on the package information and the target information includes: Obtain the service name information corresponding to the custom package; Based on the service name information, query the package information according to the package name information or the target information, and display the package information.

13. The method for managing program files according to claim 4, characterized in that, The management of the custom package based on the package information and the target information includes: Based on the target information, obtain the service name information corresponding to the custom package; Based on the service name information, the custom package is configured and modified according to the package information to obtain a definition configuration record, so as to update the package information of the custom package according to the definition configuration record.

14. The method for managing program files according to claim 13, characterized in that, The step of modifying the configuration of the custom package based on the package information to obtain the defined configuration record includes: Add a definition configuration record corresponding to the package information; Modify the package information to obtain the defined configuration record; Delete the package information to obtain the defined configuration record.

15. The method for managing program files according to claim 4, characterized in that, The current environment includes both testing and production environments. The management of the custom package based on the package information and the target information includes: The package information is differentiated based on the test environment and the production environment to obtain the second test package information and the second production package information, and the service name information corresponding to the custom package is obtained. Based on the service name information, the second test package information and the second production package information are compared to obtain a third comparison result, and the second test package information and the second production package information are labeled according to the third comparison result.

16. The method for managing program files according to claim 15, characterized in that, The comparison of the second test package information and the second production package information to obtain a third comparison result includes: The second test package information and the second production package information are sorted separately, and the sorted second test package information and the second production package information are converted into the target format to obtain the second test package information and the second production package information. A third comparison result is obtained by comparing the second test package information and the second production package information in the target format.

17. The method for managing program files according to claim 4, characterized in that, The packet information is divided into general packet information and definition packet information. The management of the custom package based on the package information and the target information includes: Based on the target information, obtain the service name information corresponding to the custom package; Based on the service name information, the general package information and the defined package information are merged to obtain the target package information; The target package information is concatenated to obtain a definition text file.

18. The method for managing program files according to claim 17, characterized in that, The method further includes: Receive the installation instructions from the definition text file, and construct the definition image file of the custom package based on the definition text file.

19. The method for managing program files according to claim 1, characterized in that, After managing the package using the package information and the target information, the method further includes: Remove the package information.

20. A program file management device, characterized in that, include: The information parsing module is configured to obtain the package information of the program package and the process information corresponding to the program package, and to parse the process information to obtain the updated process information. The information comparison module is configured to obtain the current information of the current process and compare the current information with the updated process information to obtain a first comparison result; The file management module is configured to remove target information from the updated process information based on the first comparison result, so as to manage the program package through the package information and the target information; wherein, if the first comparison result indicates that the updated partial process information does not exist in the current information, the partial process information is removed. The management of the package using the package information and the target information includes: Determine the scope of application of the package, and classify the package as a general package or a custom package based on the scope of application; The general package and the custom package are managed respectively using the package information and the target information.

21. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the program file management method according to any one of claims 1-19.

22. An electronic device, characterized in that, include: processor; Memory for storing the executable instructions of the processor; The processor is configured to execute the program file management method according to any one of claims 1-19 by executing the executable instructions.