CN112306544A - Method for automatically generating version information, storage medium and server - Google Patents

Method for automatically generating version information, storage medium and server Download PDF

Info

Publication number
CN112306544A
CN112306544A CN201910684638.4A CN201910684638A CN112306544A CN 112306544 A CN112306544 A CN 112306544A CN 201910684638 A CN201910684638 A CN 201910684638A CN 112306544 A CN112306544 A CN 112306544A
Authority
CN
China
Prior art keywords
program
version information
version
version number
character
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910684638.4A
Other languages
Chinese (zh)
Inventor
包林玉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen TCL Digital Technology Co Ltd
Original Assignee
Shenzhen TCL Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen TCL Digital Technology Co Ltd filed Critical Shenzhen TCL Digital Technology Co Ltd
Priority to CN201910684638.4A priority Critical patent/CN112306544A/en
Publication of CN112306544A publication Critical patent/CN112306544A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Abstract

The invention discloses a method, a storage medium and a server for automatically generating version information, wherein the method comprises the following steps: receiving a program code of an application program submitted by a developer, and acquiring a program version number of the program code; acquiring a regulating value of a program version number, and calculating program version information of a program code according to the regulating value and the program version number; reading first version information of the latest version released by the application program, generating second version information of the application program according to the first version information and the program version information, and generating version information of the version to be released according to the second version information. According to the method, the version information of the application program is associated with the version information of the program code, and the version information of the application program can be automatically updated along with the modification of the program code, so that the version information corresponds to the program code, the problem that the version information is not modified when the program code is modified is avoided, the accuracy of upgrading the application program according to the version information is improved, and convenience is brought to a user.

Description

