Version information updating method, device, terminal and storage medium

By analyzing the code file information to obtain target version information and file identifiers, and automatically update the version control files in the code warehouse, solving the problem of low version information update efficiency in the existing technology, realizing automatic updates, and improving efficiency.

CN112783533BActive Publication Date: 2025-02-14BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110147422.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-03
Publication Date
2025-02-14
Estimated Expiration
2041-02-14

AI Technical Summary

Technical Problem

In the prior art, the update of version information requires manual modification by technicians, resulting in low update efficiency.

Method used

By obtaining the code file information of the target branch, parsing out the target version information and file identification, obtaining the version control file from the code repository, and updating the version information in the version control file based on the target version information.

Benefits of technology

Automatic update of version information is realized, manual operations by technicians are reduced, and efficiency of version information is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112783533B_ABST
    Figure CN112783533B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a version information update method, device, terminal and storage medium, and relates to the field of computer technology. The method includes: obtaining file information, the file information is the file information of the code file of the target branch, and the target branch is the branch of the version information to be updated; parsing the target version information and file identification of the code file from the file information; based on the file identification, obtaining the version control file corresponding to the code file from the code warehouse, and the code warehouse is used to store the version control file; based on the target version information, updating the version information in the version control file; the above method realizes the automatic update of the version information before packaging the code file, so that the technician does not need to manually update the version information, thereby saving the update time and improving the efficiency of the version information update.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a version information updating method, device, terminal and storage medium. Background Art

[0002] In order to improve the development efficiency of an application, multiple functions of the application are often developed simultaneously. When a function is developed and debugged, it can be launched first. That is, the application is the main line of development, and each function corresponds to a branch. In order to distinguish the new and old branches, each branch has a version number, and the version number of the branch is stored in the branch's version control file. When launching a function, the code file and version control file of the branch corresponding to the function need to be packaged to obtain the installation package of the application, and then the installation package is released.

[0003] In the related art, during the process of packaging code files and version control files, technicians need to manually modify the version information in the version control file to update the version information of the branch.

[0004] In the above technology, since the technical staff needs to manually modify the version information each time the package is packaged, the updating efficiency of the version information is low. Summary of the invention

[0005] The present disclosure provides a version information update method, device, terminal and storage medium, which improves the efficiency of version information update. The technical solution of the present disclosure is as follows:

[0006] According to a first aspect of an embodiment of the present disclosure, a version information updating method is provided, including:

[0007] Obtain file information, where the file information is file information of a code file of a target branch, and the target branch is a branch of version information to be updated;

[0008] Parsing the target version information and the file identifier of the code file from the file information;

[0009] Based on the file identifier, obtaining a version control file corresponding to the code file from a code repository, where the code repository is used to store version control files;

[0010] Based on the target version information, the version information in the version control file is updated.

[0011] In some embodiments, obtaining file information includes:

[0012] Displaying a target page, wherein the target page includes an input entry;

[0013] In response to an input operation triggered based on the input entry, the input file information is acquired.

[0014] In some embodiments, obtaining file information includes:

[0015] Based on the encapsulated control command, the file information is obtained.

[0016] In some embodiments, obtaining the file information based on the encapsulated control command includes:

[0017] Based on the currently running target application, acquiring the input control command, wherein the control command carries the file information;

[0018] Sending the control command to a target server corresponding to the target application, so that the target server parses the file information from the control command;

[0019] The file information parsed by the target server is received.

[0020] In some embodiments, obtaining the file information based on the encapsulated control command includes:

[0021] Acquire an input control command, where the control command carries the file information;

[0022] The file information is parsed from the control command.

[0023] In some embodiments, the process of parsing the target version information of the code file from the file information includes:

[0024] The target version information is matched from the file information based on a target matching function, wherein the target matching function is used to parse the target version information from the file information.

[0025] In some embodiments, updating the version information in the version control file based on the target version information includes:

[0026] Scan the version control file to obtain the version control field of the version control file;

[0027] The version information corresponding to the version control field is replaced with the target version information.

[0028] In some embodiments, obtaining a version control file corresponding to the code file from a code repository based on the file identifier includes:

[0029] Sending a file acquisition request to the code repository through an interface with the code repository, wherein the file acquisition request carries the file identifier, and is used by the code repository to acquire a version control file corresponding to the code file based on the file identifier;

[0030] Receive the version control file sent by the code repository.

[0031] In some embodiments, the method further comprises:

[0032] Controlling the code repository to create and modify nodes;

[0033] The version control file with updated version information is sent to the code repository, so that the modification node replaces the stored version control file with the version control file with updated version information.

[0034] In some embodiments, the method further comprises:

[0035] Based on the file identifier, obtaining the code file from the code repository;

[0036] Packaging the code file and the version control file with updated version information to obtain an installation package;

[0037] Publish the installation package.

[0038] According to a second aspect of an embodiment of the present disclosure, a version information updating device is provided, comprising:

[0039] A first acquisition unit is configured to execute acquisition of file information, wherein the file information is file information of a code file of a target branch, and the target branch is a branch of version information to be updated;

[0040] A parsing unit, configured to parse the target version information and the file identifier of the code file from the file information;

[0041] A second acquisition unit is configured to acquire, based on the file identifier, a version control file corresponding to the code file from a code repository, where the code repository is used to store version control files;

[0042] The updating unit is configured to update the version information in the version control file based on the target version information.

