Method, device, equipment and storage medium for dynamically generating application version number

By listening to Kafka topics to collect production application version information, building and pushing application images, the problems of inflexible application version number management and accidental modification are solved, and accurate version number generation and automated operation are achieved in agile development.

CN118626137BActive Publication Date: 2024-11-19中邮消费金融有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411059862.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-05
Publication Date
2024-11-19
Estimated Expiration
2044-08-05

AI Technical Summary

Technical Problem

Existing application version number management methods are inflexible and prone to human error, leading to inaccurate application releases and complex operations.

Method used

By listening to the Kafka topic for production application version releases, application version information is collected, application images are built, and the version information is compared when pushing the image to determine the target version number, and application system packages are dynamically generated and embedded.

Benefits of technology

It enables flexible adaptation to frequently changing application versions under the agile development model, ensuring version number accuracy and simplifying operation processes, and automatically collecting real production version information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118626137B_ABST
    Figure CN118626137B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, equipment and storage medium for dynamically generating an application version number, and relates to the field of software development technology, wherein the method comprises: collecting application version information released by production applications by monitoring a kafka topic; building an application image based on the released application version information; when pushing the application image, comparing the version information when the application image is built with the latest application version number currently released by the production application to obtain a comparison result; determining the target version number according to the comparison result, and pushing the product based on the target version number. Since the present application builds or pushes the product by collecting the version number corresponding to each production application version release, it can dynamically generate the application version number based on the latest production version, and automatically embed it into the application system package for pushing, and flexibly adapt to the frequent changes of application versions in the agile development mode and the collection of production version information released by real applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software development technology, and in particular to a method, device, equipment and storage medium for dynamically generating an application version number. Background Art

[0002] Agile development is one of the most widely used and recognized software development frameworks in the industry. Its most important feature is flexibility and the ability to quickly adapt to changes in demand. Therefore, application version plans using the agile development model are usually adaptive and need to be adjusted according to project progress or changes in demand. As a result, the application version number also needs to be adjusted accordingly to ensure that the application version number is always incremented based on the latest production application version number.

[0003] For projects managed by Maven, the application version number is usually set in the pom file. If it needs to be changed, the source code must be downloaded before the operation can be performed. In the agile development process, the application version number changes caused by project plan adjustments will be relatively frequent, so the traditional method of setting the version number in the pom file is not flexible enough. The method of extracting the application version number to the configuration center for configuration has the problem of incorrect application version number due to human factors such as the executor's omission to modify a certain change or misoperating the version number when the new version of the application is not released. In addition, the production application version number released in the above way needs to download the deployment package in the application deployment environment, extract it from the pom file after decompression, or obtain the configured version number from the configuration center. There are cases where the operation is complicated or the extracted application version number is not the real application version number. Summary of the invention

[0004] The main purpose of this application is to provide a method, device, equipment and storage medium for dynamically generating application version numbers, aiming to solve the technical problems that existing version number management methods are inflexible and there is a risk of human omission or erroneous modification, resulting in inaccurate application release versions.

[0005] To achieve the above purpose, the present application proposes a method for dynamically generating an application version number, the method comprising:

[0006] Monitor the Kafka topic corresponding to the production application version release, and collect the application version information released by the production application;

[0007] Building an application image based on the published application version information;

[0008] When pushing the application image, compare the version information when the application image is built with the latest application version number of the production application to obtain a comparison result;

[0009] The target version number is determined according to the comparison result, and the product is pushed based on the target version number.

[0010] In one embodiment, the step of building an application image based on the published application version information includes:

[0011] Obtain application version information released by production applications from the application product package building platform database;

[0012] Obtain the latest application version information built in the current branch of the git source code corresponding to the production application from the build record;

[0013] Determine the target build version number according to the published application version information and the latest built application version information;

[0014] Build an application image according to the target build version number.

[0015] In one embodiment, the step of determining the target build version number according to the published application version information and the latest built application version information includes:

[0016] If the published application version information is less than or equal to the latest built application version information, then the latest built application version information is determined as the target build version number;

[0017] If the published application version information is greater than the latest built application version information, the published application version information is dynamically incremented, and the incremented version number is determined as the target built version number.

[0018] In one embodiment, when pushing the application image, the step of comparing the version information when the application image is built with the latest application version number of the production application to obtain the comparison result includes:

[0019] When pushing the application image, obtaining version information when the application image is built from the product package information;