Method for automatically generating version information, storage medium and server
Technical Field
The present invention relates to the field of software development technologies, and in particular, to a method, a storage medium, and a server for automatically generating version information.
Background
With the continuous development of the internet, the variety and functions of application programs are increasing. And the application program needs to be continuously updated and iterated along with the market demand, the loopholes existing in the application program and other problems so as to meet the demand of the user. When the application program is updated and iterated, the application program at the user terminal is required to be updated. In the upgrading process, the difference between the newly acquired version information and the installed version information is generally compared, and whether the user side needs to upgrade the application program is determined according to the difference. However, the version information is a fixed value in the application code, and the developer is required to modify the version information manually, and the developer may modify the application code many times every day, so that the developer is required to modify the version information frequently, which increases the workload of the developer, and thus reduces the development efficiency of the application program.
In addition, in the actual development process, when a developer modifies a small problem of an application program, the version information may not be modified, or modification of the version information may be omitted when the application program is modified, which may cause the modified version information to be consistent with the version information before modification, and may cause a user side to be unable to upgrade the application program, so that the user may not experience the latest function of the application, and inconvenience may be brought to the user.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a method, a storage medium, and a server for automatically generating version information to associate the version information with the version information of a program code, so that the version information can be automatically increased without manual modification by a developer.
A method of automatically generating version information, comprising:
when a program code of an application program is received, acquiring a program version number of the program code;
acquiring a regulating value of the program version number, and calculating program version information of the program code according to the regulating value and the program version number;
reading first version information of a latest version released by the application program, generating second version information of the application program according to the first version information and the program version information, and generating version information of a version to be released according to the second version information.
The method for automatically generating version information, where the obtaining of the adjustment value of the program version number and the calculating of the program version information of the program code according to the adjustment value and the program version number specifically include:
acquiring a regulating value of the program version number, and calculating a first difference value between the program version number and the regulating value;
reading the difference character length of the first difference and the set character length of the program version information;
comparing the difference character length with the set character length;
and if the difference character length is equal to the set character length, taking the first difference as the program version information of the program code.
The method for automatically generating the version information, wherein the step of taking the adjustment value of the program version number and calculating the program version information of the program code according to the adjustment value and the program version number comprises the following steps:
if the difference character length is smaller than the set character length, adding a character 0 before the first character of the first difference to obtain an updated first difference, and acquiring the difference character length of the updated first difference;
and repeatedly executing the step of comparing the difference character length with the set character length until the difference character length is equal to the set character length or the updating times of the first difference reach preset times.
The method for automatically generating the version information is characterized in that the preset times are second differences between the difference character length and the set character length.
The method for automatically generating version information, where the obtaining of the adjustment value of the program version number and the calculating of the program version information of the program code according to the adjustment value and the program version number specifically include:
reading a first character of the program version number, and generating an adjusting value according to the first character;
and calculating the program version information of the program code according to the adjusting value and the program version number.
The method for automatically generating version information, where reading a first character of the program version number and generating an adjustment value according to the first character, specifically includes:
reading a first character of the program version number, and taking the first character as a first character of the regulating value;
supplementing a preset number of 0 characters after the first character to generate the adjustment value, wherein the character length of the adjustment value is equal to the character length of the program version number.
The method for automatically generating version information, where the reading of the first version information of the latest version already issued by the application program, and the generating of the second version information of the application program according to the first version information and the program version information, so as to generate the version information of the version to be issued according to the second version information, specifically includes:
reading first version information of a latest version released by the application program, extracting a major version number, a minor version number and a stage version number carried by the first version information, and generating third version information according to the major version number, the minor version number and the stage version number;
binding the third version information with the program version information to obtain second version information of the application program;
and acquiring the application name of the application program, and generating version information of the version to be released according to the application name and the second version information.
The method for automatically generating version information, where the binding the third version information with the program version information to generate the second version information of the application program specifically includes:
acquiring previous program version information of the program version information according to a time sequence, and comparing a second program version number corresponding to the previous program version information with a first program version number corresponding to the program version information;
if the first character of the first program version number is different from the first character of the second program version number, adjusting the stage version number of the third version information according to a preset rule, wherein the adjusted stage version number is larger than the stage version number before adjustment;
and binding the adjusted third version information with the program version information to obtain second version information of the application program.
The method for automatically generating version information, wherein after the reading of the first version information of the latest version already issued by the application program, and the generation of the second version information of the application program according to the first version information and the program version information, so as to generate the version information of the version to be issued according to the second version information, the method further comprises:
receiving a modification instruction for modifying version information of the release version;
and if the modification instruction is received, modifying the version information of the version to be issued according to the modification instruction.
A computer readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement steps in a method of automatically generating version information as described in any above.
A server, comprising: a processor, a memory, and a communication bus; the memory has stored thereon a computer readable program executable by the processor;
the communication bus realizes connection communication between the processor and the memory;
the processor, when executing the computer readable program, implements the steps in the method of automatically generating version information as described in any one of the above.
Compared with the prior art, the embodiment of the invention has the following advantages:
according to the method for automatically generating the version information, provided by the embodiment of the invention, when a program code of an application program is received, a program version number distributed by the program code is acquired, and the program version information of the program code is calculated according to the program version number and a corresponding adjusting value; and then generating second version information of the application program according to the first version information of the latest version already issued by the application program and the program version information, so as to generate version information of the version to be issued according to the second version information. Therefore, in the implementation manner of the present invention, when an application program is received, the version control system automatically allocates the program version number to the program code, and the program version number automatically increases with the increase of the number of times of submitting the program code, so that the second version number obtained according to the program version information and the first version information also automatically increases, and therefore, developers do not need to manually modify the version information corresponding to the program code, which can reduce the workload of the developers and improve the development efficiency on the one hand, and can reduce the problem that the version information of the version to be released is the same as the version information of the previous version due to the manual modification of the developers on the other hand, so that a user side can accurately obtain the upgrade file of the application program according to the version information, and improve the success rate of upgrading the application program.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to support the embodiments or the prior art descriptions will be briefly introduced below, it is obvious that the drawings in the following description are only some embodiments described in the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a block diagram of an exemplary application scenario in an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for automatically generating version information according to an embodiment of the present invention;
fig. 3 is a schematic flow chart illustrating generation of second version information in a method for automatically generating version information according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating step S20 of a method for automatically generating version information according to an embodiment of the present invention;
FIG. 5 is a schematic flow chart illustrating a procedure of obtaining adjustment values in a method for automatically generating version information according to an embodiment of the present invention;
fig. 6 is a schematic flowchart of step M10 in the adjustment value obtaining process in a method for automatically generating version information according to an embodiment of the present invention;
fig. 7 is a flowchart illustrating step S30 in a method for automatically generating version information according to an embodiment of the present invention;
FIG. 8 is a flowchart illustrating a process of generating version information of a release version according to second version information in a method of automatically generating version information according to an embodiment of the present invention;
FIG. 9 is a flowchart illustrating step S32 of a method for automatically generating version information according to an embodiment of the present invention
Fig. 10 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The inventor finds that the existing application program upgrading is generally realized by comparing the difference between the version information of the upgraded version and the installed version information and determining whether the user side needs to upgrade the application program according to the difference. However, the version information is a fixed value in the application code, and the developer is required to modify the version information manually, and the developer may modify the application code many times every day, so that the developer is required to modify the version information frequently, which increases the workload of the developer, and thus reduces the development efficiency of the application program. Meanwhile, in the actual development process, when a developer modifies a small problem of the application program, the version information is not modified, or modification of the version information is omitted when the application program is modified, so that the modified version information is consistent with the version information before modification, and the user side cannot upgrade the application program, so that the user cannot experience the latest function of the application, and inconvenience is brought to the user.
In order to solve the above problem, in the embodiment of the present invention, when a program code of an application program is received, a program version number of the program code may be obtained, and program version information of the program code may be calculated according to the program version number and a corresponding adjustment value; and then generating second version information of the application program according to the first version information of the latest version already issued by the application program and the program version information, so as to generate version information of the version to be issued according to the second version information. Therefore, in the implementation manner of the present invention, when an application program is received, the version control system automatically allocates the program version number to the program code, and the program version number automatically increases with the increase of the number of times of submitting the program code, so that the second version number obtained according to the program version information and the first version information also automatically increases, and therefore, developers do not need to manually modify the version information corresponding to the program code, which can reduce the workload of the developers and improve the development efficiency on the one hand, and can reduce the problem that the version information of the version to be released is the same as the version information of the previous version due to the manual modification of the developers on the other hand, so that a user side can accurately obtain the upgrade file of the application program according to the version information, and improve the success rate of upgrading the application program.
For example, embodiments of the present invention may be applied to the scenario shown in FIG. 1. In this scenario, first, the user side 101 may submit the program code to the server 102, and after receiving the program code, the server may obtain a program version number allocated to the program code by a version control System (SVN), extract first version information of a latest version issued by the application program, determine a version number according to the first version information, determine program version information of the program code according to the program version number, and associate the version number with the program version information to obtain version information corresponding to the program code.
It should be noted that the above application scenarios are only presented to facilitate understanding of the present invention, and the embodiments of the present invention are not limited in any way in this respect. Rather, embodiments of the present invention may be applied to any scenario where applicable.
Various non-limiting embodiments of the present invention are described in detail below with reference to the accompanying drawings.
The present embodiment provides a method for automatically generating version information, as shown in fig. 2, the method may include the following steps:
and S10, when the program code of the application program is received, acquiring the program version number of the program code.
In this embodiment, the program version number is assigned to the program code by a version control System (SVN), the version control system is an open source code version control system, under the version control system, multiple developers of the application program can edit and modify the same code, and the developers need to submit the program code after editing and modifying the code each time. In this embodiment, the program code may be the program code of the application program submitted by performing a code submission operation after a developer modifies the code of the application program. In addition, when the program version number is an application program submitted by a developer, the version control system automatically allocates the version number to the application program, and the program version number automatically increases along with the increase of the submission times. In this embodiment, the program version number may be in the form of a number, for example, the program version number is 43452.
And S20, acquiring the adjusting value of the program version number, and calculating the program version information of the program code according to the adjusting value and the program version number.
In this embodiment, the adjustment value is used to adjust the program version number, and the adjustment value may be preset or determined according to the first character of the program version number and the character length of the program version number, where the adjustment value may be equal to the first character of the program version number plus the character length of the program version number minus one zero character. For example, the program version number is 43452, the first character of the program version number is 4, the character length of the program version number is 5, the number of 0 characters to be added is equal to the character length of the program version number minus one, that is, the number of 0 characters to be added is 4, so that the adjustment value determined according to the first character and the character length may be 40000. In addition, the program version information is identification information which is obtained by calculation according to the program version number and the adjustment value and is used for representing the program version, each submitted program code corresponds to one version information, and the program code is identified through the version information. In an implementation manner of the embodiment, the program version information is a difference between a program version number and an adjustment value, for example, the program version number is 43452, the adjustment value is 40000, and then the program version information is 43452-.
S30, reading the first version information of the latest version released by the application program, and generating the second version information of the application program according to the first version information and the program version information, so as to generate the version information of the version to be released according to the second version information.
In this embodiment, the first version information is version information of a latest version of released versions of the application program, and the first version information carries a major version number, a minor version number, a phase version number, an application program name, and program version information of the application program. The major version number is used to identify a change of a functional module of the application program, that is, when the functional module of the application program has a large change, the change needs to be modified, for example, a plurality of functional modules are added or the overall architecture changes, and the major version number needs to be adjusted. The sub-version number is used for identifying function change, that is, when the function of the application program changes, the function needs to be modified, for example, functions of controlling the authority, adding a custom view and the like are added, and the sub-version number needs to be adjusted. The phase version number is used for identifying bug fixes or detail changes, that is, the phase version number needs to be modified when the application program performs bug fixes or detail changes, for example, when a flash back bug of the application program is fixed, the phase version number needs to be adjusted.
Further, the second version information is an internal version number, and the second version information includes a main version number, a sub-version number, a stage version number, and program version information, where the main version number, the sub-version number, and the stage version number are determined according to the first version information, and the program version information is determined according to the program version number. In this embodiment, the second version information is an int data structure, and the number of bits of the second version information is 9, that is, the second version information includes 9 digits, where, among the 9 digits of the second version information, the first 5 digits are a major version number, a minor version number and a stage version number, and the last 4 digits are program version information. For example, if the second version information is 402073452, 40207 is the main version number, the sub-version number, and the phase version number according to the first version information, and 3452 is the program version information. The version information of the version to be released is determined according to the second version information and the name of the application program, where the version information of the version to be released may include an application name _ < main version number > < stage version number > < sub-version number > < program version information >. For example, the version information of the version to be released is source application _4.07.02.3452, where the source application is an application name, 4 is a motherboard number, 07 is a stage version number, 02 is a sub-version number, and 3452 is program version information.
Next, each step in this embodiment will be specifically described.
In an implementation manner of this embodiment, as shown in fig. 3 and 4, the step S20 of obtaining an adjustment value of the program version number, and calculating the program version information of the program code according to the adjustment value and the program version number may include the following steps:
s21, obtaining a regulating value of the program version number, and calculating a first difference value between the program version number and the regulating value;
s22, reading the difference character length of the first difference and the set character length of the program version information;
and S23, comparing the difference character length with the set character length.
And S24, if the difference character length is equal to the set character length, taking the first difference as the program version information of the program code.
Specifically, the first difference is a numerical difference obtained by subtracting a numerical value of the program version number from a numerical value of the adjustment value, and the difference character length refers to a numerical digit of the first difference. For example, the program version number is 43452, the adjustment value is 40000, the first difference is 43452-. The set character length may be preset and used to determine whether the first difference may be used as a basis for program version information, and the set character length is greater than or equal to the difference character length, where the first difference may be used as the program version information when the difference character length of the first difference is equal to the set character length, and the first difference may not be used as the program version information when the difference character length of the first difference is less than the set character length.
Further, in this embodiment, the set character length is a character length of the program version information, and comparing the difference character length with the set character length may be understood as comparing the difference character length with the character length of the program version information to determine whether the first difference is available as the program version information. And when the difference character length is equal to the set character length, determining that the first difference can be used as program version information, and at this time, setting the first difference as the program version information of the program code.
In addition, since the difference character length is less than or equal to the preset character length, when the difference character length is compared with the preset character length, there may be a case where the difference character length is less than the preset character length, and thus, when the difference character length is compared with the set character length, the case where the difference character length is less than the preset character length may also be included. Thus, in an implementation manner of this embodiment, the step 20 of obtaining an adjustment value of the program version number, and calculating the program version information of the program code according to the adjustment value and the program version number may include the following steps:
s25, if the difference character length is smaller than the set character length, adding a character 0 before the first character of the first difference to obtain an updated first difference, and acquiring the difference character length of the updated first difference;
s26, repeating the step of comparing the difference character length with the set character length until the difference character length is equal to the set character length or the number of updates of the first difference reaches a preset number.
Specifically, the difference character length being smaller than the set character length indicates that the number of bits of the first difference is smaller than the number of bits of the program version information, and in the second version information, the number of bits of the program version information is fixed, so that when the difference character length is smaller than the set character length, the first difference needs to be complemented, so that the difference character length of the complemented first difference is equal to the set character length. In this embodiment, when the first difference value is complemented, a 0 character is complemented, the 0 character is complemented before the first character of the first difference value, and one bit of 0 is complemented before the first character of the first difference value each time to update the first difference value. For example, if the first difference is 23, the first difference is updated by supplementing a bit 0 before the first character of the first difference, and the updated first difference is 023. And after updating the first difference, acquiring the difference character length of the updated first difference again, and determining whether the updating of the first difference is finished by judging whether the difference character length is equal to the set character length.
Therefore, when judging whether the updating of the first difference is finished or not, besides judging whether the difference character length of the updated first difference is equal to the set character length or not, the updating times of the first difference can be judged to reach the preset times, so that the first difference updating error caused by the error of the set character length can be avoided, for example, the first difference updating enters the dead loop because the error of the set character length is set to be infinite. Further, the preset number of times may be preset, for example, 3 times; the difference character length of the first difference and the set character length of the program version information may be calculated, for example, the difference character length is 2, the set character length is 4, and the preset number of times is the difference between the set character length and the difference character length, that is, the preset number of times is 2-4-2. Meanwhile, in order to determine whether the update frequency of the first difference reaches the preset frequency, the update frequency of the first difference may be recorded by a counter when the first difference is updated, and when the update frequency of the counter reaches the preset frequency, it is described that the update frequency of the first difference reaches the preset frequency.
Further, in an implementation manner of this embodiment, as shown in fig. 5, the process of obtaining the adjustment value of the program version number may include the following steps:
m10, reading a first character of the program version number, and generating an adjusting value according to the first character;
m20, calculating program version information of the program code according to the adjusting value and the program version number.
Specifically, the first character is a character in the program version number that is first in the order from front to back, and when an adjustment value is generated according to the first character, the first character is used as the first character of the adjustment value, and the adjustment value is generated according to the character length of the program version number. After the adjustment value is generated, a difference between the program version number and the adjustment value is calculated to obtain program version information, for example, the program version number is 43452, the adjustment value is 40000, and the program version information is 3452 ═ 43452-. In addition, the process of acquiring the program version information has been described in the foregoing implementation manner, and is not described here again.
Furthermore, in one implementation manner of this embodiment, as shown in fig. 6, the step M10 of reading a first character of the program version number and generating an adjustment value according to the first character may include the following steps:
m11, reading a first character of the program version number, and taking the first character as a first character of the adjusting value;
m12, supplementing a preset number of 0 characters after the first character to generate the adjustment value, wherein the character length of the adjustment value is equal to the character length of the program version number.
Specifically, the preset number may be determined according to a character length of an adjustment value and a character length of the program version number, and the character length of the adjustment value is equal to the character length of the program version number, and then the preset number may be equal to the set character length of the program version number minus the first character length. The first character of the program version number occupies a length of 1 character, and the preset number may be equal to the set length of the program version number minus one. For example, if the program version number is 43452, then the first character of the program version number is 4, and correspondingly, the first character of the adjustment value is 4, and the length of the characters of the program version number is 5, then the predetermined number is 4-5-1, so that 4 0's are added after 4 to obtain the adjustment value 4000.
Further, in an implementation manner of this embodiment, as shown in fig. 7 and 8, the step S30 of reading the first version information of the latest version that the application program has issued, and generating the second version information of the application program according to the first version information and the program version information to generate the version information of the version to be issued according to the second version information may include the following steps:
s31, reading the first version information of the latest version released by the application program, extracting a main version number, a sub-version number and a stage version number carried by the first version information, and generating third version information according to the main version number, the sub-version number and the stage version number;
s32, binding the third version information with the program version information to obtain second version information of the application program;
and S33, acquiring the application name of the application program, and generating version information of the version to be released according to the application name and the second version information.
Specifically, the third version information is determined according to the first version information, and preferably, the third version information includes 5-bit numbers, a first bit of the 5-bit numbers is a major version number, second and third bits are minor version numbers, and fourth and fifth bits are phase version numbers, for example, the third version information is 40207, and includes a major version number 1, a minor version number 02, and a phase version number 07. After the first version information is acquired, the major version number, the minor version number and the stage version number are selected according to the arrangement rule of the first version information, and the third version information is generated according to the selected major version number, the selected minor version number and the selected stage version number. The first version information is a release version number, that is, the format of the first version information is < application name > _< main version number > < stage version number > < sub-version number > < program version information >, so that the < main version number > < stage version number > < sub-version number > is extracted from the first version information, and the < main version number > < stage version number > < sub-version number > is arranged according to the form of the < main version number > < sub-version number > to obtain third version information. For example, if the first version information is the source application _4.07.02.3452, the obtained third version information is 4.02.07.
Further, since the program version information is calculated according to the program version number and the adjustment value corresponding to the program version number, when the first character of the program version number is changed, there is a problem that the program version information obtained according to the program version number is backed up. For example, when the program version number is increased from 49999 to 50000, the version information of the program calculated from the adjustment value is 0000, the second version information determined from the program version information and the third version information is 402070000, and the second version information corresponding to 49999 is 402079999, which causes a problem of version reversion. Therefore, when determining the second version information according to the third version information and the program version information, it may be determined whether the first character of the program version number corresponding to the program version information is the same as the first character of the program version number corresponding to the previous program version information. Accordingly, in an implementation manner of this embodiment, as shown in fig. 9, the step S32 of binding the third version information with the program version information to generate the second version information of the application program may include the following steps:
s321, acquiring previous program version information of the program version information according to a time sequence, and comparing a second program version number corresponding to the previous program version information with a first program version number corresponding to the program version information;
s322, if the first character of the first program version number is different from the first character of the second program version number, adjusting the stage version number of the third version information according to a preset rule, wherein the adjusted stage version number is larger than the stage version number before adjustment;
and S323, binding the adjusted third version information with the program version information to obtain second version information of the application program.
Specifically, the chronological order refers to an order of the program code submission times corresponding to the program version numbers. For example, the first program version number corresponding to the program version information is 50000, the second program version number corresponding to the previous program version information is 49999, then the first character of the first program version number is 5, the first character of the second program version number is 4, then 5 and 4 are compared, 5 is different from 4, so that the phase version number of the third version information needs to be adjusted according to a preset rule, so that the adjusted phase version number is greater than the phase version number before adjustment, where the preset rule is a preset rule for adjusting the third version information. In this embodiment, the preset rule is preferably that, when the first character of the first program version number is different from the first character of the second program version number, the phase version number is adjusted according to a difference between the first character of the first program version number and the first character of the second program version number. For example, if the difference between the first character of the first program version number and the first character of the second program version number is 1, the phase version number carried by the third version information is increased by 1, for example, the third version information is 402070000, and the adjusted third version information is 402080000.
In addition, after the application name of the application program is obtained, the main version number, the sub-version number and the stage version number may be selected from the second version information, then the program version information is obtained, and the application name, the main version number, the sub-version number, the stage version number and the program version information are arranged according to the form of < application name > _< main version number > < stage version number > < sub-version number > < program version information >, so as to obtain the version information to be released. When the major version number, the minor version number, and the stage version number are selected from the second version information, a first character set formed by first characters, a second character set formed by second and third characters, and a third character set formed by fourth and fifth characters may be selected from the second version information, where the first character set is the major version number, the second character set is the minor version number, and the third character set is the stage version number.
In addition, after the version information of the version to be issued is generated, a modification instruction sent by a user may be received, where the modification instruction is used to modify one or more of the main version number, the sub-version number, or the phase version number. Correspondingly, the reading the first version information of the latest version already issued by the application program, and generating the second version information of the application program according to the first version information and the program version information, so that after generating the version information of the version to be issued according to the second version information, the method may include:
receiving a modification instruction sent by a user;
and if the modification instruction is received, modifying the version information of the version to be issued according to the modification instruction.
Specifically, the modification instruction may modify one or more of a major version number, a minor version number, or a phase version number in the version information of the to-be-issued version. For example, if the modification instruction is to modify the major version number, the major version number is modified according to the modification instruction, e.g., if the version information of the release version generated according to the second version information and the application name is 402073452, and if the modification instruction is to modify 4 to 5, then the pair will be 402073452 to 502073452. Of course, in practical applications, the priority of the major version number may be set to be greater than that of the minor version number, and the priority of the minor version number may be set to be greater than that of the phase version number, and when the major version number is modified, the minor version number and the phase version number are backed off to 0, and when the minor version number is modified, the phase version number is backed off to 0. For example, if the version information of the release version generated from the second version information and the application name is 402073452 and the modification instruction is to modify 4 to 5, 402073452 is modified to 500003452.
Based on the method for automatically generating version information, the present invention provides a computer-readable storage medium, which stores one or more programs that can be executed by one or more processors to implement the steps in the method for automatically generating version information according to the above embodiment. For example, the computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
The present invention also provides a server, as shown in fig. 10, which includes at least one processor (processor) 20; a display screen 21; and a memory (memory)22, and may further include a communication Interface (Communications Interface)23 and a bus 24. The processor 20, the display 21, the memory 22 and the communication interface 23 can communicate with each other through the bus 24. The display screen 21 is configured to display a user guidance interface preset in the initial setting mode. The communication interface 23 may transmit information. The processor 20 may call logic instructions in the memory 22 to perform the methods in the embodiments described above.
Furthermore, the logic instructions in the memory 22 may be implemented in software functional units and stored in a computer readable storage medium when sold or used as a stand-alone product.
The memory 22, which is a computer-readable storage medium, may be configured to store a software program, a computer-executable program, such as program instructions or modules corresponding to the methods in the embodiments of the present disclosure. The processor 20 executes the functional application and data processing, i.e. implements the method in the above-described embodiments, by executing the software program, instructions or modules stored in the memory 22.
The memory 22 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal device, and the like. Further, the memory 22 may include a high speed random access memory and may also include a non-volatile memory. For example, a variety of media that can store program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, may also be transient storage media.
In addition, the specific processes loaded and executed by the instruction processors in the storage medium and the server are described in detail in the method, and are not stated herein.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is only limited by the appended claims
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (11)

