CN109871231A - A kind of code sharing method and system - Google Patents

A kind of code sharing method and system Download PDF

Info

Publication number
CN109871231A
CN109871231A CN201910037381.3A CN201910037381A CN109871231A CN 109871231 A CN109871231 A CN 109871231A CN 201910037381 A CN201910037381 A CN 201910037381A CN 109871231 A CN109871231 A CN 109871231A
Authority
CN
China
Prior art keywords
code
client
debugging
information
collection
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.)
Granted
Application number
CN201910037381.3A
Other languages
Chinese (zh)
Other versions
CN109871231B (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.)
Wangsu Science and Technology Co Ltd
Original Assignee
Wangsu Science and 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 Wangsu Science and Technology Co Ltd filed Critical Wangsu Science and Technology Co Ltd
Priority to CN201910037381.3A priority Critical patent/CN109871231B/en
Publication of CN109871231A publication Critical patent/CN109871231A/en
Application granted granted Critical
Publication of CN109871231B publication Critical patent/CN109871231B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a kind of code sharing method and system, wherein the described method includes: receiving the code search request that the first client is sent, and to the first client feedback code information;The incremental code added for the code snippet in the code information/code collection that first client is sent is received, and the incremental code is transmitted to the second client;After receiving the confirmation message of the characterization incremental code that second client sends by audit, storage is integrated with code snippet/code collection of the incremental code, and sends the instruction of code information iteration to first client;The code iterative information that first client is sent is received and stored, code snippet/code collection that the code iterative information is used to ensure to be integrated with the incremental code completes debugging and test.Technical solution provided by the present application can be improved the real-time and feasibility of code sharing.

Description

