CN110474970B - Code synchronization method, device and system - Google Patents

Code synchronization method, device and system Download PDF

Info

Publication number
CN110474970B
CN110474970B CN201910700610.5A CN201910700610A CN110474970B CN 110474970 B CN110474970 B CN 110474970B CN 201910700610 A CN201910700610 A CN 201910700610A CN 110474970 B CN110474970 B CN 110474970B
Authority
CN
China
Prior art keywords
code
code data
synchronization
version number
computer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910700610.5A
Other languages
Chinese (zh)
Other versions
CN110474970A (en
Inventor
王运峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Shenghui Technology Co ltd
Original Assignee
Ocdop 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 Ocdop Ltd filed Critical Ocdop Ltd
Priority to CN201910700610.5A priority Critical patent/CN110474970B/en
Publication of CN110474970A publication Critical patent/CN110474970A/en
Application granted granted Critical
Publication of CN110474970B publication Critical patent/CN110474970B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • 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)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a code synchronization method, a device and a system, wherein the code synchronization method comprises the steps of acquiring user identification information and code data to be synchronized, generating a corresponding version number according to the user identification information and the code data, packaging the version number and the code data into a synchronous code data packet, and sending the synchronous code data packet to code synchronization target equipment for storage; the technical problems that in the prior art, when a software research and development worker saves and backs up codes, the saved files need to be named, and the size of a storage space of a storage server needs to be considered, so that the whole process is long in time consumption, low in efficiency and complicated in process are solved; the code synchronization method is efficient, convenient and time-saving.

Description

