Method and device for automatically acquiring project version

By implementing an automated version information collection and decryption mechanism between the front and back ends, it solves the problem that operation and maintenance personnel have difficulty obtaining the upgraded version information of the cloud center jar package in a timely manner, improving the efficiency of version information acquisition and ensuring security.

CN119987839APending Publication Date: 2025-05-13SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510039354.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-10
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

It is difficult for operation and maintenance personnel to obtain the jar package upgrade version information of each cloud center in a timely manner, resulting in version omissions and affecting the normal operation of the business.

Method used

By creating text files on the front end and combining intelligent back end operations, the automatic collection of front-end project version information is achieved. Use the encryption and decryption tool to encrypt and decrypt version information, and push the version information to CMDB for centralized management through Kafka message middleware.

Benefits of technology

It reduces manual intervention, improves the efficiency of obtaining version information, ensures timely capture of version updates of various cloud centers and projects, avoids version omissions, and ensures the security of version information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119987839A_ABST
    Figure CN119987839A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a device for automatically acquiring a project version, and relates to the technical field of project version acquisition, and the method comprises the following steps: creating a text file in a front-end specified directory, and embedding an encryption and decryption tool which is only limited to a super administrator to operate and calls a back-end interface; when the version of the front-end project is updated, newly added data is encrypted and verified by an encryption and decryption tool, and is stored in a text file after passing the encryption and decryption; the rear end splices the url according to the front-end item catalog and the query result, accesses the text file, decrypts the text file, obtains front-end detailed version information and stores the front-end detailed version information; positioning a back-end jar package catalog according to the catalog, matching and splitting version information and storing the version information; and constructing a record table containing key fields, integrating front-end version information and rear-end version information for classified management, and pushing the information to the CMDB by means of Kafka to achieve centralized sharing of the version information. The method is used for automatically obtaining the project version information, and operation and maintenance personnel can be liberated from tedious manual query work.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of project version acquisition, and in particular to a method and device for automatically acquiring a project version. Background Art

[0002] As the company's business continues to expand, the number of cloud centers in various places has gradually increased. In this case, the jar package versions upgraded by each cloud center have become different. However, for operation and maintenance personnel, they are faced with a thorny problem, that is, they cannot obtain the jar package upgrade version information of each cloud center in a timely manner.

[0003] If you log in to each cloud center host one by one to check the jar package version, it will be a highly repetitive and time-consuming operation, and the efficiency is extremely low. Moreover, this method has a great risk. Due to the cumbersome operation, it is easy to miss the upgrade of a cloud center. Once missed, some cloud centers will not upgrade the jar package when they need to in actual business, which may have a negative impact on the normal operation of the business. Summary of the invention

[0004] In view of the needs and deficiencies of current technology development, the present invention provides a method and device for automatically obtaining a project version.

[0005] In a first aspect, the present invention provides a method for automatically obtaining a project version. The technical solution adopted to solve the above technical problem is as follows:

[0006] A method for automatically obtaining a project version comprises the following steps:

[0007] S1. Create a text file in the specified directory of the front end, introduce the background management module, and embed an encryption and decryption tool that can only be operated by the super administrator in the background management module. The encryption and decryption tool implements encryption and decryption functions by calling the backend interface;

[0008] S2. When the front-end project modifies the version and adds new data, use the encryption and decryption tool to encrypt the new data and verify the consistency, and store the verified encrypted data in a text file;

[0009] S3. The backend splices the detailed name based on the front-end project directory, combines it with the cloud center domain name obtained by querying the API table, and splices the URL to access the front-end text file. After successfully accessing the text file, it uses the encryption and decryption tool to decrypt it, obtains the detailed version information of the front-end project, and stores it in the database.

[0010] S4. The backend locates the jar package directory according to the backend project directory, obtains all file names in the directory through the new File method and listFiles, matches the detailed name of the jar package with the service name, and splits the backend version information according to the jar package naming rules through the specified method and stores it in the database;

