Code synchronization method, server and storage medium

文档序号:1921174 发布日期:2021-12-03 浏览:10次 中文

阅读说明:本技术 代码同步方法、服务器及存储介质 (Code synchronization method, server and storage medium ) 是由 张纯 于 2020-05-27 设计创作,主要内容包括:本说明书一个或多个实施例公开了一种代码同步方法、服务器及存储介质。该代码同步方法,所述方法包括以下步骤:在代码总目录下设置对应外部源的初始化目录,所述初始化目录下至少包括外部源代码同步清单;在所述代码总目录下执行代码同步操作,以基于所述外部源代码同步清单将所述外部源的代码数据同步至所述代码总目录下的仓库,可以加快外部源代码同步时间的同时还能大大节约存储空间。(One or more embodiments of the present specification disclose a code synchronization method, a server, and a storage medium. The code synchronization method comprises the following steps: setting an initialization directory corresponding to an external source under a total code directory, wherein the initialization directory at least comprises an external source code synchronous list; and executing code synchronization operation under the code general directory to synchronize the code data of the external source to a warehouse under the code general directory based on the external source code synchronization list, so that the external source code synchronization time can be shortened, and meanwhile, the storage space can be greatly saved.)

1. A method of code synchronization, the method comprising the steps of:

setting an initialization directory corresponding to an external source under a total code directory, wherein the initialization directory at least comprises an external source code synchronous list;

and executing code synchronization operation under the code general directory to synchronize the code data of the external source to a warehouse under the code general directory based on the external source code synchronization list.

2. The code synchronization method according to claim 1, before setting an initialization directory corresponding to the external source under the total directory of codes, the initialization directory at least including an external source code synchronization list, the method further comprising:

and performing initialization operation under an external source directory corresponding to the external source to generate the initialization directory.

3. The code synchronization method according to claim 2, wherein when the initialization operation is performed under the external source directory corresponding to the external source to generate the initialization directory, the setting of the initialization directory corresponding to the external source under the total code directory specifically includes:

and establishing a soft link of the initialization directory under the total code directory.

4. The code synchronization method according to claim 2 or 3, wherein before performing an initialization operation under an external source directory and generating the initialization directory, the method further comprises:

receiving a code synchronization command sent by the external source;

identifying parameter information corresponding to the external source from the code synchronization command;

determining the external source directory corresponding to the external source based on the parameter information.

5. The code synchronization method according to claim 4, wherein the performing an initialization operation under an external source directory to generate the initialization directory specifically comprises:

at least acquiring the external source code synchronous list based on the parameter information;

and at least saving the external source code synchronous list to the initialization directory.

6. The code synchronization method of claim 4, before identifying parameter information corresponding to the external source from the code synchronization command, the method further comprising:

and automatically triggering the code to synchronously and automatically execute the task.

7. The code synchronization method according to claim 1, wherein an initialization directory corresponding to the external source is set under the total code directory, and before the initialization directory at least includes the external source code synchronization list, the method further comprises:

confirming that the existing initialized directory exists in the total code directory;

and deleting the existing initialization directory.

8. The code synchronization method of claim 1, after performing a code synchronization operation under a code book to synchronize code data of the external source to a repository under the code book based on the external source code synchronization manifest, the method comprising:

establishing a local code synchronization list based on the external source code synchronization list and locally preset parameter information;

and uploading the local code synchronous list to a local code list library.

9. A server comprising a memory, a processor, a program stored on the memory and executable on the processor, and a data bus for enabling connection communication between the processor and the memory, the program, when executed by the processor, implementing the steps of the code synchronization method according to any one of claims 1 to 8.

10. A storage medium for computer readable storage, the storage medium storing one or more programs which, when executed by one or more processors, perform the steps of a code synchronization method as recited in any of claims 1-8.

Technical Field

The present invention relates to the field of software development technologies, and in particular, to a code synchronization method, a server, and a storage medium.

Background

At present, software development processes are mostly developed again on the basis of an existing open source architecture or a development platform, for example, a Windows operating system relied on for computer software development, and a Linux operating system, an android operating system and the like can be relied on for mobile phone software development.

Terminal manufacturers such as computers or mobile phones need to perform secondary design development and debugging according to the newly released open source codes of the development platform and the baseline software sent by chip manufacturers based on the latest source codes.

However, the traditional code synchronization method only downloads the code of the external source to the local server and then synchronizes the code to the internal library, and if the code volume is particularly large or the downloading network speed is particularly slow, only the synchronization time of the code of the external source needs at least 1 day, which seriously affects the software development progress. Therefore, how to accelerate the synchronization time of the external source code becomes an urgent problem to be solved.

Disclosure of Invention

One or more embodiments of the present disclosure are directed to a code synchronization method, a server, and a storage medium, which can speed up the synchronization time of an external source code and further save the storage space.

To solve the above technical problem, one or more embodiments of the present specification are implemented as follows:

in a first aspect, a method for code synchronization is provided, the method comprising the following steps: setting an initialization directory corresponding to an external source under a total directory of codes, wherein the initialization directory at least comprises an external source code synchronous list; and executing code synchronization operation under the code general directory to synchronize the code data of the external source to a warehouse under the code general directory based on the external source code synchronization list.

In a second aspect, a server is proposed, which comprises a memory, a processor, a program stored on the memory and executable on the processor, and a data bus for enabling a connection communication between the processor and the memory, the program, when executed by the processor, implementing the steps of the code synchronization method as described above.

