CN108829432A - A kind of code synchronisation method and system based on code manager - Google Patents

A kind of code synchronisation method and system based on code manager Download PDF

Info

Publication number
CN108829432A
CN108829432A CN201810408198.5A CN201810408198A CN108829432A CN 108829432 A CN108829432 A CN 108829432A CN 201810408198 A CN201810408198 A CN 201810408198A CN 108829432 A CN108829432 A CN 108829432A
Authority
CN
China
Prior art keywords
code
source code
file
binary
source
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810408198.5A
Other languages
Chinese (zh)
Inventor
李博
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Kangfei Information Technology Co Ltd
Original Assignee
Shanghai Kangfei Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Kangfei Information Technology Co Ltd filed Critical Shanghai Kangfei Information Technology Co Ltd
Priority to CN201810408198.5A priority Critical patent/CN108829432A/en
Publication of CN108829432A publication Critical patent/CN108829432A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/447Target code generation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0876Network architectures or network communication protocols for network security for authentication of entities based on the identity of the terminal or configuration, e.g. MAC address, hardware or software configuration or device fingerprint
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Signal Processing (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Power Engineering (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The code synchronisation method based on code manager that the invention discloses a kind of, the method includes:Multiple source code files in source code storage are compiled into corresponding multiple binary code files, and store the binary code file in binary code warehouse;When monitoring the source code file in the source code storage has update; the source code file of the update is compiled into the binary code file of update; and it is stored in the binary code warehouse, source code and the timeliness of code synchronisation can be protected.

Description

A kind of code synchronisation method and system based on code manager
Technical field
The invention belongs to code administration technical field, in particular to a kind of code synchronisation method based on code manager and System.
Background technique
Enterprise is when carrying out code administration, it will usually there are two kinds of roles of writer and user of service, and for making merely With the personnel of code, we are not intended to them and see source code, and only can run source code, but need to guarantee again with Source code is synchronous, industry be usually it is interim source code is carried out to be packaged issue user of service and carry out using but this mode Synchronism is poor, and frequent be packaged also results in time cost increase.
Therefore, the present invention provides a kind of technical solution of code synchronisation, can protect source code and code Synchronous timeliness.
Summary of the invention
In consideration of it, the purpose of the present invention is to provide a kind of code synchronisation method and system based on code manager, both Source code can be protected, and can guarantee the timeliness of code synchronisation.
According to foregoing invention purpose, the present invention provides a kind of code synchronisation method based on code manager, the method Including:
S1, multiple source code files in source code storage are compiled into corresponding multiple binary code files, and store institute Binary code file is stated in binary code warehouse;
S2, when monitoring the source code file in the source code storage has update, the source code file of the update is compiled It is translated into the binary code file of update, and is stored in the binary code warehouse.
Preferably, further include in the step S1:Source code storage and binary system generation is respectively created using code manager Code warehouse.
Preferably, the step S1 further includes:
Developer's account is created, developer's account has the access limit of the source code storage;
User of service's account is created, user of service's account has the read right in the binary code warehouse;
Administrator's account is created, administrator's account has the read right and the binary code of the source code storage The access limit in warehouse.
Preferably, the step S1 further includes:The title of each source code file and each binary code The title of file corresponds.
Preferably, the step S2 further includes:
Administrator's account is monitored in the source code storage every a preset time interval by running monitoring script Source code file whether have update.
Preferably, the step S2 is specifically included:
The update of the source code file includes deletion, increase and the change of source code file;
When monitoring source code file in the source code storage and deleting, according to the title of the source code file with two into The corresponding relationship of the title of code file processed deletes corresponding binary code file in the binary code warehouse;
When monitoring the source code file increase in the source code storage, the increased source code file is compiled into newly Binary code file, and be stored in the binary code warehouse;
When monitoring the source code file change in the source code storage, the source code file of the change is compiled into newly Binary code file deleted according to the corresponding relationship of the title of the source code file and the title of binary code file Except corresponding binary code file in the binary code warehouse, and store new binary code file in described two into Code storage processed.
According to foregoing invention purpose, the present invention provides a kind of code synchronisation system based on code manager, including:
Collector, for multiple source code files in source code storage to be compiled into corresponding multiple binary code texts Part, and the binary code file is stored in binary code warehouse;
Synchronization module, for when monitoring the source code file in the source code storage has update, by the source of the update Code file is compiled into the binary code file of update, and is stored in the binary code warehouse.
Preferably, the system also includes creation module, for using code manager be respectively created source code storage and Binary code warehouse.
Preferably, the system also includes:
Open personnel's account module, for creating developer's account, developer's account has the source code storehouse The access limit in library.
User of service's account module, for create user of service's account, user of service's account have described two into The read right of code storage processed.
Administrator's account module, for creating administrator's account, administrator's account has the source code storage Read right and the binary code warehouse access limit.
Preferably, the synchronization module includes:
Reading unit reads the source generation in the source code storage every a preset time interval for administrator's account Code file;
Monitoring unit, for when monitoring that the source code file in the source code storage has update, by the source of the update Code file is compiled into the binary code file of update;
Storage unit, for the binary code file of the update to be stored in the binary code warehouse.
Compared with prior art, a kind of code synchronisation method and system based on code manager provided by the invention, tool There is following beneficial effect:The technical problem for solving source code packing time length in the prior art can by the technical program Source code is protected, and can guarantee the synchronous timeliness of source code;Source code storage and binary system are created by code manager Code storage, and the access limit that developer has source code storage is set, there is user of service the reading of binary code to weigh Limit, can protect source code well;Only to the source code for having change in source code storage, it is same to carry out binary code compiling Step, ensure that the timeliness and validity of code synchronisation.
Detailed description of the invention
Below by clearly understandable mode, preferred embodiment is described with reference to the drawings, code manager is based on to one kind Above-mentioned characteristic, technical characteristic, advantage and its implementation of code synchronisation method and system be further described.
Fig. 1 is a kind of flow chart of the code synchronisation method based on code manager of the present invention;
Fig. 2 is a kind of composed structure schematic diagram of the code synchronisation system based on code manager of the present invention.
Specific embodiment
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, Detailed description of the invention will be compareed below A specific embodiment of the invention.It should be evident that drawings in the following description are only some embodiments of the invention, for For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other Attached drawing, and obtain other embodiments.
To make simplified form, part related to the present invention is only schematically shown in each figure, they are not represented Its practical structures as product.In addition, there is identical structure or function in some figures so that simplified form is easy to understand Component only symbolically depicts one of those, or has only marked one of those.Herein, "one" is not only indicated " only this ", can also indicate the situation of " more than one ".
As shown in Figure 1, according to one embodiment of present invention, a kind of code synchronisation method based on code manager, institute The method of stating includes:
S1, multiple source code files in source code storage are compiled into corresponding multiple binary code files, and store institute Binary code file is stated in binary code warehouse;
S2, when monitoring the source code file in the source code storage has update, the source code file of the update is compiled It is translated into the binary code file of update, and is stored in the binary code warehouse.
The present invention realizes the technical solution of code synchronisation by code manager.The technical solution can be adapted for any Code management software, such as SVN, Git.Source code can be any language that can be compiled as binary file, for example, C++, Python etc..
An of the invention specific embodiment further includes in the step S1:Source code storehouse is respectively created using code manager Library and binary code warehouse.The source code is stored in the source code storage, and the binary code file is stored in institute State binary code warehouse.
A specific embodiment of the invention, the step S1 further include:Create developer's account, developer's account Number with the source code storage access limit;User of service's account is created, user of service's account has described two The read right in carry system code warehouse;Administrator's account is created, there is administrator's account the reading of the source code storage to weigh The access limit of limit and the binary code warehouse.People is corresponded to by the way that source code storage and binary code warehouse is respectively configured Member's permission, makes developer be directly facing source code storage, without considering the packing problem of code.User of service is directly facing two Carry system code warehouse, without considering synchronous problem.Source code storage and binary code warehouse are completed by administrator's account Stationary problem, protect source code, without the concern for code leak the problem of.
Multiple source code files in source code storage are compiled into corresponding multiple binary code files, and store institute Binary code file is stated in binary code warehouse.When the source code file monitored in the source code storage has update When, the source code file of the update is compiled into the binary code file of update, and be stored in the binary code storehouse Library.
A specific embodiment of the invention, the title of each source code file and each binary code file Title correspond.Administrator's account monitors the source by running monitoring script every a preset time interval Whether the source code file in code storage has update.The update of the source code file includes the deletion of source code file, increases Adduction change;When monitoring the source code file deletion in the source code storage, according to the title of the source code file With the corresponding relationship of the title of binary code file, corresponding binary code text in the binary code warehouse is deleted Part;When monitoring the source code file increase in the source code storage, the increased source code file is compiled into newly Binary code file, and be stored in the binary code warehouse;When monitoring the source code in the source code storage When document change, the source code file of the change is compiled into new binary code file, according to the source code file Title and binary code file title corresponding relationship, delete corresponding binary system generation in the binary code warehouse Code file, and new binary code file is stored in the binary code warehouse.When user of service needs to run code, Directly binary code file is obtained from the binary code warehouse.Only the source code file of update is compiled, is protected The timeliness and validity of code synchronisation are demonstrate,proved.
According to the technical solution, the timeliness of source code and code synchronisation can be protected;Pass through code administration Device creates source code storage and binary code warehouse, and the access limit that developer has source code storage is arranged, and uses Personnel have the read right of binary code, can protect source code well;Only to the source for having change in source code storage Code carries out binary code file and synchronizes, ensure that the timeliness and validity of code synchronisation.
As shown in Fig. 2, a kind of embodiment of the invention, a kind of code synchronisation system based on code manager, including:
Collector 20, for multiple source code files in source code storage to be compiled into corresponding multiple binary code texts Part, and the binary code file is stored in binary code warehouse;
Synchronization module 21, for when monitoring the source code file in the source code storage has update, by the update Source code file is compiled into the binary code file of update, and is stored in the binary code warehouse.
A specific embodiment of the invention, the system also includes creation modules.The creation module uses code administration Source code storage and binary code warehouse is respectively created in device.The source code storage stores the source code file.Described two Carry system code warehouse stores the binary code file.
A specific embodiment of the invention, the system also includes developer's account modules, user of service's account module With administrator's account module.One developer's account of developer's account module creation, developer's account have The access limit of source code storage.One user of service's account of user of service's account module creation, user of service's account Read right with the binary code warehouse.One administrator's account of administrator's account module creation, the administrator Account has the read right of the source code storage and the access limit in the binary code warehouse.
In the collector, multiple source code files in source code storage are compiled into corresponding multiple binary systems Code file, and the binary code file is stored in binary code warehouse.In the synchronization module, when the source generation When source code file in code warehouse has update, the source code file of the update is compiled into the binary code text of update Part.Specifically, the synchronization module includes reading unit, monitoring unit and storage unit.In the reading unit, the pipe Reason person's account reads the source code file in the source code storage every a preset time interval.In the monitoring unit, When monitoring that the source code file in the source code storage has update, the source code file of the update is compiled into update Binary code file.And the binary code file of the update is stored in by the binary system by the storage unit Code storage.When user of service needs to run code, binary file directly is obtained from the binary code warehouse.Only The source code file of update is compiled, ensure that the timeliness and validity of code synchronisation.
According to the technical solution, source code storage and binary code warehouse are created by code manager, and be arranged and open Hair personnel have the access limit of source code storage, and user of service has the read right of binary code, can protect well Source code;Only to the source code for having change in source code storage, carries out binary code file and synchronize, ensure that code synchronisation Timeliness and validity
In conclusion the present invention realizes the protection to source code, the timeliness and validity of code synchronisation ensure that, be user Bring better experience effect.
It should be noted that above-described embodiment can be freely combined as needed.The above is only of the invention preferred Embodiment, it is noted that for those skilled in the art, in the premise for not departing from the principle of the invention Under, several improvements and modifications can also be made, these modifications and embellishments should also be considered as the scope of protection of the present invention.

Claims (10)

1. a kind of code synchronisation method based on code manager, which is characterized in that the method includes:
S1, multiple source code files in source code storage are compiled into corresponding multiple binary code files, and store institute Binary code file is stated in binary code warehouse;
S2, when monitoring the source code file in the source code storage has update, the source code file of the update is compiled It is translated into the binary code file of update, and is stored in the binary code warehouse.
2. the code synchronisation method based on code manager as described in claim 1, which is characterized in that also in the step S1 Including:Source code storage and binary code warehouse is respectively created using code manager.
3. the code synchronisation method based on code manager as claimed in claim 2, which is characterized in that the step S1 is also wrapped It includes:
Developer's account is created, developer's account has the access limit of the source code storage;
User of service's account is created, user of service's account has the read right in the binary code warehouse;
Administrator's account is created, administrator's account has the read right and the binary code of the source code storage The access limit in warehouse.
4. the code synchronisation method based on code manager as claimed in claim 3, which is characterized in that the step S1 is also wrapped It includes:The title of each source code file and the title of each binary code file correspond.
5. the code synchronisation method based on code manager as claimed in claim 4, which is characterized in that the step S2 is also wrapped It includes:
Administrator's account is monitored in the source code storage every a preset time interval by running monitoring script Source code file whether have update.
6. the code synchronisation method based on code manager as claimed in claim 5, which is characterized in that the step S2 is specific Including:
The update of the source code file includes deletion, increase and the change of source code file;
When monitoring source code file in the source code storage and deleting, according to the title of the source code file with two into The corresponding relationship of the title of code file processed deletes corresponding binary code file in the binary code warehouse;
When monitoring the source code file increase in the source code storage, the increased source code file is compiled into newly Binary code file, and be stored in the binary code warehouse;
When monitoring the source code file change in the source code storage, the source code file of the change is compiled into newly Binary code file deleted according to the corresponding relationship of the title of the source code file and the title of binary code file Except corresponding binary code file in the binary code warehouse, and store new binary code file in described two into Code storage processed.
7. a kind of code synchronisation system based on code manager, which is characterized in that including:
Collector, for multiple source code files in source code storage to be compiled into corresponding multiple binary code texts Part, and the binary code file is stored in binary code warehouse;
Synchronization module, for when monitoring the source code file in the source code storage has update, by the source of the update Code file is compiled into the binary code file of update, and is stored in the binary code warehouse.
8. the code synchronisation system based on code manager as claimed in claim 7, which is characterized in that the system also includes Creation module, for source code storage and binary code warehouse to be respectively created using code manager.
9. the code synchronisation system based on code manager as claimed in claim 8, which is characterized in that the system is also wrapped It includes:
Open personnel's account module, for creating developer's account, developer's account has the source code storehouse The access limit in library;
User of service's account module, for creating user of service's account, user of service's account has the binary system generation The read right in code warehouse;
Administrator's account module, for creating administrator's account, administrator's account has the reading of the source code storage The access limit of permission and the binary code warehouse.
10. the code synchronisation system based on code manager as claimed in claim 7, which is characterized in that the synchronization module Including:
Reading unit reads the source generation in the source code storage every a preset time interval for administrator's account Code file;
Monitoring unit, for when monitoring that the source code file in the source code storage has update, by the source of the update Code file is compiled into the binary code file of update;
Storage unit, for the binary code file of the update to be stored in the binary code warehouse.
CN201810408198.5A 2018-05-02 2018-05-02 A kind of code synchronisation method and system based on code manager Pending CN108829432A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810408198.5A CN108829432A (en) 2018-05-02 2018-05-02 A kind of code synchronisation method and system based on code manager

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810408198.5A CN108829432A (en) 2018-05-02 2018-05-02 A kind of code synchronisation method and system based on code manager

Publications (1)

Publication Number Publication Date
CN108829432A true CN108829432A (en) 2018-11-16

Family

ID=64147306

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810408198.5A Pending CN108829432A (en) 2018-05-02 2018-05-02 A kind of code synchronisation method and system based on code manager

Country Status (1)

Country Link
CN (1) CN108829432A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050144599A1 (en) * 2003-12-26 2005-06-30 Microsoft Corporation Source server
CN102035892A (en) * 2010-12-23 2011-04-27 中科方德软件有限公司 System and method for automatically releasing operating system version and automatically updating software package
CN107632932A (en) * 2017-09-11 2018-01-26 天津麒麟信息技术有限公司 A kind of software storage reliability checking method of multistage verification
CN108228256A (en) * 2018-02-05 2018-06-29 武汉斗鱼网络科技有限公司 Code synchronisation method, apparatus, computer-readable medium and terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050144599A1 (en) * 2003-12-26 2005-06-30 Microsoft Corporation Source server
CN102035892A (en) * 2010-12-23 2011-04-27 中科方德软件有限公司 System and method for automatically releasing operating system version and automatically updating software package
CN107632932A (en) * 2017-09-11 2018-01-26 天津麒麟信息技术有限公司 A kind of software storage reliability checking method of multistage verification
CN108228256A (en) * 2018-02-05 2018-06-29 武汉斗鱼网络科技有限公司 Code synchronisation method, apparatus, computer-readable medium and terminal

Similar Documents

Publication Publication Date Title
US10061663B2 (en) Rebuilding deduplication data in a distributed deduplication data storage system
CN105373448B (en) The restoration methods and system of fault data in database
US8478726B2 (en) Parallel database backup and restore
Gunawardane Dynamic versions of set covering type public facility location problems
CN110399425B (en) Intelligent network disk micro-service system
CN110096476A (en) Data back up method, device and computer readable storage medium
CN103595730A (en) Ciphertext cloud storage method and system
CN104965760A (en) Method and apparatus for managing life cycle of software function module
CN106326129A (en) Program abnormity information generating method and device
CN104461670A (en) Management method for multi-project public code
CN110807038A (en) CMDB information full-text retrieval method based on elastic search
CN102982171A (en) Database synchronization method
CN103106200A (en) Synchronization system of non-relational type database and double-writing synchronization method
CN105468472A (en) iOS operation system based data backup and recovery method and apparatus
CN106250501B (en) Report processing method and reporting system
US20140201709A1 (en) JavaScript™ Deployment Build Tool for software code that uses an object literal to define meta data and system code.
CN107357866B (en) Localization migration method for middleware and database of electric power enterprise information system
CN108829432A (en) A kind of code synchronisation method and system based on code manager
CN110795331A (en) Software testing method and device
PH12020551765A1 (en) Methods and systems for booking resources and access management of booked resources
US20150106381A1 (en) Loading data with complex relationships
EP3213233A1 (en) Database data distribution management
CN104281503A (en) Data backup method and related system
CN108427559B (en) Script file generation and calling method and device
US9384251B2 (en) Synchronization of off-line reports and off-line mobile content packages

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20181116