[0011] S5. Construct a version information record table containing key fields, and store the version information obtained by the front-end and back-end into the version information record table for classification management;

[0012] S6. Use Kafka as the message middleware to push the version information in the version information record table to CMDB to achieve centralized management and sharing of version information.

[0013] Optionally, when the front-end project modifies the version and adds new data, put the new data into the input box of the encryption and decryption tool, enter the 16-digit key in the small input box below or use the default key, and click the Encrypt button to call the back-end encryption interface;

[0014] The back-end encryption interface verifies the key length and data format, uses AES16-bit encryption to encrypt the newly added data and returns the ciphertext to the front-end;

[0015] The front-end uses encryption and decryption tools, inputs ciphertext and secret key or default secret key, and calls the back-end decryption interface for consistency verification;

[0016] After verification, the ciphertext is stored in the text file created by the front end.

[0017] Preferably, when the front-end project modifies the version and adds new data, the new data is version information of a json structure.

[0018] Further optionally, after the backend splices out the URL for accessing the frontend text file, it accesses the frontend text file through url.openConnection(), obtains a status code of 200 to confirm successful access, and then reads the text file; the backend uses the matching AES16-bit decryption algorithm to decrypt the ciphertext, obtains the detailed version information of the frontend project and stores it in the database.

[0019] Optionally, the detailed version information of the front-end project in step S3 includes the version number, git commit code, version description, version modification time, and project name. The detailed version information of the front-end project is filled in the version information record table of the corresponding machine project group and written into the library;

[0020] In step S4, the backend version information includes the version number, git commit code, version description, version modification time, and project name. The backend version information is filled in with the machine and project grouping and then written into the version information record table of the library.

[0021] In a second aspect, the present invention provides a device for automatically obtaining a project version. The technical solution adopted to solve the above technical problem is as follows:

[0022] A device for automatically obtaining a project version, comprising:

[0023] The information acquisition module is deployed on the front end and is used to obtain the newly added data of the front end project and its modified version;

[0024] The backend management module is deployed on the frontend and has a built-in encryption and decryption tool that can only be operated by the super administrator. The encryption and decryption tool interacts with the backend interface module to implement encryption and decryption functions;

[0025] The file creation module is deployed on the front end and is used to create a text file in the specified directory of the front end. The text file is used to store the newly added data encrypted by the encryption and decryption tools when the front end project is modified;

[0026] The splicing processing module is deployed on the back end and is used to splice the detailed name according to the front-end project directory, and combine it with the cloud center domain name obtained by querying the API table to splice the URL to access the front-end text file. After successfully accessing the text file, the encryption and decryption tool is called to decrypt it, and the detailed version information of the front-end project is obtained and stored in the database;

[0027] The back-end interface module is deployed on the back-end, including the back-end encryption interface and the back-end decryption interface, which are used to interact with the encryption and decryption tools to realize the encryption and decryption functions of the newly added data;

[0028] The acquisition and positioning module is deployed on the backend to obtain the backend project, locate the jar package directory according to the backend project directory, obtain all file names in the directory through the new File method and listFiles, match the detailed name of the jar package with the service name, and split the backend version information according to the jar package naming rules through the specified method and store it in the library;

[0029] The table construction module is used to construct a version information record table containing key fields in the library, and store the version information obtained by the front-end and back-end into the version information record table for classification management;

[0030] The information push module is used to use Kafka as the message middleware to push the version information in the version information record table to the CMDB, so as to realize the centralized management and sharing of version information.

[0031] Optionally, after the information acquisition module obtains the newly added data when the front-end project is modified, it puts the newly added data into the input box of the encryption and decryption tool, enters the 16-bit key in the small input box below or uses the default key, clicks the encryption button to call the back-end encryption interface, and the back-end encryption interface verifies the key length and data format, uses the AES16-bit encryption method to encrypt the newly added data and returns the ciphertext to the front-end;