Code synchronization method, device and system
Technical Field
The present invention relates to the field of data backup synchronization technologies, and in particular, to a code synchronization method, apparatus, and system.
Background
GIT: the system is an open-source distributed version control system, and can effectively process the version management of the project from a very small project to a very large project at a high speed.
With the continuous development and wide application of internet technology, the work content and the work complexity of software research and development personnel are also continuously increased, and how to solve the technical problem that when the software research and development personnel carry out research and development work, the generated codes are quickly, conveniently and rapidly backed up, stored and synchronized to become to be overcome.
In the prior art, software developers operate codes in a mode of using a third-party open source tool, the mode needs to be backed up by manually inputting commands, consumes longer time, needs to be named when the software developers back up and store code data, and needs to consider the storage space of a storage server, so that great inconvenience is brought to the software developers, and the working efficiency and convenience of the software developers are affected.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the related art. To this end, it is an object of the present invention to provide an efficient, convenient and time-saving code synchronization method.
The technical scheme adopted by the invention is as follows:
in a first aspect, the present invention provides a code synchronization method, which includes:
acquiring user identification information and code data to be synchronized;
generating a version number according to the user identification information and the code data;
and packaging the version number and the code data into a synchronous code data packet, and sending the synchronous code data packet to code synchronization target equipment for storage.
Further, generating a version number according to the code data specifically includes:
and after the code data is acquired, automatically generating the version number according to the user identification information, the time information for acquiring the code data and the content information of the code data.
Further, the acquiring the user identification information and the code data to be synchronized specifically includes:
and acquiring the name of a user as the user identification information, and acquiring code data to be synchronized of the computer as the code data.
Further, the code synchronization target device is a first GIT server; the computer may acquire the synchronization code packet after being connected with the first GIT server.
Further, the packing of the version number and the code data into a synchronization code packet specifically comprises:
and after the version number is used as the name of the code data packet and the code data is used as the content of the code data packet for packaging, sending the code data packet to the first GIT server for storage.
In a second aspect, the present invention provides a code synchronization apparatus, comprising:
the information data acquisition module is used for acquiring user identification information and code data to be synchronized;
the version number generation module is used for generating a version number according to the user identification information and the code data;
and the data packet generating and sending module is used for packaging the version number and the code data into a synchronous code data packet and sending the synchronous code data packet to the code synchronization target equipment for storage.
In a third aspect, the present invention provides a code synchronization system, comprising: the code synchronization device, the computer and the first GIT server;
the computer is connected with the information data acquisition module to send the user identification information and the code data to be synchronized to the information data acquisition module;
the data packet generating and sending module is connected with the first GIT server so as to send the code data packet to the first GIT server;
the computer is connected with the first GIT server so that the computer can acquire the code packet.
Further, the code synchronization device is a second GIT server; and the second GIT server is used for acquiring the user identification information and the code data, generating the version number according to the user identification information and the code data, packaging the version number and the code data into a synchronous code data packet, and then sending the synchronous code data packet to the first GIT server for storage.
In a fourth aspect, the present invention provides a code synchronization apparatus, comprising:
at least one processor; and a memory communicatively coupled to the at least one processor;
wherein the processor is adapted to execute the code synchronization method by calling a computer program stored in the memory.
In a fifth aspect, the present invention provides a computer-readable storage medium having stored thereon computer-executable instructions for causing a computer to execute the code synchronization method.
The invention has the beneficial effects that:
the embodiment of the invention generates a corresponding version number according to the user identification information and the code data by acquiring the user identification information and the code data to be synchronized, packages the version number and the code data into a synchronous code data packet and sends the synchronous code data packet to code synchronization target equipment for storage; the technical problems that in the prior art, when a software research and development worker saves and backs up codes, the saved files need to be named, and the size of a storage space of a storage server needs to be considered, so that the whole process is long in time consumption, low in efficiency and complicated in process are solved; the code synchronization method is efficient, convenient and time-saving.
Drawings
FIG. 1 is a flow diagram of one embodiment of a code synchronization method of the present invention;
FIG. 2 is a block diagram of a code synchronization apparatus according to an embodiment of the present invention;
FIG. 3 is a block diagram of a code synchronization system according to an embodiment of the present invention.
Detailed Description
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
The first embodiment is as follows:
the embodiment provides a code synchronization device, which acquires user identification information and code data to be synchronized through an information acquisition module, transmits the acquired information data to a version number generation module to generate a version number, packs the version number and the code data into a synchronization code data packet through a data packet generation and transmission module, and transmits the code data packet to code synchronization target equipment for storage after storing the code data packet; the technical problem that in the prior art, software developers need to name when backing up and storing code data, and need to consider the storage space of a storage server, so that the working efficiency and convenience of the software developers are affected is solved.
Specifically, referring to fig. 2, in this embodiment, the code synchronization apparatus includes: the device comprises an information data acquisition module, a version number generation module and a data packet generation and transmission module; the information data obtaining module transmits the obtained user identification information and the code data to be synchronized to the version number generating module, wherein the name of the user is used as the user identification information, and the version generating module generates a corresponding version number according to the name of the user, the time information for obtaining the code data and the content information for obtaining the code data, for example: a software developer with a user name called a first user (the user can define the user name) synchronously sets code data with content information being an addition algorithm at 00 min 00 s on 01, 12 of 2000, and then correspondingly generates a version number of the addition algorithm called the first user 20000101120000 (the arrangement sequence can be changed freely). After the corresponding version number is generated, the version number and the code data are transmitted to the data packet generating and sending module, the data packet generating and sending module packages the received version number and the code data into a synchronous code data packet, and the synchronous code data packet is stored in the local code bin and then sent to the code synchronization target equipment for storage, so that the code data are synchronized to the code synchronization target equipment, and the efficient, convenient and time-saving code synchronization device is provided.
Example two:
as shown in fig. 3, an embodiment of the present invention provides a code synchronization system, which includes a computer, a code synchronization apparatus according to the first embodiment, and a first GIT server. In this embodiment, the computer is connected to the first GIT server and the second GIT server, respectively, and the first GIT server is connected to the second GIT server.
Specifically, when the computer performs code synchronization operation, the computer sends user identification information (namely, a user name) and code data to be synchronized to a second GIT server, the second GIT server executes the operation of the code synchronization device according to the received information data to generate a synchronous code data packet, a code bin is arranged in the second GIT server, the generated synchronous code data packet is stored in the code bin and then sent to the synchronous code bin arranged in the first GIT server for storage, and the process of synchronizing the code data to the first GIT server is completed; the technical problems that in the prior art, when a software research and development worker saves and backs up codes, the saved files need to be named, and the size of a storage space of a storage server needs to be considered, so that the whole process is long in time consumption, low in efficiency and complicated in process are solved; an efficient, convenient and time-saving code synchronization system is provided. In this embodiment, the code synchronization operation performed by the computer may be user-triggered, timing-triggered, or real-time synchronization, and different modes may be selected according to the actual needs of the user.
In addition, when the computer cannot acquire the synchronous code data packet stored in the code bin of the second GIT server due to network failure, the computer can access the first GIT server to acquire the synchronous code data packet stored in the synchronous code bin of the first GIT server, so that the code data can be acquired in two ways, and a safe and reliable code synchronization system is provided.
Example three:
referring to fig. 1, the present embodiment provides a code synchronization method, which includes:
s1, acquiring user identification information and code data to be synchronized;
s2, generating version number according to user identification information and code data;
and S3, packaging the version number and the code data into a synchronous code data packet, and sending the synchronous code data packet to the code synchronization target device for storage.
Specifically, the method comprises the following steps:
the generating of the version number of the code data specifically includes:
and after the code data is acquired, automatically generating a version number according to the user identification information, the time information of the acquired code data and the content information of the code data.
The specific steps for acquiring the user identification information and the code data to be synchronized are as follows:
and acquiring the name of the user as user identification information, and acquiring code data to be synchronized of the computer as code data.
In this embodiment, the code synchronization target device is a first GIT server, and the computer may acquire the synchronization code packet after being connected to the first GIT server.
Packaging the version number and the code data into a synchronous code data packet, and sending the synchronous code data packet to a code synchronization target device for storage specifically comprises:
and after the version number is used as the name of the code data packet and the code data is used as the content of the code data packet for packaging, sending the code data packet to the first GIT server for storage.
The implementation process principle of the code synchronization method in this embodiment may be referred to and correspond to the implementation process principle of the code synchronization device described in the first embodiment and the implementation process principle of the code synchronization system described in the second embodiment, and will not be described in detail herein.
In the code synchronization method in the embodiment, after user identification information and code data to be synchronized are obtained and corresponding version numbers are generated according to the user identification information and the code data, the version numbers and the code data are packaged into synchronous code data packets and are sent to code synchronization target equipment for storage; the technical problems that in the prior art, when a software research and development worker saves and backs up codes, the saved files need to be named, and the size of a storage space of a storage server needs to be considered, so that the whole process is long in time consumption, low in efficiency and complicated in process are solved; the code synchronization method is efficient, convenient and time-saving.
In addition, the present invention also provides a code synchronization apparatus, comprising:
at least one processor; and a memory communicatively coupled to the at least one processor;
wherein the processor is adapted to perform the code synchronization method as described in the third embodiment by calling the computer program stored in the memory.
In addition, the present invention also provides a computer-readable storage medium storing computer-executable instructions for causing a computer to execute the code synchronization method according to the third embodiment.
While the preferred embodiments of the present invention have been illustrated and described, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (9)