[0043] In some embodiments, the first acquisition unit includes:

[0044] The acquisition subunit is configured to execute the encapsulated control command to acquire the file information.

[0045] In some embodiments, the acquisition sub-unit is configured to execute based on the currently running target application, obtain the input control command, and the control command carries the file information; send the control command to the target server corresponding to the target application, so that the target server parses the file information from the control command; and receive the file information parsed by the target server.

[0046] In some embodiments, the acquisition subunit is configured to execute acquisition of an input control command, where the control command carries the file information; and parse the file information from the control command.

[0047] In some embodiments, the parsing unit is configured to perform matching of the target version information from the file information based on a target matching function, wherein the target matching function is used to parse the target version information from the file information.

[0048] In some embodiments, the updating unit is configured to scan the version control file to obtain a version control field of the version control file; and replace the version information corresponding to the version control field with the target version information.

[0049] In some embodiments, the second acquisition unit is configured to execute a file acquisition request to the code repository through an interface with the code repository, wherein the file acquisition request carries the file identifier, and is used by the code repository to acquire the version control file corresponding to the code file based on the file identifier; and receive the version control file sent by the code repository.

[0050] In some embodiments, the apparatus further comprises:

[0051] A creation unit, configured to execute control of the code repository to create a modification node;

[0052] The sending unit is configured to execute sending the version control file with updated version information to the code repository, so that the modification node replaces the stored version control file with the version control file with updated version information.

[0053] In some embodiments, the apparatus further comprises:

[0054] A third acquisition unit is configured to acquire the code file from the code repository based on the file identifier;

[0055] A packaging unit is configured to package the code file and the version control file after the version information is updated to obtain an installation package;

[0056] The publishing unit is configured to execute publishing of the installation package.

[0057] According to a third aspect of an embodiment of the present disclosure, a terminal is provided, including:

[0058] processor;

[0059] a memory for storing instructions executable by the processor;

[0060] The processor is configured to execute the instructions to implement the version information updating method as described in the above embodiment.

[0061] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of a terminal, the terminal is enabled to execute the version information updating method as described in the above embodiment.

[0062] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program / instruction, wherein when the computer program / instruction is executed by a processor, the version information updating method described in the above embodiment is implemented.

[0063] In the disclosed embodiment, since the file information of the code file includes version information and file identifier, the version control file corresponding to the code file is obtained by parsing the file identifier, and the version information in the version control file is updated by the parsed version information, thereby realizing automatic update of the version information before packaging the code file, so that the technician does not need to manually update the version information, thereby saving update time and improving the efficiency of version information updating.

[0064] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0066] Figure 1 The diagram is a schematic diagram of an implementation environment of a version information updating method according to an exemplary embodiment.

[0067] Figure 2 The figure is a flowchart of a version information updating method according to an exemplary embodiment.

[0068] Figure 3 The figure is a flowchart of a version information updating method according to an exemplary embodiment.

[0069] Figure 4 The figure is a flowchart of a version information updating method according to an exemplary embodiment.

[0070] Figure 5 The figure is a flowchart of a version information updating method according to an exemplary embodiment.

[0071] Figure 6 The figure is a flowchart of a version information updating method according to an exemplary embodiment.

[0072] Figure 7 The figure is a flowchart of a version information updating method according to an exemplary embodiment.

[0073] Figure 8 The figure is a flowchart of a version information updating method according to an exemplary embodiment.

[0074] Fig. 9 The figure is a block diagram of a version information updating device according to an exemplary embodiment.

[0075] Fig.10 It is a block diagram of a terminal according to an exemplary embodiment. DETAILED DESCRIPTION

[0076] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0077] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0078] In an embodiment of the present disclosure, when developing an application, each function of the application corresponds to a branch. In order to distinguish the new and old branches, it is necessary to add version information to the file information of the branch. When a function of the application is launched, it is necessary to package the code file and version control file of the branch corresponding to the function, obtain the installation package of the application, and then publish the installation package. Before the packaging operation, the version information in the version control file can be updated by the version information update method provided in the embodiment of the present disclosure.

[0079] Figure 1 FIG. 1 is a schematic diagram of an implementation environment of a version information updating method according to an exemplary embodiment. Figure 1 The implementation environment at least includes a terminal 10 and a server 20. The terminal 10 and the server 20 are connected via a wireless or wired network.

[0080] The terminal 10 is installed with a first application provided by the server 20, and the terminal 10 can implement functions such as data interaction through the first application. In some embodiments, the first application is an application in the operating system of the terminal 10, or an application provided by a third party. The first application not only has a software development function, but also has a version information update function. That is, the version information update function is added to the first application, for example, the first application is a software development application, etc.

[0081] In some embodiments, the user can use terminal 10 to write or debug the branch code corresponding to a function of the application in the first application, obtain the code file of the branch, and implement the development operation of the application.

[0082] Continue to see Figure 1 The first application may not have the function of updating the version information, and the terminal may update the version information with the help of the second application. Then, the implementation environment further includes a target server 30. The server 20 is connected to the target server 30 via a wireless or wired network.

[0083] The terminal 10 is installed with a second application provided by the target server 30, and the terminal 10 can implement functions such as data interaction through the second application. In some embodiments, the second application is an application in the operating system of the terminal 10, or an application provided by a third party. Among them, the user can develop software in the first application and update the version information in the second application. For example, the second application is a code hosting application, a branch packaging application, etc.