[0032] Use the encryption and decryption tool, enter the ciphertext and secret key or the default secret key, call the backend decryption interface for consistency verification, and after the verification passes, store the ciphertext in a text file.

[0033] Preferably, when the front-end project modifies the version and adds new data, the new data is version information of a json structure.

[0034] Further optionally, after the splicing processing module splices out the URL for accessing the front-end text file, it accesses the text file through url.openConnection(), obtains a status code of 200 to confirm successful access, reads the text file, and uses the matching AES16-bit decryption algorithm to decrypt the ciphertext, obtains the detailed version information of the front-end project and stores it in the database.

[0035] Optionally, the detailed version information of the front-end project involved includes the version number, git commit code, version description, version modification time, and project name. The splicing processing module fills the detailed version information of the front-end project into the corresponding version information record table of the library after the project grouping of the machine belongs to it;

[0036] The backend version information includes version number, git commit code, version description, version modification time, and project name. The acquisition and positioning module fills the backend version information with the belonging machine and project group and writes it into the version information record table of the library accordingly.

[0037] Compared with the prior art, the method and device for automatically obtaining a project version of the present invention have the following beneficial effects:

[0038] 1. In terms of the automation of version information acquisition, the present invention realizes the automatic collection of front-end and back-end project version information by creating a text file in a specific directory of the front end and combining a series of intelligent operations of the back end; after the front-end project modifies the version, the encryption and decryption tool is used to interact with the back-end interface to automatically encrypt and store the version information. The back end can accurately splice the URL according to the front-end project directory and the API table, automatically obtain the ciphertext in the front-end text file and decrypt it to obtain the version details; the back end itself can also locate the jar package directory according to the project directory and automatically split the version information; this automated process greatly reduces manual intervention, frees operation and maintenance personnel from tedious manual query work, greatly improves the efficiency of version information acquisition, ensures that version updates of each cloud center and each project can be captured in time, and avoids the problem of version omission;

[0039] 2. From the perspective of security, the present invention introduces a strict encryption and decryption mechanism, specifically using the AES16-bit encryption algorithm. Whether it is the encryption of the newly added version information by the front end or the decryption process after the back end obtains the ciphertext, a key of a specific length is required, and only super administrators are allowed to operate key encryption and decryption interfaces. This effectively prevents unauthorized access and data leakage risks, ensures the security of version information during transmission and storage, and maintains the core technical assets of the enterprise;

[0040] 3. In terms of the centralization and standardization of version information management, the present invention constructs a version information record table containing comprehensive key fields, and uniformly incorporates the version information obtained by the front-end and back-end into it for classified management; and, with the help of Kafka message middleware, the information in the record table is pushed to CMDB, realizing one-stop centralized management and sharing of version information; different departments and different business links within the enterprise can quickly and accurately query from CMDB when version information is needed, whether it is used for system maintenance, upgrade decisions, or troubleshooting compatibility issues, it can get strong data support, greatly improving the overall efficiency and coordination capabilities of enterprise IT operation management. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Attached Figure 1 is a flow chart of a method according to Embodiment 1 of the present invention;

[0042] Attached Figure 2 This is a module connection block diagram of the second embodiment of the present invention. DETAILED DESCRIPTION

[0043] In order to make the technical solution, the technical problem solved and the technical effect of the present invention more clearly understood, the technical solution of the present invention is clearly and completely described below in conjunction with specific embodiments.

[0044] Embodiment 1:

[0045] Combined with Figure 1 , this embodiment proposes a method for automatically obtaining a project version, which includes the following steps:

[0046] S1. Create a text file in the specified directory of the front end, introduce the background management module, and embed an encryption and decryption tool that can only be operated by the super administrator in the background management module. The encryption and decryption tool implements encryption and decryption functions by calling the backend interface.