1. A method of code synchronization, comprising:
acquiring user identification information and code data to be synchronized from a computer;
generating a version number according to the user identification information and the code data;
packaging the version number and the code data into a synchronous code data packet, storing the synchronous code data packet, and sending the synchronous code data packet to code synchronization target equipment for storage;
generating a version number according to the code data specifically includes: after the code data is obtained, automatically generating the version number according to the user identification information, the time information for obtaining the code data and the content information of the code data;
the computer performs code synchronization operation as user trigger, timing trigger or real-time synchronization.
2. The code synchronization method according to claim 1, wherein the acquiring of the user identification information and the code data to be synchronized specifically comprises:
and acquiring the name of a user as the user identification information, and acquiring code data to be synchronized of the computer as the code data.
3. The code synchronization method according to claim 2, wherein the code synchronization target apparatus is a first GIT server; and the computer is connected with the first GIT server and then acquires the synchronous code data packet.
4. The code synchronization method according to claim 3, wherein packaging the version number and the code data into a synchronization code packet, and sending the synchronization code packet to a code synchronization target device for storage specifically comprises:
and after the version number is used as the name of the code data packet and the code data is used as the content of the code data packet for packaging, sending the code data packet to the first GIT server for storage.
5. A code synchronization apparatus, comprising:
the information data acquisition module is used for acquiring user identification information and code data to be synchronized from a computer;
the version number generation module is used for generating a version number according to the user identification information and the code data;
the data packet generating and sending module is used for packaging the version number and the code data into a synchronous code data packet, storing the synchronous code data packet, and sending the synchronous code data packet to code synchronization target equipment for storage;
generating a version number according to the code data specifically includes: after the code data is obtained, automatically generating the version number according to the user identification information, the time information for obtaining the code data and the content information of the code data;
the computer performs code synchronization operation as user trigger, timing trigger or real-time synchronization.
6. A code synchronization system, comprising: the code synchronization apparatus, computer and first GIT server of claim 5, the first GIT server being the synchronization target device;
the computer is connected with the information data acquisition module to send the user identification information and the code data to be synchronized to the information data acquisition module;
the data packet generating and sending module is connected with the first GIT server so as to send the code data packet to the first GIT server;
the computer is connected with the first GIT server so that the computer can acquire the code packet.
7. The code synchronization system according to claim 6, wherein the code synchronization apparatus is a second GIT server; and the second GIT server is used for acquiring the user identification information and the code data, generating the version number according to the user identification information and the code data, packaging the version number and the code data into a synchronous code data packet, and then sending the synchronous code data packet to the first GIT server for storage.
8. A code synchronization apparatus, comprising:
at least one processor; and a memory communicatively coupled to the at least one processor;
wherein the processor is adapted to perform the code synchronization method of any one of claims 1 to 4 by calling a computer program stored in the memory.
9. A computer-readable storage medium storing computer-executable instructions for causing a computer to perform the code synchronization method of any one of claims 1 to 4.
CN201910700610.5A 2019-07-31 2019-07-31 Code synchronization method, device and system Active CN110474970B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910700610.5A CN110474970B (en) 2019-07-31 2019-07-31 Code synchronization method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910700610.5A CN110474970B (en) 2019-07-31 2019-07-31 Code synchronization method, device and system