[0084] In some embodiments, the user may use terminal 10 to perform a version information update operation on a branch that needs to have its version information updated in the second application.

[0085] The terminal 10 is at least one of a mobile phone, a tablet computer, a PC (Personal Computer), etc. The server 20 and the target server 30 can be at least one of a server, a server cluster consisting of multiple servers, a cloud server, a cloud computing platform, and a virtualization center.

[0086] Figure 2is a flowchart of a version information updating method according to an exemplary embodiment. Figure 2 As shown, the method is used in a terminal and includes the following steps.

[0087] In step S21, file information is obtained, where the file information is file information of a code file of a target branch, and the target branch is a branch of version information to be updated.

[0088] In step S22, the target version information and the file identifier of the code file are parsed from the file information.

[0089] In step S23, based on the file identifier, a version control file corresponding to the code file is obtained from a code repository, where the code repository is used to store version control files.

[0090] In step S24, the version information in the version control file is updated based on the target version information.

[0091] In some embodiments, obtaining file information includes:

[0092] Displaying a target page, the target page including an input entry;

[0093] In response to an input operation triggered based on the input entry, the input file information is obtained.

[0094] In some embodiments, obtaining file information includes:

[0095] Based on the encapsulated control command, obtain the file information.

[0096] In some embodiments, the obtaining of the file information based on the encapsulated control command includes:

[0097] Based on the currently running target application, obtaining the input control command, where the control command carries the file information;

[0098] Sending the control command to a target server corresponding to the target application, so that the target server can parse the file information from the control command;

[0099] Receive the file information parsed by the target server.

[0100] In some embodiments, the obtaining of the file information based on the encapsulated control command includes:

[0101] Obtaining an input control command, the control command carrying the file information;

[0102] Parse the file information from the control command.

[0103] In some embodiments, the process of parsing the target version information of the code file from the file information includes:

[0104] The target version information is matched from the file information based on a target matching function, and the target matching function is used to parse the target version information from the file information.

[0105] In some embodiments, updating the version information in the version control file based on the target version information includes:

[0106] Scan the version control file to obtain the version control field of the version control file;

[0107] The version information corresponding to the version control field is replaced with the target version information.

[0108] In some embodiments, based on the file identifier, obtaining a version control file corresponding to the code file from a code repository includes:

[0109] Sending a file acquisition request to the code repository through an interface with the code repository, where the file acquisition request carries the file identifier, and is used by the code repository to acquire a version control file corresponding to the code file based on the file identifier;

[0110] Receive the version control file sent by the code repository.

[0111] In some embodiments, the method further comprises:

[0112] Control the creation and modification of nodes in the code repository;

[0113] The version control file with updated version information is sent to the code repository, so that the modification node replaces the stored version control file with the version control file with updated version information.

[0114] In some embodiments, the method further comprises:

[0115] Based on the file identifier, obtain the code file from the code repository;

[0116] The code file and the version control file with updated version information are packaged to obtain an installation package;

[0117] Publish the installation package.

[0118] In the disclosed embodiment, since the file information of the code file includes version information and file identifier, the version control file corresponding to the code file is obtained by parsing the file identifier, and the version information in the version control file is updated by the parsed version information, thereby realizing automatic update of the version information before packaging the code file, so that the technician does not need to manually update the version information, thereby saving update time and improving the efficiency of version information updating.

[0119] Figure 3 is a flowchart of a version information updating method according to an exemplary embodiment. Figure 3 As shown, the method is used in a terminal. In the disclosed embodiment, the method is explained by taking the updating of version information in the first application, that is, the first application provides a target page, and obtaining the file information of the target branch based on the target page as an example. The method includes the following steps.

[0120] In step S31, the terminal displays a target page, which includes an input entry.

[0121] The target page is encapsulated based on an open application programming interface (Open Application Programming Interface, Open API) of a code repository. For example, the code repository is Gitlab (an open source software) or Github (an open source software).

[0122] In some embodiments, the terminal displays the target page in the display interface. Accordingly, the user can trigger the terminal to display the home page of the target application, and display the target page by triggering the home page.

[0123] In this step, when the version information of the target branch needs to be modified, the user can perform an input operation on the input entry through the terminal, that is, input the file information of the target branch. The terminal obtains the input file information based on the input operation, and accordingly, the terminal executes the operation of step S32.

[0124] In step S32, the terminal obtains the input file information in response to the input operation triggered based on the input entry, where the file information is the file information of the code file of the target branch, and the target branch is the branch of the version information to be updated.

[0125] Among them, for the target branch of the version information to be updated, the user enters the file information of the target branch through the input entrance, and the terminal obtains the file information. For example, the file information is the file name of the code file, and the file information can be release / v1.0.0, release / v2.1.0, etc.

[0126] In the disclosed embodiment, since the terminal displays a target page, the file information of the branch file whose version information needs to be updated can be input through the input entry provided by the target page, thereby obtaining the file information, thereby improving the efficiency of information acquisition.

[0127] In the embodiment of the present disclosure, when the terminal updates the target version information, it needs to first obtain the target version information. Accordingly, after obtaining the file information, the operation of step S33 is performed.

[0128] In step S33, the terminal parses the target version information of the code file from the file information.

[0129] Among them, this step can be implemented directly by the terminal or with the help of a server. In the first case, the terminal directly parses the target version information of the code file from the file information. In some embodiments, the terminal can parse the target version information from the file information through a matching function. Accordingly, the implementation method of this step can be: the terminal matches the target version information from the file information based on a target matching function, and the target matching function is used to parse the target version information from the file information.