[0047] S2. When the front-end project modifies the version and adds new data, use the encryption and decryption tool to encrypt the new data and verify the consistency, and store the verified encrypted data in a text file. The specific operations include:

[0048] When the front-end project modifies the version and adds new data, the new data is the version information of the json structure. Put the new data into the input box of the encryption and decryption tool, enter the 16-digit key in the small input box below or use the default key, and click the encryption button to call the back-end encryption interface;

[0049] The back-end encryption interface verifies the key length and data format, uses AES16-bit encryption to encrypt the newly added data and returns the ciphertext to the front-end;

[0050] The front-end uses encryption and decryption tools, inputs ciphertext and secret key or default secret key, and calls the back-end decryption interface for consistency verification;

[0051] After verification, the ciphertext is stored in the text file created by the front end.

[0052] S3. The backend splices the detailed name according to the front-end project directory, combines it with the cloud center domain name obtained by querying the API table, and splices out the URL to access the front-end text file. The front-end text file is accessed through url.openConnection(), and the status code is 200 to confirm the successful access. Then, the text file is read. The backend uses the matching AES16-bit decryption algorithm to decrypt the ciphertext and obtain the detailed version information of the front-end project, including the version number, git commit code, version description, version modification time, and project name. After filling it into the corresponding version information record table of the library after the project grouping of the machine is written.

[0053] S4. The backend locates the jar package directory according to the backend project directory, obtains all file names under the directory through the new File method and listFiles, matches the detailed name of the jar package with the service name, and splits the backend version information according to the jar package naming rules through the specified method, including version number, git commit code, version description, version modification time, and project name, and fills it into the version information record table of the corresponding machine and project grouping and writes it into the library.

[0054] S5. Construct a version information record table containing key fields, and store the version information obtained by the front-end and back-end into the version information record table for classification management;

[0055] S6. Use Kafka as the message middleware to push the version information in the version information record table to the CMDB (Configuration Management Database) to achieve centralized management and sharing of version information.

[0056] Embodiment 2:

[0057] Combined with Figure 2 This embodiment provides a device for automatically obtaining a project version, which includes:

[0058] The information acquisition module is deployed on the front end and is used to obtain the newly added data of the front end project and its modified version;

[0059] The backend management module is deployed on the frontend and has a built-in encryption and decryption tool that can only be operated by the super administrator. The encryption and decryption tool interacts with the backend interface module to implement encryption and decryption functions;

[0060] The file creation module is deployed on the front end and is used to create a text file in the specified directory of the front end. The text file is used to store the newly added data encrypted by the encryption and decryption tools when the front end project is modified;

[0061] The splicing processing module is deployed on the back end and is used to splice the detailed name according to the front-end project directory, and combine it with the cloud center domain name obtained by querying the API table to splice the URL to access the front-end text file. After successfully accessing the text file, the encryption and decryption tool is called to decrypt it, and the detailed version information of the front-end project is obtained and stored in the database;

[0062] The back-end interface module is deployed on the back-end, including the back-end encryption interface and the back-end decryption interface, which are used to interact with the encryption and decryption tools to realize the encryption and decryption functions of the newly added data;

[0063] The acquisition and positioning module is deployed on the backend to obtain the backend project, locate the jar package directory according to the backend project directory, obtain all file names in the directory through the new File method and listFiles, match the detailed name of the jar package with the service name, and split the backend version information according to the jar package naming rules through the specified method and store it in the library;

[0064] The table construction module is used to construct a version information record table containing key fields in the library, and store the version information obtained by the front-end and back-end into the version information record table for classification management;

[0065] The information push module is used to use Kafka as the message middleware to push the version information in the version information record table to the CMDB (Configuration Management Database) to achieve centralized management and sharing of version information.