In a third aspect, a storage medium for a computer-readable storage is proposed, the storage medium storing one or more programs which, when executed by one or more processors, implement the steps of the code synchronization method as described above.

As can be seen from the technical solutions provided by one or more embodiments of the present specification, in the code synchronization method provided by the embodiments of the present specification, the initialization directory is set in the total code directory, the initialization directory corresponding to the external source is established in the local server, and the external source code synchronization list is stored in the initialization directory, so as to determine the corresponding relationship between the initialization directory and the external source. Different initialization directories can be respectively established by different external sources; and finally, code synchronization operation is executed in the code general directory, so that the code data of different external sources can be completely synchronized to the warehouse group in the same code general directory, and the code data of the same part among the different external sources can be automatically deduplicated, thereby effectively improving the code synchronization efficiency, reducing the time cost and the labor cost of code synchronization, accelerating the project research and development process, improving the research and development efficiency and saving the storage space. Particularly, an external source directory corresponding to an external source is established in a local server, after the initialization directory is generated under the external source directory, the soft link of the initialization directory is established under a total code directory, so that the synchronous synchronization of codes from a plurality of external sources can be supported, and the error operation in the middle can be avoided. Therefore, the code synchronization method provided by the application can simultaneously cover the synchronization of the baseline software codes of various chip manufacturers and the code synchronization directly from the software development platform, all external sources are not interfered with each other, the time cost and the labor cost of code synchronization are effectively reduced, and the code synchronization method is particularly suitable for terminal manufacturers who need to frequently synchronize the baseline software codes issued by all chip manufacturers for software development, and completes the updating operation of the internal codes of the development platforms.

Drawings

In order to more clearly illustrate one or more embodiments or prior art solutions of the present specification, reference will now be made briefly to the attached drawings, which are needed in the description of one or more embodiments or prior art, and it should be apparent that the drawings in the description below are only some of the embodiments described in the specification, and that other drawings may be obtained by those skilled in the art without inventive exercise.

Fig. 1 is a schematic diagram illustrating steps of a code synchronization method according to an embodiment of the present disclosure.

Fig. 2 is a schematic diagram of steps of another code synchronization method provided by an embodiment of the present specification.

Fig. 3 is a schematic diagram of steps of another code synchronization method provided by an embodiment of the present specification.

Fig. 4 is a schematic diagram of steps of another code synchronization method provided by an embodiment of the present specification.

Fig. 5 is a schematic diagram of steps of another code synchronization method provided by an embodiment of the present specification.

Fig. 6 is a schematic diagram of steps of another code synchronization method provided by an embodiment of the present specification.

Fig. 7 is a schematic diagram of steps of another code synchronization method provided by an embodiment of the present specification.

Fig. 8 is a schematic diagram of steps of another code synchronization method provided by an embodiment of the present specification.

Fig. 9 is a schematic structural diagram of a server provided in an embodiment of the present specification.

Detailed Description

In order to make the technical solutions in the present specification better understood, the technical solutions in one or more embodiments of the present specification will be clearly and completely described below with reference to the accompanying drawings in one or more embodiments of the present specification, and it is obvious that the one or more embodiments described are only a part of the embodiments of the present specification, and not all embodiments. All other embodiments that can be derived by a person skilled in the art from one or more of the embodiments described herein without making any inventive step shall fall within the scope of protection of this document.

According to the code synchronization method provided by the specification, the initialization directory corresponding to the external source is established locally, and the code synchronization operation is executed after the initialization directory is arranged under the total code directory, so that the code synchronization efficiency is improved. The code synchronization method and its respective steps provided in this specification will be described in detail below.

The code synchronization method provided by the embodiment of the specification is suitable for updating the code synchronization of the code of the internal platform of a terminal manufacturer which needs to acquire the code issued by a development platform or a chip manufacturer for development. It can be understood that the code synchronization method can be applied to code synchronization under any development platform, and can be a development platform of any other applicable operating system, such as a Windows operating system, a Linux operating system, or an android operating system.

It should be noted that all steps and embodiments mentioned in the present application may be operations performed locally, especially on a server that needs to store synchronized code data.

Example one

Referring to fig. 1, a schematic diagram of steps of a code synchronization method provided in an embodiment of the present disclosure is shown. It should be understood that the code synchronization method is not limited to the case of synchronizing the code of one external source, and may be to synchronize the codes of a plurality of external sources at the same time. It should be noted that the external source mentioned in the present application is a code download service provided by an external development platform or a chip manufacturer. The code synchronization method provided by the embodiment of the specification comprises the following steps:

step 10: setting an initialization directory corresponding to an external source under a total code directory, wherein the initialization directory at least comprises an external source code synchronous list;

the initialization directory can be set under the total code directory in a mode of copying or directly creating the initialization directory, and the purpose is that synchronous information of code synchronization can be obtained from the initialization directory under the total code directory, the synchronous information comprises at least an external source code synchronous list corresponding to an external source under the initialization directory, so that the code synchronization operation under the subsequent total code directory is facilitated, and the external source can be synchronized under the subsequent total code directory. Different external sources can be operated under the total code directory, and the baseline codes are issued by chip manufacturers in a label mode when the codes are issued, and branch names are not repeated. Therefore, synchronization can not be interfered with each other even under the same code general directory, so that the same parts among all external sources can not be repeatedly synchronized, and the synchronization efficiency is accelerated.

The code summary catalog is a preset summary catalog for code synchronization, and code data from different external sources are stored in a warehouse under the code summary catalog. The initialization directory may be a folder for storing synchronization information for code synchronization, and may be set under a root directory in the code summary directory.