[0130] For example, the target version information is the version number of the target branch. In some embodiments, for branches with naming conventions, the version information generally adopts the format of XYZ, and X, Y and Z are all non-negative integers, and zeros are prohibited in front of the numbers. Among them, X is the major version number, Y is the minor version number, and Z is the revision number.

[0131] In some embodiments, the target matching function may be a regular expression. The target matching function may be encapsulated in the target page. For example, the file information of the branch is release / v1.0.0, and the target matching function is release / (\d+\.\d+\.\d+)_RC(\d+). Among them, "release" indicates that the type of the branch is a release version branch, "\d" indicates a number, "+" indicates that it appears at least once, and "()" indicates that the content in the brackets is a group.

[0132] The target matching function can also be used to check whether the file information is standardized. Accordingly, before step S33, the terminal first checks the file information based on the target matching function; if the file information is standardized, the terminal continues to perform the operation of step S33; if the file information is not standardized, the terminal stops the update operation of the version information.

[0133] In this step, since the file information includes the target version information and the target version information has a standard format, the target version information can be parsed from the file information through the target matching function. For example, the input file information is release / v1.0.0, where the target version information parsed by the terminal through the target matching function is 1.0.0.

[0134] In the disclosed embodiment, based on the target matching function, not only the file information of the naming specification can be determined, but also the target version information can be parsed from the file information, thereby providing data support for the subsequent update of the version information.

[0135] In the second case, the terminal obtains the target version information of the code file with the help of the server; accordingly, the terminal first sends a version acquisition request to the server, and the version acquisition request carries the file information; the server receives the version acquisition request, parses the target version information from the file information, and sends the target version information to the terminal; the terminal receives the target version information. The implementation method of the server parsing the target version information from the file information is the same as the operation of the terminal matching the target version information from the file information based on the target matching function, which will not be repeated here.

[0136] In step S34, the terminal parses the file information to obtain the file identifier of the code file.

[0137] The file identifier is used by the terminal to obtain the version control file corresponding to the code file from the code repository. For example, the file identifier is release. In some embodiments, the file identifier is located in the header of the file information, and the step may be: the terminal determines that the information in the header of the file information is the file identifier; or the terminal obtains the file identifier with the help of a server. Correspondingly, the implementation method for the terminal to obtain the file identifier with the help of a server may be: the terminal sends an identifier acquisition request to the server, the identifier acquisition request carries the file information, the server receives the identifier acquisition request, determines that the information in the header of the file information is the file identifier, sends the file identifier to the terminal, and the terminal receives the file identifier. The identifier acquisition request and the version acquisition request may be the same request or different requests, and the present disclosure does not make specific limitations on this.

[0138] In the embodiment of the present disclosure, by obtaining the file identifier of the code file, a basis is provided for pulling the subsequent version control file.

[0139] In step S35, the terminal obtains the version control file corresponding to the code file from the code repository based on the file identifier, and the code repository is used to store version control files.

[0140] Among them, since the version control file of the version information to be updated is stored in the code warehouse, it is necessary to obtain the version control file from the code warehouse according to the file identifier of the code file. Figure 4 The implementation of this step includes the following steps S351-S352:

[0141] S351: The terminal sends a file acquisition request to the code repository through an interface with the code repository. The file acquisition request carries the file identifier, and is used by the code repository to acquire a version control file corresponding to the code file based on the file identifier.

[0142] The interface may be an Open API. In some embodiments, the terminal performs the operation of step S351 with the help of the server. Accordingly, the implementation of this step may be: the terminal sends a file acquisition request to the server, and the server forwards the file acquisition request to the target server corresponding to the code repository through the interface between the terminal and the code repository; since the code repository stores branch files corresponding to multiple branches, upon receiving the file acquisition request sent by the server, the target server obtains the version control file in the code file corresponding to the file identifier from the multiple branch files in the code repository, and forwards the version control file to the terminal through the server.

[0143] In some embodiments, for the Android system, the version control file is gradle.properties (a configuration file); in other embodiments, for the Apple operating system (iPhone OperationSystem, IOS), the version control file is project.pbxproj (a configuration file).

[0144] S352: The terminal receives the version control file sent by the code repository.

[0145] In this step, the terminal receives the version control file with the help of the server, thereby pulling the version control file.

[0146] In the disclosed embodiment, since the version control file of the branch is hosted in a remote code repository, the version control file is pulled through the interface of the code repository, providing data support for subsequent updates of version information.

[0147] In step S36, the terminal updates the version information in the version control file based on the target version information.

[0148] Among them, since the content in the version control file is program code, the version control file can be scanned to locate the version control field. Figure 5, the implementation method of this step includes the following steps S361-S362:

[0149] S361: The terminal scans the version control file to obtain a version control field of the version control file.

[0150] In some embodiments, in the version control files of the Android system and the IOS system, the format of the version control field is constrained by the key value (key=value) format. Accordingly, in this step, the terminal determines the current system type, then determines the key that matches the system type, scans the position of the key in the version control file, and obtains the value to the right of the equal sign of the key, which is the version information that needs to be updated, and the key value is the version control field.