[0066] In this embodiment, when the information acquisition module obtains the newly added data when the front-end project is modified, the newly added data is the version information of the json structure, and then the newly added data is put into the input box of the encryption and decryption tool, and the 16-bit key is entered in the small input box below or the default key is used. Click the encryption button to call the back-end encryption interface, and the back-end encryption interface verifies the key length and data format, and uses the AES16-bit encryption method to encrypt the newly added data and return the ciphertext to the front end;

[0067] Use the encryption and decryption tool, enter the ciphertext and secret key or the default secret key, call the backend decryption interface for consistency verification, and after the verification passes, store the ciphertext in a text file.

[0068] In this embodiment, the splicing processing module involved splices out the URL for accessing the front-end text file, accesses the text file through url.openConnection(), obtains a status code of 200 to confirm successful access, reads the text file, and uses the matching AES16-bit decryption algorithm to decrypt the ciphertext, obtains the detailed version information of the front-end project and stores it in the database.

[0069] In this embodiment, the detailed version information of the front-end project involved includes version number, git submission code, version description, version modification time, and project name. The splicing processing module fills the detailed version information of the front-end project into the version information record table corresponding to the project grouping of the machine to which it belongs and writes it into the library.

[0070] In this embodiment, the backend version information involved includes version number, git submission code, version description, version modification time, and project name. The acquisition and positioning module fills the backend version information into the corresponding version information record table of the library after grouping the machine and project.

[0071] In summary, the method and device for automatically obtaining project versions of the present invention can automatically obtain project version information, reduce manual intervention, free operation and maintenance personnel from tedious manual query work, greatly improve the efficiency of version information acquisition, and ensure that version updates of each cloud center and each project can be captured in time, avoiding version omission problems.

[0072] The above specific examples are used to explain the principles and implementation methods of the present invention in detail. These examples are only used to help understand the core technical content of the present invention. Based on the above specific embodiments of the present invention, any improvements and modifications made by technicians in this technical field without departing from the principles of the present invention should fall within the scope of patent protection of the present invention.

Claims

1. A method for automatically obtaining a project version, characterized in that: The steps include: S1. Create a text file in the specified directory of the front end, introduce the background management module, and embed an encryption and decryption tool that can only be operated by the super administrator in the background management module. The encryption and decryption tool implements encryption and decryption functions by calling the backend interface; S2. When the front-end project modifies the version and adds new data, use the encryption and decryption tool to encrypt the new data and verify the consistency, and store the verified encrypted data in a text file; S3. The backend splices the detailed name based on the front-end project directory, combines it with the cloud center domain name obtained by querying the API table, and splices the URL to access the front-end text file. After successfully accessing the text file, it uses the encryption and decryption tool to decrypt it, obtains the detailed version information of the front-end project, and stores it in the database. S4. The backend locates the jar package directory according to the backend project directory, obtains all file names in the directory through the new File method and listFiles, matches the detailed name of the jar package with the service name, and splits the backend version information according to the jar package naming rules through the specified method and stores it in the database; S5. Construct a version information record table containing key fields, and store the version information obtained by the front-end and back-end into the version information record table for classification management; S6. Use Kafka as the message middleware to push the version information in the version information record table to CMDB to achieve centralized management and sharing of version information.

2. A method for automatically obtaining a project version according to claim 1, characterized in that: When the front-end project modifies the version and adds new data, put the new data into the input box of the encryption and decryption tool, enter the 16-digit key in the small input box below or use the default key, and click the Encrypt button to call the back-end encryption interface; The back-end encryption interface verifies the key length and data format, uses AES16-bit encryption to encrypt the newly added data and returns the ciphertext to the front-end; The front-end uses encryption and decryption tools, inputs ciphertext and secret key or default secret key, and calls the back-end decryption interface for consistency verification; After verification, the ciphertext is stored in the text file created by the front end.

3. A method for automatically obtaining a project version according to claim 2, characterized in that: When the front-end project modifies the version and adds new data, the new data is version information in a json structure.