A kind of code sharing method and system
Technical field
The present invention relates to Internet technical field, in particular to a kind of code sharing method and system.
Background technique
With the continuous development of software engineering technology, more and more functions can be realized by way of programming.? In practical application, in different programming projects, it is understood that there may be duplicate function.It is real in order to improve the development efficiency of programming project The code of these existing repeat functions can be shared, to save the energy for rewriting code.
However, usually by programming personnel, release code is needed in forum or group at present when realizing code sharing It asks, then provides corresponding code by other programming personnels.Such mode there is a problem of more, on the one hand, code sharing Real-time and efficiency it is lower, just can not be in time to the volume for having demand if programming personnel active in forum is seldom Cheng personnel provide code.On the other hand, shared code not can guarantee feasibility, and the code that other programming personnels provide may be only It is only applicable in the project of itself, not can guarantee can also operate normally after pulling out code snippet.
Therefore, it is higher that a kind of real-time is needed at present, and the higher code sharing mode of code feasibility.
Summary of the invention
The application's is designed to provide a kind of code sharing method and system, can be improved code sharing real-time and Feasibility.
To achieve the above object, on the one hand the application provides a kind of code sharing method, and the method is total applied to code It enjoys in system, which comprises receive the code search request that the first client is sent, and to first client feedback The code information to match with the keyword in code search request, the code information are uploaded by the second client, and And code snippet/the code collection for completing debugging is included at least in the code information;Receive what first client was sent For the code snippet in the code information/code collection addition incremental code, and the incremental code is transmitted to institute State the second client;Pass through the confirmation message audited when receiving the characterization incremental code that second client is sent Afterwards, storage is integrated with code snippet/code collection of the incremental code, and sends code information to first client and change Generation instruction;The code iterative information that first client is sent is received and stored, the code iterative information is for ensuring to collect Debugging and test are completed at code snippet/code collection of the incremental code.
To achieve the above object, on the other hand the application also provides a kind of code sharing system, the system comprises: code Information feedback unit, for receiving the code search request that the first client sends, and to first client feedback and institute The code information that the keyword in code search request matches is stated, the code information is uploaded by the second client, and institute State the code snippet/code collection for including at least in code information and completing debugging;Incremental code retransmission unit, it is described for receiving The incremental code added for the code snippet in the code information/code collection that first client is sent, and will be described Incremental code is transmitted to second client;Iteration prompt unit, for working as the table for receiving second client and sending After levying confirmation message of the incremental code by audit, storage is integrated with code snippet/code collection of the incremental code, And the instruction of code information iteration is sent to first client;Iterative information storage unit, for receiving and storing described The code iterative information that one client is sent, the code iterative information is for ensuring to be integrated with the code piece of the incremental code Section/code collection completes debugging and test.
Therefore technical solution provided by the present application, code snippet/code collection to be shared can be by programming personnel It is uploaded to code sharing system by client, and the code snippet/code collection for being uploaded to code sharing system has all been At debugging, it thereby may be ensured that code snippet/code collection in code sharing system can be operated normally.In addition, Code sharing system can have code search function.When some programming personnel wants to look up the code for having specific function, Keyword can be provided to code sharing system by client, in this way, code sharing system can be fed back to it in time Corresponding code.It is subsequent, if the programming personnel when using the code of code sharing system feedback, needs to carry out the code Modification, then the incremental code of addition can be sent to the code sharing system by client by the programming personnel, then Incremental code is transmitted to the uploader of the code by code sharing system.By uploader audit incremental code it is errorless after, Incremental code can be integrated in original code.Then, code sharing system can notify the uploader of incremental code to mention For code iterative information, which, which can be used to ensure that, is integrated with code snippet/code set of the incremental code Conjunction can normally complete debugging and test, so that the code being modified in code sharing system also has feasibility.By Above as it can be seen that technical solution provided by the present application, can be improved the real-time and feasibility of code sharing.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent 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.
Fig. 1 is the flow chart of code sharing method in embodiment of the present invention;
Fig. 2 is the operating process schematic diagram of the second client in embodiment of the present invention;
Fig. 3 is code debugging schematic diagram in embodiment of the present invention;
Fig. 4 is the operating process schematic diagram of the first client in embodiment of the present invention;
Fig. 5 is the functional block diagram of code sharing system in embodiment of the present invention.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention Formula is described in further detail.
The application provides a kind of code sharing method, and this method can be applied in code sharing system.In practical application In, the code sharing system can be installed in the terminal device of user by way of software.When terminal device operation should When software, terminal device can be established with code sharing system and be communicated to connect, so as to be counted with code sharing system According to interaction.
Referring to Fig. 1, the code sharing method that one embodiment of the application provides may comprise steps of.
S1: the code search request that the first client is sent is received, and to first client feedback and the code The code information that keyword in searching request matches, the code information are uploaded by the second client, and the code Code snippet/the code collection for completing debugging is included at least in information.
In the present embodiment, programming personnel can be by client to code sharing system upload code.Wherein, described Client can refer to the terminal device that programming personnel uses, and can also be the code sharing run in the terminal device The software program of system.The code can be divided into multiple types according to practical situation.For example, the code can be code Segment can also be the code collection being combined by multiple code snippets.The code collection for example can be SDK (Software Development Kit, Software Development Kit) or API (Application Programming Interface, application programming interfaces).
Referring to Fig. 2, in the present embodiment, it is assumed that code uploader uses the second client, then code is total The system of enjoying can receive initial code segment/code collection that second client uploads, the initial code segment/code set The code that can be without debugging is closed, may not be able to be operated normally.In addition, the second client can also upload institute together Initial code segment/code collection remark information is stated, the remark information can be used for characterizing the initial code segment/generation Code collection closes the function of realizing.
After uploading the initial code segment/code collection and its remark information, in order to guarantee that code can be normal Operation, programming personnel need to complete the debugging process to the initial code of upload in the second client.Specifically, in the generation In code shared system, it can be pre-configured with the code debugging environment on basis, the code debugging environment on the basis can be in the second visitor Family enables in end.In this way, the second client can be in the code debugging environment to the initial code segment/code collection It is debugged.In solving debugging process after some defects for being likely to occur, code snippet after the completion of being debugged/ Code collection.In this case, the code snippet/code collection for completing debugging can be uploaded to code and be total to by the second client It enjoys in system.In this way, code sharing system can use the code snippet/code collection replacement original initial generation for completing debugging Code.
In the present embodiment, the second client is after completion code debugging, in order to further guarantee after completing debugging Code snippet/code collection can preferably suitable for the software project of other users, can for the completion debugging generation Chip segment/code collection configuration test case (Tset Case).The test case can be for a specific target and One group of test data of establishment executes condition and expected result, inputs test data under the conditions of the execution and completes Code snippet/code collection of debugging, available expected result.Certainly, in certain application scenarios, programming personnel may There is no the time to write the test case of code, but can provide for realizing the tutorial message of the test case.The guidance Information for example can be the thinking or scheme for realizing test case.In this way, code sharing system is receiving completion debugging After code snippet/code collection, the code snippet/code for the completion debugging that second client uploads can also be received Gather corresponding test case or the tutorial message for realizing the test case.So far, the second client can be It uploads in code sharing system by debugging, and is equipped with code snippet/code set of test case (or tutorial message) It closes.
In one embodiment, since code snippet/code collection in code sharing system can be made by other users With in use, other users may modify to code snippet/code collection.In consideration of it, the second client exists It can also be code snippet/code collection configuration power of completion debugging when uploading the code snippet/code collection for completing debugging Limit information, the authority information can limit the code snippet/code collection access mode for completing debugging.For example, the access side Formula can be " read-only ", " anyone can modify " or " modification instruction can only be submitted by specific mode " etc..
In addition, correctly searching for code in order to facilitate other users, the second client can also debug for the completion Code snippet/code collection setting keyword, which can be the function realized based on code to set.This Sample, the keyword can be used for searching for the code snippet/code collection for completing debugging in the code sharing system.
In the present embodiment, in code snippet/code collection, remark information, authority information of above-mentioned completion debugging etc. Hold, code information can be integrated into code sharing system, which can be associated with the keyword of configuration.It needs The user for obtaining code can send code search request to code sharing system by the first client, in the code search It may include keyword in request.In this way, code sharing system can be inquired and the keyword by built-in search engine The code information to match, and the code information inquired is fed back into the first client.
S3: the code snippet being directed in the code information/code collection addition that first client is sent is received Incremental code, and the incremental code is transmitted to second client.
In the present embodiment, after the first client receives the code information, can parse code snippet therein/ The contents such as code collection, remark information, authority information.Then, the first client is in order to which the code guaranteed in code information can It operates normally, the code debugging environment in code sharing system can be enabled, and parsing is obtained by code debugging environment Code is debugged.In practical applications, in order not to indefinitely occupy the code debugging environment in code sharing system, first When enabling the code debugging environment in code sharing system, the debugging that the code debugging environment can be arranged together has client The effect phase.The time limit using code debugging environment that the user that the debugging validity period can be the first client estimates, and code A upper limit value can be arranged in shared system for debugging validity period, and the debugging validity period of the first client setting can not be more than should Upper limit value.In this way, may be used also after code sharing system enables preconfigured code debugging environment in first client To receive the debugging validity period that first client is code debugging environment setting.Then, code sharing system can be with Code snippet/code collection in the code information is debugged using the code debugging environment, is up to when debugging To after the debugging validity period, the code debugging environment is just automatically closed, to give the code debugging Environment release to other User uses.
In one embodiment, it if wanting the code debugging environment in normal use code sharing system, needs Before enabling code debugging environment, the corresponding some preposition services of the code debugging environment are enabled in advance.That is, code sharing System can inquire the corresponding preposition service of the code debugging environment to be enabled, and enable the preposition service.It is enabling After these preposition services, the code debugging environment can be normally enabled in the first client.
Referring to Fig. 3, in one embodiment, the first client is in the code debugging environment by enabling to parsing To code snippet/code collection debugged when, for the code of SDK API type, need to key in some be used for The analog parameter of debugging obtains when these analog parameters can make SDK or API be debugged in code debugging environment Expected result.That is, code sharing system can receive the incoming analog parameter of first client, and it is based on institute Analog parameter is stated to debug the code snippet/code collection in the code debugging environment, then, code sharing system System can be to first client feedback debugging result compatible with the analog parameter.If the debugging result meets expection As a result, so then indicating that debugging passes through.And if not meeting expected results, indicate that debugging does not pass through, at this time the first visitor Family end can debug the prompt information of error to code sharing system feedback, which can be by code sharing system forwards To the second client, and complete by the second client the debugging process of upload code.
Referring to Fig. 4, in one embodiment, after the code snippet that parsing obtains/code collection completes debugging, the Code snippet/the code collection can be integrated in the system of itself building by one client.Specifically, first client The unit testing use-case of the code snippet/code collection and the code snippet/code collection can be integrated to described In the system currently constructed in first client.In addition, first client is also based in the code information and parses Obtained test case or tutorial message, by the automatic test information integration of the code snippet/code collection to described In the system currently constructed in first client.For example, the first client is constructing a search engine system at present, then the One client can get the corresponding code snippet of function of search from code sharing system, by completing to the code snippet It, can should according to the corresponding unit testing use-case of the code snippet and automatic test cases (or tutorial message) after debugging Code snippet is integrated in the search engine system of building, to eliminate the time that exploitation has the code of function of search.
In the present embodiment, after the code snippet that parsing obtains/code collection completes debugging, the use of the first client It family can be for the code snippet/code collection addition incremental code for completing debugging, so that the incremental code by addition is real Now additional function.The incremental code of addition can be sent to code sharing system by the first client, and by code sharing system The incremental code is forwarded at the second client of uploader of source code by system, and audits the increasing by the user of the second client Whether amount code can be incorporated into source code.
In practical applications, the first client can be by way of pullrequest (pulling request) to the second client End request merges incremental code.It specifically, can be in code sharing system when the second client needs to add incremental code Code branch is created, and adds incremental code for the code snippet/code collection in the code branch.Then, One client can send the branch merging request pullrequest for carrying the incremental code, code to code sharing system Shared system, can be by this point after the branch for receiving the carrying incremental code that first client is sent merges request Branch merges request and is transmitted to the second client.In this way, the second client can extract incremental code from the request, and carry out Audit.Certainly, after code sharing system can also extract the incremental code from branch merging request, by the institute of extraction It states incremental code and is transmitted to second client and audited.
S5: after receiving the confirmation message of the characterization incremental code that second client sends by audit, Storage is integrated with code snippet/code collection of the incremental code, and sends code information iteration to first client Instruction.
It in the present embodiment, can be to code sharing system after the second client completes audit for incremental code Feedback characterizes the incremental code and passes through the confirmation message of audit.After code sharing system receives the confirmation message, It is integrated with code snippet/code collection of the incremental code with storage, and sends code information to first client and changes Generation instruction.The code information iteration instruction can indicate that incremental code has passed through audit.First client is receiving this After the instruction of code information iteration, need to carry out the code snippet/code collection every terms of information for being integrated with the incremental code It updates.For example, the first client needs the functional circuit information of more fresh code.Due to being added to incremental code, after modification Code have some new functions.At this point, the first client can be to code sharing system sending function more new information, the function Can more new information can be used for describe be integrated with the function that code snippet/code collection of the incremental code is realized.
S7: the code iterative information that first client is sent is received and stored, the code iterative information is for true It protects and is integrated with the code snippet/code collection completion debugging and test of the incremental code.
In the present embodiment, the first client, which also needs to be directed to, is integrated with code snippet/code of the incremental code Set is debugged.Specific debugging process is consistent with the second client debugging process of source code, just repeats no more here.
After completion code debugging, the first client can also further provide the automatic test cases of fresh code Or the tutorial message for realizing automatic test cases.Then, the first client can send generation to code sharing system Code iterative information may include the notice that debugging is completed in the code iterative information, can also include the automation of above-mentioned offer Test case or tutorial message.In this way, the code iterative information can be used to ensure that and be integrated with the generation of the incremental code Chip segment/code collection can smoothly complete debugging and test.Code sharing system after receiving the function renewal information, Can more fresh code version identifier.Specifically, the source code that the second client uploads can have initial version mark, generation Code shared system can update the initial version mark after receiving the code iterative information of the first client feedback, and Updated version identifier is distributed to and is integrated with code snippet/code collection of the incremental code.For example, code sharing system System can be on the basis of initial version identifies plus 1, and the mark after adding 1 is distributed to and is integrated with the code of the incremental code Segment/code collection.In this way, can have code snippet/code collection of each version in code sharing system, and And code snippet/code collection of each version can have respective version identifier, so that other users are according to the need of itself It asks and is selected.
In one embodiment, the source code collection uploaded the second client before some other clients At into the system of itself, then after the first client provides incremental code, code sharing system can be to currently just The other clients of the code snippet/code collection for including in using the code information send code update prompt information, So that other clients are updated to the currently used code snippet/code collection to be integrated with the incremental code Code snippet/code collection.Certainly, other clients can be updated source code according to actual demand, can also be with Without updating, the application is to this and without limitation.
Referring to Fig. 5, the application also provides a kind of code sharing system, the system comprises:
Code information feedback unit, the code search request sent for receiving the first client, and it is objective to described first The code information that family end feedback matches with the keyword in code search request, the code information is by the second client It uploads, and includes at least the code snippet/code collection for completing debugging in the code information;
Incremental code retransmission unit, the code being directed in the code information sent for receiving first client Segment/code collection addition incremental code, and the incremental code is transmitted to second client;
Iteration prompt unit passes through audit for that ought receive the characterization incremental code that second client is sent Confirmation message after, storage is integrated with code snippet/code collection of the incremental code, and sends to first client The instruction of code information iteration;
Iterative information storage unit, the code iterative information sent for receiving and storing first client are described Code snippet/code collection that code iterative information is used to ensure to be integrated with the incremental code completes debugging and test.
In one embodiment, the code information feedback unit includes:
Initial code receiving module, the initial code segment/code collection uploaded for receiving second client, with And the remark information of the initial code segment/code collection, the remark information is for characterizing the initial code segment/generation Code collection closes the function of realizing;
Debugging enables module, for enabling preconfigured code debugging environment in second client, and in institute It states in code debugging environment and debugging is completed to the initial code segment/code collection;
Information receiving module is tested, for receiving the code snippet/code for the completion debugging that second client uploads Set and the corresponding test case of code snippet/code collection for completing debugging are used for realizing the test The tutorial message of example.
In one embodiment, the code information feedback unit further include:
Authority information receiving module, the authority information uploaded for receiving second client, the authority information are used In the code snippet/code collection access mode for limiting the completion debugging;
Keyword receiving module is the code snippet/code set for completing debugging for receiving second client Close setting keyword, the keyword be used for searched in the code sharing system it is described complete debugging code snippet/ Code collection.
In one embodiment, the system also includes:
Start unit is debugged, for enabling preconfigured code debugging environment in first client, and is received First client is the debugging validity period of code debugging environment setting;
Code debugging unit, for utilizing the code debugging environment to code snippet/code in the code information Set is debugged, and after debugging duration reaches the debugging validity period, closes the code debugging environment.
In one embodiment, the debugging start unit includes:
Preposition service enables module, for inquiring the corresponding preposition service of the code debugging environment to be enabled, and opens With the preposition service;
Debugging enironment enables module, for enabling institute in first client after enabling the preposition service State code debugging environment.
In one embodiment, the code debugging unit includes:
Analog parameter receiving module for receiving the incoming analog parameter of first client, and is based on the simulation Parameter debugs the code snippet/code collection in the code debugging environment;
Debugging result feedback module, for being tied to first client feedback debugging compatible with the analog parameter Fruit.
In one embodiment, the incremental code retransmission unit includes:
Branch merges request receiving module, for creating code branch when first client, and in the code point After adding incremental code for the code snippet/code collection in branch, the carrying institute that first client is sent is received The branch for stating incremental code merges request;
Code extraction module extracts the incremental code for merging in request from the branch, and will be described in extraction Incremental code is transmitted to second client.
In one embodiment, the system also includes:
Function renewal information memory cell, the function renewal information uploaded for receiving and storing first client, The function renewal information is for describing to be integrated with the function that code snippet/code collection of the incremental code is realized.
In one embodiment, the system also includes:
Prompt unit is updated, for the code snippet/code collection for including in the code information is being currently used Other clients send code update prompt information so that other clients are by the currently used code piece Section/code collection is updated to be integrated with code snippet/code collection of the incremental code.
It should be noted that the code sharing system in this specification, concrete implementation mode is referred to method implementation The description of mode, does not repeat one by one herein.
In practical applications, the code sharing system can have user interface in the client.User behaviour Make the various functions that code sharing system can be shown in interface.For example, code search function, code release iteration can be shown Query function, code debugging environmental management function, message informing management function, automatic test management function, code audit function Energy, code permission control function, keyword managing function and online chatting function etc..Wherein, code release iterative query function Can inquire respectively code snippet, SDK and API these three types code each version.
Therefore technical solution provided by the present application, code snippet/code collection to be shared can be by programming personnel It is uploaded to code sharing system by client, and the code snippet/code collection for being uploaded to code sharing system has all been At debugging, it thereby may be ensured that code snippet/code collection in code sharing system can be operated normally.In addition, Code sharing system can have code search function.When some programming personnel wants to look up the code for having specific function, Keyword can be provided to code sharing system by client, in this way, code sharing system can be fed back to it in time Corresponding code.It is subsequent, if the programming personnel when using the code of code sharing system feedback, needs to carry out the code Modification, then the incremental code of addition can be sent to the code sharing system by client by the programming personnel, then Incremental code is transmitted to the uploader of the code by code sharing system.By uploader audit incremental code it is errorless after, Incremental code can be integrated in original code.Then, code sharing system can notify the uploader of incremental code to mention For code iterative information, which, which can be used to ensure that, is integrated with code snippet/code set of the incremental code Conjunction can normally complete debugging and test, so that the code being modified in code sharing system also has feasibility.By Above as it can be seen that technical solution provided by the present application, can be improved the real-time and feasibility of code sharing.
Through the above description of the embodiments, those skilled in the art can be understood that each embodiment can It realizes by means of software and necessary general hardware platform, naturally it is also possible to be realized by hardware.Based on such Understand, substantially the part that contributes to existing technology can embody above-mentioned technical proposal in the form of software products in other words Out, which may be stored in a computer readable storage medium, such as ROM/RAM, magnetic disk, CD, packet Some instructions are included to use so that a computer equipment (can be personal computer, server or the network equipment etc.) executes Method described in certain parts of each embodiment or embodiment.
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.