[0151] For example, in the Android system, the version control file is gradle.properties, and the format of the version control field is: VERSION_NAME = XYZ, that is, the key is VERSION_NAME and the value is XYZ; in the iOS system, the version control file is project.pbxproj, and the format of the version control field is: MARKETING_VERSION = XYZ, that is, the key is MARKETING_VERSION and the value is XYZ. Among them, X, Y and Z are all non-negative integers.

[0152] S362: The terminal replaces the version information corresponding to the version control field with the target version information.

[0153] In some embodiments, the terminal performs the operation of step S362 with the help of the server. For example, if the scanned version control field is VERSION_NAME=1.0.0 and the target version information is 1.0.1, the replaced version control field is VERSION_NAME=1.0.1.

[0154] In the disclosed embodiment, the version control file is scanned to locate the version control field, without the need for the user to manually search for the version control field in the version control file, thereby achieving replacement of the target version information with high replacement efficiency.

[0155] In the embodiment of the present disclosure, since the version control file after the version information is updated needs to be uploaded to the code warehouse for storage, accordingly, the method also includes step S37. In this step, the terminal sends the version control file after the version information is updated to the code warehouse based on the modification node. Accordingly, the implementation method of this step includes the following steps S371-S372:

[0156] S371: The terminal controls the code repository to create a modification node.

[0157] In some embodiments, the terminal sends a node creation request to the code repository with the help of a server, and the code repository receives the node creation request and creates a modified node through commit (operation instruction).

[0158] S372: The terminal sends the version control file with updated version information to the code repository, so that the modification node replaces the stored version control file with the version control file with updated version information.

[0159] In some embodiments, the terminal sends the version control file with updated version information to the code repository with the help of the server. Since the version control file with updated version information may be updated later, or the version control file with updated version information needs to be obtained when the code file is packaged later, the version control file with updated version information needs to be saved.

[0160] In the disclosed embodiment, by creating a modification node, the version control file with updated version information is sent to the code repository for storage, thereby realizing the preservation of each update, saving both the modification record and the modified file, and the file storage security is relatively high.

[0161] In the disclosed embodiment, when the branch is released, the code file and the version control file after the updated version information need to be packaged, and accordingly, the method further includes step S38. In this step, the terminal packages the code file and the version control file after the updated version information based on the file identifier, and accordingly, the implementation method of this step includes the following steps S381-S383:

[0162] S381: The terminal obtains the code file from the code repository based on the file identifier.

[0163] The code repository is also used to store branch files. Accordingly, the implementation of this step is similar to the implementation of the terminal obtaining the version control file corresponding to the code file from the code repository based on the file identifier, and will not be repeated here.

[0164] S382: The terminal packages the code file and the version control file with updated version information to obtain an installation package.

[0165] The installation package is the installation package of the application to which the branch belongs.

[0166] S383: The terminal releases the installation package.

[0167] The terminal may publish the installation package in an application market including the application program, so that users can download and install the package.

[0168] In the disclosed embodiment, a code file is obtained through a file identifier, and then the code file and a version control file with updated version information are packaged to obtain an installation package of the application. There is no need to manually modify the version control file, and the packaging efficiency is high.

[0169] Figure 6 is a flowchart of a version information updating method according to an exemplary embodiment. Figure 6 As shown, the method is used in a terminal. In the disclosed embodiment, application development is performed in a first application, and version information is updated in a second application, that is, file information of a target branch is obtained based on an encapsulated control command. The method includes the following steps.

[0170] In step S61, the terminal obtains file information based on the encapsulated control command, where the file information is file information of a code file of version information to be updated.

[0171] In some embodiments, the terminal can parse the file information from the control command by itself; Figure 7 , the implementation of this step includes the following steps S611A-S612A:

[0172] S611A: The terminal obtains the input control command, which carries the file information.

[0173] The user inputs a control command through the terminal, and in response to the input operation of the control command, the terminal obtains the control command.

[0174] S612A: The terminal parses the file information from the control command.

[0175] In some embodiments, the terminal scans the control command, determines the control field where the file information is located, and obtains the file information from the control field.

[0176] In the embodiment of the present disclosure, the terminal directly obtains the input control command through data interaction between terminals, and the information acquisition efficiency is high.

[0177] In some embodiments, the terminal may obtain the file information through a target server that provides services for the target application; Figure 8 , the implementation of this step includes the following steps S611B-S613B:

[0178] S611B: The terminal obtains the input control command based on the currently running target application, and the control command carries the file information.

[0179] Among them, for the currently running target application, the user can input control commands through the terminal.

[0180] S612B: The terminal sends the control command to the target server corresponding to the target application, so that the target server parses the control command to obtain the file information.

[0181] The terminal implements information exchange with the target server with the help of the server. Accordingly, the terminal sends the control command to the server, and the server forwards the control command to the target server; the target server receives the control command, parses the file information from the control command, generates a push event carrying the file information, and sends the push event to the server.

[0182] S613B: The terminal receives the file information parsed by the target server.

[0183] In this step, the server forwards the file information to the terminal, so that the terminal receives the push event through the reverse API of the code repository and obtains the file information from the push event. For example, the reverse API is a webhook interface.

[0184] In the disclosed embodiment, since the file information is parsed with the help of the target server, the terminal does not need to perform the operation of parsing the file information from the control command, and thus does not need to configure the relevant parsing function, thereby reducing the design cost of the terminal.

[0185] In the disclosed embodiment, the file information is directly obtained through control commands without developing a target page, thereby saving development costs and improving development efficiency.