4. The method for automatically obtaining a project version according to claim 2, characterized in that: After the backend assembles the URL for accessing the frontend text file, it accesses the frontend text file through url.openConnection(). After obtaining a status code of 200 to confirm successful access, it reads the text file. The backend uses the matching AES16-bit decryption algorithm to decrypt the ciphertext, obtain the detailed version information of the frontend project, and store it in the database.

5. The method for automatically obtaining a project version according to claim 1, characterized in that: The detailed version information of the front-end project in step S3 includes the version number, git commit code, version description, version modification time, and project name. The detailed version information of the front-end project is filled in the corresponding version information record table of the library after the project grouping of the machine belongs to it; The backend version information in step S4 includes version number, git commit code, version description, version modification time, and project name. The backend version information is filled in the version information record table of the library after being grouped with the machine and project.

6. A device for automatically obtaining a project version, characterized in that: It includes: The information acquisition module is deployed on the front end and is used to obtain the newly added data of the front end project and its modified version; The backend management module is deployed on the frontend and has a built-in encryption and decryption tool that can only be operated by the super administrator. The encryption and decryption tool interacts with the backend interface module to implement encryption and decryption functions; The file creation module is deployed on the front end and is used to create a text file in the specified directory of the front end. The text file is used to store the newly added data encrypted by the encryption and decryption tools when the front end project is modified; The splicing processing module is deployed on the back end and is used to splice the detailed name according to the front-end project directory, and combine it with the cloud center domain name obtained by querying the API table to splice the URL to access the front-end text file. After successfully accessing the text file, the encryption and decryption tool is called to decrypt it, and the detailed version information of the front-end project is obtained and stored in the database; The back-end interface module is deployed on the back-end, including the back-end encryption interface and the back-end decryption interface, which are used to interact with the encryption and decryption tools to realize the encryption and decryption functions of the newly added data; The acquisition and positioning module is deployed on the backend to obtain the backend project, locate the jar package directory according to the backend project directory, obtain all file names in the directory through the new File method and listFiles, match the detailed name of the jar package with the service name, and split the backend version information according to the jar package naming rules through the specified method and store it in the library; The table construction module is used to construct a version information record table containing key fields in the library, and store the version information obtained by the front-end and back-end into the version information record table for classification management; The information push module is used to use Kafka as the message middleware to push the version information in the version information record table to the CMDB, so as to realize the centralized management and sharing of version information.

7. The device for automatically obtaining a project version according to claim 6, characterized in that: After the information acquisition module obtains the newly added data when the front-end project is modified, it puts the newly added data into the input box of the encryption and decryption tool, enters the 16-bit key in the small input box below or uses the default key, clicks the encryption button to call the back-end encryption interface, and the back-end encryption interface verifies the key length and data format, uses the AES16-bit encryption method to encrypt the newly added data and returns the ciphertext to the front-end; Use the encryption and decryption tool, enter the ciphertext and secret key or the default secret key, call the backend decryption interface for consistency verification, and after the verification passes, store the ciphertext in a text file.

8. The device for automatically obtaining a project version according to claim 7, characterized in that: When the front-end project modifies the version and adds new data, the new data is version information in a json structure.

9. The device for automatically obtaining a project version according to claim 7, characterized in that: After the splicing processing module splices out the URL for accessing the front-end text file, it accesses the text file through url.openConnection(), obtains a status code of 200 to confirm successful access, reads the text file, and uses the matching AES16-bit decryption algorithm to decrypt the ciphertext, obtains the detailed version information of the front-end project and stores it in the database.

10. The device for automatically obtaining a project version according to claim 6, characterized in that: The detailed version information of the front-end project includes the version number, git commit code, version description, version modification time, and project name. The splicing processing module fills the detailed version information of the front-end project into the corresponding version information record table of the library after the project grouping of the machine belongs to it; The backend version information includes version number, git commit code, version description, version modification time, and project name. The acquisition and positioning module fills the backend version information with the belonging machine and project group and writes it into the version information record table of the library accordingly.