In some embodiments, a management tool of the development platform can be used to manage multi-warehouse codes, and the method is particularly suitable for a terminal manufacturer who needs to frequently synchronize code data released by the development platform and a chip manufacturer for software development to perform code synchronization updating operation on codes of an internal platform of the terminal manufacturer.

The code synchronization method provided by the embodiment of the specification can effectively improve the efficiency of code synchronization, particularly can support the code synchronization from a plurality of external sources, can cover the synchronization of baseline software codes of various large chip manufacturers, and simultaneously supports the code synchronization directly from an open source development platform. The time cost and the labor cost can be effectively reduced, the code synchronization time is greatly shortened, the project research and development process is accelerated, and the research and development efficiency is improved.

Step 20: and executing a code synchronization operation under the code general directory to synchronize code data of an external source to a warehouse under the code general directory based on the external source code synchronization list.

And executing a code synchronization operation under the code general directory, and synchronizing code data of an external source to a warehouse under the code general directory based on the external source code synchronization list. The external source code synchronization list corresponding to different external sources lists the code labels and the code branches which need to be synchronized respectively. In this step, the code data of the external source may be all synchronized to the warehouse under the code summary directory, and the code data of the external source may be finally stored in the warehouse group under the code summary directory by using a method of pulling the git fetch or other methods. If the code data of a plurality of external sources are stored in the warehouse group under the code general catalog, the code data of the same part between different external sources cannot be repeatedly synchronized, and the code synchronization efficiency is improved. The embodiment of the specification can perform the step of code synchronization under the total code directory by softly linking the initialized directories corresponding to the external sources to the total code directory, thereby greatly improving the reuse rate of a bare warehouse, reducing the disk occupancy rate and improving the synchronization speed. For example, for newly released Android X version open source codes, some chip manufacturers develop and release new baseline code data based on the Android X code, then when synchronizing the baseline code data of a first chip manufacturer, the open source code data of the Android X will be synchronized together in the local database, and when synchronizing the baseline code data released by a second chip manufacturer, which is also developed based on the Android X, the git warehouse under the same code general directory will not repeatedly synchronize the existing data, but only synchronize the newly added baseline code data of the second chip manufacturer, so the code synchronization speed is significantly increased, and the method is particularly suitable for the case of very slow network speed. The code data of a plurality of external sources are synchronized to the same code general directory, so that the research and development progress and the research and development cost can be accelerated and the research and development iteration speed of the mobile phone version can be accelerated due to the fact that all code data are shared in a database and the sustainability of code data coupling sharing development branches based on the same development platform, and a mobile phone manufacturer can always follow the latest technologies of a chip manufacturer and an open source platform and move to the forefront of the related fields.

It is understood that the embodiments of the present description may be applicable to an open source software team, a mobile phone software development team, a chip manufacturer, etc. By adopting the code synchronization method provided by the embodiment of the specification, the code synchronization efficiency can be remarkably improved, the subsequent baseline upgrading and patch acquisition of research and development departments are facilitated, and the whole research and development progress is accelerated.

The code synchronization method provided by the embodiments of the present specification may perform a code synchronization operation based on a code management tool of a development platform, where the code management tools of different development platforms have different commands of the code synchronization operation, and will be described in the following as an example. In addition, the method is related to different external sources in a local link mode, so that the code data of the different external sources are stored in the warehouse group under the same code general catalog. In addition, the method realizes targeted code synchronization by acquiring the latest external source code synchronization list of the external source and automatically switching the local code synchronization list, and can be widely applied to OEM manufacturers, mobile phone manufacturers, personal developers and the like needing to be developed based on the external source code.

Referring to fig. 2, in some embodiments, step 10: the code synchronization method provided by the embodiment of the present specification further includes the following steps:

step 30: and performing initialization operation under an external source directory corresponding to an external source to generate the initialization directory.

Corresponding external source directories are established in advance aiming at different external sources locally, so that the synchronization of code data of different external sources is facilitated. The initialization operation is performed under a preset external source directory, and the purpose of generating the initialization directory is to establish a corresponding relationship between the initialization directory and the external source. Another purpose of generating the initialization directory is to obtain information of this code synchronization, such as an external source code synchronization list, so as to perform subsequent code synchronization based on the external source code synchronization list. The external source code synchronization manifest is provided in the external source each time the code is updated, as described in more detail below.

The code synchronization method provided by the embodiment of the specification can perform code operation on different external sources under the same general directory, store code data of different external sources in the same warehouse group, avoid repeated synchronization of the same part among different external sources, and establish a corresponding relation with the external sources by generating an initialization directory before synchronization.

The initialization operation mentioned here may be a command to perform a code synchronization operation based on code management tools of development platforms, the code management tools of different development platforms each having a different code synchronization operation, with the purpose of generating an initialization directory.

Aiming at the current terminal development platform which is mainly used, a popular Android platform is selected as a development platform to explain the code synchronization method provided by the embodiment of the specification in detail, so that the understanding is facilitated.

The following description will be given in detail by taking the development of mobile phone software based on the Android platform as an example.

The baseline software released by the chip manufacturer based on the Android platform provides the code downloading service by issuing a repo downloading command, and the code downloading service is the external source mentioned above.

And initializing by using a REPO tool according to the command REPO _ CMD of the external source, wherein the initialization operations corresponding to different commands of the external source are different. The method comprises the following specific steps:

1. high-pass REPO _ CMD:

repo init-u$CAF_MANIFEST_REPO-b release-m$CAF_MANIFEST--repo-url=git://codeaurora.org/tools/repo.git--repo-branch=caf-stable;