[0186] In step S62, the terminal parses the target version information of the code file from the file information.

[0187] In step S63, the terminal parses the file information to obtain the file identifier of the code file.

[0188] In step S64, the terminal obtains the version control file corresponding to the code file from the code repository based on the file identifier, and the code repository is used to store version control files.

[0189] In step S65, the terminal updates the version information in the version control file based on the target version information.

[0190] In some embodiments, the implementation of steps S62 to S65 is the same as the implementation of steps S33 to S36, and will not be repeated here.

[0191] In the disclosed embodiment, since the file information of the code file includes version information and file identifier, the version control file corresponding to the code file is obtained by parsing the file identifier, and the version information in the version control file is updated by the parsed version information, thereby realizing automatic update of the version information before packaging the code file, so that the technician does not need to manually update the version information, thereby saving update time and improving the efficiency of version information updating.

[0192] Fig. 9 is a block diagram of a version information updating device according to an exemplary embodiment. Fig. 9 The device 90 includes a first acquisition unit 901, a parsing unit 902, a second acquisition unit 903 and an updating unit 904.

[0193] The first acquisition unit 901 is configured to execute acquisition of file information, where the file information is file information of a code file of a target branch, and the target branch is a branch of version information to be updated;

[0194] A parsing unit 902 is configured to parse the target version information and the file identifier of the code file from the file information;

[0195] A second obtaining unit 903 is configured to obtain a version control file corresponding to the code file from a code repository based on the file identifier, where the code repository is used to store version control files;

[0196] The updating unit 904 is configured to update the version information in the version control file based on the target version information.

[0197] In some embodiments, the first acquisition unit 901 is configured to execute display of a target page, where the target page includes an input entry; and in response to an input operation triggered based on the input entry, acquire the input file information.

[0198] In some embodiments, the first acquisition unit 901 includes:

[0199] The acquisition subunit is configured to execute the encapsulated control command to acquire the file information.

[0200] In some embodiments, the acquisition sub-unit is configured to execute based on the currently running target application, obtain the input control command, and the control command carries the file information; send the control command to the target server corresponding to the target application, so that the target server parses the file information from the control command; and receive the file information parsed by the target server.

[0201] In some embodiments, the acquisition subunit is configured to execute acquisition of an input control command, where the control command carries the file information; and parse the file information from the control command.

[0202] In some embodiments, the parsing unit 902 is configured to perform a target matching function to match the target version information from the file information, and the target matching function is used to parse the target version information from the file information.

[0203] In some embodiments, the updating unit 904 is configured to scan the version control file to obtain a version control field of the version control file; and replace the version information corresponding to the version control field with the target version information.

[0204] In some embodiments, the second acquisition unit 903 is configured to execute a file acquisition request to the code repository through an interface with the code repository, where the file acquisition request carries the file identifier, and is used by the code repository to obtain the version control file corresponding to the code file based on the file identifier; and receive the version control file sent by the code repository.

[0205] In some embodiments, the apparatus further comprises:

[0206] A creation unit is configured to execute control to create and modify nodes in the code repository;

[0207] The sending unit is configured to execute sending of the version control file with updated version information to the code repository, so that the modification node replaces the stored version control file with the version control file with updated version information.

[0208] In some embodiments, the apparatus further comprises:

[0209] A third obtaining unit is configured to obtain the code file from the code repository based on the file identifier;

[0210] A packaging unit is configured to package the code file and the version control file after the version information is updated to obtain an installation package;

[0211] The publishing unit is configured to execute publishing of the installation package.

[0212] In the disclosed embodiment, since the file information of the code file includes version information and file identifier, the version control file corresponding to the code file is obtained by parsing the file identifier, and the version information in the version control file is updated by the parsed version information, thereby realizing automatic update of the version information before packaging the code file, so that the technician does not need to manually update the version information, thereby saving update time and improving the efficiency of version information updating.

[0213] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0214] Fig.10 1 is a block diagram of a terminal 10 according to an exemplary embodiment. In some embodiments, the terminal 10 may be a smart phone, a tablet computer, a laptop computer, or a desktop computer. The terminal 10 may also be called a user equipment, a portable terminal, a laptop terminal, a desktop terminal, or other names.

[0215] Typically, the terminal 10 includes a processor 101 and a memory 102 .

[0216] In some embodiments, the processor 101 includes one or more processing cores, such as a 4-core processor, an 8-core processor, etc. In some embodiments, the processor 101 is implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). In some embodiments, the processor 101 also includes a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 101 is integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 101 also includes an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0217] In some embodiments, the memory 102 includes one or more computer-readable storage media, which are non-transitory. In some embodiments, the memory 102 also includes a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 102 is used to store at least one instruction, which is used to be executed by the processor 101 to implement the version information update method provided in the method embodiment of the present disclosure.

[0218] In some embodiments, the terminal 10 may further optionally include: a peripheral device interface 103 and at least one peripheral device. In some embodiments, the processor 101, the memory 102 and the peripheral device interface 103 are connected via a bus or a signal line. In some embodiments, each peripheral device is connected to the peripheral device interface 103 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 104, a display screen 105, a camera assembly 106, an audio circuit 107, a positioning assembly 108 and a power supply 109.

[0219] The peripheral device interface 103 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 101 and the memory 102. In some embodiments, the processor 101, the memory 102, and the peripheral device interface 103 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 101, the memory 102, and the peripheral device interface 103 are implemented on a separate chip or circuit board, which is not limited in this embodiment.

[0220] The radio frequency circuit 104 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 104 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 104 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. In some embodiments, the radio frequency circuit 104 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. In some embodiments, the radio frequency circuit 104 communicates with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 104 also includes circuits related to NFC (Near Field Communication), which is not limited in the present disclosure.

[0221] The display screen 105 is used to display a UI (User Interface). In some embodiments, the UI includes graphics, text, icons, videos, and any combination thereof. When the display screen 105 is a touch display screen, the display screen 105 also has the ability to collect touch signals on the surface or above the surface of the display screen 105. In some embodiments, the touch signal is input as a control signal to the processor 101 for processing. At this time, the display screen 105 is also used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 105 is one, which is arranged on the front panel of the terminal 10; in other embodiments, the display screen 105 is at least two, which are arranged on different surfaces of the terminal 10 or are folded; in other embodiments, the display screen 105 is a flexible display screen, which is arranged on a curved surface or a folded surface of the terminal 10. Even, the display screen 105 is also arranged in a non-rectangular irregular shape, that is, a special-shaped screen. In some embodiments, the display screen 105 is made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, organic light-emitting diode).

[0222] The camera assembly 106 is used to capture images or videos. In some embodiments, the camera assembly 106 includes a front camera and a rear camera. Typically, the front camera is disposed on the front panel of the terminal, and the rear camera is disposed on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize the panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 106 also includes a flash. In some embodiments, the flash is a monochrome temperature flash, and in some embodiments, the flash is a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which is used for light compensation at different color temperatures.

[0223] In some embodiments, the audio circuit 107 includes a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 101 for processing, or input them into the RF circuit 104 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, in some embodiments, there are multiple microphones, which are respectively arranged at different parts of the terminal 10. In some embodiments, the microphone is an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 101 or the RF circuit 104 into sound waves. In some embodiments, the speaker is a traditional film speaker, and in some embodiments, the speaker is a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 107 also includes a headphone jack.

[0224] The positioning component 108 is used to locate the current geographical location of the terminal 10 to implement navigation or LBS (Location Based Service). In some embodiments, the positioning component 107 is a positioning component based on the US GPS (Global Positioning System), China's Beidou system or Russia's Galileo system.

[0225] The power supply 109 is used to power various components in the terminal 10. In some embodiments, the power supply 109 is an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 109 includes a rechargeable battery, the rechargeable battery is a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged through a wired line, and a wireless rechargeable battery is a battery that is charged through a wireless coil. The rechargeable battery is also used to support fast charging technology.

[0226] In some embodiments, the terminal 10 further includes one or more sensors 110 , including but not limited to: an acceleration sensor 111 , a gyroscope sensor 112 , a pressure sensor 113 , a fingerprint sensor 114 , an optical sensor 115 , and a proximity sensor 116 .

[0227] In some embodiments, the acceleration sensor 111 detects the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal 10. For example, the acceleration sensor 111 is used to detect the components of gravity acceleration on the three coordinate axes. In some embodiments, the processor 101 controls the display screen 105 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 111. In some embodiments, the acceleration sensor 111 is also used to collect motion data of games or users.

[0228] In some embodiments, the gyro sensor 112 detects the body direction and rotation angle of the terminal 10, and the gyro sensor 112 cooperates with the acceleration sensor 111 to collect the user's 3D actions on the terminal 10. The processor 101 can implement the following functions based on the data collected by the gyro sensor 112: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.

[0229] In some embodiments, the pressure sensor 113 is disposed on the side frame of the terminal 10 and / or the lower layer of the display screen 105. When the pressure sensor 113 is disposed on the side frame of the terminal 10, it can detect the user's holding signal of the terminal 10, and the processor 101 performs left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 113. When the pressure sensor 113 is disposed on the lower layer of the display screen 105, the processor 101 controls the operability controls on the UI interface according to the user's pressure operation on the display screen 105. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.

[0230] The fingerprint sensor 114 is used to collect the user's fingerprint, and the processor 101 identifies the user's identity based on the fingerprint collected by the fingerprint sensor 114, or the fingerprint sensor 114 identifies the user's identity based on the collected fingerprint. When the user's identity is identified as a trusted identity, the processor 101 authorizes the user to perform relevant sensitive operations, which include unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings. In some embodiments, the fingerprint sensor 114 is set on the front, back or side of the terminal 10. When a physical button or a manufacturer logo is set on the terminal 10, the fingerprint sensor 114 is integrated with the physical button or the manufacturer logo.

[0231] The optical sensor 115 is used to collect the ambient light intensity. In one embodiment, the processor 101 controls the display brightness of the display screen 105 according to the ambient light intensity collected by the optical sensor 115. Specifically, when the ambient light intensity is high, the display brightness of the display screen 105 is increased; when the ambient light intensity is low, the display brightness of the display screen 105 is decreased. In another embodiment, the processor 101 also dynamically adjusts the shooting parameters of the camera assembly 106 according to the ambient light intensity collected by the optical sensor 115.

[0232] The proximity sensor 116, also called a distance sensor, is usually disposed on the front panel of the terminal 10. The proximity sensor 116 is used to collect the distance between the user and the front of the terminal 10. In one embodiment, when the proximity sensor 116 detects that the distance between the user and the front of the terminal 10 is gradually decreasing, the processor 101 controls the display screen 105 to switch from the screen-on state to the screen-off state; when the proximity sensor 116 detects that the distance between the user and the front of the terminal 10 is gradually increasing, the processor 101 controls the display screen 105 to switch from the screen-off state to the screen-on state.

[0233] Those skilled in the art will understand that Fig.10 The structure shown in the figure does not constitute a limitation on the terminal 10, and the terminal 10 can include more or less components than shown in the figure, or combine some components, or adopt a different component arrangement.

[0234] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 102 including instructions, and the instructions can be executed by the processor 102 of the terminal 10 to complete the version information update method in the above embodiment. Optionally, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0235] In an exemplary embodiment, a computer program product is further provided. The computer program product includes a computer program / instruction. When the computer program / instruction is executed by a processor, the version information updating method in the above embodiment is implemented.

[0236] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0237] It should be understood that the present disclosure is not limited to the exact structures that have been 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 present disclosure is limited only by the appended claims.

Claims

1. A version information updating method, characterized in that: include: Based on the currently running target application, an input control command is obtained, where the control command carries file information, where the file information is file information of a code file of a target branch, where the target branch is a branch of version information to be updated in the application, where each function of the application corresponds to a branch, and the file information is a file name of the code file; Sending the control command to a target server corresponding to the target application, so that the target server parses the file information from the control command and generates a push event for the file information; Receiving the push event through a reverse API of the code repository, and obtaining the file information from the push event; Verifying the file information based on the target matching function, and if the file information is not standardized, stopping the update operation of the version information of the target branch; If the file information is standardized, then based on the target matching function, the target version information of the code file is parsed from the file information; and the file identifier of the code file is parsed from the file information, where the file identifier is the information in the header of the file information; Based on the file identifier, obtaining a version control file corresponding to the code file from the code repository, where the code repository is used to store version control files; Scan the version control file to obtain the version control field of the version control file; The version information corresponding to the version control field is replaced with the target version information.

2. The version information updating method according to claim 1, characterized in that: The method further comprises: Displaying a target page, wherein the target page includes an input entry; In response to an input operation triggered based on the input entry, the input file information is acquired.

3. The version information updating method according to claim 1, characterized in that: The acquiring, based on the file identifier, a version control file corresponding to the code file from the code repository includes: Sending a file acquisition request to the code repository through an interface with the code repository, wherein the file acquisition request carries the file identifier, and is used by the code repository to acquire a version control file corresponding to the code file based on the file identifier; Receive the version control file sent by the code repository.

4. The version information updating method according to claim 1, characterized in that: The method further comprises: Controlling the code repository to create and modify nodes; The version control file with updated version information is sent to the code repository, so that the modification node replaces the stored version control file with the version control file with updated version information.

5. The version information updating method according to claim 1, characterized in that: The method further comprises: Based on the file identifier, obtaining the code file from the code repository; Packaging the code file and the version control file with updated version information to obtain an installation package; Publish the installation package.

6. A version information updating device, characterized in that: include: The first acquisition unit includes an acquisition subunit, which is configured to execute based on the currently running target application and acquire the input control command, wherein the control command carries file information, and the file information is file information of the code file of the target branch, the target branch is the branch of the version information to be updated in the application, each function of the application corresponds to a branch, and the file information is the file name of the code file; Sending the control command to a target server corresponding to the target application, so that the target server parses the file information from the control command and generates a push event for the file information; Receiving the push event through a reverse API of the code repository, and obtaining the file information from the push event; a parsing unit configured to perform verification of the file information based on a target matching function, and if the file information is not standardized, stop the update operation of the version information of the target branch; if the file information is standardized, parse the target version information of the code file from the file information based on the target matching function; and The parsing unit is further configured to parse the file identifier of the code file from the file information, where the file identifier is information in the header of the file information; A second acquisition unit is configured to acquire, based on the file identifier, a version control file corresponding to the code file from the code repository, where the code repository is used to store version control files; The updating unit is configured to scan the version control file to obtain the version control field of the version control file; and replace the version information corresponding to the version control field with the target version information.

7. The version information updating device according to claim 6, characterized in that: The first acquisition unit is configured to execute display of a target page, the target page including an input entry; and acquire the input file information in response to an input operation triggered by the input entry.

8. The version information updating device according to claim 6, characterized in that: The second acquisition unit is configured to execute, through an interface between the code repository and the code repository, sending a file acquisition request to the code repository, wherein the file acquisition request carries the file identifier, and is used by the code repository to acquire a version control file corresponding to the code file based on the file identifier; Receive the version control file sent by the code repository.

9. The version information updating device according to claim 6, characterized in that: The device also includes: A creation unit, configured to execute control of the code repository to create a modification node; The sending unit is configured to execute sending the version control file with updated version information to the code repository, so that the modification node replaces the stored version control file with the version control file with updated version information.

10. The version information updating device according to claim 6, characterized in that: The device also includes: A third acquisition unit is configured to acquire the code file from the code repository based on the file identifier; A packaging unit is configured to package the code file and the version control file after the version information is updated to obtain an installation package; The publishing unit is configured to execute publishing of the installation package.

11. A terminal, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the version information updating method according to any one of claims 1 to 5.

12. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of a terminal, the terminal is enabled to execute the version information updating method according to any one of claims 1 to 5.

13. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the version information updating method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Application construction method and system, computer equipment and storage medium

    CN108287694A