Claims (21)

1. a kind of code sharing method, which is characterized in that the method is applied in code sharing system, which comprises
The code search request that the first client is sent is received, and is requested to first client feedback and the code search In the code information that matches of keyword, the code information uploads by the second client, and in the code information extremely Few includes the code snippet/code collection for completing debugging;
Receive the increment generation added for the code snippet in the code information/code collection that first client is sent Code, and the incremental code is transmitted to second client;
After receiving the confirmation message of the characterization incremental code that second client sends by audit, storage is integrated Code snippet/code collection of the incremental code, and the instruction of code information iteration is sent to first client;
The code iterative information that first client is sent is received and stored, the code iterative information is for ensuring to be integrated with The code snippet of the incremental code/code collection completes debugging and test.
2. the method according to claim 1, wherein the code information is uploaded to the generation in the following way Code shared system:
Receive initial code segment/code collection and initial code segment/code set that second client uploads The remark information of conjunction, the remark information are used to characterize the function that the initial code segment/code collection is realized;
Preconfigured code debugging environment is enabled in second client, and to described in the code debugging environment Initial code segment/code collection completes debugging;
Receive the code snippet/code collection for the completion debugging that second client uploads and the generation of the completion debugging The corresponding test case of chip segment/code collection or tutorial message for realizing the test case.
3. according to the method described in claim 2, it is characterized in that, the method also includes:
The authority information that second client uploads is received, the authority information is used to limit the code piece for completing debugging The access mode of section/code collection;
Receiving second client is the code snippet for completing debugging/code collection setting keyword, the key Word is used to search for the code snippet/code collection for completing debugging in the code sharing system.
4. the method according to claim 1, wherein to first client feedback and the code search After the code information that keyword in request matches, the method also includes:
Preconfigured code debugging environment is enabled in first client, and receiving first client is the generation The debugging validity period of code debugging enironment setting;
Code snippet/code collection in the code information is debugged using the code debugging environment, when debugging After length reaches the debugging validity period, the code debugging environment is closed.
5. according to the method described in claim 4, it is characterized in that, enabling preconfigured code in first client Debugging enironment includes:
The corresponding preposition service of the code debugging environment to be enabled is inquired, and enables the preposition service;
After enabling the preposition service, the code debugging environment is enabled in first client.
6. method according to claim 4 or 5, which is characterized in that believed using the code debugging environment the code Code snippet/code collection in breath carries out debugging
The incoming analog parameter of first client is received, and right in the code debugging environment based on the analog parameter Code snippet/the code collection is debugged;
To first client feedback debugging result compatible with the analog parameter.
7. the method according to claim 1, wherein to first client feedback and the code search After the code information that keyword in request matches, the method also includes:
First client is by the unit testing of the code snippet/code collection and the code snippet/code collection Use-case is integrated in the system currently constructed in first client.
8. the method according to the description of claim 7 is characterized in that further including the code snippet/generation in the code information Code collection closes corresponding test case or the tutorial message for realizing the test case;
Correspondingly, the method also includes:
First client is based on the test case or the tutorial message, by the code snippet/code collection In the system currently constructed in automatic test information integration to first client.
9. the method according to claim 1, wherein receive that first client sends for the code Code snippet in information/code collection addition incremental code includes:
When first client creation code branch, and the code snippet/code collection is directed in the code branch After adding incremental code, the branch for receiving the carrying incremental code that first client is sent merges request;
Correspondingly, the incremental code is transmitted to second client includes:
Merge in request from the branch and extract the incremental code, and the incremental code of extraction is transmitted to described second Client.
10. the method according to claim 1, wherein sending code information iteration to first client After instruction, the method also includes:
The function renewal information that first client uploads is received and stored, the function renewal information is integrated with for describing The function that code snippet/code collection of the incremental code is realized.
11. the method according to claim 1, wherein code snippet/code collection tool in the code information Standby initial version identifies;Correspondingly, after receiving and storing the code iterative information that first client is sent, the side Method further include:
The initial version mark is updated, and updated version identifier is distributed to and is integrated with the code piece of the incremental code Section/code collection.
12. the method according to claim 1, wherein in the generation for receiving and storing first client and sending After code iterative information, the method also includes:
Code is sent more to the other clients of code snippet/code collection for including in the code information are being currently used New prompt information, so that the currently used code snippet/code collection is updated to be integrated with by other clients Code snippet/code collection of the incremental code.
13. a kind of code sharing system, which is characterized in that the system comprises:
Code information feedback unit, for receiving the code search request that the first client sends, and to first client The code information that feedback matches with the keyword in code search request, the code information is by the second client It passes, and includes at least the code snippet/code collection for completing debugging in the code information;
Incremental code retransmission unit, the code piece being directed in the code information sent for receiving first client The incremental code of section/code collection addition, and the incremental code is transmitted to second client;
Iteration prompt unit passes through audit really for that ought receive the characterization incremental code that second client is sent After recognizing information, storage is integrated with code snippet/code collection of the incremental code, and sends code to first client Information iteration instruction;
Iterative information storage unit, the code iterative information sent for receiving and storing first client, the code Code snippet/code collection that iterative information is used to ensure to be integrated with the incremental code completes debugging and test.
14. system according to claim 13, which is characterized in that the code information feedback unit includes:
Initial code receiving module, the initial code segment/code collection uploaded for receiving second client, Yi Jisuo Initial code segment/code collection remark information is stated, the remark information is for characterizing the initial code segment/code set Close the function of realizing;
Debugging enables module, for enabling preconfigured code debugging environment in second client, and in the generation Debugging is completed to the initial code segment/code collection in code debugging enironment;
Information receiving module is tested, for receiving the code snippet/code collection for the completion debugging that second client uploads, And the corresponding test case of code snippet/code collection for completing debugging or finger for realizing the test case Lead information.
15. system according to claim 14, which is characterized in that the code information feedback unit further include:
Authority information receiving module, the authority information uploaded for receiving second client, the authority information is for limiting Fixed code snippet/code collection the access mode for completing debugging;
Keyword receiving module is that the code snippet/code collection for completing debugging is set for receiving second client The keyword set, the keyword are used to search for the code snippet/code for completing debugging in the code sharing system Set.
16. system according to claim 13, which is characterized in that the system also includes:
Start unit is debugged, for enabling preconfigured code debugging environment in first client, and described in reception First client is the debugging validity period of code debugging environment setting;
Code debugging unit, for utilizing the code debugging environment to code snippet/code collection in the code information It is debugged, after debugging duration reaches the debugging validity period, closes the code debugging environment.
17. system according to claim 16, which is characterized in that the debugging start unit includes:
Preposition service enables module, for inquiring the corresponding preposition service of the code debugging environment to be enabled, and enables institute State preposition service;
Debugging enironment enables module, for enabling the generation in first client after enabling the preposition service Code debugging enironment.
18. system according to claim 16 or 17, which is characterized in that the code debugging unit includes:
Analog parameter receiving module for receiving the incoming analog parameter of first client, and is based on the analog parameter Code snippet/the code collection is debugged in the code debugging environment;
Debugging result feedback module is used for first client feedback debugging result compatible with the analog parameter.
19. system according to claim 13, which is characterized in that the incremental code retransmission unit includes:
Branch merges request receiving module, for creating code branch when first client, and in the code branch After the code snippet/code collection addition incremental code, the carrying increasing that first client is sent is received The branch for measuring code merges request;
Code extraction module extracts the incremental code for merging in request from the branch, and by the increment of extraction Code is transmitted to second client.
20. system according to claim 13, which is characterized in that the system also includes:
Function renewal information memory cell, the function renewal information uploaded for receiving and storing first client are described Function renewal information is for describing to be integrated with the function that code snippet/code collection of the incremental code is realized.
21. system according to claim 13, which is characterized in that the system also includes:
Update prompt unit, for be being currently used the code snippet/code collection for including in the code information its Its client sends code update prompt information, so that other clients are by the currently used code snippet/generation Code collection conjunction is updated to be integrated with code snippet/code collection of the incremental code.
CN201910037381.3A 2019-01-15 2019-01-15 Code sharing method and system Expired - Fee Related CN109871231B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910037381.3A CN109871231B (en) 2019-01-15 2019-01-15 Code sharing method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910037381.3A CN109871231B (en) 2019-01-15 2019-01-15 Code sharing method and system