REPO _ CMD for MTK:

repo init-u$MTK_MANIFEST_REPO-b$MTK_BRANCH-m$MTK_MANIFEST--no-repo-verify;

3. extended REPO _ CMD:

repo init-u$ST_MANIFEST_REPO-b$ST_MANIFEST--repo-url=ssh://[email protected]:29418/tools/repo.git。

each set of baseline software of each chip manufacturer and external sources such as open source codes of Google are published by issuing an external source synchronous code list manifest, and after acquiring the external source code synchronous list manifest, a software developer synchronizes all code data to a local code warehouse group according to the content of the external source code synchronous list manifest.

Where CAF _ MANIFEST _ REPO, MTK _ MANIFEST _ REPO and ST _ MANIFEST _ REPO are git repositories for storing Manifest code listings, herein generically referred to as code listings repository MANIFEST _ REPO. Through a repoinit command, a repo folder is initialized under the current local external source directory; then synchronizing MANIFEST code MANIFEST FILEs, including CAF _ MANIFEST, MTK _ MANIFEST, ST _ MANIFEST, etc., which we call MANIFEST _ FILE, to the repo/MANIFEST. And finally, reading content information in the repo/manifest xml when the codes are synchronized, and synchronizing each code warehouse for storing code data of an external source to a code warehouse group on a local code server one by one in a bare warehouse form (-mirror). It should be noted that some of the Manifest _ FILEs are stored in branches of the code List library, Manifest _ REPO, such as the parameter following-b herein, which we will generally refer to as the code List BRANCH, Manifest _ BRANCH.

So the external source's synchronization command REPO _ CMD can be summarized as:

repo init-u$MANIFEST_REPO-b$MANIFEST_BRANCH-m$MANIFEST_FILE

then, switching to the position under the code general directory all _ projects, and executing the reposync-force-sync and repo-force-c commands to synchronize all the code data of the external source into a naked warehouse under the code general directory all _ projects in a way of 'gitfetch'.

In the field of research and development of mobile phone software, particularly in an Android platform, the most upstream of the software is the source code which is the most basic of open source Android and issued by Google on an open source code project AOSP, and all mobile phone chip manufacturers add related driving and tool components and the like of all platform chips based on the Android source code to form a set of brand-new closed source baseline software, so that the closed source baseline software can run on the hardware of their own chip platforms. And mobile phone manufacturers purchase related chips and matched closed-source baseline software for mobile phone chip manufacturers to carry out secondary design development and debugging, further optimize the mobile phone software to enable the mobile phone software to better run on mobile phones produced at home, and finally complete the design and manufacture of mobile phone products. Most of the core modifications related to the chip platform are all from the modification and update of the chip manufacturer to the baseline software, and the newer the software version, the more perfect the function is, the more stable the performance is. Therefore, obtaining the latest closed-source baseline software from chip manufacturers has become one of the most important rings in the whole development process. And mobile phone manufacturers may produce mobile phone products of different models or different series, chips of the mobile phone products may come from different chip manufacturers, when Google publishes the latest source code on the open source code project AOSP, a code library of each chip manufacturer contains tags and code branches of Google codes, and data of each set of codes is largely repeated. The traditional separate and separate synchronization mode leads to larger volume of synchronization, longer synchronization time and high disk occupancy rate, and the same modules of each external source are independent from each other and cannot be mutually sorted and recycled for cherry-pick modification.

Entering into corresponding external source directory, executing REPO _ CMD to add "- - - -minor" parameter to mirror the above-mentioned initialized directory, REPO, and automatically setting external source code synchronous list MANIFEST _ FILE stored in initialized directory as the newest synchronous list.

As shown in fig. 3, in some embodiments, in the code synchronization method provided in this specification, when an initialization operation is performed in an external source directory corresponding to an external source to generate an initialization directory, step 10, setting the initialization directory corresponding to the external source in a total code directory specifically includes:

step 100: and establishing a soft link for initializing the directory under the total directory of the codes.

The initialization directory is arranged under the code general directory, and the purpose of the initialization directory is to acquire code synchronization information such as at least an external source code synchronization list of an external source in the initialization directory under the code general directory, so that the subsequent code synchronization operation under the code general directory is facilitated.

Optionally, the initialization directory set in the external source directory soft links the initialization directory to the total code directory, the soft link mode is fast, errors are not easy to occur, and the disk occupancy rate of the total code directory is reduced.

For example, software development based on the Android platform can establish a soft link under an overall directory all _ project of the code by repo:

all_projects/.repo

cd all_projects

ln-s external source directory/. repo

The code synchronization method provided by the embodiment of the specification changes the traditional code synchronization mode under a separated independent directory, performs code synchronization by softly linking the initialized directories generated under different external source directories to a unique total code directory, switches different external sources by softly linking the initialized directories of different code sources, synchronizes code data of the external sources to the same warehouse group on a local server, and automatically completes the whole process by triggering an automatic code synchronization task. And sharing of code data and directories is realized. And the novel way of initializing the directory soft link makes the speed of the synchronous code much faster, and the disk occupancy rate is not influenced too much if the number of external sources is increased continuously in the future. In addition, a synchronous task does not need to be established for each external source, and after all external source initialization operations are completed, the code data of different external sources can be synchronized only by the code synchronous task scheduling soft link corresponding to the initialization directories of different external sources.

Referring to fig. 4, in some embodiments, in step S10, before performing an initialization operation under an external source directory and generating an initialization directory, the code synchronization method provided by the embodiment of the present specification further includes:

step S60: receiving a code synchronization command sent by an external source;

the code synchronization method provided by the embodiment of the specification can be manual operation or automatic trigger code synchronization task, and when the code synchronization command sent by the external source is detected, the code synchronization task can be automatically triggered, so that the code synchronization efficiency is improved, and the labor and time cost is reduced.

Step S70, identifying the parameter information corresponding to the external source from the code synchronous command;

and starting to identify and analyze the code synchronization command, and acquiring parameter information corresponding to an external source, such as an external source, an external source code synchronization list and the like.

In the Android platform-based software development process, specifically after a code synchronization command of a chip manufacturer is acquired, a REPO _ CMD code synchronization command is firstly analyzed, and especially key information such as identification _ REPO, identification _ BRANCH, identification _ FILE and the like contained in the code synchronization command is analyzed. For example, the "-u" parameter is followed by MANIFEST _ REPO, the "-b" parameter is followed by MANIFEST _ BRANCH, the "-m" parameter is followed by MANIFEST _ FILE, etc.

REPO_CMD=“repo init-u$MANIFEST_REPO-b$MANIFEST_BRANCH-m$MANIFEST_FILE”

MANIFEST_REPO=`echo${REPO_CMD##*-u}|awk'{print$1}'`

MANIFEST_BRANCH=`echo${REPO_CMD##*-b}|awk'{print$1}'`

MANIFEST_FILE=`echo${REPO_CMD##*-m}|awk'{print$1}'`

Step S80, an external source directory corresponding to the external source is determined based on the parameter information.

And according to the acquired parameter information, knowing the name of the external source, searching whether the external source directory exists in a locally preset external source directory group or not based on the name of the external source, if so, finding the external source directory, and if not, creating a new external source directory by the name in the external source directory group.

In the Android platform-based software development process, a specific name of an external source is recognized according to MANIFEST _ REPO, a folder is created in the external source directory group by the specific name, and if the external source directory of the specific name exists, the creation is skipped.

Referring to fig. 5, in some embodiments, in step S30, performing an initialization operation under the external source directory to generate an initialization directory specifically includes:

step S300, at least obtaining an external source code synchronous list based on the parameter information;

and acquiring the external source code synchronization list from the parameter information acquired from the code synchronization command. If the external source code synchronization list does not exist in the parameter information, the automatic trigger code synchronization task can obtain the external source code synchronization list through calculation of a correlation algorithm.

And step S310, at least storing the external source code synchronous list under the initialization directory.

The purpose of storing the external source code synchronization list in the initialization directory is to establish a corresponding relation between the initialization directory and the external source so as to perform code synchronization operation based on the external source code synchronization list after the initialization directory is subsequently arranged in the total code directory.

Referring to fig. 6, in some embodiments, before identifying parameter information corresponding to the external source from the code synchronization command, in step S70, the code synchronization method provided by the embodiments of the present specification further includes:

and step SA, automatically triggering the code to synchronously and automatically execute the task.

When a code synchronization command sent by an external source is received, the code synchronization automatic execution task is automatically triggered, the automatic code synchronization operation can be realized, all steps of code synchronization are automatically executed, automatic increment synchronization is realized when the code synchronization is automatically executed, manual intervention is reduced, the workload of a baseline engineer is greatly reduced, and the working efficiency of library sharing and baseline code upgrading is improved.

And when the code synchronization is automatically triggered to automatically execute the task, if a new external source code synchronization list is found, the external source code synchronization list is switched to the new external source code synchronization list for targeted synchronization, so that the code synchronization is completely realized without manual intervention, the whole process from the code synchronization to the internal downloading can be completely automated, and the code synchronization speed and the research and development efficiency are greatly improved. Theoretically, the time for code synchronization can be completed within dozens of minutes to 1 hour from the time of taking 1 to 2 days in average in the past to the present time, the manual intervention in the whole process is greatly reduced compared with the manual intervention in the past, the automation of the code synchronization is basically realized, the automatic code synchronization method comprises the following steps of establishing a local code synchronization list and automatically uploading the local code synchronization list to a local code synchronization list library, and internal research and development personnel can conveniently obtain the latest code synchronization list in time and download the latest code synchronization list.

For example, in the Android platform-based software development process, the acquisition of the external source code synchronization list, namely, the request _ FILE, can be set to be completely obtained by the calculation that the automatic code synchronization automatic execution task queries the modification record of the request _ REPO through git log, and then the latest external source code synchronization list, namely, the request _ FILE, is synchronized to the corresponding initialization directory to be stored. The automatic code synchronous automatic execution task enters an automatic downloading mode: the default value of REPO _ CMD is read, and if the default value exists, three elements in the code synchronization command are also parsed, namely, MANIFEST _ REPO, MANIFEST _ BRANCH and MANIFEST _ FILE. Detecting whether there is a request _ FILE updated from the external source code synchronization list stored in the initialization directory, if so, automatically switching to the latest request _ FILE for synchronization without using the original request _ FILE, and storing the updated request _ FILE in the initialization directory.

Referring to fig. 7, in some embodiments, step 10: before the initialization directory is set under the total directory of codes, the code synchronization method provided by the embodiment of the present specification further includes:

step 40: confirming that the existing initialized directory exists in the total directory of the codes;

firstly, whether an existing initialization directory corresponding to the external source exists in the total directory of codes is confirmed, if so, the existing initialization directory may contain a previous soft link or a previous external source code synchronization list.

Step 50: the existing initialization directory is deleted.