[0020] Obtain the latest released application version number of the production application from the application package building platform database;

[0021] Compare the version information when the application image is built with the latest application version number of the production application to obtain the comparison result.

[0022] In one embodiment, the step of determining a target version number according to the comparison result and pushing a product based on the target version number includes:

[0023] If the version information of the application image when it is built is greater than or equal to the latest application version number of the production application, the version information of the application image when it is built is determined as the target version number, and the application image is pushed;

[0024] If the version information of the application image when it is built is less than the latest application version number of the production application, the latest application version number of the production application is dynamically incremented to obtain the target version number, and the application version information in the last built source image is replaced with the target version number, and the replaced source image is pushed.

[0025] In one embodiment, if the version information of the application image when it is constructed is greater than or equal to the latest application version number of the production application, the step of determining the version information of the application image when it is constructed as the target version number includes:

[0026] If the major version number in the version information when the application image is constructed is greater than or equal to the major version number in the application version number currently released by the production application, the major version number in the version information when the application image is constructed is determined as the target major version number;

[0027] If the minor version number in the version information when the application image is constructed is greater than or equal to the minor version number in the application version number currently released by the production application, the minor version number in the version information when the application image is constructed is determined as the target minor version number;

[0028] If the compilation version number in the version information when the application image is constructed is greater than or equal to the compilation version number in the latest application version number released by the production application, the compilation version number in the version information when the application image is constructed is determined as the target compilation version number;

[0029] A target version number is generated according to the target major version number, the target minor version number and the target compilation version number.

[0030] In one embodiment, if the version information of the application image when it is built is less than the latest application version number of the production application, the step of dynamically increasing the latest application version number of the production application to obtain the target version number includes:

[0031] If the major version number in the version information when the application image is built is smaller than the major version number in the latest application version number released by the production application, the major version number in the latest application version number released by the production application is determined as the target major version number;

[0032] If the minor version number in the version information when the application image is built is smaller than the minor version number in the latest application version number of the production application, the minor version number in the latest application version number of the production application is determined as the target minor version number;

[0033] If the compilation version number in the version information when the application image is built is smaller than the compilation version number in the latest application version number released by the production application, the current timestamp is determined as the target compilation version number;

[0034] A target version number is generated according to the target major version number, the target minor version number and the target compilation version number.

[0035] In addition, to achieve the above purpose, the present application also proposes a device for dynamically generating an application version number, the device for dynamically generating an application version number comprising:

[0036] The version information collection module is used to monitor the Kafka topic corresponding to the production application version release and collect the application version information released by the production application;

[0037] An application image building module, used to build an application image based on the published application version information;

[0038] A version information comparison module is used to compare the version information when the application image is built with the latest application version number of the production application when pushing the application image, and obtain a comparison result;

[0039] The target version determination module is used to determine the target version number according to the comparison result, and push the product based on the target version number.

[0040] In addition, to achieve the above-mentioned purpose, the present application also proposes a device for dynamically generating an application version number, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the method for dynamically generating an application version number as described above.

[0041] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the method for dynamically generating an application version number as described above are implemented.

[0042] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the method for dynamically generating an application version number as described above are implemented.

[0043] The present application provides a method for dynamically generating an application version number, which collects application version information released by production applications by listening to a kafka topic; builds an application image based on the released application version information; when pushing the application image, compares the version information when the application image is built with the latest application version number released by the production application to obtain a comparison result; determines the target version number based on the comparison result, and pushes the product based on the target version number. Since the present application builds or pushes the product by collecting the version number corresponding to each production application version release, it can dynamically generate the application version number based on the latest production version, and automatically embed it into the application system package for push, which can flexibly adapt to the frequent changes of application versions in the agile development mode and the collection of production version information released by real applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0046] Figure 1 A flowchart of a first embodiment of a method for dynamically generating an application version number of the present application is provided;

[0047] Figure 2 A flowchart of a second embodiment of the method for dynamically generating an application version number of the present application is provided;

[0048] Figure 3 A flowchart of a third embodiment of the method for dynamically generating an application version number of the present application is provided;

[0049] Figure 4 This is a schematic diagram of the module structure of the device for dynamically generating application version numbers according to an embodiment of the present application;

[0050] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the method for dynamically generating an application version number in an embodiment of the present application.