Publications (2)

Publication Number Publication Date
CN109871231A true CN109871231A (en) 2019-06-11
CN109871231B CN109871231B (en) 2022-09-30

Family

ID=66917684

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910037381.3A Expired - Fee Related CN109871231B (en) 2019-01-15 2019-01-15 Code sharing method and system

Country Status (1)

Country Link
CN (1) CN109871231B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102520959A (en) * 2011-12-16 2012-06-27 西安邮电学院 Reused code matching inquiry method based on meaning
CN104881285A (en) * 2015-05-25 2015-09-02 北京理工大学 Code snippet marking and reusing system based on body
CN105867990A (en) * 2015-11-20 2016-08-17 乐视云计算有限公司 Software development integration method and device thereof
CN107688464A (en) * 2017-06-28 2018-02-13 上海壹账通金融科技有限公司 Software customized server, method and computer-readable recording medium
US20180137032A1 (en) * 2016-11-11 2018-05-17 Atlassian Pty Ltd Systems and methods for testing source code

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102520959A (en) * 2011-12-16 2012-06-27 西安邮电学院 Reused code matching inquiry method based on meaning
CN104881285A (en) * 2015-05-25 2015-09-02 北京理工大学 Code snippet marking and reusing system based on body
CN105867990A (en) * 2015-11-20 2016-08-17 乐视云计算有限公司 Software development integration method and device thereof
US20180137032A1 (en) * 2016-11-11 2018-05-17 Atlassian Pty Ltd Systems and methods for testing source code
CN107688464A (en) * 2017-06-28 2018-02-13 上海壹账通金融科技有限公司 Software customized server, method and computer-readable recording medium