For example, in the software development process based on the Android platform, the specific process is as follows:

firstly, delete the repo folder under the code total directory, that is

rm-r all_projects/.repo

And secondly, the newly initialized directory under the external source directory is linked to the total code directory in a soft mode.

Referring to fig. 8, in some embodiments, step S30: after a code synchronization operation is performed under a code general directory to synchronize code data of an external source to a warehouse under the code general directory based on an external source code synchronization list, a code synchronization method provided by an embodiment of the present specification includes:

step S90: establishing a local code synchronization list based on the external source code synchronization list and locally preset parameter information;

in the software development process based on the Android platform, elements such as remote, fetch and pushurl in a local code synchronization list are modified according to an external source code synchronization list (MANIFEST _ FILE) to automatically generate a local code synchronization list (OEM _ MANIFEST _ FILE) which can be used by a local code library, and the local code synchronization list is automatically uploaded to a server of a self-party, such as the local code list stored in a local code list library, so that a code synchronization list in the local code list library is updated, and internal research personnel or the internal research personnel can conveniently use the latest local code synchronization list. Specifically, remote, fetch and pushurl in the external source code synchronization list MANIFEST _ FILE are changed into an internal IP address and a default name, wherein, the remote is modified into an internal server name in combination with local parameter information, and the fetch defaults to ". multidot.. Their role in the request _ FILE is to guide the notification of which server the code synchronization command is from, the contents of these two values are the address and name of the external source just after synchronization. We need to change them to be used by the internal code base and change these two values to the values used by the internal code base.

Deleting two lines of contents including remote and fetch pushurl in the original MANIFEST _ FILE:

xmlstarlet ed-d"//remote"-d"//default"$SOURCE/$MANIFEST_FILE>$OEM/$OEM_MANIFEST_FILE

add new remote and fetch and set the pushurl address to the internal code server address:

sed-i'2a\\<remote fetch=".."pushurl="ssh://zte_smartphone.com:29418"name="zte"review="ssh://zte_smartphone.com:29418"/>'$OEM/$OEM_MANIFEST_FILE

sed-i'3a\\<default remote="zte"/>'$OEM/$OEM_MANIFEST_FILE

upload $ OEM/$ OEM _ MANIFEST _ FILE to the internal local code synchronization inventory.

Step S90': and uploading the local code synchronous list to a local code list library.

The code synchronization automatic execution task changes an external source code synchronization list file of an external source into a local code synchronization list which can be directly synchronized by internal research and development personnel. The automatic code synchronization task can convert an external source code synchronization list file from an external source into an internal local code synchronization list file to be uploaded to a local code list library after the synchronization codes are completed, update a code synchronization list in the local code list library, and provide a latest local code synchronization list for research personnel to download code data internally.

Example two

Referring to fig. 8, a server provided for the embodiments of the present specification includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for implementing connection communication between the processor and the memory, where the program, when executed by the processor, implements the steps of the code synchronization method shown in fig. 1 to 8. The specific steps shown in fig. 1 are as follows:

step 10: setting an initialization directory corresponding to an external source under a total directory of codes, wherein the initialization directory at least comprises an external source code synchronous list;

the initialization directory can be set under the total code directory in a mode of copying or directly creating the initialization directory, and the purpose is that synchronous information of code synchronization can be obtained from the initialization directory under the total code directory, the synchronous information comprises at least an external source code synchronous list corresponding to an external source under the initialization directory, so that the code synchronization operation under the subsequent total code directory is facilitated, and the external source can be synchronized under the subsequent total code directory. Different external sources can be operated simultaneously under the total code directory, and the baseline codes are issued by various chip manufacturers in a label mode when the codes are issued, and branch names are not repeated. Therefore, synchronization can not be interfered with each other even under the same code general directory, so that the same parts among all external sources can not be repeatedly synchronized, and the synchronization efficiency is accelerated.

The code summary catalog is a preset summary catalog for code synchronization, and code data from different external sources are stored in a warehouse under the code summary catalog. The initialization directory may be a folder for storing synchronization information for code synchronization, and may be set under a root directory in the code summary directory.

Particularly, the multi-warehouse code management system can manage multi-warehouse codes by using a management tool of a development platform, and is particularly suitable for terminal manufacturers who need to frequently synchronize code data released by the development platform and chip manufacturers and the like for software development to perform code synchronous updating on codes of own internal platforms.

The code synchronization method provided by the embodiment of the specification can effectively improve the efficiency of code synchronization, particularly can support the code synchronization from a plurality of external sources, can cover the synchronization of baseline software codes of various large chip manufacturers, and simultaneously supports the code synchronization directly from an open source development platform. The time cost and the labor cost can be effectively reduced, the code synchronization time is greatly shortened, the project research and development process is accelerated, and the research and development efficiency is improved.

Step 20: and executing a code synchronization operation under the code general directory to synchronize code data of an external source to a warehouse under the code general directory based on the external source code synchronization list.

And executing a code synchronization operation under the code general directory, and synchronizing code data of an external source to a warehouse under the code general directory based on the external source code synchronization list. The external source code synchronization list corresponding to different external sources lists the code labels and the code branches which need to be synchronized respectively. In this step, the code data of the external source may be all synchronized to the warehouse under the code summary directory, and the code data of the external source may be finally stored in the warehouse group under the code summary directory by using a method of pulling the git fetch or other methods. If the code data of a plurality of external sources are stored in the warehouse group under the code general catalog, the code data of the same part between different external sources cannot be repeatedly synchronized, and the code synchronization efficiency is improved.