[0051] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0052] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0053] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0054] The main solution of the embodiment of the present application is: listen to the kafka topic corresponding to the production application version release, collect the application version information released by the production application; build an application image based on the released application version information; when pushing the application image, compare the version information when the application image is built with the latest application version number currently released by the production application to obtain a comparison result; determine the target version number according to the comparison result, and push the product based on the target version number.

[0055] Since the version number of the application in the prior art is usually set in the pom file, if it needs to be changed, the source code must be downloaded before the operation can be performed. In the agile development process, the application version number changes caused by the project plan adjustment will be relatively frequent, so the traditional method of setting the version number in the pom file is not flexible enough. The method of extracting the application version number to the configuration center for configuration has the problem of incorrect application version number due to human factors such as the execution personnel missing a change or misoperating the version number when the new version of the application is not released. In addition, the production application version number released in the above way needs to download the deployment package in the application deployment environment, extract it from the pom file after decompression, or obtain the configured version number from the configuration center. There are cases where the operation is complicated or the extracted application version number is not the real application version number.

[0056] The present application provides a solution, which collects the application version information released by the production application by listening to the kafka topic; builds the application image based on the released application version information; when pushing the application image, compares the version information when the application image is built with the latest application version number released by the production application to obtain the comparison result; determines the target version number according to the comparison result, and pushes the product based on the target version number. Since the present application builds or pushes the product by collecting the version number corresponding to each production application version release, it can dynamically generate the application version number based on the latest production version, and automatically embed it into the application system package for push, which can flexibly adapt to the frequent changes of application versions in the agile development mode and the collection of production version information released by real applications.

[0057] It should be noted that the execution subject of the method of this embodiment can be a computing service device with dynamic application version number generation, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc.; it can also be the above-mentioned dynamic application version number generation device with the same or similar functions. This embodiment and the following embodiments will be described by taking the dynamic application version number generation device as an example.

[0058] Based on this, the present application embodiment provides a method for dynamically generating an application version number, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the method for dynamically generating application version numbers of this application.

[0059] In this embodiment, the method for dynamically generating an application version number includes steps S10 to S40:

[0060] Step S10, monitor the Kafka topic corresponding to the production application version release, and collect the application version information released by the production application.

[0061] It is understandable that this solution divides the entire process into three modules: application version release management, dynamic generation of application version numbers, and automatic collection of production application version numbers. The application version release management module listens to the specified kafka topic for production application version releases, and saves the collected application production version information to the application product package construction platform database. The storage results are shown in the following table.

[0062]

[0063] Step S20: construct an application image based on the published application version information.

[0064] It can be understood that, during the application construction phase, the module for dynamically generating an application version number obtains the latest released application version number of the application from the application version release management module according to the application construction information, and dynamically increments the version number based on the version number. The generated version information is then written into the version configuration file, and the version configuration file is automatically embedded into the constructed application source code. Finally, the application image is built and the application version information is registered.

[0065] Step S30, when pushing the application image, compare the version information when the application image is built with the latest application version number of the production application to obtain a comparison result.

[0066] It should be understood that in the product push stage, the application version information when the image is built is obtained based on the pushed application image, and the application version number when the image is built is compared with the latest application version number of the production application to determine the comparison result.

[0067] Step S40, determining a target version number according to the comparison result, and pushing a product based on the target version number.

[0068] It is understandable that after determining the target version number, the product is pushed according to the target version number. Then, the pushed product application image is deployed to the production environment through the automatic collection of production application version number module; when the application is successfully started, the plug-in that inherits the springboot application ApplicationListener application listener receives the ApplicationReadyEvent application ready event, and starts to collect the application app-version.properties configuration file information, and pushes the collected version information to the specified topic of kafka for collection by the application version management module. In addition, if there are strict requirements for the accuracy of the imported data files, on this basis, specific encryption operations can be performed on the data files in the imported application package, and then decrypted in the automatic data collection component to ensure that the imported data files are not tampered with.

[0069] This embodiment provides a method for dynamically generating an application version number, which collects application version information released by production applications by listening to a kafka topic; builds an application image based on the released application version information; when pushing the application image, compares the version information when the application image is built with the latest application version number released by the production application to obtain a comparison result; determines the target version number based on the comparison result, and pushes the product based on the target version number. Since this embodiment builds or pushes the product by collecting the version number corresponding to each production application version release, it can dynamically generate an application version number based on the latest production version, and automatically embed it into the application system package for push, which can flexibly adapt to the frequent changes of application versions in the agile development mode and the collection of production version information released by real applications.