Publications (2)

Publication Number Publication Date
CN110474970A CN110474970A (en) 2019-11-19
CN110474970B true CN110474970B (en) 2022-03-01

Family

ID=68509715

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910700610.5A Active CN110474970B (en) 2019-07-31 2019-07-31 Code synchronization method, device and system

Country Status (1)

Country Link
CN (1) CN110474970B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110968646B (en) * 2019-12-20 2023-06-06 广东睿住智能科技有限公司 Embedded system database synchronization method, device and storage medium
CN113138769A (en) * 2021-05-17 2021-07-20 上海交通大学 Biological analysis code storage method and device based on cloud storage
CN114221971B (en) * 2021-12-15 2024-04-19 中国建设银行股份有限公司 Data synchronization method, device, server, storage medium and product

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106886445A (en) * 2016-06-23 2017-06-23 阿里巴巴集团控股有限公司 Java packets generation method and equipment and information extracting method and equipment
CN108196915A (en) * 2018-02-06 2018-06-22 杭州朗和科技有限公司 Code process method, equipment and storage medium based on application container engine
CN108256352A (en) * 2018-01-15 2018-07-06 北京安博通科技股份有限公司 A kind of method, apparatus and terminal of web protection feature database automatic packaging
CN108268253A (en) * 2017-05-05 2018-07-10 平安科技(深圳)有限公司 Interface code generation method and terminal device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10599424B2 (en) * 2016-06-15 2020-03-24 Red Hat Israel, Ltd. Committed program-code management

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106886445A (en) * 2016-06-23 2017-06-23 阿里巴巴集团控股有限公司 Java packets generation method and equipment and information extracting method and equipment
CN108268253A (en) * 2017-05-05 2018-07-10 平安科技(深圳)有限公司 Interface code generation method and terminal device
CN108256352A (en) * 2018-01-15 2018-07-06 北京安博通科技股份有限公司 A kind of method, apparatus and terminal of web protection feature database automatic packaging
CN108196915A (en) * 2018-02-06 2018-06-22 杭州朗和科技有限公司 Code process method, equipment and storage medium based on application container engine

Also Published As

Publication number Publication date
CN110474970A (en) 2019-11-19

Similar Documents

Publication Publication Date Title
CN110474970B (en) Code synchronization method, device and system
US20220179682A1 (en) Task processing method, apparatus, and system based on distributed system
CN107306277B (en) Method and device for synchronous capacity expansion of server
US9705730B1 (en) Cloud storage using Merkle trees
CN110096340B (en) Timing task processing method and device
CN104504062A (en) Data synchronization method and device of primary and standby databases
CN104268055A (en) Program exception monitoring method and device
CN104092575A (en) Resource monitoring method and system
CN106325966B (en) Software compilation method and device
CN107798039B (en) Data synchronization method and device
CN103685385A (en) Method, system and device for file synchronization
CN104601366A (en) Configuration service method and device for control and service nodes
CN104317749A (en) Information writing method and device
CN105843707A (en) Quick recovery method and equipment of database
CN109062737A (en) A kind of method of quick backup test data
CN105224358A (en) Under a kind of cloud computing software automatically pack dispose system and method
CN108804109A (en) Industry deployment based on the arbitration of multichannel function equivalence module redundancy and control method
CN104881485A (en) Data synchronizing method and system
CN113806301A (en) Data synchronization method, device, server and storage medium
CN114647700A (en) Data synchronization method and system based on block chain, electronic device and storage medium
CN111367805A (en) Development and debugging method and device
CN111831540A (en) Debugging information processing method, processing device and storage medium
EP3859529A3 (en) Backup management method and system, electronic device and medium
CN116614199B (en) Clock synchronization method, device, slave clock equipment, clock synchronization system and medium
CN112948124A (en) Method, device and equipment for processing accelerated task and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20220602

Address after: 518000 401, building 1, nantaiyun chuanggu Park, Southeast of the intersection of Guangming Avenue and Dongchang Road, Tangwei community, Fenghuang street, Guangming District, Shenzhen City, Guangdong Province

Patentee after: Shenzhen Shenghui Technology Co.,Ltd.

Address before: 518000 room 602, 6 / F, Langfeng building, No. 2 Kefa Road, Yuehai street, Nanshan District, Shenzhen, Guangdong

Patentee before: Ocdop Ltd.

TR01 Transfer of patent right