The embodiment of the specification can perform the step of code synchronization under the total code directory by softly linking the initialized directories corresponding to the external sources to the total code directory, thereby greatly improving the reuse rate of a bare warehouse, reducing the disk occupancy rate and improving the synchronization speed. For example, for newly issued Android X version open source codes, some chip manufacturers develop and issue new baseline code data based on the Android X code, then when synchronizing the baseline code data of a first chip manufacturer, the open source code data of the Android X will be synchronized together in the local database, and when synchronizing the baseline code data issued by a second chip manufacturer, which is also developed based on the Android X, the git warehouse under the same code general directory will not repeatedly synchronize the existing data, but only synchronizes the newly added baseline code data of the second chip manufacturer, thereby significantly improving the code synchronization speed, and being particularly suitable for the case of very slow network speed.

The code data of a plurality of external sources are synchronized to the same code general directory, so that the research and development progress and the research and development cost can be accelerated and the research and development iteration speed of the mobile phone version can be accelerated due to the fact that all code data are shared in a database and the sustainability of code data coupling sharing development branches based on the same development platform, and a mobile phone manufacturer can always follow the latest technologies of a chip manufacturer and an open source platform and move to the forefront of the related fields.

It can be understood that the embodiments of the present disclosure may be applied to various large-source software teams, mobile phone software development teams, chip manufacturers, and the like. By adopting the code synchronization method provided by the embodiment of the specification, the code synchronization efficiency can be remarkably improved, the subsequent baseline upgrading and patch acquisition of research and development departments are facilitated, and the whole research and development progress is accelerated.

The code synchronization method provided in the embodiments of the present specification may be performed only when the code management tool of the development platform executes code synchronization, and the code management tools of different development platforms have different commands for code synchronization operation, which will be described as an example below. In addition, the method is related to different external sources in a local link mode, so that the code data of different external sources are synchronously stored in the warehouse group under the same code general catalog. In addition, the method realizes targeted code synchronization by automatically switching the local code synchronization list by obtaining the latest external source code synchronization list replacing the code source, and can be widely applied to OEM manufacturers, mobile phone manufacturers, personal developers and the like needing to be developed based on the external source code.

Fig. 9 is a schematic structural diagram of a server 900 according to an embodiment of the present disclosure, which includes, at a hardware level, a processor 920, and optionally an internal bus 940 and a memory 920.

The memory 920 is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor. The Memory 920 may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the server may also include hardware needed for other services.

The processor 910 reads a corresponding computer program from the non-volatile memory into the memory and then runs the computer program. The processor 910 executes the program stored in the memory. The processor 910 and the memory 920 may be connected to each other by an internal bus 940, and the internal bus 940 may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 940 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one double-headed arrow is shown in FIG. 9, but this does not indicate only one bus or one type of bus. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the processor may be implemented by integrated logic circuits in hardware or instructions in software in the processor. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.

In the technical solution of the present specification, in the code synchronization method provided in the embodiments of the present specification, the initialization directory is set in the total code directory, the initialization directory corresponding to the external source is established in the local server, and the external source code synchronization list is stored in the initialization directory, so as to determine the corresponding relationship between the initialization directory and the external source. Different initialization directories can be respectively established by different external sources; and finally, code synchronization operation is executed in the code general catalog, so that the code data of different external sources can be completely synchronized to the warehouse group in the same code general catalog, and the code data of the same part among the different external sources can be automatically deduplicated, thereby effectively improving the code synchronization efficiency, reducing the time cost and the labor cost of code synchronization, accelerating the project research and development process and improving the research and development efficiency. Particularly, an external source directory corresponding to an external source is established in a local server, after the initialization directory is generated under the external source directory, the soft link of the initialization directory is established under a total code directory, so that the synchronous synchronization of codes from a plurality of external sources can be supported, and the error operation in the middle can be avoided. Therefore, the code synchronization method provided by the application can simultaneously cover the synchronization of the baseline software codes of various chip manufacturers and the code synchronization directly from the software development platform, all external sources are not interfered with each other, the time cost and the labor cost of code synchronization are effectively reduced, and the code synchronization method is particularly suitable for terminal manufacturers who need to frequently synchronize the baseline software codes issued by all chip manufacturers for software development, and completes the updating operation of the internal codes of the development platforms.

EXAMPLE III

A storage medium provided in an embodiment of the present specification is a computer-readable storage medium, where one or more programs are stored, and the one or more programs are executable by one or more processors to implement the steps of the code synchronization method shown in fig. 1 to 8, and specifically perform the following steps:

step 10: setting an initialization directory corresponding to an external source under a total directory of codes, wherein the initialization directory at least comprises an external source code synchronous list;

the initialization directory can be set under the total code directory in a mode of copying or directly creating the initialization directory, and the purpose is that synchronous information of code synchronization can be obtained from the initialization directory under the total code directory, the synchronous information comprises at least an external source code synchronous list corresponding to an external source under the initialization directory, so that the code synchronization operation under the subsequent total code directory is facilitated, and the external source can be synchronized under the subsequent total code directory. Different external sources can be operated simultaneously under the total code directory, and the baseline codes are issued by various chip manufacturers in a label mode when the codes are issued, and branch names are not repeated. Therefore, synchronization can not be interfered with each other even under the same code general directory, so that the same parts among all external sources can not be repeatedly synchronized, and the synchronization efficiency is accelerated.

The code summary catalog is a preset summary catalog for code synchronization, and code data from different external sources are stored in a warehouse under the code summary catalog. The initialization directory may be a folder for storing synchronization information for code synchronization, and may be set under a root directory in the code summary directory.