[0070] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can refer to the above introduction, and will not be repeated later. Figure 2 , step S20, the method for dynamically generating an application version number further includes steps S201 to S204:

[0071] Step S201, obtaining application version information of the production application from the application product package construction platform database.

[0072] Step S202, obtaining the latest built application version information in the current branch of the git source code corresponding to the production application from the build record.

[0073] Step S203: determining a target build version number according to the published application version information and the latest built application version information.

[0074] It is understandable that in the construction phase, after selecting the application to be built and the corresponding git source code branch, the construction is initiated. The system obtains the latest released application version information of its production application and the latest built application version information in the current branch based on the selected application. The latest released application version information is obtained from the above-mentioned application product package construction platform database. The latest built application version information of the current branch is obtained from the build record table. If the build record does not exist, the application branch is built for the first time, and the version defaults to the latest production version increment; if the build record exists, the corresponding version information is obtained. Then, the version information of the built application is verified with the latest production version information corresponding to the application to determine the target build version number.

[0075] In a feasible implementation, step S203 may include steps S2031-S2032:

[0076] Step S2031: If the published application version information is less than or equal to the latest built application version information, the latest built application version information is determined as the target build version number.

[0077] It should be noted that the version information of the constructed application is verified with the latest production version information corresponding to the application. If the published application version information is less than or equal to the latest constructed application version information, the latest constructed application version information is determined as the target build version number.

[0078] In the specific implementation, the version number rule is: V major version number. Minor version number. Compile version number, that is, the version numbers involved in this application include major version number, minor version number and compile version number. When comparing the size of the version number, the three parts can be compared one by one. First, the major version number is compared. If the major version number of the published application version information is less than or equal to the major version number of the latest built application version information, the major version number of the latest built application version information is determined as the final target build major version number; then the minor version number is compared. If the minor version number of the published application version information is less than or equal to the minor version number of the latest built application version information, the minor version number of the latest built application version information is determined as the final target build minor version number; finally, the compile version number is compared. If the compile version number of the published application version information is less than or equal to the compile version number of the latest built application version information, the compile version number of the latest built application version information is determined as the final target build compile version number. Then, the target build version number is generated according to the rule of "V target build major version number. target build minor version number. target build compile version number".

[0079] Step S2032: If the published application version information is greater than the latest built application version information, the published application version information is dynamically incremented, and the incremented version number is determined as the target built version number.

[0080] It should be noted that if the published application version information is greater than the latest built application version information, the published application version information is dynamically incremented, and the incremented version number is determined as the target built version number.

[0081] In the specific implementation, the main version number is compared first. If the main version number of the released application version information is greater than the main version number of the latest built application version information, the main version number of the released application version information is determined as the final target build main version number; then the minor version number is compared. If the minor version number of the released application version information is greater than the minor version number of the latest built application version information, the minor version number of the released application version information is determined as the final target build minor version number; finally, the compilation version number is compared. If the compilation version number of the released application version information is greater than the compilation version number of the latest built application version information, the current timestamp is determined as the final target build compilation version number. Then the target build version number is generated according to the rule of "V target build major version number. target build minor version number. target build compilation version number".

[0082] Step S204: Build an application image according to the target build version number.

[0083] It can be understood that after determining the target build version number, you can download the selected application branch source code, write the application version information into the version configuration file app-version.properties, and then copy the configuration file to the configuration file directory of the application source code; build and package the application image and push it to the image repository, and save the application version information and the corresponding relationship between the application image in the db.

[0084] In this embodiment, the application version information released by the production application is obtained from the application product package construction platform database; the application version information of the latest construction in the current branch of the git source code corresponding to the production application is obtained from the construction record; the size of the released application version information and the latest construction application version information are compared according to the major version number, minor version number and compilation version number, so that the target build version number can be determined more accurately, making the version number in the constructed application image more accurate, and avoiding the inaccuracy caused by manual modification of the version number.

[0085] Based on the first embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above description, and will not be described in detail later. Figure 3, step S30, the method for dynamically generating an application version number further includes steps S301 to S303:

[0086] Step S301, when pushing the application image, obtaining the version information when the application image is built from the product package information.

[0087] Step S302: Obtain the latest released application version number of the production application from the application product package building platform database.

[0088] Step S303: compare the version information of the application image when it is built with the latest application version number of the production application to obtain a comparison result.