Also Published As

Publication number Publication date
CN109871231B (en) 2022-09-30

Similar Documents

Publication Publication Date Title
CN108400909B (en) Traffic statistical method, device, terminal equipment and storage medium
CN105335293A (en) Automatic testing system and method based on parallel ports
WO2011011913A1 (en) Method and device for auto-generating goose signal connection topology from substation level
CN105426165A (en) Script tool processing method and apparatus
CN103843308A (en) Execution of applications distributed across a plurality of computing devices
CN106155812A (en) Method, device, system and the electronic equipment of a kind of resource management to fictitious host computer
WO2014049804A1 (en) System operation trace method in distributed system
CN104281520A (en) Tracking and debugging method, device and system
CN107113199B (en) Analysis device for analyzing and processing communication sequences
CN114025027B (en) Method and device for running data transmission script, storage medium and electronic device
CN109871231A (en) A kind of code sharing method and system
CN103457957B (en) A kind of network penetration test macro and method with adaptation function
Bogdoll et al. mctau: Bridging the gap between Modest and UPPAAL
CN104462235A (en) Internet of Things general event service mechanism based on Restful Web Service
CN104468788A (en) Multi-net and multi-terminal data synchronization method
CN112711518B (en) Log uploading method and device
Wu et al. Formal modeling and analysis of the REST architecture using CSP
Vlaovič et al. Applying automated model extraction for simulation and verification of real-life SDL specification with Spin
CN103024667B (en) The method of reporting information and device
Olsen et al. Prototype of generic server for wind power plants using IEC 61400-25 standard
Admodisastro et al. An architecture analysis approach for supporting black-box software development
CN101145953B (en) Method and system for dynamic debugging of network device management software
Söderbacka The GOOSE protocol
Huang et al. User-Driven Smart Home Control System Based on Named Data Networking
Tran Jr Integrate AWS IoT Core and Device Shadow in embedded instrument

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
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20220930