CN113656050B - Method and apparatus for generating version number - Google Patents

Method and apparatus for generating version number Download PDF

Info

Publication number
CN113656050B
CN113656050B CN202010397398.2A CN202010397398A CN113656050B CN 113656050 B CN113656050 B CN 113656050B CN 202010397398 A CN202010397398 A CN 202010397398A CN 113656050 B CN113656050 B CN 113656050B
Authority
CN
China
Prior art keywords
version number
development stage
new
updating
revision
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.)
Active
Application number
CN202010397398.2A
Other languages
Chinese (zh)
Other versions
CN113656050A (en
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.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202010397398.2A priority Critical patent/CN113656050B/en
Publication of CN113656050A publication Critical patent/CN113656050A/en
Application granted granted Critical
Publication of CN113656050B publication Critical patent/CN113656050B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application discloses a method and a device for generating a version number. One embodiment of the method comprises the following steps: acquiring development stage information and a current version number; in response to detecting an update of the object code package, updating the current version number in a manner matching the development stage information to generate a new version number; and establishing a corresponding relation between the new version number and the updated object code packet. The embodiment realizes that the version number of the updated code package is automatically updated according to the mode matched with the development stage information, avoids efficiency loss caused by manual participation after each version update, and reduces error probability. When the updating mode is changed, only version number updating logic matched with the development stage information is required to be rewritten, so that the development cost of great changes is saved, and the development efficiency is improved.

Description

Method and apparatus for generating version number
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method and a device for generating version numbers.
Background
With the rapid development of mobile internet technology, the development and iteration speed of Application (APP) are also gradually accelerated. In the version iteration process of the application, modification and management of the version number have an important effect on the version iteration. The related approach is typically that the technician refers to the document check modification rules each time the version number is modified, and then manually modifies it.
Disclosure of Invention
The embodiment of the application provides a method and a device for generating a version number.
In a first aspect, an embodiment of the present application provides a method for generating a version number, the method including: acquiring development stage information and a current version number; in response to detecting the update of the object code package, updating the current version number in a manner matching the development stage information to generate a new version number; and establishing a corresponding relation between the new version number and the updated object code package.
In some embodiments, the development stage information includes information characterizing a development stage, and the current version number includes a revision number. The updating the current version number in a manner matched with the development stage information to generate a new version number includes: the revision number is incremented to generate a new revision number as the new version number.
In some embodiments, the development stage information includes information characterizing entry into a gray scale test stage, and the current version number further includes a minor version number. The updating the current version number in a manner matched with the development stage information to generate a new version number includes: resetting the revision number as a revision number of the new version number based on the minor version number; a tag corresponding to the new version number entering the gray test phase is generated.
In some embodiments, the development stage information includes information characterizing a gray scale test stage. The updating the current version number in a manner matched with the development stage information to generate a new version number includes: the revision number is incremented by a preset increment to generate a new revision number as a new version number.
In some embodiments, the development stage information includes information characterizing entry into the release stage, and the current version number further includes a master version number and an application profile version number. The updating the current version number in a manner matched with the development stage information to generate a new version number includes: incrementing the revision number to generate a new component update number as the revision number of the new version number; updating the main version number of the new version number and the version number of the application program configuration file to be consistent with the minor version number of the current version number; a tag corresponding to the new version number entering the release phase is generated.
In some embodiments, the development stage information includes information characterizing entry into a next version development stage. The updating the current version number in a manner matched with the development stage information to generate a new version number includes: acquiring a next version number; pulling a development branch according to the next version number; updating the main version number of the new version number to be consistent with the auxiliary version number of the current version number; updating the minor version number of the new version number to be consistent with the minor version number of the next version number; based on the updated minor version information, the revision number is reset as the revision number of the new version number.
In some embodiments, the method further comprises: submitting the updated object code package to a local warehouse and a corresponding remote warehouse; and setting the development branch to which the updated target code packet belongs as a protection branch and a default branch.
In a second aspect, an embodiment of the present application provides an apparatus for generating a version number, including: an acquisition unit configured to acquire development stage information and a current version number; an updating unit configured to update the current version number in a manner matching the development stage information to generate a new version number in response to detecting the update of the object code package; and the association unit is configured to establish a corresponding relation between the new version number and the updated object code package.
In some embodiments, the development stage information includes information characterizing a development stage, and the current version number includes a revision number. The updating unit is further configured to: the revision number is incremented to generate a new revision number as the new version number.
In some embodiments, the development stage information includes information characterizing entry into a gray scale test stage, and the current version number further includes a minor version number. The updating unit includes: a first reset module configured to reset the revision number as a revision number of the new version number based on the minor version number; a first generation module configured to generate a tag corresponding to a new version number entering a gray test phase.
In some embodiments, the development stage information includes information characterizing a gray scale test stage. The updating unit is further configured to: the revision number is incremented by a preset increment to generate a new revision number as a new version number.
In some embodiments, the development stage information includes information characterizing entry into the release stage, and the current version number further includes a master version number and an application profile version number. The updating unit includes: an incrementing module configured to increment the revision number to generate a new component update number as a revision number of the new version number; a first updating module configured to update the major version number of the new version number and the application profile version number to be consistent with the minor version number of the current version number; and a second generation module configured to generate a tag corresponding to the new version number entering the release phase.
In some embodiments, the development stage information includes information characterizing entry into a next version development stage. The updating unit includes: an acquisition module configured to acquire a next version number; a pull module configured to pull the development branch according to the next version number; a second updating module configured to update the major version number of the new version number to be consistent with the minor version number of the current version number; a third updating module configured to update the minor version number of the new version number to be consistent with the minor version number of the next version number; and a second resetting module configured to reset the revision number as a revision number of the new version number based on the updated minor version information.
In some embodiments, the apparatus further comprises: a submitting unit configured to submit the updated object code package to a local repository and a corresponding remote repository; and the setting unit is configured to set the development branch to which the updated target code packet belongs as a protection branch and a default branch.
In a third aspect, an embodiment of the present application provides a terminal, including: one or more processors; a storage device having one or more programs stored thereon; the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method as described in any of the implementations of the first aspect.
In a fourth aspect, embodiments of the present application provide a computer readable medium having stored thereon a computer program which, when executed by a processor, implements a method as described in any of the implementations of the first aspect.
The method and the device for generating the version number provided by the embodiment of the application are characterized in that the development stage information and the current version number are acquired first. Then, in response to detecting the update of the object code package, the current version number is updated in a manner that matches the development stage information to generate a new version number. And finally, establishing a corresponding relation between the new version number and the updated object code package. Therefore, the version number of the updated code package is automatically updated according to the mode of matching with the development stage information, the efficiency loss caused by manual participation after each version update is avoided, and the error probability is reduced. When the updating mode is changed, only version number updating logic matched with the development stage information is required to be rewritten, so that the development cost of great changes is saved, and the development efficiency is improved. .
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the detailed description of non-limiting embodiments, made with reference to the following drawings, in which:
FIG. 1 is an exemplary system architecture diagram in which an embodiment of the present application may be applied;
FIG. 2 is a flow chart of one embodiment of a method for generating a version number according to the present application;
FIG. 3 is a schematic diagram of one application scenario of a method for generating a version number according to an embodiment of the present application;
FIG. 4 is a flow chart of yet another embodiment of a method for generating a version number according to the present application;
FIG. 5 is a schematic structural diagram of one embodiment of an apparatus for generating version numbers according to the present application;
fig. 6 is a schematic structural diagram of an electronic device suitable for use in implementing embodiments of the present application.
Detailed Description
The present application is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings.
It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be combined with each other. The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary architecture 100 to which the methods for generating version numbers or apparatuses for generating version numbers of the present application may be applied.
As shown in fig. 1, a system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The terminal devices 101, 102, 103 interact with the server 105 via the network 104 to receive or send messages or the like. Various communication client applications, such as a web browser application, a shopping class application, an instant messaging tool, a mailbox client, social platform software, a text editing class application, a software development class application, a reading class application, and the like, may be installed on the terminal devices 101, 102, 103.
The terminal devices 101, 102, 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices having a display screen and supporting software development, including but not limited to smartphones, tablet computers, electronic book readers, laptop and desktop computers, and the like. When the terminal devices 101, 102, 103 are software, they can be installed in the above-listed electronic devices. Which may be implemented as multiple software or software modules (e.g., software or software modules for providing distributed services) or as a single software or software module. The present invention is not particularly limited herein.
The server 105 may be a server providing various services, such as a background server providing remote storage and version management services for codes stored on the terminal devices 101, 102, 103. The background server can carry out version numbering, storage and other processing on the uploaded code packet.
The server may be hardware or software. When the server is hardware, the server may be implemented as a distributed server cluster formed by a plurality of servers, or may be implemented as a single server. When the server is software, it may be implemented as a plurality of software or software modules (e.g., software or software modules for providing distributed services), or as a single software or software module. The present invention is not particularly limited herein.
It should be noted that the method for generating a version number provided in the embodiments of the present application is generally performed by the terminal devices 101, 102, 103, and accordingly, the means for generating a version number is generally provided in the terminal devices 101, 102, 103.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to fig. 2, a flow 200 of one embodiment of a method for generating a version number according to the present application is shown. The method for generating a version number includes the steps of:
step 201, obtain development stage information and current version number.
In the present embodiment, an execution subject of the method for generating a version number (such as the terminal devices 101, 102, 103 shown in fig. 1) can acquire development stage information and a current version number by a wired connection manner or a wireless connection manner. The development stage information may be used to characterize a stage in which an application program is developed. The current version number is used to characterize version information of the application. In general, the stage at which the application program is developed may include, but is not limited to, at least one of: the development stage enters a gray level test stage, a release stage and a next version development stage. In practice, the current version number may take many forms, and may be represented by an integer value, or may be combined by several sub-version numbers.
In the present embodiment, as an example, the execution subject may acquire development stage information and a current version number from an electronic device (e.g., a terminal device for software development by a developer) communicatively connected thereto. As yet another example, with the help of the Gitlab tool, the execution body may also obtain the development stage information and the current version number from the master branch.
In some alternative implementations of the present embodiment, the development stage information may include information characterizing a development stage. The current version number may include a revision number. Wherein the update of the revision number often corresponds to the repair of a bug in an application.
In some alternative implementations of the present embodiment, the development stage information may include information characterizing entry into a gray scale test stage. The current version number may also include a minor version number. Wherein the above-mentioned update of the minor version number often corresponds to a smaller functional modification of the application.
In some alternative implementations of the present embodiment, the development stage information may include information characterizing a gray scale test stage.
In some alternative implementations of the present embodiment, the development stage information may include information characterizing entry into the release stage.
In some alternative implementations of the present embodiment, the development stage information may include information characterizing entry into a next version development stage.
In response to detecting the update of the object code package, the current version number is updated in a manner that matches the development stage information to generate a new version number, step 202.
In this embodiment, first, the execution body may detect whether the object code package is updated by using various file comparison manners. The above-mentioned document comparison may include, for example, a difference (diff). The object code package described above may be used to characterize the set of codes to be updated in an application. Then, in response to detecting the update of the object code package, the execution body may first acquire a version number update manner matched with the development stage information acquired in step 201; then, the executing body may update the current version number acquired in the step 201 according to the acquired version number updating manner, so as to generate a new version number. As an example, the execution body may store a correspondence table of the matching relationship between the development stage information and the version number update method in advance. The version number update method can be used for indicating update logic of the version number. The update logic may be represented by a Python statement, for example.
In some optional implementations of this embodiment, the execution body may increment the revision number based on the information characterizing the development stage included in the development stage information and the revision number included in the current version number to generate a new revision number as the new version number. As an example, version number updating means matching the development stage information described above may include increasing the revision number between 1-49. Thus, the execution body may increment the revision number by 1 every time an update of the object code package is detected.
Based on the alternative implementation manner, the execution body can update the version number of the code package in the development stage.
In some optional implementations of this embodiment, based on the information characterizing the development stage entering the gray scale test stage and the minor version number included in the current version number included in the development stage information, the execution body may further update the current version number according to the following steps:
first, based on the minor version number, the revision number is reset as the revision number of the new version number.
In these implementations, the execution subject may reset the revision number as the revision number of the new version number in various ways based on the minor version number. As an example, the version number updating means matched with the above-described entering gray test stage information may include resetting the revision number to an odd number between 50-99. Thus, the execution body may reset the revision number of the new version number to the minor version number multiplied by 100 and then added by 51.
Second, a label (label) corresponding to the new version number entering the gradation test stage is generated.
In these implementations, the executing entity may generate the tag corresponding to the new version number of the first reset entering the gray test stage in various ways. Thus, the corresponding code package can be found from the tag.
Based on the alternative implementation manner, the execution body can update the version number of the code package entering the gray test stage.
Optionally, based on the optional implementation manner, the development stage information includes information characterizing a gray scale test stage, and the execution body may further increment the revision number according to a preset increment, so as to generate a new revision number as the new version number. The preset amplification may be determined according to actual needs. For example, in the case where the odd-even number needs to be ensured, the amplification may be set to 2 in general. In these implementations, as an example, version number updating means matching the gradation test stage information described above may include increasing the revision number between 50-99 and maintaining an odd number. Thus, the execution subject may increment the revision number by 2 each time an update of the object code package in the gradation test phase is detected.
Based on the alternative implementation manner, the execution body can update the version number of the code package in the gray test stage.
Optionally, based on the optional implementation manner, the development stage information includes information that characterizes the entering of the publishing stage, and the execution entity may further update the current version number according to the following steps:
First, the revision number is incremented to generate a new component update number as the revision number of the new version number.
In these embodiments, the execution body may increment the revision number to generate an even number of new component update numbers as revision numbers for the new version numbers.
And secondly, updating the major version number of the new version number and the version number of the application program configuration file to be consistent with the minor version number of the current version number.
In these implementations, the execution body may update the major version number of the new version number and the application profile (android management) version number to be consistent with the minor version number of the current version number.
And thirdly, generating a label corresponding to the new version number entering the release stage.
Based on the alternative implementation manner, the execution body can update the version number of the code package entering the release stage.
Optionally, based on the optional implementation manner, the development stage information includes information that characterizes entering a next version development stage, and the execution entity may further update the current version number according to the following steps:
first, the next version number is obtained.
In these implementations, the executing entity may obtain the next version number in various ways. As an example, the executing body may obtain the next version number from an electronic device (e.g., a terminal device for software development by a developer) communicatively connected thereto. As yet another example, the execution body may further obtain the next version number according to a preset next version number generation rule (e.g., increase of 1 in minor version number, return of revision number to zero).
And secondly, pulling the development branch according to the next version number.
In these implementations, the execution body may create a development branch (dev branch) locally using the obtained next version number. The development branches created above are then associated to a remote code repository (e.g., gitlab).
And thirdly, updating the main version number of the new version number to be consistent with the minor version number of the current version number.
And fourthly, updating the minor version number of the new version number to be consistent with the minor version number of the next version number.
And fifthly, resetting the revision number as the revision number of the new version number based on the updated minor version information.
In these implementations, the execution subject may reset the revision number as the revision number of the new version number in various ways based on the updated minor version information of the fourth step. As an example, a version number update approach that matches the information described above to enter the next version development stage may include resetting the revision number to 1 and iterating through the update process to 49. Thus, the execution body may reset the revision number of the new version number to the minor version number multiplied by 100 and then added by 1.
Based on the alternative implementation manner, the execution body can update the version number of the code package entering the next version development stage.
And 203, establishing a corresponding relation between the new version number and the updated object code package.
In this embodiment, the executing body may establish the correspondence between the new version number and the updated object code packet in various manners. The updated object code package may include the updated full code package, or may include an incremental code package obtained by differentiating the updated object code package from the original edition, which is not limited herein.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of a method for generating a version number according to an embodiment of the present application. In the application scenario of fig. 3, terminal device 301 may first obtain development stage information and current version number 006 (shown as 302 in fig. 3) that characterizes the application program as currently in the development stage. The developer 303 modifies the code of the application program using the terminal 301 to form a modified code package 304. The terminal 301 detects that the code packet 304 is updated as compared with the code packet corresponding to the version number 006, updates the version number, and generates a new version number 007 (as shown at 305 in fig. 3). Then, the terminal 301 may establish a correspondence relationship between the code package 304 and the version number 007 (as shown by 306 in fig. 3). Optionally, the terminal 301 may also submit the code package 304 to a backend server 307 that provides code version management services.
Currently, one of the existing technologies is that a technician refers to a document to check a modification rule every time the version number is modified, and then the technician performs excessive repetitive work to affect development efficiency through manual modification. According to the method provided by the embodiment of the application, the version number of the updated code packet is automatically updated according to the mode matched with the development stage information, so that efficiency loss caused by manual participation after each version update is avoided, and error probability is reduced. When the updating mode is changed, only version number updating logic matched with the development stage information is required to be rewritten, so that the development cost of great changes is saved, and the development efficiency is improved.
With further reference to fig. 4, a flow 400 of yet another embodiment of a method for generating a version number is shown. The flow 400 of the method for generating a version number comprises the steps of:
step 401, acquire development stage information and current version number.
In response to detecting the update of the object code package, the current version number is updated in a manner that matches the development stage information to generate a new version number, step 402.
Step 403, establishing a correspondence between the new version number and the updated object code package.
The steps 401, 402, and 403 are identical to the steps 201, 202, 203 and their optional implementation manners in the foregoing embodiments, and the descriptions of the steps 201, 202, 203 and their optional implementation manners also apply to the steps 401, 402, and 403, which are not repeated herein.
Step 404, submitting the updated object code package to a local repository and a corresponding remote repository.
In the present embodiment, an execution subject of the method for generating a version number (e.g., the terminal devices 101, 102, 103 shown in fig. 1) may submit updated object code packages to the local repository and the corresponding remote repository in various ways. As an example, the remote repository may be a Gitlab, and the execution entity may submit updated object code packages to the local repository and the corresponding remote repository by executing a commit command and a push command.
Step 405, setting the development branch to which the updated object code packet belongs as a protection branch and a default branch.
In this embodiment, the execution body may set the development branch to which the updated object code package belongs to as the protection branch and the default branch in various manners. As an example, the execution body may set a development branch to which the updated object code package belongs to a protection branch (protection branch) and a default branch (default branch) by calling an API (Application Programming Interface) of the Gitlab.
As can be seen from fig. 4, the flow 400 of the method for generating a version number in this embodiment embodies the steps of submitting an updated code packet and setting the development branch to which the updated code packet belongs as a protection branch and a default branch. Therefore, the scheme described in the embodiment can integrate the updated code submitting and branch authority setting, thereby realizing automatic updated code and branch authority setting, simplifying the operation of developers and reducing the misoperation rate caused by manpower.
With further reference to fig. 5, as an implementation of the method shown in the foregoing figures, the present application provides an embodiment of an apparatus for generating a version number, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2 or fig. 4, and the apparatus may be specifically applied in various electronic devices.
As shown in fig. 5, the apparatus 500 for generating a version number provided in the present embodiment includes an acquisition unit 501, an update unit 502, and an association unit 503. Wherein, the obtaining unit 501 is configured to obtain development stage information and a current version number; an updating unit 502 configured to update the current version number in a manner matching the development stage information to generate a new version number in response to detecting the update of the object code package; an association unit 503 configured to establish a correspondence between the new version number and the updated object code package
In the present embodiment, in the apparatus 500 for generating a version number: the specific processes of the obtaining unit 501, the updating unit 502 and the associating unit 503 and the technical effects thereof may refer to the relevant descriptions of the step 201, the step 202 and the step 203 in the corresponding embodiment of fig. 2, and are not repeated herein.
In some alternative implementations of the present embodiment, the development stage information may include information characterizing a development stage. The current version number may include a revision number. The updating unit 502 may be further configured to increment the revision number to generate a new revision number as the new version number.
In some alternative implementations of the present embodiment, the development stage information may include information characterizing entry into a gray scale test stage. The current version number may also include a minor version number. The updating unit 502 may include a first resetting module (not shown in the figure) and a first generating module (not shown in the figure). Wherein the first reset module may be configured to reset the revision number as the revision number of the new version number based on the minor version number. The first generation module may be configured to generate a tag corresponding to a new version number entering the gray test stage.
In some alternative implementations of the present embodiment, the development stage information may include information characterizing a gray scale test stage. The updating unit 502 may be further configured to: the revision number is incremented by a preset increment to generate a new revision number as a new version number.
In some alternative implementations of the present embodiment, the development stage information may include information characterizing entry into the release stage. The current version number may also include a master version number and an application profile version number. The updating unit 502 may include: an increment module (not shown), a first update module (not shown), and a second generation module (not shown). Wherein the incrementing module may be configured to increment the revision number to generate the new component update number as the revision number of the new version number. The first updating module may be configured to update the major version number of the new version number and the application profile version number to be consistent with the minor version number of the current version number. The second generation module may be configured to generate a tag corresponding to a new version number entering the release phase.
In some alternative implementations of the present embodiment, the development stage information may include information characterizing entry into a next version development stage. The updating unit 502 may include: an acquisition module (not shown), a pull module (not shown), a second update module (not shown), a third update module (not shown), and a second reset module (not shown). The obtaining module may be configured to obtain a next version number. The pulling module may be configured to pull the development branch according to a next version number. The second updating module may be configured to update the major version number of the new version number to be consistent with the minor version number of the current version number. The third updating module may be configured to update the minor version number of the new version number to be consistent with the minor version number of the next version number. The second resetting module may be configured to reset the revision number as the revision number of the new version number based on the updated minor version information.
In some optional implementations of this embodiment, the apparatus 500 for generating a version number may further include: a submitting unit (not shown in the figure), a setting unit (not shown in the figure). The submitting unit may be configured to submit the updated object code package to a local repository and a corresponding remote repository. The setting unit may be configured to set a development branch to which the updated object code package belongs as the protection branch and the default branch.
The apparatus provided in the above embodiment of the present application acquires the development stage information and the current version number through the acquisition unit 501. Then, in response to detecting the update of the object code package, the update unit 502 updates the current version number in a manner matching the development stage information to generate a new version number. Finally, the association unit 503 establishes a correspondence between the new version number and the updated object code package. Therefore, the version number of the updated code package is automatically updated according to the mode of matching with the development stage information, the efficiency loss caused by manual participation after each version update is avoided, and the error probability is reduced. When the updating mode is changed, only version number updating logic matched with the development stage information is required to be rewritten, so that the development cost of great changes is saved, and the development efficiency is improved.
Referring now to fig. 6, a schematic diagram of a configuration of an electronic device (e.g., the terminal device of fig. 1) 600 suitable for use in implementing embodiments of the present application is shown. The terminal device in the embodiments of the present application may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. The terminal device shown in fig. 6 is only an example, and should not impose any limitation on the functions and the scope of use of the embodiments of the present application.
As shown in fig. 6, the electronic device 600 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 601, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data required for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
In general, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 607 including, for example, a liquid crystal display (LCD, liquid Crystal Display), a speaker, a vibrator, and the like; storage 608 including, for example, flash memory; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 shows an electronic device 600 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead. Each block shown in fig. 6 may represent one device or a plurality of devices as needed.
In particular, according to embodiments of the present application, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via communication means 609, or from storage means 608, or from ROM 602. The above-described functions defined in the methods of the embodiments of the present application are performed when the computer program is executed by the processing means 601.
It should be noted that, the computer readable medium according to the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of the present application, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. Whereas in embodiments of the present application, the computer-readable signal medium may comprise a data signal propagated in baseband or as part of a carrier wave, with computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (Radio Frequency), and the like, or any suitable combination thereof.
The computer readable medium may be contained in the terminal device; or may exist alone without being fitted into the terminal device. The computer-readable medium carries one or more programs which, when executed by the terminal device, cause the terminal device to: acquiring development stage information and a current version number; in response to detecting the update of the object code package, updating the current version number in a manner matching the development stage information to generate a new version number; and establishing a corresponding relation between the new version number and the updated object code package.
Computer program code for carrying out operations for embodiments of the present application may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present application may be implemented by software, or may be implemented by hardware. The described units may also be provided in a processor, for example, described as: a processor includes an acquisition unit, an update unit, and an association unit. The names of these units do not constitute a limitation on the unit itself in some cases, and for example, the acquisition unit may also be described as "a unit that acquires development stage information and a current version number".
The foregoing description is only of the preferred embodiments of the present application and is presented as a description of the principles of the technology being utilized. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present application is not limited to the specific combination of the above technical features, but encompasses other technical features formed by any combination of the above technical features or their equivalents without departing from the spirit of the invention. Such as the technical solution formed by mutually replacing the above features and the technical features with similar functions (but not limited to) disclosed in the embodiments of the present application.

Claims (7)

1. A method for generating a version number, comprising:
acquiring development stage information and a current version number;
in response to detecting an update of the object code package, updating the current version number in a manner matched with the development stage information to generate a new version number;
establishing a corresponding relation between the new version number and the updated object code package;
wherein the development stage information comprises information characterizing a development stage, and the current version number comprises a revision number; and
updating the current version number in a manner matched with the development stage information to generate a new version number, including:
Incrementing the revision number to generate a new revision number as the new version number;
wherein the development stage information comprises information representing entering a gray scale test stage, and the current version number further comprises a minor version number; and
updating the current version number in a manner matched with the development stage information to generate a new version number, including:
resetting the revision number as a revision number of the new version number based on the minor version number;
generating a label corresponding to the new version number entering the gray test stage;
wherein the development stage information comprises information for representing entering a next version development stage; and
updating the current version number in a manner matched with the development stage information to generate a new version number, including:
acquiring a next version number;
pulling a development branch according to the next version number;
updating the main version number of the new version number to be consistent with the auxiliary version number of the current version number;
updating the minor version number of the new version number to be consistent with the minor version number of the next version number;
and resetting the revision number as the revision number of the new version number based on the updated minor version information.
2. The method of claim 1, wherein the development stage information includes information characterizing a gray scale test stage; and
updating the current version number in a manner matched with the development stage information to generate a new version number, including:
and increasing the revision number according to a preset increase to generate a new revision number as the new version number.
3. The method of claim 2, wherein the development stage information includes information characterizing entry into a release stage, the current version number further including a master version number and an application profile version number; and
updating the current version number in a manner matched with the development stage information to generate a new version number, including:
incrementing the revision number to generate a new component update number as a revision number for the new version number;
updating the major version number of the new version number and the version number of the application program configuration file to be consistent with the minor version number of the current version number;
a tag corresponding to the new version number entering the release phase is generated.
4. A method according to one of claims 1-3, wherein the method further comprises:
submitting the updated object code package to a local warehouse and a corresponding remote warehouse;
And setting the development branch to which the updated target code packet belongs as a protection branch and a default branch.
5. An apparatus for generating a version number, comprising:
an acquisition unit configured to acquire development stage information and a current version number;
an updating unit configured to update the current version number in a manner matching the development stage information to generate a new version number in response to detection of an update of an object code package;
the association unit is configured to establish a corresponding relation between the new version number and the updated object code package;
wherein the development stage information comprises information characterizing a development stage, and the current version number comprises a revision number; and
the updating unit updates the current version number in a mode of matching with the development stage information to generate a new version number, and the updating unit is specifically used for:
incrementing the revision number to generate a new revision number as the new version number;
wherein the development stage information comprises information representing entering a gray scale test stage, and the current version number further comprises a minor version number; and
the updating unit updates the current version number in a mode of matching with the development stage information to generate a new version number, and the updating unit is specifically used for:
Resetting the revision number as a revision number of the new version number based on the minor version number;
generating a label corresponding to the new version number entering the gray test stage;
wherein the development stage information comprises information for representing entering a next version development stage; and
the updating unit updates the current version number in a mode of matching with the development stage information to generate a new version number, and the updating unit is specifically used for:
acquiring a next version number;
pulling a development branch according to the next version number;
updating the main version number of the new version number to be consistent with the auxiliary version number of the current version number;
updating the minor version number of the new version number to be consistent with the minor version number of the next version number;
and resetting the revision number as the revision number of the new version number based on the updated minor version information.
6. A terminal, comprising:
one or more processors;
a storage device having one or more programs stored thereon;
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-4.
7. A computer readable medium having stored thereon a computer program, wherein the program when executed by a processor implements the method of any of claims 1-4.
CN202010397398.2A 2020-05-12 2020-05-12 Method and apparatus for generating version number Active CN113656050B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010397398.2A CN113656050B (en) 2020-05-12 2020-05-12 Method and apparatus for generating version number

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010397398.2A CN113656050B (en) 2020-05-12 2020-05-12 Method and apparatus for generating version number

Publications (2)

Publication Number Publication Date
CN113656050A CN113656050A (en) 2021-11-16
CN113656050B true CN113656050B (en) 2024-03-22

Family

ID=78488724

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010397398.2A Active CN113656050B (en) 2020-05-12 2020-05-12 Method and apparatus for generating version number

Country Status (1)

Country Link
CN (1) CN113656050B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115599437B (en) * 2022-10-26 2023-10-20 北京领雁科技股份有限公司 Software version processing method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB0615181D0 (en) * 2006-07-29 2006-09-06 Ibm Methods,apparatus and computer programs for modelling computer programs
GB0619147D0 (en) * 2006-09-28 2006-11-08 Ibm A method, apparatus or software for managing software component version identifications in a componentised software system
WO2013185570A1 (en) * 2012-06-13 2013-12-19 腾讯科技(深圳)有限公司 Software update method, software update system and computer storage medium
CN103605546A (en) * 2013-11-22 2014-02-26 中国广核集团有限公司 Software version detecting method and device
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8788510B2 (en) * 2007-08-17 2014-07-22 Salesforce.Com, Inc. System, method, and computer program product for runtime invocation of an appropriate version of program instructions in an on-demand database

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB0615181D0 (en) * 2006-07-29 2006-09-06 Ibm Methods,apparatus and computer programs for modelling computer programs
GB0619147D0 (en) * 2006-09-28 2006-11-08 Ibm A method, apparatus or software for managing software component version identifications in a componentised software system
WO2013185570A1 (en) * 2012-06-13 2013-12-19 腾讯科技(深圳)有限公司 Software update method, software update system and computer storage medium
CN103605546A (en) * 2013-11-22 2014-02-26 中国广核集团有限公司 Software version detecting method and device
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

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
常见版本号说明;Leon_Jinhai_Sun;《CSDN,https://blog.csdn.net/Leon_Jinhai_Sun/article/details/100919286》;第1页 *
软件版本命名规范及各阶段说明;程序员杠杠;《https://www.jianshu.com/p/aa51738227a5》;第1-6页 *

Also Published As

Publication number Publication date
CN113656050A (en) 2021-11-16

Similar Documents

Publication Publication Date Title
CN110515647B (en) Static resource management method, device, equipment and storage medium
CN110554876A (en) Method and device for compiling android project
CN110960855B (en) Communication protocol code updating method and device, electronic equipment and storage medium
CN112214408B (en) Dependency conflict detection method, dependency conflict detection device, electronic equipment and computer readable medium
CN111338944B (en) Remote Procedure Call (RPC) interface testing method, device, medium and equipment
CN111104479A (en) Data labeling method and device
CN115757400B (en) Data table processing method, device, electronic equipment and computer readable medium
CN110780874B (en) Method and device for generating information
CN110851139A (en) Method and device for checking codes and electronic equipment
CN111597107B (en) Information output method and device and electronic equipment
CN109766127A (en) Method for updating application version information
CN110221857A (en) The problem of application program restorative procedure, device, electronic equipment and storage medium
CN108959102B (en) Method and device for generating test data and testing application to be tested
CN113656050B (en) Method and apparatus for generating version number
CN114428925A (en) Page rendering method and device, electronic equipment and computer readable medium
CN111897827B (en) Data updating method and system for data warehouse and electronic equipment
CN108804442B (en) Serial number generation method and device
CN111506904B (en) Method and device for online bug repair
CN113468053B (en) Application system testing method and device
CN113407229B (en) Method and device for generating offline scripts
CN108287792B (en) Method and apparatus for outputting information
CN114021133A (en) Code processing method and device, electronic equipment and storage medium
CN114328215A (en) Test data deployment method, device, equipment, readable storage medium and product
CN109445840B (en) Dynamic updating method and device of webpage, electronic equipment and storage medium
CN113032046A (en) Method, device and equipment for repairing so file 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
GR01 Patent grant
GR01 Patent grant