[0089] It is understandable that in the push phase, the built application image is selected to push the product to production. At this time, the latest application version number of the production application of the push product and the version information when the application image is built are obtained. The latest application version number of the production application is obtained from the application product package construction platform database; the version information when the application image is built is obtained from the product package information. After that, the version information when the application image is built is verified with the latest application version number of the production application. If the application version is greater than the latest production version, the version of the pushed product application is used; if it is less than the latest production version, new version information is dynamically incremented based on the latest production release version.

[0090] In a feasible implementation, step S40 may include steps S401-S402:

[0091] Step S401: If the version information of the application image when it is constructed is greater than or equal to the latest application version number of the production application, the version information of the application image when it is constructed is determined as the target version number, and the application image is pushed.

[0092] It should be understood that if the version information when the application image is built is greater than or equal to the latest application version number of the production application, the version information when the application image is built is determined as the target version number. Download the pushed product image, export the downloaded application product image to archive it as a tar file, then unzip the tar and search for the application package; write the dynamically generated version information to the version configuration file app-version.properties and replace the version configuration file in the application package; dynamically generate a docker file, use the pushed image as the basic image, and copy the application package after replacing the version configuration file to the container; use the dynamically generated docker file to rebuild the application image and push it to the image warehouse, and save the latest product and version information to the db, and finally push the production product.

[0093] In a feasible implementation, step S401 may include steps S4011 to S4014:

[0094] Step S4011, if the major version number in the version information when the application image is constructed is greater than or equal to the major version number in the latest application version number released by the production application, then the major version number in the version information when the application image is constructed is determined as the target major version number.

[0095] Step S4012: If the minor version number in the version information when the application image is constructed is greater than or equal to the minor version number in the latest application version number released by the production application, the minor version number in the version information when the application image is constructed is determined as the target minor version number.

[0096] Step S4013: If the compilation version number in the version information when the application image is constructed is greater than or equal to the compilation version number in the latest released application version number of the production application, the compilation version number in the version information when the application image is constructed is determined as the target compilation version number.

[0097] Step S4014, generating a target version number according to the target major version number, the target minor version number and the target compiled version number.

[0098] It should be noted that the version number rule is: V major version number. Minor version number. Compiled version number, that is, the version number includes the major version number, the minor version number and the compiled version number. When comparing the size of the version number, the three parts can also be compared one by one. First, the major version number is compared. If the major version number in the version information when the application image is constructed is greater than or equal to the major version number in the latest application version number released by the production application, the major version number in the version information when the application image is constructed is determined as the target major version number; then the minor version number is compared. If the minor version number in the version information when the application image is constructed is greater than or equal to the minor version number in the latest application version number released by the production application, the minor version number in the version information when the application image is constructed is determined as the target minor version number; finally, the compiled version number is compared. If the compiled version number in the version information when the application image is constructed is greater than or equal to the compiled version number in the latest application version number released by the production application, the compiled version number in the version information when the application image is constructed is determined as the target compiled version number. Then generate the target version number according to the rule of "V target major version number. target minor version number. target compilation version number".

[0099] Step S402: If the version information of the application image when it is constructed is less than the latest application version number of the production application, the latest application version number of the production application is dynamically incremented to obtain the target version number, and the application version information in the last constructed source image is replaced with the target version number, and the replaced source image is pushed.

[0100] In a feasible implementation, step S402 may include steps S4021 to S4024:

[0101] Step S4021, if the major version number in the version information when the application image is built is smaller than the major version number in the latest application version number of the production application, the major version number in the latest application version number of the production application is determined as the target major version number.

[0102] Step S4022: If the minor version number in the version information when the application image is built is smaller than the minor version number in the latest application version number of the production application, the minor version number in the latest application version number of the production application is determined as the target minor version number.

[0103] Step S4023: If the compilation version number in the version information when the application image is constructed is smaller than the compilation version number in the latest application version number released by the production application, the current timestamp is determined as the target compilation version number.

[0104] Step S4024, generating a target version number according to the target major version number, the target minor version number and the target compiled version number.

[0105] It should be noted that the main version number is compared first. If the main version number in the version information when the application image is built is smaller than the main version number in the latest application version number released by the production application, the main version number in the latest application version number released by the production application is determined as the target main version number; then the minor version number is compared. If the minor version number in the version information when the application image is built is smaller than the minor version number in the latest application version number released by the production application, the minor version number in the latest application version number released by the production application is determined as the target minor version number; finally, the compilation version number is compared. If the compilation version number in the version information when the application image is built is smaller than the compilation version number in the latest application version number released by the production application, the current timestamp is determined as the target compilation version number. Then the target version number is generated according to the rule of "V target major version number. target minor version number. target compilation version number".

[0106] In this implementation, when pushing the application image, the version information when the application image is built is obtained from the product package information, and the currently latest released application version number of the production application is obtained from the application product package construction platform database. The version information when the application image is built and the currently latest released application version number of the production application are compared according to the major version number, minor version number and compilation version number, and the target version number is determined, so that the version number in the pushed product can be more accurate.

[0107] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the method for dynamically generating the application version number of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0108] This application also provides a device for dynamically generating an application version number. Figure 4 , the application version number dynamic generation device includes:

[0109] The version information collection module 10 is used to monitor the Kafka topic corresponding to the production application version release and collect the application version information released by the production application;

[0110] An application image building module 20, configured to build an application image based on the published application version information;

[0111] The version information comparison module 30 is used to compare the version information when the application image is built with the latest application version number of the production application when pushing the application image, and obtain a comparison result;

[0112] The target version determination module 40 is used to determine the target version number according to the comparison result, and push the product based on the target version number.

[0113] The application version number dynamic generation device provided by the present application adopts the application version number dynamic generation method in the above embodiment to solve the technical problem. Compared with the prior art, the application version number dynamic generation device provided by the present application has the same beneficial effects as the application version number dynamic generation method provided by the above embodiment, and other technical features in the application version number dynamic generation device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0114] The present application provides a device for dynamically generating an application version number, which includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for dynamically generating an application version number in the above-mentioned embodiment one.

[0115] Reference below Figure 5 , which shows a schematic diagram of the structure of a device for dynamically generating application version numbers suitable for implementing the embodiments of the present application. The device for dynamically generating application version numbers in the embodiments of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The application version number dynamic generation device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0116] like Figure 5 As shown, the application version number dynamic generation device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM: Read Only Memory) 1002 or the program loaded from the storage device 1003 to the random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the application version number dynamic generation device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the application version number dynamic generation device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an application version number dynamic generation device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.

[0117] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0118] The device for dynamically generating application version numbers provided by the present application adopts the method for dynamically generating application version numbers in the above embodiment, and can solve the technical problem of dynamically generating application version numbers. Compared with the prior art, the beneficial effects of the device for dynamically generating application version numbers provided by the present application are the same as the beneficial effects of the method for dynamically generating application version numbers provided by the above embodiment, and other technical features in the device for dynamically generating application version numbers are the same as the features disclosed in the method of the previous embodiment, and will not be described in detail here.

[0119] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0120] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0121] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, the computer-readable program instructions being used to execute the method for dynamically generating an application version number in the above-mentioned embodiment.

[0122] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0123] The computer-readable storage medium may be included in the device for dynamically generating application version numbers; or may exist independently without being assembled into the device for dynamically generating application version numbers.

[0124] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the application version number dynamic generation device, the application version number dynamic generation device: listens to the kafka topic corresponding to the production application version release, collects the application version information released by the production application; builds an application image based on the released application version information; when pushing the application image, compares the version information when the application image is built with the latest application version number currently released by the production application to obtain a comparison result; determines the target version number according to the comparison result, and pushes the product based on the target version number.

[0125] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0126] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0127] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0128] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned method for dynamically generating application version numbers, and can solve technical problems. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the method for dynamically generating application version numbers provided by the above-mentioned embodiments, and will not be elaborated here.

[0129] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned method for dynamically generating an application version number when executed by a processor.

[0130] The computer program product provided by this application can solve the technical problem. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the method for dynamically generating application version numbers provided by the above embodiment, which will not be described in detail here.