1. A method for automatically generating version information, comprising:
when a program code of an application program is received, acquiring a program version number of the program code;
acquiring a regulating value of the program version number, and calculating program version information of the program code according to the regulating value and the program version number;
reading first version information of a latest version released by the application program, generating second version information of the application program according to the first version information and the program version information, and generating version information of a version to be released according to the second version information.
2. The method according to claim 1, wherein the obtaining of the adjustment value of the program version number and the calculating of the program version information of the program code according to the adjustment value and the program version number specifically include:
acquiring a regulating value of the program version number, and calculating a first difference value between the program version number and the regulating value;
reading the difference character length of the first difference and the set character length of the program version information;
comparing the difference character length with the set character length;
and if the difference character length is equal to the set character length, taking the first difference as the program version information of the program code.
3. The method of claim 2, wherein the step of calculating the program version information of the program code according to the adjustment value and the program version number by taking the adjustment value of the program version number comprises:
if the difference character length is smaller than the set character length, adding a character 0 before the first character of the first difference to obtain an updated first difference, and acquiring the difference character length of the updated first difference;
and repeatedly executing the step of comparing the difference character length with the set character length until the difference character length is equal to the set character length or the updating times of the first difference reach preset times.
4. The method of claim 3, wherein the predetermined number of times is a second difference between the difference character length and the set character length.
5. The method according to any one of claims 1 to 4, wherein the obtaining of the adjustment value of the program version number and the calculating of the program version information of the program code according to the adjustment value and the program version number specifically include:
reading a first character of the program version number, and generating an adjusting value according to the first character;
and calculating the program version information of the program code according to the adjusting value and the program version number.
6. The method according to claim 5, wherein the reading of a first character of the program version number and the generation of the adjustment value according to the first character specifically include:
reading a first character of the program version number, and taking the first character as a first character of the regulating value;
supplementing a preset number of 0 characters after the first character to generate the adjustment value, wherein the character length of the adjustment value is equal to the character length of the program version number.
7. The method according to any one of claims 1 to 4, wherein the reading of the first version information of the latest version that has been released by the application program, and the generating of the second version information of the application program according to the first version information and the program version information, so as to generate the version information of the version to be released according to the second version information, specifically includes:
reading first version information of a latest version released by the application program, extracting a major version number, a minor version number and a stage version number carried by the first version information, and generating third version information according to the major version number, the minor version number and the stage version number;
binding the third version information with the program version information to obtain second version information of the application program;
and acquiring the application name of the application program, and generating version information of the version to be released according to the application name and the second version information.
8. The method for automatically generating version information according to claim 7, wherein the binding the third version information with the program version information to generate the second version information of the application program specifically comprises:
acquiring previous program version information of the program version information according to a time sequence, and comparing a second program version number corresponding to the previous program version information with a first program version number corresponding to the program version information;
if the first character of the first program version number is different from the first character of the second program version number, adjusting the stage version number of the third version information according to a preset rule, wherein the adjusted stage version number is larger than the stage version number before adjustment;
and binding the adjusted third version information with the program version information to obtain second version information of the application program.
9. The method for automatically generating version information according to any one of claims 1 to 4, wherein after the reading of the first version information of the latest version already issued by the application program and the generation of the second version information of the application program according to the first version information and the program version information to generate the version information of the version to be issued according to the second version information, the method further comprises:
receiving a modification instruction for modifying version information of the release version;
and if the modification instruction is received, modifying the version information of the version to be issued according to the modification instruction.
10. A computer-readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to perform the steps in the method of automatically generating version information according to any one of claims 1-9.
11. A server, comprising: a processor, a memory, and a communication bus; the memory has stored thereon a computer readable program executable by the processor;
the communication bus realizes connection communication between the processor and the memory;
the processor, when executing the computer readable program, implements the steps in the method of automatically generating version information according to any one of claims 1-9.
CN201910684638.4A 2019-07-26 2019-07-26 Method for automatically generating version information, storage medium and server Pending CN112306544A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910684638.4A CN112306544A (en) 2019-07-26 2019-07-26 Method for automatically generating version information, storage medium and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910684638.4A CN112306544A (en) 2019-07-26 2019-07-26 Method for automatically generating version information, storage medium and server