Particularly, the multi-warehouse code management system can manage multi-warehouse codes by using a management tool of a development platform, and is particularly suitable for terminal manufacturers who need to frequently synchronize code data released by the development platform and chip manufacturers and the like for software development to perform code synchronous updating on codes of own internal platforms.

The code synchronization method provided by the embodiment of the specification can effectively improve the efficiency of code synchronization, particularly can support the code synchronization from a plurality of external sources, can cover the synchronization of baseline software codes of various large chip manufacturers, and simultaneously supports the code synchronization directly from an open source development platform. The time cost and the labor cost can be effectively reduced, the code synchronization time is greatly shortened, the project research and development process is accelerated, and the research and development efficiency is improved.

Step 20: and executing a code synchronization operation under the code general directory to synchronize code data of an external source to a warehouse under the code general directory based on the external source code synchronization list.

And executing a code synchronization operation under the code general directory, and synchronizing code data of an external source to a warehouse under the code general directory based on the external source code synchronization list. The external source code synchronization list corresponding to different external sources lists the code labels and the code branches which need to be synchronized respectively. In this step, the code data of the external source may be all synchronized to the warehouse under the code summary directory, and the code data of the external source may be finally stored in the warehouse group under the code summary directory by using a method of pulling the git fetch or other methods. If the code data of a plurality of external sources are stored in the warehouse group under the code general catalog, the code data of the same part between different external sources cannot be repeatedly synchronized, and the code synchronization efficiency is improved.

The embodiment of the specification can perform the step of code synchronization under the total code directory by softly linking the initialized directories corresponding to the external sources to the total code directory, thereby greatly improving the reuse rate of a bare warehouse, reducing the disk occupancy rate and improving the synchronization speed. If some chip manufacturers develop and issue new baseline code data based on Android X code aiming at newly issued Android X version open source code, the open source code data of Android X can be synchronized together in a local database when synchronizing the baseline code data of a first chip manufacturer, and a git warehouse under the same code general directory can not repeatedly synchronize existing data but only synchronize newly added baseline code data of a second chip manufacturer when synchronizing the baseline code data issued by a second chip manufacturer which is also developed based on Android X, so that the code synchronization speed is remarkably improved, and the method is particularly suitable for the condition of low network speed.

The code data of a plurality of external sources are synchronized to the same code general directory, so that the research and development progress and the research and development cost can be accelerated and the research and development iteration speed of the mobile phone version can be accelerated due to the fact that all code data are shared in a database and the sustainability of code data coupling sharing development branches based on the same development platform, and a mobile phone manufacturer can always follow the latest technologies of a chip manufacturer and an open source platform and move to the forefront of the related fields.

It can be understood that the embodiments of the present disclosure may be applied to various large-source software teams, mobile phone software development teams, chip manufacturers, and the like. By adopting the code synchronization method provided by the embodiment of the specification, the code synchronization efficiency can be remarkably improved, the subsequent baseline upgrading and patch acquisition of research and development departments are facilitated, and the whole research and development progress is accelerated.

The code synchronization method provided by the embodiments of the present specification may perform a code synchronization operation based on a code management tool of a development platform, where the code management tools of different development platforms have different commands of the code synchronization operation, and will be described in the following as an example. In addition, the method is related to different external sources in a local link mode, so that the code data of different external sources are synchronously stored in the warehouse group under the same code general catalog. In addition, the method realizes targeted code synchronization by acquiring the latest external source code synchronization list of the external source and automatically switching the local code synchronization list, and can be widely applied to OEM manufacturers, mobile phone manufacturers, personal developers and the like needing to be developed based on the external source code.

In the technical solution of the present specification, in the code synchronization method provided in the embodiments of the present specification, the initialization directory is set in the total code directory, the initialization directory corresponding to the external source is established in the local server, and the external source code synchronization list is stored in the initialization directory, so as to determine the corresponding relationship between the initialization directory and the external source. Different initialization directories can be respectively established by different external sources; and finally, code synchronization operation is executed in the code general catalog, so that the code data of different external sources can be completely synchronized to the warehouse group in the same code general catalog, and the code data of the same part among the different external sources can be automatically deduplicated, thereby effectively improving the code synchronization efficiency, reducing the time cost and the labor cost of code synchronization, accelerating the project research and development process and improving the research and development efficiency. Particularly, an external source directory corresponding to an external source is established in a local server, after the initialization directory is generated under the external source directory, the soft link of the initialization directory is established under a total code directory, so that the synchronous synchronization of codes from a plurality of external sources can be supported, and the error operation in the middle can be avoided. Therefore, the code synchronization method provided by the application can simultaneously cover the synchronization of the baseline software codes of various chip manufacturers and the code synchronization directly from the software development platform, all external sources are not interfered with each other, the time cost and the labor cost of code synchronization are effectively reduced, and the code synchronization method is particularly suitable for terminal manufacturers who need to frequently synchronize the baseline software codes issued by all chip manufacturers for software development, and completes the updating operation of the internal codes of the development platforms.

In short, the above description is only a preferred embodiment of the present disclosure, and is not intended to limit the scope of the present disclosure. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present specification shall be included in the protection scope of the present specification.

The system, apparatus, module or unit illustrated in one or more of the above embodiments may be implemented by a computer chip or an entity, or by an article of manufacture with a certain functionality. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

Computer-readable storage media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.

It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.

The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.

The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.

21页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种软件包管理方法、装置、设备及介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!