[0131] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A method for dynamically generating an application version number, characterized in that: The method includes: Monitor the Kafka topic corresponding to the production application version release, and collect the application version information released by the production application; Building an application image based on the published application version information; When pushing the application image, compare the version information when the application image is built with the latest application version number of the production application to obtain a comparison result; Determine the target version number according to the comparison result, and push the product based on the target version number; The step of determining the target version number according to the comparison result and pushing the product based on the target version number includes: If the major version number in the version information when the application image is constructed is greater than or equal to the major version number in the application version number currently released by the production application, the major version number in the version information when the application image is constructed is determined as the target major version number; If the minor version number in the version information when the application image is constructed is greater than or equal to the minor version number in the application version number currently released by the production application, the minor version number in the version information when the application image is constructed is determined as the target minor version number; If the compilation version number in the version information when the application image is constructed is greater than the compilation version number in the latest application version number released by the production application, the compilation version number in the version information when the application image is constructed is determined as the target compilation version number; Generate a target version number according to the target major version number, the target minor version number and the target compiled version number, and push the application image; If the major version number in the version information when the application image is built is smaller than the major version number in the latest application version number released by the production application, the major version number in the latest application version number released by the production application is determined as the target major version number; If the minor version number in the version information when the application image is built is smaller than the minor version number in the latest application version number of the production application, the minor version number in the latest application version number of the production application is determined as the target minor version number; If the compilation version number in the version information when the application image is built is less than or equal to the compilation version number in the latest application version number released by the production application, the current timestamp is determined as the target compilation version number; Generate a target version number according to the target major version number, the target minor version number and the target compiled version number, replace the application version information in the last built source image with the target version number, and push the replaced source image; The step of building an application image based on the published application version information includes: Obtain application version information released by production applications from the application product package building platform database; Obtain the latest application version information built in the current branch of the git source code corresponding to the production application from the build record; If the published application version information is less than or equal to the latest built application version information, then the latest built application version information is determined as the target build version number; If the published application version information is greater than the latest built application version information, dynamically incrementing the published application version information, and determining the incrementally generated version number as the target built version number; Build an application image according to the target build version number.

2. The method according to claim 1, characterized in that The step of comparing the version information when the application image is built with the latest application version number of the production application when pushing the application image to obtain the comparison result includes: When pushing the application image, obtaining version information when the application image is built from the product package information; Obtain the latest released application version number of the production application from the application package building platform database; Compare the version information when the application image is built with the latest application version number of the production application to obtain the comparison result.

3. A device for dynamically generating an application version number, characterized in that: The device for dynamically generating an application version number comprises: The version information collection module is used to monitor the Kafka topic corresponding to the production application version release and collect the application version information released by the production application; An application image building module, used to build an application image based on the published application version information; A version information comparison module is used to compare the version information when the application image is built with the latest application version number of the production application when pushing the application image, and obtain a comparison result; A target version determination module, used to determine a target version number according to the comparison result, and push a product based on the target version number; The target version determination module is further configured to determine the major version number in the version information when the application image is constructed as the target major version number if the major version number in the version information when the application image is constructed is greater than or equal to the major version number in the application version number currently released by the production application; The target version determination module is further configured to determine the minor version number in the version information when the application image is constructed as the target minor version number if the minor version number in the version information when the application image is constructed is greater than or equal to the minor version number in the application version number currently released by the production application; The target version determination module is further configured to determine the compilation version number in the version information when the application image is constructed as the target compilation version number if the compilation version number in the version information when the application image is constructed is greater than the compilation version number in the application version number currently released by the production application; generate a target version number according to the target major version number, the target minor version number and the target compilation version number, and push the application image; The target version determination module is further configured to determine the main version number in the latest application version number of the production application as the target main version number if the main version number in the version information when the application image is built is smaller than the main version number in the latest application version number of the production application; The target version determination module is further configured to determine the minor version number in the latest application version number of the production application as the target minor version number if the minor version number in the version information when the application image is built is smaller than the minor version number in the latest application version number of the production application; The target version determination module is further configured to determine the current timestamp as the target compilation version number if the compilation version number in the version information when the application image is constructed is less than or equal to the compilation version number in the application version number currently released by the production application; generate a target version number according to the target major version number, the target minor version number and the target compilation version number, replace the application version information in the source image built last time with the target version number, and push the replaced source image; The application image construction module is used to obtain the application version information released by the production application from the application product package construction platform database; obtain the latest built application version information in the current branch of the git source code corresponding to the production application from the construction record; if the released application version information is less than or equal to the latest built application version information, the latest built application version information is determined as the target build version number; if the released application version information is greater than the latest built application version information, the released application version information is dynamically incremented, and the incremented version number is determined as the target build version number; and the application image is constructed according to the target build version number.

4. A device for dynamically generating an application version number, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the method for dynamically generating an application version number according to any one of claims 1 to 2.

5. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the method for dynamically generating an application version number according to any one of claims 1 to 2 are implemented.