Publications (1)

Publication Number Publication Date
CN112306544A true CN112306544A (en) 2021-02-02

Family

ID=74330001

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910684638.4A Pending CN112306544A (en) 2019-07-26 2019-07-26 Method for automatically generating version information, storage medium and server

Country Status (1)

Country Link
CN (1) CN112306544A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120221538A1 (en) * 2011-02-28 2012-08-30 International Business Machines Corporation Optimistic, version number based concurrency control for index structures with atomic, non-versioned pointer updates
CN105426206A (en) * 2015-11-12 2016-03-23 深圳国微技术有限公司 Control method and control device for version information
CN106843935A (en) * 2016-12-29 2017-06-13 广州华多网络科技有限公司 A kind of method and system for automatically updating static file version number
WO2017185649A1 (en) * 2016-04-26 2017-11-02 乐视控股(北京)有限公司 Document release method, device, and electronic apparatus
CN109445839A (en) * 2018-09-25 2019-03-08 平安普惠企业管理有限公司 A kind of module management packet dissemination method, device and terminal device
CN109961230A (en) * 2019-03-28 2019-07-02 金瓜子科技发展(北京)有限公司 A kind of configuration method of index, device, storage medium and electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120221538A1 (en) * 2011-02-28 2012-08-30 International Business Machines Corporation Optimistic, version number based concurrency control for index structures with atomic, non-versioned pointer updates
CN105426206A (en) * 2015-11-12 2016-03-23 深圳国微技术有限公司 Control method and control device for version information
WO2017185649A1 (en) * 2016-04-26 2017-11-02 乐视控股(北京)有限公司 Document release method, device, and electronic apparatus
CN106843935A (en) * 2016-12-29 2017-06-13 广州华多网络科技有限公司 A kind of method and system for automatically updating static file version number
CN109445839A (en) * 2018-09-25 2019-03-08 平安普惠企业管理有限公司 A kind of module management packet dissemination method, device and terminal device
CN109961230A (en) * 2019-03-28 2019-07-02 金瓜子科技发展(北京)有限公司 A kind of configuration method of index, device, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
US9081640B2 (en) Apparatus, method and medium for calculating an update order on a service level objective
CN108388515B (en) Test data generation method, device, equipment and computer readable storage medium
CN107145359A (en) A kind of BMC changes the optimization method of BIOS option
CN110599341A (en) Transaction calling method and system
CN111414189A (en) Method and device for determining version compatibility
CN110096354B (en) Cloning method and device for application
CN112306544A (en) Method for automatically generating version information, storage medium and server
EP3346642A1 (en) Method and device for managing network element model
CN110737455A (en) Firmware updating method and device and electronic equipment
CN113535206B (en) Multi-version code upgrading method and system
CN110968351A (en) BIOS configuration method and device
US11507367B2 (en) Firmware update method and firmware update system thereof
CN106598687B (en) Script preheating method and device
CN105700906B (en) Optical module software upgrading method, related equipment and system
US10579397B2 (en) Machine readable instructions backward compatibility
CN110618824B (en) Software upgrading method, device, medium and equipment
CN113312412A (en) Statistical data acquisition method and device, electronic equipment and storage medium
KR101839607B1 (en) User terminal and service server for processing security of the user terminal
CN111008018A (en) CAN signal unpacking processing method and system
CN109542598B (en) Timed task management method and device
EP3842932B1 (en) Firmware update method and firmware update system thereof
CN115480745B (en) Code generation method and device based on configuration file
CN106528183B (en) Method and device for creating control and computer program
CN114816465A (en) Software updating method and device for vehicle, storage medium, electronic equipment and vehicle
CN114546476A (en) Firmware parameter configuration method and device, baseboard management controller and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination