Version synchronization method and apparatus, computer device, and storage medium
By monitoring version updates in the Git workflow and automatically determining the version to be synchronized using attribute information, the problem of low reliability of manual synchronization is solved, achieving efficient and reliable version synchronization.
Patent Information
- Application Number
- CN202210241203.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-11
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2042-03-11
AI Technical Summary
In existing technologies, application version synchronization relies on manual operation, resulting in low synchronization reliability and easy omission of some versions from synchronization.
By monitoring version updates in the Git workflow, the application's attribute information is obtained. The application version to be synchronized is automatically determined using preset synchronization rules, and the updated data is synchronized to the corresponding version. The rules include information such as production time, version number, and grayscale indicator.
It automates application version synchronization, improving synchronization reliability and efficiency, and avoiding omissions that occur during manual operation.
Smart Images

Figure CN114579179B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a version synchronization method, apparatus, computer equipment, storage medium, and computer program product. Background Technology
[0002] During application development, Git workflows based on distributed version control systems are typically used to manage different versions of the application. That is, different versions of the same application are managed by different Git workflows. Since multiple different versions of the application are maintained simultaneously in different Git workflows, when a version of the application managed by one Git workflow changes, the changed code or functional modules in that version need to be synchronized to other versions of the same application managed by other Git workflows.
[0003] Currently, when synchronizing changes to a version of an application managed in one Git workflow to other versions of the same application in other Git workflows, it typically relies on developers performing manual version synchronization. However, manual version synchronization often results in omissions in synchronizing certain versions of the application, leading to low reliability. Summary of the Invention
[0004] Therefore, it is necessary to provide a version synchronization method, apparatus, computer device, computer-readable storage medium, and computer program product that can improve the reliability of version synchronization of applications in response to the above-mentioned technical problems.
[0005] Firstly, this application provides a version synchronization method. The method includes:
[0006] If an update to the first version of the application in the first Git workflow is detected, the attribute information and update data of the first version of the application are obtained. Based on the attribute information of the first version of the application, a second version of the application corresponding to the first version of the application is determined from other version applications in other Git workflows using a preset synchronization rule. The second version of the application is the application to be synchronized, and the application identifier of the second version of the application is the same as that of the first version of the application. The preset synchronization rule is a synchronization rule set based on the attribute information of the first version of the application. The update data of the first version of the application is synchronized to the second version of the application.
[0007] In one embodiment, the attribute information includes the production launch time, or the attribute information includes the production launch time and at least one of the version number or grayscale identifier / non-grayscale identifier.
[0008] In one embodiment, if the attribute information includes the production launch time, then based on the attribute information of the first version application, a second version application corresponding to the first version application is determined from other version applications in other Git workflows using preset synchronization rules, including:
[0009] Obtain the release dates of other application versions; determine the time sequence between the release dates of the first application version and the release dates of other application versions; if the release date of the first application version is earlier than the release date of other application versions, then identify the other application versions as the second application version.
[0010] In one embodiment, if the attribute information also includes a grayscale identifier / non-grayscale identifier, then before determining other versions of the application as the second version application, the following steps are also included:
[0011] Determine whether the first version of the application has a non-grayscale identifier; if so, identify the first version of the application corresponding to the grayscale identifier as the second version of the application.
[0012] In one embodiment, if the attribute information also includes a version number, then based on the attribute information of the first version application, a second version application corresponding to the first version application is determined from other version applications in other Git workflows using preset synchronization rules, including:
[0013] If the release date of the first version of the application is equal to the release date of other versions of the application, then determine the relationship between the version number of the first version of the application and the version number of other versions of the application; if the version number of the first version of the application is less than the version number of other versions of the application, then the other versions of the application are identified as the second version of the application.
[0014] In one embodiment, if the attribute information also includes a grayscale identifier / non-grayscale identifier, then before determining other versions of the application as the second version application, the following steps are also included:
[0015] Determine whether the first version of the application has a non-grayscale identifier; if so, identify the first version of the application corresponding to the grayscale identifier as the second version of the application.
[0016] In one embodiment, if the attribute information further includes a grayscale identifier / non-grayscale identifier, the method further includes:
[0017] If the version number of the first version application is equal to the version number of other versions of the application, then determine whether the first version application has a non-grayscale identifier; if so, then the first version application corresponding to the grayscale identifier is identified as the second version application.
[0018] Secondly, this application also provides a version synchronization device. The device includes:
[0019] The acquisition module is used to acquire the attribute information and update data of the first version of the application if an update is detected in the first version of the application in the first Git workflow.
[0020] The determination module is used to determine the second version application corresponding to the first version application from other version applications in other Git workflows based on the attribute information of the first version application and using preset synchronization rules; the second version application is the application to be synchronized, and the application identifier of the second version application is the same as that of the first version application; the preset synchronization rules are the synchronization rules set based on the attribute information of the first version application.
[0021] The synchronization module is used to synchronize updated data from the first version of the application to the second version of the application.
[0022] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method steps of any of the embodiments of the first aspect described above.
[0023] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the method steps of any of the embodiments of the first aspect described above.
[0024] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the method steps described in any of the embodiments of the first aspect.
[0025] The aforementioned version synchronization method, apparatus, computer equipment, storage medium, and computer program product, if an update to a first version application in a first Git workflow is detected, acquires the attribute information and update data of the first version application; based on the attribute information of the first version application, uses preset synchronization rules to determine a second version application corresponding to the first version application from other version applications in other Git workflows; and synchronizes the update data of the first version application to the second version application; wherein, the second version application is the application to be synchronized, and the application identifier of the second version application is the same as that of the first version application; the preset synchronization rules are synchronization rules set based on the attribute information of the first version application. In the technical solution provided by the embodiments of this application, since multiple different versions of applications are maintained simultaneously in different Git workflows, when a certain version of the application managed in a Git workflow changes, the update data of the application can be automatically synchronized based on the corresponding attribute information and the set synchronization rules, so that no data that needs to be synchronized is missed, improving the reliability of application version synchronization; and the entire synchronization process does not require manual intervention, realizing an automated synchronization method, thereby also improving the efficiency of application version synchronization. Attached Figure Description
[0026] Figure 1 This is an internal structural diagram of a computer device in one embodiment;
[0027] Figure 2 This is a flowchart illustrating a version synchronization method in one embodiment;
[0028] Figure 3 This is a flowchart illustrating the process of determining a second version of the application in one embodiment;
[0029] Figure 4 This is a flowchart illustrating the process of determining a second version of the application in another embodiment;
[0030] Figure 5 This is a flowchart illustrating the process of determining a second version of the application in yet another embodiment;
[0031] Figure 6 This is a flowchart illustrating the process of determining a second version of the application in another embodiment;
[0032] Figure 7 This is a flowchart illustrating the process of determining a second version of the application in another embodiment;
[0033] Figure 8 This is a schematic diagram of the overall process of a version synchronization method in one embodiment;
[0034] Figure 9 This is a structural block diagram of a version synchronization device in one embodiment. Detailed Implementation
[0035] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0036] The version synchronization method provided in this application can be applied to computer devices, which can be servers or terminals. The server can be a single server or a server cluster composed of multiple servers. This application does not specifically limit this. The terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices.
[0037] Taking a computer device as an example, Figure 1 A block diagram of a server is shown, such as Figure 1 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores version synchronization data. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements a version synchronization method.
[0038] Those skilled in the art will understand that Figure 1 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the server to which the present application is applied. Optionally, the server may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0039] It should be noted that the execution subject of the embodiments of this application can be a computer device or a version synchronization device. The following method embodiments will be described with a computer device as the execution subject.
[0040] In one embodiment, such as Figure 2 The diagram illustrates a flowchart of a version synchronization method provided in an embodiment of this application. The method may include the following steps:
[0041] Step 220: If an update to the first version of the application in the first Git workflow is detected, obtain the attribute information and update data of the first version of the application.
[0042] In application development, a Git workflow based on a distributed version control system is typically used to manage different versions of the application. This means different versions of the same application are managed by different Git workflows. A Git workflow represents the workflow of different development branches when multiple people are collaboratively developing an application. If an update is detected in the first version of the application within the first Git workflow—meaning a developer has committed new code—then it is necessary to obtain the attribute information and update data of the first version of the application.
[0043] The attribute information of the first version of the application is extracted from the first Git workflow. When a Git workflow is created, it has corresponding attribute information, which may include the name of the Git workflow, the application identifier, the version number, the production release time, and whether it is a grayscale or non-grayscale indicator. It may also include other types of attribute information, which are not specifically limited in this embodiment. The update data of the first version of the application is the new program code submitted by the developers in the first Git workflow.
[0044] Step 240: Based on the attribute information of the first version application, determine the second version application corresponding to the first version application from other version applications in other Git workflows using preset synchronization rules; the second version application is the application to be synchronized, and the application identifier of the second version application is the same as that of the first version application; the preset synchronization rules are the synchronization rules set based on the attribute information of the first version application.
[0045] The preset synchronization rule can be determined based on the information type in the obtained attribute information. That is, if the attribute information only includes the production time, the preset synchronization rule is determined only based on the production time; if the attribute information includes the production time and the version number, the preset synchronization rule is determined by both the production time and the version number. Examples will not be given here.
[0046] Based on the obtained attribute information of the first version application, after determining the type of attribute information, a second version application corresponding to the first version application is determined from other version applications in other Git workflows using preset synchronization rules. In other words, the second version application that needs to be synchronized is determined from other Git workflows according to the preset synchronization rules. Other version applications may include applications with different deployment times and / or version numbers than the first version application, and may also include applications with the same deployment time and / or version number as the first version application, but with different grayscale / non-grayscale identifiers. Furthermore, it should be noted that when determining the second version application, it is not necessary to check every Git workflow in the database one by one. Instead, based on the application identifier in the attribute information of the first version application, all Git workflows belonging to that application identifier and currently in use can be determined from the database, and then the second version application can be determined from the extracted Git workflows. Since the second version application is determined from other versions of the application, the second version application corresponding to the first version application can include applications with different release time and / or version number than the first version application, or applications with the same release time and / or version number as the first version application but with different grayscale / non-grayscale identifiers.
[0047] Step 260: Synchronize the update data of the first version of the application to the second version of the application.
[0048] Once the second version of the application corresponding to the first version is identified, the update data of the first version can be synchronized to the second version. Specifically, the program code committed in the first Git workflow corresponding to the first version of the application can be directly copied to other Git workflows corresponding to the second version of the application. The copied program code is then merged with the program code corresponding to the second version of the application in other Git workflows to update the second version of the application.
[0049] In this embodiment, if an update to the first version of the application in the first Git workflow is detected, the attribute information and update data of the first version of the application are obtained. Based on the attribute information of the first version of the application, a second version of the application corresponding to the first version of the application is determined from other version applications in other Git workflows using a preset synchronization rule. The update data of the first version of the application is synchronized to the second version of the application. The second version of the application is the application to be synchronized, and the application identifier of the second version of the application is the same as that of the first version of the application. The preset synchronization rule is a synchronization rule set based on the attribute information of the first version of the application. Since multiple different versions of the application are maintained simultaneously in different Git workflows, when a version of the application managed in a Git workflow changes, the update data of the application can be automatically synchronized based on the corresponding attribute information and the set synchronization rule, thus ensuring that no data that needs to be synchronized is missed, improving the reliability of application version synchronization. Furthermore, the entire synchronization process does not require manual intervention, achieving an automated synchronization method, thereby improving the efficiency of application version synchronization.
[0050] In one embodiment, the attribute information includes the production launch time, or the attribute information includes the production launch time and at least one of the version number or grayscale identifier / non-grayscale identifier.
[0051] The attribute information can include only the production launch time, or it can include the production launch time and version number, the production launch time and grayscale / non-grayscale identifier, or the production launch time, version number, and grayscale / non-grayscale identifier. When the attribute information includes different types of information, different preset synchronization rules can be used to synchronize the update data of the first version of the application.
[0052] Specifically, if the attribute information only includes the production launch time, the default synchronization rule is determined solely based on the production launch time; if the attribute information includes the production launch time and the version number, the default synchronization rule is determined jointly based on both the production launch time and the version number; if the attribute information includes both the production launch time and the grayscale / non-grayscale identifier, the default synchronization rule is determined jointly based on both the production launch time and the grayscale / non-grayscale identifier; if the attribute information includes both the production launch time, the version number, and the grayscale / non-grayscale identifier, the default synchronization rule is determined jointly based on all three factors: the production launch time, the version number, and the grayscale / non-grayscale identifier.
[0053] In this embodiment, since the types of attribute information obtained can include a variety, different preset synchronization rules can be flexibly adopted for synchronization. When the types of attribute information obtained are few, version synchronization can still be achieved. When the types of attribute information obtained are many, the application version to be synchronized can be determined more accurately, thereby achieving version synchronization. This ensures the reliability and flexibility of application version synchronization and is applicable to a variety of practical application scenarios.
[0054] In one embodiment, if the attribute information includes the production start time, such as Figure 3 The diagram illustrates a flowchart of a version synchronization method provided in an embodiment of this application, specifically relating to a possible process for determining a second version of an application. This method may include the following steps:
[0055] Step 320: Obtain the production launch time of other versions of the application.
[0056] The "other versions" can include multiple applications, and their deployment dates can be obtained from their corresponding Git workflows. For example, the other versions could include applications A, B, and C, with deployment dates of February 18th, 25th, and March 4th, respectively.
[0057] Step 340: Determine the time sequence between the release time of the first version of the application and the release time of other versions of the application.
[0058] After obtaining the release dates of other application versions, the release date of the first application version can be determined by comparing its time sequence with that of the other versions. The second application version can then be identified based on this time sequence. If there are multiple other application versions, the release date of the first application version can be compared with the release dates of each of the other versions.
[0059] Step 360: If the first version of the application is launched earlier than the other versions of the application, then the other versions of the application are identified as the second version of the application.
[0060] In this scenario, if the first version of the application was released earlier than the other versions, it indicates that the first version is a lower version, while the other versions are higher versions. Generally, higher versions of the application have more comprehensive functions and are more stable than lower versions, thus requiring updates. Applications released later than the first version are designated as second versions. These second versions can be all or some of the other versions. For example, if the first version was released on February 14th, it was released earlier than versions A, B, and C, so all three versions (A, B, and C) can be considered second versions. If the first version was released on February 20th, it was released only earlier than versions B and C, so versions B and C are considered second versions.
[0061] In this embodiment, the production time of other application versions is obtained; the chronological order between the production time of the first application version and the production time of other application versions is determined; if the production time of the first application version is earlier than the production time of other application versions, then the other application versions are identified as the second application version. Determining the second application version to be synchronized based on production time is a simple and reliable comparison method, thereby improving the reliability and convenience of application version synchronization.
[0062] Based on the above embodiments, if the attribute information also includes grayscale / non-grayscale identifiers, before determining other versions of the application as the second version application, such as... Figure 4 The diagram illustrates a flowchart of a version synchronization method provided in an embodiment of this application, specifically relating to another possible process for determining a second version of the application. This method may include the following steps:
[0063] Step 420: Determine whether the first version of the application has a non-grayscale identifier.
[0064] If the attribute information also includes grayscale / non-grayscale identifiers, that is, the attribute information includes the production launch time and the grayscale / non-grayscale identifiers. The application can be released in a grayscale or non-grayscale manner, so the attribute information of the first version of the application can also include grayscale / non-grayscale identifiers. Grayscale release refers to a release method that allows for a smooth transition between black and white, and A / B testing can be performed on it. That is, some users continue to use product feature A, while some users start using product feature B. If users have no objections to B, then the scope is gradually expanded, and all users are migrated to B. The attribute information of the first version of the application can be used to determine whether the first version of the application has a non-grayscale identifier.
[0065] Step 440: If yes, then the first version of the application corresponding to the grayscale identifier is identified as the second version of the application.
[0066] Specifically, if the first version of the application has a non-grayscale identifier, then the first version of the application with the grayscale identifier will also be identified as the second version of the application. This means that the first version of the application with the grayscale identifier will also be updated, ensuring that the version of the application with the grayscale identifier is the latest. For example, if other versions of the application include application D, and D and the first version of the application were launched at the same time, and D has a grayscale identifier while the first version of the application has a non-grayscale identifier, then D also needs to be identified as the second version of the application.
[0067] In this embodiment, it is determined whether the first version of the application has a non-grayscale identifier; if so, the first version of the application corresponding to the grayscale identifier is identified as the second version of the application. Thus, in the scenario of grayscale release, it is also possible to update the grayscale version of the application, ensuring that not only the application with a later production time is updated, but also the grayscale version of the application is updated, improving the accuracy of identifying the second version of the application, and thus enabling a more comprehensive update of all applications to be synchronized.
[0068] In one embodiment, if the attribute information also includes a version number, such as Figure 5 The diagram illustrates a flowchart of a version synchronization method provided in an embodiment of this application, specifically relating to another possible process for determining a second version of the application. This method may include the following steps:
[0069] Step 520: If the release time of the first version of the application is equal to the release time of other versions of the application, then determine the size relationship between the version number of the first version of the application and the version number of other versions of the application.
[0070] If the attribute information also includes a version number, meaning it includes both the release date and the version number, then if the release date of the first version of the application is equal to the release dates of other versions, the second version of the application needs to be determined by combining the version number of the first version with the version numbers of the other versions. Specifically, the second version can be determined by comparing the size of the version number of the first version with the version numbers of the other versions. For example, the other versions could include three applications, A, B, and C, with version numbers 2.0, 4.0, and 6.0 respectively. Here, the release dates of these three applications are all the same as the release date of the first version.
[0071] Step 540: If the version number of the first version application is less than the version number of other versions of the application, then the other versions of the application are identified as the second version application.
[0072] In this process, if the version number of the first version of the application is lower than the version numbers of other versions, it indicates that the first version is older, while the other versions are newer. Therefore, applications with version numbers higher than the first version are designated as the second version. The second version can be all or some of the other versions. For example, if the first version is 1.0, then all three versions (A, B, and C) have version numbers lower than the first version's version numbers, making them all second version applications. If the first version is 3.0, then it only has version numbers lower than the second version's version numbers (B and C).
[0073] In this embodiment, if the production time of the first version of the application is equal to the production time of other versions of the application, the version number of the first version of the application is compared with the version number of other versions of the application. If the version number of the first version of the application is less than the version number of other versions of the application, then the other versions of the application are identified as the second version of the application. By combining the production time and version number to determine the second version of the application, the determination method is simple and reliable, thereby improving the reliability and convenience of application version synchronization.
[0074] Based on the above embodiments, if the attribute information also includes grayscale / non-grayscale identifiers, before determining other versions of the application as the second version application, such as... Figure 6The diagram illustrates a flowchart of a version synchronization method provided in an embodiment of this application, specifically relating to another possible process for determining a second version of the application. This method may include the following steps:
[0075] Step 620: Determine whether the first version of the application has a non-grayscale identifier.
[0076] Step 640: If yes, then the first version of the application corresponding to the grayscale identifier is identified as the second version of the application.
[0077] If the attribute information also includes grayscale / non-grayscale identifiers, meaning the attribute information simultaneously includes the release date, version number, and grayscale / non-grayscale identifier, and if the version number of the first version application is lower than the version numbers of other versions of the application, it can be determined whether the first version application has a non-grayscale identifier. The first version application with a grayscale identifier can then be identified as the second version application. This ensures that the first version applications with grayscale identifiers within the same version are also updated, making the version of the applications with grayscale identifiers the latest. For example, if other versions of the application include application D, and D and the first version application belong to the same release date and version number, and D has a grayscale identifier while the first version application has a non-grayscale identifier, then D should also be considered as the second version application.
[0078] In this embodiment, it is determined whether the first version of the application has a non-grayscale identifier; if so, the first version of the application corresponding to the grayscale identifier is identified as the second version of the application. Thus, even in a grayscale release scenario, updates to grayscale versions of the application can be achieved. This ensures that updates are made not only to applications with higher version numbers but also to grayscale versions of the same version, improving the accuracy of identifying the second version of the application. Consequently, updates to all applications awaiting synchronization can be performed more comprehensively.
[0079] Based on the above embodiments, if the attribute information also includes grayscale identifier / non-grayscale identifier; Figure 7 The diagram illustrates a flowchart of a version synchronization method provided in an embodiment of this application, specifically relating to another possible process for determining a second version of the application. This method may include the following steps:
[0080] Step 720: If the version number of the first version of the application is equal to the version number of other versions of the application, then determine whether the first version of the application has a non-grayscale identifier.
[0081] Step 740: If yes, then the first version of the application corresponding to the grayscale identifier is identified as the second version of the application.
[0082] If the attribute information also includes grayscale / non-grayscale identifiers (i.e., the attribute information includes both release date, version number, and grayscale / non-grayscale identifier), and the release date and version number are the same, the second version application can be determined by whether the first version application has a non-grayscale identifier. Specifically, the first version application with a grayscale identifier can also be identified as the second version application, thus updating the first version application with the grayscale identifier to ensure it is the latest version. This allows updating the first version application, which has the same release date and version number as the first version application and also has a grayscale identifier.
[0083] In this embodiment, if the version number of the first version application is equal to the version number of other versions of the application, it is determined whether the first version application has a non-grayscale identifier; if so, the first version application corresponding to the grayscale identifier is determined as the second version application. By combining the production time, version number, and grayscale identifier / non-grayscale identifier to determine the second version application, the determination method is simple and reliable, thereby improving the reliability and convenience of application version synchronization.
[0084] In one embodiment, such as Figure 8 The diagram illustrates a flowchart of a version synchronization method provided in an embodiment of this application. The method may include the following steps:
[0085] Step 801: If an update to the first version of the application in the first Git workflow is detected, obtain the attribute information and update data of the first version of the application; the attribute information includes the production time, version number, and grayscale / non-grayscale identifier.
[0086] Step 802: Obtain the production launch time of other versions of the application.
[0087] Step 803: Determine the time sequence between the release time of the first version of the application and the release time of other versions of the application.
[0088] Step 804: If the production time of the first version of the application is later than that of other versions of the application, then the other versions of the application will be set to empty, that is, the update data of the first version of the application will not be synchronized.
[0089] Step 805: If the first version of the application is released earlier than the other versions of the application.
[0090] Step 806: Determine whether the first version of the application has a non-grayscale identifier.
[0091] Step 807: If yes, then identify the first version application corresponding to the grayscale identifier and other versions of the application as the second version application, and synchronize the update data of the first version application to the second version application.
[0092] Step 808: If no, i.e., whether the first version of the application has a grayscale indicator, then identify the other versions of the application as the second version of the application, and synchronize the update data of the first version of the application to the second version of the application.
[0093] Step 809: If the production time of the first version of the application is equal to the production time of other versions of the application.
[0094] Step 810: Determine the relationship between the version number of the first version of the application and the version numbers of other versions of the application.
[0095] Step 811: If the version number of the first version of the application is greater than the version number of other versions of the application, then the other versions of the application are set to empty, that is, the update data of the first version of the application is not synchronized.
[0096] Step 812: If the version number of the first version application is less than the version number of other versions of the application, then the other versions of the application are identified as the second version application.
[0097] Step 813: If the version number of the first version of the application is equal to the version number of other versions of the application.
[0098] Step 814: Determine whether the first version of the application has a non-grayscale identifier.
[0099] Step 815: If yes, then the first version application corresponding to the grayscale identifier is identified as the second version application, and the update data of the first version application is synchronized to the second version application.
[0100] Step 816: If no, i.e., whether the first version of the application has a grayscale indicator, then other versions of the application are determined to be empty, i.e., the update data of the first version of the application is not synchronized.
[0101] In this embodiment, since multiple different versions of the application are maintained simultaneously in different Git workflows, when a certain version of the application managed in a Git workflow changes, the updated data of the application can be automatically synchronized based on the set synchronization rules according to the corresponding attribute information, so that no data that needs to be synchronized is missed, thus improving the reliability of version synchronization of the application; and the entire synchronization process does not require manual intervention, realizing an automated synchronization method, which in turn improves the efficiency of version synchronization of the application.
[0102] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0103] Based on the same inventive concept, this application also provides a version synchronization apparatus for implementing the version synchronization method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more version synchronization apparatus embodiments provided below can be found in the limitations of the version synchronization method described above, and will not be repeated here.
[0104] In one embodiment, such as Figure 9 As shown, a version synchronization device 900 is provided, including: an acquisition module 902, a determination module 904, and a synchronization module 906, wherein:
[0105] The acquisition module 902 is used to acquire the attribute information and update data of the first version of the application if an update is detected in the first version of the application in the first Git workflow.
[0106] The determination module 904 is used to determine the second version application corresponding to the first version application from other version applications in other Git workflows based on the attribute information of the first version application and using preset synchronization rules; the second version application is the application to be synchronized, and the application identifier of the second version application is the same as that of the first version application; the preset synchronization rules are the synchronization rules set based on the attribute information of the first version application.
[0107] Synchronization module 906 is used to synchronize update data from the first version of the application to the second version of the application.
[0108] In one embodiment, the attribute information includes the production launch time, or the attribute information includes the production launch time and at least one of the version number or grayscale identifier / non-grayscale identifier.
[0109] In one embodiment, if the attribute information includes the production time, then based on the attribute information of the first version application, the determining module 904 is specifically used to obtain the production time of other versions of the application; determine the time order between the production time of the first version application and the production time of other versions of the application; if the production time of the first version application is earlier than the production time of other versions of the application, then the other versions of the application are determined as the second version application.
[0110] In one embodiment, if the attribute information also includes a grayscale identifier / non-grayscale identifier, the determination module 904 is further used to determine whether the first version application has a non-grayscale identifier; if so, the first version application corresponding to the grayscale identifier is determined as the second version application.
[0111] In one embodiment, if the attribute information also includes a version number, the determining module 904 is further configured to determine the size relationship between the version number of the first version application and the version number of other version applications if the production time of the first version application is equal to the production time of other version applications; and to determine the other version applications as the second version application if the version number of the first version application is less than the version number of other version applications.
[0112] In one embodiment, if the attribute information also includes a grayscale identifier / non-grayscale identifier, the determination module 904 is further used to determine whether the first version application has a non-grayscale identifier; if so, the first version application corresponding to the grayscale identifier is determined as the second version application.
[0113] In one embodiment, if the attribute information further includes a grayscale identifier / non-grayscale identifier, the determination module 904 is further configured to determine whether the first version application has a non-grayscale identifier if the version number of the first version application is equal to the version number of other versions application; if so, the first version application corresponding to the grayscale identifier is determined as the second version application.
[0114] Each module in the aforementioned version synchronization device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0115] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0116] If an update to the first version of the application in the first Git workflow is detected, the attribute information and update data of the first version of the application are obtained. Based on the attribute information of the first version of the application, a second version of the application corresponding to the first version of the application is determined from other version applications in other Git workflows using preset synchronization rules. The second version of the application is the application to be synchronized, and the application identifier of the second version of the application is the same as that of the first version of the application. The preset synchronization rules are the synchronization rules set based on the attribute information of the first version of the application. The update data of the first version of the application is synchronized to the second version of the application.
[0117] In one embodiment, the attribute information includes the production launch time, or the attribute information includes the production launch time and at least one of the version number or grayscale identifier / non-grayscale identifier.
[0118] In one embodiment, the attribute information includes the production start time;
[0119] When a processor executes a computer program, it also performs the following steps:
[0120] Obtain the release dates of other application versions; determine the time sequence between the release dates of the first application version and the release dates of other application versions; if the release date of the first application version is earlier than the release date of other application versions, then identify the other application versions as the second application version.
[0121] In one embodiment, the attribute information may also include grayscale / non-grayscale identifiers;
[0122] When a processor executes a computer program, it also performs the following steps:
[0123] Determine whether the first version of the application has a non-grayscale identifier; if so, identify the first version of the application corresponding to the grayscale identifier as the second version of the application.
[0124] In one embodiment, the attribute information may also include a version number;
[0125] When a processor executes a computer program, it also performs the following steps:
[0126] If the release date of the first version of the application is equal to the release date of other versions of the application, then determine the relationship between the version number of the first version of the application and the version number of other versions of the application; if the version number of the first version of the application is less than the version number of other versions of the application, then the other versions of the application are identified as the second version of the application.
[0127] In one embodiment, the attribute information may also include grayscale / non-grayscale identifiers;
[0128] When a processor executes a computer program, it also performs the following steps:
[0129] Determine whether the first version of the application has a non-grayscale identifier; if so, identify the first version of the application corresponding to the grayscale identifier as the second version of the application.
[0130] In one embodiment, the attribute information may also include grayscale / non-grayscale identifiers;
[0131] When a processor executes a computer program, it also performs the following steps:
[0132] If the version number of the first version application is equal to the version number of other versions of the application, then determine whether the first version application has a non-grayscale identifier; if so, then the first version application corresponding to the grayscale identifier is identified as the second version application.
[0133] The computer device provided in this application embodiment has a similar implementation principle and technical effect to the above method embodiment, and will not be described again here.
[0134] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0135] If an update to the first version of the application in the first Git workflow is detected, the attribute information and update data of the first version of the application are obtained. Based on the attribute information of the first version of the application, a second version of the application corresponding to the first version of the application is determined from other version applications in other Git workflows using preset synchronization rules. The second version of the application is the application to be synchronized, and the application identifier of the second version of the application is the same as that of the first version of the application. The preset synchronization rules are the synchronization rules set based on the attribute information of the first version of the application. The update data of the first version of the application is synchronized to the second version of the application.
[0136] In one embodiment, the attribute information includes the production launch time, or the attribute information includes the production launch time and at least one of the version number or grayscale identifier / non-grayscale identifier.
[0137] In one embodiment, the attribute information includes the production start time;
[0138] When a computer program is executed by a processor, it also performs the following steps:
[0139] Obtain the release dates of other application versions; determine the time sequence between the release dates of the first application version and the release dates of other application versions; if the release date of the first application version is earlier than the release date of other application versions, then identify the other application versions as the second application version.
[0140] In one embodiment, the attribute information may also include grayscale / non-grayscale identifiers;
[0141] When a computer program is executed by a processor, it also performs the following steps:
[0142] Determine whether the first version of the application has a non-grayscale identifier; if so, identify the first version of the application corresponding to the grayscale identifier as the second version of the application.
[0143] In one embodiment, the attribute information may also include a version number;
[0144] When a computer program is executed by a processor, it also performs the following steps:
[0145] If the release date of the first version of the application is equal to the release date of other versions of the application, then determine the relationship between the version number of the first version of the application and the version number of other versions of the application; if the version number of the first version of the application is less than the version number of other versions of the application, then the other versions of the application are identified as the second version of the application.
[0146] In one embodiment, the attribute information may also include grayscale / non-grayscale identifiers;
[0147] When a computer program is executed by a processor, it also performs the following steps:
[0148] Determine whether the first version of the application has a non-grayscale identifier; if so, identify the first version of the application corresponding to the grayscale identifier as the second version of the application.
[0149] In one embodiment, the attribute information may also include grayscale / non-grayscale identifiers;
[0150] When a computer program is executed by a processor, it also performs the following steps:
[0151] If the version number of the first version application is equal to the version number of other versions of the application, then determine whether the first version application has a non-grayscale identifier; if so, then the first version application corresponding to the grayscale identifier is identified as the second version application.
[0152] The computer-readable storage medium provided in this embodiment is similar in principle and technical effect to the method embodiment described above, and will not be repeated here.
[0153] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0154] If an update to the first version of the application in the first Git workflow is detected, the attribute information and update data of the first version of the application are obtained. Based on the attribute information of the first version of the application, a second version of the application corresponding to the first version of the application is determined from other version applications in other Git workflows using preset synchronization rules. The second version of the application is the application to be synchronized, and the application identifier of the second version of the application is the same as that of the first version of the application. The preset synchronization rules are the synchronization rules set based on the attribute information of the first version of the application. The update data of the first version of the application is synchronized to the second version of the application.
[0155] In one embodiment, the attribute information includes the production launch time, or the attribute information includes the production launch time and at least one of the version number or grayscale identifier / non-grayscale identifier.
[0156] In one embodiment, the attribute information includes the production start time;
[0157] When a computer program is executed by a processor, it also performs the following steps:
[0158] Obtain the release dates of other application versions; determine the time sequence between the release dates of the first application version and the release dates of other application versions; if the release date of the first application version is earlier than the release date of other application versions, then identify the other application versions as the second application version.
[0159] In one embodiment, the attribute information may also include grayscale / non-grayscale identifiers;
[0160] When a computer program is executed by a processor, it also performs the following steps:
[0161] Determine whether the first version of the application has a non-grayscale identifier; if so, identify the first version of the application corresponding to the grayscale identifier as the second version of the application.
[0162] In one embodiment, the attribute information may also include a version number;
[0163] When a computer program is executed by a processor, it also performs the following steps:
[0164] If the release date of the first version of the application is equal to the release date of other versions of the application, then determine the relationship between the version number of the first version of the application and the version number of other versions of the application; if the version number of the first version of the application is less than the version number of other versions of the application, then the other versions of the application are identified as the second version of the application.
[0165] In one embodiment, the attribute information may also include grayscale / non-grayscale identifiers;
[0166] When a computer program is executed by a processor, it also performs the following steps:
[0167] Determine whether the first version of the application has a non-grayscale identifier; if so, identify the first version of the application corresponding to the grayscale identifier as the second version of the application.
[0168] In one embodiment, the attribute information may also include grayscale / non-grayscale identifiers;
[0169] When a computer program is executed by a processor, it also performs the following steps:
[0170] If the version number of the first version application is equal to the version number of other versions of the application, then determine whether the first version application has a non-grayscale identifier; if so, then the first version application corresponding to the grayscale identifier is identified as the second version application.
[0171] The computer program product provided in this embodiment has a similar implementation principle and technical effect to the above method embodiments, and will not be described again here.
[0172] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0173] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0174] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0175] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A version synchronization method, characterized in that, The method includes: If an update to the first version of the application is detected in the first Git workflow, the attribute information and update data of the first version of the application are obtained; wherein, the attribute information includes the production time, or the attribute information includes the production time and at least one of version number or grayscale identifier / non-grayscale identifier; the update data of the first version of the application is the new program code submitted by the developer in the first Git workflow. Based on the attribute information of the first version application, a second version application corresponding to the first version application is determined from other version applications in other Git workflows using preset synchronization rules; the second version application is the application to be synchronized, and the application identifier of the second version application is the same as that of the first version application; the preset synchronization rules are synchronization rules set based on the attribute information of the first version application. The update data of the first version application is synchronized to the second version application; wherein, the step of synchronizing the update data of the first version application to the second version application includes: directly copying the program code submitted in the first Git workflow corresponding to the first version application to other Git workflows corresponding to the second version application, and merging the copied program code with the program code corresponding to the second version application in other Git workflows to update the second version application. If the attribute information includes the production launch time, then the step of determining the second version application corresponding to the first version application from other version applications in other Git workflows using preset synchronization rules based on the attribute information of the first version application includes: Obtain the production launch time of the other versions of the application; determine the time sequence between the production launch time of the first version of the application and the production launch time of the other versions of the application; If the first version of the application is launched earlier than the other versions of the application, then the other versions of the application are identified as the second version of the application; if the first version of the application is launched later than the other versions of the application, then the other versions of the application are identified as empty, that is, the update data of the first version of the application is not synchronized.
2. The method according to claim 1, characterized in that, If the attribute information also includes grayscale / non-grayscale identifiers, then before determining the other version of the application as the second version of the application, the following steps are also included: Determine whether the first version of the application has a non-grayscale identifier; If so, the other version of the application corresponding to the grayscale identifier will be identified as the second version of the application.
3. The method according to claim 1, characterized in that, If the attribute information also includes a version number, then the step of determining the second version application corresponding to the first version application from other version applications in other Git workflows using preset synchronization rules based on the attribute information of the first version application includes: If the production time of the first version of the application is equal to the production time of the other versions of the application, then determine the size relationship between the version number of the first version of the application and the version number of the other versions of the application. If the version number of the first version application is less than the version number of the other version applications, then the other version applications are identified as the second version application.
4. The method according to claim 3, characterized in that, If the attribute information also includes grayscale / non-grayscale identifiers, then before determining the other version of the application as the second version of the application, the following steps are also included: Determine whether the first version of the application has a non-grayscale identifier; If so, the version of other applications corresponding to the grayscale identifier will be identified as the second version application.
5. The method according to claim 3, characterized in that, If the attribute information further includes grayscale / non-grayscale identifiers, the method further includes: If the version number of the first version of the application is equal to the version number of the other versions of the application, then determine whether the first version of the application has a non-grayscale identifier. If so, the other version of the application corresponding to the grayscale identifier will be identified as the second version of the application.
6. A version synchronization device, characterized in that, The device includes: The acquisition module is used to acquire the attribute information and update data of the first version application if an update is detected in the first version application in the first Git workflow; wherein, the attribute information includes the production time, or the attribute information includes the production time and at least one of version number or grayscale identifier / non-grayscale identifier; the update data of the first version application is the new program code submitted by the developer in the first Git workflow. The determination module is used to determine, based on the attribute information of the first version application and using preset synchronization rules, a second version application corresponding to the first version application from other version applications in other Git workflows; the second version application is the application to be synchronized, and the application identifier of the second version application is the same as that of the first version application; the preset synchronization rules are synchronization rules set based on the attribute information of the first version application. A synchronization module is used to synchronize the update data of the first version of the application to the second version of the application; The synchronization module is specifically used to directly copy the program code submitted in the first Git workflow corresponding to the first version of the application to other Git workflows corresponding to the second version of the application, and merge the copied program code with the program code corresponding to the second version of the application in other Git workflows to update the second version of the application. If the attribute information includes the production launch time, then the determining module, based on the attribute information of the first version of the application, is specifically used for: Obtain the production launch time of the other versions of the application; determine the time sequence between the production launch time of the first version of the application and the production launch time of the other versions of the application; If the first version of the application is launched earlier than the other versions of the application, then the other versions of the application are identified as the second version of the application; if the first version of the application is launched later than the other versions of the application, then the other versions of the application are identified as empty, that is, the update data of the first version of the application is not synchronized.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Multi-version parallel development method and system based on gitlab
CN112698815A
Code synchronization method and system, computer equipment and storage medium
CN113672277A
